diff --git a/.gibot.yml b/.gibot.yml index 194d376713..b3a565a5e4 100644 --- a/.gibot.yml +++ b/.gibot.yml @@ -2,13 +2,13 @@ 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 + - status/accepting-pr 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 is in error, please reply with the requested information.' @@ -17,11 +17,11 @@ stages: 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 +31,26 @@ 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: 160 + days: 365 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 + - status/accepting-pr 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 a333dc08fe..b56ddb134a 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -22,4 +22,4 @@ **RPT log file:** - Add a link ([gist](https://gist.github.com) or [pastebin](http://pastebin.com)) to the client and/or server RPT file. An instruction to find your RPT files can be found [here](https://community.bistudio.com/wiki/Crash_Files#Arma_3). -- If possible at the time the bug is encountered, go to ACE Options and select "Debug To Clipboard", this will print extensive debug information to the RPT file. +- If possible at the time the bug is encountered, go to Options and select "ACE Debug To Clipboard", this will print extensive debug information to the RPT file and copy it to clipboard. 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 dcf94277cc..ba89a97abc 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 # @@ -38,7 +38,11 @@ Aggr094 alef Aleksey EpMAK Yermakov Alganthe +Andrea "AtixNeon" Verano Anthariel +Arcanum417 +Anton +Arcanum417 Arkhir Asgar Serran BaerMitUmlaut @@ -50,6 +54,8 @@ Brakoviejo Brisse Brostrom.A | Evul BullHorn +chris579 +classicarma Clon1998 Codingboy Coren @@ -60,6 +66,7 @@ dixon13 Drill Dudakov aka [OMCB]Kaban Dslyecxi +ElTyranos eRazeri evromalarkey F3 Project @@ -83,8 +90,11 @@ Harakhti havena Hawkins Head +Hybrid V +john681611 Karneck Kavinsky +Keithen Kllrt legman Legolasindar "Viper" @@ -102,8 +112,10 @@ nomisum OnkelDisMaster oscarmolinadev PaxJaromeMalues +Phyma pokertour Professor +QuickDagger rakowozz ramius86 Raspu86 @@ -120,8 +132,11 @@ Tessa Elieff Toaster Tonic Tourorist +Tuupertunut Valentin Torikian voiper VyMajoris(W-Cephei) Winter +xrufix +Zakant zGuba diff --git a/README.md b/README.md index 733af4eaed..bfe05bdd4f 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 09b93a543f..f5686a5a3f 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 index e2dae5caab..f1802ce5e8 100644 Binary files a/ace_advanced_ballistics_x64.dll and b/ace_advanced_ballistics_x64.dll differ diff --git a/addons/advanced_ballistics/ACE_Settings.hpp b/addons/advanced_ballistics/ACE_Settings.hpp index 0c2265619a..c25592eb5d 100644 --- a/addons/advanced_ballistics/ACE_Settings.hpp +++ b/addons/advanced_ballistics/ACE_Settings.hpp @@ -6,43 +6,13 @@ class ACE_Settings { typeName = "BOOL"; value = 0; }; - class GVAR(simulateForSnipers) { + class GVAR(muzzleVelocityVariationEnabled) { category = CSTRING(DisplayName); - displayName = CSTRING(simulateForSnipers_DisplayName); - description = CSTRING(simulateForSnipers_Description); + displayName = CSTRING(muzzleVelocityVariationEnabled_DisplayName); + description = CSTRING(muzzleVelocityVariationEnabled_Description); typeName = "BOOL"; value = 1; - }; - class GVAR(simulateForGroupMembers) { - category = CSTRING(DisplayName); - displayName = CSTRING(simulateForGroupMembers_DisplayName); - description = CSTRING(simulateForGroupMembers_Description); - typeName = "BOOL"; - value = 0; - }; - class GVAR(simulateForEveryone) { - category = CSTRING(DisplayName); - displayName = CSTRING(simulateForEveryone_DisplayName); - description = CSTRING(simulateForEveryone_Description); - typeName = "BOOL"; - value = 0; - }; - class GVAR(disabledInFullAutoMode) { - category = CSTRING(DisplayName); - displayName = CSTRING(disabledInFullAutoMod_DisplayName); - description = CSTRING(disabledInFullAutoMod_Description); - typeName = "BOOL"; - value = 0; - }; - /* // TODO: We currently do not have firedEHs on vehicles - class GVAR(vehicleGunnerEnabled) { - category = CSTRING(DisplayName); - displayName = "Enabled For Vehicle Gunners"; - description = "Enables advanced ballistics for vehicle gunners"; - typeName = "BOOL"; - value = 0; - }; - */ + }; class GVAR(ammoTemperatureEnabled) { category = CSTRING(DisplayName); displayName = CSTRING(ammoTemperatureEnabled_DisplayName); @@ -70,12 +40,6 @@ class ACE_Settings { description = CSTRING(simulationInterval_Description); typeName = "SCALAR"; value = 0.05; - }; - class GVAR(simulationRadius) { - category = CSTRING(DisplayName); - displayName = CSTRING(simulationRadius_DisplayName); - description = CSTRING(simulationRadius_Description); - typeName = "SCALAR"; - value = 3000; + sliderSettings[] = {0, 0.2, 0.05, 2}; }; }; diff --git a/addons/advanced_ballistics/CfgVehicles.hpp b/addons/advanced_ballistics/CfgVehicles.hpp index 151972ea02..c3a2650150 100644 --- a/addons/advanced_ballistics/CfgVehicles.hpp +++ b/addons/advanced_ballistics/CfgVehicles.hpp @@ -1,7 +1,7 @@ class CfgVehicles { class ACE_Module; class GVAR(ModuleSettings): ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(DisplayName); icon = QPATHTOF(UI\Icon_Module_Wind_ca.paa); category = "ACE"; @@ -17,38 +17,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 0; }; - class simulateForSnipers { - displayName = CSTRING(simulateForSnipers_DisplayName); - description = CSTRING(simulateForSnipers_Description); + class muzzleVelocityVariationEnabled { + displayName = CSTRING(muzzleVelocityVariationEnabled_DisplayName); + description = CSTRING(muzzleVelocityVariationEnabled_Description); typeName = "BOOL"; defaultValue = 1; }; - class simulateForGroupMembers { - displayName = CSTRING(simulateForGroupMembers_DisplayName); - description = CSTRING(simulateForGroupMembers_Description); - typeName = "BOOL"; - defaultValue = 0; - }; - class simulateForEveryone { - displayName = CSTRING(simulateForEveryone_DisplayName); - description = CSTRING(simulateForEveryone_Description); - typeName = "BOOL"; - defaultValue = 0; - }; - class disabledInFullAutoMode { - displayName = CSTRING(disabledInFullAutoMod_DisplayName); - description = CSTRING(disabledInFullAutoMod_Description); - typeName = "BOOL"; - defaultValue = 0; - }; - /* // TODO: We currently do not have firedEHs on vehicles - class vehicleGunnerEnabled { - displayName = "Enabled For Vehicle Gunners"; - description = "Enables advanced ballistics for vehicle gunners"; - typeName = "BOOL"; - defaultValue = 0; - }; - */ class ammoTemperatureEnabled { displayName = CSTRING(ammoTemperatureEnabled_DisplayName); description = CSTRING(ammoTemperatureEnabled_Description); @@ -73,15 +47,9 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 0.05; }; - class simulationRadius { - displayName = CSTRING(simulationRadius_DisplayName); - description = CSTRING(simulationRadius_Description); - typeName = "NUMBER"; - defaultValue = 3000; - }; }; class ModuleDescription { description = CSTRING(Description); }; }; -}; \ No newline at end of file +}; diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index d60feb8311..1e0e6860da 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -9,19 +9,6 @@ GVAR(ProtractorStart) = CBA_missionTime; GVAR(allBullets) = []; GVAR(currentGrid) = 0; -GVAR(extensionAvailable) = true; -/* @TODO: Remove this until versioning is in sync with cmake/build versioning -GVAR(extensionVersion) = ("ace_advanced_ballistics" callExtension "version"); -GVAR(extensionAvailable) = (GVAR(extensionVersion) == EXTENSION_REQUIRED_VERSION); -if (!GVAR(extensionAvailable)) exitWith { - if (GVAR(extensionVersion) == "") then { - diag_log text "[ACE] ERROR: ace_advanced_ballistics.dll is missing"; - } else { - diag_log text "[ACE] ERROR: ace_advanced_ballistics.dll is incompatible"; - }; -}; -*/ - if (!hasInterface) exitWith {}; ["ace_settingsInitialized", { @@ -54,4 +41,4 @@ if (!hasInterface) exitWith {}; #ifdef DEBUG_MODE_FULL call FUNC(diagnoseWeapons); -#endif \ No newline at end of file +#endif diff --git a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf index 19cd55c98e..d988d5f8ed 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf @@ -10,26 +10,25 @@ * Return Value: * muzzle velocity shift - m/s * + * Example: + * [[], 5] call ace_advanced_ballistics_fnc_calcilateAmmoTemperatureVelocityShift + * * Public: No */ #include "script_component.hpp" params ["_muzzleVelocityShiftTable", "_temperature"]; -// Check if muzzleVelocityShiftTable is Less Than 11 Entrys +// Check if muzzleVelocityShiftTable is less than 11 Entrys if ((count _muzzleVelocityShiftTable) < 11) exitWith {0}; private _muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10; -if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 }; +if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith {0}; // Find exact data index required for given temperature -private _temperatureIndexFunction = (_temperature + 15) / 5; +private _temperatureIndexFunction = 0 max ((_temperature + 15) / 5) min 10; -// lower and upper data index used for interpolation -private _temperatureIndexA = (0 max (floor(_temperatureIndexFunction))) min 10; -private _temperatureIndexB = (0 max (ceil(_temperatureIndexFunction))) min 10; +// Lower and upper data index used for interpolation +private _temperatureIndexA = floor(_temperatureIndexFunction); +private _temperatureIndexB = ceil(_temperatureIndexFunction); -// Interpolation ratio -private _interpolationRatio = _temperatureIndexFunction - floor(_temperatureIndexFunction); - -// Interpolation -(_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _interpolationRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _interpolationRatio // Return +linearConversion [_temperatureIndexA, _temperatureIndexB, _temperatureIndexFunction, _muzzleVelocityShiftTable select _temperatureIndexA, _muzzleVelocityShiftTable select _temperatureIndexB, true] // Return 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..4c5cd47a29 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,26 +12,24 @@ * 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 }; +if (_muzzleVelocityTableCount != _barrelLengthTableCount || _muzzleVelocityTableCount == 0) exitWith { 0 }; if (_muzzleVelocityTableCount == 1) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity }; // If we have the precise barrel length value, return result immediately @@ -43,29 +41,15 @@ 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 = 0; +private _lowerDataIndex = 1; + // Find closest bordering values for barrel length { - if (_barrelLength <= _x) then { + if (_barrelLength <= _x) exitWith { _upperDataIndex = _forEachIndex; _lowerDataIndex = _upperDataIndex - 1; - breakTo "main"; }; } forEach _barrelLengthTable; -// Worst case scenario -if (isNil "_lowerDataIndex" || isNil "_upperDataIndex") exitWith {0}; - -_lowerBarrelLength = _barrelLengthTable select _lowerDataIndex; -_upperBarrelLength = _barrelLengthTable select _upperDataIndex; -_lowerMuzzleVelocity = _muzzleVelocityTable select _lowerDataIndex; -_upperMuzzleVelocity = _muzzleVelocityTable select _upperDataIndex; - -// Calculate interpolation ratio -_interpolationRatio = if (abs (_lowerBarrelLength - _upperBarrelLength) > 0) then { - (_upperBarrelLength - _barrelLength) / (_upperBarrelLength - _lowerBarrelLength) -} else { - 0 -}; - -// Calculate interpolated muzzle velocity shift -(_lowerMuzzleVelocity + ((_upperMuzzleVelocity - _lowerMuzzleVelocity) * (1 - _interpolationRatio))) - _muzzleVelocity // Return +(linearConversion [_barrelLengthTable select _lowerDataIndex, _barrelLengthTable select _upperDataIndex, _barrelLength, _muzzleVelocityTable select _lowerDataIndex, _muzzleVelocityTable select _upperDataIndex]) - _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..4c929ac22d 100644 --- a/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf +++ b/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf @@ -10,19 +10,31 @@ * Return Value: * None * + * Example: + * [] call ace_advanced_ballistics_fnc_diagnoseWeapons + * * Public: No */ #define DEBUG_MODE_FULL #include "script_component.hpp" +private _diagnoseStartTime = diag_tickTime; +#ifdef DEBUG_INIT_SPEEDS + private _data = []; + private _weapons = []; + private _magazines = []; + private _weaponInitSpeeds = []; + private _magazineInitSpeeds = []; +#endif + private _cfgWeapons = configFile >> "CfgWeapons"; for "_i" from 0 to (count _cfgWeapons)-1 do { private _weaponConfig = _cfgWeapons select _i; if (isClass _weaponConfig) then { private _weapon = configName _weaponConfig; private _weaponType = getNumber (_weaponConfig >> "Type"); - if (_weaponType == 1) then { - // The weapon is a primary weapon + if (_weaponType in [1, 2]) then { + // The weapon is a primary weapon or a handgun weapon private _weaponInitSpeed = getNumber (_weaponConfig >> "initSpeed"); private _magazines = getArray (_weaponConfig >> "magazines"); @@ -44,16 +56,78 @@ for "_i" from 0 to (count _cfgWeapons)-1 do { // AB initial speed -------------------------------- // Get Weapon and Ammo Configurations - private _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); - private _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); - _AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable"]; + private _AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo]; + if (isNil "_AmmoCacheEntry") then { + _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); + }; + private _WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon]; + if (isNil "_WeaponCacheEntry") then { + _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); + }; + _AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocityVariationSD"]; _WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"]; private _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _vanillaInitialSpeed] call FUNC(calculateBarrelLengthVelocityShift); private _abInitialSpeed = _vanillaInitialSpeed + _barrelVelocityShift; // -------------------------------------------------- - diag_log text format ["ABDiagnose,%1,%2,%3,%4,%5,%6,%7",_weapon,_magazine,_ammo,_magazineInitSpeed,_weaponInitSpeed,_vanillaInitialSpeed,_abInitialSpeed]; + + if (_weapon find "_base" == -1 && _weapon find "_Base" == -1) then { +#ifdef DEBUG_INIT_SPEEDS + _data pushBack [-_forEachIndex, _abInitialSpeed, _magazine, _weapon]; +#endif + if (_barrelLength > 0 && abs(_vanillaInitialSpeed - _abInitialSpeed) > abs(_abInitialSpeed) * 0.0025) then { + diag_log text format ["AB_Diagnose_initSpeed,%1,%2,%3,%4,%5,%6,%7,%8",_weapon,_magazine,_ammo,_magazineInitSpeed,_weaponInitSpeed,_vanillaInitialSpeed,_abInitialSpeed,_abInitialSpeed/_vanillaInitialSpeed]; + }; + if (_barrelTwist == 0) then { + diag_log text format ["AB_Diagnose_barrelTwist,%1,%2,%3,%4,%5",_weapon,_magazine,_ammo,_twistDirection,_barrelTwist]; + }; + if (_barrelLength == 0) then { + diag_log text format ["AB_Diagnose_barrelLength,%1,%2,%3,%4,%5",_weapon,_magazine,_ammo,_barrelLength]; + }; + }; } forEach _magazines; }; }; }; + +#ifdef DEBUG_INIT_SPEEDS + _data sort false; + { + _x params ["_magazineIndex", "_abInitialSpeed", "_magazine", "_weapon"]; + if (_magazines find _magazine == -1) then { + private _magSpeed = _abInitialSpeed; + private _ammoRef = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); + if (_ammoRef != "") then { + { + private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); + if (_ammo == _ammoRef) exitWith { + _magSpeed = _magazineInitSpeeds select _forEachIndex; + }; + } forEach _magazines; + }; + _magazines pushBack _magazine; + _magazineInitSpeeds pushBack round(_magSpeed); + }; + if (_weapons find _weapon == -1) then { + _weapons pushBack _weapon; + _magIndex = _magazines find _magazine; + _magSpeed = _magazineInitSpeeds select _magIndex; + _weaponInitSpeeds pushBack (_abInitialSpeed / _magSpeed); + }; + } forEach _data; + { + _x params ["_magazineIndex", "_abInitialSpeed", "_magazine", "_weapon"]; + _magIndex = _magazines find _magazine; + _magSpeed = _magazineInitSpeeds select _magIndex; + _wepIndex = _weapons find _weapon; + _wepSpeed = _weaponInitSpeeds select _wepIndex; + } forEach _data; + { + diag_log text format ["AB_WeaponInitSpeed,%1,%2", _x, _weaponInitSpeeds select _forEachIndex]; + } forEach _weapons; + { + diag_log text format ["AB_MagazineInitSpeed,%1,%2", _x, _magazineInitSpeeds select _forEachIndex]; + } forEach _magazines; +#endif + +diag_log format["AdvancedBallistics: Finished 'diagnoseWeapons' in %1 seconds", (diag_tickTime - _diagnoseStartTime) toFixed 2]; 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..af13926893 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf @@ -8,29 +8,27 @@ * 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"]; - private _bulletVelocity = velocity _bullet; - - private _bulletSpeed = vectorMagnitude _bulletVelocity; - - if (!alive _bullet || _bulletSpeed < 100) then { + if (!alive _bullet) then { GVAR(allBullets) deleteAt (GVAR(allBullets) find _x); } else { + private _bulletVelocity = velocity _bullet; private _bulletPosition = getPosASL _bullet; - if (_bulletTraceVisible && _bulletSpeed > 500) then { + if (_bulletTraceVisible && {vectorMagnitude _bulletVelocity > BULLET_TRACE_MIN_VELOCITY}) then { 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, 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 28fe9c5680..e77aad33ad 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,102 +19,108 @@ //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; - if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (!alive _projectile) exitWith {}; -if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {}; if (underwater _unit) exitWith {}; -if (!GVAR(simulateForEveryone) && !(local _unit)) then { - // The shooter is non local - _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"); - _abort = _opticType != 2; // We only abort if the non local shooter is not a sniper + +private _abort = !local _unit; +if (_abort) then { + private _bulletVelocity = velocity _projectile; + private _muzzleVelocity = vectorMagnitude _bulletVelocity; + + private _maxRange = uiNamespace getVariable format[QGVAR(maxRange_%1), _ammo]; + if (isNil "_maxRange") then { + private _airFriction = getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction"); + private _maxRange = if (_airFriction < 0) then { + private _maxTime = ((_vanillaInitialSpeed - BULLET_TRACE_MIN_VELOCITY) / (BULLET_TRACE_MIN_VELOCITY * -_airFriction * _vanillaInitialSpeed)) max getNumber(configFile >> "CfgAmmo" >> _ammo >> "tracerEndTime"); + -ln(1 - _airFriction * _vanillaInitialSpeed * _maxTime) / _airFriction + } else { + _vanillaInitialSpeed * getNumber(configFile >> "CfgAmmo" >> _ammo >> "tracerEndTime") + }; + uiNamespace setVariable [format[QGVAR(maxRange_%1), _ammo], _maxRange]; + }; + if (ACE_player distance _unit > _maxRange && {ACE_player distance ((getPosASL _unit) vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply _maxRange)) > _maxRange}) exitWith {}; + + private _ammoCount = (_unit ammo _muzzle) + 1; + private _tracersEvery = getNumber(configFile >> "CfgMagazines" >> _magazine >> "tracersEvery"); + private _lastRoundsTracer = getNumber(configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer"); + if (_ammoCount <= _lastRoundsTracer || {_tracersEvery > 0 && {(_ammoCount - _lastRoundsTracer) % _tracersEvery == 0}}) exitWith { _abort = false }; + + if (GVAR(bulletTraceEnabled) && {_muzzleVelocity > BULLET_TRACE_MIN_VELOCITY} && {cameraView == "GUNNER"}) then { + if (currentWeapon ACE_player == binocular ACE_player) exitWith { _abort = false }; + if (currentWeapon ACE_player == primaryWeapon ACE_player && {count primaryWeaponItems ACE_player > 2}) then { + private _opticsName = (primaryWeaponItems ACE_player) select 2; + private _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + if (_opticType == 2) exitWith { _abort = false }; }; }; - if (GVAR(simulateForGroupMembers) && _abort) then { - _abort = (group ACE_player) != (group _unit); - }; }; -//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) exitWith {}; // 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); }; -_AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable"]; +_AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocityVariationSD"]; _WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"]; +private _temperature = nil; // We need the variable in this scope. So we need to init it here. -_bulletVelocity = velocity _projectile; -_muzzleVelocity = vectorMagnitude _bulletVelocity; +private _ammoCount = _unit ammo _muzzle; +private _bulletVelocity = velocity _projectile; +private _muzzleVelocity = vectorMagnitude _bulletVelocity; -_barrelVelocityShift = 0; if (GVAR(barrelLengthInfluenceEnabled)) then { - _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); + _muzzleVelocity = _muzzleVelocity + ([_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift)); }; - -_ammoTemperatureVelocityShift = 0; if (GVAR(ammoTemperatureEnabled)) then { _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); - _ammoTemperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift)); + _muzzleVelocity = _muzzleVelocity + ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift)); +}; +if (GVAR(muzzleVelocityVariationEnabled)) then { + private _time = round (CBA_missionTime / 2); + // Generate seed from publicly known values (via Cantor pairing function) + private _seed = 0.5 * (_time + _ammoCount) * (_time + _ammoCount + 1) + _ammoCount; + // Generate normally distributed random number (via Box–Muller transform) + private _z = sqrt(-2.0 * ln(0.00000001 max (-_seed random 1))) * cos(_seed random 360); + + _muzzleVelocity = _muzzleVelocity * (_z * _muzzleVelocityVariationSD + 1); }; -if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { - _muzzleVelocityShift = _barrelVelocityShift + _ammoTemperatureVelocityShift; - TRACE_4("shift",_muzzleVelocity,_muzzleVelocityShift, _barrelVelocityShift, _ammoTemperatureVelocityShift); - if (_muzzleVelocityShift != 0) then { - _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; - _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); - _projectile setVelocity _bulletVelocity; - }; -}; +_bulletVelocity = (vectorNormalized _bulletVelocity) vectorMultiply _muzzleVelocity; +_projectile setVelocity _bulletVelocity; -if (_abort || !(GVAR(extensionAvailable))) exitWith { - if (missionNamespace getVariable [QEGVAR(windDeflection,enabled), false]) then { - EGVAR(windDeflection,trackedBullets) pushBack [_projectile, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")]; - }; -}; - -_bulletTraceVisible = false; -if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { +private _bulletTraceVisible = false; +if (GVAR(bulletTraceEnabled) && {_muzzleVelocity > BULLET_TRACE_MIN_VELOCITY} && {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; -if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { +private _stabilityFactor = 1.5; +if (_caliber * _bulletLength * _bulletMass * _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:%18", GVAR(currentbulletID), _ammoCount, _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _transonicStabilityCoef, getPosASL _projectile, _bulletVelocity, 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..a92982db21 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" @@ -19,14 +22,10 @@ params ["_logic","_units", "_activated"]; if !(_activated) exitWith {}; [_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(muzzleVelocityVariationEnabled), "muzzleVelocityVariationEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(ammoTemperatureEnabled), "ammoTemperatureEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(barrelLengthInfluenceEnabled), "barrelLengthInfluenceEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(bulletTraceEnabled), "bulletTraceEnabled"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(simulateForEveryone), "simulateForEveryone"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(disabledInFullAutoMode), "disabledInFullAutoMode"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(simulateForSnipers), "simulateForSnipers"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(simulateForGroupMembers), "simulateForGroupMembers"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(simulationInterval), "simulationInterval"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(simulationRadius), "simulationRadius"] call EFUNC(common,readSettingFromModule); GVAR(simulationInterval) = 0 max GVAR(simulationInterval) min 0.2; diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index 9c226d4a44..4b522656ff 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -8,18 +8,18 @@ * Return Value: * None * + * Example: + * [] call ace_advanced_ballistics_fnc_initializeTerrainExtension + * * Public: No */ #include "script_component.hpp" 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 = diag_tickTime; +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 +28,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; @@ -40,20 +40,20 @@ INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldNa _args params ["_mapGrids", "_gridCells", "_initStartTime"]; if (GVAR(currentGrid) >= _gridCells) exitWith { - INFO_2("Finished terrain initialization in %1 seconds [world: %2]", ceil(CBA_missionTime - _initStartTime), worldName); + INFO_2("Finished terrain initialization in %1 seconds [world: %2]", (diag_tickTime - _initStartTime) toFixed 2, worldName); #ifdef DEBUG_MODE_FULL - systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(CBA_missionTime - _initStartTime)]; + systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", (diag_tickTime - _initStartTime) toFixed 2]; #endif [_idPFH] call CBA_fnc_removePerFrameHandler; }; 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 bac37a22a0..2a5ccb4dfa 100644 --- a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf @@ -7,48 +7,55 @@ * 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"]; + private _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 _airFriction = getNumber(_ammoConfig >> "airFriction"); +private _caliber = 0 max getNumber(_ammoConfig >> "ACE_caliber"); +private _bulletLength = 0 max getNumber(_ammoConfig >> "ACE_bulletLength"); +private _bulletMass = 0 max getNumber(_ammoConfig >> "ACE_bulletMass"); +private _transonicStabilityCoef = 0 max getNumber(_ammoConfig >> "ACE_transonicStabilityCoef") min 1; if (_transonicStabilityCoef == 0) then { _transonicStabilityCoef = 0.5; }; -_dragModel = getNumber(_ammoConfig >> "ACE_dragModel"); -if (_dragModel == 0 || !(_dragModel in [1, 2, 5, 6, 7, 8])) then { +private _dragModel = getNumber(_ammoConfig >> "ACE_dragModel"); +if (!(_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 _muzzleVelocityVariationSD = DEFAULT_MUZZLE_VELOCITY_VARIATION_SD; +if (isNumber (_ammoConfig >> "ACE_muzzleVelocityVariationSD")) then { + _muzzleVelocityVariationSD = getNumber(_ammoConfig >> "ACE_muzzleVelocityVariationSD") / 100; +}; +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 +93,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, _muzzleVelocityVariationSD]; 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 882542f068..a0fa193b6f 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 */ @@ -17,8 +20,8 @@ private _weaponConfig = (configFile >> "CfgWeapons" >> _this); -private _barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist"); -private _twistDirection = 1; +private _barrelTwist = 0 max getNumber(_weaponConfig >> "ACE_barrelTwist"); +private _twistDirection = [0, 1] select (_barrelTwist != 0); if (isNumber (_weaponConfig >> "ACE_twistDirection")) then { _twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection"); if !(_twistDirection in [-1, 0, 1]) then { @@ -26,7 +29,7 @@ if (isNumber (_weaponConfig >> "ACE_twistDirection")) then { }; }; -private _barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength"); +private _barrelLength = 0 max getNumber(_weaponConfig >> "ACE_barrelLength"); private _result = [_barrelTwist, _twistDirection, _barrelLength]; diff --git a/addons/advanced_ballistics/script_component.hpp b/addons/advanced_ballistics/script_component.hpp index 48344f8ca3..bbd659670f 100644 --- a/addons/advanced_ballistics/script_component.hpp +++ b/addons/advanced_ballistics/script_component.hpp @@ -6,6 +6,8 @@ // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS +#define DEBUG_INIT_SPEEDS + #ifdef DEBUG_ENABLED_ADVANCEDBALLISTICS #define DEBUG_MODE_FULL #endif @@ -16,7 +18,6 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define GRAVITY 9.80665 #define ABSOLUTE_ZERO_IN_CELSIUS -273.15 #define KELVIN(t) (t - ABSOLUTE_ZERO_IN_CELSIUS) #define CELSIUS(t) (t + ABSOLUTE_ZERO_IN_CELSIUS) @@ -27,4 +28,9 @@ #define STD_AIR_DENSITY_ICAO 1.22498 #define STD_AIR_DENSITY_ASM 1.20885 + // Standard deviation of the default muzzle velocity variation (0.3%) +#define DEFAULT_MUZZLE_VELOCITY_VARIATION_SD 0.003 + +#define BULLET_TRACE_MIN_VELOCITY 500 + #define EXTENSION_REQUIRED_VERSION "1.0" diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index 31b9b56bb9..8a2ee622d1 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -14,6 +14,8 @@ Mostrar Informação do Vento 風の情報を表示 바람의 정보를 표시 + 顯示風況 + 显示风况 Show Protractor @@ -28,6 +30,8 @@ Mostrar Transferidor 分度器を表示 각도기 표시 + 顯示量角器 + 显示量角器 Advanced Ballistics @@ -42,6 +46,8 @@ Balistica Avanzata アドバンスド バリスティックス 고급 탄도학 + 先進彈道系統 + 先进弹道系统 Advanced Ballistics @@ -56,6 +62,8 @@ Balistica Avanzata アドバンスド バリスティックス 고급 탄도학 + 先進彈道系統 + 先进弹道系统 Enables advanced ballistics @@ -68,148 +76,22 @@ Engedélyezi a fejlett ballisztikát Включает продвинутую баллистику Abilita Balistica Avanzata - アドバンスド バリスティックスを有効化 + アドバンスド バリスティックス 고급 탄도학을 적용합니다 + 啟用先進彈道系統 + 启用先进弹道系统 - - Enabled For Snipers - Activada para francotiradores - Akt. dla snajperów - Für Scharfschützen aktiviert - Povoleno pro odstřelovače - Ativar para caçadores - Activé pour les snipers - Mesterlövészeknek engedélyezve - Включена для снайперов - Abilita per Tiratori Scelti - 狙撃手へ有効化 - 저격수만 적용 + + Enable Muzzle Velocity Variation + Variation der Mündungsgeschwindigkeit aktivieren + 銃口初速の変化 + Abilita Variazione Velocità Volata - - Enables advanced ballistics for non local snipers (when using high power optics) - Activa la balística avanzada para francotiradores no locales (cuando se usa una mira telescópica) - Aktywuje zaawansowaną balistykę dla nielokalnych snajperów (kiedy używają optyki) - Aktiviert die erweiterte Ballistik für nicht lokale Scharfschützen (bei Benutzung von Optiken mit starker Vergrößerung) - Aktivuje pokročilou balistiku pro nelokální odstřelovače (při použití optiky) - Ativa balística avançada para caçadores não locais (quando usando miras telescópicas) - Active la balistique avancée pour les snipers non locaux (en utilisant les optiques avancées) - Engedélyezi a fejlett ballisztikát nem-helyi mesterlövészeknek (nagy-teljesítményű optika használatakor) - Включает продвинутую баллистику для нелокальных снайперов (при использовании мощной оптики) - Abilita Balistica Avanzata per Tiratori Scelti non locali (con ottiche ad alto potenziale) - 非ローカルの狙撃手 (高倍率スコープを使っている場合)へアドバンスド バリスティックスを有効化します - 고급 탄도학을 비-저격수 인원에게도 적용합니다(고성능 조준경을 사용시) - - - Enabled For Group Members - Activada para miembros de grupo - Akt. dla czł. grupy - Für Gruppenmitglieder aktiviert - Povoleno pro členy skupiny - Ativada para membros do grupo - Activé pour les membres groupés - Csoporttagoknak engedélyezve - Включена для группы - Abilita per Membri del Gruppo - グループ メンバーへ有効化 - 그룹 멤버도 적용 - - - Enables advanced ballistics for non local group members - Activada la balística avanzada para miembros de grupo no locales - Aktywuje zaawansowaną balistykę dla nielokalnych członków grupy - Aktiviert die erweiterte Ballistik für nicht lokale Gruppenmitglieder - Aktivuje pokročilou balistiku pro nelokální členy skupiny - Ativa balística avançada para membros de grupo não locais - Active la balistique avancée pour les membres du groupe non locaux - Engedélyezi a fejlett ballisztikát nem-helyi csoporttagoknak - Включает продвинутую баллистику для нелокальных членов группы - Abilita Balistica Avanzata per Membri non locali del Gruppo - 非ローカルのグループ メンバーへアドバンスド バリスティックスを有効化します - 고급 탄도학을 비-그룹멤버에게도 적용합니다 - - - Enabled For Everyone - Activada para todos - Akt. dla wszystkich - Für jeden aktiviert - Povoleno pro všechny - Ativada para todos - Activé pour tout le monde - Mindenkinek engedélyezve - Включена для всех - Abilita per tutti - 全員に有効化 - 모두에게 적용 - - - Enables advanced ballistics for all non local players (enabling this may degrade performance during heavy firefights in multiplayer) - Activada la balística avanzada para todos los jugadores no locales (activarlo puede degradar el rendimiento durante grandes tiroteos en multijugador). - Aktywuje zaawansowaną balistykę dla wszystkich nielokalnych graczy (aktywacja tej opcji może spodowować spory spadek wydajności podczas ciężkiej wymiany ognia) - Aktiviert die erweiterte Ballistik für alle nicht lokalen Spieler (das Aktivieren dieser Funktion kann zur Beeinträchtigung des Spielerlebnisses im Multiplayer führen) - Aktivuje pokročilou balistiku pro všechny nelokální hráče (aktivace této možnosti způsobuje pokles FPS během velké přestřelky v multiplayeru) - Ativa balística avançada para todos os jogadores não locais (ativando isso pode degradar a performance durante troca de tiros intensas no multiplayer) - 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 ridurre le prestazioni durante scontri intensi in multiplayer) - 非ローカルの全プレイヤーへアドバンスド バリスティックスを有効化します (マルチプレイで大規模な銃撃戦がおこなわれると、動作の低下を招きます) - 고급 탄도학을 모든 비-로컬그룹에게도 적용합니다(적용 후 대규모 전투시 성능하락을 유발할 수 있습니다) - - - Always Enabled For Group Members - Zawsze akt. dla czł. grupy - Siempre activada para miembros de grupo - Für Gruppenmitglieder immer aktiviert - Vždy povoleno pro členy skupiny - Sempre ativada para membros do grupo - Toujours activer pour les membres du groupe - Mindig engedélyezve csoporttagoknak - Всегда включена для членов группы - Sempre abilitato per Membri del Gruppo - 常にグループ メンバーへ有効化 - 그룹 멤버에게 항상 적용 - - - Always enables advanced ballistics when a group member fires - Aktywuje zaawansowaną balistykę dla wszystkich członków grupy - Activada la balística avanzada siempre cuando miembros de grupo disparan - Aktiviert die erweiterte Ballistik immer, wenn ein Gruppenmitglied schießt - Aktivuje pokročilou balistiku pro členy skupiny - Sempre ative balística avançada quando um membro do grupo disparar - 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 - グループ メンバーが射撃した時、常にアドバンスド バリスティックスを有効化します - 그룹 멤버가 발사시 항상 고급 탄도학을 적용합니다 - - - Disabled In FullAuto Mode - Wył. podczas ognia auto. - Desactivada en modo automático - Beim vollautomatischen Feuern deaktiviert - Zakázáno v automatickém režimu střelby - Desabilitar no modo automático - Désactiver en mode automatique - Automata módban letiltva - Выкл. для автомат. режима - Disabilita in modalità di fuoco automatico - フルオートでは無効化 - 조정간 자동시 비활성화 - - - Disables the advanced ballistics during full auto fire - Dezaktywuje zaawansowaną balistykę podczas ognia automatycznego - Desactivada la balística avanzada durante el fuego automático - Deaktiviert die erweiterte Ballistik beim vollautomatischen Feuern - Zákáže pokročilou balistiku během střelby v režimu automat - Desabilitar a balística avançada durante fogo automático - Désactive la balistique avancée pour les tirs en automatique - Letiltja a fejlett ballisztikát automata tüzelés folyamán - Выключает продвинутую баллистику при стрельбе в полностью автоматическом режиме - Disabilita Balistica Avanzata durante fuoco automatico - フルオートで射撃中ではアドバンスド バリスティックスを無効化します - 조정간 자동시 고급 탄도학을 비활성화 합니다 + + Simulates slight variations in muzzle velocity between each shot + Simuliert leichte Variationen der Mündungsgeschwindigkeit zwischen jedem Schuss. + 発射毎に僅かな銃口初速の変化をシミュレートします。 + Simula lievi variazioni della velocità della volata tra un colpo e l'altro Enable Ammo Temperature Simulation @@ -222,8 +104,10 @@ Lőszer-hő szimuláció engedélyezése Симуляция температуры для боеприпасов Abilita simulazione della temperatura delle munizioni - 弾薬の温度シミュレーションを有効化 + 弾薬温度シミュレーション 탄약 온도 구현 적용 + 啟用彈藥溫度模擬系統 + 启用弹药温度模拟系统 Muzzle velocity varies with ammo temperature @@ -236,8 +120,10 @@ A kezdősebesség a lőszer hőmérsékletétől függően változó Начальная скорость пули зависит от температуры La velocità dello sparo varia a seconda della temperatura delle munizioni - 弾薬の温度により初速値を変化させます + 弾薬の温度により銃口初速を変化させます 탄약 온도에 비례해 총구 속도가 달라집니다 + 子彈初速將隨彈藥溫度而有所變化 + 子弹初速将随弹药温度而有所变化 Enable Barrel Length Simulation @@ -250,8 +136,10 @@ Csőhossz-szimuláció engedélyezése Симуляция длины ствола Abilita simulazione della lunghezza della canna - 銃身長のシミュレーションを有効化 + 銃身長シミュレーション 총열 길이 구현 적용 + 啟用槍管長度模擬系統 + 启用枪管长度模拟系统 Muzzle velocity varies with barrel length @@ -264,8 +152,10 @@ A kezdősebesség a cső hosszától függően változó Начальная скорость пули зависит от длины ствола La velocità di sparo varia a seconda della lunghezza della canna - 銃身長により初速値を変化させます + 銃身長により銃口初速を変化させます 총구 속도가 총열에 비례해 달라집니다 + 子彈初速將隨槍管長度而有所變化 + 子弹初速将随枪管长度而有所变化 Enable Bullet Trace Effect @@ -278,8 +168,10 @@ Nyomkövető-effekt engedélyezése Следы пуль Abilita effetto dei Proiettili Traccianti - 弾丸の痕跡表示を有効化 + 弾丸の痕跡表示 예광탄 효과 적용 + 啟用曳光彈效果 + 启用曳光弹效果 Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics) @@ -294,6 +186,8 @@ Abilita effetto dei proiettili traccianti di alto calibro (visibile solo attraverso ottiche ad alto potenziale) 大口径の銃弾による弾丸の痕跡表示を有効化します (高倍率スコープを介してでしか見れません) 대구경 탄환에 예광탄 효과를 적용합니다(오직 고성능 조준경 사용시에만 보입니다) + 啟用曳光彈效果給大口徑子彈 (只有透過高倍率光學瞄鏡才能看到) + 启用曳光弹效果给大口径子弹 (只有透过高倍率光学瞄镜才能看到) Simulation Interval @@ -308,12 +202,14 @@ Intervallo Simulazione シミュレーション間隔 구현 간격 + 模擬間隔 + 模拟间隔 - Defines the interval between every calculation step + Defines the interval between each calculation step Określa interwał pomiędzy każdym krokiem kalkulacji Define el intervalo entre cada cálculo - Legt das Intervall zwischen den Berechnungsschritten fest + Definiert das Intervall zwischen den einzelnen Simulationsschritten Určuje interval mezi každým výpočtem Define o intervalo entre cada cálculo Définit un intervalle de calcul entre deux simulations @@ -322,6 +218,8 @@ Definisce l'intervallo tra ogni step di calcolo 各計算ごとの間隔を定義します 각 계산 단위의 간격을 정의합니다 + 定義每個模擬計算之間的時間間隔 + 定义每个模拟计算之间的时间间隔 Simulation Radius @@ -334,8 +232,10 @@ Szimuláció hatóköre Радиус симуляции Raggio Simulazione - シミュレーションの適用範囲 + シミュレーション適用範囲 구현 범위 + 模擬半徑 + 模拟半径 Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles @@ -350,6 +250,8 @@ 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. @@ -364,6 +266,8 @@ 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 このモジュールはアドバンスド バリスティックスを有効化します。弾道は気温や気圧、湿度、重力、弾薬の種類、発射する武器から影響を受けるようになります。 이 모듈은 고급 탄도학을 적용시킵니다 - 이는 발사체의 궤적이 기온, 대기압, 습도, 중력, 탄환의 종류와 어느 무기에서 발사되는지에 따라 영향을 받습니다. + 該模塊實現先進的彈道仿真 - 這意味著子彈的軌跡是由空氣溫度、大氣壓力、濕度、重力、彈藥類型以及射擊的武器所影響 + 该模块实现先进的弹道仿真 - 这意味着子弹的轨迹是由空气温度、大气压力、湿度、重力、弹药类型以及射击的武器所影响 diff --git a/addons/advanced_fatigue/ACE_Settings.hpp b/addons/advanced_fatigue/ACE_Settings.hpp index 8242e16111..2d46fd5eb3 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,31 +15,35 @@ 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; + sliderSettings[] = {0, 5, 1, 1}; }; class GVAR(recoveryFactor) { - category = "Advanced Fatigue"; + category = CSTRING(DisplayName); displayName = CSTRING(RecoveryFactor); description = CSTRING(RecoveryFactor_Description); typeName = "SCALAR"; value = 1; + sliderSettings[] = {0, 5, 1, 1}; }; class GVAR(loadFactor) { - category = "Advanced Fatigue"; + category = CSTRING(DisplayName); displayName = CSTRING(LoadFactor); description = CSTRING(LoadFactor_Description); typeName = "SCALAR"; value = 1; + sliderSettings[] = {0, 5, 1, 1}; }; class GVAR(terrainGradientFactor) { - category = "Advanced Fatigue"; + category = CSTRING(DisplayName); displayName = CSTRING(TerrainGradientFactor); description = CSTRING(TerrainGradientFactor_Description); typeName = "SCALAR"; value = 1; + sliderSettings[] = {0, 5, 1, 1}; }; }; diff --git a/addons/advanced_fatigue/CfgVehicles.hpp b/addons/advanced_fatigue/CfgVehicles.hpp index 922322b588..f6cead81e1 100644 --- a/addons/advanced_fatigue/CfgVehicles.hpp +++ b/addons/advanced_fatigue/CfgVehicles.hpp @@ -3,9 +3,9 @@ class CfgVehicles { class GVAR(moduleSettings): ACE_Module { author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Advanced Fatigue"; + displayName = CSTRING(DisplayName); function = QFUNC(moduleSettings); - scope = 2; + scope = 1; isGlobal = 1; isTriggerActivated = 0; icon = QPATHTOF(UI\Icon_Module.paa); 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_handlePlayerChanged.sqf b/addons/advanced_fatigue/functions/fnc_handlePlayerChanged.sqf index bdcbb9b296..0e31e89645 100644 --- a/addons/advanced_fatigue/functions/fnc_handlePlayerChanged.sqf +++ b/addons/advanced_fatigue/functions/fnc_handlePlayerChanged.sqf @@ -8,6 +8,11 @@ * * Return Value: * None + * + * Example: + * [newbob, oldbob] call ace_advanced_fatigue_fnc_handlePlayerChanged + * + * Public: No */ #include "script_component.hpp" params ["_newUnit", "_oldUnit"]; 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 d01eeefa78..4b23153dff 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -7,6 +7,11 @@ * * 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) 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 02924c0ae9..95b30d3c57 100644 --- a/addons/advanced_fatigue/stringtable.xml +++ b/addons/advanced_fatigue/stringtable.xml @@ -1,6 +1,15 @@  + + Advanced Fatigue + Erweiterte Ausdauer + 進階疲勞 + 进阶疲劳 + アドバンスド疲労 + Fatica Avanzata + 고급 피로도 + Performance Factor Leistungsfaktor @@ -9,24 +18,30 @@ 성능 요인 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 @@ -36,15 +51,19 @@ 회복 요인 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 @@ -54,15 +73,19 @@ 부담 요인 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 @@ -72,6 +95,8 @@ 지형 경사도 요인 Facteur d'inclinaison du terrain Fattore Pendenza Terreno + 地形陡峭影響值 + 地形陡峭影响值 Sets how much steep terrain increases stamina loss. Higher means higher stamina loss. @@ -81,6 +106,8 @@ 경사도에 따라 얼마나 피로해지는지를 정합니다. 값이 클수록 더 많은 피로를 유발합니다. 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 @@ -90,6 +117,8 @@ 활성화 Activé Abilitato + 啟用 + 启用 Enables/disables Advanced Fatigue. @@ -99,6 +128,8 @@ 고급 피로도 활성화/비활성화 Active/désactive la fatigue avancée. Abilita/disabilita la Fatica Avanzata. + 啟用/關閉進階體力. + 启用/关闭进阶体力. Show stamina bar @@ -108,6 +139,8 @@ 피로도 막대 Afficher la barre d'endurance Mostra barra stamina + 顯示體力條 + 显示体力条 Shows the stamina bar. @@ -117,6 +150,8 @@ 피로도 막대를 보여줍니다. 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..51f5d08a31 --- /dev/null +++ b/addons/advanced_throwing/CfgAmmo.hpp @@ -0,0 +1,11 @@ +class CfgAmmo { + class Default; + class Grenade: Default { + GVAR(torqueDirection)[] = {1, 1, 0}; + GVAR(torqueMagnitude) = "(50 + random 100) * selectRandom [1, -1]"; + }; + class GrenadeCore: 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..c3ee134968 100644 --- a/addons/advanced_throwing/CfgVehicles.hpp +++ b/addons/advanced_throwing/CfgVehicles.hpp @@ -7,7 +7,7 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(Category); function = QFUNC(moduleInit); - scope = 2; + scope = 1; isGlobal = 1; icon = QPATHTOF(UI\Icon_Module_AdvancedThrowing_ca.paa); class Arguments { @@ -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 3754be0e2d..7c0a194267 100644 --- a/addons/advanced_throwing/XEH_postInit.sqf +++ b/addons/advanced_throwing/XEH_postInit.sqf @@ -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]; @@ -93,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]; }; @@ -115,7 +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); { - drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [1,0,0,1], _x, 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/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..c95ec39c49 100644 --- a/addons/advanced_throwing/functions/fnc_canPrepare.sqf +++ b/addons/advanced_throwing/functions/fnc_canPrepare.sqf @@ -32,6 +32,7 @@ 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 call CBA_fnc_canUseWeapon} // Disable in non-FFV seats due to surface detection issues +{[_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 +{"" == currentWeapon _unit || {currentWeapon _unit != secondaryWeapon _unit}} && +{0 >= _unit getVariable [QEGVAR(common,effect_blockThrow), 0]} 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 359bd946a5..33ff556f6a 100644 --- a/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf +++ b/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf @@ -34,7 +34,8 @@ if !(_unit getVariable [QGVAR(primed), false]) then { _activeThrowable setVelocity [0, 0, -0.1]; // Set thrower - [QEGVAR(common,setShotParents), [_activeThrowable, _unit, (getShotParents _activeThrowable) select 1]] call CBA_fnc_serverEvent; + 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..2e7ae18e42 100644 --- a/addons/advanced_throwing/functions/fnc_moduleInit.sqf +++ b/addons/advanced_throwing/functions/fnc_moduleInit.sqf @@ -13,13 +13,10 @@ * Example: * [logic, [unit1, unit2], true] call ace_advanced_throwing_fnc_moduleInit * - * Public: - * No + * Public: No */ #include "script_component.hpp" -if (!isServer) exitWith {}; - params ["_logic", "_units", "_activated"]; if (!_activated) exitWith {}; 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..038390ee74 100644 --- a/addons/advanced_throwing/functions/fnc_throw.sqf +++ b/addons/advanced_throwing/functions/fnc_throw.sqf @@ -49,9 +49,26 @@ if (!(_unit getVariable [QGVAR(primed), false])) then { _newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit)); }; + // Calculate torque of thrown grenade + private _config = configFile >> "CfgAmmo" >> typeOf _activeThrowable; + private _torqueDir = getArray (_config >> QGVAR(torqueDirection)); + _torqueDir = if (_torqueDir isEqualTypeArray [0,0,0]) then { vectorNormalized _torqueDir } else { [0,0,0] }; + private _torqueMag = getNumber (_config >> QGVAR(torqueMagnitude)); + + if (_dropMode) then { + _torqueMag = _torqueMag * THROWSTYLE_DROP_TORQUE_COEF; + } else { + if (_throwType == "high") then { + _torqueMag = _torqueMag * THROWSTYLE_HIGH_TORQUE_COEF; + }; + }; + + 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 +84,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/script_component.hpp b/addons/advanced_throwing/script_component.hpp index 4beb0ee342..c6ce7dcb84 100644 --- a/addons/advanced_throwing/script_component.hpp +++ b/addons/advanced_throwing/script_component.hpp @@ -23,6 +23,8 @@ #define THROWSTYLE_HIGH_DIR [0, 200, 500] #define THROWSTYLE_HIGH_VEL_COEF 2 #define THROWSTYLE_DROP_VEL 2 +#define THROWSTYLE_HIGH_TORQUE_COEF .6 +#define THROWSTYLE_DROP_TORQUE_COEF .2 #define THROW_TYPE_DEFAULT "normal" #define THROW_SPEED_DEFAULT 18 diff --git a/addons/advanced_throwing/stringtable.xml b/addons/advanced_throwing/stringtable.xml index 2874570523..3157e767e5 100644 --- a/addons/advanced_throwing/stringtable.xml +++ b/addons/advanced_throwing/stringtable.xml @@ -10,6 +10,8 @@ 고급 투척 Lancé amélioré Lancio Avanzato + 進階投擲 + 进阶投掷 Allows changing advanced throwing behaviour. @@ -20,16 +22,20 @@ 고급 투척 행위를 허가합니다 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. @@ -40,6 +46,8 @@ 고급 투척을 활성화 합니다 Active le système de lancé amélioré. Abilita il sistema di lancio avanzato. + 啟用進階投擲系統 + 启用进阶投掷系统 Show Throw Arc @@ -50,6 +58,8 @@ 투척 궤적 표시 Afficher l'arc de lancé Mostra Arco di Tiro + 顯示投擲軌道 + 显示投掷轨道 Enables visualization of the throw arc (where throwable will fly). @@ -60,6 +70,8 @@ 투척 궤도를 시각화 합니다(투척물이 어디로 갈지) 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 @@ -70,6 +82,8 @@ 마우스 조작 표시 Afficher les contrôles à la souris du lancé Mostra Comandi Mouse Lancio + 顯示滑鼠投擲控制提示 + 显示滑鼠投掷控制提示 Enables visual cues for mouse controls when throwable is prepared. @@ -80,16 +94,20 @@ 투척물을 준비시 마우스 조작을 시각화해서 보여줍니다 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. @@ -100,16 +118,20 @@ 땅에 떨어진 투척물을 주울 수 있게 해줍니다. 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. @@ -120,16 +142,20 @@ 부착된 투척물을 주울 수 있게 해줍니다. 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) @@ -140,26 +166,32 @@ 투척물 떨어뜨리기 모드(꾹눌러서) 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 @@ -170,6 +202,8 @@ 던지기 Lancer Lanciare + 投擲 + 投掷 (Scroll) Change Mode @@ -180,6 +214,8 @@ (마우스 휠) 모드 변경 (Molette souris) Changer de mode (Scorrere) Cambio Modalità + (滾輪) 變更模式 + (滚轮) 变更模式 (Scroll) Extend @@ -190,6 +226,8 @@ (마우스 휠) 연장 (Molette souris) Etendre (Scorrere) Estendere + (滾輪) 延長 + (滚轮) 延长 (Click) Cook @@ -200,6 +238,8 @@ (클릭) 예열 (Clique) Dégoupiller (Click) Arma + (點擊) 提早拉開引信 + (点击) 提早拉开引信 Pick Up @@ -210,6 +250,8 @@ 줍기 Ramasser Raccogli + 撿取 + 捡取 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/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/ai/XEH_preStart.sqf b/addons/ai/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/ai/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/ai/config.cpp b/addons/ai/config.cpp index a269bdcdbc..bc3b2df4ac 100644 --- a/addons/ai/config.cpp +++ b/addons/ai/config.cpp @@ -15,3 +15,4 @@ class CfgPatches { }; #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..f4d2a816b2 --- /dev/null +++ b/addons/ai/stringtable.xml @@ -0,0 +1,41 @@ + + + + + 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 ec7cfd6a54..0da9c7760f 100644 --- a/addons/aircraft/CfgAmmo.hpp +++ b/addons/aircraft/CfgAmmo.hpp @@ -39,29 +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 6d35e90255..19797b53d8 100644 --- a/addons/aircraft/CfgMagazines.hpp +++ b/addons/aircraft/CfgMagazines.hpp @@ -2,7 +2,6 @@ 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 8f3be35873..5d3d705db6 100644 --- a/addons/aircraft/CfgVehicles.hpp +++ b/addons/aircraft/CfgVehicles.hpp @@ -33,51 +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; }; }; @@ -91,224 +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 { - driverCanEject = 1; - - class Turrets: Turrets { - class MainTurret: MainTurret { - canEject = 1; - }; - }; - }; - class I_Heli_light_03_F: Heli_light_03_base_F { - lockDetectionSystem = 0; - incomingMissileDetectionSystem = 16; - weapons[] = {"M134_minigun", "missiles_DAR", "CMFlareLauncher", "ACE_AIR_SAFETY" }; - magazines[] = {"5000Rnd_762x51_Yellow_Belt", "24Rnd_missiles", "168Rnd_CMFlare_Chaff_Magazine"}; + lockDetectionSystem = 0; // Vanilla: 12 + incomingMissileDetectionSystem = 16; // Vanilla: 24 class Turrets: Turrets { class MainTurret: MainTurret { 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 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; + lockDetectionSystem = 12; // Vanilla: 8 + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; class Plane_CAS_02_base_F: Plane_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; + lockDetectionSystem = 12; // Vanilla: 8 + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; class Plane_Fighter_03_base_F: Plane_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - }; - - 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 { - driverCanEject = 1; - - class Turrets: Turrets { - class CopilotTurret: CopilotTurret { - canEject = 1; - }; - }; + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; - class B_Heli_Transport_03_F: Heli_Transport_03_base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - }; - 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 7e5c2a34bb..5543925b5b 100644 --- a/addons/aircraft/CfgWeapons.hpp +++ b/addons/aircraft/CfgWeapons.hpp @@ -105,28 +105,5 @@ class CfgWeapons { 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 5b774a3dc2..7e59abad48 100644 --- a/addons/aircraft/Heli_Attack_01_base_F.hpp +++ b/addons/aircraft/Heli_Attack_01_base_F.hpp @@ -1,887 +1,12 @@ 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"}; + weapons[] = {"ACE_gatling_20mm_Comanche", "missiles_DAGR", "missiles_ASRAAM"}; magazines[] = {"ACE_500Rnd_20mm_shells_Comanche", "4Rnd_AAA_missiles", "24Rnd_PG_missiles"}; - outGunnerMayFire = 1; - commanding = -1; - primaryGunner = 1; - gunnerOpticsModel = ""; - gunnerOpticsEffect[] = {"TankCommanderOptics1"}; - gunnerForceOptics = 0; 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 { delete Narrow; @@ -957,7 +82,6 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { directionStabilized = 1; horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; - }; }; @@ -991,3 +115,13 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { }; }; }; + +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/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 48bf2c054e..21b8d9b3c9 100644 --- a/addons/aircraft/config.cpp +++ b/addons/aircraft/config.cpp @@ -18,6 +18,7 @@ class CfgPatches { }; #include "CfgAmmo.hpp" +#include "CfgEventHandlers.hpp" #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" 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 7e08f906ee..0c52397242 100644 --- a/addons/aircraft/stringtable.xml +++ b/addons/aircraft/stringtable.xml @@ -14,6 +14,8 @@ XM301 XM301 XM301 + XM301 + XM301 Open Cargo Door @@ -28,6 +30,8 @@ Abrir porta de carga カーゴ ドアを開く 화물칸 개방 + 開啟貨艙門 + 开启货舱门 Close Cargo Door @@ -42,6 +46,8 @@ Fechar porta de carga カーゴ ドアを閉じる 화물칸 폐쇄 + 關閉貨艙門 + 关闭货舱门 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/arsenal/$PBOPREFIX$ b/addons/arsenal/$PBOPREFIX$ new file mode 100644 index 0000000000..fea3434f4b --- /dev/null +++ b/addons/arsenal/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\arsenal \ No newline at end of file diff --git a/addons/arsenal/CfgEventHandlers.hpp b/addons/arsenal/CfgEventHandlers.hpp new file mode 100644 index 0000000000..becf395052 --- /dev/null +++ b/addons/arsenal/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/arsenal/RscDisplayMain.hpp b/addons/arsenal/RscDisplayMain.hpp new file mode 100644 index 0000000000..b20b99e31e --- /dev/null +++ b/addons/arsenal/RscDisplayMain.hpp @@ -0,0 +1,36 @@ +class RscStandardDisplay; +class RscDisplayMain: RscStandardDisplay { + class controls { + class GroupSingleplayer: RscControlsGroupNoScrollbars { + class Controls; + }; + class GroupTutorials: GroupSingleplayer { + h = "(6 * 1.5) * (pixelH * pixelGrid * 2)"; + + class Controls: Controls { + class Bootcamp; + class VRTraining; + class Arsenal; + class GVAR(mission): Arsenal { + idc = -1; + text = CSTRING(Mission); + tooltip = CSTRING(Mission_tooltip); + y = "(3 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)"; + onbuttonclick = QUOTE(playMission [ARR_2('','PATHTOF(missions\Arsenal.VR)')]); + animTextureNormal = QPATHTOF(data\buttonMissionMainMenu_ca.paa); + animTextureDisabled = QPATHTOF(data\buttonMissionMainMenu_ca.paa); + animTextureOver = QPATHTOF(data\buttonMissionMainMenuHover_ca.paa); + animTextureFocused = QPATHTOF(data\buttonMissionMainMenuHover_ca.paa); + animTexturePressed = QPATHTOF(data\buttonMissionMainMenu_ca.paa); + animTextureDefault = QPATHTOF(data\buttonMissionMainMenu_ca.paa); + }; + class FieldManual: Bootcamp { + y = "(4 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)"; + }; + class CommunityGuides: Bootcamp { + y = "(5 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)"; + }; + }; + }; + }; +}; diff --git a/addons/arsenal/XEH_PREP.hpp b/addons/arsenal/XEH_PREP.hpp new file mode 100644 index 0000000000..7596b769d8 --- /dev/null +++ b/addons/arsenal/XEH_PREP.hpp @@ -0,0 +1,47 @@ +PREP(addListBoxItem); +PREP(addVirtualItems); +PREP(buttonCargo); +PREP(buttonClearAll); +PREP(buttonExport); +PREP(buttonHide); +PREP(buttonImport); +PREP(buttonLoadoutsDelete); +PREP(buttonLoadoutsLoad); +PREP(buttonLoadoutsRename); +PREP(buttonLoadoutsSave); +PREP(buttonLoadoutsShare); +PREP(clearSearchbar); +PREP(fillLeftPanel); +PREP(fillLoadoutsList); +PREP(fillRightPanel); +PREP(handleLoadoutsSearchbar); +PREP(handleMouse); +PREP(handleScrollWheel); +PREP(handleSearchbar); +PREP(initBox); +PREP(itemInfo); +PREP(loadoutsChangeTab); +PREP(message); +PREP(onArsenalClose); +PREP(onArsenalOpen); +PREP(onKeyDown); +PREP(onLoadoutsClose); +PREP(onLoadoutsOpen); +PREP(onMouseButtonDown); +PREP(onMouseButtonUp); +PREP(onSelChangedLeft); +PREP(onSelChangedLoadouts); +PREP(onSelChangedRight); +PREP(onSelChangedRightListnBox); +PREP(open3DEN); +PREP(openBox); +PREP(portVALoadouts); +PREP(removeBox); +PREP(removeVirtualItems); +PREP(scanConfig); +PREP(showItem); +PREP(sortPanel); +PREP(updateCamPos); +PREP(updateRightPanel); +PREP(updateUniqueItemsList); +PREP(verifyLoadout); diff --git a/addons/arsenal/XEH_postInit.sqf b/addons/arsenal/XEH_postInit.sqf new file mode 100644 index 0000000000..dcc5c7c7b5 --- /dev/null +++ b/addons/arsenal/XEH_postInit.sqf @@ -0,0 +1,83 @@ +#include "script_component.hpp" +#include "defines.hpp" + +GVAR(EH_ID) = 0; +GVAR(lastSearchTextLeft) = ""; +GVAR(lastSearchTextRight) = ""; +GVAR(lastSearchTextLoadouts) = ""; + +[QGVAR(initBox), {_this call FUNC(initBox)}] call CBA_fnc_addEventHandler; +[QGVAR(removeBox), {_this call FUNC(removeBox)}] call CBA_fnc_addEventHandler; + +[QGVAR(broadcastFace), { + params ["_unit", "_face"]; + + _unit setFace _face; +}] call CBA_fnc_addEventHandler; + +[QGVAR(broadcastVoice), { + params ["_unit", "_voice"]; + + _unit setSpeaker _voice; +}] call CBA_fnc_addEventHandler; + +[QGVAR(loadoutUnshared), { + params ["_contentPanelCtrl" , "_playerName", "_loadoutName"]; + + if (!(isNil QGVAR(currentLoadoutsTab)) && {GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts}) then { + + private _dataToCheck = _playerName + _loadoutName; + + for '_i' from 0 to (((lnbsize _contentPanelCtrl) select 0) - 1) do { + if ((_contentPanelCtrl lnbData [_i, 1]) == _dataToCheck) exitwith {_contentPanelCtrl lnbDeleteRow _i}; + }; + } else { + + if ( + profileName == _playerName && + {!(isNil QGVAR(currentLoadoutsTab) && {GVAR(currentLoadoutsTab) == IDC_buttonMyLoadouts})} + ) then { + + for '_i' from 0 to (((lnbsize _contentPanelCtrl) select 0) - 1) do { + if ((_contentPanelCtrl lnbText [_i, 1]) == _loadoutName) exitwith { + _contentPanelCtrl lnbSetPicture [[_i, 0], QPATHTOF(data\iconPublicBlank.paa)]; + _contentPanelCtrl lnbSetValue [[_i, 0], 0]; + }; + }; + }; + }; +}] call CBA_fnc_addEventHandler; + +[QGVAR(loadoutShared), { + params ["_contentPanelCtrl" ,"_loadoutArgs"]; + _loadoutArgs params ["_playerName", "_loadoutName", "_loadoutData"]; + + if (!(isNil QGVAR(currentLoadoutsTab)) && {GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts}) then { + + private _curSelData =_contentPanelCtrl lnbData [(lnbCurSelRow _contentPanelCtrl), 1]; + ([_loadoutData] call FUNC(verifyLoadout)) params ["_loadout", "_nullItemsAmount", "_unavailableItemsAmount"]; + + private _newRow = _contentPanelCtrl lnbAddRow [_playerName, _loadoutName]; + + ADD_LOADOUTS_LIST_PICTURES + + _contentPanelCtrl lnbSetData [[_newRow, 1], _playerName + _loadoutName]; + + if (_nullItemsAmount > 0) then { + + _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; + } else { + + if (_unavailableItemsAmount > 0) then { + _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; + }; + }; + + _contentPanelCtrl lnbSort [1, false]; + + // Select previously selected loadout + for '_i' from 0 to (((lnbsize _contentPanelCtrl) select 0) - 1) do { + if ((_contentPanelCtrl lnbText [_i, 1]) == _curSelData) exitwith {_contentPanelCtrl lnbSetCurSelRow _i}; + }; + }; +}] call CBA_fnc_addEventHandler; diff --git a/addons/arsenal/XEH_preInit.sqf b/addons/arsenal/XEH_preInit.sqf new file mode 100644 index 0000000000..537af9c11d --- /dev/null +++ b/addons/arsenal/XEH_preInit.sqf @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +// Arsenal +GVAR(modList) = ["","curator","kart","heli","mark","expansion","expansionpremium"]; + +[QGVAR(camInverted), "CHECKBOX", localize LSTRING(invertCameraSetting), localize LSTRING(settingCategory), false] call CBA_Settings_fnc_init; +[QGVAR(enableModIcons), "CHECKBOX", [LSTRING(modIconsSetting), LSTRING(modIconsTooltip)], localize LSTRING(settingCategory), true] call CBA_Settings_fnc_init; +[QGVAR(fontHeight), "SLIDER", [LSTRING(fontHeightSetting), LSTRING(fontHeightTooltip)], localize LSTRING(settingCategory), [1, 10, 4.5, 1]] call CBA_Settings_fnc_init; + +// Arsenal loadouts +[QGVAR(allowDefaultLoadouts), "CHECKBOX", [LSTRING(allowDefaultLoadoutsSetting), LSTRING(defaultLoadoutsTooltip)], localize LSTRING(settingCategory), true, true] call CBA_Settings_fnc_init; +[QGVAR(allowSharedLoadouts), "CHECKBOX", localize LSTRING(allowSharingSetting), localize LSTRING(settingCategory), true, true] call CBA_Settings_fnc_init; +[QGVAR(EnableRPTLog), "CHECKBOX", [LSTRING(printToRPTSetting), LSTRING(printToRPTTooltip)], localize LSTRING(settingCategory), false, false] call CBA_Settings_fnc_init; + +ADDON = true; diff --git a/addons/arsenal/XEH_preStart.sqf b/addons/arsenal/XEH_preStart.sqf new file mode 100644 index 0000000000..ed7f4f0345 --- /dev/null +++ b/addons/arsenal/XEH_preStart.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" + +call FUNC(scanConfig); diff --git a/addons/arsenal/config.cpp b/addons/arsenal/config.cpp new file mode 100644 index 0000000000..0c3000ab3c --- /dev/null +++ b/addons/arsenal/config.cpp @@ -0,0 +1,41 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author = ECSTRING(common,ACETeam); + authors[] = {"alganthe"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +class Cfg3DEN { + class Mission { + class GVAR(DummyCategory) { + displayName="Dummy attribute, should never show up"; + class AttributeCategories { + class ACE3_Arsenal { + class Attributes { + class GVAR(DefaultLoadoutsListAttribute) { + property = QGVAR(DefaultLoadoutsListAttribute); + value=0; + expression="if !(is3DEN) then {ace_arsenal_defaultLoadoutsList = _value};"; + defaultValue="[]"; + validate="none"; + wikiType="[[Array]]"; + }; + }; + }; + }; + }; + }; +}; + +#include "ui\RscAttributes.hpp" +#include "CfgEventHandlers.hpp" +#include "RscDisplayMain.hpp" diff --git a/addons/arsenal/data/buttonMissionMainMenuHover_ca.paa b/addons/arsenal/data/buttonMissionMainMenuHover_ca.paa new file mode 100644 index 0000000000..5592939ea8 Binary files /dev/null and b/addons/arsenal/data/buttonMissionMainMenuHover_ca.paa differ diff --git a/addons/arsenal/data/buttonMissionMainMenu_ca.paa b/addons/arsenal/data/buttonMissionMainMenu_ca.paa new file mode 100644 index 0000000000..9f84cefcdf Binary files /dev/null and b/addons/arsenal/data/buttonMissionMainMenu_ca.paa differ diff --git a/addons/arsenal/data/iconClearContainer.paa b/addons/arsenal/data/iconClearContainer.paa new file mode 100644 index 0000000000..cf3ad52815 Binary files /dev/null and b/addons/arsenal/data/iconClearContainer.paa differ diff --git a/addons/arsenal/data/iconPublic.paa b/addons/arsenal/data/iconPublic.paa new file mode 100644 index 0000000000..d92675e8e2 Binary files /dev/null and b/addons/arsenal/data/iconPublic.paa differ diff --git a/addons/arsenal/data/iconPublicBlank.paa b/addons/arsenal/data/iconPublicBlank.paa new file mode 100644 index 0000000000..cf37c88b02 Binary files /dev/null and b/addons/arsenal/data/iconPublicBlank.paa differ diff --git a/addons/arsenal/data/iconSecondaryMuzzle.paa b/addons/arsenal/data/iconSecondaryMuzzle.paa new file mode 100644 index 0000000000..5cc7f17daa Binary files /dev/null and b/addons/arsenal/data/iconSecondaryMuzzle.paa differ diff --git a/addons/arsenal/defines.hpp b/addons/arsenal/defines.hpp new file mode 100644 index 0000000000..5cc25796bd --- /dev/null +++ b/addons/arsenal/defines.hpp @@ -0,0 +1,334 @@ +// Pixel grid +#define pixelScale 0.25 +#define GRID_W (pixelW * pixelGridNoUIScale * pixelScale) +#define GRID_H (pixelH * pixelGridNoUIScale * pixelScale) + +// IDCs +#define IDD_ace_arsenal 1127001 +#define IDC_mouseArea 0 +#define IDC_arrowMinus 101 +#define IDC_arrowPlus 102 +#define IDC_blockLeftFrame 3 +#define IDC_blockLeftBackground 4 +#define IDC_blockRightFrame 5 +#define IDC_blockRighttBackground 6 +#define IDC_loadIndicator 7 +#define IDC_loadIndicatorBar 701 +#define IDC_totalWeight 8 +#define IDC_totalWeightText 801 +#define IDC_message 9 +#define IDC_menuBar 10 +#define IDC_menuBarClose 1001 +#define IDC_infoBox 11 +#define IDC_infoBackground 1101 +#define IDC_infoName 1102 +#define IDC_infoAuthor 1103 +#define IDC_DLCBackground 1104 +#define IDC_DLCIcon 1105 +#define IDC_mouseBlock 12 +#define IDC_leftTabContent 13 +#define IDC_rightTabContent 14 +#define IDC_rightTabContentListnBox 15 +#define IDC_sortLeftTab 16 +#define IDC_sortRightTab 17 +#define IDC_leftSearchbar 18 +#define IDC_leftSearchbarButton 41 +#define IDC_rightSearchbar 19 +#define IDC_rightSearchbarButton 42 +#define IDC_tabLeft 20 +#define IDC_iconBackgroundPrimaryWeapon 2001 +#define IDC_buttonPrimaryWeapon 2002 +#define IDC_iconBackgroundHandgun 2003 +#define IDC_buttonHandgun 2004 +#define IDC_iconBackgroundSecondaryWeapon 2005 +#define IDC_buttonSecondaryWeapon 2006 +#define IDC_iconBackgroundHeadgear 2007 +#define IDC_buttonHeadgear 2008 +#define IDC_iconBackgroundUniform 2009 +#define IDC_buttonUniform 2010 +#define IDC_iconBackgroundVest 2011 +#define IDC_buttonVest 2012 +#define IDC_iconBackgroundBackpack 2013 +#define IDC_buttonBackpack 2014 +#define IDC_iconBackgroundGoggles 2015 +#define IDC_buttonGoggles 2016 +#define IDC_iconBackgroundNVG 2017 +#define IDC_buttonNVG 2018 +#define IDC_iconBackgroundBinoculars 2019 +#define IDC_buttonBinoculars 2020 +#define IDC_iconBackgroundMap 2021 +#define IDC_buttonMap 2022 +#define IDC_iconBackgroundGPS 2023 +#define IDC_buttonGPS 2024 +#define IDC_iconBackgroundRadio 2025 +#define IDC_buttonRadio 2026 +#define IDC_iconBackgroundCompass 2028 +#define IDC_buttonCompass 2029 +#define IDC_iconBackgroundWatch 2030 +#define IDC_buttonWatch 2031 +#define IDC_iconBackgroundFace 2032 +#define IDC_buttonFace 2033 +#define IDC_iconBackgroundVoice 2034 +#define IDC_buttonVoice 2035 +#define IDC_iconBackgroundInsigna 2036 +#define IDC_buttonInsigna 2037 +#define IDC_iconBackgroundOptic 21 +#define IDC_buttonOptic 22 +#define IDC_iconBackgroundItemAcc 23 +#define IDC_buttonItemAcc 24 +#define IDC_iconBackgroundMuzzle 25 +#define IDC_buttonMuzzle 26 +#define IDC_iconBackgroundBipod 27 +#define IDC_buttonBipod 28 +#define IDC_iconBackgroundCurrentMag 3001 +#define IDC_buttonCurrentMag 3002 +#define IDC_iconBackgroundCurrentMag2 3003 +#define IDC_buttonCurrentMag2 3004 +#define IDC_iconBackgroundMag 29 +#define IDC_buttonMag 30 +#define IDC_iconBackgroundMagALL 31 +#define IDC_buttonMagALL 32 +#define IDC_iconBackgroundThrow 33 +#define IDC_buttonThrow 34 +#define IDC_iconBackgroundPut 35 +#define IDC_buttonPut 36 +#define IDC_iconBackgroundMisc 37 +#define IDC_buttonMisc 38 +#define IDC_buttonRemoveAllSelected 39 +#define IDC_buttonRemoveAll 40 + +#define IDD_loadouts_display 1127002 +#define IDC_centerBox 3 +#define IDC_centerTitle 301 +#define IDC_contentPanel 302 +#define IDC_textEditBox 303 +#define IDC_buttonSave 304 +#define IDC_buttonLoad 305 +#define IDC_buttonShare 306 +#define IDC_buttonDelete 307 +#define IDC_buttonRename 308 +#define IDC_loadoutsSearchbar 309 +#define IDC_buttonMyLoadoutsBackground 401 +#define IDC_buttonMyLoadouts 402 +#define IDC_buttonDefaultLoadoutsBackground 403 +#define IDC_buttonDefaultLoadouts 404 +#define IDC_buttonSharedLoadoutsBackground 405 +#define IDC_buttonSharedLoadouts 406 + +#define FADE_DELAY 0.15 +#define CAM_DIS_MAX 5 + +#define RIGHT_PANEL_ACC_IDCS IDC_buttonOptic, IDC_buttonItemAcc, IDC_buttonMuzzle, IDC_buttonBipod +#define RIGHT_PANEL_ACC_BACKGROUND_IDCS IDC_iconBackgroundOptic, IDC_iconBackgroundItemAcc, IDC_iconBackgroundMuzzle, IDC_iconBackgroundBipod +#define RIGHT_PANEL_ITEMS_IDCS IDC_buttonMag, IDC_buttonMagALL, IDC_buttonThrow, IDC_buttonPut, IDC_buttonMisc +#define RIGHT_PANEL_ITEMS_BACKGROUND_IDCS IDC_iconBackgroundMag, IDC_iconBackgroundMagALL, IDC_iconBackgroundThrow, IDC_iconBackgroundPut, IDC_iconBackgroundMisc +#define ARROWS_IDCS IDC_arrowMinus, IDC_arrowPlus + +#define GETDLC\ + {\ + private _dlc = "";\ + private _addons = configsourceaddonlist _this;\ + if (count _addons > 0) then {\ + private _mods = configsourcemodlist (configfile >> "CfgPatches" >> _addons select 0);\ + if (count _mods > 0) then {\ + _dlc = _mods select 0;\ + };\ + };\ + _dlc\ + } + +#define ADDMODICON\ + {\ + private _dlcName = _this call GETDLC;\ + if (_dlcName != "") then {\ + _ctrlPanel lbsetpictureright [_lbAdd,(modParams [_dlcName,["logo"]]) param [0,""]];\ + _modID = GVAR(modList) find _dlcName;\ + if (_modID < 0) then {_modID = GVAR(modList) pushback _dlcName;};\ + _ctrlPanel lbsetvalue [_lbAdd,_modID];\ + };\ + }; + +#define ADDBINOCULARSMAG\ + private _magazines = getarray (configfile >> "cfgweapons" >> _item >> "magazines");\ + if (count _magazines > 0) then {GVAR(center) addmagazine (_magazines select 0)}; + +#define TOGGLE_RIGHT_PANEL_WEAPON\ +{\ + _x = _display displayCtrl _x;\ + _x ctrlSetFade 0;\ + _x ctrlShow true;\ + _x ctrlEnable true;\ + _x ctrlCommit FADE_DELAY;\ +} foreach [\ + IDC_blockRightFrame,\ + IDC_blockRighttBackground,\ + IDC_rightTabContent,\ + IDC_sortRightTab,\ + RIGHT_PANEL_ACC_IDCS,\ + IDC_rightSearchbar,\ + IDC_rightSearchbarButton,\ + IDC_buttonCurrentMag\ +];\ +private _buttonCurrentMag2Ctrl = _display displayCtrl IDC_buttonCurrentMag2;\ +if (GVAR(currentLeftPanel) == IDC_buttonPrimaryWeapon) then {\ + _buttonCurrentMag2Ctrl ctrlSetFade 0;\ + _buttonCurrentMag2Ctrl ctrlShow true;\ + _buttonCurrentMag2Ctrl ctrlEnable true;\ +} else {\ + _buttonCurrentMag2Ctrl ctrlSetFade 1;\ + _buttonCurrentMag2Ctrl ctrlShow false;\ + _buttonCurrentMag2Ctrl ctrlEnable false;\ +};\ +_buttonCurrentMag2Ctrl ctrlCommit FADE_DELAY;\ +{\ + _x = _display displayCtrl _x;\ + _x ctrlSetFade 1;\ + _x ctrlShow false;\ + _x ctrlEnable false;\ + _x ctrlCommit FADE_DELAY;\ +} foreach [\ + IDC_loadIndicator,\ + RIGHT_PANEL_ITEMS_IDCS,\ + IDC_rightTabContentListnBox,\ + RIGHT_PANEL_ITEMS_BACKGROUND_IDCS,\ + IDC_buttonRemoveAll\ +]; + +#define TOGGLE_RIGHT_PANEL_CONTAINER\ +{\ + _x = _display displayCtrl _x;\ + _x ctrlSetFade 0;\ + _x ctrlShow true;\ + _x ctrlEnable true;\ + _x ctrlCommit FADE_DELAY;\ +} foreach [\ + IDC_blockRightFrame, \ + IDC_blockRighttBackground,\ + IDC_loadIndicator,\ + IDC_rightTabContentListnBox,\ + IDC_sortRightTab,\ + IDC_tabRight,\ + RIGHT_PANEL_ACC_IDCS,\ + RIGHT_PANEL_ITEMS_IDCS,\ + IDC_rightSearchbar,\ + IDC_rightSearchbarButton\ +];\ +{\ + _x = _display displayCtrl _x;\ + _x ctrlSetFade 1;\ + _x ctrlShow false;\ + _x ctrlEnable false;\ + _x ctrlCommit FADE_DELAY;\ +} foreach [\ + IDC_buttonCurrentMag,\ + IDC_buttonCurrentMag2,\ + IDC_iconBackgroundCurrentMag,\ + IDC_iconBackgroundCurrentMag2\ +]; + +#define TOGGLE_RIGHT_PANEL_HIDE\ +{\ + _x = _display displayCtrl _x;\ + _x ctrlSetFade 1;\ + _x ctrlShow false;\ + _x ctrlEnable false;\ + _x ctrlCommit FADE_DELAY;\ +} foreach [\ + IDC_blockRightFrame,\ + IDC_blockRighttBackground,\ + IDC_loadIndicator,\ + IDC_rightTabContent,\ + IDC_rightTabContentListnBox,\ + IDC_sortRightTab,\ + RIGHT_PANEL_ACC_BACKGROUND_IDCS,\ + RIGHT_PANEL_ACC_IDCS,\ + RIGHT_PANEL_ITEMS_BACKGROUND_IDCS,\ + RIGHT_PANEL_ITEMS_IDCS,\ + IDC_buttonRemoveAll,\ + IDC_rightSearchbar,\ + IDC_rightSearchbarButton,\ + IDC_buttonCurrentMag,\ + IDC_buttonCurrentMag2,\ + IDC_iconBackgroundCurrentMag,\ + IDC_iconBackgroundCurrentMag2\ +]; + +#define LIST_DEFAULTS\ + [\ + [\ + (primaryweapon GVAR(center) call bis_fnc_baseWeapon),\ + (secondaryweapon GVAR(center) call bis_fnc_baseWeapon),\ + (handgunweapon GVAR(center) call bis_fnc_baseWeapon)\ + ],\ + [\ + [primaryWeaponItems GVAR(center), secondaryWeaponItems GVAR(center), handgunItems GVAR(center)],\ + [primaryWeaponMagazine GVAR(center), secondaryWeaponMagazine GVAR(center), handgunMagazine GVAR(center)]\ + ],\ + uniformItems GVAR(center) + vestItems GVAR(center) + backpackItems GVAR(center),\ + [headgear GVAR(center)],\ + [uniform GVAR(center)],\ + [vest GVAR(center)],\ + [backpack GVAR(center)],\ + [goggles GVAR(center)],\ + [hmd GVAR(center)],\ + [binocular GVAR(center)]\ +] + +#define CHECK_WEAPON_OR_ACC\ + _item in (_weaponsArray select 0) ||\ + {_item in (_weaponsArray select 1)} ||\ + {_item in (_weaponsArray select 2)} ||\ + {_item in (GVAR(virtualItems) select 9)} ||\ + {_item in (_accsArray select 0)} ||\ + {_item in (_accsArray select 1)} ||\ + {_item in (_accsArray select 2)} ||\ + {_item in (_accsArray select 3)} + +#define CHECK_ASSIGNED_ITEMS\ + _item in (GVAR(virtualItems) select 10) ||\ + {_item in (GVAR(virtualItems) select 11)} ||\ + {_item in (GVAR(virtualItems) select 12)} ||\ + {_item in (GVAR(virtualItems) select 13)} ||\ + {_item in (GVAR(virtualItems) select 14)} ||\ + {_item in (GVAR(virtualItems) select 8)} + +#define CHECK_CONTAINER\ + _item in (GVAR(virtualItems) select 4) ||\ + {_item in (GVAR(virtualItems) select 5)} ||\ + {_item in (GVAR(virtualItems) select 6)} + +#define CLASS_CHECK_ITEM\ + isClass (_weaponCfg >> _item) ||\ + {isClass (_vehcCfg >> _item)} ||\ + {isClass (_glassesCfg >> _item)} ||\ + {isClass (_magCfg >> _item)} + +#define CHECK_CONTAINER_ITEMS\ + _item in (GVAR(virtualItems) select 3) ||\ + {_item in (_accsArray select 0)} ||\ + {_item in (_accsArray select 1)} ||\ + {_item in (_accsArray select 2)} ||\ + {_item in (_accsArray select 3)} ||\ + {_item in (GVAR(virtualItems) select 4)} ||\ + {_item in (GVAR(virtualItems) select 5)} ||\ + {_item in (GVAR(virtualItems) select 6)} ||\ + {_item in (GVAR(virtualItems) select 7)} ||\ + {_item in (GVAR(virtualItems) select 8)} ||\ + {_item in (GVAR(virtualItems) select 10)} ||\ + {_item in (GVAR(virtualItems) select 11)} ||\ + {_item in (GVAR(virtualItems) select 12)} ||\ + {_item in (GVAR(virtualItems) select 13)} ||\ + {_item in (GVAR(virtualItems) select 14)} ||\ + {_item in (GVAR(virtualItems) select 15)} ||\ + {_item in (GVAR(virtualItems) select 16)} ||\ + {_item in (GVAR(virtualItems) select 17)} + +#define ADD_LOADOUTS_LIST_PICTURES\ + _contentPanelCtrl lnbSetPicture [[_newRow, 2], getText (configFile >> "cfgWeapons" >> ((_loadout select 0) select 0) >> "picture")];\ + _contentPanelCtrl lnbSetPicture [[_newRow, 3], getText (configFile >> "cfgWeapons" >> ((_loadout select 1) select 0) >> "picture")];\ + _contentPanelCtrl lnbSetPicture [[_newRow, 4], getText (configFile >> "cfgWeapons" >> ((_loadout select 2) select 0) >> "picture")];\ + _contentPanelCtrl lnbSetPicture [[_newRow, 5], getText (configFile >> "cfgWeapons" >> ((_loadout select 3) select 0) >> "picture")];\ + _contentPanelCtrl lnbSetPicture [[_newRow, 6], getText (configFile >> "cfgWeapons" >> ((_loadout select 4) select 0) >> "picture")];\ + _contentPanelCtrl lnbSetPicture [[_newRow, 7], getText (configFile >> "cfgVehicles" >> ((_loadout select 5) select 0) >> "picture")];\ + _contentPanelCtrl lnbSetPicture [[_newRow, 8], getText (configFile >> "cfgWeapons" >> (_loadout select 6) >> "picture")];\ + _contentPanelCtrl lnbSetPicture [[_newRow, 9], getText (configFile >> "cfgGlasses" >> (_loadout select 7) >> "picture")]; diff --git a/addons/arsenal/functions/fnc_addListBoxItem.sqf b/addons/arsenal/functions/fnc_addListBoxItem.sqf new file mode 100644 index 0000000000..815e3511a8 --- /dev/null +++ b/addons/arsenal/functions/fnc_addListBoxItem.sqf @@ -0,0 +1,63 @@ +/* + * Author: Dedmen + * Add a listbox row. + * + * Arguments: + * 0: Config category (must be "CfgWeapons", "CfgVehicles", "CfgMagazines", "CfgVoice") + * 1: Classname + * 2: Panel control + * 3: Name of the picture entry in that Cfg class + * + * Return Value: + * None + * + * Public: Yes +*/ + +#include "script_component.hpp" +params ["_configCategory", "_className", "_ctrlPanel", ["_pictureEntryName", "picture", [""]]]; + +private _cacheNamespace = _ctrlPanel; //For better readability. + +private _cachedItemInfo = _cacheNamespace getVariable [_configCategory+_className, []]; + +//_cachedItemInfo == [_displayName, _itemPicture, _modPicture, _modID] +if (_cachedItemInfo isEqualTo []) then {//Not in cache. So get info and put into cache. + + private _configPath = configFile >> _configCategory >> _className; + + _cachedItemInfo set [0, getText (_configPath >> "displayName")]; + //if _pictureEntryName is empty then this item has no Icons. (Faces) + _cachedItemInfo set [1, if (_pictureEntryName isEqualTo "") then {""} else {getText (_configPath >> _pictureEntryName)}]; + + //get name of DLC + private _dlcName = ""; + private _addons = configsourceaddonlist _configPath; + if !(_addons isEqualTo []) then { + private _mods = configsourcemodlist (configfile >> "CfgPatches" >> _addons select 0); + if !(_mods isEqualTo []) then { + _dlcName = _mods select 0; + }; + }; + + if (_dlcName != "") then { + _cachedItemInfo set [2, (modParams [_dlcName,["logo"]]) param [0,""]];//mod picture + _modID = GVAR(modList) find _dlcName; + if (_modID < 0) then {_modID = GVAR(modList) pushback _dlcName;};//We keep a ordered list of all mods for sorting later. + _cachedItemInfo set [3, _modID];//mod ID + } else { + _cachedItemInfo set [2, ""];//mod picture + _cachedItemInfo set [3, 0];//mod ID + }; + _cacheNamespace setVariable [_configCategory+_className, _cachedItemInfo]; +}; + +_cachedItemInfo params ["_displayName", "_itemPicture", "_modPicture", "_modID"]; + +private _lbAdd = _ctrlPanel lbAdd _displayName; + +_ctrlPanel lbSetData [_lbAdd, _className]; +_ctrlPanel lbSetPicture [_lbAdd, _itemPicture]; +_ctrlPanel lbSetPictureRight [_lbAdd,["",_modPicture] select (GVAR(enableModIcons))]; +_ctrlPanel lbSetValue [_lbAdd,_modID]; +_ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _className]]; diff --git a/addons/arsenal/functions/fnc_addVirtualItems.sqf b/addons/arsenal/functions/fnc_addVirtualItems.sqf new file mode 100644 index 0000000000..742b305a89 --- /dev/null +++ b/addons/arsenal/functions/fnc_addVirtualItems.sqf @@ -0,0 +1,223 @@ +/* + * Author: Alganthe, Dedmen + * Add virtual items to the provided target. + * + * Arguments: + * 0: Target + * 1: Items + * 2: Add globally + * + * Return Value: + * None + * + * Example: + * [_box, ["item1", "item2", "itemN"]] call ace_arsenal_fnc_addVirtualItems + * [_box, true, false] call ace_arsenal_fnc_addVirtualItems + * + * Public: Yes +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params [["_object", objNull, [objNull]], ["_items", [], [true, []]], ["_global", false, [false]]]; + +if (_object == objNull) exitWith {}; +if (_items isEqualType [] && {count _items == 0}) exitWith {}; + +private _cargo = _object getVariable [QGVAR(virtualItems), [ + [[], [], []], // Weapons 0, primary, secondary, handgun + [[], [], [], []], // WeaponAccessories 1, optic,side,muzzle,bipod + [ ], // Magazines 2 + [ ], // Headgear 3 + [ ], // Uniform 4 + [ ], // Vest 5 + [ ], // Backpacks 6 + [ ], // Goggles 7 + [ ], // NVGs 8 + [ ], // Binoculars 9 + [ ], // Map 10 + [ ], // Compass 11 + [ ], // Radio slot 12 + [ ], // Watch slot 13 + [ ], // Comms slot 14 + [ ], // WeaponThrow 15 + [ ], // WeaponPut 16 + [ ] // InventoryItems 17 +]]; + +private _configCfgWeapons = configFile >> "CfgWeapons"; //Save this lookup in variable for perf improvement + +if (_items isEqualType true && {_items}) then { + private _configItems = uiNamespace getVariable QGVAR(configItems); + + { + (_x select 0) append (_x select 1); + (_x select 2) set [(_x select 3), (_x select 0) arrayIntersect (_x select 0)]; + } forEach [ + [(_cargo select 0 select 0),(_configItems select 0 select 0), _cargo select 0, 0], + [(_cargo select 0 select 1),(_configItems select 0 select 1), _cargo select 0, 1], + [(_cargo select 0 select 2),(_configItems select 0 select 2), _cargo select 0, 2], + [(_cargo select 1 select 0),(_configItems select 1 select 0), _cargo select 1, 0], + [(_cargo select 1 select 1),(_configItems select 1 select 1), _cargo select 1, 1], + [(_cargo select 1 select 2),(_configItems select 1 select 2), _cargo select 1, 2], + [(_cargo select 1 select 3),(_configItems select 1 select 3), _cargo select 1, 3] + ]; + + for "_index" from 2 to 17 do { + (_cargo select _index) append (_configItems select _index); + _cargo set [_index, (_cargo select _index) arrayIntersect (_cargo select _index)]; + }; + +} else { + { + if (_x isEqualType "") then { + private _configItemInfo = _configCfgWeapons >> _x >> "ItemInfo"; + private _simulationType = getText (_configCfgWeapons >> _x >> "simulation"); + switch true do { + case (isClass (_configCfgWeapons >> _x)): { + switch true do { + /* Weapon acc */ + case ( + isClass (_configItemInfo) && + {(getNumber (_configItemInfo >> "type")) in [101, 201, 301, 302]} && + {!(_x isKindOf ["CBA_MiscItem", (_configCfgWeapons)])} + ): { + switch (getNumber (_configItemInfo >> "type")) do { + case 201: { + (_cargo select 1) select 0 pushBackUnique _x; + }; + case 301: { + (_cargo select 1) select 1 pushBackUnique _x; + }; + case 101: { + (_cargo select 1) select 2 pushBackUnique _x; + }; + case 302: { + (_cargo select 1) select 3 pushBackUnique _x; + }; + }; + }; + /* Headgear */ + case (isClass (_configItemInfo) && + {getNumber (_configItemInfo >> "type") == 605}): { + (_cargo select 3) pushBackUnique _x; + }; + /* Uniform */ + case (isClass (_configItemInfo) && + {getNumber (_configItemInfo >> "type") == 801}): { + (_cargo select 4) pushBackUnique _x; + }; + /* Vest */ + case (isClass (_configItemInfo) && + {getNumber (_configItemInfo >> "type") == 701}): { + (_cargo select 5) pushBackUnique _x; + }; + /* NVgs */ + case (_simulationType == "NVGoggles"): { + (_cargo select 8) pushBackUnique _x; + }; + /* Binos */ + case (_simulationType == "Binocular" || + {(_simulationType == 'Weapon') && {(getNumber (_configCfgWeapons >> _x >> 'type') == 4096)}}): { + (_cargo select 9) pushBackUnique _x; + }; + /* Map */ + case (_simulationType == "ItemMap"): { + (_cargo select 10) pushBackUnique _x; + }; + /* Compass */ + case (_simulationType == "ItemCompass"): { + (_cargo select 11) pushBackUnique _x; + }; + /* Radio */ + case (_simulationType == "ItemRadio"): { + (_cargo select 12) pushBackUnique _x; + }; + /* Watch */ + case (_simulationType == "ItemWatch"): { + (_cargo select 13) pushBackUnique _x; + }; + /* GPS */ + case (_simulationType == "ItemGPS"): { + (_cargo select 14) pushBackUnique _x; + }; + /* UAV terminals */ + case (isClass (_configItemInfo) && + {getNumber (_configItemInfo >> "type") == 621}): { + (_cargo select 14) pushBackUnique _x; + }; + /* Weapon, at the bottom to avoid adding binos */ + case (isClass (_configCfgWeapons >> _x >> "WeaponSlotsInfo") && + {getNumber (_configCfgWeapons >> _x >> 'type') != 4096}): { + switch (getNumber (_configCfgWeapons >> _x >> "type")) do { + case 1: { + (_cargo select 0) select 0 pushBackUnique ([_x] call bis_fnc_baseWeapon); + }; + case 2: { + (_cargo select 0) select 2 pushBackUnique ([_x] call bis_fnc_baseWeapon); + }; + case 4: { + (_cargo select 0) select 1 pushBackUnique ([_x] call bis_fnc_baseWeapon); + }; + }; + }; + /* Misc items */ + case ( + isClass (_configItemInfo) && + ((getNumber (_configItemInfo >> "type")) in [101, 201, 301, 302] && + {(_x isKindOf ["CBA_MiscItem", (_configCfgWeapons)])}) || + {(getNumber (_configItemInfo >> "type")) in [401, 619, 620]} || + {(getText (_configCfgWeapons >> _x >> "simulation")) == "ItemMineDetector"} + ): { + (_cargo select 17) pushBackUnique _x; + }; + }; + }; + case (isClass (configFile >> "CfgMagazines" >> _x)): { + // Lists to check against + private _grenadeList = []; + { + _grenadeList append getArray (_configCfgWeapons >> "Throw" >> _x >> "magazines"); + false + } count getArray (_configCfgWeapons >> "Throw" >> "muzzles"); + + private _putList = []; + { + _putList append getArray (_configCfgWeapons >> "Put" >> _x >> "magazines"); + false + } count getArray (_configCfgWeapons >> "Put" >> "muzzles"); + + // Check what the magazine actually is + switch true do { + // Rifle, handgun, secondary weapons mags + case ( + (getNumber (configFile >> "CfgMagazines" >> _x >> "type") in [256,512,1536,16]) && + {!(_x in _grenadeList)} && + {!(_x in _putList)} + ): { + (_cargo select 2) pushBackUnique _x; + }; + // Grenades + case (_x in _grenadeList): { + (_cargo select 15) pushBackUnique _x; + }; + // Put + case (_x in _putList): { + (_cargo select 16) pushBackUnique _x; + }; + }; + }; + case (isClass (configFile >> "CfgVehicles" >> _x)): { + if (getText (configFile >> "CfgVehicles" >> _x >> "vehicleClass") == "Backpacks") then { + (_cargo select 6) pushBackUnique _x; + }; + }; + case (isClass (configFile >> "CfgGlasses" >> _x)): { + (_cargo select 7) pushBackUnique _x; + }; + }; + }; + } foreach _items; +}; + +_object setVariable [QGVAR(virtualItems), _cargo, _global]; diff --git a/addons/arsenal/functions/fnc_buttonCargo.sqf b/addons/arsenal/functions/fnc_buttonCargo.sqf new file mode 100644 index 0000000000..1af4008caf --- /dev/null +++ b/addons/arsenal/functions/fnc_buttonCargo.sqf @@ -0,0 +1,92 @@ +/* + * Author: Alganthe + * Add or remove item(s) when the + or - button is pressed in the right panel. + * + * Arguments: + * 0: Arsenal display + * 1: Add or remove (-1: remove, 1: Add) + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_addOrRemove"]; + +private _load = 0; +private _maxLoad = ""; +private _items = []; +private _ctrlList = (_display displayCtrl IDC_rightTabContentListnBox); +private _lnbCurSel = lnbCurSelRow _ctrlList; +private _item = _ctrlList lnbData [_lnbCurSel, 0]; + +if ((_ctrlList lnbValue [_lnbCurSel, 2]) == 1 && {_addOrRemove == 1}) exitWith {}; + +// Update item count and currentItems array +switch GVAR(currentLeftPanel) do { + + case IDC_buttonUniform : { + if (_addOrRemove > 0) then { + for "_count" from 1 to ([1, 5] select (GVAR(shiftState))) do { + GVAR(center) addItemToUniform _item; + }; + } else { + for "_count" from 1 to ([1, 5] select (GVAR(shiftState))) do { + GVAR(center) removeItemFromUniform _item; + }; + }; + + _load = loadUniform GVAR(center); + _maxLoad = gettext (configfile >> "CfgWeapons" >> uniform GVAR(center) >> "ItemInfo" >> "containerClass"); + _items = uniformItems GVAR(center); + GVAR(currentItems) set [15 ,_items]; + }; + + case IDC_buttonVest : { + if (_addOrRemove > 0) then { + for "_count" from 1 to ([1, 5] select (GVAR(shiftState))) do { + GVAR(center) addItemToVest _item; + }; + } else { + for "_count" from 1 to ([1, 5] select (GVAR(shiftState))) do { + GVAR(center) removeItemFromVest _item; + }; + }; + + _load = loadVest GVAR(center); + _maxLoad = gettext (configfile >> "CfgWeapons" >> vest GVAR(center) >> "ItemInfo" >> "containerClass"); + _items = vestItems GVAR(center); + GVAR(currentItems) set [16,_items]; + }; + + case IDC_buttonBackpack : { + if (_addOrRemove > 0) then { + for "_count" from 1 to ([1, 5] select (GVAR(shiftState))) do { + GVAR(center) addItemToBackpack _item; + }; + } else { + for "_count" from 1 to ([1, 5] select (GVAR(shiftState))) do { + GVAR(center) removeItemFromBackpack _item; + }; + }; + + _load = loadBackpack GVAR(center); + _maxLoad = backpack GVAR(center); + _items = backpackItems GVAR(center); + GVAR(currentItems) set [17,_items]; + }; +}; + +// Update progress bar status, weight info +private _loadIndicatorBarCtrl = _display displayCtrl IDC_loadIndicatorBar; +_loadIndicatorBarCtrl progressSetPosition _load; + +private _value = {_x == _item} count _items; +_ctrlList lnbSetText [[_lnbCurSel, 2],str _value]; + +[QGVAR(cargoChanged), [_display, _item, _addOrRemove, GVAR(shiftState)]] call CBA_fnc_localEvent; + +[_ctrlList, _maxLoad] call FUNC(updateRightPanel); diff --git a/addons/arsenal/functions/fnc_buttonClearAll.sqf b/addons/arsenal/functions/fnc_buttonClearAll.sqf new file mode 100644 index 0000000000..d73d777ace --- /dev/null +++ b/addons/arsenal/functions/fnc_buttonClearAll.sqf @@ -0,0 +1,62 @@ +/* + * Author: Alganthe + * Clear the current container. + * + * Arguments: + * 0: Arsenal display + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display"]; + +// Clear container +switch (GVAR(currentLeftPanel)) do { + case IDC_buttonUniform: { + {GVAR(center) removeItemFromUniform _x} foreach (uniformItems GVAR(center)); + GVAR(currentItems) set [15, []]; + }; + case IDC_buttonVest: { + {GVAR(center) removeItemFromVest _x} foreach (vestItems GVAR(center)); + GVAR(currentItems) set [16, []]; + }; + case IDC_buttonBackpack: { + {GVAR(center) removeItemFromBackpack _x} foreach (backpackItems GVAR(center)); + GVAR(currentItems) set [17, []]; + }; +}; + +// Clear number of owned items +private _ctrlList = _display displayCtrl IDC_rightTabContentListnBox; + +for "_l" from 0 to (lbSize _ctrlList - 1) do { + _ctrlList lnbSetText [[_l, 2], str 0]; +}; + +private _removeAllCtrl = _display displayCtrl IDC_buttonRemoveAll; +_removeAllCtrl ctrlSetFade 1; +_removeAllCtrl ctrlCommit FADE_DELAY; + +// Update load bar +private _loadIndicatorBarCtrl = _display displayCtrl IDC_loadIndicatorBar; +_loadIndicatorBarCtrl progressSetPosition 0; + +private _maxLoad = switch (GVAR(currentLeftPanel)) do { + case IDC_buttonUniform: { + gettext (configfile >> "CfgWeapons" >> uniform GVAR(center) >> "ItemInfo" >> "containerClass") + }; + case IDC_buttonVest: { + gettext (configfile >> "CfgWeapons" >> vest GVAR(center) >> "ItemInfo" >> "containerClass") + }; + case IDC_buttonBackpack: { + backpack GVAR(center) + }; +}; + +private _control = _display displayCtrl IDC_rightTabContentListnBox; +[_control, _maxLoad] call FUNC(updateRightPanel); diff --git a/addons/arsenal/functions/fnc_buttonExport.sqf b/addons/arsenal/functions/fnc_buttonExport.sqf new file mode 100644 index 0000000000..7bcac4c8ba --- /dev/null +++ b/addons/arsenal/functions/fnc_buttonExport.sqf @@ -0,0 +1,51 @@ +/* + * Author: Alganthe + * Export current loadout / default loadouts list to clipboard. + * + * Arguments: + * 0: Arsenal display + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_display"]; + +if (GVAR(shiftState)) then { + + if (isNil QGVAR(defaultLoadoutsList) || {GVAR(defaultLoadoutsList) isEqualTo []}) exitWith { + [_display, localize LSTRING(exportDefaultError)] call FUNC(message); + }; + + private _listLength = count GVAR(defaultLoadoutsList); + for "_index" from -1 to _listLength do { + + switch true do { + case (_index == -1): { + "ace_clipboard" callExtension (format ["[%1", endl]); + }; + + case (_index == _listLength): { + "ace_clipboard" callExtension "];"; + }; + + default { + "ace_clipboard" callExtension ([" ",str (GVAR(defaultLoadoutsList) select _index), [",", ""] select (_index == _listLength - 1), endl] joinString ""); + }; + }; + }; + + "ace_clipboard" callExtension "--COMPLETE--"; + + [_display, localize LSTRING(exportDefault)] call FUNC(message); +} else { + + private _export = str getUnitLoadout GVAR(center); + "ace_clipboard" callExtension (_export + ";"); + "ace_clipboard" callExtension "--COMPLETE--"; + + [_display, localize LSTRING(exportCurrent)] call FUNC(message); +}; diff --git a/addons/arsenal/functions/fnc_buttonHide.sqf b/addons/arsenal/functions/fnc_buttonHide.sqf new file mode 100644 index 0000000000..d79ff779d1 --- /dev/null +++ b/addons/arsenal/functions/fnc_buttonHide.sqf @@ -0,0 +1,52 @@ +/* + * Author: Alganthe + * Hide / show arsenal interface. + * + * Arguments: + * 0: Arsenal display + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display"]; + +private _showToggle = !ctrlShown (_display displayCtrl IDC_menuBar); + +{ + private _ctrl = _display displayctrl _x; + _ctrl ctrlshow _showToggle; + _ctrl ctrlcommit 0.15; +} foreach [ + IDC_blockLeftFrame, + IDC_blockLeftBackground, + IDC_blockRightFrame, + IDC_blockRighttBackground, + IDC_loadIndicator, + IDC_totalWeight, + IDC_menuBar, + IDC_infoBox, + IDC_leftTabContent, + IDC_rightTabContent, + IDC_rightTabContentListnBox, + IDC_sortLeftTab, + IDC_sortRightTab, + IDC_leftSearchbarButton, + IDC_rightSearchbarButton, + IDC_leftSearchbar, + IDC_rightSearchbar, + IDC_tabLeft, + RIGHT_PANEL_ACC_BACKGROUND_IDCS, + RIGHT_PANEL_ACC_IDCS, + RIGHT_PANEL_ITEMS_BACKGROUND_IDCS, + RIGHT_PANEL_ITEMS_IDCS, + IDC_buttonRemoveAll, + IDC_buttonCurrentMag, + IDC_buttonCurrentMag2, + IDC_iconBackgroundCurrentMag, + IDC_iconBackgroundCurrentMag2 +]; diff --git a/addons/arsenal/functions/fnc_buttonImport.sqf b/addons/arsenal/functions/fnc_buttonImport.sqf new file mode 100644 index 0000000000..76cd2f3a75 --- /dev/null +++ b/addons/arsenal/functions/fnc_buttonImport.sqf @@ -0,0 +1,111 @@ +/* + * Author: Alganthe + * Import loadout / default loadouts list from clipboard. + * + * Arguments: + * 0: Arsenal display + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display"]; + +private _data = call (compile copyFromClipboard); + +if (isNil "_data" || {!(_data isEqualType [])}) exitWith { + [_display, localize LSTRING(importFormatError)] call FUNC(message); +}; + +if (GVAR(shiftState) && {is3DEN}) then { + + { + if ( + count _x == 2 && + {_x select 0 isEqualType ""} && + {_x select 0 != ""} && + {_x select 1 isEqualType []} && + {count (_x select 1) == 10} + ) then { + + _x params ["_loadoutName", "_loadout"]; + + private _sameNameLoadoutsList = GVAR(defaultLoadoutsList) select {_x select 0 == _loadoutName}; + + if (count _sameNameLoadoutsList == 0) then { + GVAR(defaultLoadoutsList) pushBack [_loadoutName, _loadout]; + } else { + GVAR(defaultLoadoutsList) set [GVAR(defaultLoadoutsList) find (_sameNameLoadoutsList select 0), _loadoutName, _loadout]; + }; + }; + } foreach _data; + + [_display, localize LSTRING(importedDefault)] call FUNC(message); + set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]]; + +} else { + if (count _data == 10) then { + GVAR(center) setUnitLoadout _data; + + GVAR(currentItems) = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", [], [], [], [], [], []]; + for "_index" from 0 to 15 do { + switch (_index) do { + case 0; + case 1; + case 2:{ + GVAR(currentItems) set [_index, ((LIST_DEFAULTS select 0) select _index)]; + }; + case 3; + case 4; + case 5; + case 6; + case 7; + case 8; + case 9: { + GVAR(currentItems) set [_index, (LIST_DEFAULTS select _index) select 0]; + + }; + case 10: { + {(GVAR(currentItems) select 15) pushBack _x} forEach (uniformItems GVAR(center)); + }; + case 11: { + {(GVAR(currentItems) select 16) pushBack _x} forEach (vestItems GVAR(center)); + }; + case 12: { + {(GVAR(currentItems) select 17) pushBack _x} forEach (backpackItems GVAR(center)); + }; + case 13: { + GVAR(currentItems) set [18, (primaryWeaponItems GVAR(center)) + (primaryWeaponMagazine GVAR(center))]; + }; + case 14: { + GVAR(currentItems) set [19, (secondaryWeaponItems GVAR(center)) + (secondaryWeaponMagazine GVAR(center))]; + }; + case 15: { + GVAR(currentItems) set [20, (handgunItems GVAR(center)) + (handgunMagazine GVAR(center))]; + }; + }; + }; + + + { + private _simulationType = getText (configFile >> "CfgWeapons" >> _x >> "simulation"); + private _index = 10 + (["itemmap", "itemcompass", "itemradio", "itemwatch", "itemgps"] find (tolower _simulationType)); + + GVAR(currentItems) set [_index, _x]; + } foreach (assignedItems GVAR(center)); + + call FUNC(updateUniqueItemsList); + + // Reapply insignia + [GVAR(center), ""] call bis_fnc_setUnitInsignia; + [GVAR(center), GVAR(currentInsignia)] call bis_fnc_setUnitInsignia; + + [_display, _display displayCtrl GVAR(currentLeftPanel)] call FUNC(fillLeftPanel); + + [_display, localize LSTRING(importedCurrent)] call FUNC(message); + }; +}; diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsDelete.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsDelete.sqf new file mode 100644 index 0000000000..d3621f5826 --- /dev/null +++ b/addons/arsenal/functions/fnc_buttonLoadoutsDelete.sqf @@ -0,0 +1,55 @@ +/* + * Author: Alganthe + * Delete / unshare loadout currently selected. + * + * Arguments: + * 0: Arsenal display + * 1: Button control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +if !(ctrlEnabled _control) exitWith {}; + +private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; +private _contentPanelCursSel = lnbCurSelRow _contentPanelCtrl; +private _loadoutName = _contentPanelCtrl lnbText [_contentPanelCursSel, 1]; + +if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { + + if (is3DEN && {GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts}) then { + GVAR(defaultLoadoutsList) deleteAt (GVAR(defaultLoadoutsList) find ((GVAR(defaultLoadoutsList) select {_x select 0 == _loadoutName}) select 0)); + set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]]; + } else { + private _data = profileNamespace getVariable [QGVAR(saved_loadouts), []]; + _data deleteAt (_data find ((_data select {_x select 0 == _loadoutName}) select 0)); + }; + + _contentPanelCtrl setVariable [_loadoutName + str GVAR(currentLoadoutsTab), nil]; + _contentPanelCtrl lnbDeleteRow _contentPanelCursSel; + _contentPanelCtrl lnbSetCurSelRow (_contentPanelCursSel); + + [(findDisplay IDD_ace_arsenal), [localize LSTRING(loadoutDeleted), _loadoutName] joinString " "] call FUNC(message); +} else { + + private _profileName = profileName; // GVAR(center) could be a remote unit + private _loadoutVar = _profileName + _loadoutName; + private _sharedLoadoutsVars = GVAR(sharedLoadoutsNamespace) getVariable QGVAR(sharedLoadoutsVars); + + GVAR(sharedLoadoutsNamespace) setVariable [_loadoutVar, nil, true]; + GVAR(sharedLoadoutsNamespace) setVariable [QGVAR(sharedLoadoutsVars), _sharedLoadoutsVars - [_loadoutVar], true]; + + _contentPanelCtrl lnbDeleteRow _contentPanelCursSel; + _contentPanelCtrl lnbSetCurSelRow (_contentPanelCursSel); + + [QGVAR(loadoutUnshared), [_contentPanelCtrl, profileName, _loadoutName]] call CBA_fnc_remoteEvent; + + [(findDisplay IDD_ace_arsenal), [localize LSTRING(loadoutUnshared), _loadoutName] joinString " "] call FUNC(message); +}; diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf new file mode 100644 index 0000000000..9d413a233c --- /dev/null +++ b/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf @@ -0,0 +1,90 @@ +/* + * Author: Alganthe + * Load selected loadout. + * + * Arguments: + * 0: Arsenal display + * 1: Button control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +if !(ctrlEnabled _control) exitWith {}; + +private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; +private _curSel = lnbCurSelRow _contentPanelCtrl; +private _loadoutName = _contentPanelCtrl lnbText [_curSel, 1]; + +private _loadout = switch GVAR(currentLoadoutsTab) do { + + case IDC_buttonMyLoadouts; + case IDC_buttonDefaultLoadouts:{ + (_contentPanelCtrl getVariable _loadoutName + str GVAR(currentLoadoutsTab)) select 0 + }; + + case IDC_buttonSharedLoadouts:{ + (GVAR(sharedLoadoutsNamespace) getVariable ((_contentPanelCtrl lnbText [_curSel, 0]) + (_contentPanelCtrl lnbText [_curSel, 1]))) select 2 + }; +}; + +GVAR(center) setUnitLoadout [_loadout, true]; + +GVAR(currentItems) = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", [], [], [], [], [], []]; +for "_index" from 0 to 15 do { + switch (_index) do { + case 0; + case 1; + case 2:{ + GVAR(currentItems) set [_index, ((LIST_DEFAULTS select 0) select _index)]; + }; + case 3; + case 4; + case 5; + case 6; + case 7; + case 8; + case 9: { + GVAR(currentItems) set [_index, (LIST_DEFAULTS select _index) select 0]; + + }; + case 10: { + {(GVAR(currentItems) select 15) pushBack _x} forEach (uniformItems GVAR(center)); + }; + case 11: { + {(GVAR(currentItems) select 16) pushBack _x} forEach (vestItems GVAR(center)); + }; + case 12: { + {(GVAR(currentItems) select 17) pushBack _x} forEach (backpackItems GVAR(center)); + }; + case 13: { + GVAR(currentItems) set [18, (primaryWeaponItems GVAR(center)) + (primaryWeaponMagazine GVAR(center))]; + }; + case 14: { + GVAR(currentItems) set [19, (secondaryWeaponItems GVAR(center)) + (secondaryWeaponMagazine GVAR(center))]; + }; + case 15: { + GVAR(currentItems) set [20, (handgunItems GVAR(center)) + (handgunMagazine GVAR(center))]; + }; + }; +}; +{ + private _simulationType = getText (configFile >> "CfgWeapons" >> _x >> "simulation"); + private _index = 10 + (["itemmap", "itemcompass", "itemradio", "itemwatch", "itemgps"] find (tolower _simulationType)); + + GVAR(currentItems) set [_index, _x]; +} foreach (assignedItems GVAR(center)); + +call FUNC(updateUniqueItemsList); + +// Reapply insignia +[GVAR(center), ""] call bis_fnc_setUnitInsignia; +[GVAR(center), GVAR(currentInsignia)] call bis_fnc_setUnitInsignia; + +[(findDisplay IDD_ace_arsenal), [localize LSTRING(loadoutLoaded), _loadoutName] joinString " "] call FUNC(message); diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf new file mode 100644 index 0000000000..5435d07279 --- /dev/null +++ b/addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf @@ -0,0 +1,70 @@ +/* + * Author: Alganthe + * Rename selected loadout. + * + * Arguments: + * 0: Arsenal display + * 1: Button control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +if !(ctrlEnabled _control) exitWith {}; + +// Retrieve panel data +private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; +private _curSelRow = lnbCurSelRow _contentPanelCtrl; +private _loadoutName = _contentPanelCtrl lnbText [_curSelRow, 1]; + +private _editBoxCtrl = _display displayCtrl IDC_textEditBox; +private _editBoxContent = ctrlText _editBoxCtrl; + +private _data = [profileNamespace getVariable [QGVAR(saved_loadouts), []], GVAR(defaultLoadoutsList)] select (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts && {is3DEN}); +private _similarLoadouts = _data select {_x select 0 == _editBoxContent}; + +if (count _similarLoadouts > 0) exitWith { + [(findDisplay IDD_ace_arsenal), localize LSTRING(renameExistError)] call FUNC(message); +}; + +// Update loadout info in profile / 3DEN and list namespaces +private _loadoutToRename = (_data select {_x select 0 == _loadoutName}) select 0; +(_contentPanelCtrl getVariable (_loadoutName + str GVAR(currentLoadoutsTab))) params ["_loadout", "_nullItemsAmount", "_unavailableItemsAmount", "_nullItemsList", "_unavailableItemsList"]; + +_data set [_data find _loadoutToRename, [_editBoxContent, (_loadoutToRename select 1)]]; +_contentPanelCtrl setVariable [_loadoutName + str GVAR(currentLoadoutsTab), nil]; +_contentPanelCtrl setVariable [_editBoxContent + str GVAR(currentLoadoutsTab), [_loadout, _nullItemsAmount, _unavailableItemsAmount, _nullItemsList, _unavailableItemsList]]; + +// Add new row +_contentPanelCtrl lnbDeleteRow _curSelRow; +private _newRow = _contentPanelCtrl lnbAddRow ["",_editBoxContent]; + +ADD_LOADOUTS_LIST_PICTURES + +if (_nullItemsAmount > 0) then { + + _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; +} else { + + if (_unavailableItemsAmount > 0) then { + _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; + }; +}; + +// Sort and select the current row +_contentPanelCtrl lnbSort [1, false]; +for '_i' from 0 to (((lnbsize _contentPanelCtrl) select 0) - 1) do { + if ((_contentPanelCtrl lnbText [_i, 1]) == _editBoxContent) exitwith {_contentPanelCtrl lnbSetCurSelRow _i}; +}; + +if (is3DEN && {GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts}) then { + set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]]; +}; + +[(findDisplay IDD_ace_arsenal), [_loadoutName, localize LSTRING(loadoutRenamed) ,_editBoxContent] joinString " "] call FUNC(message); diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf new file mode 100644 index 0000000000..fecb6300e3 --- /dev/null +++ b/addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf @@ -0,0 +1,288 @@ +/* + * Author: Alganthe + * Save selected loadout. + * + * Arguments: + * 0: Arsenal display + * 1: Button control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +if !(ctrlEnabled _control) exitWith {}; + +private _editBoxCtrl = _display displayCtrl IDC_textEditBox; +private _editBoxContent = ctrlText _editBoxCtrl; + +if (_editBoxContent == "") exitWith { + [(findDisplay IDD_ace_arsenal), localize LSTRING(saveEmptyNameBox)] call FUNC(message); +}; + +private _data = [+(profileNamespace getVariable [QGVAR(saved_loadouts),[]]), +(GVAR(defaultLoadoutsList))] select (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts && {is3DEN}); +private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; +private _cursSelRow = lnbCurSelRow _contentPanelCtrl; + +private _loadoutName = _contentPanelCtrl lnbText [_cursSelRow, 1]; +private _curSelLoadout = (_contentPanelCtrl getVariable (_loadoutName + str GVAR(currentLoadoutsTab))) select 0; +private _loadout = getUnitLoadout GVAR(center); + +private _sameNameLoadoutsList = _data select {_x select 0 == _editBoxContent}; +private _sharedLoadoutsVars = GVAR(sharedLoadoutsNamespace) getVariable QGVAR(sharedLoadoutsVars); + +// Make sure the loadout isn't yours (public tab) or being shared (my loadouts tab) +private _similarSharedLoadout = (profileName + _editBoxContent) in _sharedLoadoutsVars; +if ((_contentPanelCtrl lnbText [_cursSelRow, 0]) == profileName) exitWith { + [(findDisplay IDD_ace_arsenal), localize LSTRING(saveAuthorError)] call FUNC(message); +}; + +if (_similarSharedLoadout) exitWith { + [(findDisplay IDD_ace_arsenal), localize LSTRING(saveSharedError)] call FUNC(message); +}; + +switch (GVAR(currentLoadoutsTab)) do { + case IDC_buttonMyLoadouts:{ + + for "_dataIndex" from 0 to 10 do { + switch (_dataIndex) do { + + case 0; + case 1; + case 2; + case 8: { + if (count (_loadout select _dataIndex) > 0) then { + + private _weapon = (_loadout select _dataIndex) select 0; + if (_weapon != "") then { + + private _baseWeapon = _weapon call BIS_fnc_baseWeapon; + if (_weapon != _baseWeapon) then { + (_loadout select _dataIndex) set [0, _baseWeapon]; + }; + }; + }; + }; + + case 3; + case 4; + case 5: { + if (count (_loadout select _dataIndex) > 0) then { + private _containerContents = (_loadout select _dataIndex) select 1; + + if (count _containerContents > 0) then { + + { + if (count _x == 2) then { + + if ((_x select 0) isEqualType "") then { + + private _item = (_x select 0); + if (_item != "") then { + + private _uniqueBaseCfgText = getText (configFile >> "CfgWeapons" >> _item >> "ace_arsenal_uniqueBase"); + if (_uniqueBaseCfgText != "") then { + + _x set [0, _uniqueBaseCfgText]; + }; + }; + } else { + private _weapon = (_x select 0) select 0; + if (_weapon != "") then { + + private _baseWeapon = _weapon call BIS_fnc_baseWeapon; + if (_weapon != _baseWeapon) then { + (_x select 0)set [0, _baseWeapon]; + }; + }; + }; + }; + } foreach _containerContents; + }; + }; + }; + + case 9: { + for "_subIndex" from 0 to 4 do { + private _item = (_loadout select _dataIndex) select _subIndex; + + if (_item != "") then { + + private _uniqueBaseCfgText = getText (configFile >> "CfgWeapons" >> _item >> "ace_arsenal_uniqueBase"); + if (_uniqueBaseCfgText != "") then { + + (_loadout select _dataIndex) set [_subIndex, _uniqueBaseCfgText]; + }; + }; + }; + }; + }; + }; + + if (count _sameNameLoadoutsList == 0) then { + _data pushBack [_editBoxContent, _loadout]; + } else { + _data set [_data find (_sameNameLoadoutsList select 0), [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _loadout]]; + }; + + // Delete "old" loadout row + for '_i' from 0 to (((lnbsize _contentPanelCtrl) select 0) - 1) do { + if ((_contentPanelCtrl lnbText [_i, 1]) == _editBoxContent) exitwith {_contentPanelCtrl lnbDeleteRow _i}; + }; + + private _newRow = _contentPanelCtrl lnbAddRow ["",_editBoxContent]; + + ADD_LOADOUTS_LIST_PICTURES + + _contentPanelCtrl setVariable [_editBoxContent + str GVAR(currentLoadoutsTab), [_loadout] call FUNC(verifyLoadout)]; + + _contentPanelCtrl lnbSort [1, false]; + + // Select newly saved loadout + for '_i' from 0 to (((lnbsize _contentPanelCtrl) select 0) - 1) do { + if ((_contentPanelCtrl lnbText [_i, 1]) == _editBoxContent) exitwith {_contentPanelCtrl lnbSetCurSelRow _i}; + }; + + profileNamespace setVariable [QGVAR(saved_loadouts), _data]; + }; + + case IDC_buttonDefaultLoadouts:{ + + if (is3DEN) then { + + private _sameNameLoadoutsList = _data select {_x select 0 == _editBoxContent}; + + for "_dataIndex" from 0 to 10 do { + switch (_dataIndex) do { + + case 0; + case 1; + case 2; + case 8: { + if (count (_loadout select _dataIndex) > 0) then { + + private _weapon = (_loadout select _dataIndex) select 0; + if (_weapon != "") then { + + private _baseWeapon = _weapon call BIS_fnc_baseWeapon; + if (_weapon != _baseWeapon) then { + (_loadout select _dataIndex) set [0, _baseWeapon]; + }; + }; + }; + }; + + case 3; + case 4; + case 5: { + if (count (_loadout select _dataIndex) > 0) then { + private _containerContents = (_loadout select _dataIndex) select 1; + + if (count _containerContents > 0) then { + + { + if (count _x == 2) then { + + if ((_x select 0) isEqualType "") then { + + private _item = (_x select 0); + if (_item != "") then { + + private _uniqueBaseCfgText = getText (configFile >> "CfgWeapons" >> _item >> "ace_arsenal_uniqueBase"); + if (_uniqueBaseCfgText != "") then { + + _x set [0, _uniqueBaseCfgText]; + }; + }; + } else { + private _weapon = (_x select 0) select 0; + if (_weapon != "") then { + + private _baseWeapon = _weapon call BIS_fnc_baseWeapon; + if (_weapon != _baseWeapon) then { + (_x select 0)set [0, _baseWeapon]; + }; + }; + }; + }; + } foreach _containerContents; + }; + }; + }; + + case 9: { + for "_subIndex" from 0 to 4 do { + private _item = (_loadout select _dataIndex) select _subIndex; + + if (_item != "") then { + + private _uniqueBaseCfgText = getText (configFile >> "CfgWeapons" >> _item >> "ace_arsenal_uniqueBase"); + if (_uniqueBaseCfgText != "") then { + + (_loadout select _dataIndex) set [_subIndex, _uniqueBaseCfgText]; + }; + }; + }; + }; + }; + }; + + if (count _sameNameLoadoutsList == 0) then { + GVAR(defaultLoadoutsList) pushBack [_editBoxContent, _loadout]; + } else { + GVAR(defaultLoadoutsList) set [GVAR(defaultLoadoutsList) find (_sameNameLoadoutsList select 0), [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _loadout]]; + }; + + for '_i' from 0 to (((lnbsize _contentPanelCtrl) select 0) - 1) do { + if ((_contentPanelCtrl lnbText [_i, 1]) == _editBoxContent) exitwith {_contentPanelCtrl lnbDeleteRow _i}; + }; + + private _newRow = _contentPanelCtrl lnbAddRow ["",_editBoxContent]; + + ADD_LOADOUTS_LIST_PICTURES + + _contentPanelCtrl setVariable [_editBoxContent + str GVAR(currentLoadoutsTab), [_loadout] call FUNC(verifyLoadout)]; + + _contentPanelCtrl lnbSort [1, false]; + + // Select newly saved loadout + for '_i' from 0 to (((lnbsize _contentPanelCtrl) select 0) - 1) do { + if ((_contentPanelCtrl lnbText [_i, 1]) == _editBoxContent) exitwith {_contentPanelCtrl lnbSetCurSelRow _i}; + }; + + set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]]; + } else { + + if (count _sameNameLoadoutsList == 0) then { + _data pushBack [_editBoxContent, _curSelLoadout]; + } else { + _data set [_data find (_sameNameLoadoutsList select 0), [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _curSelLoadout]]; + _contentPanelCtrl setVariable [_editBoxContent + str IDC_buttonMyLoadouts, [_curSelLoadout] call FUNC(verifyLoadout)]; + }; + + profileNamespace setVariable [QGVAR(saved_loadouts), _data]; + }; + }; + + case IDC_buttonSharedLoadouts :{ + + _loadout = (GVAR(sharedLoadoutsNamespace) getVariable ((_contentPanelCtrl lnbText [_cursSelRow, 0]) + (_contentPanelCtrl lnbText [_cursSelRow, 1]))) select 2; + + if (count _sameNameLoadoutsList == 0) then { + _data pushBack [_editBoxContent, _loadout]; + } else { + _data set [_data find (_sameNameLoadoutsList select 0), [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _loadout]]; + _contentPanelCtrl setVariable [_editBoxContent + str IDC_buttonMyLoadouts, [_loadout] call FUNC(verifyLoadout)]; + }; + + profileNamespace setVariable [QGVAR(saved_loadouts), _data]; + }; +}; +[(findDisplay IDD_ace_arsenal), [localize LSTRING(loadoutSaved), _editBoxContent] joinString " "] call FUNC(message); +private _savedLoadout = (_data select {_x select 0 == _editBoxContent}) select 0; +[QGVAR(onLoadoutSave), [_data find _savedLoadout, _savedLoadout]] call CBA_fnc_localEvent; diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf new file mode 100644 index 0000000000..d167522823 --- /dev/null +++ b/addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf @@ -0,0 +1,55 @@ +/* + * Author: Alganthe + * Share selected loadout. + * + * Arguments: + * 0: Arsenal display + * 1: Button control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +if !(ctrlEnabled _control) exitWith {}; + +private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; +private _contentPanelCursSel = lnbCurSelRow _contentPanelCtrl; +private _loadoutName = _contentPanelCtrl lnbText [_contentPanelCursSel, 1]; +private _profileName = profileName; // GVAR(center) could be a remote unit +private _loadoutVar = _profileName + _loadoutName; +private _sharedLoadoutsVars = +(GVAR(sharedLoadoutsNamespace) getVariable QGVAR(sharedLoadoutsVars)); + +private _loadoutIndex = _sharedLoadoutsVars find _loadoutVar; +private _loadoutData = (_contentPanelCtrl getVariable (_loadoutName + str GVAR(currentLoadoutsTab))) select 0; + +// Loadout set to private +if (_loadoutIndex > -1) then { + GVAR(sharedLoadoutsNamespace) setVariable [_loadoutVar, nil, true]; + GVAR(sharedLoadoutsNamespace) setVariable [QGVAR(sharedLoadoutsVars), _sharedLoadoutsVars - [_loadoutVar], true]; + + _contentPanelCtrl lnbSetPicture [[_contentPanelCursSel, 0], QPATHTOF(data\iconPublicBlank.paa)]; + _contentPanelCtrl lnbSetValue [[_contentPanelCursSel, 0], 0]; + [QGVAR(loadoutUnshared), [_contentPanelCtrl, profileName, _loadoutName]] call CBA_fnc_remoteEvent; + +// Loadout set to public +} else { + GVAR(sharedLoadoutsNamespace) setVariable [_loadoutVar, [_profileName ,_loadoutName , _loadoutData], true]; + _sharedLoadoutsVars pushBackUnique _loadoutVar; + GVAR(sharedLoadoutsNamespace) setVariable [QGVAR(sharedLoadoutsVars), _sharedLoadoutsVars, true]; + + _contentPanelCtrl lnbSetPicture [[_contentPanelCursSel, 0], QPATHTOF(data\iconPublic.paa)]; + _contentPanelCtrl lnbSetValue [[_contentPanelCursSel, 0], 1]; + [QGVAR(loadoutShared), [_contentPanelCtrl, [_profileName ,_loadoutName , _loadoutData]]] call CBA_fnc_remoteEvent; +}; + +// Update share button text +_control ctrlSetText ( [ + localize LSTRING(buttonSharePrivateText), + localize LSTRING(buttonSharePublicText) +] select ((_contentPanelCtrl lnbValue [_contentPanelCursSel, 0]) == 1)); diff --git a/addons/arsenal/functions/fnc_clearSearchbar.sqf b/addons/arsenal/functions/fnc_clearSearchbar.sqf new file mode 100644 index 0000000000..c417b6d1a4 --- /dev/null +++ b/addons/arsenal/functions/fnc_clearSearchbar.sqf @@ -0,0 +1,28 @@ +/* + * Author: Alganthe + * Clear the provided searchbar. + * + * Arguments: + * 0: Arsenal display + * 1: Searchbar control + * 2: Right button state + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control", "_rightButton"]; + +if (_rightButton != 1) exitWith {}; + +_control ctrlSetText ''; + +if (ctrlIDC _control == IDC_leftSearchbar) then { + [_display, _display displayCtrl GVAR(currentLeftPanel)] call FUNC(fillLeftPanel); +} else { + [_display, _display displayCtrl GVAR(currentRightPanel)] call FUNC(fillRightPanel); +}; diff --git a/addons/arsenal/functions/fnc_fillLeftPanel.sqf b/addons/arsenal/functions/fnc_fillLeftPanel.sqf new file mode 100644 index 0000000000..83a4336ea0 --- /dev/null +++ b/addons/arsenal/functions/fnc_fillLeftPanel.sqf @@ -0,0 +1,189 @@ +/* + * Author: Alganthe + * Fill left panel. + * + * Arguments: + * 0: Arsenal display + * 1: Tab control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +private _ctrlIDC = ctrlIDC _control; + +if !(isNil QGVAR(currentLeftPanel)) then { + private _previousCtrlBackground = _display displayCtrl (GVAR(currentLeftPanel) - 1); + _previousCtrlBackground ctrlSetFade 1; + _previousCtrlBackground ctrlCommit FADE_DELAY; +}; + +private _ctrlBackground = _display displayCtrl (_ctrlIDC - 1); +private _ctrlPanel = _display displayCtrl IDC_leftTabContent; +_ctrlBackground ctrlSetFade 0; +_ctrlBackground ctrlCommit FADE_DELAY; + +_ctrlPanel lbSetCurSel -1; + +// Handle icons and filling +switch true do { + case (_ctrlIDC in [IDC_buttonPrimaryWeapon, IDC_buttonHandgun, IDC_buttonSecondaryWeapon]) : { + // Purge old data + lbClear _ctrlPanel; + private _addEmpty = _ctrlPanel lbadd format [" <%1>",localize "str_empty"]; + _ctrlPanel lbsetvalue [_addEmpty, -1]; + + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach ((GVAR(virtualItems) select 0) select ([IDC_buttonPrimaryWeapon, IDC_buttonSecondaryWeapon, IDC_buttonHandgun] find _ctrlIDC)); + }; + + case (_ctrlIDC in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBackpack]) : { + + lbClear _ctrlPanel; + private _addEmpty = _ctrlPanel lbadd format [" <%1>",localize "str_empty"]; + _ctrlPanel lbsetvalue [_addEmpty, -1]; + + // Filling + switch (_ctrlIDC) do { + case IDC_buttonUniform : { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 4); + }; + + case IDC_buttonVest : { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 5); + }; + + case IDC_buttonBackpack : { + { + ["CfgVehicles", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 6); + }; + }; + }; + + default { + GVAR(currentRightPanel) = nil; + + lbClear _ctrlPanel; + + if !(_ctrlIDC in [IDC_buttonFace, IDC_buttonVoice]) then { + private _addEmpty = _ctrlPanel lbadd format [" <%1>",localize "str_empty"]; + _ctrlPanel lbsetvalue [_addEmpty, -1]; + }; + + switch (_ctrlIDC) do { + case IDC_buttonHeadgear: { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 3); + }; + case IDC_buttonGoggles : { + { + ["CfgGlasses", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 7); + }; + case IDC_buttonNVG : { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 8); + }; + case IDC_buttonBinoculars : { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 9); + }; + case IDC_buttonMap : { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 10); + }; + case IDC_buttonCompass : { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 11); + }; + case IDC_buttonRadio : { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 12); + }; + case IDC_buttonWatch : { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 13); + }; + case IDC_buttonGPS : { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (GVAR(virtualItems) select 14); + }; + case IDC_buttonFace : { + { + { + if ( + getnumber (_x >> "disabled") == 0 && + {getText (_x >> "head") != ""} && + {configName _x != "Default"} + ) then { + private _configName = configName _x; + private _displayName = getText (_x >> "displayName"); + private _lbAdd = _ctrlPanel lbAdd _displayName; + _ctrlPanel lbSetData [_lbAdd, _configName]; + _ctrlPanel lbSetTooltip [_lbAdd,format ["%1\n%2",_displayName, _configName]]; + _x call ADDMODICON; + }; + } foreach ("isClass _x" configClasses _x); + } foreach ("isClass _x" configClasses (configfile >> "cfgfaces")); + }; + case IDC_buttonVoice : { + private _voices = (configProperties [(configFile >> "CfgVoice"), "isClass _x && {getNumber (_x >> 'scope') == 2}", true]) - [(configfile >> "CfgVoice" >> "NoVoice")]; + { + ["CfgVoice", configName _x, _ctrlPanel, "icon"] call FUNC(addListBoxItem); + } foreach _voices; + }; + case IDC_buttonInsigna : { + { + ["CfgUnitInsignia", configName _x, _ctrlPanel, "texture"] call FUNC(addListBoxItem); + } foreach ("true" configClasses (configFile >> "CfgUnitInsignia")); + }; + }; + }; +}; + +// Done +if (GVAR(currentLeftPanel) != _ctrlIDC) then { + (_display displayCtrl IDC_leftSearchbar) ctrlSetText ""; + (_display displayCtrl IDC_rightSearchbar) ctrlSetText ""; +}; + +GVAR(currentLeftPanel) = _ctrlIDC; +[QGVAR(leftPanelFilled), [_display, _ctrlIDC, GVAR(currentRightPanel)]] call CBA_fnc_localEvent; + +// Sort +private _sortLeftCtrl = _display displayCtrl IDC_sortLeftTab; +[_sortLeftCtrl, _sortLeftCtrl lbValue (lbCurSel _sortLeftCtrl)] call FUNC(sortPanel); + +//Select current item +private _itemsToCheck = ((GVAR(currentItems) select [0,15]) + [GVAR(currentFace), GVAR(currentVoice), GVAR(currentInsignia)]) apply {tolower _x}; + +for "_lbIndex" from 0 to (lbSize _ctrlPanel - 1) do { + private _currentData = _ctrlPanel lbData _lbIndex; + + if (!(_currentData isEqualTo "") && {tolower _currentData in _itemsToCheck}) exitWith { + _ctrlPanel lbSetCurSel _lbIndex; + }; +}; +if (lbCurSel _ctrlPanel < 0) then { + _ctrlPanel lbSetCurSel 0; +}; diff --git a/addons/arsenal/functions/fnc_fillLoadoutsList.sqf b/addons/arsenal/functions/fnc_fillLoadoutsList.sqf new file mode 100644 index 0000000000..118581c160 --- /dev/null +++ b/addons/arsenal/functions/fnc_fillLoadoutsList.sqf @@ -0,0 +1,118 @@ +/* + * Author: Alganthe + * Fill loadouts list. + * + * Arguments: + * 0: Loadouts display + * 1: Tab control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; +private _textEditBoxCtrl= _display displayCtrl IDC_textEditBox; +_textEditBoxCtrl ctrlSetText ""; +private _sharingEnabled = (GVAR(allowSharedLoadouts) && {isMultiplayer}); +private _sharedLoadoutsVars = GVAR(sharedLoadoutsNamespace) getVariable QGVAR(sharedLoadoutsVars); + +_contentPanelCtrl lnbSetCurSelRow -1; +lnbClear _contentPanelCtrl; + +private _data = +(profileNamespace getvariable [QGVAR(saved_loadouts),[]]); + +if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { + + { + _x params ["_loadoutName", "_loadoutData"]; + + private _loadoutCachedInfo = _contentPanelCtrl getVariable (_loadoutName + str GVAR(currentLoadoutsTab)); + + if (isNil "_loadoutCachedInfo") then { + [_loadoutData] call FUNC(verifyLoadout) + } else { + _loadoutCachedInfo + } params ["_loadout", "_nullItemsAmount", "_unavailableItemsAmount", "_nullItemsList", "_unavailableItemsList"]; + + // Log missing / nil items to RPT + if (GVAR(EnableRPTLog) && {isNil "_loadoutCachedInfo"} && {(_nullItemsAmount > 0) || {_unavailableItemsAmount > 0}}) then { + + private _printComponent = "ACE_Arsenal - Loadout:"; + private _printNullItemsList = ["Missing items:", str _nullItemsList] joinString " "; + private _printUnavailableItemsList = ["Unavailable items:", str _unavailableItemsList] joinString " "; + + diag_log text (format ["%1%5 %2%5 %3%5 %4", _printComponent, "Name: " + _loadoutName, _printNullItemsList, _printUnavailableItemsList, endl]); + }; + + if (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts || {!_sharingEnabled}) then { + _contentPanelCtrl lnbSetColumnsPos [0, 0, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90]; + } else { + _contentPanelCtrl lnbSetColumnsPos [0, 0.05, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90]; + }; + + private _newRow = _contentPanelCtrl lnbAddRow ["",_loadoutName]; + + ADD_LOADOUTS_LIST_PICTURES + + if (_nullItemsAmount > 0) then { + + _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; + } else { + + if (_unavailableItemsAmount > 0) then { + _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; + }; + }; + + _contentPanelCtrl setVariable [_loadoutName + str GVAR(currentLoadoutsTab), [_loadout, _nullItemsAmount, _unavailableItemsAmount, _nullItemsList, _unavailableItemsList]]; + + if ((profileName + _loadoutName) in _sharedLoadoutsVars && {GVAR(currentLoadoutsTab) == IDC_buttonMyLoadouts}) then { + _contentPanelCtrl lnbSetPicture [[_newRow, 0], QPATHTOF(data\iconPublic.paa)]; + _contentPanelCtrl lnbSetValue [[_newRow, 0], 1]; + }; + } foreach ([_data, +GVAR(defaultLoadoutsList)] select (ctrlIDC _control == IDC_buttonDefaultLoadouts)); +} else { + + { + _x params ["_playerName", "_loadoutName", "_loadoutData"]; + + if ((allPlayers apply {name _x}) find _playerName == -1) then { + + private _loadoutVar = _playerName + _loadoutName; + + GVAR(sharedLoadoutsNamespace) setVariable [_loadoutVar, nil, true]; + _sharedLoadoutsVars = _sharedLoadoutsVars - [_loadoutVar]; + GVAR(sharedLoadoutsNamespace) setVariable [QGVAR(sharedLoadoutsNamespace), _sharedLoadoutsVars, true]; + + [QGVAR(loadoutUnshared), [_contentPanelCtrl, profileName, _loadoutName]] call CBA_fnc_remoteEvent; + } else { + + ([_loadoutData] call FUNC(verifyLoadout)) params ["_loadout", "_nullItemsAmount", "_unavailableItemsAmount"]; + + _contentPanelCtrl lnbSetColumnsPos [0, 0.15, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90]; + private _newRow = _contentPanelCtrl lnbAddRow [_playerName, _loadoutName]; + + ADD_LOADOUTS_LIST_PICTURES + + _contentPanelCtrl lnbSetData [[_newRow, 1], _playerName + _loadoutName]; + + if (_nullItemsAmount > 0) then { + + _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; + } else { + + if (_unavailableItemsAmount > 0) then { + _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; + }; + }; + }; + } foreach (_sharedLoadoutsVars apply {GVAR(sharedLoadoutsNamespace) getVariable _x}); +}; + +_contentPanelCtrl lnbSort [1, false]; diff --git a/addons/arsenal/functions/fnc_fillRightPanel.sqf b/addons/arsenal/functions/fnc_fillRightPanel.sqf new file mode 100644 index 0000000000..99194b065e --- /dev/null +++ b/addons/arsenal/functions/fnc_fillRightPanel.sqf @@ -0,0 +1,361 @@ +/* + * Author: Alganthe + * Fill right panel. + * + * Arguments: + * 0: Arsenal display + * 1: Tab control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +private _ctrlIDC = ctrlIDC _control; + +// Fade old control background +if !(isNil QGVAR(currentRightPanel)) then { + private _previousCtrlBackground = _display displayCtrl (GVAR(currentRightPanel) - 1); + _previousCtrlBackground ctrlSetFade 1; + _previousCtrlBackground ctrlCommit FADE_DELAY; +}; + +// Show new control background +private _ctrlBackground = _display displayCtrl (_ctrlIDC - 1); +_ctrlBackground ctrlShow true; +_ctrlBackground ctrlSetFade 0; +_ctrlBackground ctrlCommit FADE_DELAY; + +private _searchbarCtrl = _display displayCtrl IDC_rightSearchbar; + +if (!(ctrlShown _searchbarCtrl) || {ctrlFade _searchbarCtrl > 0}) then { + _searchbarCtrl ctrlShow true; + _searchbarCtrl ctrlSetFade 0; + _searchbarCtrl ctrlCommit 0; +}; + +private _fnc_fill_right_Container = { + params ["_configCategory", "_className", "_isMagazine", ["_isUnique", false, [false]]]; + + private _cacheNamespace = _ctrlPanel; + private _cachedItemInfo = _cacheNamespace getVariable [_configCategory+_className, []]; + + // Not in cache. So get info and put into cache + if (_cachedItemInfo isEqualTo []) then { + private _configPath = configFile >> _configCategory >> _className; + + _cachedItemInfo set [0, getText (_configPath >> "displayName")]; + _cachedItemInfo set [1, getText (_configPath >> "picture")]; + _cachedItemInfo set [2, [getNumber (_configPath >> "itemInfo" >> "mass"), getNumber (_configPath >> "mass")] select _isMagazine]; + + _cacheNamespace setVariable [_configCategory+_className, _cachedItemInfo]; + }; + + _cachedItemInfo params ["_displayName","_picture", "_mass"]; + + private _lbAdd = _ctrlPanel lnbAddRow ["", _displayName, "0"]; + private _columns = count lnbGetColumnsPosition _ctrlPanel; + + _ctrlPanel lnbSetData [[_lbAdd, 0], _x]; + _ctrlPanel lnbSetPicture [[_lbAdd, 0], _picture]; + _ctrlPanel lnbSetValue [[_lbAdd, 0], _mass]; + _ctrlPanel setVariable [_x, _mass]; + _ctrlPanel lnbSetValue [[_lbAdd, 2], [0, 1] select (_isUnique)]; + _ctrlPanel lbSetTooltip [_lbAdd * _columns,format ["%1\n%2", _displayName, _x]]; +}; + +// Retrieve compatible mags +private _compatibleItems = []; +private _compatibleMagazines = [[[], []], [[], []], [[], []]]; +{ + if (_x != "") then { + private _weaponConfig = (configFile >> "CfgWeapons" >> _x); + private _index = _forEachIndex; + + { + private _subIndex = _forEachIndex; + { + // Magazine group + if !(isClass (configFile >> "CfgMagazines" >> _x)) then { + private _magazineGroups = uiNamespace getVariable [QGVAR(magazineGroups),["#CBA_HASH#",[],[],[]]]; + private _magArray = [_magazineGroups, _x] call CBA_fnc_hashGet; + {((_compatibleMagazines select _index) select _subIndex) pushBackUnique _x} forEach _magArray; + } else { + ((_compatibleMagazines select _index) select _subIndex) pushBackUnique _x + } + } foreach ([getArray (_weaponConfig >> _x >> "magazines"), getArray (_weaponConfig >> "magazines")] select (_x == "this")); + } foreach getArray (_weaponConfig >> "muzzles"); + }; +} foreach [primaryWeapon GVAR(center), handgunWeapon GVAR(center), secondaryWeapon GVAR(center)]; + +private _itemsToCheck = []; +private _compatibleMagsPrimaryMuzzle = []; +private _compatibleMagsSecondaryMuzzle = []; + +private _allCompatibleMags = []; +{ + _allCompatibleMags append (_x select 0); + _allCompatibleMags append (_x select 1); +} foreach _compatibleMagazines; + +private _ctrlPanel = _display displayCtrl IDC_rightTabContent; + +switch (GVAR(currentLeftPanel)) do { + case IDC_buttonPrimaryWeapon : { + _compatibleMagsPrimaryMuzzle = _compatibleMagazines select 0 select 0; + _compatibleMagsSecondaryMuzzle = _compatibleMagazines select 0 select 1; + _compatibleItems = (primaryWeapon GVAR(center)) call bis_fnc_compatibleItems; + _itemsToCheck = GVAR(currentItems) select 18; + }; + + case IDC_buttonHandgun : { + _compatibleMagsPrimaryMuzzle = _compatibleMagazines select 1 select 0; + _compatibleMagsSecondaryMuzzle = _compatibleMagazines select 1 select 1; + _compatibleItems = (handgunWeapon GVAR(center)) call bis_fnc_compatibleItems; + _itemsToCheck = GVAR(currentItems) select 20; + }; + + case IDC_buttonSecondaryWeapon : { + _compatibleMagsPrimaryMuzzle = _compatibleMagazines select 2 select 0; + _compatibleMagsSecondaryMuzzle = _compatibleMagazines select 2 select 1; + _compatibleItems = (secondaryWeapon GVAR(center)) call bis_fnc_compatibleItems; + _itemsToCheck = GVAR(currentItems) select 19; + }; + + case IDC_buttonUniform; + case IDC_buttonVest; + case IDC_buttonBackpack : { + _ctrlPanel = _display displayCtrl IDC_rightTabContentListnBox; + }; +}; + +_itemsToCheck = _itemsToCheck apply {toLower _x}; +_compatibleItems = _compatibleItems apply {toLower _x}; + +lbClear (_display displayCtrl IDC_rightTabContentListnBox); +lbClear (_display displayCtrl IDC_rightTabContent); + +(_display displayCtrl IDC_rightTabContentListnBox) lbSetCurSel -1; +(_display displayCtrl IDC_rightTabContent) lbSetCurSel -1; + +private _leftPanelState = GVAR(currentLeftPanel) in [IDC_buttonPrimaryWeapon, IDC_buttonHandgun, IDC_buttonSecondaryWeapon]; + +if (_ctrlIDC in [RIGHT_PANEL_ACC_IDCS, IDC_buttonCurrentMag, IDC_buttonCurrentMag2] && {_leftPanelState}) then { + private _addEmpty = _ctrlPanel lbadd format [" <%1>",localize "str_empty"]; + _ctrlPanel lbsetvalue [_addEmpty, -1]; +}; + +switch (_ctrlIDC) do { + + case IDC_buttonOptic : { + if (_leftPanelState) then { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (_compatibleItems arrayIntersect (((GVAR(virtualItems) select 1) select 0) apply {toLower _x})); + } else { + { + ["CfgWeapons", _x, false] call _fnc_fill_right_Container; + } foreach ((GVAR(virtualItems) select 1) select 0); + { + ["CfgWeapons", _x, false, true] call _fnc_fill_right_Container; + } foreach ((GVAR(virtualItems) select 22) select 0); + }; + }; + + case IDC_buttonItemAcc : { + if (_leftPanelState) then { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (_compatibleItems arrayIntersect (((GVAR(virtualItems) select 1) select 1) apply {toLower _x})); + } else { + { + ["CfgWeapons", _x, false] call _fnc_fill_right_Container; + } foreach ((GVAR(virtualItems) select 1) select 1); + { + ["CfgWeapons", _x, false, true] call _fnc_fill_right_Container; + } foreach ((GVAR(virtualItems) select 22) select 1); + }; + }; + + case IDC_buttonMuzzle : { + if (_leftPanelState) then { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (_compatibleItems arrayIntersect (((GVAR(virtualItems) select 1) select 2) apply {toLower _x})); + } else { + { + ["CfgWeapons", _x, false] call _fnc_fill_right_Container; + } foreach ((GVAR(virtualItems) select 1) select 2); + { + ["CfgWeapons", _x, false, true] call _fnc_fill_right_Container; + } foreach ((GVAR(virtualItems) select 22) select 2); + }; + }; + + case IDC_buttonBipod : { + if (_leftPanelState) then { + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach (_compatibleItems arrayIntersect (((GVAR(virtualItems) select 1) select 3) apply {toLower _x})); + } else { + { + ["CfgWeapons", _x, false] call _fnc_fill_right_Container; + } foreach ((GVAR(virtualItems) select 1) select 3); + { + ["CfgWeapons", _x, false, true] call _fnc_fill_right_Container; + } foreach ((GVAR(virtualItems) select 22) select 3); + }; + }; + + case IDC_buttonCurrentMag : { + if (_leftPanelState) then { + { + ["CfgMagazines", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach ((GVAR(virtualItems) select 2) arrayIntersect _compatibleMagsPrimaryMuzzle); + }; + }; + + case IDC_buttonCurrentMag2 : { + if (_leftPanelState) then { + { + ["CfgMagazines", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach ((GVAR(virtualItems) select 2) arrayIntersect _compatibleMagsSecondaryMuzzle); + }; + }; + + case IDC_buttonMag : { + { + ["CfgMagazines", _x, true] call _fnc_fill_right_Container; + } foreach ((GVAR(virtualItems) select 2) arrayIntersect _allCompatibleMags); + { + ["CfgMagazines", _x, true, true] call _fnc_fill_right_Container; + } foreach ((GVAR(virtualItems) select 19) arrayIntersect _allCompatibleMags); + }; + + case IDC_buttonMagALL : { + { + ["CfgMagazines", _x, true] call _fnc_fill_right_Container; + } foreach (GVAR(virtualItems) select 2); + { + ["CfgMagazines", _x, true, true] call _fnc_fill_right_Container; + } foreach (GVAR(virtualItems) select 19); + }; + + case IDC_buttonThrow : { + { + ["CfgMagazines", _x, true] call _fnc_fill_right_Container; + } foreach (GVAR(virtualItems) select 15); + { + ["CfgMagazines", _x, true, true] call _fnc_fill_right_Container; + } foreach (GVAR(virtualItems) select 20); + }; + + case IDC_buttonPut : { + { + ["CfgMagazines", _x, true] call _fnc_fill_right_Container; + } foreach (GVAR(virtualItems) select 16); + { + ["CfgMagazines", _x, true, true] call _fnc_fill_right_Container; + } foreach (GVAR(virtualItems) select 21); + }; + + case IDC_buttonMisc : { + { + ["CfgWeapons", _x, false] call _fnc_fill_right_Container; + } foreach (GVAR(virtualItems) select 17); + { + ["CfgWeapons", _x, false, true] call _fnc_fill_right_Container; + } foreach (GVAR(virtualItems) select 18); + { + ["CfgVehicles", _x, false, true] call _fnc_fill_right_Container; + } foreach (GVAR(virtualItems) select 23); + { + ["CfgGlasses", _x, false, true] call _fnc_fill_right_Container; + } foreach (GVAR(virtualItems) select 24); + }; +}; + +if (GVAR(currentRightPanel) != _ctrlIDC) then { + (_display displayCtrl IDC_rightSearchbar) ctrlSetText ""; +}; + +GVAR(currentRightPanel) = _ctrlIDC; + +[QGVAR(rightPanelFilled), [_display, GVAR(currentLeftPanel), _ctrlIDC]] call CBA_fnc_localEvent; + +// Add current items and change progress bar +if (GVAR(currentLeftPanel) in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBackpack]) then { + + private _maxLoad = 0; + private _container = switch (GVAR(currentLeftPanel)) do { + case IDC_buttonUniform : { + (_display displayCtrl IDC_loadIndicatorBar) progressSetPosition (loadUniform GVAR(center)); + _maxLoad = gettext (configfile >> "CfgWeapons" >> uniform GVAR(center) >> "ItemInfo" >> "containerClass"); + uniformItems GVAR(center) + }; + case IDC_buttonVest : { + (_display displayCtrl IDC_loadIndicatorBar) progressSetPosition (loadVest GVAR(center)); + _maxLoad = gettext (configfile >> "CfgWeapons" >> vest GVAR(center) >> "ItemInfo" >> "containerClass"); + vestItems GVAR(center) + }; + case IDC_buttonBackpack : { + (_display displayCtrl IDC_loadIndicatorBar) progressSetPosition (loadBackpack GVAR(center)); + _maxLoad = backpack GVAR(center); + backpackItems GVAR(center) + }; + }; + + for "_l" from 0 to ((lnbsize _ctrlPanel select 0) - 1) do { + private _class = _ctrlPanel lnbData [_l, 0]; + _ctrlPanel lnbSetText [[_l, 2], ["0", str ({_x == _class} count _container)] select (_class in _container)]; + }; + + [_ctrlPanel, _maxLoad] call FUNC(updateRightPanel); +}; + +// Sorting +private _sortRightCtrl = _display displayCtrl IDC_sortRightTab; +private _sortRightCurSel = lbCurSel _sortRightCtrl; + +if (lbSize _sortRightCtrl == 3) then { + _sortRightCtrl lbDelete 2; +}; + +if (_leftPanelState) then { + _sortRightCtrl lbDelete 1; + _sortRightCtrl lbAdd (localize "STR_a3_rscdisplayarsenal_sort_mod"); + _sortRightCtrl lbSetValue [1, 1]; + + _sortRightCtrl lbSetCurSel ([0, _sortRightCurSel] select (_sortRightCurSel != 2)); +} else { + _sortRightCtrl lbDelete 1; + _sortRightCtrl lbAdd localize LSTRING(sortByWeightText); + _sortRightCtrl lbSetValue [1, 1]; + + _sortRightCtrl lbAdd localize LSTRING(sortByAmountText); + _sortRightCtrl lbSetValue [2, 2]; + + _sortRightCtrl lbSetCurSel _sortRightCurSel; +}; + +[_sortRightCtrl, _sortRightCtrl lbValue (lbCurSel _sortRightCtrl)] call FUNC(sortPanel); + +// Select current data if not in a container +if !(_itemsToCheck isEqualTo []) then { + for "_lbIndex" from 0 to (lbSize _ctrlPanel - 1) do { + private _currentData = _ctrlPanel lbData _lbIndex; + + if ((_currentData != "") && {tolower _currentData in _itemsToCheck}) exitWith { + _ctrlPanel lbSetCurSel _lbIndex; + }; + }; + + if (lbCurSel _ctrlPanel < 0) then { + _ctrlPanel lbSetCurSel 0; + }; +}; diff --git a/addons/arsenal/functions/fnc_handleLoadoutsSearchbar.sqf b/addons/arsenal/functions/fnc_handleLoadoutsSearchbar.sqf new file mode 100644 index 0000000000..07a42c4fd5 --- /dev/null +++ b/addons/arsenal/functions/fnc_handleLoadoutsSearchbar.sqf @@ -0,0 +1,45 @@ +/* + * Author: Alganthe + * Handles keyboard inputs inside the searchbars text boxes. + * + * Arguments: + * 0: Loadouts display + * 1: Searchbar control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +private _textString = ctrlText _control; + +private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; + +if !(GVAR(lastSearchTextLoadouts) isEqualTo "" || {(_textString find GVAR(lastSearchTextLoadouts)) == 0}) then {//don't refill if there is no need + [_display, _display displayCtrl GVAR(currentLoadoutsTab)] call FUNC(fillLoadoutsList); +}; + +GVAR(lastSearchTextLoadouts) = _textString; +if (count _textString == 0) exitWith {}; + +private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; + +private _itemsToGo = (lnbSize _contentPanelCtrl) select 0; +private _lbIndex = 0; +while {_itemsToGo > 0} do { + private _currentData = _contentPanelCtrl lnbText [_lbIndex, 1]; + private _currentClassname = _contentPanelCtrl lnbData [_lbIndex, 0]; + + if ((_currentData isEqualTo "") || {(((toUpper _currentData) find (toUpper _textString)) == -1) && {((toUpper _currentClassname) find (toUpper _textString)) == -1}}) then { + _contentPanelCtrl lnbDeleteRow _lbIndex; + } else { + _lbIndex = _lbIndex + 1; + }; + _itemsToGo = _itemsToGo - 1; +}; +_contentPanelCtrl lnbSetCurSelRow -1; diff --git a/addons/arsenal/functions/fnc_handleMouse.sqf b/addons/arsenal/functions/fnc_handleMouse.sqf new file mode 100644 index 0000000000..16548f3985 --- /dev/null +++ b/addons/arsenal/functions/fnc_handleMouse.sqf @@ -0,0 +1,73 @@ +/* + * Author: Karel Moricky, modified by Alganthe + * Update the camera position and pitch/bank. + * Modernized a bit, modified to fit the rewrite. + * + * Arguments: + * 0: Not used + * 1: Arguments + * 1.1: Mouse area control + * 1.2: Mouse X position + * 1.3: Mouse Y position + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["", "_args"]; + +_args params ["_control", "_mouseX", "_mouseY"]; +GVAR(cameraPosition) params ["_distance", "_dirH", "_dirV", "_helperPos"]; +GVAR(mouseButtonState) params ["_LMB", "_RMB"]; + +if (count _LMB > 0) then { + _LMB params ["_LMBcursorX", "_LMBcursorY"]; + private _dX = [(_mouseX - _LMBcursorX), (_LMBcursorX - _mouseX)] select GVAR(camInverted); + private _dY = [(_mouseY -_LMBcursorY), (_LMBcursorY - _mouseY)] select GVAR(camInverted); + GVAR(mouseButtonState) set [0,[_mouseX,_mouseY]]; + + private _centerBox = boundingboxreal GVAR(center); + private _centerSizeBottom = _centerBox select 0 select 2; + private _centerSizeUp = _centerBox select 1 select 2; + private _centerSize = sqrt ([_centerBox select 0 select 0,_centerBox select 0 select 1] distance [_centerBox select 1 select 0,_centerBox select 1 select 1]); + + _helperPos = [_helperPos, _dX * _centerSize, _dirH - 90] call bis_fnc_relpos; + _helperPos = [ + [0,0,((_helperPos select 2) - _dY * _centerSize) max _centerSizeBottom min _centerSizeUp], + ([0,0,0] distance2D _helperPos) min _centerSize, + [0,0,0] getDir _helperPos + ] call bis_fnc_relpos; + + _helperPos set [2,(_helperPos select 2) max ((boundingboxreal GVAR(center) select 0 select 2) + 0.2)]; + + //--- Do not let target go below ground + private _posZmin = 0.1; + private _targetWorldPosZ = (GVAR(center) modeltoworldvisual _helperPos) select 2; + if (_targetWorldPosZ < _posZmin) then {_helperPos set [2,(_helperPos select 2) - _targetWorldPosZ + _posZmin];}; + + GVAR(cameraPosition) set [3,_helperPos]; +}; + +if (count _RMB > 0) then { + _RMB params ["_RMBcursorX", "_RMBcursorY"]; + private _dX = (_RMBcursorX - _mouseX) * 0.75; + private _dY = (_RMBcursorY - _mouseY) * 0.75; + _helperPos = [ + [0,0,_helperPos select 2], + [0,0,0] distance2D _helperPos, + ([0,0,0] getDir _helperPos) - _dX * 360 + ] call bis_fnc_relpos; + + GVAR(cameraPosition) set [1,(_dirH - _dX * 360)]; + GVAR(cameraPosition) set [2,(_dirV - _dY * 100) max -89 min 89]; + GVAR(cameraPosition) set [3,_helperPos]; + GVAR(mouseButtonState) set [1,[_mouseX,_mouseY]]; +}; + +if (!alive (GVAR(center)) || isnull GVAR(center)) then { + (ctrlParent _control) closeDisplay 2; +}; diff --git a/addons/arsenal/functions/fnc_handleScrollWheel.sqf b/addons/arsenal/functions/fnc_handleScrollWheel.sqf new file mode 100644 index 0000000000..e7dc3bbc1e --- /dev/null +++ b/addons/arsenal/functions/fnc_handleScrollWheel.sqf @@ -0,0 +1,25 @@ +/* + * Author: Alganthe + * Handle the mouse wheel. + * + * Arguments: + * 0: Not used + * 1: Mousewheel Z position + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["", "_args"]; +_args params ["", "_zPos"]; + +private _distanceMax = ((boundingboxreal GVAR(center) select 0) vectordistance (boundingboxreal GVAR(center) select 1)) * 1.5; +private _distanceMin = _distanceMax * 0.15; +private _distance = GVAR(cameraPosition) select 0; + +_distance = (_distance - (_zPos / 10)) max _distanceMin min _distanceMax; +GVAR(cameraPosition) set [0, _distance]; diff --git a/addons/arsenal/functions/fnc_handleSearchbar.sqf b/addons/arsenal/functions/fnc_handleSearchbar.sqf new file mode 100644 index 0000000000..87b03d8c57 --- /dev/null +++ b/addons/arsenal/functions/fnc_handleSearchbar.sqf @@ -0,0 +1,92 @@ +/* + * Author: Alganthe + * Handles keyboard inputs inside the searchbars text boxes. + * + * Arguments: + * 0: Arsenal display + * 1: Searchbar control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +private _textString = ctrlText _control; + +if ((ctrlIDC _control) == IDC_rightSearchbar) then { + if !(GVAR(lastSearchTextRight) isEqualTo "" || {(_textString find GVAR(lastSearchTextRight)) == 0}) then {//don't refill if there is no need + [_display, _display displayCtrl GVAR(currentRightPanel)] call FUNC(fillRightPanel); + }; + GVAR(lastSearchTextRight) = _textString; + if (count _textString == 0) exitWith {}; + + private _rightPanelState = GVAR(currentLeftPanel) in [IDC_buttonPrimaryWeapon, IDC_buttonHandgun, IDC_buttonSecondaryWeapon]; + private _rightPanelCtrl = [_display displayCtrl IDC_rightTabContentListnBox, _display displayCtrl IDC_rightTabContent] select (_rightPanelState); + + if (_rightPanelState) then { + + private _itemsToGo = lbSize _rightPanelCtrl; + private _lbIndex = 0; + while {_itemsToGo > 0} do { + private _currentData = _rightPanelCtrl lbText _lbIndex; + private _currentClassname = _rightPanelCtrl lbData _lbIndex; + + if ((_currentData isEqualTo "") || {(((toUpper _currentData) find (toUpper _textString)) == -1) && {((toUpper _currentClassname) find (toUpper _textString)) == -1}}) then { + _rightPanelCtrl lbDelete _lbIndex; + } else { + _lbIndex = _lbIndex + 1; + }; + _itemsToGo = _itemsToGo - 1; + }; + _rightPanelCtrl lbSetCurSel -1; + } else { + + private _itemsToGo = (lnbSize _rightPanelCtrl) select 0; + private _lbIndex = 0; + while {_itemsToGo > 0} do { + private _currentData = _rightPanelCtrl lnbText [_lbIndex, 1]; + private _currentClassname = _rightPanelCtrl lnbData [_lbIndex, 0]; + + if ((_currentData isEqualTo "") || {(((toUpper _currentData) find (toUpper _textString)) == -1) && {((toUpper _currentClassname) find (toUpper _textString)) == -1}}) then { + _rightPanelCtrl lnbDeleteRow _lbIndex; + } else { + _lbIndex = _lbIndex + 1; + }; + _itemsToGo = _itemsToGo - 1; + }; + _rightPanelCtrl lnbSetCurSelRow -1; + }; + + [_display, nil, nil, configNull] call FUNC(itemInfo); +} else { + + if !(GVAR(lastSearchTextLeft) isEqualTo "" || {(_textString find GVAR(lastSearchTextLeft)) == 0}) then {//don't refill if there is no need + [_display, _display displayCtrl GVAR(currentLeftPanel)] call FUNC(fillLeftPanel); + }; + GVAR(lastSearchTextLeft) = _textString; + if (count _textString == 0) exitWith {}; + + private _leftPanelCtrl = _display displayCtrl IDC_leftTabContent; + + + private _itemsToGo = (lbSize _leftPanelCtrl); + private _lbIndex = 0; + while {_itemsToGo > 0} do { + private _currentData = _leftPanelCtrl lbText _lbIndex; + private _currentClassname = _leftPanelCtrl lbData _lbIndex; + + if ((_currentData isEqualTo "") || {(((toUpper _currentData) find (toUpper _textString)) == -1) && {((toUpper _currentClassname) find (toUpper _textString)) == -1}}) then { + _leftPanelCtrl lbDelete _lbIndex; + } else { + _lbIndex = _lbIndex + 1; + }; + _itemsToGo = _itemsToGo - 1; + }; + _leftPanelCtrl lbSetCurSel -1; + [_display, nil, nil, configNull] call FUNC(itemInfo); +}; diff --git a/addons/arsenal/functions/fnc_initBox.sqf b/addons/arsenal/functions/fnc_initBox.sqf new file mode 100644 index 0000000000..55c0ab653e --- /dev/null +++ b/addons/arsenal/functions/fnc_initBox.sqf @@ -0,0 +1,61 @@ +/* + * Author: Alganthe + * Initialize a box / object for arsenal. + * + * Arguments: + * 0: Target + * 1: Items or + * 2: Initialize globally + * + * Return Value: + * None + * + * Example: + * [_box, ["MyItem1", "MyItem2", "MyItemN"]] call ace_arsenal_fnc_initBox + * [_box, true] call ace_arsenal_fnc_initBox + * + * Public: Yes +*/ +#include "script_component.hpp" + +params [["_object", objNull, [objNull]], ["_items", true, [[], true]], ["_global", true, [true]]]; + +if (isNull _object) exitWith {}; + +if (isNil QGVAR(EHIDArray)) then { + GVAR(EHIDArray) = []; +}; + +if (_global && {isMultiplayer} && {{_object in _x} count GVAR(EHIDArray) == 0}) then { + + private _ID = [QGVAR(initBox), [_object, _items, false]] call CBA_fnc_globalEventJIP; + [_ID, _object] call CBA_fnc_removeGlobalEventJIP; + + GVAR(EHIDArray) pushBack [_ID, _object]; + publicVariable QGVAR(EHIDArray); +} else { + + if ({(_x select 0) select 0 isEqualTo QGVAR(interaction)} count (_object getVariable [QEGVAR(interact_menu,actions), []]) == 0) then { + + private _action = [ + QGVAR(interaction), + localize "STR_A3_Arsenal", + "", + { + params ["_target", "_player"]; + + [{[_this select 0, _this select 1] call FUNC(openBox)}, [_target, _player]] call CBA_fnc_execNextFrame; + }, + { + params ["_target", "_player"]; + + [_player, _target, ["isNotSwimming", "isNotCarrying", "isNotDragging", "notOnMap", "isNotEscorting", "isNotOnLadder"]] call EFUNC(common,canInteractWith) + }, + {}, + [] + ] call EFUNC(interact_menu,createAction); + [_object, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject); + + [_object, _items, false] call FUNC(addVirtualItems); + }; +}; diff --git a/addons/arsenal/functions/fnc_itemInfo.sqf b/addons/arsenal/functions/fnc_itemInfo.sqf new file mode 100644 index 0000000000..9dcfe2ea86 --- /dev/null +++ b/addons/arsenal/functions/fnc_itemInfo.sqf @@ -0,0 +1,75 @@ +/* + * Author: Alganthe + * Update arsenal's info box. + * + * Arguments: + * 0: Arsenal display + * 1: Current panel control + * 2: Current panel selection + * 3: Item config entry + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control", "_curSel" ,"_itemCfg"]; + +private _ctrlInfo = _display displayCtrl IDC_infoBox; + +if (isClass _itemCfg) then { + + _ctrlInfo ctrlSetFade 0; + _ctrlInfo ctrlCommit FADE_DELAY; + + // Name + author + private _ctrlInfoName = _display displayCtrl IDC_infoName; + _ctrlInfoName ctrlSetText ([_control lbText _curSel, _control lnbText [_curSel, 1]] select (ctrlType _control == 102)); + + private _ctrlInfoAuthor = _display displayctrl IDC_infoAuthor; + _ctrlInfoAuthor ctrlSetText ""; + + private _itemAuthor = getText (_itemCfg >> "author"); + _ctrlInfoAuthor ctrlSetText ([localize "STR_AUTHOR_UNKNOWN", format [localize "STR_FORMAT_AUTHOR_SCRIPTED",_itemAuthor]] select (_itemAuthor != "")); + + // DLC / mod icon + private _ctrlDLC = _display displayctrl IDC_DLCIcon; + private _ctrlDLCBackground = _display displayctrl IDC_DLCBackground; + private _dlc = _itemCfg call GETDLC; + if (_dlc != "") then { + + private _dlcParams = modParams [_dlc, ["name", "logo", "logoOver"]]; + _dlcParams params ["_name", "_logo", "_logoOver"]; + private _appId = getnumber (configfile >> "CfgMods" >> _dlc >> "appId"); + + _ctrlDLC ctrlsettooltip _name; + _ctrlDLC ctrlsettext _logo; + _ctrlDLCBackground ctrlsetfade 0; + _ctrlDLC ctrlsetfade 0; + if (_appId > 0) then { + _ctrlDLC ctrlseteventhandler ["mouseexit",format ["(_this select 0) ctrlsettext '%1';",_logo]]; + _ctrlDLC ctrlseteventhandler ["mouseenter",format ["(_this select 0) ctrlsettext '%1';",_logoOver]]; + _ctrlDLC ctrlseteventhandler [ + "buttonclick", + format ["uiNamespace setvariable ['RscDisplayDLCPreview_dlc','%1']; ctrlparent (_this select 0) createDisplay 'RscDisplayDLCPreview';", _dlc] + ]; + } else { + _ctrlDLC ctrlRemoveAllEventHandlers "buttonclick"; + _ctrlDLC ctrlRemoveAllEventHandlers "mouseexit"; + _ctrlDLC ctrlRemoveAllEventHandlers "mouseenter"; + }; + } else { + _ctrlDLC ctrlsetfade 1; + _ctrlDLCBackground ctrlsetfade 1; + }; + + _ctrlDLC ctrlcommit 0; + _ctrlDLCBackground ctrlcommit 0; + +} else { + _ctrlInfo ctrlSetFade 1; + _ctrlInfo ctrlCommit FADE_DELAY; +}; diff --git a/addons/arsenal/functions/fnc_loadoutsChangeTab.sqf b/addons/arsenal/functions/fnc_loadoutsChangeTab.sqf new file mode 100644 index 0000000000..7842df8704 --- /dev/null +++ b/addons/arsenal/functions/fnc_loadoutsChangeTab.sqf @@ -0,0 +1,77 @@ +/* + * Author: Alganthe + * Handles tab changing for the loadouts display. + * + * Arguments: + * 0: Arsenal display + * 1: Tab control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +if !(ctrlEnabled _control || {GVAR(currentLoadoutsTab) == ctrlIDC _control}) exitWith {}; + +private _centerBoxTitleCtrl = _display displayCtrl IDC_centerTitle; +private _shareButtonCtrl = _display displayCtrl IDC_buttonShare; +private _saveButtonCtrl = _display displayCtrl IDC_buttonSave; +private _loadButtonCtrl = _display displayCtrl IDC_buttonLoad; +private _deleteButtonCtrl = _display displayCtrl IDC_buttonDelete; +private _renameButtonCtrl = _display displayCtrl IDC_buttonRename; + +// Update UI visual elements +if (GVAR(currentLoadoutsTab) != -1) then { + + private _previousCtrlBackground = _display displayCtrl (GVAR(currentLoadoutsTab) - 1); + _previousCtrlBackground ctrlSetBackgroundColor [0, 0, 0, 0.8]; + _previousCtrlBackground ctrlCommit 0; + + private _previousCtrl = _display displayCtrl GVAR(currentLoadoutsTab); + _previousCtrl ctrlSetTextColor [1, 1, 1, 1]; + _previousCtrl ctrlCommit 0; +}; + +private _ctrlBackground = _display displayCtrl ((ctrlIDC _control) - 1); +_ctrlBackground ctrlSetBackgroundColor [1, 1, 1, 0.8]; +_ctrlBackground ctrlCommit 0; + +_control ctrlSetTextColor [0, 0, 0, 1]; +_control ctrlCommit 0; + +switch (ctrlIDC _control) do { + case IDC_buttonMyLoadouts: { + _centerBoxTitleCtrl ctrlSetText (localize LSTRING(tabMyLoadoutsText)); + + _saveButtonCtrl ctrlEnable true; + _saveButtonCtrl ctrlCommit 0; + }; + + case IDC_buttonDefaultLoadouts: { + _centerBoxTitleCtrl ctrlSetText (localize LSTRING(tabDefaultLoadoutsText)); + + _saveButtonCtrl ctrlEnable (is3DEN); + _saveButtonCtrl ctrlCommit 0; + }; + + case IDC_buttonSharedLoadouts: { + _centerBoxTitleCtrl ctrlSetText (localize LSTRING(tabSharedLoadoutsText)); + + _saveButtonCtrl ctrlEnable false; + _saveButtonCtrl ctrlCommit 0; + }; +}; + +{ + _x ctrlEnable false; + _x ctrlCommit 0; +} foreach [_shareButtonCtrl, _loadButtonCtrl, _deleteButtonCtrl, _renameButtonCtrl]; + +GVAR(currentLoadoutsTab) = ctrlIDC _control; + +[_display, _control] call FUNC(fillLoadoutsList); diff --git a/addons/arsenal/functions/fnc_message.sqf b/addons/arsenal/functions/fnc_message.sqf new file mode 100644 index 0000000000..92f922d7f9 --- /dev/null +++ b/addons/arsenal/functions/fnc_message.sqf @@ -0,0 +1,54 @@ +/* + * Author: Alganthe + * Displays messages in arsenal. + * + * Arguments: + * 0: Arsenal display + * 1: Message + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_message"]; + +private _messageBoxCtrl = _display displayCtrl IDC_message; +private _handle = _messageBoxCtrl getVariable QGVAR(messageBoxHandle); + +if !(isNil "_handle") then { + terminate _handle; +}; + +_handle = [_display, _messageBoxCtrl, time + 5, _message, FADE_DELAY] spawn { + disableSerialization; + + _this params ["_display", "_control", "_timer", "_message", "_delay"]; + + while {_timer >= time} do { + switch true do { + case (_display isEqualTo displayNull): { + terminate _thisScript; + }; + + case (round (_timer - time) == 5): { + _control ctrlSetText _message; + _control ctrlSetFade 1; + _control ctrlCommit 0; + + _control ctrlSetFade 0; + _control ctrlCommit _delay; + }; + }; + + uiSleep 1; + }; + + _control ctrlSetFade 1; + _control ctrlCommit _delay; + terminate _thisScript; +}; +_messageBoxCtrl setVariable [QGVAR(messageBoxHandle), _handle]; diff --git a/addons/arsenal/functions/fnc_onArsenalClose.sqf b/addons/arsenal/functions/fnc_onArsenalClose.sqf new file mode 100644 index 0000000000..52466f6746 --- /dev/null +++ b/addons/arsenal/functions/fnc_onArsenalClose.sqf @@ -0,0 +1,101 @@ +/* + * Author: Alganthe + * onUnLoad EH for arsenal. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +GVAR(camera) cameraEffect ["terminate", "back"]; +private _cameraData = [getposAtl GVAR(camera), (getposAtl GVAR(camera)) vectorFromTo (getposAtl GVAR(cameraHelper))]; + +[QGVAR(displayClosed), []] call CBA_fnc_localEvent; + +removeMissionEventHandler ["draw3D", GVAR(camPosUpdateHandle)]; + +camDestroy GVAR(camera); +GVAR(center) switchCamera GVAR(cameraView); +deleteVehicle GVAR(cameraHelper); + +if (is3DEN) then { + + private _centerOriginParent = objectParent GVAR(centerOrigin); + + if !(isNull _centerOriginParent) then { + _centerOriginParent hideObject false; + }; + + GVAR(centerOrigin) hideObject false; + + // Apply the loadout from the dummy to all selected units + { + _x setUnitLoadout (getUnitLoadout GVAR(center)); + _x setFace GVAR(currentFace); + _x setSpeaker GVAR(currentVoice); + } foreach (get3DENSelected "object"); + + save3DENInventory (get3DENSelected "object"); + + deleteVehicle GVAR(light); + deleteVehicle GVAR(center); + + GVAR(centerOrigin) = nil; + GVAR(light) = nil; + + get3DENCamera cameraEffect ["internal","back"]; + ["ShowInterface",true] call bis_fnc_3DENInterface; + GVAR(visionMode) call bis_fnc_3DENVisionMode; +} else { + // Select correct weapon + switch GVAR(selectedWeaponType) do { + case 0: {GVAR(center) selectWeapon primaryWeapon GVAR(center);}; + case 1: {GVAR(center) selectWeapon secondaryWeapon GVAR(center);}; + case 2: {GVAR(center) selectWeapon handgunWeapon GVAR(center);}; + }; +}; + +if (isMultiplayer) then { + + [QGVAR(broadcastFace), [GVAR(center), GVAR(currentFace)], QGVAR(center) + "_face"] call CBA_fnc_globalEventJIP; + [QGVAR(center) + "_face", GVAR(center)] call CBA_fnc_removeGlobalEventJIP; + + [QGVAR(broadcastVoice), [GVAR(center), GVAR(currentVoice)], QGVAR(center) + "_voice"] call CBA_fnc_globalEventJIP; + [QGVAR(center) + "_voice", GVAR(center)] call CBA_fnc_removeGlobalEventJIP; +}; + +if !(isnull curatorCamera) then { + curatorcamera setPosAtl (_cameraData select 0); + curatorcamera setVectorDir (_cameraData select 1); + curatorcamera cameraEffect ["internal","back"]; +}; + +GVAR(camera) = nil; +GVAR(cameraHelper) = nil; + +GVAR(mouseButtonState) = nil; +GVAR(currentLeftPanel) = nil; +GVAR(currentRightPanel) = nil; +GVAR(leftSearchbarFocus) = nil; +GVAR(rightSearchbarFocus) = nil; +GVAR(shiftState) = nil; +GVAR(leftTabFocus) = nil; +GVAR(rightTabFocus) = nil; +GVAR(rightTabLnBFocus) = nil; + +GVAR(selectedWeaponType) = nil; +GVAR(virtualItems) = nil; +GVAR(currentItems) = nil; +GVAR(currentFace) = nil; +GVAR(currentVoice) = nil; +GVAR(currentInsignia) = nil; +GVAR(currentAction) = nil; + +GVAR(center) = nil; + +showHUD true; diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf new file mode 100644 index 0000000000..6c53882008 --- /dev/null +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -0,0 +1,287 @@ +/* + * Author: Alganthe + * onLoad EH for arsenal. + * + * Arguments: + * 0: Ignored + * 1: Arguments + * 1.1: Arsenal display + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["", "_args"]; +_args params ["_display"]; + +//--------------- General vars +if (isNil QGVAR(center)) then { + GVAR(center) = player; +}; + +GVAR(mouseButtonState) = [[],[]]; + +if (isNil QGVAR(sharedLoadoutsNamespace)) then { + GVAR(sharedLoadoutsNamespace) = true call CBA_fnc_createNamespace; + publicVariable QGVAR(sharedLoadoutsNamespace); +}; + +if (isNil {GVAR(sharedLoadoutsNamespace) getVariable QGVAR(sharedLoadoutsVars)}) then { + GVAR(sharedLoadoutsNamespace) setVariable [QGVAR(sharedLoadoutsVars), [], true]; +}; + +if (isNil QGVAR(defaultLoadoutsList)) then { + if (is3DEN) then { + GVAR(defaultLoadoutsList) = (QGVAR(DummyCategory) get3DENMissionAttribute QGVAR(DefaultLoadoutsListAttribute)); + } else { + GVAR(defaultLoadoutsList) = []; + }; +}; + +if (isNil QGVAR(virtualItems)) then { + GVAR(virtualItems) = [[[], [], []], [[], [], [], []], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]; +}; + +GVAR(currentItems) = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", [], [], [], [], [], []]; + +GVAR(currentFace) = face GVAR(center); +GVAR(currentVoice) = speaker GVAR(center); +GVAR(currentInsignia) = GVAR(center) param [0, objNull, [objNull]] getVariable ["BIS_fnc_setUnitInsignia_class", ""]; + +GVAR(currentAction) = "Stand"; +GVAR(shiftState) = false; + +// Add the items the player has to virtualItems +for "_index" from 0 to 10 do { + switch (_index) do { + // primary, secondary, handgun weapons + case 0: { + private _array = LIST_DEFAULTS select _index; + + if !((_array select 0) isEqualTo "") then { + ((GVAR(virtualItems) select _index) select 0) pushBackUnique (_array select 0); + }; + + if !((_array select 1) isEqualTo "") then { + ((GVAR(virtualItems) select _index) select 1) pushBackUnique (_array select 1); + }; + + if !((_array select 2) isEqualTo "") then { + ((GVAR(virtualItems) select _index) select 2) pushBackUnique (_array select 2); + }; + }; + + // Accs for the weapons above + case 1: { + private _array = LIST_DEFAULTS select _index; + _array params ["_accsArray", "_magsArray"]; + + { + private _subIndex = _forEachIndex; + + { + if (_x != "") then { + (GVAR(virtualItems) select _index) select ([2, 1, 0, 3] select _forEachIndex) pushBackUnique _x; + }; + } foreach _x; + } foreach _accsArray; + + { + if !(_x isEqualTo []) then { + + if (_x select 0 != "") then { + (GVAR(virtualItems) select 2) pushBackUnique (_x select 0); + }; + + if (count _x > 1 && {_x select 1 != ""}) then { + (GVAR(virtualItems) select 2) pushBackUnique (_x select 1); + }; + }; + } foreach _magsArray; + }; + + // Inventory items + case 2: { + call FUNC(updateUniqueItemsList); + }; + + // The rest + default { + private _array = (LIST_DEFAULTS select _index) select {!(_x isEqualTo "")}; + if !(_array isEqualTo []) then { + {(GVAR(virtualItems) select _index) pushBackUnique _x} foreach _array; + }; + }; + }; +}; + +// Fill current items +for "_index" from 0 to 15 do { + switch (_index) do { + case 0; + case 1; + case 2:{ + GVAR(currentItems) set [_index, ((LIST_DEFAULTS select 0) select _index)]; + }; + case 3; + case 4; + case 5; + case 6; + case 7; + case 8; + case 9: { + GVAR(currentItems) set [_index, (LIST_DEFAULTS select _index) select 0]; + + }; + case 10: { + {(GVAR(currentItems) select 15) pushBack _x} forEach (uniformItems GVAR(center)); + }; + case 11: { + {(GVAR(currentItems) select 16) pushBack _x} forEach (vestItems GVAR(center)); + }; + case 12: { + {(GVAR(currentItems) select 17) pushBack _x} forEach (backpackItems GVAR(center)); + }; + case 13: { + GVAR(currentItems) set [18, (primaryWeaponItems GVAR(center)) + (primaryWeaponMagazine GVAR(center))]; + }; + case 14: { + GVAR(currentItems) set [19, (secondaryWeaponItems GVAR(center)) + (secondaryWeaponMagazine GVAR(center))]; + }; + case 15: { + GVAR(currentItems) set [20, (handgunItems GVAR(center)) + (handgunMagazine GVAR(center))]; + }; + }; +}; + +{ + private _simulationType = getText (configFile >> "CfgWeapons" >> _x >> "simulation"); + private _index = 10 + (["itemmap", "itemcompass", "itemradio", "itemwatch", "itemgps"] find (tolower _simulationType)); + + GVAR(currentItems) set [_index, _x]; +} foreach (assignedItems GVAR(center)); + +GVAR(currentWeaponType) = switch true do { + case (currentWeapon GVAR(center) == GVAR(currentItems) select 0): {0}; + case (currentWeapon GVAR(center) == GVAR(currentItems) select 1): {1}; + case (currentWeapon GVAR(center) == GVAR(currentItems) select 2): {2}; + default {-1}; +}; + +[QGVAR(displayOpened), []] call CBA_fnc_localEvent; + +//--------------- Fade out unused elements +private _mouseBlockCtrl = _display displayCtrl IDC_mouseBlock; +_mouseBlockCtrl ctrlEnable false; + +{ + _x = _display displayCtrl _x; + + _x ctrlSetFade 1; + _x ctrlShow false; + _x ctrlCommit 0; +} foreach [ + IDC_blockRightFrame, + IDC_blockRighttBackground, + IDC_loadIndicator, + IDC_rightTabContent, + IDC_rightTabContentListnBox, + IDC_sortRightTab, + RIGHT_PANEL_ACC_BACKGROUND_IDCS, + RIGHT_PANEL_ACC_IDCS, + RIGHT_PANEL_ITEMS_BACKGROUND_IDCS, + RIGHT_PANEL_ITEMS_IDCS, + IDC_buttonRemoveAll, + IDC_rightSearchbar +]; + +//--------------- Camera prep +cutText ["","plain"]; +showCommandingMenu ""; + +GVAR(cameraView) = cameraView; +GVAR(center) switchCamera "internal"; +showHUD false; + +private _mouseAreaCtrl = _display displayCtrl IDC_mouseArea; +ctrlSetFocus _mouseAreaCtrl; + +// 3DEN support, lifted from BIS_fnc_arsenal +if (is3DEN) then { + + GVAR(centerOrigin) = GVAR(center); + GVAR(centerOrigin) hideObject true; + + private _centerOriginParent = objectParent GVAR(centerOrigin); + if !(isNull _centerOriginParent) then { + _centerOriginParent hideObject true; + }; + + private _centerPos = position GVAR(centerOrigin); + + GVAR(center) = createAgent [typeOf GVAR(centerOrigin), position GVAR(centerOrigin), [], 0, "none"]; + GVAR(center) setPosAtl getPosAtl GVAR(centerOrigin); + GVAR(center) setDir (getDir GVAR(centerOrigin)); + GVAR(center) switchMove animationState GVAR(centerOrigin); + GVAR(center) switchAction "playerstand"; + GVAR(center) enableSimulation false; + + GVAR(center) setUnitLoadout (getUnitLoadout GVAR(centerOrigin)); + GVAR(center) setFace GVAR(currentFace); + GVAR(center) setSpeaker GVAR(currentVoice); + + //--- Create light for night editing (code based on BIS_fnc_3DENFlashlight) + private _intensity = 1; + GVAR(light) = "#lightpoint" createVehicle _centerPos; + GVAR(light) setLightBrightness _intensity; + GVAR(light) setLightAmbient [1,1,1]; + GVAR(light) setLightColor [0,0,0]; + GVAR(light) lightAttachObject [GVAR(centerOrigin), [0, 0, -_intensity * 7]]; + + //--- Use the same vision mode as in Eden + GVAR(visionMode)= -2 call bis_fnc_3DENVisionMode; + ["ShowInterface",false] spawn bis_fnc_3DENInterface; + if (get3denactionstate "togglemap" > 0) then {do3DENAction "togglemap";}; +}; + +//--------------- Prepare the left panel +GVAR(currentLeftPanel) = nil; +GVAR(currentRightPanel) = nil; +GVAR(leftSearchbarFocus) = false; +GVAR(rightSearchbarFocus) = false; +GVAR(leftTabFocus) = false; +GVAR(rightTabFocus) = false; +GVAR(rightTabLnBFocus) = false; + +{ + private _panel = _display displayCtrl _x; + _panel ctrlSetFontHeight (GVAR(fontHeight) * GRID_H); + _panel ctrlCommit 0; +} foreach [IDC_leftTabContent, IDC_rightTabContent, IDC_rightTabContentListnBox]; + +[_display, _display displayCtrl IDC_buttonPrimaryWeapon] call FUNC(fillLeftPanel); + +//--------------- Init camera +if (isNil QGVAR(cameraPosition)) then { + GVAR(cameraPosition) = [5,0,0,[0,0,0.85]]; +}; + +GVAR(cameraHelper) = createAgent ["Logic", position GVAR(center) ,[] ,0 ,"none"]; +GVAR(cameraHelper) attachTo [GVAR(center), GVAR(cameraPosition) select 3, ""]; + +GVAR(camera) = "camera" camCreate position GVAR(center); +GVAR(camera) cameraEffect ["internal","back"]; +GVAR(camera) camPrepareFocus [-1,-1]; +GVAR(camera) camPrepareFov 0.35; +GVAR(camera) camCommitPrepared 0; + +showCinemaBorder false; +["#(argb,8,8,3)color(0,0,0,1)",false,nil,0,[0,0.5]] call bis_fnc_textTiles; + +//--------------- Reset camera pos +[nil, [controlNull,0,0]] call FUNC(handleMouse); +GVAR(camPosUpdateHandle) = addMissionEventHandler ["draw3D",{ [] call FUNC(updateCamPos) }]; diff --git a/addons/arsenal/functions/fnc_onKeyDown.sqf b/addons/arsenal/functions/fnc_onKeyDown.sqf new file mode 100644 index 0000000000..b963974033 --- /dev/null +++ b/addons/arsenal/functions/fnc_onKeyDown.sqf @@ -0,0 +1,188 @@ +/* + * Author: Alganthe + * Handles keyboard inputs in arsenal. + * + * Arguments: + * 0: Arsenal display + * 1: Key being pressed + * 2: Shift state + * 3: Ctrl state + * 4: Alt state + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" +#include "\A3\ui_f\hpp\defineDIKCodes.inc" + +params ["", "_args"]; +_args params ["_display", "_keyPressed", "_shiftState", "_ctrlState", "_altState"]; + +GVAR(shiftState) = _shiftState; +private _return = true; +private _loadoutsDisplay = findDisplay IDD_loadouts_display; + +if !(_loadoutsDisplay isEqualTo displayNull) then { + if !(GVAR(loadoutsSearchbarFocus)) then { + switch true do { + // Close button + case (_keyPressed == DIK_ESCAPE): { + _display closeDisplay 2; + }; + // Search field + case (_keyPressed == DIK_F && {_ctrlState}): { + ctrlSetFocus (_loadoutsDisplay displayCtrl IDC_loadoutsSearchbar); + }; + }; + } else { + switch true do { + case (_keyPressed == DIK_ESCAPE): { + _display closeDisplay 2; + }; + case (_keyPressed == DIK_BACKSPACE): { + _return = false; + }; + case (_keyPressed == DIK_NUMPADENTER); + case (_keyPressed == DIK_RETURN): { + [_loadoutsDisplay, _loadoutsDisplay displayCtrl IDC_loadoutsSearchbar] call FUNC(handleLoadoutsSearchBar); + }; + case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): { + _return = false; + }; + }; + }; + + switch true do { + case (_keyPressed == DIK_C && {_ctrlState}): { + _return = false; + }; + case (_keyPressed == DIK_V && {_ctrlState}): { + _return = false; + }; + case (_keyPressed == DIK_A && {_ctrlState}): { + _return = false; + }; + case (_keyPressed == DIK_X && {_ctrlState}): { + _return = false; + }; + case (GVAR(loadoutsPanelFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}): { + _return = false; + }; + }; +} else { + + if (!GVAR(leftSearchbarFocus) && {!GVAR(rightSearchbarFocus)}) then { + + switch true do { + // Close button + case (_keyPressed == DIK_ESCAPE): { + _display closeDisplay 2; + }; + // Hide button + case (_keyPressed == DIK_BACKSPACE): { + [_display] call FUNC(buttonHide); + }; + // Export button + case (_keyPressed == DIK_C && {_ctrlState}): { + [_display] call FUNC(buttonExport); + }; + // Import button + case (_keyPressed == DIK_V && {_ctrlState}): { + [_display] call FUNC(buttonImport); + }; + // Search fields + case (_keyPressed == DIK_F && {_ctrlState}): { + ctrlSetFocus (_display displayCtrl IDC_leftSearchbar); + }; + // Switch vision mode + case (_keyPressed in (actionkeys "nightvision")): { + if (isNil QGVAR(visionMode)) then { + GVAR(visionMode) = 0; + }; + GVAR(visionMode) = (GVAR(visionMode) + 1) % 3; + + switch GVAR(visionMode) do { + //--- Normal + case 0: { + camusenvg false; + false setCamUseTi 0; + }; + //--- NVG + case 1: { + camusenvg true; + false setCamUseTi 0; + }; + //--- TI + default { + camusenvg false; + true setCamUseTi 0; + }; + }; + + playsound ["RscDisplayCurator_visionMode",true]; + }; + }; + } else { + switch true do { + case (_keyPressed == DIK_ESCAPE): { + _display closeDisplay 2; + }; + case (_keyPressed == DIK_BACKSPACE): { + _return = false; + }; + case (_keyPressed == DIK_NUMPADENTER); + case (_keyPressed == DIK_RETURN): { + if (GVAR(leftSearchbarFocus)) then { + [_display, _display displayCtrl IDC_leftSearchbar] call FUNC(handleSearchBar); + }; + if (GVAR(rightSearchbarFocus)) then { + [_display, _display displayCtrl IDC_rightSearchbar] call FUNC(handleSearchBar); + }; + }; + case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): { + _return = false; + }; + case (_keyPressed == DIK_C && {_ctrlState}): { + _return = false; + }; + case (_keyPressed == DIK_V && {_ctrlState}): { + _return = false; + }; + case (_keyPressed == DIK_A && {_ctrlState}): { + _return = false; + }; + case (_keyPressed == DIK_X && {_ctrlState}): { + _return = false; + }; + // Search fields + case (_keyPressed == DIK_F && {_ctrlState}): { + if (GVAR(rightSearchbarFocus)) then { + ctrlSetFocus (_display displayCtrl IDC_leftSearchbar); + } else { + ctrlSetFocus (_display displayCtrl IDC_rightSearchbar); + }; + }; + }; + }; + + if (GVAR(leftTabFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { + _return = false; + }; + + if (GVAR(rightTabFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { + _return = false; + }; + + if (GVAR(rightTabLnBFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { + _return = false; + }; + + if (GVAR(rightTabLnBFocus) && {_keyPressed in [DIK_LEFT, DIK_RIGHT]}) then { + [_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo); + }; +}; + +_return diff --git a/addons/arsenal/functions/fnc_onLoadoutsClose.sqf b/addons/arsenal/functions/fnc_onLoadoutsClose.sqf new file mode 100644 index 0000000000..777af3aed1 --- /dev/null +++ b/addons/arsenal/functions/fnc_onLoadoutsClose.sqf @@ -0,0 +1,31 @@ +/* + * Author: Alganthe + * onUnLoad EH for arsenal loadouts display. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +GVAR(currentLoadoutsTab) = nil; + +private _arsenalDisplay = findDisplay IDD_ace_arsenal; +private _mouseBlockCtrl = _arsenalDisplay displayCtrl IDC_mouseBlock; + +GVAR(cameraPosition) = GVAR(previousCameraPos); +GVAR(previousCameraPos) = nil; +GVAR(loadoutsSearchbarFocus) = nil; +GVAR(loadoutsPanelFocus) = nil; + +_mouseBlockCtrl ctrlEnable false; +_mouseBlockCtrl ctrlCommit 0; + +[_arsenalDisplay] call FUNC(buttonHide); + +[_arsenalDisplay , _arsenalDisplay displayCtrl GVAR(currentLeftPanel)] call FUNC(fillLeftPanel); diff --git a/addons/arsenal/functions/fnc_onLoadoutsOpen.sqf b/addons/arsenal/functions/fnc_onLoadoutsOpen.sqf new file mode 100644 index 0000000000..ec025b0bc1 --- /dev/null +++ b/addons/arsenal/functions/fnc_onLoadoutsOpen.sqf @@ -0,0 +1,60 @@ +/* + * Author: Alganthe + * onLoad EH for arsenal loadouts display. + * + * Arguments: + * 0: Ignored + * 1: Arguments + * 1.1: Loadouts display + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["", "_args"]; +_args params ["_display"]; + +private _arsenalDisplay = findDisplay IDD_ace_arsenal; +private _mouseBlockCtrl = _arsenalDisplay displayCtrl IDC_mouseBlock; + +_mouseBlockCtrl ctrlEnable true; +_mouseBlockCtrl ctrlCommit 0; + +[_arsenalDisplay] call FUNC(buttonHide); + +GVAR(currentLoadoutsTab) = -1; +GVAR(loadoutsSearchbarFocus) = false; +GVAR(loadoutsPanelFocus) = false; + +GVAR(previousCameraPos) = GVAR(cameraPosition); +GVAR(cameraPosition) = [5,0,20,[-0.85,0,0.85]]; + +private _panelContentCtrl = _display displayCtrl IDC_contentPanel; +_panelContentCtrl ctrlSetFontHeight (4.5 * GRID_H); +_panelContentCtrl ctrlCommit 0; + +if !(GVAR(allowDefaultLoadouts)) then { + private _buttonDefaultLoadoutsCtrl = _display displayCtrl IDC_buttonDefaultLoadouts; + _buttonDefaultLoadoutsCtrl ctrlEnable false; + _buttonDefaultLoadoutsCtrl ctrlCommit 0; + + private _buttonDefaultLoadoutsBackgroundCtrl = _display displayCtrl IDC_buttonDefaultLoadoutsBackground; + _buttonDefaultLoadoutsBackgroundCtrl ctrlShow false; + _buttonDefaultLoadoutsBackgroundCtrl ctrlCommit 0; +}; + +if !(GVAR(allowSharedLoadouts) && {isMultiplayer}) then { + private _buttonShareLoadoutsCtrl = _display displayCtrl IDC_buttonSharedLoadouts; + _buttonShareLoadoutsCtrl ctrlEnable false; + _buttonShareLoadoutsCtrl ctrlCommit 0; + + private _buttonShareLoadoutsBackgroundCtrl = _display displayCtrl IDC_buttonSharedLoadoutsBackground; + _buttonShareLoadoutsBackgroundCtrl ctrlShow false; + _buttonShareLoadoutsBackgroundCtrl ctrlCommit 0; +}; + +[_display, _display displayCtrl IDC_buttonMyLoadouts] call FUNC(loadoutsChangeTab); diff --git a/addons/arsenal/functions/fnc_onMouseButtonDown.sqf b/addons/arsenal/functions/fnc_onMouseButtonDown.sqf new file mode 100644 index 0000000000..0cb2c856a4 --- /dev/null +++ b/addons/arsenal/functions/fnc_onMouseButtonDown.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +params ["", "_args"]; +_args params ["", "_buttonPressed", "_xPos", "_yPos"]; + +GVAR(mouseButtonState) set [_buttonPressed, [_xPos, _yPos]]; diff --git a/addons/arsenal/functions/fnc_onMouseButtonUp.sqf b/addons/arsenal/functions/fnc_onMouseButtonUp.sqf new file mode 100644 index 0000000000..53848a4f8e --- /dev/null +++ b/addons/arsenal/functions/fnc_onMouseButtonUp.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +params ["", "_args"]; +_args params ["", "_buttonPressed"]; + +GVAR(mouseButtonState) set [_buttonPressed, []]; diff --git a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf new file mode 100644 index 0000000000..5c4d49b5d1 --- /dev/null +++ b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf @@ -0,0 +1,413 @@ +/* + * Author: Alganthe + * Handles selection changes on the left panel. + * + * Arguments: + * 0: Left panel control + * 1: Left panel selection + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_control", "_curSel"]; + +if (_curSel < 0) exitwith {}; + +private _ctrlIDC = ctrlIDC _control; +private _display = ctrlParent _control; +private _item = [_control lnbData [_curSel, 0], _control lbData _curSel] select !(ctrlType _control == 102); + +private _weaponDefaultRightPanel = _display displayCtrl IDC_buttonOptic; +private _selectCorrectPanelWeapon = [_weaponDefaultRightPanel, _display displayCtrl GVAR(currentRightPanel)] select (!(isNil QGVAR(currentRightPanel)) && {GVAR(currentRightPanel) in [RIGHT_PANEL_ACC_IDCS, IDC_buttonCurrentMag, IDC_buttonCurrentMag2]}); + +private _containerDefaultRightPanel = _display displayCtrl IDC_buttonMisc; +private _selectCorrectPanelContainer = [_containerDefaultRightPanel, _display displayCtrl GVAR(currentRightPanel)] select (!(isNil QGVAR(currentRightPanel)) && {GVAR(currentRightPanel) in [RIGHT_PANEL_ITEMS_IDCS]}); + +switch (GVAR(currentLeftPanel)) do { + + case IDC_buttonPrimaryWeapon : { + private _baseWeapon = ((GVAR(currentItems) select 0) call bis_fnc_baseWeapon); + + if ((GVAR(currentItems) select 0) != _item && {_baseWeapon != _item}) then { + + private _compatibleMags = getArray (configfile >> "cfgweapons" >> _baseWeapon >> "magazines"); + { + GVAR(center) removeMagazines _x; + } foreach _compatibleMags; + + GVAR(currentItems) set [15, uniformItems GVAR(center)]; + GVAR(currentItems) set [16, vestItems GVAR(center)]; + GVAR(currentItems) set [17, backpackItems GVAR(center)]; + + if (_item == "") then { + + GVAR(center) removeWeapon (primaryWeapon GVAR(center)); + GVAR(currentItems) set [18, ["", "", "", "", "", ""]]; + GVAR(currentItems) set [0, _item]; + } else { + + private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x}; + GVAR(center) addWeapon _item; + GVAR(center) addWeaponItem [_item, [(getArray (configfile >> "cfgweapons" >> _item >> "magazines")) select 0]]; + + { + if (tolower _x in _compatibleItems || {_x in _compatibleMags}) then { + GVAR(center) addPrimaryWeaponItem _x; + }; + } foreach (GVAR(currentItems) select 18); + + private _primaryMags = primaryWeaponMagazine GVAR(center); + GVAR(currentItems) set [18, (primaryWeaponItems GVAR(center)) + ([_primaryMags + [""], _primaryMags] select (count _primaryMags > 1))]; + GVAR(currentItems) set [0, _item]; + }; + }; + + if (_item == "") then { + TOGGLE_RIGHT_PANEL_HIDE + } else { + TOGGLE_RIGHT_PANEL_WEAPON + [_display, _selectCorrectPanelWeapon] call FUNC(fillRightPanel); + }; + + call FUNC(showItem); + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonHandgun : { + private _baseWeapon = ((GVAR(currentItems) select 2) call bis_fnc_baseWeapon); + + if ((GVAR(currentItems) select 2) != _item && {_baseWeapon != _item}) then { + + private _compatibleMags = getArray (configfile >> "cfgweapons" >> _baseWeapon >> "magazines"); + { + GVAR(center) removeMagazines _x; + } foreach _compatibleMags; + + GVAR(currentItems) set [15, uniformItems GVAR(center)]; + GVAR(currentItems) set [16, vestItems GVAR(center)]; + GVAR(currentItems) set [17, backpackItems GVAR(center)]; + + if (_item == "") then { + + GVAR(center) removeWeapon (handgunWeapon GVAR(center)); + GVAR(currentItems) set [18, ["", "", "", "", "", ""]]; + GVAR(currentItems) set [2, _item]; + } else { + + private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x}; + GVAR(center) addWeapon _item; + GVAR(center) addWeaponItem [_item, [(getArray (configfile >> "cfgweapons" >> _item >> "magazines")) select 0]]; + + { + if (tolower _x in _compatibleItems || {_x in _compatibleMags}) then { + GVAR(center) addHandgunItem _x; + }; + } foreach (GVAR(currentItems) select 20); + + private _handgunMags = handgunMagazine GVAR(center); + GVAR(currentItems) set [20, (handgunItems GVAR(center)) + ([_handgunMags + [""], _handgunMags] select (count _handgunMags > 1))]; + GVAR(currentItems) set [2, _item]; + }; + }; + + if (_item == "") then { + TOGGLE_RIGHT_PANEL_HIDE + } else { + TOGGLE_RIGHT_PANEL_WEAPON + [_display, [_selectCorrectPanelWeapon, _weaponDefaultRightPanel] select (GVAR(currentRightPanel) == IDC_buttonCurrentMag2)] call FUNC(fillRightPanel); + }; + + call FUNC(showItem); + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonSecondaryWeapon : { + private _baseWeapon = ((GVAR(currentItems) select 1) call bis_fnc_baseWeapon); + + if ((GVAR(currentItems) select 1) != _item && {_baseWeapon != _item}) then { + + private _compatibleMags = getArray (configfile >> "cfgweapons" >> _baseWeapon >> "magazines"); + { + GVAR(center) removeMagazines _x; + } foreach _compatibleMags; + + GVAR(currentItems) set [15, uniformItems GVAR(center)]; + GVAR(currentItems) set [16, vestItems GVAR(center)]; + GVAR(currentItems) set [17, backpackItems GVAR(center)]; + + if (_item == "") then { + + GVAR(center) removeWeapon (secondaryWeapon GVAR(center)); + GVAR(currentItems) set [18, ["", "", "", "", "", ""]]; + GVAR(currentItems) set [1, _item]; + } else { + + private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x}; + GVAR(center) addWeapon _item; + GVAR(center) addWeaponItem [_item, [(getArray (configfile >> "cfgweapons" >> _item >> "magazines")) select 0]]; + + { + if (tolower _x in _compatibleItems || {_x in _compatibleMags}) then { + GVAR(center) addSecondaryWeaponItem _x; + }; + } foreach (GVAR(currentItems) select 19); + + private _secondaryMags = secondaryWeaponMagazine GVAR(center); + GVAR(currentItems) set [19, (secondaryWeaponItems GVAR(center)) + ([_secondaryMags + [""], _secondaryMags] select (count _secondaryMags > 1))]; + GVAR(currentItems) set [1, _item]; + }; + }; + + if (_item == "") then { + TOGGLE_RIGHT_PANEL_HIDE + } else { + TOGGLE_RIGHT_PANEL_WEAPON + [_display, [_selectCorrectPanelWeapon, _weaponDefaultRightPanel] select (GVAR(currentRightPanel) == IDC_buttonCurrentMag2)] call FUNC(fillRightPanel); + }; + + call FUNC(showItem); + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonHeadgear : { + if (_item == "") then { + removeHeadgear GVAR(center); + GVAR(currentItems) set [3, _item]; + } else { + GVAR(center) addHeadgear _item; + GVAR(currentItems) set [3, _item]; + }; + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonUniform : { + if (_item == "") then { + + removeuniform GVAR(center); + GVAR(currentItems) set [15, []]; + GVAR(currentItems) set [4, _item]; + TOGGLE_RIGHT_PANEL_HIDE + } else { + + GVAR(center) forceAddUniform _item; + + while {count uniformItems GVAR(center) > 0} do { + GVAR(center) removeItemFromUniform (uniformItems GVAR(center) select 0); + }; //--- Remove default config contents + + {GVAR(center) addItemtoUniform _x} foreach (GVAR(currentItems) select 15); + GVAR(currentItems) set [4, _item]; + + [GVAR(center), ""] call bis_fnc_setUnitInsignia; + [GVAR(center), GVAR(currentInsignia)] call bis_fnc_setUnitInsignia; + + TOGGLE_RIGHT_PANEL_CONTAINER + [_display, _selectCorrectPanelContainer] call FUNC(fillRightPanel); + }; + + call FUNC(showItem); + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonVest: { + if (_item == "") then { + + removeVest GVAR(center); + GVAR(currentItems) set [16, []]; + GVAR(currentItems) set [5, _item]; + TOGGLE_RIGHT_PANEL_HIDE + } else { + + GVAR(center) addVest _item; + while {count vestItems GVAR(center) > 0} do { + GVAR(center) removeItemFromVest (VestItems GVAR(center) select 0); + }; //--- Remove default config contents + {GVAR(center) addItemToVest _x} foreach (GVAR(currentItems) select 16); + + GVAR(currentItems) set [5, _item]; + + TOGGLE_RIGHT_PANEL_CONTAINER + [_display, _selectCorrectPanelContainer] call FUNC(fillRightPanel); + }; + + call FUNC(showItem); + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonBackpack : { + if (_item == "") then { + + removeBackpack GVAR(center); + GVAR(currentItems) set [17, []]; + GVAR(currentItems) set [6, _item]; + TOGGLE_RIGHT_PANEL_HIDE + } else { + + removeBackpack GVAR(center); + GVAR(center) addBackpack _item; + while {count backpackItems GVAR(center) > 0} do { + GVAR(center) removeItemFromBackpack (backpackItems GVAR(center) select 0); + }; //--- Remove default config contents + {GVAR(center) addItemToBackpack _x} foreach (GVAR(currentItems) select 17); + + GVAR(currentItems) set [6, _item]; + + TOGGLE_RIGHT_PANEL_CONTAINER + [_display, _selectCorrectPanelContainer] call FUNC(fillRightPanel); + }; + + call FUNC(showItem); + [_display, _control, _curSel, (configFile >> "CfgVehicles" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonGoggles : { + if (_item == "") then { + removeGoggles GVAR(center); + GVAR(currentItems) set [7, _item]; + } else { + GVAR(center) addGoggles _item; + GVAR(currentItems) set [7, _item]; + }; + + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgGlasses" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonNVG : { + if (_item == "") then { + GVAR(center) unlinkItem (GVAR(currentItems) select 8); + GVAR(currentItems) set [8, _item]; + } else { + GVAR(center) linkItem _item; + GVAR(currentItems) set [8, _item]; + }; + + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonBinoculars : { + if (_item == "") then { + GVAR(center) removeWeapon (binocular GVAR(center)); + GVAR(currentItems) set [9, _item]; + } else { + GVAR(center) addWeapon _item; + GVAR(currentItems) set [9, _item]; + call FUNC(showItem); + ADDBINOCULARSMAG + }; + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonMap : { + if (_item == "") then { + GVAR(center) unlinkItem (GVAR(currentItems) select 10) select 0; + GVAR(currentItems) set [10, _item]; + } else { + GVAR(center) linkItem _item; + GVAR(currentItems) set [10, _item]; + }; + + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonCompass : { + if (_item == "") then { + GVAR(center) unlinkItem (GVAR(currentItems) select 11) select 0; + GVAR(currentItems) set [11, _item]; + } else { + GVAR(center) linkItem _item; + GVAR(currentItems) set [11, _item]; + }; + + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonRadio : { + if (_item == "") then { + GVAR(center) unlinkItem (GVAR(currentItems) select 12) select 0; + GVAR(currentItems) set [12, _item]; + } else { + GVAR(center) linkItem _item; + GVAR(currentItems) set [12, _item]; + }; + + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonWatch : { + if (_item == "") then { + GVAR(center) unlinkItem (GVAR(currentItems) select 13); + GVAR(currentItems) set [13, _item]; + } else { + GVAR(center) linkItem _item; + GVAR(currentItems) set [13, _item]; + }; + + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonGPS : { + if (_item == "") then { + GVAR(center) unlinkItem (GVAR(currentItems) select 14) select 0; + GVAR(currentItems) set [14, _item]; + } else { + GVAR(center) linkItem _item; + GVAR(currentItems) set [14, _item]; + }; + + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgWeapons" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonFace : { + private _face = [_item, "Default"] select (_item == ""); + + GVAR(center) setFace _face; + GVAR(currentFace) = _face; + + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgFaces" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonVoice : { + GVAR(center) setSpeaker _item; + GVAR(currentVoice) = _item; + + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgVoice" >> _item)] call FUNC(itemInfo); + }; + + case IDC_buttonInsigna : { + [GVAR(center), _item] call bis_fnc_setUnitInsignia; + GVAR(currentInsignia) = _item; + + call FUNC(showItem); + TOGGLE_RIGHT_PANEL_HIDE + [_display, _control, _curSel, (configFile >> "CfgUnitInsignia" >> _item)] call FUNC(itemInfo); + }; +}; + +(_display displayCtrl IDC_totalWeightText) ctrlSetText (format ["%1 (%2)", [GVAR(center), 2] call EFUNC(common,getWeight), [GVAR(center), 1] call EFUNC(common,getWeight)]); diff --git a/addons/arsenal/functions/fnc_onSelChangedLoadouts.sqf b/addons/arsenal/functions/fnc_onSelChangedLoadouts.sqf new file mode 100644 index 0000000000..3f4d508ae0 --- /dev/null +++ b/addons/arsenal/functions/fnc_onSelChangedLoadouts.sqf @@ -0,0 +1,103 @@ +/* + * Author: Alganthe + * Handles selection changes on loadouts panel. + * + * Arguments: + * 0: Loadouts panel control + * 1: Loadouts panel selection + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control", "_curSel"]; + +private _shareButtonCtrl = _display displayCtrl IDC_buttonShare; +private _saveButtonCtrl = _display displayCtrl IDC_buttonSave; +private _loadButtonCtrl = _display displayCtrl IDC_buttonLoad; +private _deleteButtonCtrl = _display displayCtrl IDC_buttonDelete; +private _renameButtonCtrl = _display displayCtrl IDC_buttonRename; +private _textEditBoxCtrl= _display displayCtrl IDC_textEditBox; + +if (_curSel == -1) exitWith { + + if (GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts) then { + _saveButtonCtrl ctrlEnable false; + _saveButtonCtrl ctrlCommit 0; + }; + + _shareButtonCtrl ctrlSetText (localize LSTRING(buttonSharePrivateText)); + + { + _x ctrlEnable false; + _x ctrlCommit 0; + } foreach [_shareButtonCtrl, _loadButtonCtrl, _deleteButtonCtrl, _renameButtonCtrl]; +}; + +switch (GVAR(currentLoadoutsTab)) do { + + case IDC_buttonMyLoadouts: { + + _shareButtonCtrl ctrlEnable (GVAR(allowSharedLoadouts) && {isMultiplayer}); + _shareButtonCtrl ctrlCommit 0; + + _loadButtonCtrl ctrlEnable true; + _loadButtonCtrl ctrlCommit 0; + + _shareButtonCtrl ctrlSetText ( [ + localize LSTRING(buttonSharePrivateText), + localize LSTRING(buttonSharePublicText) + ] select ((_control lnbValue [_curSel, 0]) == 1)); + + { + _x ctrlEnable true; + _x ctrlCommit 0; + } foreach [_renameButtonCtrl, _deleteButtonCtrl]; + + _textEditBoxCtrl ctrlSetText (_control lnbText [_curSel, 1]); + }; + + case IDC_buttonDefaultLoadouts: { + + { + _x ctrlEnable true; + _x ctrlCommit 0; + } foreach [_saveButtonCtrl, _loadButtonCtrl]; + + _shareButtonCtrl ctrlEnable false; + _shareButtonCtrl ctrlCommit 0; + + { + _x ctrlEnable (is3DEN); + _x ctrlCommit 0; + } foreach [_deleteButtonCtrl, _renameButtonCtrl]; + + _textEditBoxCtrl ctrlSetText (_control lnbText [_curSel, 1]); + }; + + case IDC_buttonSharedLoadouts: { + + { + _x ctrlEnable true; + _x ctrlCommit 0; + } foreach [_saveButtonCtrl, _loadButtonCtrl]; + + _shareButtonCtrl ctrlEnable false; + _shareButtonCtrl ctrlCommit 0; + + if ((serverCommandAvailable "#logout") || {(_control lnbText [_curSel, 0]) == profileName}) then { + + _deleteButtonCtrl ctrlEnable true; + _deleteButtonCtrl ctrlCommit 0; + } else { + _deleteButtonCtrl ctrlEnable false; + _deleteButtonCtrl ctrlCommit 0; + }; + + _textEditBoxCtrl ctrlSetText (_control lnbText [_curSel, 1]); + }; +}; diff --git a/addons/arsenal/functions/fnc_onSelChangedRight.sqf b/addons/arsenal/functions/fnc_onSelChangedRight.sqf new file mode 100644 index 0000000000..7a565cd14d --- /dev/null +++ b/addons/arsenal/functions/fnc_onSelChangedRight.sqf @@ -0,0 +1,77 @@ +/* + * Author: Alganthe + * Handles selection changes on the right panel. + * + * Arguments: + * 0: Right panel control + * 1: Right panel selection + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_control", "_curSel"]; + +if (_curSel < 0) exitwith {}; + +private _ctrlIDC = ctrlIDC _control; +private _display = ctrlParent _control; +private _item = _control lbData _curSel; + + +private _fnc_selectItem = { + params ["_item", "_currentItemsIndex", "_itemIndex"]; + + switch (_currentItemsIndex) do { + case 18: { + if (_item == "") then { + GVAR(center) removePrimaryWeaponItem ((GVAR(currentItems) select 18) select _itemIndex); + private _primaryMags = primaryWeaponMagazine GVAR(center); + GVAR(currentItems) set [18, (primaryWeaponItems GVAR(center)) + ([_primaryMags + [""], _primaryMags] select (count _primaryMags > 1))]; + } else { + GVAR(center) addPrimaryWeaponItem _item; + private _primaryMags = primaryWeaponMagazine GVAR(center); + GVAR(currentItems) set [18, (primaryWeaponItems GVAR(center)) + ([_primaryMags + [""], _primaryMags] select (count _primaryMags > 1))]; + }; + [_display, _control, _curSel, (configFile >> (["CfgWeapons", "CfgMagazines"] select (_itemIndex in [4, 5]))>> _item)] call FUNC(itemInfo); + }; + + case 19: { + if (_item == "") then { + GVAR(center) removeSecondaryWeaponItem ((GVAR(currentItems) select 19) select _itemIndex); + private _secondaryMags = secondaryWeaponMagazine GVAR(center); + GVAR(currentItems) set [19, (secondaryWeaponItems GVAR(center)) + ([_secondaryMags + [""], _secondaryMags] select (count _secondaryMags > 1))]; + } else { + GVAR(center) addSecondaryWeaponItem _item; + private _secondaryMags = secondaryWeaponMagazine GVAR(center); + GVAR(currentItems) set [19, (secondaryWeaponItems GVAR(center)) + ([_secondaryMags + [""], _secondaryMags] select (count _secondaryMags > 1))]; + }; + [_display, _control, _curSel, (configFile >> (["CfgWeapons", "CfgMagazines"] select (_itemIndex in [4, 5]))>> _item)] call FUNC(itemInfo); + }; + + case 20: { + if (_item == "") then { + GVAR(center) removeHandgunItem ((GVAR(currentItems) select 20) select _itemIndex); + private _handgunMags = handgunMagazine GVAR(center); + GVAR(currentItems) set [20, (handgunItems GVAR(center)) + ([_handgunMags + [""], _handgunMags] select (count _handgunMags > 1))]; + } else { + GVAR(center) addHandgunItem _item; + private _handgunMags = handgunMagazine GVAR(center); + GVAR(currentItems) set [20, (handgunItems GVAR(center)) + ([_handgunMags + [""], _handgunMags] select (count _handgunMags > 1))]; + }; + [_display, _control, _curSel, (configFile >> (["CfgWeapons", "CfgMagazines"] select (_itemIndex in [4, 5]))>> _item)] call FUNC(itemInfo); + }; + }; +}; + +[ + _item, + 18 + ([IDC_buttonPrimaryWeapon, IDC_buttonSecondaryWeapon, IDC_buttonHandgun] find GVAR(currentLeftPanel)), + [IDC_buttonMuzzle, IDC_buttonItemAcc, IDC_buttonOptic, IDC_buttonBipod, IDC_buttonCurrentMag, IDC_buttonCurrentMag2] find GVAR(currentRightPanel) +] call _fnc_selectItem; + +(_display displayCtrl IDC_totalWeightText) ctrlSetText (format ["%1 (%2)", [GVAR(center), 2] call EFUNC(common,getWeight), [GVAR(center), 1] call EFUNC(common,getWeight)]); diff --git a/addons/arsenal/functions/fnc_onSelChangedRightListnBox.sqf b/addons/arsenal/functions/fnc_onSelChangedRightListnBox.sqf new file mode 100644 index 0000000000..29c66a79f9 --- /dev/null +++ b/addons/arsenal/functions/fnc_onSelChangedRightListnBox.sqf @@ -0,0 +1,51 @@ +/* + * Author: Alganthe + * Handles selection changes on the right panel (listnbox). + * + * Arguments: + * 0: Right panel control + * 1: Right panel selection + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_control", "_curSel"]; + +if (_curSel < 0) exitwith {}; + +private _ctrlIDC = ctrlIDC _control; +private _display = ctrlParent _control; +private _item = [_control lnbData [_curSel, 0], _control lbData _curSel] select !(ctrlType _control == 102); + +private _fnc_selectRight = { + params ["_item", "_cfgEntry"]; + + // Load remaining + private _maxLoad = switch (GVAR(currentLeftPanel)) do { + case IDC_buttonUniform: { + gettext (configfile >> "CfgWeapons" >> uniform GVAR(center) >> "ItemInfo" >> "containerClass") + }; + case IDC_buttonVest: { + gettext (configfile >> "CfgWeapons" >> vest GVAR(center) >> "ItemInfo" >> "containerClass") + }; + case IDC_buttonBackpack: { + backpack GVAR(center) + }; + }; + + [_control, _maxLoad] call FUNC(updateRightPanel); + [_display, _control, _curSel, (configFile >> _cfgEntry >> _item)] call FUNC(itemInfo); +}; + +if (GVAR(currentLeftPanel) in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBackpack]) then { + + [ + _item, + ["CfgWeapons", "CfgMagazines"] select (GVAR(currentRightPanel) in [IDC_buttonMag, IDC_buttonMagALL, IDC_buttonThrow, IDC_buttonPut]) + ] call _fnc_selectRight; +}; diff --git a/addons/arsenal/functions/fnc_open3DEN.sqf b/addons/arsenal/functions/fnc_open3DEN.sqf new file mode 100644 index 0000000000..6bb0adcaa3 --- /dev/null +++ b/addons/arsenal/functions/fnc_open3DEN.sqf @@ -0,0 +1,17 @@ +/* + * Author: Alganthe + * Replace the 3DEN "edit loadout" menu action + * + * Arguments: + * None + * + * Return Value: + * None + * + * + * Public: No +*/ +#include "script_component.hpp" + +private _entity = (uinamespace getvariable ["bis_fnc_3DENEntityMenu_data",[]]) param [1, objnull]; +[_entity, _entity, true] call FUNC(openBox); diff --git a/addons/arsenal/functions/fnc_openBox.sqf b/addons/arsenal/functions/fnc_openBox.sqf new file mode 100644 index 0000000000..4a79f95918 --- /dev/null +++ b/addons/arsenal/functions/fnc_openBox.sqf @@ -0,0 +1,53 @@ +/* + * Author: Alganthe + * Open arsenal. + * + * Arguments: + * 0: Box + * 1: Unit to open the arsenal on + * 2: Ignore virtual items and fill arsenal + * + * Return Value: + * None + * + * Example: + * [_box, player] call ace_arsenal_fnc_openBox + * + * Public: Yes +*/ +#include "script_component.hpp" + +params [["_object", objNull, [objNull]], ["_center", objNull, [objNull]], ["_mode", false, [false]]]; + +if ( + isNull _object || + {isNull _center} || + {!(_center isKindOf "Man")} || + {!(isNull objectParent _center) && {!is3DEN}} +) exitWith {}; + +if (isNil {_object getVariable [QGVAR(virtualItems), nil]} && {!_mode}) exitWith { + [localize LSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText); +}; + +if (canSuspend) exitWith { + [{_this call FUNC(openBox)}, _this] call CBA_fnc_directCall; +}; + +private _displayToUse = [findDisplay 46, findDIsplay 312] select (!isNull findDisplay 312); +_displayToUse = [_displayToUse, findDisplay 313] select (is3DEN); + +if (isNil "_displayToUse" || {!isnil QGVAR(camera)}) exitWith { + [localize LSTRING(CantOpenDisplay), false, 5, 1] call EFUNC(common,displayText); +}; + +if (_mode) then { + GVAR(virtualItems) = uiNamespace getVariable QGVAR(configItems); +} else { + GVAR(virtualItems) = +(_object getVariable [QGVAR(virtualItems), [ + [[], [], []], [[], [], [], []], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [] + ]]); +}; + +GVAR(center) = _center; +_displayToUse createDisplay QGVAR(display); diff --git a/addons/arsenal/functions/fnc_portVALoadouts.sqf b/addons/arsenal/functions/fnc_portVALoadouts.sqf new file mode 100644 index 0000000000..7ad141819d --- /dev/null +++ b/addons/arsenal/functions/fnc_portVALoadouts.sqf @@ -0,0 +1,43 @@ +/* + * Author: alganthe + * Port VA loadouts to ACE Arsenal. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: Yes +*/ +#include "script_component.hpp" + +private _VALoadouts = +(profilenamespace getvariable ["bis_fnc_saveInventory_data",[]]); +private _aceLoadouts = +(profileNamespace getVariable [QGVAR(saved_loadouts),[]]); + +if (isNull player) exitWith { + [localize LSTRING(portLoadoutsPlayerError)] call BIS_fnc_error; +}; + +if (_VALoadouts isEqualTo []) exitWith { + [localize LSTRING(portLoadoutsLoadoutError)] call BIS_fnc_error; +}; + +for "_i" from 0 to (count _VALoadouts - 1) step 2 do { + _name = _VALoadouts select _i; + _inventory = _VALoadouts select (_i + 1); + + private _sameNameLoadoutsList = _aceLoadouts select {_x select 0 == _name}; + [player, [profilenamespace, _name]] call bis_fnc_loadinventory; + + private _loadout = getUnitLoadout player; + + if (count _sameNameLoadoutsList > 0) then { + _aceLoadouts set [_aceLoadouts find (_sameNameLoadoutsList select 0), [_name, _loadout]]; + + } else { + _aceLoadouts pushBack [_name, _loadout]; + }; +}; + +profileNamespace setVariable [QGVAR(saved_loadouts), _aceLoadouts]; diff --git a/addons/arsenal/functions/fnc_removeBox.sqf b/addons/arsenal/functions/fnc_removeBox.sqf new file mode 100644 index 0000000000..43fa903ca4 --- /dev/null +++ b/addons/arsenal/functions/fnc_removeBox.sqf @@ -0,0 +1,35 @@ +/* + * Author: Alganthe + * Remove arsenal from target. + * + * Arguments: + * 0: Target + * 1: Remove globally + * + * Return Value: + * None + * + * Example: + * [_box, true] call ace_arsenal_fnc_removeBox + * + * Public: Yes +*/ +#include "script_component.hpp" + +params [["_object", objNull, [objNull]], ["_global", true, [true]]]; + +if (isNull _object || {isNil QGVAR(EHIDArray)}) exitWith {}; + +if (_global && {isMultiplayer}) then { + private _ID = (GVAR(EHIDArray) select {_x select 1 == _object}) select 0; + + if !(isNil "_ID") then { + [_ID select 0] call CBA_fnc_removeGlobalEventJIP; + GVAR(EHIDArray) deleteAt (GVAR(EHIDArray) find _ID); + publicVariable QGVAR(EHIDArray); + [QGVAR(removeBox), [_object, false]] call CBA_fnc_globalEvent; + }; +} else { + _object setVariable [QGVAR(virtualItems), nil, false]; + [_object, 0, ["ACE_MainActions", QGVAR(interaction)]] call EFUNC(interact_menu,removeActionFromObject); +}; diff --git a/addons/arsenal/functions/fnc_removeVirtualItems.sqf b/addons/arsenal/functions/fnc_removeVirtualItems.sqf new file mode 100644 index 0000000000..ad96718c6d --- /dev/null +++ b/addons/arsenal/functions/fnc_removeVirtualItems.sqf @@ -0,0 +1,80 @@ +/* + * Author: Alganthe + * Remove virtual items to the provided target. + * + * Arguments: + * 0: Target + * 1: Items + * 2: Add globally + * + * Return Value: + * None + * + * Example: + * [_box, ["item1", "item2", "itemN"]] call ace_arsenal_fnc_removeVirtualItems + * [_box, true, false] call ace_arsenal_fnc_removeVirtualItems + * + * Public: Yes +*/ +#include "script_component.hpp" + +params [ ["_object", objNull, [objNull]], ["_items", [], [true, [""]]], ["_global", false, [false]] ]; + +if (_object == objNull) exitWith {}; +if (_items isEqualType [] && {count _items == 0}) exitWith {}; + +private _cargo = _object getVariable [QGVAR(virtualItems), [ + [[], [], []], // Weapons 0, primary, handgun, secondary + [[], [], [], []], // WeaponAccessories 1, optic,side,muzzle,bipod + [ ], // Magazines 2 + [ ], // Headgear 3 + [ ], // Uniform 4 + [ ], // Vest 5 + [ ], // Backpacks 6 + [ ], // Goggles 7 + [ ], // NVGs 8 + [ ], // Binoculars 9 + [ ], // Map 10 + [ ], // Compass 11 + [ ], // Radio slot 12 + [ ], // Watch slot 13 + [ ], // Comms slot 14 + [ ], // WeaponThrow 15 + [ ], // WeaponPut 16 + [ ] // InventoryItems 17 +]]; + +if (_items isEqualType true && {_items}) then { + [_object, _global] call FUNC(removeBox); + _object setVariable [QGVAR(virtualItems), nil, _global]; +} else { + + // Make sure all items are in string form + _items = _items select {_x isEqualType "" && {_x != ""}}; + + { + if (_forEachIndex isEqualTo 0) then { + _cargo set [_forEachIndex, [(_x select 0) - _items, (_x select 1) - _items, (_x select 2) - _items]]; + } else { + if (_forEachIndex isEqualTo 1) then { + _cargo set [_forEachIndex, [(_x select 0) - _items, (_x select 1) - _items, (_x select 2) - _items, (_x select 3) - _items]]; + } else { + _cargo set [_cargo find _x, _x - _items]; + }; + }; + } foreach _cargo; + + private _itemCount = { + if (_x isEqualTo (_cargo select 0) || {_x isEqualTo (_cargo select 1)}) then { + !(_x isEqualTo [[],[],[]] || {_x isEqualTo [[],[],[],[]]}) + } else { + !(_x isEqualTo []) + }; + } count _cargo; + + if (_itemCount == 0) then { + [_object, _global] call FUNC(removeBox); + } else { + _object setVariable [QGVAR(virtualItems), _cargo, _global]; + }; +}; diff --git a/addons/arsenal/functions/fnc_scanConfig.sqf b/addons/arsenal/functions/fnc_scanConfig.sqf new file mode 100644 index 0000000000..28f90b9ae6 --- /dev/null +++ b/addons/arsenal/functions/fnc_scanConfig.sqf @@ -0,0 +1,184 @@ +/* + * Author: Dedmen + * Cache an array of all the compatible items for arsenal. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +private _cargo = [ + [[], [], []], // Weapons 0, primary, secondary, handgun + [[], [], [], []], // WeaponAccessories 1, optic,side,muzzle,bipod + [ ], // Magazines 2 + [ ], // Headgear 3 + [ ], // Uniform 4 + [ ], // Vest 5 + [ ], // Backpacks 6 + [ ], // Goggles 7 + [ ], // NVGs 8 + [ ], // Binoculars 9 + [ ], // Map 10 + [ ], // Compass 11 + [ ], // Radio slot 12 + [ ], // Watch slot 13 + [ ], // Comms slot 14 + [ ], // WeaponThrow 15 + [ ], // WeaponPut 16 + [ ] // InventoryItems 17 +]; + +private _configCfgWeapons = configFile >> "CfgWeapons"; //Save this lookup in variable for perf improvement +private _magazineGroups = [[],[]] call CBA_fnc_hashCreate; + +{ + private _configItemInfo = _x >> "ItemInfo"; + private _simulationType = getText (_x >> "simulation"); + private _className = configName _x; + private _hasItemInfo = isClass (_configItemInfo); + private _itemInfoType = if (_hasItemInfo) then {getNumber (_configItemInfo >> "type")} else {0}; + + switch true do { + /* Weapon acc */ + case ( + _hasItemInfo && + {_itemInfoType in [101, 201, 301, 302]} && + {!(configName _x isKindOf ["CBA_MiscItem", (_configCfgWeapons)])} + ): { + + //Convert type to array index + (_cargo select 1) select ([201,301,101,302] find _itemInfoType) pushBackUnique _className; + }; + /* Headgear */ + case (_hasItemInfo && {_itemInfoType == 605}): { + (_cargo select 3) pushBackUnique _className; + }; + /* Uniform */\ + case (_hasItemInfo && {_itemInfoType == 801}): { + (_cargo select 4) pushBackUnique _className; + }; + /* Vest */ + case (_hasItemInfo && {_itemInfoType == 701}): { + (_cargo select 5) pushBackUnique _className; + }; + /* NVgs */ + case (_simulationType == "NVGoggles"): { + (_cargo select 8) pushBackUnique _className; + }; + /* Binos */ + case (_simulationType == "Binocular" || + ((_simulationType == 'Weapon') && {(getNumber (_x >> 'type') == 4096)})): { + (_cargo select 9) pushBackUnique _className; + }; + /* Map */ + case (_simulationType == "ItemMap"): { + (_cargo select 10) pushBackUnique _className; + }; + /* Compass */ + case (_simulationType == "ItemCompass"): { + (_cargo select 11) pushBackUnique _className; + }; + /* Radio */ + case (_simulationType == "ItemRadio"): { + (_cargo select 12) pushBackUnique _className; + }; + /* Watch */ + case (_simulationType == "ItemWatch"): { + (_cargo select 13) pushBackUnique _className; + }; + /* GPS */ + case (_simulationType == "ItemGPS"): { + (_cargo select 14) pushBackUnique _className; + }; + /* UAV terminals */ + case (_hasItemInfo && {_itemInfoType == 621}): { + (_cargo select 14) pushBackUnique _className; + }; + /* Weapon, at the bottom to avoid adding binos */ + case (isClass (_x >> "WeaponSlotsInfo") && + {getNumber (_x >> 'type') != 4096}): { + switch (getNumber (_x >> "type")) do { + case 1: { + (_cargo select 0) select 0 pushBackUnique (_className call bis_fnc_baseWeapon); + }; + case 2: { + (_cargo select 0) select 2 pushBackUnique (_className call bis_fnc_baseWeapon); + }; + case 4: { + (_cargo select 0) select 1 pushBackUnique (_className call bis_fnc_baseWeapon); + }; + }; + }; + /* Misc items */ + case ( + _hasItemInfo && + (_itemInfoType in [101, 201, 301, 302] && + {(_className isKindOf ["CBA_MiscItem", (_configCfgWeapons)])}) || + {_itemInfoType in [401, 619, 620]} || + {(getText ( _x >> "simulation")) == "ItemMineDetector"} + ): { + (_cargo select 17) pushBackUnique _className; + }; + }; +} foreach configProperties [_configCfgWeapons, "isClass _x && {(if (isNumber (_x >> 'scopeArsenal')) then {getNumber (_x >> 'scopeArsenal')} else {getNumber (_x >> 'scope')}) == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; + +{ + private _className = configName _x; + private _grenadeList = []; + { + _grenadeList append getArray (_configCfgWeapons >> "Throw" >> _x >> "magazines"); + false + } count getArray (_configCfgWeapons >> "Throw" >> "muzzles"); + + private _putList = []; + { + _putList append getArray (_configCfgWeapons >> "Put" >> _x >> "magazines"); + false + } count getArray (_configCfgWeapons >> "Put" >> "muzzles"); + + + switch true do { + // Rifle, handgun, secondary weapons mags + case ( + (getNumber (_x >> "type") in [256,512,1536,16]) && + {!(_className in _grenadeList)} && + {!(_className in _putList)} + ): { + (_cargo select 2) pushBackUnique _className; + }; + // Grenades + case (_className in _grenadeList): { + (_cargo select 15) pushBackUnique _className; + }; + // Put + case (_className in _putList): { + (_cargo select 16) pushBackUnique _className; + }; + }; + + if (isArray (_x >> "magazineGroup")) then { + { + private _entry = [_magazineGroups, _x] call CBA_fnc_hashGet; + _entry pushBackUnique _className; + [_magazineGroups, _x, _entry] call CBA_fnc_hashSet; + } forEach getArray (_x >> "magazineGroup") + }; +} foreach configProperties [(configFile >> "CfgMagazines"), "isClass _x && {getNumber (_x >> 'scope') == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; + +{ + if (getText (_x >> "vehicleClass") == "Backpacks") then { + (_cargo select 6) pushBackUnique (configName _x); + }; +} foreach configProperties [(configFile >> "CfgVehicles"), "isClass _x && {getNumber (_x >> 'scope') == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; + +{ + (_cargo select 7) pushBackUnique (configName _x); +} foreach configProperties [(configFile >> "CfgGlasses"), "isClass _x && {getNumber (_x >> 'scope') == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; + +uiNamespace setVariable [QGVAR(configItems), _cargo]; +uiNamespace setVariable [QGVAR(magazineGroups), _magazineGroups]; diff --git a/addons/arsenal/functions/fnc_showItem.sqf b/addons/arsenal/functions/fnc_showItem.sqf new file mode 100644 index 0000000000..e97ebd8dd5 --- /dev/null +++ b/addons/arsenal/functions/fnc_showItem.sqf @@ -0,0 +1,75 @@ +/* + * Author: Alganthe + * Change unit animation / play sound preview. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + + + +private _nextAction = switch (GVAR(currentLeftPanel)) do { + + case IDC_buttonPrimaryWeapon : { + ["Civil", "PrimaryWeapon"] select ((GVAR(currentItems) select 0) != "") + }; + case IDC_buttonSecondaryWeapon : { + ["Civil", "SecondaryWeapon"] select (GVAR(currentItems) select 1 != "") + }; + case IDC_buttonHandgun : { + ["Civil", "HandGunOn"] select (GVAR(currentItems) select 2 != "") + }; + case IDC_buttonHeadgear; + case IDC_buttonUniform; + case IDC_buttonVest; + case IDC_buttonBackpack; + case IDC_buttonGoggles; + case IDC_buttonMap; + case IDC_buttonGPS; + case IDC_buttonRadio; + case IDC_buttonCompass; + case IDC_buttonWatch; + case IDC_buttonFace; + case IDC_buttonNVG : { + "Civil" + }; + case IDC_buttonBinoculars : { + ["Civil", "Binoculars"] select (GVAR(currentItems) select 9 != "") + }; + case IDC_buttonInsigna : { + "Salute" + }; + case IDC_buttonVoice : { + GVAR(center) directSay "CuratorObjectPlaced"; + "Civil" + }; +}; + +if (_nextAction != GVAR(currentAction)) then { + switch (_nextAction) do { + case "PrimaryWeapon": { + GVAR(selectedWeaponType) = 0; + }; + case "SecondaryWeapon": { + GVAR(selectedWeaponType) = 1; + }; + case "HandGunOn": { + GVAR(selectedWeaponType) = 2; + }; + }; + + if (simulationEnabled GVAR(center)) then { + GVAR(center) playActionNow _nextAction; + } else { + GVAR(center) switchAction _nextAction; + }; + + GVAR(currentAction) = _nextAction; +}; diff --git a/addons/arsenal/functions/fnc_sortPanel.sqf b/addons/arsenal/functions/fnc_sortPanel.sqf new file mode 100644 index 0000000000..c8bf02777f --- /dev/null +++ b/addons/arsenal/functions/fnc_sortPanel.sqf @@ -0,0 +1,64 @@ +/* + * Author: Alganthe, Dedmen + * Sort arsenal panel. + * + * Arguments: + * 0: Panel's control to sort + * 1: Sorting mode + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_control", "_mode"]; + +private _display = ctrlParent _control; +private ["_panel", "_curSel", "_selected"]; + +// Right panel +if (ctrlIDC _control == 17 && {GVAR(currentLeftPanel) in [IDC_buttonUniform ,IDC_buttonVest, IDC_buttonBackpack]}) then { + _panel = _display displayCtrl IDC_rightTabContentListnBox; + _curSel = lnbCurSelRow _panel; + _selected = _panel lnbData [_curSel, 0]; + + switch (_mode) do { + case 0: { + _panel lnbSort [1, false]; + }; + + case 1: { + _panel lnbSortByValue [0, false]; + }; + + case 2: { + _panel lnbSort [2, true]; + }; + }; + + if (_cursel >= 0) then { + for '_i' from 0 to (((lnbsize _panel) select 0) - 1) do { + if ((_panel lnbdata [_i, 0]) == _selected) exitwith {_panel lnbSetCurSelRow _i}; + }; + }; +// Left panel +} else { + _panel = _display displayCtrl ([IDC_leftTabContent, IDC_rightTabContent] select (ctrlIDC _control == 17)); + _curSel = lbCurSel _panel; + _selected = _panel lbData _curSel; + + if (_mode > 0) then { + lbSortByValue _panel; + } else { + lbsort _panel; + }; + + if (_cursel >= 0) then { + for '_i' from 0 to (lbsize _panel - 1) do { + if ((_panel lbdata _i) == _selected) exitwith {_panel lbSetCurSel _i}; + }; + }; +}; diff --git a/addons/arsenal/functions/fnc_updateCamPos.sqf b/addons/arsenal/functions/fnc_updateCamPos.sqf new file mode 100644 index 0000000000..f8b6b91a15 --- /dev/null +++ b/addons/arsenal/functions/fnc_updateCamPos.sqf @@ -0,0 +1,27 @@ +/* + * Author: Karel Moricky, modified by Alganthe + * Update camera position + * Modernized a bit, modified vars to fit arsenal rewrite. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: Yes +*/ +#include "script_component.hpp" + +GVAR(cameraPosition) params ["_distance", "_dirH", "_dirV"]; +[GVAR(cameraHelper), [_dirH + 180, - _dirV, 0]] call bis_fnc_setobjectrotation; +GVAR(cameraHelper) attachTo [GVAR(center), GVAR(cameraPosition) select 3, ""]; //--- Reattach for smooth movement + +GVAR(camera) setPos (GVAR(cameraHelper) modelToWorld [0, -_distance, 0]); +GVAR(camera) setVectorDirAndUp [vectorDir GVAR(cameraHelper), vectorUp GVAR(cameraHelper)]; + +//--- Make sure the camera is not underground +if ((getPosAsl GVAR(camera) select 2) < (getPosAsl GVAR(center) select 2)) then { + private _disCoef = ((getPosAsl GVAR(cameraHelper) select 2) - (getPosAsl GVAR(center) select 2)) / ((getPosAsl GVAR(cameraHelper) select 2) - (getPosAsl GVAR(camera) select 2) + 0.001); + GVAR(camera) setPos (GVAR(cameraHelper) modelToWorldVisual [0, -_distance * _disCoef, 0]); +}; diff --git a/addons/arsenal/functions/fnc_updateRightPanel.sqf b/addons/arsenal/functions/fnc_updateRightPanel.sqf new file mode 100644 index 0000000000..41c7c68483 --- /dev/null +++ b/addons/arsenal/functions/fnc_updateRightPanel.sqf @@ -0,0 +1,57 @@ +/* + * Author: Alganthe + * Update the right panel (listnbox). + * + * Arguments: + * 0: Right panel control + * 1: Max load of the current container + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_control", "_maxLoad"]; + +private _loadIndicatorBarCtrl = _display displayCtrl IDC_loadIndicatorBar; +private _curSel = lnbCurSelRow _control; + +(lnbSize _control) params ["_rows"]; + +_maxLoad = getnumber (configfile >> "CfgVehicles" >> _maxLoad >> "maximumLoad"); +_maxLoad = _maxLoad * (1 - (progressPosition _loadIndicatorBarCtrl)); +_maxLoad = parseNumber (_maxLoad toFixed 2); // Required to avoid an issue where even though the typename returns "SCALAR" it doesn't act as one. + +// Grey out items too big +for "_r" from 0 to (_rows - 1) do { + private _mass = _control getVariable (_control lnbData [_r, 0]); + private _class = _control lnbText [_r, 1]; + + private _alpha = [0.25, 1.0] select (_mass <= _maxLoad); + private _color = [1, 1, 1, _alpha]; + _control lnbSetColor [[_r, 1],_color]; + _control lnbSetColor [[_r, 2],_color]; +}; + +// Remove all from container show / hide +private _removeAllCtrl = _display displayCtrl IDC_buttonRemoveAll; + +if (progressPosition _loadIndicatorBarCtrl > 0) then { + + _removeAllCtrl ctrlSetFade 0; + _removeAllCtrl ctrlShow true; + _removeAllCtrl ctrlEnable true; + _removeAllCtrl ctrlCommit FADE_DELAY; +}; + +(_display displayCtrl IDC_totalWeightText) ctrlSetText (format ["%1 (%2)", [GVAR(center), 2] call EFUNC(common,getWeight), [GVAR(center), 1] call EFUNC(common,getWeight)]); + +// change button color if unique or too big +if (_curSel != -1) then { + private _plusButtonCtrl = _display displayCtrl IDC_arrowPlus; + _plusButtonCtrl ctrlEnable !((_control lnbValue [_curSel, 2]) == 1 || {(_control getVariable (_control lnbData [_curSel, 0])) > _maxLoad}); + _plusButtonCtrl ctrlCommit FADE_DELAY; +}; diff --git a/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf b/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf new file mode 100644 index 0000000000..7a037d987d --- /dev/null +++ b/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf @@ -0,0 +1,118 @@ +/* + * Author: Alganthe + * Update the list of unique items. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +GVAR(virtualItems) set [18, []]; +GVAR(virtualItems) set [19, []]; +GVAR(virtualItems) set [20, []]; +GVAR(virtualItems) set [21, []]; +GVAR(virtualItems) set [22, [[], [], [], []]]; +GVAR(virtualItems) set [23, []]; +GVAR(virtualItems) set [24, []]; + +private _array = LIST_DEFAULTS select 2; +private _itemsCache = uiNamespace getVariable QGVAR(configItems); + +private _configCfgWeapons = configFile >> "CfgWeapons"; +private _configMagazines = configFile >> "CfgMagazines"; +private _configVehicles = configFile >> "CfgVehicles"; +private _configGlasses = configFile >> "CfgGlasses"; + +{ + switch true do { + // Weapon mag + case ( + isClass (_configMagazines >> _x) && + {_x in (_itemsCache select 2)} && + {!(_x in (GVAR(virtualItems) select 2))} + ): { + (GVAR(virtualItems) select 19) pushBackUnique _x; + }; + + // Mag throw + case ( + isClass (_configMagazines >> _x) && + {_x in (_itemsCache select 15)} && + {!(_x in (GVAR(virtualItems) select 15))} + ): { + (GVAR(virtualItems) select 20) pushBackUnique _x; + }; + + // Mag put + case ( + isClass (_configMagazines >> _x) && + {_x in (_itemsCache select 16)} && + {!(_x in (GVAR(virtualItems) select 16))} + ): { + (GVAR(virtualItems) select 21) pushBackUnique _x; + }; + + // acc + case ( + isClass (_configCfgWeapons >> _x) && + {!(_x in ((GVAR(virtualItems) select 1) select 0))} && + {_x in ((_itemsCache select 1) select 0)} + ): { + ((GVAR(virtualItems) select 22) select 0) pushBackUnique _x; + }; + + // acc + case ( + isClass (_configCfgWeapons >> _x) && + {!(_x in ((GVAR(virtualItems) select 1) select 1))} && + {_x in ((_itemsCache select 1) select 1)} + ): { + ((GVAR(virtualItems) select 22) select 1) pushBackUnique _x; + }; + + // acc + case ( + isClass (_configCfgWeapons >> _x) && + {!(_x in ((GVAR(virtualItems) select 1) select 2))} && + {_x in ((_itemsCache select 1) select 2)} + ): { + ((GVAR(virtualItems) select 22) select 2) pushBackUnique _x; + }; + // acc + case ( + isClass (_configCfgWeapons >> _x) && + {!(_x in ((GVAR(virtualItems) select 1) select 3))} && + {_x in ((_itemsCache select 1) select 3)} + ): { + ((GVAR(virtualItems) select 22) select 3) pushBackUnique _x; + }; + + // Misc + case ( + isClass (_configCfgWeapons >> _x) && + {!(_x in (GVAR(virtualItems) select 17))} && + {!(_x in ((_itemsCache select 1) select 0))} && + {!(_x in ((_itemsCache select 1) select 1))} && + {!(_x in ((_itemsCache select 1) select 2))} && + {!(_x in ((_itemsCache select 1) select 3))} + ): { + (GVAR(virtualItems) select 18) pushBackUnique _x; + }; + + // Backpacks + case (isClass (_configVehicles >> _x)): { + (GVAR(virtualItems) select 23) pushBackUnique _x; + }; + + // Facewear + case (isClass (_configGlasses >> _x)): { + (GVAR(virtualItems) select 24) pushBackUnique _x; + }; + }; +} foreach _array; diff --git a/addons/arsenal/functions/fnc_verifyLoadout.sqf b/addons/arsenal/functions/fnc_verifyLoadout.sqf new file mode 100644 index 0000000000..e7946b8b10 --- /dev/null +++ b/addons/arsenal/functions/fnc_verifyLoadout.sqf @@ -0,0 +1,239 @@ +/* + * Author: Alganthe + * Verify the provided loadout. + * + * Arguments: + * 0: Loadout (getUnitLoadout format) + * + * Return Value: + * Verified loadout and missing / unavailable items list and count + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_loadout"]; + +private _weaponCfg = configFile >> "CfgWeapons"; +private _magCfg = configFile >> "CfgMagazines"; +private _vehcCfg = configFile >> "CfgVehicles"; +private _glassesCfg = configFile >> "CfgGlasses"; +private _weaponsArray = GVAR(virtualItems) select 0; +private _accsArray = GVAR(virtualItems) select 1; + +private _nullItemsAmount = 0; +private _unavailableItemsAmount = 0; +private _nullItemsList = []; +private _unavailableItemsList = []; + +private _fnc_weaponCheck = { + params ["_dataPath"]; + + if (count _dataPath != 0) then { + { + if (_x isEqualType "") then { + + private _item = _x; + + if (_item != "") then { + if (isClass (_weaponCfg >> _item)) then { + if !(CHECK_WEAPON_OR_ACC) then { + + _unavailableItemsList pushBackUnique _item; + _dataPath set [_forEachIndex, ""]; + _unavailableItemsAmount = _unavailableItemsAmount + 1; + }; + } else { + + _nullItemsList pushBackUnique _item; + _dataPath set [_forEachIndex, ""]; + _nullItemsAmount = _nullItemsAmount + 1; + }; + }; + + } else { + + if (count _x != 0) then { + private _mag = _x select 0; + + if (isClass (_magCfg >> _mag)) then { + if !(_mag in (GVAR(virtualItems) select 2)) then { + + _unavailableItemsList pushBackUnique _item; + _dataPath set [_forEachIndex, []]; + _unavailableItemsAmount = _unavailableItemsAmount + 1; + }; + } else { + + _nullItemsList pushBackUnique _item; + _dataPath set [_forEachIndex, []]; + _nullItemsAmount = _nullItemsAmount + 1; + }; + }; + }; + } foreach _dataPath; + }; +}; + +for "_dataIndex" from 0 to 9 do { + switch (_dataIndex) do { + case 0; + case 1; + case 2; + case 8: { + [_loadout select _dataIndex] call _fnc_weaponCheck; + }; + + case 3; + case 4; + case 5: { + private _containerArray = (_loadout select _dataIndex); + + if (count _containerArray != 0) then { + + _containerArray params ["_item", "_containerItems"]; + + if (isClass (_vehcCfg >> _item) || {isClass (_weaponCfg >> _item)}) then { + if !(CHECK_CONTAINER) then { + + _unavailableItemsList pushBackUnique _item; + _loadout set [_dataIndex, []]; + _unavailableItemsAmount = _unavailableItemsAmount + 1; + } else { + + if (count _containerItems != 0) then { + { + private _currentIndex = _forEachIndex; + + switch (count _x) do { + case 2: { + + if ((_x select 0) isEqualType "") then { + + private _item = _x select 0; + + if (CLASS_CHECK_ITEM) then { + if !(CHECK_CONTAINER_ITEMS) then { + + _unavailableItemsList pushBackUnique _item; + ((_loadout select _dataIndex) select 1) set [_currentIndex, []]; + _unavailableItemsAmount = _unavailableItemsAmount + 1; + }; + } else { + + _nullItemsList pushBackUnique _item; + ((_loadout select _dataIndex) select 1) set [_currentIndex, []]; + _nullItemsAmount = _nullItemsAmount + 1; + }; + } else { + + [(((_loadout select _dataIndex) select 1) select _currentIndex) select 0] call _fnc_weaponCheck; + }; + }; + + case 3: { + private _item = _x select 0; + + if (isClass (_magCfg >> _item)) then { + if !( + _item in (GVAR(virtualItems) select 2) || + _item in (GVAR(virtualItems) select 15) || + _item in (GVAR(virtualItems) select 16) + ) then { + + _unavailableItemsList pushBackUnique _item; + ((_loadout select _dataIndex) select 1) set [_currentIndex, []]; + _unavailableItemsAmount = _unavailableItemsAmount + 1; + }; + } else { + + _nullItemsList pushBackUnique _item; + ((_loadout select _dataIndex) select 1) set [_currentIndex, []]; + _nullItemsAmount = _nullItemsAmount + 1; + }; + }; + }; + } foreach _containerItems; + }; + }; + } else { + + _nullItemsList pushBackUnique _item; + _loadout set [_dataIndex, []]; + _nullItemsAmount = _nullItemsAmount + 1; + }; + }; + }; + + case 6: { + private _item = _loadout select _dataIndex; + + if (_item != "") then { + + if (isClass (_weaponCfg >> _item)) then { + + if !(_item in (GVAR(virtualItems) select 3)) then { + + _unavailableItemsList pushBackUnique _item; + _loadout set [_dataIndex, ""]; + _unavailableItemsAmount = _unavailableItemsAmount + 1; + }; + } else { + + _nullItemsList pushBackUnique _item; + _loadout set [_dataIndex, ""]; + _nullItemsAmount = _nullItemsAmount + 1; + }; + }; + }; + + case 7: { + private _item = _loadout select _dataIndex; + + if (_item != "") then { + + if (isClass (_glassesCfg >> _item)) then { + + if !(_item in (GVAR(virtualItems) select 7)) then { + + _unavailableItemsList pushBackUnique _item; + _loadout set [_dataIndex, ""]; + _unavailableItemsAmount = _unavailableItemsAmount + 1; + }; + } else { + + _nullItemsList pushBackUnique _item; + _loadout set [_dataIndex, ""]; + _nullItemsAmount = _nullItemsAmount + 1; + }; + }; + }; + + case 9: { + for "_subIndex" from 0 to 4 do { + private _item = (_loadout select _dataIndex) select _subIndex; + + if (_item != "") then { + + if (isClass (_weaponCfg >> _item)) then { + + if !(CHECK_ASSIGNED_ITEMS) then { + + _unavailableItemsList pushBackUnique _item; + (_loadout select _dataIndex) set [_subIndex, ""]; + _unavailableItemsAmount = _unavailableItemsAmount + 1; + }; + } else { + + _nullItemsList pushBackUnique _item; + (_loadout select _dataIndex) set [_subIndex, ""]; + _nullItemsAmount = _nullItemsAmount + 1; + }; + }; + }; + }; + }; +}; + +[_loadout, _nullItemsAmount, _unavailableItemsAmount, _nullItemsList, _unavailableItemsList] diff --git a/addons/arsenal/functions/script_component.hpp b/addons/arsenal/functions/script_component.hpp new file mode 100644 index 0000000000..523addf768 --- /dev/null +++ b/addons/arsenal/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\arsenal\script_component.hpp" \ No newline at end of file diff --git a/addons/arsenal/missions/Arsenal.VR/CfgEventHandlers.hpp b/addons/arsenal/missions/Arsenal.VR/CfgEventHandlers.hpp new file mode 100644 index 0000000000..0f36260026 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call compile preprocessFileLineNumbers 'XEH_preInit.sqf'); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call compile preprocessFileLineNumbers 'XEH_postInit.sqf'); + }; +}; diff --git a/addons/arsenal/missions/Arsenal.VR/XEH_postInit.sqf b/addons/arsenal/missions/Arsenal.VR/XEH_postInit.sqf new file mode 100644 index 0000000000..e9fde7c172 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/XEH_postInit.sqf @@ -0,0 +1,113 @@ +#include "script_component.hpp" +#include "\z\ace\addons\arsenal\defines.hpp" +#include "\a3\ui_f\hpp\defineDIKCodes.inc" + +enableSaving [false, false]; +cba_diagnostic_projectileMaxLines = 10; + +[QGVAR(displayOpened), { + private _player = player; + + // player pose + [{ + switch (true) do { + case (primaryWeapon _this != ""): { + _this switchMove "amovpercmstpslowwrfldnon"; + }; + case (handgunWeapon _this != ""): { + _this switchMove "amovpercmstpslowwpstdnon"; + }; + default { + _this switchMove "amovpercmstpsnonwnondnon"; + }; + }; + }, _player] call CBA_fnc_execNextFrame; + + // hide everything except the player + { + _x enableSimulation false; + _x hideObject true; + } forEach (allMissionObjects "" - [_player]); + + _player call CBA_fnc_removeUnitTrackProjectiles; + _player setFatigue 0; + + // Esc to close mission + { + private _display = findDisplay IDD_ace_arsenal; + + _display displayAddEventHandler ["KeyDown", { + params ["_display", "_key", "_shift"]; + + if (_key isEqualTo DIK_ESCAPE && {!_shift}) then { + [_display] spawn { + disableSerialization; + params ["_display"]; + + private _return = [ + localize "str_sure", + localize "str_a3_rscdisplaymain_buttonexit", + true, false, + _display, false, true + ] call BIS_fnc_GUImessage; + + if (_return) then { + profileNamespace setVariable [QGVAR(missionLastLoadout), getUnitLoadout player]; + _display closeDisplay 2; + findDisplay 46 closeDisplay 0; + }; + }; + true + }; + }]; + + private _buttonClose = _display displayCtrl IDC_menuBarClose; + _buttonClose ctrlSetText localize "str_a3_rscdisplayarsenal_buttonok"; + } call CBA_fnc_execNextFrame; +}] call CBA_fnc_addEventHandler; + +[QGVAR(displayClosed), { + private _player = player; + + // unhide everthing + { + _x enableSimulation true; + _x hideObject false; + } forEach allMissionObjects ""; + + // update VR unit gear + { + private _unit = _x; + + removeVest _unit; + _unit addVest vest _player; + + removeBackpack _unit; + _unit addBackpack backpack _player; + + removeHeadgear _unit; + _unit addHeadgear headgear _player; + + removeGoggles _unit; + _unit addGoggles goggles _player; + + removeAllWeapons _unit; + _unit addWeapon primaryWeapon _player; + { + _unit addPrimaryWeaponItem _x; + } forEach primaryWeaponItems _player; + + _unit addWeapon secondaryWeapon _player; + + { + _unit addSecondaryWeaponItem _x; + } forEach secondaryWeaponItems _player; + + _unit addWeapon handgunWeapon _player; + { + _unit addHandgunItem _x; + } forEach handgunItems _player; + } forEach (entities [["B_Soldier_VR_F", "O_Soldier_VR_F", "I_Soldier_VR_F"], [], true]); + + _player call CBA_fnc_addUnitTrackProjectiles; +}] call CBA_fnc_addEventHandler; diff --git a/addons/arsenal/missions/Arsenal.VR/XEH_preInit.sqf b/addons/arsenal/missions/Arsenal.VR/XEH_preInit.sqf new file mode 100644 index 0000000000..329d5fd1a5 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/XEH_preInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +PREP(onPause); +PREP(createTarget); diff --git a/addons/arsenal/missions/Arsenal.VR/description.ext b/addons/arsenal/missions/Arsenal.VR/description.ext new file mode 100644 index 0000000000..b548cb933e --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/description.ext @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +dev = "commy2"; +author = ECSTRING(common,ACETeam); + +onLoadName = CSTRING(Mission); +overviewText = CSTRING(Mission_overview); +overviewPicture = "logo_ca.paa"; + +briefing = 0; +debriefing = 0; +enableDebugConsoleSP = 1; + +doneKeys[] = {"BIS_Arsenal.Map_VR_done"}; +onPauseScript[] = {QFUNC(onPause)}; + +#include "CfgEventHandlers.hpp" diff --git a/addons/arsenal/missions/Arsenal.VR/fnc_createTarget.sqf b/addons/arsenal/missions/Arsenal.VR/fnc_createTarget.sqf new file mode 100644 index 0000000000..7ff1ea58e6 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/fnc_createTarget.sqf @@ -0,0 +1,66 @@ +#include "script_component.hpp" + +params ["_type", "_position", ["_group", grpNull], "_varName"]; +private _player = player; + +if (isNull _group) then { + _group = creategroup east; +}; + +private _target = _group createUnit [_type, [10,10,0], [], 0, "NONE"]; + +if (isNil "_varName") then { + _varName = _target call BIS_fnc_netId; +}; + +_target setPos _position; +_target setDir (_position getDir _player); +_target doWatch position _player; +_target addRating -10e10; +_target setUnitPos "UP"; +_target setBehaviour "CARELESS"; +_target setCombatMode "BLUE"; +_target setSpeedMode "LIMITED"; +_target disableAI "TARGET"; +_target disableAI "AUTOTARGET"; +_target allowFleeing 0; +_target setSpeaker "BASE"; + +[{ + params ["_target", "_time"]; + + if (speaker _target == "BASE") exitWith {time > _time}; + _target setSpeaker "BASE"; + false +}, {}, [_target, time + 1]] call CBA_fnc_waitUntilAndExecute; + +_player reveal [_target, 4]; + +_target addVest vest _player; +_target addBackpack backpack _player; +_target addHeadgear headgear _player; +_target addGoggles goggles _player; +_target addWeapon primaryWeapon _player; +_target addWeapon secondaryWeapon _player; +_target addWeapon handgunWeapon _player; + +_target setVehicleVarName _varName; +missionNamespace setvariable [_varName, _target]; + +_target switchMove "amovpercmstpslowwrfldnon"; +_target setVariable ["origin", _position]; + +_target addEventHandler ["killed", { + params ["_target"]; + private _position = _target getVariable ["origin", position _target]; + private _varName = vehicleVarName _target; + + [_target, true] spawn BIS_fnc_VREffectKilled; + + [{isNull (_this select 0)}, { + (_this select 1) call FUNC(createTarget); + }, [_target, [typeOf _target, _position, group _target, _varName]]] call CBA_fnc_waitUntilAndExecute; +}]; + +_target call BIS_fnc_VRHitpart; +_target diff --git a/addons/arsenal/missions/Arsenal.VR/fnc_onPause.sqf b/addons/arsenal/missions/Arsenal.VR/fnc_onPause.sqf new file mode 100644 index 0000000000..25e49405bf --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/fnc_onPause.sqf @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +params ["_display"]; + +private _ctrlButtonAbort = _display displayCtrl 104; +_ctrlButtonAbort ctrlSetText localize LSTRING(Mission); +_ctrlButtonAbort ctrlSetTooltip localize LSTRING(ReturnToArsenal); + +_ctrlButtonAbort ctrlSetEventHandler ["ButtonClick", { + params ["_control"]; + ctrlParent _control closeDisplay 2; + {[player, player, true] call FUNC(openBox)} call CBA_fnc_execNextFrame; + true +} call EFUNC(common,codeToString)]; + +true diff --git a/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf b/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf new file mode 100644 index 0000000000..111202d04e --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf @@ -0,0 +1,175 @@ +#include "script_component.hpp" + +params ["_unit"]; + +private _loadout = profileNamespace getVariable QGVAR(missionLastLoadout); + +if (!isNil "_loadout") then { + _unit setUnitLoadout _loadout; +}; + +_unit allowDamage false; + +//--- Static targets in various distance +{ + private _position = _unit getRelPos [_x, _forEachIndex]; + ["O_Soldier_VR_F", _position] call FUNC(createTarget); +} forEach [10, 20, 30, 40, 50, 100, 500, 1000, 2000]; + +//--- Target line +private _position = _unit getRelPos [20, -90]; + +for "_i" from 0 to 5 do { + private _position = _position vectorAdd [0, -3 + _i, 0]; + ["O_Soldier_VR_F", _position] call FUNC(createTarget); +}; + +//--- Target cluster +_position = _unit getRelPos [20, 90]; + +for "_i" from 0 to 8 do { + private _index = floor (_i / 3); + private _position = _position vectorAdd [_index * 1.5, 1.5 + (_i % 3), 0]; + + private _target = ["O_Soldier_VR_F", _position] call FUNC(createTarget); + + _target switchMove (["aidlpercmstpslowwrfldnon", "aidlpknlmstpslowwrfldnon_ai", "aidlppnemstpsraswrfldnon_ai"] select _index); + _target setUnitPos (["UP", "MIDDLE", "DOWN"] select _index); +}; + +//--- Target patrol +private _group = createGroup east; + +{ + private _position = _unit getRelPos [10, _x]; + private _waypoint = _group addWaypoint [_position, 0]; + + if (_forEachIndex == 4) then { + _waypoint setWaypointType "CYCLE"; + }; +} forEach [0, 90, 180, 270, 0]; + +_position = _unit getRelPos [10, 180]; + +for "_i" from 0 to 1 do { + private _target = ["O_Soldier_VR_F", _position] call FUNC(createTarget); + + [_target] join _group; + _target stop false; + _target enableAI "MOVE"; + _target setSpeedMode "LIMITED"; +}; + +//--- Armored vehicles +private _vehicles = []; + +private _step = 15; +_position = [position _unit select 0,(position _unit select 1) + 30,0]; + +{ + private _row = _forEachIndex; + private _rowCount = (count _x - 1) * 0.5; + + { + private _position = _position vectorAdd [(-_rowCount + _forEachIndex) * _step, _row * _step, 0]; + + private _vehicle = createVehicle [_x, _position, [], 0, "NONE"]; + _vehicle setPos _position; + _vehicle setDir 180; + _vehicle setVelocity [0,0,-1]; + _vehicle call BIS_fnc_VRHitpart; + + private _marker = _vehicle call BIS_fnc_boundingBoxMarker; + _marker setMarkerColor "ColorOrange"; + _vehicles pushBack _vehicle; + } forEach _x; +} forEach [[ + "Land_VR_Target_MRAP_01_F", + "Land_VR_Target_APC_Wheeled_01_F", + "Land_VR_Target_MBT_01_cannon_F" +], [ + "Land_VR_Target_MRAP_01_F", + "Land_VR_Target_APC_Wheeled_01_F", + "Land_VR_Target_MBT_01_cannon_F" +]]; + +_vehicles spawn { + waituntil { + private _allDisabled = true; + + { + _hitAlive = _x getVariable ["bis_fnc_VRHitParts_hitalive", []]; + _allDisabled = _allDisabled && ({!_x} count _hitAlive >= 2); + sleep 0.1; + } forEach _this; + + _allDisabled + }; + + setStatValue ["MarkMassVirtualDestruction", 1]; +}; + +//--- Cover objects +private _coverObjects = [ + "Land_VR_CoverObject_01_kneel_F", + "Land_VR_CoverObject_01_kneelHigh_F", + "Land_VR_CoverObject_01_kneelLow_F", + "Land_VR_CoverObject_01_stand_F", + "Land_VR_CoverObject_01_standHigh_F" +]; + +for "_i" from 5 to 11 do { + private _direction = 180 + _i * 45; + private _position = _unit getRelPos [(abs sin _direction + abs cos _direction) * 3, _direction]; + private _block = createVehicle [_coverObjects select (_i % count _coverObjects), _position, [], 0, "NONE"]; + _block setPos _position; +}; + +//--- Starting point +private _square = createVehicle ["VR_Area_01_square_1x1_grey_F", position _unit, [], 0, "NONE"]; +_square setPosASL getPosASL _unit; + +private _marker = createMarker [QGVAR(start), getPosWorld _unit]; +_marker setMarkerType "mil_start"; + +//--- Open Arsenal +[_unit, true, false] call FUNC(initBox); + +[{!isNull findDisplay 46}, { + [_this, _this, true] call FUNC(openBox); +}, _unit] call CBA_fnc_waitUntilAndExecute; + +//--- Salute +_unit addEventHandler ["AnimChanged", { + params ["_unit", "_anim"]; + _anim = _anim splitString "_"; + + if ("salute" in _anim) then { + { + _x playAction "salute"; + } forEach ((_unit nearObjects ["CAManBase", 10]) - [_unit]); + }; +}]; + +["#(argb,8,8,3)color(0,0,0,1)", false, nil, 0.1, [0,0.5]] spawn BIS_fnc_textTiles; + +//--- Target markers +private _markers = []; + +{ + private _marker = createMarker [vehicleVarName _x, position _x]; + _marker setMarkerType "mil_dot"; + _marker setMarkerColor "ColorOrange"; + + _markers pushBack _marker; +} forEach (allMissionObjects "CAManBase" - [_unit]); + +_markers spawn { + while {true} do { + { + private _target = missionNamespace getVariable _x; + _x setMarkerPos position _target; + } forEach _this; + sleep 0.1; + }; +}; diff --git a/addons/arsenal/missions/Arsenal.VR/logo_ca.paa b/addons/arsenal/missions/Arsenal.VR/logo_ca.paa new file mode 100644 index 0000000000..0ad1e2dd0f Binary files /dev/null and b/addons/arsenal/missions/Arsenal.VR/logo_ca.paa differ diff --git a/addons/arsenal/missions/Arsenal.VR/mission.sqm b/addons/arsenal/missions/Arsenal.VR/mission.sqm new file mode 100644 index 0000000000..c43d901f6e --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/mission.sqm @@ -0,0 +1,163 @@ +version=12; +class Mission +{ + addOns[]= + { + "A3_Map_VR", + "A3_Characters_F_BLUFOR", + "a3_characters_f_beta", + "a3_characters_f" + }; + addOnsAuto[]= + { + "A3_Characters_F_BLUFOR", + "a3_characters_f", + "A3_Map_VR" + }; + randomSeed=5486937; + class Intel + { + briefingName="@STR_A3_Arsenal"; + startWeather=0; + startWind=0.099999994; + startWaves=0.099999994; + forecastWeather=0; + forecastWind=0.099999994; + forecastWaves=0.099999994; + forecastLightnings=0.099999994; + year=2035; + month=2; + day=24; + hour=12; + minute=0; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; + class Groups + { + items=1; + class Item0 + { + side="CIV"; + class Vehicles + { + items=1; + class Item0 + { + position[]={4256,5,4192}; + azimut=180; + id=0; + side="CIV"; + vehicle="C_man_1"; + player="PLAYER COMMANDER"; + leader=1; + skill=0.60000002; + }; + }; + }; + }; + class Sensors + { + items=1; + class Item0 + { + position[]={4271.2827,5,4170.251}; + a=0; + b=0; + interruptable=1; + age="UNKNOWN"; + expCond="cheat1"; + expActiv="endmission ""end1"""; + class Effects + { + }; + }; + }; +}; +class Intro +{ + addOns[]= + { + "A3_Map_VR" + }; + addOnsAuto[]= + { + "A3_Map_VR" + }; + randomSeed=12455686; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; +}; +class OutroWin +{ + addOns[]= + { + "A3_Map_VR" + }; + addOnsAuto[]= + { + "A3_Map_VR" + }; + randomSeed=9312504; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; +}; +class OutroLoose +{ + addOns[]= + { + "A3_Map_VR" + }; + addOnsAuto[]= + { + "A3_Map_VR" + }; + randomSeed=15192082; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; +}; diff --git a/addons/arsenal/missions/Arsenal.VR/script_component.hpp b/addons/arsenal/missions/Arsenal.VR/script_component.hpp new file mode 100644 index 0000000000..83467c1293 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/script_component.hpp @@ -0,0 +1,3 @@ +#include "\z\ace\addons\arsenal\script_component.hpp" + +#define PREP(var) FUNC(var) = compileFinal preprocessFileLineNumbers format ["fnc_%1.sqf", QUOTE(var)] diff --git a/addons/arsenal/script_component.hpp b/addons/arsenal/script_component.hpp new file mode 100644 index 0000000000..2eb9c3f170 --- /dev/null +++ b/addons/arsenal/script_component.hpp @@ -0,0 +1,17 @@ +#define COMPONENT arsenal +#define COMPONENT_BEAUTIFIED Arsenal +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_ARSENAL + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_ARSENAL + #define DEBUG_SETTINGS DEBUG_SETTINGS_ARSENAL +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml new file mode 100644 index 0000000000..21452fed7a --- /dev/null +++ b/addons/arsenal/stringtable.xml @@ -0,0 +1,466 @@ + + + + + Hide + Cacher + Verstecken + Ukryj + 非表示 + Nascondere + + + Hide interface + Cache l'interface + Oberfläche verstecken + Ukryj interfejs + インターフェイスを隠す + Nascondi interfaccia + + + Loadouts + Équipements + Ausrüstungen + Zestawy wyposażenia + 装備 + Equipaggiamenti + + + Export + Exporter + Exportieren + Eksportuj + 出力 + Esporta + + + Import + Importer + Importieren + Importuj + 取込 + Importa + + + Close + Fermer + Schließen + Zamknij + 閉じる + Chiudi + + + No virtual item available + Aucun objet virtuel disponible + Kein virtuelles Objekt verfügbar + Brak dostępnych przedmiotów wirtualnych + 利用可能なバーチャル アイテムは無し + Nessun oggetto virtuale disponibile + + + Save + Enregister + Speichern + Zapisz + 保存 + Salva + + + Save the current loadout + Enregistre l'équipement actuel + Ausgewählte Ausrüstung speichern + Zapisz obecny zestaw + 現在の装備を保存します + Salva l'equipaggiamento corrente + + + Rename + Renommer + Umbenennen + Zmień nazwę + 改名 + Rinomina + + + Rename the selected loadout + Renomme l'équipement sélectionné + Ausgewählte Ausrüstung umbenennen + Zmień nazwę wybranego zestawu + 現在選択中の装備を改名します + Rinomina l'equipaggiamento selezionato + + + Load + Charger + Laden + Wczytaj + 読み込む + Carica + + + Load the selected loadout + Charger l'équipement sélectionné + Ausgewählte Ausrüstung laden + Wczytaj wybrany zestaw + 現在選択中の装備を読み込みます + Carica l'equipaggiamento selezionato + + + Delete + Supprimer + Entfernen + Skasuj + 削除 + Elimina + + + Delete the selected loadout + Supprimer l'équipement sélectionné + Ausgewählte Ausrüstung entfernen + Skasuj wybrany zestaw + 現在選択中の装備を削除します + Elimina l'equipaggiamento selezionato + + + My loadouts + Mes équipements + Meine Ausrüstungen + Moje zestawy + 自分の装備 + I miei equipaggiamenti + + + Loadouts saved in your profile + Équipements enregistrés dans votre profil + Ausrüstungen, die in deinem Profil gespeichert sind + Zestawy zapisane w Twoim profilu + 自プロフィールに保存された装備です + Gli equipaggiamenti salvati nel tuo profilo + + + Default loadouts + Équipements de base + Standard-Ausrüstungen + Domyślne zestawy + 標準の装備 + Equipaggiamenti standard + + + Loadouts made available by the mission maker + Équipements faits par l'auteur de la mission + Ausrüstungen, die durch den Missionsersteller zur Verfügung gestellt worden sind + Zestawy udostępnione przez twórcę misji + 装備はミッション著者によって利用できます + Equipaggiamenti resi disponibili dal creatore della missione + + + Public loadouts + Équipements publics + Veröffentlichte Ausrüstungen + Publiczne zestawy + 公開装備 + Equipaggiamenti pubblici + + + Loadouts shared by you and other players + Équipements mis à disposition par vous ou les autres joueurs + Ausrüstungen, die von dir und anderen Spielern geteilt wurden + Zestawy udostępnione przez Ciebie i innych graczy + 自分か他人によって共有された装備です + Equipaggiamenti condivisi da te e da altri giocatori + + + Sort by weight + Trier par poids + Nach Gewicht sortieren + Sortuj wg wagi + 重量で並び替え + Ordina per peso + + + Sort by amount + Trier par quantité + Nach Menge sortieren + Sortuj wg ilości + 量で並び替え + Ordina per quantitativo + + + Share or stop sharing the selected loadout + Partager ou arrêter de partager cet équipement + Ausgewählte Ausrüstung teilen oder nicht mehr teilen + Udostępnij lub przestań udostępniać wybrany zestaw + 選択した装備の共有設定 + Condividi o smetti di condividere l'equipaggiamento selezionato + + + Private + Privé + Privat + Prywatny + 非公開 + Privato + + + Public + Public + Öffentlich + Publiczny + 公開 + Pubblico + + + The default loadouts list is empty! + La liste d'équipements de base est vide ! + Die Standard-Ausrüstungen-Liste ist leer! + Lista domyślnych zestawów jest pusta! + 標準の装備一欄が空です! + La lista degli equipaggiamenti standard è vuota! + + + Default loadouts list exported to clipboard + Liste d'équipements de base exportée dans le presse papier + Standard-Ausrüstungen-Liste in die Zwischenablage exportiert + Lista domyślnych zestawów została eksportowana do schowka + 標準の装備一欄はクリップボードへ出力されました + La lista degli equipaggiamenti standard è stata esportata negli appunti + + + Current loadout exported to clipboard + Équipement actuel exporté dans le presse papier + Derzeitige Ausrüstung in die Zwischenablage exportiert + Obecny zestaw został eksportowany do schowka + 現在の装備はクリップボードへ出力されました + Equipaggiamento corrente esportato negli appunti + + + Wrong format provided + Mauvais format fourni + Falsches Format verwendet + Podano zły format + 間違ったフォーマットが入力されました + Formato fornito sbagliato + + + Default loadouts list imported from clipboard + Liste d'équipements de base importée depuis le presse papier + Standard-Ausrüstungen-Liste aus der Zwischenablage importiert + Lista domyślnych zestawów została importowana ze schowka + 標準の装備一欄はクリップボードから取込されました + La lista degli equipaggiamenti standard è stata importata dagli appunti + + + Loadout imported from clipboard + Équipement importé depuis le presse papier + Ausrüstung aus der Zwischenablage importiert + Zestaw został importowany ze schowka + 装備はクリップボードから取込されました + Equipaggiamento importato dagli appunti + + + The following loadout was deleted: + L'équipement suivant fut supprimé: + Folgende Ausrüstung wurde entfernt: + Następujący zestaw został skasowany: + 次の装備は削除されました: + Il seguente equipaggiamento è stato eliminato: + + + The following loadout is not public anymore: + L'équipement suivant n'est plus public: + Folgende Ausrüstung ist nicht mehr öffentlich: + Następujący zestaw nie jest już publiczny: + 次の装備は非公開になりました: + Il seguente eequipaggiamento non è più pubblico: + + + The name field is empty! + Le champ nom est vide ! + Das Feld "Name" ist leer! + Pole nazwy jest puste! + 名前欄が空白です! + Il campo del nome è vuoto! + + + You are the author of this loadout + Vous êtes l'auteur de cet équipement + Du bist der Ersteller dieser Ausrüstung + Jesteś autorem tego zestawu + あなたはこの装備の作者です + Sei l'autore di questo equipaggiamento + + + A loadout of yours with the same name is public + Un de vos équipements avec le même nom est public + Eine deiner Ausrüstungen mit dem gleichen Namen ist öffentlich + Jeden z Twoich zestawów nazwany tak samo jest już publiczny + あなたの装備は既に公開されているものと同名です + Un tuo equipaggiamento con lo stesso nome è pubblico + + + The following loadout was saved: + L'équipement suivant fut enregistré: + Folgende Ausrüstung wurde gespeichert: + Następujący zestaw został zapisany: + 次の装備は保存されました: + Il seguente equipaggiamento è stato salvato: + + + The following loadout was loaded: + L'équipement suivant fut chargé: + Folgene Ausrüstung wurde geladen: + Następujący zestaw został wczytany: + 次の装備が読み込みされました: + Il seguente equipaggiamento è stato caricato: + + + A loadout with the same name already exist! + Un équipement avec le même nom existe déjà ! + Eine Ausrüstung mit dem gleichen Namen existiert bereits! + Zestaw z tą nazwą już istnieje! + 既にその名前は装備に使われています! + Un equipaggiamento con lo stesso nome è gia esistente! + + + was renamed to + fut renommé en + wurde umbenannt in + zmienił nazwę na + 次の名前に改名されました + E' stato rinominato in + + + Invert camera controls + Inverser les contrôles de la caméra + Kamerasteuerung invertieren + Odwróć sterowanie kamerą + カメラ操作を反転 + Inverti comandi camera + + + Enable mod icons + Afficher les icônes de mod + Aktiviert Mod-Icons + Włącz ikony modów + MOD アイコンを表示 + Abilita icone mod + + + Panel font height + taille de police des panneaux + Schrifthöhe für die linke und rechte Liste + Wysokość czcionki + パネルにあるフォントの高さ + Altezza carattere del pannello + + + Allow default loadouts + Activer l'onglet équipement de base + Erlaubt die Benutzung des Standard-Ausrüstungen-Reiters + Zezwól na użycie domyślnych zestawów + 標準の装備を許可 + Consenti equipaggiamenti standard + + + Allow loadout sharing + Autoriser le partage d'équipement + Erlaubt das Teilen von Ausrüstungen + Zezwól na udostępnianie zestawów + 装備の共有を許可 + Consenti condivisione equipaggiamenti + + + Log missing / unavailable items + Enregistrer les objets manquants + Aktiviert die Aufzeichnung fehlender Gegenstände in der RPT + Rejestruj brakujące / niedostępne przedmioty + 欠落 / 利用不可アイテムを記録 + Log mancante / oggetto non disponibile + + + Primary magazine + Chargeur principal + Główny magazynek + プライマリ弾倉 + Caricatore primario + + + Secondary magazine + Chargeur secondaire + Dodatkowy magazynek + セカンダリ弾倉 + Caricatore secondario + + + ACE Arsenal + ACE Arsenal + ACE-Arsenal + ACE Arsenał + ACE 武器庫 + Arsenale ACE + + + Allow the use of the default loadouts tab + Autorise l'usage de l'onglet équipements de base + Zezwól na użycie zakładki domyślnych zestawów + 標準の装備タブの使用を許可します + Consenti l'uso della sezione per gli equipaggiamenti standard + + + Show / hide mod icons for the left panel + Montrer / cacher les icones de mod pour le panneau de gauche + Pokaż / ukryj ikony modów w lewym panelu + 左パネルにある MOD アイコンの表示 / 非表示をします + Mostra / nascondi le icone delle mod dal pannello sinistro + + + Change the font height for text in the left / right panels + Change la taille de police du texte des panneaux gauche / droite + Zmień wysokość czcionki dla tekstu lewego i prawego panelu + 右か左パネルにあるフォントの高さを変更します。 + Cambia l'altezza del font per il testo sul pannello sinistro / destro + + + Log missing / unavailable items in the RPT + Enregistre les objets manquants / indisponibles dans le RPT + Rejestruj brakujące / niedostępne przedmioty do pliku RPT + PRT で欠落 / 利用不可アイテムを記録します + Log mancante / oggetto non disponibile nell' RPT + + + Unable to open ACE arsenal + Impossible d'ouvrir ACE arsenal + Kann ACE-Arsenal nicht anzeigen + Impossibile aprire l'arsenale ACE + ACE 武器庫を開けません + + + Import BI VA loadouts to ACE Arsenal + Importe les loadouts de BI VA dans ACE Arsenal + + + No player unit available! Place a unit and mark it as "Player". + Aucune unité joueur disponible ! Placez une unité et marquez la en tant que "joueur". + + + No loadouts to import. + Aucun loadout à importer. + + + ACE Arsenal + ACE-Arsenal + + + Return to ACE Arsenal. + Zurück zum ACE-Arsenal. + + + Use ACE Arsenal to try out different weapons and equipment. + Verwende ACE-Arsenal und sieh dir verschiedene Waffen und Ausrüstung an und probiere sie aus. + + + Try weapons and equipment and create your own loadouts. + Probiere verschiedene Waffen und Ausrüstung aus und stelle dir eigene Ausrüstungsprofile zusammen. + + + diff --git a/addons/arsenal/ui/RscAttributes.hpp b/addons/arsenal/ui/RscAttributes.hpp new file mode 100644 index 0000000000..33564b7010 --- /dev/null +++ b/addons/arsenal/ui/RscAttributes.hpp @@ -0,0 +1,931 @@ +#include "RscCommon.hpp" +#include "..\defines.hpp" + +class GVAR(display) { + idd = IDD_ace_arsenal; + enableSimulation=1; + onLoad = QUOTE([ARR_3('onLoad', _this, QQGVAR(display))] call FUNC(onArsenalOpen)); + onUnload = QUOTE([ARR_3('onUnload', _this, QQGVAR(display))] call FUNC(onArsenalClose)); + onKeyDown = QUOTE([ARR_3('onKeyDown', _this, QQGVAR(display))] call FUNC(onKeyDown)); + onKeyUp = QUOTE(GVAR(shiftState) = _this select 2); + onMouseButtonDown = QUOTE([ARR_3('onMouseButtonDown', _this, QQGVAR(display))] call FUNC(onMouseButtonDown)); + onMouseButtonUp = QUOTE([ARR_3('onMouseButtonUp', _this, QQGVAR(display))] call FUNC(onMouseButtonUp)); + icon="\A3\Ui_f\data\Logos\a_64_ca.paa"; + logo="\A3\Ui_f\data\Logos\arsenal_1024_ca.paa"; + class ControlsBackground { + class blackLeft: ctrlStatic { + colorBackground[]={0,0,0,1}; + x = QUOTE(safezoneXAbs); + y = QUOTE(safezoneY); + w = QUOTE(safezoneXAbs - safezoneX); + h = QUOTE(safezoneH); + }; + + class blackRight: blackLeft { + x = QUOTE(safezoneX + safezoneW); + }; + + class mouseArea: ctrlStatic { + idc = IDC_mouseArea; + style = 16; + onMouseMoving = QUOTE([ARR_3('onMouseMoving', _this, GVAR(display))] call FUNC(handleMouse)); + onMouseHolding = QUOTE([ARR_3('onMouseHolding', _this, GVAR(display))] call FUNC(handleMouse)); + onMouseZChanged = QUOTE([ARR_3('onMouseZChanged', _this, GVAR(display))] call FUNC(handleScrollWheel)); + x = QUOTE(safezoneX); + y = QUOTE(safezoneY); + w = QUOTE(safezoneW); + h = QUOTE(safezoneH); + }; + }; + class controls { + class ArrowLeft: ctrlButton { + idc = IDC_arrowMinus; + text = "-"; + colorBackground[]={0,0,0,0.8}; + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), -1)] call FUNC(buttonCargo)); + fade = 1; + enable = 0; + x = 0.5; + y = 0.5; + w = QUOTE(1 * GRID_W); + h = QUOTE(1 * GRID_H); + sizeEx = QUOTE(7 * GRID_H); + }; + class ArrowRight: ArrowLeft { + idc = IDC_arrowPlus; + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), 1)] call FUNC(buttonCargo)); + text="+"; + }; + class blockLeftFrame: RscFrame { + idc = IDC_blockLeftFrame; + x = QUOTE(safezoneX + 13 * GRID_W); + y = QUOTE(safezoneY + 14 * GRID_H); + w = QUOTE(80 * GRID_W); + h = QUOTE(safezoneH - 24 * GRID_H); + colorText[] = {0,0,0,1}; + }; + class blockLeftBackground: ctrlStaticBackground { + idc = IDC_blockLeftBackground; + x = QUOTE(safezoneX + 13 * GRID_W); + y = QUOTE(safezoneY + 14 * GRID_H); + w = QUOTE(80 * GRID_W); + h = QUOTE(safezoneH - 24 * GRID_H); + colorBackground[] = {0,0,0,0.5}; + }; + class blockRightFrame: blockLeftFrame { + idc = IDC_blockRightFrame; + x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + h = QUOTE(safezoneH - 34 * GRID_H); + }; + class blockRighttBackground: blockLeftBackground { + idc = IDC_blockRighttBackground; + x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + h = QUOTE(safezoneH - 34 * GRID_H); + }; + class loadIndicator: RscControlsGroupNoScrollbars { + idc = IDC_loadIndicator; + x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + y = QUOTE(safeZoneH + safezoneY - 20 * GRID_H); + w = QUOTE(80 * GRID_W); + h = QUOTE(6 * GRID_H); + class controls { + class loadIndicatorBackground: ctrlStaticBackground { + idc = -1; + colorBackground[] = {0,0,0,0.5}; + x = 0; + y = 0; + w = QUOTE(80 * GRID_W); + h = QUOTE(6 * GRID_H); + }; + class loadIndicatorBar: ctrlProgress { + idc = IDC_loadIndicatorBar; + style = 0; + texture = "#(argb,8,8,3)color(1,1,1,1)"; + colorBar[] = {1,1,1,1}; + colorFrame[] = {0,0,0,1}; + x = 0; + y = 0; + w = QUOTE(80 * GRID_W); + h = QUOTE(6 * GRID_H); + }; + }; + }; + class totalWeight: RscControlsGroupNoScrollbars { + idc = IDC_totalWeight; + x = QUOTE(safezoneX + 13 * GRID_W); + y = QUOTE(safeZoneH + safezoneY - 10 * GRID_H); + w = QUOTE(80 * GRID_W); + h = QUOTE(8 * GRID_H); + class controls { + class totalWeightBackground: ctrlStaticBackground { + idc = -1; + colorBackground[] = {0,0,0,0.8}; + x = 0; + y = 0; + w = QUOTE(80 * GRID_W); + h = QUOTE(8 * GRID_H); + }; + class totalWeightTitle: RscText { + idc = -1; + text = ECSTRING(common,Weight); + x = 0; + y = 0; + w = QUOTE(30 * GRID_W); + h = QUOTE(8 * GRID_H); + sizeEx = QUOTE(7 * GRID_H); + }; + class totalWeightText: RscText { + idc = IDC_totalWeightText; + style = ST_RIGHT; + text = ""; + x = QUOTE(30 * GRID_W); + y = 0; + w = QUOTE(50 * GRID_W); + h = QUOTE(8 * GRID_H); + sizeEx = QUOTE(7 * GRID_H); + }; + }; + }; + class message: RscText { + idc = IDC_message; + fade = 1; + style=2; + shadow=0; + colorBackground[]={0,0,0,0.69999999}; + text=""; + x = QUOTE(safezoneX + safezoneW * 0.50 - 80 * GRID_W); + y = QUOTE(safeZoneH + safezoneY - 25 * GRID_H); + w = QUOTE(160 * GRID_W); + h = QUOTE(10 * GRID_H); + sizeEx = QUOTE(5 * GRID_H); + }; + + #define WIDTH_TOTAL (safezoneW - 2 * (93 * GRID_W)) + #define WIDTH_GAP (WIDTH_TOTAL / 100) + #define WIDTH_SINGLE ((WIDTH_TOTAL - 6 * WIDTH_GAP) / 5) + + class menuBar: RscControlsGroupNoScrollbars { + idc = IDC_menuBar; + x = QUOTE(0.5 - WIDTH_TOTAL / 2); + y = QUOTE(safezoneH + safezoneY - 9 * GRID_H); + w = QUOTE(WIDTH_TOTAL); + h = QUOTE(7 * GRID_H); + class controls { + class buttonHide: ctrlButton { + idc = -1; + colorBackground[] = {0,0,0,0.8}; + x = QUOTE(1 * WIDTH_GAP + 0 * WIDTH_SINGLE); + y = QUOTE(0); + w = QUOTE(WIDTH_SINGLE); + h = QUOTE(7 * GRID_H); + text = CSTRING(buttonHideText); + sizeEx = QUOTE(5 * GRID_H); + shortcuts[] = {"0x0E"}; + tooltip = CSTRING(buttonHideTooltip); + onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonHide)); + }; + class buttonLoadouts: buttonHide { + idc = -1; + x = QUOTE(2 * WIDTH_GAP + 1 * WIDTH_SINGLE); + text = CSTRING(buttonLoadoutsText); + onButtonClick = QUOTE(createDialog QQGVAR(loadoutsDisplay)); + }; + class buttonExport: buttonHide { + idc = -1; + x = QUOTE(3 * WIDTH_GAP + 2 * WIDTH_SINGLE); + text = CSTRING(buttonExportText); + onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonExport)); + }; + class buttonImport: buttonHide { + idc = -1; + x = QUOTE(4 * WIDTH_GAP + 3 * WIDTH_SINGLE); + text = CSTRING(buttonImportText); + onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonImport)); + }; + class buttonClose: ctrlButtonClose { + idc = IDC_menuBarClose; + colorBackground[] = {0,0,0,0.8}; + x = QUOTE(5 * WIDTH_GAP + 4 * WIDTH_SINGLE); + y = QUOTE(0); + w = QUOTE(WIDTH_SINGLE); + h = QUOTE(7 * GRID_H); + text = CSTRING(buttonCloseText); + sizeEx = QUOTE(5 * GRID_H); + shortcuts[]= {"0x01"}; + onButtonClick = QUOTE(ctrlparent (_this select 0) closeDisplay 2); + }; + }; + }; + class infoBox: RscControlsGroupNoScrollbars { + idc = IDC_infoBox; + fade = 1; + x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + y = QUOTE(safeZoneH + safezoneY - 14 * GRID_H); + w = QUOTE(92 * GRID_W); + h = QUOTE(12 * GRID_H); + class controls { + class infoBackground: ctrlStaticBackground { + idc = IDC_infoBackground; + x = QUOTE(0 * GRID_W); + y = QUOTE(0); + w = QUOTE(80 * GRID_W); + h = QUOTE(12 * GRID_H); + colorBackground[] = {0,0,0,0.8}; + }; + class infoName: RscText { + idc = IDC_infoName; + x = QUOTE(0 * GRID_W); + y = QUOTE(0); + w = QUOTE(80 * GRID_W); + h = QUOTE(7 * GRID_H); + sizeEx = QUOTE(5.5 * GRID_H); + }; + class infoAuthor: RscText { + idc = IDC_infoAuthor; + colorText[] = {1,1,1,0.5}; + x = QUOTE(0 * GRID_W); + y = QUOTE(6 * GRID_H); + w = QUOTE(80 * GRID_W); + h = QUOTE(5 * GRID_H); + sizeEx = QUOTE(5 * GRID_H); + }; + class DLCBackground: ctrlStaticBackground { + idc = IDC_DLCBackground; + fade = 1; + x = QUOTE(80 * GRID_W); + y = QUOTE(0); + w = QUOTE(12 * GRID_W); + h = QUOTE(12 * GRID_H); + }; + class DLCIcon: RscActivePicture { + idc = IDC_DLCIcon; + enabled = 0; + fade = 1; + color[] = {1,1,1,1}; + colorActive[] = {1,1,1,1}; + text="#(argb,8,8,3)color(1,1,1,1)"; + x = QUOTE(80 * GRID_W); + y = QUOTE(0); + w = QUOTE(12 * GRID_W); + h = QUOTE(12 * GRID_H); + }; + }; + }; + class mouseBlock: RscText { + idc = IDC_mouseBlock; + style = 16; + x = QUOTE(safezoneX); + y = QUOTE(safezoneY); + w = QUOTE(safezoneW); + h = QUOTE(safezoneH); + }; + class leftTabContent: RscListBox { + idc = IDC_leftTabContent; + colorBackground[]={0,0,0,0}; + colorSelectBackground[]={1,1,1,0.5}; + colorSelectBackground2[]={1,1,1,0.5}; + colorPictureSelected[]={1,1,1,1}; + colorSelect[]={1,1,1,1}; + colorSelect2[]={1,1,1,1}; + colorPictureRightSelected[]={1,1,1,1}; + onLBSelChanged = QUOTE(_this call FUNC(onSelChangedLeft)); + onSetFocus = QUOTE(GVAR(leftTabFocus) = true); + onKillFocus = QUOTE(GVAR(leftTabFocus) = false); + x = QUOTE(safezoneX + 13 * GRID_W); + y = QUOTE(safezoneY + 14 * GRID_H); + w = QUOTE(80 * GRID_W); + h = QUOTE(safezoneH - 24.5 * GRID_H); + sizeEx = QUOTE(7 * GRID_H); + }; + class rightTabContent: leftTabContent { + idc = IDC_rightTabContent; + drawSideArrows=1; + disableOverflow=1; + onLBSelChanged = QUOTE(_this call FUNC(onSelChangedRight)); + onSetFocus = QUOTE(GVAR(rightTabFocus) = true); + onKillFocus = QUOTE(GVAR(rightTabFocus) = false); + x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + h = QUOTE(safezoneH - 34.5 * GRID_H); + }; + class rightTabContentListnBox : RscListNBox { + idc = IDC_rightTabContentListnBox; + colorBackground[]={0,0,0,0}; + colorSelectBackground[]={1,1,1,0.5}; + colorSelectBackground2[]={1,1,1,0.5}; + colorPictureSelected[]={1,1,1,1}; + colorSelect[]={1,1,1,1}; + colorSelect2[]={1,1,1,1}; + colorPictureRightSelected[]={1,1,1,1}; + columns[]={0.07, 0.15, 0.75}; + idcLeft = IDC_arrowMinus; + idcRIght = IDC_arrowPlus; + drawSideArrows=1; + disableOverflow=1; + onLBSelChanged = QUOTE(_this call FUNC(onSelChangedRightListnBox)); + onSetFocus = QUOTE(GVAR(rightTabLnBFocus) = true); + onKillFocus = QUOTE(GVAR(rightTabLnBFocus) = false); + x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + y = QUOTE(safezoneY + 14 * GRID_H); + w = QUOTE(80 * GRID_W); + h = QUOTE(safezoneH - 34.5 * GRID_H); + sizeEx = QUOTE(7 * GRID_H); + }; + class sortLeftTab: RscCombo { + idc = IDC_sortLeftTab; + x = QUOTE(safezoneX + 13 * GRID_W); + y = QUOTE(safezoneY + 8 * GRID_H); + w = QUOTE(80 * GRID_W); + h = QUOTE(6 * GRID_H); + onLBSelChanged = QUOTE(_this call FUNC(sortPanel)); + sizeEx = QUOTE(5 * GRID_H); + class Items { + class Alphabet { + text="$STR_a3_rscdisplayarsenal_sort_alphabet"; + default=1; + value= 0; + }; + class Mod { + text="$STR_a3_rscdisplayarsenal_sort_mod"; + value= 1; + }; + }; + }; + class sortRightTab: sortLeftTab { + idc = IDC_sortRightTab; + x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + class Items { + class Alphabet { + text="$STR_a3_rscdisplayarsenal_sort_alphabet"; + default=1; + value= 0; + }; + class Weight { + text="$STR_a3_rscdisplayarsenal_sort_mod"; + value= 1; + }; + }; + }; + class leftSearchbar: ctrlEdit { + idc = IDC_leftSearchbar; + onSetFocus = QUOTE(GVAR(leftSearchbarFocus) = true); + onKillFocus = QUOTE(GVAR(leftSearchbarFocus) = false); + onMouseButtonClick = QUOTE([ARR_3(ctrlParent (_this select 0), _this select 0, _this select 1)] call FUNC(clearSearchbar)); + x = QUOTE(safezoneX + 13 * GRID_W); + y = QUOTE(safezoneY + 1.8 * GRID_H); + w = QUOTE(74 * GRID_W); + h = QUOTE(6 * GRID_H); + }; + class leftSearchbarButton: ctrlButtonPicture { + idc = IDC_leftSearchbarButton; + text = "\a3\Ui_f\data\GUI\RscCommon\RscButtonSearch\search_start_ca.paa"; + colorBackground[]={0,0,0,0.5}; + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), ctrlparent (_this select 0) displayCtrl IDC_leftSearchbar)] call FUNC(handleSearchbar)); + x = QUOTE(safezoneX + 87 * GRID_W); + y = QUOTE(safezoneY + 1.8 * GRID_H); + w = QUOTE(6 * GRID_W); + h = QUOTE(6 * GRID_H); + }; + class rightSearchbar: leftSearchBar { + idc = IDC_rightSearchbar; + onSetFocus = QUOTE(GVAR(rightSearchbarFocus) = true); + onKillFocus = QUOTE(GVAR(rightSearchbarFocus) = false); + x = QUOTE(safezoneX + safezoneW - 87 * GRID_W); + }; + class rightSearchbarButton: leftSearchbarButton { + idc = IDC_rightSearchbarButton; + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), ctrlparent (_this select 0) displayCtrl IDC_rightSearchbar)] call FUNC(handleSearchbar)); + x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + }; + class tabLeft: RscControlsGroupNoScrollbars { + idc = IDC_tabLeft; + x = QUOTE(safezoneX + 1 * GRID_W); + y = QUOTE(safezoneY + 8 * GRID_H); + w = QUOTE(12 * GRID_W); + h = QUOTE(200 * GRID_H); + class controls { + class iconBackgroundPrimaryWeapon: ctrlStaticBackground { + idc = IDC_iconBackgroundPrimaryWeapon; + fade=1; + enable=0; + colorBackground[]={0,0,0,1}; + x = QUOTE(0); + y = QUOTE(0 * GRID_H); + w = QUOTE(12 * GRID_W); + h = QUOTE(9 * GRID_H); + }; + class buttonPrimaryWeapon: RscButtonArsenal { + idc = IDC_buttonPrimaryWeapon; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\PrimaryWeapon_ca.paa"; + tooltip="$STR_A3_RscDisplayArsenal_tab_PrimaryWeapon"; + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(fillLeftPanel)); + colorBackground[]={0,0,0,0.5}; + x = QUOTE(0 * GRID_W); + y = QUOTE(0 * GRID_H); + w = QUOTE(9 * GRID_W); + h = QUOTE(9 * GRID_H); + }; + class iconBackgroundHandgun: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundHandgun; + y = QUOTE(10 * GRID_H); + }; + class buttonHandgun: buttonPrimaryWeapon { + idc = IDC_buttonHandgun; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Handgun_ca.paa"; + tooltip="$STR_A3_RscDisplayArsenal_tab_Handgun"; + y = QUOTE(10 * GRID_H); + }; + class iconBackgroundSecondaryWeapon: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundSecondaryWeapon; + y = QUOTE(20 * GRID_H); + }; + class buttonSecondaryWeapon: buttonPrimaryWeapon { + idc = IDC_buttonSecondaryWeapon; + tooltip="$STR_A3_RscDisplayArsenal_tab_SecondaryWeapon"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\SecondaryWeapon_ca.paa"; + y = QUOTE(20 * GRID_H); + }; + class iconBackgroundHeadgear: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundHeadgear; + y = QUOTE(30 * GRID_H); + }; + class buttonHeadgear: buttonPrimaryWeapon { + idc = IDC_buttonHeadgear; + tooltip="$STR_A3_RscDisplayArsenal_tab_Headgear"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Headgear_ca.paa"; + y = QUOTE(30 * GRID_H); + }; + class iconBackgroundUniform: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundUniform; + y = QUOTE(40 * GRID_H); + }; + class buttonUniform: buttonPrimaryWeapon { + idc = IDC_buttonUniform; + tooltip="$STR_A3_RscDisplayArsenal_tab_Uniform"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Uniform_ca.paa"; + y = QUOTE(40 * GRID_H); + }; + class iconBackgroundVest: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundVest; + y = QUOTE(50 * GRID_H); + }; + class buttonVest: buttonPrimaryWeapon { + idc = IDC_buttonVest; + tooltip="$STR_A3_RscDisplayArsenal_tab_Vest"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Vest_ca.paa"; + y = QUOTE(50 * GRID_H); + }; + class iconBackgroundBackpack: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundBackpack; + y = QUOTE(60 * GRID_H); + }; + class buttonBackpack: buttonPrimaryWeapon { + idc = IDC_buttonBackpack; + tooltip="$STR_A3_RscDisplayArsenal_tab_Backpack"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Backpack_ca.paa"; + y = QUOTE(60 * GRID_H); + }; + class iconBackgroundGoggles: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundGoggles; + y = QUOTE(70 * GRID_H); + }; + class buttonGoggles: buttonPrimaryWeapon { + idc = IDC_buttonGoggles; + tooltip="$STR_A3_RscDisplayArsenal_tab_Goggles"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Goggles_ca.paa"; + y = QUOTE(70 * GRID_H); + }; + class iconBackgroundNVG: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundNVG; + y = QUOTE(80 * GRID_H); + }; + class buttonNVG: buttonPrimaryWeapon { + idc = IDC_buttonNVG; + tooltip="$STR_A3_RscDisplayArsenal_tab_NVGs"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\NVGs_ca.paa"; + y = QUOTE(80 * GRID_H); + }; + class iconBackgroundBinoculars: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundBinoculars; + y = QUOTE(90 * GRID_H); + }; + class buttonBinoculars: buttonPrimaryWeapon { + idc = IDC_buttonBinoculars; + tooltip="$STR_A3_RscDisplayArsenal_tab_Binoculars"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Binoculars_ca.paa"; + y = QUOTE(90 * GRID_H); + }; + class iconBackgroundMap: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundMap; + y = QUOTE(100 * GRID_H); + }; + class buttonMap: buttonPrimaryWeapon { + idc = IDC_buttonMap; + tooltip="$STR_A3_RscDisplayArsenal_tab_Map"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Map_ca.paa"; + y = QUOTE(100 * GRID_H); + }; + class iconBackgroundGPS: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundGPS; + y = QUOTE(110 * GRID_H); + }; + class buttonGPS: buttonPrimaryWeapon { + idc = IDC_buttonGPS; + tooltip="$STR_A3_RscDisplayArsenal_tab_GPS"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\GPS_ca.paa"; + y = QUOTE(110 * GRID_H); + }; + class iconBackgroundRadio: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundRadio; + y = QUOTE(120 * GRID_H); + }; + class buttonRadio: buttonPrimaryWeapon { + idc = IDC_buttonRadio; + tooltip="$STR_A3_RscDisplayArsenal_tab_Radio"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Radio_ca.paa"; + y = QUOTE(120 * GRID_H); + }; + class iconBackgroundCompass: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundCompass; + y = QUOTE(130 * GRID_H); + }; + class buttonCompass: buttonPrimaryWeapon { + idc = IDC_buttonCompass; + tooltip="$STR_A3_RscDisplayArsenal_tab_Compass"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Compass_ca.paa"; + y = QUOTE(130 * GRID_H); + }; + class iconBackgroundWatch: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundWatch; + y = QUOTE(140 * GRID_H); + }; + class buttonWatch: buttonPrimaryWeapon { + idc = IDC_buttonWatch; + tooltip="$STR_A3_RscDisplayArsenal_tab_Watch"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Watch_ca.paa"; + y = QUOTE(140 * GRID_H); + }; + class iconBackgroundFace: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundFace; + y = QUOTE(150 * GRID_H); + }; + class buttonFace: buttonPrimaryWeapon { + idc = IDC_buttonFace; + tooltip="$STR_A3_RscDisplayArsenal_tab_Face"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Face_ca.paa"; + y = QUOTE(150 * GRID_H); + }; + class iconBackgroundVoice: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundVoice; + y = QUOTE(160 * GRID_H); + }; + class buttonVoice: buttonPrimaryWeapon { + idc = IDC_buttonVoice; + tooltip="$STR_A3_RscDisplayArsenal_tab_Voice"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Voice_ca.paa"; + y = QUOTE(160 * GRID_H); + }; + class iconBackgroundInsigna: IconBackgroundPrimaryWeapon { + idc = IDC_iconBackgroundInsigna; + y = QUOTE(170 * GRID_H); + }; + class buttonInsigna: buttonPrimaryWeapon { + idc = IDC_buttonInsigna; + tooltip="$STR_A3_RscDisplayArsenal_tab_Insignia"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Insignia_ca.paa"; + y = QUOTE(170 * GRID_H); + }; + }; + }; + class iconBackgroundOptic: ctrlStaticBackground { + idc = IDC_iconBackgroundOptic; + colorBackground[]={0,0,0,1}; + fade=1; + enable=0; + x = QUOTE(safezoneW + safezoneX - 13 * GRID_W); + y = QUOTE(safezoneY + 8 * GRID_H); + w = QUOTE(12 * GRID_W); + h = QUOTE(9 * GRID_H); + }; + class buttonOptic: RscButtonArsenal { + idc = IDC_buttonOptic; + tooltip="$STR_A3_RscDisplayArsenal_tab_ItemOptic"; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemOptic_ca.paa"; + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(fillRightPanel)); + colorBackground[]={0,0,0,0.5}; + x = QUOTE(safezoneW + safezoneX - 10 * GRID_W); + y = QUOTE(safezoneY + 8 * GRID_H); + w = QUOTE(9 * GRID_W); + h = QUOTE(9 * GRID_H); + }; + class iconBackgroundItemAcc: iconBackgroundOptic { + idc = IDC_iconBackgroundItemAcc; + y = QUOTE(safezoneY + 18 * GRID_H); + }; + class buttonItemAcc: buttonOptic { + idc = IDC_buttonItemAcc; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemAcc_ca.paa"; + tooltip="$STR_A3_RscDisplayArsenal_tab_ItemAcc"; + y = QUOTE(safezoneY + 18 * GRID_H); + }; + class iconBackgroundMuzzle: iconBackgroundOptic { + idc = IDC_iconBackgroundMuzzle; + y = QUOTE(safezoneY + 28 * GRID_H); + }; + class buttonMuzzle: buttonOptic { + idc = IDC_buttonMuzzle; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemMuzzle_ca.paa"; + tooltip="$STR_A3_RscDisplayArsenal_tab_ItemMuzzle"; + y = QUOTE(safezoneY + 28 * GRID_H); + }; + class iconBackgroundBipod: iconBackgroundOptic { + idc = IDC_iconBackgroundBipod; + y = QUOTE(safezoneY + 38 * GRID_H); + }; + class buttonBipod: buttonOptic { + idc = IDC_buttonBipod; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemBipod_ca.paa"; + tooltip="$STR_A3_RscDisplayArsenal_tab_ItemBipod"; + y = QUOTE(safezoneY + 38 * GRID_H); + }; + class iconBackgroundCurrentMag: iconBackgroundOptic { + idc = IDC_iconBackgroundCurrentMag; + y = QUOTE(safezoneY + 48 * GRID_H); + }; + class buttonCurrentMag: buttonOptic { + idc = IDC_buttonCurrentMag; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMag_ca.paa"; + tooltip= CSTRING(buttonCurrentMagTooltip); + y = QUOTE(safezoneY + 48 * GRID_H); + }; + class iconBackgroundCurrentMag2: iconBackgroundOptic { + idc = IDC_iconBackgroundCurrentMag2; + y = QUOTE(safezoneY + 58 * GRID_H); + }; + class buttonCurrentMag2: buttonOptic { + idc = IDC_buttonCurrentMag2; + text= QPATHTOF(data\iconSecondaryMuzzle); + tooltip= CSTRING(buttonCurrentMag2Tooltip); + y = QUOTE(safezoneY + 58 * GRID_H); + }; + class iconBackgroundMag: iconBackgroundOptic { + idc = IDC_iconBackgroundMag; + y = QUOTE(safezoneY + 48 * GRID_H); + }; + class buttonMag: buttonOptic { + idc = IDC_buttonMag; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMag_ca.paa"; + tooltip="$STR_A3_RscDisplayArsenal_tab_CargoMag"; + y = QUOTE(safezoneY + 48 * GRID_H); + }; + class iconBackgroundMagALL: iconBackgroundOptic { + idc = IDC_iconBackgroundMagALL; + y = QUOTE(safezoneY + 58 * GRID_H); + }; + class buttonMagALL: buttonOptic { + idc = IDC_buttonMagALL; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMagAll_ca.paa"; + tooltip="$STR_A3_RscDisplayArsenal_tab_CargoMagAll"; + y = QUOTE(safezoneY + 58 * GRID_H); + }; + class iconBackgroundThrow: iconBackgroundOptic { + idc = IDC_iconBackgroundThrow; + y = QUOTE(safezoneY + 68 * GRID_H); + }; + class buttonThrow: buttonOptic { + idc = IDC_buttonThrow; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoThrow_ca.paa"; + tooltip="$STR_A3_RscDisplayArsenal_tab_CargoThrow"; + y = QUOTE(safezoneY + 68 * GRID_H); + }; + class iconBackgroundPut: iconBackgroundOptic { + idc = IDC_iconBackgroundPut; + y = QUOTE(safezoneY + 78 * GRID_H); + }; + class buttonPut: buttonOptic { + idc = IDC_buttonPut; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoPut_ca.paa"; + tooltip="$STR_A3_RscDisplayArsenal_tab_CargoPut"; + y = QUOTE(safezoneY + 78 * GRID_H); + }; + class iconBackgroundMisc: iconBackgroundOptic { + idc = IDC_iconBackgroundMisc; + y = QUOTE(safezoneY + 88 * GRID_H); + }; + class buttonMisc: buttonOptic { + idc = IDC_buttonMisc; + text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMisc_ca.paa"; + tooltip="$STR_A3_RscDisplayArsenal_tab_CargoMisc"; + y = QUOTE(safezoneY + 88 * GRID_H); + }; + class buttonRemoveAll: ctrlButtonPicture { + idc = IDC_buttonRemoveAll; + text = QPATHTOF(data\iconClearContainer.paa); + colorBackground[]={0,0,0,0.5}; + onButtonClick = QUOTE(ctrlParent (_this select 0) call FUNC(buttonClearAll)); + fade=1; + enable=0; + x = QUOTE(safezoneW + safezoneX - 11 * GRID_W); + y = QUOTE(safeZoneH + safezoneY - 29 * GRID_H); + w = QUOTE(9 * GRID_W); + h = QUOTE(9 * GRID_H); + }; + }; +}; + +class GVAR(loadoutsDisplay) { + idd = IDD_loadouts_display; + onLoad = QUOTE([ARR_3('onLoad', _this, QQGVAR(loadoutsDisplay))] call FUNC(onLoadoutsOpen)); + onUnload = QUOTE([ARR_3('onUnload', _this, QQGVAR(loadoutsDisplay))] call FUNC(onLoadoutsClose)); + class controls { + class centerBox: ctrlControlsGroupNoScrollbars { + idc = IDC_centerBox; + x = QUOTE(safezoneW + safezoneX - (180 * GRID_W)); + y = QUOTE(safezoneY + (5 * GRID_H)); + w = QUOTE(160 * GRID_W); + h = QUOTE(safezoneH - (34 * GRID_H)); + class controls { + class centerFrame: RscFrame { + idc = -1; + x = QUOTE(0 * GRID_W); + y = QUOTE(0 * GRID_H); + w = QUOTE(160 * GRID_W); + h = QUOTE(safezoneH - (45 * GRID_H)); + colorText[] = {0,0,0,1}; + }; + class centerBackground: ctrlStaticBackground { + idc = -1; + x = QUOTE(0); + y = QUOTE(0); + w = QUOTE(160 * GRID_W); + h = QUOTE(safezoneH - (45 * GRID_H)); + colorBackground[] = {0.13,0.13,0.13,0.9}; + }; + class centerTitle: ctrlStaticTitle { + idc = IDC_centerTitle; + style = ST_CENTER; + text = ""; + x = QUOTE(0); + y = QUOTE(0); + w = QUOTE(160 * GRID_W); + h = QUOTE(5 * GRID_H); + sizeEx = QUOTE(5 * GRID_H); + }; + class contentPanel: RscListnBox { + idc = IDC_contentPanel; + columns[]={0, 0.05, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90}; + drawSideArrows=0; + disableOverflow=1; + onSetFocus = QUOTE(GVAR(loadoutsPanelFocus) = true); + onKillFocus = QUOTE(GVAR(loadoutsPanelFocus) = false); + onLBSelChanged = QUOTE([ARR_3(ctrlParent (_this select 0), _this select 0, _this select 1)] call FUNC(onSelChangedLoadouts)); + onLBDblClick = QUOTE([ARR_2(ctrlparent (_this select 0), (ctrlParent (_this select 0)) displayCtrl IDC_buttonLoad)] call FUNC(buttonLoadoutsLoad)); + x = QUOTE(0); + y = QUOTE(5 * GRID_H); + w = QUOTE(160 * GRID_W); + h = QUOTE(safezoneH - (57 * GRID_H)); + sizeEx = QUOTE(7 * GRID_H); + }; + class textTitle: RscText { + idc= -1; + text="$STR_DISP_GAME_NAME"; + x = QUOTE(0 * GRID_W); + y = QUOTE(safezoneH - (51 * GRID_H)); + w = QUOTE(15 * GRID_W); + h = QUOTE(5 * GRID_H); + sizeEx = QUOTE(5 * GRID_H); + colorBackground[]={0,0,0,0.2}; + }; + class textEditBox: ctrlEdit { + idc= IDC_textEditBox; + x = QUOTE(15 * GRID_W); + y = QUOTE(safezoneH - (51 * GRID_H)); + w = QUOTE(65 * GRID_W); + h = QUOTE(5 * GRID_H); + }; + class loadoutsSearchbar: ctrlEdit { + idc = IDC_loadoutsSearchbar; + onSetFocus = QUOTE(GVAR(loadoutsSearchbarFocus) = true); + onKillFocus = QUOTE(GVAR(loadoutsSearchbarFocus) = false); + onMouseButtonClick = QUOTE([ARR_3(ctrlParent (_this select 0), _this select 0, _this select 1)] call FUNC(clearSearchbar)); + x = QUOTE(83 * GRID_W); + y = QUOTE(safezoneH - (51 * GRID_H)); + w = QUOTE(72 * GRID_W); + h = QUOTE(5 * GRID_H); + }; + class loadoutsSearchbarButton: ctrlButtonPicture { + idc = -1; + text = "\a3\Ui_f\data\GUI\RscCommon\RscButtonSearch\search_start_ca.paa"; + colorBackground[]={0,0,0,0.5}; + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), ctrlparent (_this select 0) displayCtrl IDC_loadoutsSearchbar)] call FUNC(handleLoadoutsSearchbar)); + x = QUOTE(155 * GRID_W); + y = QUOTE(safezoneH - (51 * GRID_H)); + w = QUOTE(5 * GRID_W); + h = QUOTE(5 * GRID_H); + }; + class buttonSave: ctrlButton { + idc = IDC_buttonSave; + x = QUOTE(0 * GRID_W); + y = QUOTE(safezoneH - (44 * GRID_H)); + w = QUOTE(30 * GRID_W); + h = QUOTE(10 * GRID_H); + text= CSTRING(buttonSaveText); + tooltip= CSTRING(buttonSaveTooltip); + sizeEx = QUOTE(5 * GRID_H); + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(buttonLoadoutsSave)); + colorBackground[] = {0,0,0,0.8}; + }; + class buttonRename: buttonSave { + idc = IDC_buttonRename; + x = QUOTE(32.5 * GRID_W); + text= CSTRING(buttonRenameText); + tooltip= CSTRING(buttonRenameTooltip); + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(buttonLoadoutsRename)); + }; + class buttonLoad: buttonSave { + idc = IDC_buttonLoad; + x = QUOTE(65 * GRID_W); + text= CSTRING(buttonLoadText); + tooltip= CSTRING(buttonLoadTooltip); + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(buttonLoadoutsLoad)); + }; + class buttonShare: buttonSave { + idc = IDC_buttonShare; + x = QUOTE(97.5 * GRID_W); + text= CSTRING(buttonSharePrivateText); + tooltip= CSTRING(buttonShareTooltip); + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(buttonLoadoutsShare)); + }; + class buttonDelete: buttonSave { + idc = IDC_buttonDelete; + x = QUOTE(130 * GRID_W); + text= CSTRING(buttonDeleteText); + tooltip= CSTRING(buttonDeleteTooltip); + colorBackgroundActive[] = {0.5,0,0,1}; + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(buttonLoadoutsDelete)); + }; + }; + }; + + class buttonClose: ctrlButton { + idc = -1; + x = QUOTE(safezoneW + safezoneX - 32 * GRID_W); + y = QUOTE(safezoneH + safezoneY - 9 * GRID_H); + w = QUOTE(30 * GRID_W); + h = QUOTE(7 * GRID_H); + sizeEx = QUOTE(5 * GRID_H); + text= CSTRING(buttonCloseText); + shortcuts[]= {"0x01"}; + tooltip= ""; + onButtonClick = QUOTE(ctrlparent (_this select 0) closeDisplay 2); + }; + class buttonBar: ctrlControlsGroupNoScrollbars { + idc = -1; + x = QUOTE((safezoneW * 0.5) + safezoneX - (80.5 * GRID_W)); + y = QUOTE(safezoneH + safezoneY - 9 * GRID_H); + w = QUOTE(161 * GRID_W); + h = QUOTE(7 * GRID_H); + class controls { + class buttonMyLoadoutsBackground: ctrlStaticBackground { + idc = IDC_buttonMyLoadoutsBackground; + x = QUOTE(0); + y = QUOTE(0); + w = QUOTE(52 * GRID_W); + h = QUOTE(7 * GRID_H); + colorBackground[] = {0,0,0,0.7}; + }; + class buttonMyLoadouts: ctrlButton { + idc = IDC_buttonMyLoadouts; + colorBackground[] = {0,0,0,0}; + x = QUOTE(0 * GRID_W); + y = QUOTE(0 * GRID_H); + w = QUOTE(52 * GRID_W); + h = QUOTE(7 * GRID_H); + sizeEx = QUOTE(5 * GRID_H); + text= CSTRING(tabMyLoadoutsText); + tooltip= CSTRING(tabMyLoadoutsTooltip); + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(loadoutsChangeTab)); + }; + class buttonDefaultLoadoutsBackground: buttonMyLoadoutsBackground { + idc = IDC_buttonDefaultLoadoutsBackground; + x = QUOTE(54.5 * GRID_W); + }; + class buttonDefaultLoadouts: buttonMyLoadouts { + idc = IDC_buttonDefaultLoadouts; + x = QUOTE(54.5 * GRID_W); + text= CSTRING(tabDefaultLoadoutsText); + tooltip= CSTRING(tabDefaultLoadoutsTooltip); + }; + class buttonSharedLoadoutsBackground: buttonMyLoadoutsBackground { + idc = IDC_buttonSharedLoadoutsBackground; + x = QUOTE(109 * GRID_W); + }; + class buttonSharedLoadouts: buttonMyLoadouts { + idc = IDC_buttonSharedLoadouts; + x = QUOTE(109 * GRID_W); + text= CSTRING(tabSharedLoadoutsText); + tooltip= CSTRING(tabSharedLoadoutsTooltip); + }; + }; + }; + }; +}; diff --git a/addons/arsenal/ui/RscCommon.hpp b/addons/arsenal/ui/RscCommon.hpp new file mode 100644 index 0000000000..5db52bf704 --- /dev/null +++ b/addons/arsenal/ui/RscCommon.hpp @@ -0,0 +1,292 @@ +// Control types +#define CT_STATIC 0 +#define CT_BUTTON 1 +#define CT_EDIT 2 +#define CT_SLIDER 3 +#define CT_COMBO 4 +#define CT_LISTBOX 5 +#define CT_TOOLBOX 6 +#define CT_CHECKBOXES 7 +#define CT_PROGRESS 8 +#define CT_HTML 9 +#define CT_STATIC_SKEW 10 +#define CT_ACTIVETEXT 11 +#define CT_TREE 12 +#define CT_STRUCTURED_TEXT 13 +#define CT_CONTEXT_MENU 14 +#define CT_CONTROLS_GROUP 15 +#define CT_SHORTCUTBUTTON 16 +#define CT_HITZONES 17 +#define CT_XKEYDESC 40 +#define CT_XBUTTON 41 +#define CT_XLISTBOX 42 +#define CT_XSLIDER 43 +#define CT_XCOMBO 44 +#define CT_ANIMATED_TEXTURE 45 +#define CT_OBJECT 80 +#define CT_OBJECT_ZOOM 81 +#define CT_OBJECT_CONTAINER 82 +#define CT_OBJECT_CONT_ANIM 83 +#define CT_LINEBREAK 98 +#define CT_USER 99 +#define CT_MAP 100 +#define CT_MAP_MAIN 101 +#define CT_LISTNBOX 102 +#define CT_ITEMSLOT 103 +#define CT_CHECKBOX 77 + +// Static styles +#define ST_POS 0x0F +#define ST_HPOS 0x03 +#define ST_VPOS 0x0C +#define ST_LEFT 0x00 +#define ST_RIGHT 0x01 +#define ST_CENTER 0x02 +#define ST_DOWN 0x04 +#define ST_UP 0x08 +#define ST_VCENTER 0x0C + +#define ST_TYPE 0xF0 +#define ST_SINGLE 0x00 +#define ST_MULTI 0x10 +#define ST_TITLE_BAR 0x20 +#define ST_PICTURE 0x30 +#define ST_FRAME 0x40 +#define ST_BACKGROUND 0x50 +#define ST_GROUP_BOX 0x60 +#define ST_GROUP_BOX2 0x70 +#define ST_HUD_BACKGROUND 0x80 +#define ST_TILE_PICTURE 0x90 +#define ST_WITH_RECT 0xA0 +#define ST_LINE 0xB0 +#define ST_UPPERCASE 0xC0 +#define ST_LOWERCASE 0xD0 + +#define ST_SHADOW 0x100 +#define ST_NO_RECT 0x200 +#define ST_KEEP_ASPECT_RATIO 0x800 + +// Slider styles +#define SL_DIR 0x400 +#define SL_VERT 0 +#define SL_HORZ 0x400 + +#define SL_TEXTURES 0x10 + +// progress bar +#define ST_VERTICAL 0x01 +#define ST_HORIZONTAL 0 + +// Listbox styles +#define LB_TEXTURES 0x10 +#define LB_MULTI 0x20 + +// Tree styles +#define TR_SHOWROOT 1 +#define TR_AUTOCOLLAPSE 2 + +// Default grid +#define GUI_GRID_WAbs ((safezoneW / safezoneH) min 1.2) +#define GUI_GRID_HAbs (GUI_GRID_WAbs / 1.2) +#define GUI_GRID_W (GUI_GRID_WAbs / 40) +#define GUI_GRID_H (GUI_GRID_HAbs / 25) +#define GUI_GRID_X (safezoneX) +#define GUI_GRID_Y (safezoneY + safezoneH - GUI_GRID_HAbs) + +// Default text sizes +#define GUI_TEXT_SIZE_SMALL (GUI_GRID_H * 0.8) +#define GUI_TEXT_SIZE_MEDIUM (GUI_GRID_H * 1) +#define GUI_TEXT_SIZE_LARGE (GUI_GRID_H * 1.2) + +class ScrollBar; +class RscObject; +class RscText; +class RscTextSmall; +class RscTitle; +class RscProgress; +class RscProgressNotFreeze; +class RscPicture; +class RscLadderPicture; +class RscPictureKeepAspect; +class RscHTML; +class RscButton; +class RscShortcutButton; +class RscButtonSmall; +class RscEdit; +class RscCombo; +class RscListBox; +class RscListNBox; +class RscXListBox; +class RscTree; +class RscSlider; +class RscSliderH; +class RscXSliderH; +class RscActiveText; +class RscStructuredText; +class RscControlsGroup; +class RscToolbox; +class RscMapControl; +class RscCheckBox; +class RscFrame; +class ctrlDefault; +class ctrlControlsGroup; +class ctrlDefaultText; +class ctrlDefaultButton; +class RscBackgroundStripeTop; +class RscBackgroundStripeBottom; +class RscIGText; +class RscIGProgress; +class RscListBoxKeys; +class RscControlsGroupNoScrollbars; +class RscControlsGroupNoHScrollbars; +class RscControlsGroupNoVScrollbars; +class RscLine; +class RscActivePicture; +class RscButtonTextOnly; +class RscShortcutButtonMain; +class RscButtonEditor; +class RscIGUIShortcutButton; +class RscGearShortcutButton; +class RscButtonMenu; +class RscButtonMenuOK; +class RscButtonMenuCancel; +class RscButtonMenuSteam; +class RscLoadingText; +class RscIGUIListBox; +class RscIGUIListNBox; +class RscBackground; +class RscBackgroundGUI; +class RscBackgroundGUILeft; +class RscBackgroundGUIRight; +class RscBackgroundGUIBottom; +class RscBackgroundGUITop; +class RscBackgroundGUIDark; +class RscBackgroundLogo; +class RscMapControlEmpty; +class RscVignette; +class CA_Mainback; +class CA_Back; +class CA_Title_Back; +class CA_Black_Back; +class CA_Title; +class CA_Logo; +class CA_Logo_Small; +class CA_RscButton; +class CA_RscButton_dialog; +class CA_Ok; +class CA_Ok_image; +class CA_Ok_image2; +class CA_Ok_text; +class ctrlCheckbox; +class ctrlCheckboxBaseline; +class ctrlStatic; +class ctrlControlsGroupNoScrollbars; +class ctrlStructuredText; +class RscTextMulti; +class RscTreeSearch; +class RscVideo; +class RscVideoKeepAspect; +class RscActivePictureKeepAspect; +class RscEditMulti; +class RscMapSignalBackground; +class RscMapSignalPicture; +class RscMapSignalText; +class RscColorPicker; +class RscInterlacingScreen; +class RscFeedback; +class RscTrafficLight; +class RscButtonSearch; +class RscIGUIText; +class RscOpticsText; +class RscOpticsValue; +class RscIGUIValue; +class RscButtonMenuMain; +class RscButtonTestCentered; +class RscDisplaySingleMission_ChallengeOverviewGroup; +class RscDisplayDebriefing_RscTextMultiline; +class RscDisplayDebriefing_ListGroup; +class RscButtonArsenal; +class RscTextNoShadow; +class RscButtonNoColor; +class RscToolboxButton; +class ctrlStaticPicture; +class ctrlStaticPictureKeepAspect; +class ctrlStaticPictureTile; +class ctrlStaticFrame; +class ctrlStaticLine; +class ctrlStaticMulti; +class ctrlStaticBackground; +class ctrlStaticOverlay; +class ctrlStaticTitle; +class ctrlStaticFooter; +class ctrlStaticBackgroundDisable; +class ctrlStaticBackgroundDisableTiles; +class ctrlButton; +class ctrlButtonPicture; +class ctrlButtonPictureKeepAspect; +class ctrlButtonOK; +class ctrlButtonCancel; +class ctrlButtonClose; +class ctrlButtonToolbar; +class ctrlButtonSearch; +class ctrlButtonExpandAll; +class ctrlButtonCollapseAll; +class ctrlButtonFilter; +class ctrlEdit; +class ctrlEditMulti; +class ctrlSliderV; +class ctrlSliderH; +class ctrlCombo; +class ctrlComboToolbar; +class ctrlListbox; +class ctrlToolbox; +class ctrlToolboxPicture; +class ctrlToolboxPictureKeepAspect; +class ctrlCheckboxes; +class ctrlCheckboxesCheckbox; +class ctrlProgress; +class ctrlHTML; +class ctrlActiveText; +class ctrlActivePicture; +class ctrlActivePictureKeepAspect; +class ctrlTree; +class ctrlControlsGroupNoHScrollbars; +class ctrlControlsGroupNoVScrollbars; +class ctrlShortcutButton; +class ctrlShortcutButtonOK; +class ctrlShortcutButtonCancel; +class ctrlShortcutButtonSteam; +class ctrlXListbox; +class ctrlXSliderV; +class ctrlXSliderH; +class ctrlMenu; +class ctrlMenuStrip; +class ctrlMap; +class ctrlMapEmpty; +class ctrlMapMain; +class ctrlListNBox; +class ctrlCheckboxToolbar; + +class Display3DEN { + class ContextMenu :ctrlMenu { + class Items { + class Arsenal { + action= QUOTE(call FUNC(open3DEN)); + }; + }; + }; + class Controls { + class MenuStrip: ctrlMenuStrip { + class Items { + class Tools { + items[] += {"ACE_arsenal_portVALoadouts"}; + }; + class ACE_arsenal_portVALoadouts { + text = CSTRING(portLoadoutsText); + picture = "\z\ace\logo_ace3_ca.paa"; + action = "call ace_arsenal_fnc_portVALoadouts;"; + }; + }; + }; + }; +}; diff --git a/addons/arsenal/ui/script_component.hpp b/addons/arsenal/ui/script_component.hpp new file mode 100644 index 0000000000..523addf768 --- /dev/null +++ b/addons/arsenal/ui/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\arsenal\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 ba03785427..834c4eb8af 100644 --- a/addons/atragmx/RscTitles.hpp +++ b/addons/atragmx/RscTitles.hpp @@ -52,7 +52,6 @@ class ATragMX_RscButton { shadow=0; }; class ATragMX_RscEdit { - access=0; type=2; style=ST_RIGHT; x=0; diff --git a/addons/atragmx/XEH_PREP.hpp b/addons/atragmx/XEH_PREP.hpp index c77b7e0655..b61258c008 100644 --- a/addons/atragmx/XEH_PREP.hpp +++ b/addons/atragmx/XEH_PREP.hpp @@ -27,6 +27,7 @@ PREP(init); PREP(initGunList); PREP(insert_c1_ballistic_coefficient_data); PREP(insert_muzzle_velocity_data); +PREP(lookup_c1_ballistic_coefficient); PREP(parse_input); PREP(read_gun_list_entries_from_config); PREP(recalculate_c1_ballistic_coefficient); diff --git a/addons/atragmx/functions/fnc_add_new_gun.sqf b/addons/atragmx/functions/fnc_add_new_gun.sqf index 3be23920bc..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 diff --git a/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf b/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf index 9641804fbe..cbb78df8e7 100644 --- a/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf +++ b/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf @@ -3,10 +3,10 @@ * Calculates distance at which the bullet velocity drops below the threshold velocity * * Arguments: - * theshold velocity + * theshold velocity * * Return Value: - * distance * * Example: * 403 call ace_atragmx_fnc_calculate_distance_at_velocity @@ -29,7 +29,8 @@ private _distance = 0; while {_velocity > _thresholdVelocity} do { private _bc = GVAR(targetSolutionInput) select 14; private _dragModel = GVAR(targetSolutionInput) select 15; - private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _velocity])); + 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); }; diff --git a/addons/atragmx/functions/fnc_calculate_range_card.sqf b/addons/atragmx/functions/fnc_calculate_range_card.sqf index b72c38e756..9201861351 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 @@ -27,4 +27,9 @@ _solutionInput set [ 8, round(_solutionInput select 4)]; _solutionInput set [13, _targetRange]; _solutionInput set [17, true]; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + private _c1 = [_targetRange] call FUNC(lookup_c1_ballistic_coefficient); + _solutionInput set [14, _c1]; +}; + 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 836d785242..a7928d1ef0 100644 --- a/addons/atragmx/functions/fnc_calculate_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_solution.sqf @@ -51,37 +51,34 @@ params [ ]; _windSpeed params ["_windSpeed1", "_windSpeed2"]; -private ["_tx", "_tz", "_lastBulletPos", "_bulletPos", "_bulletVelocity", "_bulletAccel", "_bulletSpeed", "_gravity", "_deltaT"]; -_tx = 0; -_tz = 0; -_lastBulletPos = [0, 0, 0]; -_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) * -GRAVITY, cos(_scopeBaseAngle + _inclinationAngle) * -GRAVITY]; +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", "_trueRange", "_rangeFactor"]; -_n = 0; -_range = 0; -_trueRange = 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; @@ -89,18 +86,16 @@ 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 = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel])); }; -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); + _eoetvoesMultiplier = 2 * (0.0000729 * _muzzleVelocity / -GRAVITY) * cos(_latitude) * sin(_directionOfFire); }; _bulletPos set [0, 0]; @@ -118,7 +113,7 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _trueSpeed = vectorMagnitude _trueVelocity; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed])); + 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); @@ -144,7 +139,7 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _windage1 = - atan(_tx / _trueRange); _windDrift = (_wind2 select 0) * (_TOF - _trueRange / _muzzleVelocity); _windage2 = - atan(_windDrift / _trueRange); - _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _trueRange); + _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _trueRange); }; _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); _kineticEnergy = _kineticEnergy * 0.737562149; @@ -179,7 +174,7 @@ if (_targetRange != 0) then { _windage1 = - atan(_tx / _targetRange); _windDrift = (_wind2 select 0) * (_TOF - _targetRange / _muzzleVelocity); _windage2 = - atan(_windDrift / _targetRange); - _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _targetRange); + _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _targetRange); }; _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); diff --git a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf index be21a09927..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 @@ -74,7 +74,7 @@ switch (_this) do { if (_estRange > 0) then { _imageSize = atan(_targetSize / _estRange); }; - + switch (GVAR(rangeAssistImageSizeUnit)) do { case 0: { _imageSize = _imageSize * 6400 / 360; @@ -93,7 +93,7 @@ switch (_this) do { 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 2cc3973c47..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,34 +39,31 @@ 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 = 50 * _bulletMass / ((_bulletDiameter/2)^2); -_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); 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]; 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 index 38d19456da..fa43ac73c2 100644 --- a/addons/atragmx/functions/fnc_calculate_truing_drop.sqf +++ b/addons/atragmx/functions/fnc_calculate_truing_drop.sqf @@ -6,7 +6,7 @@ * parse input * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_calculate_truing_drop @@ -33,7 +33,7 @@ if (_parseInput) then { _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); @@ -46,8 +46,8 @@ if (_parseInput) then { }; switch (_dropUnit) do { case 0: { - _transonicDrop = _transonicDrop * 3.38; - _subsonicDrop = _subsonicDrop * 3.38; + _transonicDrop = MRAD_TO_MOA(_transonicDrop); + _subsonicDrop = MRAD_TO_MOA(_subsonicDrop); }; case 2: { _transonicDrop = _transonicDrop / 1.047; @@ -56,7 +56,7 @@ if (_parseInput) then { }; _transonicDrop = Round(_transonicDrop * 100) / 100; _subsonicDrop = Round(_subsonicDrop * 100) / 100; - + _subsonicDrop = _transonicDrop max _subsonicDrop; }; @@ -65,7 +65,7 @@ if ((GVAR(truingDropDropData) select 0) == 0 || {!([_transonicRange, _subsonicRa call FUNC(calculate_target_solution); }; private _solutionInput = +GVAR(targetSolutionInput); - + if (_transonicRange == 0) then { _transonicRange = Round(403 call FUNC(calculate_distance_at_velocity)); }; 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 b6e5e24658..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 diff --git a/addons/atragmx/functions/fnc_change_target_slot.sqf b/addons/atragmx/functions/fnc_change_target_slot.sqf index 7c660ff7de..6fd3889309 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 @@ -15,10 +15,9 @@ */ #include "script_component.hpp" -private _target = 0 max _this min 3; +GVAR(currentTarget) = 0 max _this min 3; -[] call FUNC(parse_input); +GVAR(targetRangeDirtyFlag) = true; -GVAR(currentTarget) = _target; call FUNC(update_target_selection); 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 index c6f2d47134..a795b74c70 100644 --- a/addons/atragmx/functions/fnc_clear_c1_ballistic_coefficient_data.sqf +++ b/addons/atragmx/functions/fnc_clear_c1_ballistic_coefficient_data.sqf @@ -3,10 +3,10 @@ * Clears the c1 ballistic coefficient data fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_clear_c1_ballistic_coefficient_data diff --git a/addons/atragmx/functions/fnc_clear_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_clear_muzzle_velocity_data.sqf index d76fa5864b..6f4472c550 100644 --- a/addons/atragmx/functions/fnc_clear_muzzle_velocity_data.sqf +++ b/addons/atragmx/functions/fnc_clear_muzzle_velocity_data.sqf @@ -3,10 +3,10 @@ * Clears the muzzle velocity data fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_clear_muzzle_velocity_data diff --git a/addons/atragmx/functions/fnc_clear_user_data.sqf b/addons/atragmx/functions/fnc_clear_user_data.sqf index faa9af07f7..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 @@ -43,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 6bf57e620a..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 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 f1cc9c2219..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 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 c94739035e..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 diff --git a/addons/atragmx/functions/fnc_evaluate_option_menu_input.sqf b/addons/atragmx/functions/fnc_evaluate_option_menu_input.sqf index f74f8678a4..2e4c9ef023 100644 --- a/addons/atragmx/functions/fnc_evaluate_option_menu_input.sqf +++ b/addons/atragmx/functions/fnc_evaluate_option_menu_input.sqf @@ -6,7 +6,7 @@ * option menu id * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_evaluate_option_menu_input diff --git a/addons/atragmx/functions/fnc_init.sqf b/addons/atragmx/functions/fnc_init.sqf index deff9d34cb..28b5202670 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 @@ -51,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]; @@ -84,6 +84,8 @@ GVAR(truingDropMuzzleVelocity) = 0; GVAR(targetSolutionInput) = nil; +GVAR(targetRangeDirtyFlag) = false; + GVAR(showMainPage) = true; GVAR(showAddNewGun) = false; GVAR(showAtmoEnvData) = false; diff --git a/addons/atragmx/functions/fnc_initGunList.sqf b/addons/atragmx/functions/fnc_initGunList.sqf index 21592278bd..2e2bbd15bd 100644 --- a/addons/atragmx/functions/fnc_initGunList.sqf +++ b/addons/atragmx/functions/fnc_initGunList.sqf @@ -3,10 +3,10 @@ * Inits the gun list from user profile * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_initGunList @@ -32,51 +32,51 @@ if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == 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.0666557, -0.00063800, 3.81, 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], + 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.0615965, -0.00036645, 3.81, 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.0588284, -0.00057503, 3.81, 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.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.3406920, -0.00019268, 3.81, 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], + ["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.1262000, -0.00202645, 3.81, 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], + [".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.0482146, -0.00063655, 3.81, 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.0611842, -0.00044958, 3.81, 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], + [".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.605], [1110, 0.569], [1500, 0.560], [1790, 0.551], [1990, 0.547], [2140, 0.545], [2300, 0.544]], 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.872], [1440, 0.862], [1630, 0.859], [1870, 0.852], [2090, 0.843], [2230, 0.838], [2420, 0.833]], true], - ["9.3×64mm" , 862, 100, 0.0627652, -0.00108571, 3.81, 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], + ["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.0604821, -0.00059133, 3.81, 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.0685883, -0.00052190, 3.81, 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.0602535, -0.00069611, 3.81, 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], + [".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.656], [1300, 0.64], [1460, 0.636], [1770, 0.625], [1920, 0.621], [2030, 0.619], [2190, 0.618]], 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.734], [1300, 0.726], [1500, 0.720], [1770, 0.708], [1880, 0.705], [2000, 0.702], [2110, 0.700]], 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.590], [1180, 0.576], [1320, 0.572], [1570, 0.563], [1690, 0.560], [1860, 0.557], [2050, 0.555]], true], - [".300WM Mk248 Mod0" , 857, 100, 0.0621425, -0.00070530, 3.81, 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.0637038, -0.00061188, 3.81, 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.0686968, -0.00053733, 3.81, 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], + [".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.546], [1210, 0.529], [1470, 0.520], [1570, 0.518], [1730, 0.515], [1880, 0.513], [1970, 0.513]], 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.623], [1150, 0.614], [1330, 0.609], [1620, 0.598], [1770, 0.595], [1970, 0.592], [2030, 0.591]], 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.721], [1400, 0.708], [1570, 0.703], [1860, 0.692], [1990, 0.689], [2140, 0.686], [2220, 0.685]], true], - ["7.62x54mmR" , 812, 100, 0.0678441, -0.00100023, 3.81, 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.62x54mmR" , 828, 100, 0.0853677, -0.00103739, 7.11, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO", [[-15,809],[0,816],[10,823],[15,828],[25,842],[30,851],[35,862]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], - ["7.62x51mm M80" , 802, 100, 0.0690229, -0.00100957, 3.81, 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.0739989, -0.00082828, 3.81, 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.0709422, -0.00082029, 3.81, 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.0593025, -0.00102338, 3.81, 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.0585007, -0.00107148, 3.81, 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.3168140, -0.00049899, 3.81, 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.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.399], [810, 0.392], [1030, 0.383], [1120, 0.381], [1270, 0.380], [1410, 0.379], [1530, 0.379]], 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.483], [790, 0.479], [920, 0.475], [1130, 0.465], [1230, 0.462], [1420, 0.460], [1630, 0.459]], 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.484], [830, 0.479], [950, 0.475], [1130, 0.467], [1260, 0.463], [1430, 0.461], [1660, 0.459]], 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.303], [250, 0.409], [320, 0.427], [420, 0.445], [550, 0.460], [650, 0.467], [730, 0.470]], true], - ["7.62x39mm" , 708, 100, 0.0846559, -0.00151621, 3.81, 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], + ["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.0725986, -0.00075308, 3.81, 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.0722256, -0.00067037, 3.81, 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.0655022, -0.00060887, 3.81, 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], + ["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.525], [910, 0.520], [1050, 0.515], [1270, 0.506], [1390, 0.503], [1570, 0.500], [1770, 0.498]], 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.578], [970, 0.574], [1140, 0.569], [1430, 0.557], [1610, 0.553], [1750, 0.551], [1860, 0.550]], 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.635], [1150, 0.627], [1350, 0.621], [1630, 0.611], [1760, 0.607], [1860, 0.606], [2020, 0.604]], true], - ["5.8x42mm DBP87" , 942, 100, 0.0566639, -0.00117956, 3.81, 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.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.323], [760, 0.309], [970, 0.303], [1030, 0.302], [1130, 0.301], [1210, 0.300], [1510, 0.299]], true], - ["5.56x45mm M855" , 862, 100, 0.0635456, -0.00126466, 3.81, 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.0682606, -0.00109563, 3.81, 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.0624569, -0.00123318, 3.81, 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.0635355, -0.00123272, 3.81, 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.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.306], [670, 0.298], [880, 0.291], [1000, 0.289], [1150, 0.288], [1340, 0.288], [1410, 0.288]], 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.0801269, -0.00116278, 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]]; + ["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.339], [730, 0.331], [960, 0.323], [1100, 0.321], [1220, 0.320], [1380, 0.320], [1480, 0.320]], 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 index 5b03c11475..ba5a781813 100644 --- a/addons/atragmx/functions/fnc_insert_c1_ballistic_coefficient_data.sqf +++ b/addons/atragmx/functions/fnc_insert_c1_ballistic_coefficient_data.sqf @@ -8,7 +8,7 @@ * c1 ballistic coefficient - * * Return Value: - * Nothing + * None * * Example: * [800, 0.485] call ace_atragmx_fnc_insert_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 index 1eb25b2f62..43cd936beb 100644 --- a/addons/atragmx/functions/fnc_insert_muzzle_velocity_data.sqf +++ b/addons/atragmx/functions/fnc_insert_muzzle_velocity_data.sqf @@ -7,7 +7,7 @@ * muzzle velocity - * * Return Value: - * Nothing + * None * * Example: * [10, 800] call ace_atragmx_fnc_insert_muzzle_velocity_data diff --git a/addons/atragmx/functions/fnc_lookup_c1_ballistic_coefficient.sqf b/addons/atragmx/functions/fnc_lookup_c1_ballistic_coefficient.sqf new file mode 100644 index 0000000000..43b6da006f --- /dev/null +++ b/addons/atragmx/functions/fnc_lookup_c1_ballistic_coefficient.sqf @@ -0,0 +1,43 @@ +/* + * Author: Ruthberg + * Lookup the correct C1 ballistic coefficient in the c1 ballistic coefficient vs. distance interpolation table + * + * Arguments: + * Target Range + * + * Return Value: + * C1 ballistic coefficient 0) then { + _lookupTable pushBack _x; + }; +} forEach (GVAR(workingMemory) select 19); + +private _lookupTableSize = count _lookupTable; +if (_lookupTableSize < 2) exitWith { (GVAR(workingMemory) select 15) }; +_lookupTable sort true; + +private _lowerIndex = 0; +private _upperIndex = 1; + +for "_index" from 1 to (_lookupTableSize - 1) do { + _upperIndex = _index; + _lowerIndex = _upperIndex - 1; + if (((_lookupTable select _index) select 0) >= _targetRange) exitWith {}; +}; + +(_lookupTable select _lowerIndex) params ["_lowerDistance", "_lowerC1"]; +(_lookupTable select _upperIndex) params ["_upperDistance", "_upperC1"]; + +(0.1 max (linearConversion [_lowerDistance, _upperDistance, _targetRange, _lowerC1, _upperC1]) min 2.0) 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 38310edfae..3ff40bbbcc 100644 --- a/addons/atragmx/functions/fnc_parse_input.sqf +++ b/addons/atragmx/functions/fnc_parse_input.sqf @@ -3,10 +3,10 @@ * 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 @@ -77,11 +77,10 @@ if (GVAR(currentUnit) != 2) then { GVAR(barometricPressure) = 340 max GVAR(barometricPressure) min 1350; }; -private ["_windSpeed1", "_windSpeed2", "_targetSpeed", "_targetRange", "_inclinationAngleCosine", "_inclinationAngleDegree"]; -_windSpeed1 = parseNumber(ctrlText 140020); -_windSpeed2 = parseNumber(ctrlText 140021); -_targetSpeed = parseNumber(ctrlText 140050); -_targetRange = parseNumber(ctrlText 140060); +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; @@ -100,6 +99,7 @@ if (GVAR(currentUnit) == 1) then { } else { _targetRange = 25 max _targetRange min 3700; }; +GVAR(targetRangeDirtyFlag) = GVAR(targetRangeDirtyFlag) || {_targetRange != GVAR(targetRange) select GVAR(currentTarget)}; 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), _windSpeed1]; @@ -107,8 +107,8 @@ GVAR(windSpeed2) set [GVAR(currentTarget), _windSpeed2]; GVAR(windDirection) set [GVAR(currentTarget), 1 max Round(parseNumber(ctrlText 140030)) min 12]; GVAR(targetSpeed) set [GVAR(currentTarget), _targetSpeed]; GVAR(targetRange) set [GVAR(currentTarget), _targetRange]; -_inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; -_inclinationAngleDegree = -60 max round(parseNumber(ctrlText 140040)) min 60; +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 { @@ -122,19 +122,18 @@ if ((ctrlText 140051) == ">") then { GVAR(targetSpeedDirection) set [GVAR(currentTarget), -1]; }; -private ["_boreHeight", "_bulletMass", "_bulletDiameter", "_airFriction", "_rifleTwist", "_muzzleVelocity", "_zeroRange"]; -_boreHeight = parseNumber(ctrlText 120000); -_bulletMass = parseNumber(ctrlText 120010); -_bulletDiameter = parseNumber(ctrlText 120020); -_airFriction = parseNumber(ctrlText 120030); +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 _airFriction min 2; } else { _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; @@ -175,6 +174,11 @@ if (_muzzleVelocity != GVAR(workingMemory) select 1) then { GVAR(workingMemory) set [1, _muzzleVelocity]; GVAR(workingMemory) set [2, _zeroRange]; +if (GVAR(targetRangeDirtyFlag) && missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + [false, false] call FUNC(recalculate_c1_ballistic_coefficient); + GVAR(targetRangeDirtyFlag) = false; +}; + [] call FUNC(update_gun); [] call FUNC(update_gun_ammo_data); [] call FUNC(update_atmosphere); 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 index 0408b0e497..4d99a5637f 100644 --- a/addons/atragmx/functions/fnc_read_gun_list_entries_from_config.sqf +++ b/addons/atragmx/functions/fnc_read_gun_list_entries_from_config.sqf @@ -3,10 +3,10 @@ * Reads gun list entries from the config and appends them to the gun list * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_read_gun_list_entries_from_config @@ -110,10 +110,10 @@ private _validate_preset = { { 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]; diff --git a/addons/atragmx/functions/fnc_recalculate_c1_ballistic_coefficient.sqf b/addons/atragmx/functions/fnc_recalculate_c1_ballistic_coefficient.sqf index 028a06fa4a..e8bd219159 100644 --- a/addons/atragmx/functions/fnc_recalculate_c1_ballistic_coefficient.sqf +++ b/addons/atragmx/functions/fnc_recalculate_c1_ballistic_coefficient.sqf @@ -1,13 +1,13 @@ /* * Author: Ruthberg - * Recalculates the c1 ballistic coefficient based on the c1 ballistic coefficient vs. distance interpolation input + * Recalculates the c1 ballistic coefficient based on the current target range * * Arguments: * parse input * update display * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_recalculate_c1_ballistic_coefficient @@ -22,35 +22,7 @@ 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", "_upperIndex"]; -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", "_upperDistance", "_lowerC1", "_upperC1", "_c1"]; -_lowerDistance = (_lookupTable select _lowerIndex) select 0; -_upperDistance = (_lookupTable select _upperIndex) select 0; -_lowerC1 = (_lookupTable select _lowerIndex) select 1; -_upperC1 = (_lookupTable select _upperIndex) select 1; -_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; +private _c1 = [GVAR(targetRange) select GVAR(currentTarget)] call FUNC(lookup_c1_ballistic_coefficient); if (_c1 != GVAR(workingMemory) select 15) then { GVAR(workingMemory) set [15, _c1]; diff --git a/addons/atragmx/functions/fnc_recalculate_muzzle_velocity.sqf b/addons/atragmx/functions/fnc_recalculate_muzzle_velocity.sqf index 5830ba7683..aa1ab6d23f 100644 --- a/addons/atragmx/functions/fnc_recalculate_muzzle_velocity.sqf +++ b/addons/atragmx/functions/fnc_recalculate_muzzle_velocity.sqf @@ -7,7 +7,7 @@ * update display * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_recalculate_muzzle_velocity @@ -33,24 +33,19 @@ private _lookupTableSize = count _lookupTable; if (_lookupTableSize < 2) exitWith {}; _lookupTable sort true; -private ["_lowerIndex", "_upperIndex"]; +private _lowerIndex = 0; +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", "_upperTemperature", "_lowerMuzzleVelocity", "_upperMuzzleVelocity", "_muzzleVelocity"]; -_lowerTemperature = (_lookupTable select _lowerIndex) select 0; -_upperTemperature = (_lookupTable select _upperIndex) select 0; -_lowerMuzzleVelocity = (_lookupTable select _lowerIndex) select 1; -_upperMuzzleVelocity = (_lookupTable select _upperIndex) select 1; -_muzzleVelocity = _lowerMuzzleVelocity; -if (_lowerTemperature != _upperTemperature) then { - private _slope = (_upperMuzzleVelocity - _lowerMuzzleVelocity) / (_upperTemperature - _lowerTemperature); - _muzzleVelocity = _lowerMuzzleVelocity + (GVAR(temperature) - _lowerTemperature) * _slope; -}; -_muzzleVelocity = 100 max _muzzleVelocity min 1400; +(_lookupTable select _lowerIndex) params ["_lowerDistance", "_lowerMuzzleVelocity"]; +(_lookupTable select _upperIndex) params ["_upperDistance", "_upperMuzzleVelocity"]; + +_muzzleVelocity = 100 max (linearConversion [_lowerDistance, _upperDistance, GVAR(temperature), _lowerMuzzleVelocity, _upperMuzzleVelocity]) min 1400; if (_muzzleVelocity != GVAR(workingMemory) select 1) then { GVAR(workingMemory) set [1, _muzzleVelocity]; 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 index b8541152a0..a3fb516f23 100644 --- a/addons/atragmx/functions/fnc_restore_truing_drop.sqf +++ b/addons/atragmx/functions/fnc_restore_truing_drop.sqf @@ -6,7 +6,7 @@ * update display * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_restore_truing_drop diff --git a/addons/atragmx/functions/fnc_restore_user_data.sqf b/addons/atragmx/functions/fnc_restore_user_data.sqf index de91a7cd0e..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,7 +23,7 @@ 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]; diff --git a/addons/atragmx/functions/fnc_save_gun.sqf b/addons/atragmx/functions/fnc_save_gun.sqf index 73e26ee5fd..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)]; diff --git a/addons/atragmx/functions/fnc_shift_c1_ballistic_coefficient_data.sqf b/addons/atragmx/functions/fnc_shift_c1_ballistic_coefficient_data.sqf index 241d7fe7e0..89667e25b9 100644 --- a/addons/atragmx/functions/fnc_shift_c1_ballistic_coefficient_data.sqf +++ b/addons/atragmx/functions/fnc_shift_c1_ballistic_coefficient_data.sqf @@ -6,7 +6,7 @@ * ballistic coefficient - * * Return Value: - * Nothing + * None * * Example: * 10 call ace_atragmx_fnc_shift_c1_ballistic_coefficient_data diff --git a/addons/atragmx/functions/fnc_shift_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_shift_muzzle_velocity_data.sqf index 4bbd9337fd..75fcc9c3a6 100644 --- a/addons/atragmx/functions/fnc_shift_muzzle_velocity_data.sqf +++ b/addons/atragmx/functions/fnc_shift_muzzle_velocity_data.sqf @@ -6,7 +6,7 @@ * velocity - * * Return Value: - * Nothing + * None * * Example: * 10 call ace_atragmx_fnc_shift_muzzle_velocity_data 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 index 9ac13aef86..797f0498fe 100644 --- a/addons/atragmx/functions/fnc_show_c1_ballistic_coefficient_data.sqf +++ b/addons/atragmx/functions/fnc_show_c1_ballistic_coefficient_data.sqf @@ -6,7 +6,7 @@ * visible - * * Return Value: - * Nothing + * None * * Example: * false call ace_atragmx_fnc_show_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 591554d632..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 */ diff --git a/addons/atragmx/functions/fnc_show_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_show_muzzle_velocity_data.sqf index 8a5d39f2b5..20c7bf1826 100644 --- a/addons/atragmx/functions/fnc_show_muzzle_velocity_data.sqf +++ b/addons/atragmx/functions/fnc_show_muzzle_velocity_data.sqf @@ -6,7 +6,7 @@ * visible - * * Return Value: - * Nothing + * None * * Example: * false call ace_atragmx_fnc_show_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 index d4b7ce551f..644fe834b6 100644 --- a/addons/atragmx/functions/fnc_show_truing_drop.sqf +++ b/addons/atragmx/functions/fnc_show_truing_drop.sqf @@ -6,10 +6,10 @@ * visible - * * Return Value: - * Nothing + * None * * Example: - * call ace_atragmx_fnc_show_truing_drop + * false call ace_atragmx_fnc_show_truing_drop * * Public: No */ diff --git a/addons/atragmx/functions/fnc_sord.sqf b/addons/atragmx/functions/fnc_sord.sqf index eacd142c53..c6f77f748b 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 @@ -21,6 +21,8 @@ if (!GVAR(initialised)) exitWith {}; params ["_slopeDistance", "_azimuth", "_inclination"]; +GVAR(targetRangeDirtyFlag) = (round(_slopeDistance) != (GVAR(targetRange) select GVAR(currentTarget))); + GVAR(inclinationAngle) set [GVAR(currentTarget), round(_inclination)]; GVAR(directionOfFire) set [GVAR(currentTarget), round(_azimuth)]; GVAR(targetRange) set [GVAR(currentTarget), round(_slopeDistance)]; diff --git a/addons/atragmx/functions/fnc_store_gun_list.sqf b/addons/atragmx/functions/fnc_store_gun_list.sqf index 3e569f8a59..b3969837d2 100644 --- a/addons/atragmx/functions/fnc_store_gun_list.sqf +++ b/addons/atragmx/functions/fnc_store_gun_list.sqf @@ -3,10 +3,10 @@ * Saves the persistent gun list entries into profileNamespace * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_store_user_data diff --git a/addons/atragmx/functions/fnc_store_user_data.sqf b/addons/atragmx/functions/fnc_store_user_data.sqf index a0b3f9fe80..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 @@ -42,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 bda24a48f4..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 diff --git a/addons/atragmx/functions/fnc_toggle_c1_ballistic_coefficient_data.sqf b/addons/atragmx/functions/fnc_toggle_c1_ballistic_coefficient_data.sqf index e83f0d985c..c83e21a872 100644 --- a/addons/atragmx/functions/fnc_toggle_c1_ballistic_coefficient_data.sqf +++ b/addons/atragmx/functions/fnc_toggle_c1_ballistic_coefficient_data.sqf @@ -6,7 +6,7 @@ * Apply new data? * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_toggle_c1_ballistic_coefficient_data diff --git a/addons/atragmx/functions/fnc_toggle_coriolis.sqf b/addons/atragmx/functions/fnc_toggle_coriolis.sqf index 17b081131e..a711d2a55e 100644 --- a/addons/atragmx/functions/fnc_toggle_coriolis.sqf +++ b/addons/atragmx/functions/fnc_toggle_coriolis.sqf @@ -3,10 +3,10 @@ * Toggles the coriolis and spin drift output on/off * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_toggle_coriolis diff --git a/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf index c8cfe0f8f3..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 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 index 9a334b35ca..d00992d856 100644 --- a/addons/atragmx/functions/fnc_toggle_muzzle_velocity_data.sqf +++ b/addons/atragmx/functions/fnc_toggle_muzzle_velocity_data.sqf @@ -6,7 +6,7 @@ * Apply new data? * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_toggle_muzzle_velocity_data diff --git a/addons/atragmx/functions/fnc_toggle_option_menu.sqf b/addons/atragmx/functions/fnc_toggle_option_menu.sqf index 99928e2cc8..f7d7f06a13 100644 --- a/addons/atragmx/functions/fnc_toggle_option_menu.sqf +++ b/addons/atragmx/functions/fnc_toggle_option_menu.sqf @@ -6,7 +6,7 @@ * open menu item * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_toggle_option_menu @@ -29,7 +29,7 @@ if (ctrlVisible 3001) then { }; } else { lbClear 3002; - + lbAdd [3002, "Accuracy 1st"]; lbAdd [3002, "Muz Vel Table"]; lbAdd [3002, "Drag Coef Table"]; @@ -43,9 +43,9 @@ if (ctrlVisible 3001) then { }; lbAdd [3002, "Set Clicks"]; lbAdd [3002, "Gun Note"]; - + lbSetCurSel [3002, 0]; - + ctrlShow [3001, true]; ctrlShow [3002, true]; 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 44892ca882..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 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 index 8c2e72587c..9865005c78 100644 --- a/addons/atragmx/functions/fnc_toggle_truing_drop.sqf +++ b/addons/atragmx/functions/fnc_toggle_truing_drop.sqf @@ -6,7 +6,7 @@ * Apply new data? * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_toggle_truing_drop diff --git a/addons/atragmx/functions/fnc_trim_gun_name.sqf b/addons/atragmx/functions/fnc_trim_gun_name.sqf index 2ab603c804..36344d6dfa 100644 --- a/addons/atragmx/functions/fnc_trim_gun_name.sqf +++ b/addons/atragmx/functions/fnc_trim_gun_name.sqf @@ -3,10 +3,10 @@ * Trims the gun name input field * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_trim_gun_name diff --git a/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf b/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf index 6af3e179ac..dfa41ea0b4 100644 --- a/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf +++ b/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf @@ -3,10 +3,10 @@ * Trues the c1 ballistic coefficient * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_true_c1_ballistic_coefficient diff --git a/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf b/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf index d8aa478412..db907aa29d 100644 --- a/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf +++ b/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf @@ -3,10 +3,10 @@ * Trues the muzzle velocity * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_true_muzzle_velocity 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 index d63d9768da..5095ee0d96 100644 --- a/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf +++ b/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf @@ -3,10 +3,10 @@ * Updates the c1 ballistic coefficient data fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_c1_ballistic_coefficient_data 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 abdb401454..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 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 index 989d3d113c..466d83cc4c 100644 --- a/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf +++ b/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf @@ -3,10 +3,10 @@ * Updates the muzzle velocity data fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_muzzle_velocity_data diff --git a/addons/atragmx/functions/fnc_update_range_card.sqf b/addons/atragmx/functions/fnc_update_range_card.sqf index e8c910ca74..2f4aa3c7a2 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 = MOA_TO_MRAD(_elevation); + _windage1 = MOA_TO_MRAD(_windage1); + _windage2 = MOA_TO_MRAD(_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, MRAD_TO_MOA(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 2541222583..1dc2c6204e 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,20 +15,19 @@ */ #include "script_component.hpp" -private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_windageRel", "_windageCur", "_wind2", "_lead", "_clickSize", "_clickNumber", "_clickInterval"]; -_elevationAbs = GVAR(elevationOutput) select GVAR(currentTarget); -_elevationRel = 0; -_elevationCur = 0; -_windageAbs = GVAR(windage1Output) select GVAR(currentTarget); -_windageRel = 0; -_windageCur = 0; +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); if (GVAR(showCoriolis)) then { _elevationRel = GVAR(verticalCoriolisOutput) select GVAR(currentTarget); _windageRel = GVAR(horizontalCoriolisOutput) select GVAR(currentTarget); - + _windageCur = GVAR(spinDriftOutput) select GVAR(currentTarget); } else { _elevationCur = GVAR(workingMemory) select 10; @@ -38,20 +37,20 @@ if (GVAR(showCoriolis)) then { _windageRel = _windageAbs - _windageCur; }; -_lead = GVAR(leadOutput) select GVAR(currentTarget); +private _lead = GVAR(leadOutput) select GVAR(currentTarget); switch (GVAR(currentScopeUnit)) do { case 0: { - _elevationAbs = _elevationAbs / 3.38; - _windageAbs = _windageAbs / 3.38; + _elevationAbs = MOA_TO_MRAD(_elevationAbs); + _windageAbs = MOA_TO_MRAD(_windageAbs); - _wind2 = _wind2 / 3.38; + _wind2 = MOA_TO_MRAD(_wind2); - _elevationRel = _elevationRel / 3.38; - _windageRel = _windageRel / 3.38; + _elevationRel = MOA_TO_MRAD(_elevationRel); + _windageRel = MOA_TO_MRAD(_windageRel); - _elevationCur = _elevationCur / 3.38; - _windageCur = _windageCur / 3.38; + _elevationCur = MOA_TO_MRAD(_elevationCur); + _windageCur = MOA_TO_MRAD(_windageCur); }; case 2: { _elevationAbs = _elevationAbs * 1.047; @@ -66,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, MRAD_TO_MOA(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 index 5d97780d49..cd1fa9de68 100644 --- a/addons/atragmx/functions/fnc_update_truing_drop_data.sqf +++ b/addons/atragmx/functions/fnc_update_truing_drop_data.sqf @@ -3,10 +3,10 @@ * Updates the truing drop data fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_truing_drop_data @@ -42,9 +42,9 @@ private _dropData = +GVAR(truingDropDropData); switch (_dropUnit) do { case 0: { - _dropData set [0, (_dropData select 0) / 3.38]; - _dropData set [1, (_dropData select 1) / 3.38]; - _dropData set [2, (_dropData select 2) / 3.38]; + _dropData set [0, MOA_TO_MRAD(_dropData select 0)]; + _dropData set [1, MOA_TO_MRAD(_dropData select 1)]; + _dropData set [2, MOA_TO_MRAD(_dropData select 2)]; }; case 2: { _dropData set [0, (_dropData select 0) * 1.047]; diff --git a/addons/atragmx/functions/fnc_update_truing_drop_selection.sqf b/addons/atragmx/functions/fnc_update_truing_drop_selection.sqf index 98f7483276..e00876e4a1 100644 --- a/addons/atragmx/functions/fnc_update_truing_drop_selection.sqf +++ b/addons/atragmx/functions/fnc_update_truing_drop_selection.sqf @@ -3,10 +3,10 @@ * Updates the truing drop input method * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_truing_drop_selection diff --git a/addons/atragmx/functions/fnc_update_unit_selection.sqf b/addons/atragmx/functions/fnc_update_unit_selection.sqf index f054857078..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 diff --git a/addons/atragmx/functions/fnc_update_zero_range.sqf b/addons/atragmx/functions/fnc_update_zero_range.sqf index e4b3d0da8c..8a41e1c38e 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 @@ -17,33 +17,29 @@ [] 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 = GVAR(workingMemory) select 2; - -private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"]; -_altitude = GVAR(altitude); -_temperature = GVAR(temperature); -_barometricPressure = GVAR(barometricPressure); -_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 _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]; + private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%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]; + private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZeroAB:%1:%2:%3:%4:%5:%6:%7:%8:%9", _zeroRange, _muzzleVelocity, _boreHeight, _temperature, _barometricPressure, _relativeHumidity, _bc, _dragModel, _atmosphereModel]; (parseNumber _zeroAngle) }; 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 8ebc8b445f..ad25ee5b09 100644 --- a/addons/atragmx/script_component.hpp +++ b/addons/atragmx/script_component.hpp @@ -16,4 +16,4 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define ATRAGMX_PROFILE_NAMESPACE_VERSION 2.0 +#define ATRAGMX_PROFILE_NAMESPACE_VERSION 2.2 diff --git a/addons/atragmx/stringtable.xml b/addons/atragmx/stringtable.xml index 13c9e4478f..4c11ea8add 100644 --- a/addons/atragmx/stringtable.xml +++ b/addons/atragmx/stringtable.xml @@ -14,6 +14,8 @@ ATragMX ATragMX ATragMX + ATragMX + ATragMX Open ATragMX @@ -28,6 +30,8 @@ Abrir ATragMX ATragMX を開く ATragMX 열기 + 開啟ATragMX + 开启ATragMX Rugged PDA with ATragMX @@ -42,6 +46,8 @@ PDA Robusto com ATragMX ATragMX 付きの携行型端末 ATragMX가 달린 PDA + 裝有軍用PDA的ATragMX + 装有军用PDA的ATragMX Open ATragMX @@ -56,6 +62,8 @@ Abrir ATragMX ATragMX を開く ATragMX 열기 + 開啟ATragMX + 开启ATragMX 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/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index e48a850209..e7a8630ac9 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,43 +21,42 @@ 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, 2] call EFUNC(common,displayTextStructured); }; _unit setVariable [QGVAR(attached), [[_attachedItem, _itemClassname]], true]; } else { GVAR(placeAction) = PLACE_WAITING; [_unit, "forceWalk", "ACE_Attach", true] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", "ACE_Attach", true] call EFUNC(common,statusEffect_set); [{[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: - _model = getText (configFile >> "CfgAmmo" >> _itemVehClass >> "model"); + private _model = getText (configFile >> "CfgAmmo" >> _itemVehClass >> "model"); if (_model == "") then { _model = getText (configFile >> "CfgVehicles" >> _itemVehClass >> "model"); }; @@ -67,27 +66,27 @@ 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; [_unit, "forceWalk", "ACE_Attach", false] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", "ACE_Attach", false] call EFUNC(common,statusEffect_set); [] call EFUNC(interaction,hideMouseHint); [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); _unit removeAction _actionID; @@ -95,7 +94,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: @@ -103,18 +102,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 a9b6f2deff..bd9d7453cb 100644 --- a/addons/attach/functions/fnc_canDetach.sqf +++ b/addons/attach/functions/fnc_canDetach.sqf @@ -24,9 +24,7 @@ if ((vehicle _unit) != _unit) exitWith {false}; 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..91763c0c4d 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,9 +78,9 @@ _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"); }; -[format [localize LSTRING(Item_Detached), _itemDisplayName]] call EFUNC(common,displayTextStructured); +[format [localize LSTRING(Item_Detached), _itemDisplayName], 2] call EFUNC(common,displayTextStructured); 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..9679e55ad2 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, 2] 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 900c10bc05..a8e8c23cdf 100644 --- a/addons/attach/stringtable.xml +++ b/addons/attach/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Прикрепить предмет アイテムを取り付ける 물건 부착 + 附掛裝備>> + 附挂装备>> Attach @@ -28,6 +30,8 @@ Прикрепить 取り付ける 부착 + 附掛 + 附挂 Detach item @@ -42,6 +46,8 @@ Отсоединить アイテムを外す 분리 + 取下裝備 + 取下装备 IR Strobe Attached @@ -56,6 +62,8 @@ ИК-маяк прикреплён 赤外線ストロボを取り付ける 적외선 스트로브 부착됨 + 已附掛紅外線頻閃器 + 已附挂红外线频闪器 IR Strobe Detached @@ -70,6 +78,8 @@ ИК-маяк отсоединён 赤外線ストロボを外す 적외선 스트로브 분리됨 + 已取下紅外線頻閃器 + 已取下红外线频闪器 IR Grenade Attached @@ -84,6 +94,8 @@ ИК-граната прикреплена 赤外線グレネードを取り付ける 적외선 수류탄 부착됨 + 已附掛紅外線手榴彈 + 已附挂红外线手榴弹 IR Grenade Detached @@ -98,6 +110,8 @@ ИК-граната отсоединена 赤外線グレネードを外す 적외선 수류탄 분리됨 + 已取下紅外線手榴彈 + 已取下红外线手榴弹 Chemlight Attached @@ -112,6 +126,8 @@ Химсвет прикреплён ケミライトを取り付け 켐라이트 부착됨 + 已附掛螢光棒 + 已附挂萤光棒 Chemlight Detached @@ -126,6 +142,8 @@ Химсвет отсоединён ケミライトを外す 켐라이트 분리됨 + 已取下螢光棒 + 已取下萤光棒 No inventory space @@ -140,6 +158,8 @@ В инвентаре нет места インベントリに空きがない 넣을 공간이 없음 + 無可用空間 + 无可用空间 IR Strobe @@ -154,6 +174,8 @@ ИК-маяк 赤外線ストロボ 적외선 스트로브 + 紅外線頻閃器 + 红外线频闪器 IR Strobe allows you to signal your position through a pulsating beacon only visible with NVGs. @@ -168,6 +190,8 @@ ИК-маяк позволяет сигнализировать о своём местоположении через пульсирующий свет, видимый только через ПНВ. 赤外線ストロボはあなたの位置を知らせますが、夜間暗視装置を介してでしか見れません。 적외선 스트로브는 자신의 위치를 반짝이면서 표시합니다. 이는 야간투시경으로 밖에 보지 못합니다. + 紅外線閃頻器,藉由紅外線閃頻信號來辨識你的位置,僅能使用夜視系統來辨識紅外線信號 + 红外线闪频器,藉由红外线闪频信号来辨识你的位置,仅能使用夜视系统来辨识红外线信号 Place @@ -182,6 +206,8 @@ Установить 置く 두기 + 放置 + 放置 Cancel @@ -196,6 +222,8 @@ Отмена やめる 취소 + 取消 + 取消 Attach Failed @@ -210,6 +238,8 @@ Non si attacca 取り付けに失敗した 부착 실패 + 附掛失敗 + 附挂失败 %1<br/>Attached @@ -224,6 +254,8 @@ %1<br/>присоединен(-а) %1<br/>を取り付けた %1<br/>부착됨 + %1<br/>已附掛 + %1<br/>已附挂 %1<br/>Detached @@ -238,6 +270,8 @@ %1<br/>отсоединен(-а) %1<br/>を外した %1<br/>분리됨 + %1<br/>已取下 + %1<br/>已取下 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 795a84087d..5b25f70f71 100644 --- a/addons/ballistics/CfgAmmo.hpp +++ b/addons/ballistics/CfgAmmo.hpp @@ -7,7 +7,7 @@ class CfgAmmo { }; class B_556x45_Ball : BulletBase { - airFriction=-0.00126466; + airFriction=-0.00130094; tracerScale = 1; tracerStartTime=0.073; // M856 tracer burns out to 800m tracerEndTime=1.57123; // Time in seconds calculated with ballistics calculator @@ -23,10 +23,11 @@ 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; + airFriction=-0.00111805; ACE_caliber=5.69; ACE_bulletLength=23.012; ACE_bulletMass=4.9896; + ACE_muzzleVelocityVariationSD=0.4; 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.361}; ACE_velocityBoundaries[]={}; @@ -36,7 +37,7 @@ class CfgAmmo { ACE_barrelLengths[]={190.5, 368.3, 457.2, 508.0}; }; class ACE_556x45_Ball_Mk318 : B_556x45_Ball { - airFriction=-0.00123318; + airFriction=-0.0012588; ACE_caliber=5.69; ACE_bulletLength=23.012; ACE_bulletMass=4.0176; @@ -49,7 +50,7 @@ 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; ACE_caliber=5.69; ACE_bulletLength=23.012; @@ -67,7 +68,7 @@ class CfgAmmo { nvgOnly = 1; }; class B_545x39_Ball_F : BulletBase { - airFriction=-0.00116278; + airFriction=-0.00119458; ACE_caliber=5.588; ACE_bulletLength=21.59; ACE_bulletMass=3.42792; @@ -83,7 +84,7 @@ class CfgAmmo { tracerScale = 0.5; }; class B_580x42_Ball_F: BulletBase { - airFriction=-0.00117956; + airFriction=-0.00121087; ACE_caliber=5.9944; ACE_bulletLength=24.2; ACE_bulletMass=4.15; @@ -96,7 +97,7 @@ class CfgAmmo { ACE_barrelLengths[]={369.0, 463.0, 600.0}; }; class B_65x39_Caseless : BulletBase { - airFriction=-0.00075308; + airFriction=-0.00077363; tracerScale = 1.1; //1.0; ACE_caliber=6.706; ACE_bulletLength=32.893; @@ -118,11 +119,12 @@ class CfgAmmo { nvgOnly = 1; }; class ACE_65x47_Ball_Scenar: B_65x39_Caseless { - airFriction=-0.00067037; + airFriction=-0.00069003; caliber=0.9; ACE_caliber=6.706; ACE_bulletLength=34.646; ACE_bulletMass=9.0072; + ACE_muzzleVelocityVariationSD=0.35; 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.290}; ACE_velocityBoundaries[]={}; @@ -132,11 +134,12 @@ 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; + airFriction=-0.00062437; caliber=1.1; ACE_caliber=6.706; ACE_bulletLength=36.22; ACE_bulletMass=9.072; + ACE_muzzleVelocityVariationSD=0.3; 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.317}; ACE_velocityBoundaries[]={}; @@ -150,7 +153,7 @@ class CfgAmmo { tracerScale = 1.1; //1.0; }; class B_762x51_Ball : BulletBase { - airFriction=-0.00100957; + 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 @@ -170,13 +173,14 @@ 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; ACE_caliber=7.823; ACE_bulletLength=31.496; ACE_bulletMass=11.34; + ACE_muzzleVelocityVariationSD=0.4; 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.243}; ACE_velocityBoundaries[]={}; @@ -186,13 +190,14 @@ 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; ACE_caliber=7.823; ACE_bulletLength=31.496; ACE_bulletMass=11.34; + ACE_muzzleVelocityVariationSD=0.45; ACE_ammoTempMuzzleVelocityShifts[]={-5.3, -5.1, -4.6, -4.2, -3.4, -2.6, -1.4, -0.3, 1.4, 3.0, 5.2}; ACE_ballisticCoefficients[]={0.243}; ACE_velocityBoundaries[]={}; @@ -202,13 +207,14 @@ 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; ACE_caliber=7.823; ACE_bulletLength=31.496; ACE_bulletMass=8.424; + ACE_muzzleVelocityVariationSD=0.45; 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.377}; ACE_velocityBoundaries[]={}; @@ -218,7 +224,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; @@ -234,7 +240,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; @@ -250,13 +256,14 @@ class CfgAmmo { ACE_barrelLengths[]={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; ACE_caliber=7.823; ACE_bulletLength=34.366; ACE_bulletMass=12.312; + ACE_muzzleVelocityVariationSD=0.45; ACE_ammoTempMuzzleVelocityShifts[]={-5.3, -5.1, -4.6, -4.2, -3.4, -2.6, -1.4, -0.3, 1.4, 3.0, 5.2}; ACE_ballisticCoefficients[]={0.268}; ACE_velocityBoundaries[]={}; @@ -266,13 +273,14 @@ 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; ACE_caliber=7.823; ACE_bulletLength=37.821; ACE_bulletMass=14.256; + ACE_muzzleVelocityVariationSD=0.45; ACE_ammoTempMuzzleVelocityShifts[]={-5.3, -5.1, -4.6, -4.2, -3.4, -2.6, -1.4, -0.3, 1.4, 3.0, 5.2}; ACE_ballisticCoefficients[]={0.310}; ACE_velocityBoundaries[]={}; @@ -282,13 +290,14 @@ 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; ACE_caliber=7.823; ACE_bulletLength=40.691; ACE_bulletMass=14.904; + ACE_muzzleVelocityVariationSD=0.35; 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.368}; ACE_velocityBoundaries[]={}; @@ -298,7 +307,8 @@ class CfgAmmo { ACE_barrelLengths[]={508.0, 609.6, 660.4}; }; class B_762x54_Ball: B_762x51_Ball { - airFriction=-0.00100023; + airFriction=-0.00101071; + typicalSpeed=835; ACE_caliber=7.925; ACE_bulletLength=28.956; ACE_bulletMass=9.8496; @@ -307,12 +317,12 @@ class CfgAmmo { ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; - ACE_muzzleVelocities[]={700, 800, 820, 833}; - ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; + ACE_muzzleVelocities[]={760, 795, 835, 865}; + ACE_barrelLengths[]={406.4, 508.0, 604.5, 736.6}; }; class B_762x54_Tracer_Green; class ACE_762x54_Ball_7T2 : B_762x54_Tracer_Green { - airFriction=-0.00103989; + airFriction=-0.00103739; typicalSpeed=800; tracerStartTime=0.073; // Based on the 7T2 which burns three seconds tracerEndTime=3; @@ -324,11 +334,11 @@ class CfgAmmo { ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; - ACE_muzzleVelocities[]={680, 750, 798, 800}; - ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; + ACE_muzzleVelocities[]={735, 770, 809, 838}; + ACE_barrelLengths[]={406.4, 508.0, 604.5, 736.6}; }; class B_762x39_Ball_F : BulletBase { - airFriction=-0.00151621; + airFriction=-0.00154815; ACE_caliber=7.823; ACE_bulletLength=28.956; ACE_bulletMass=7.9704; @@ -341,7 +351,7 @@ class CfgAmmo { ACE_barrelLengths[]={254.0, 414.02, 508.0}; }; class B_9x21_Ball : BulletBase { - airFriction=-0.00208292; + airFriction=-0.00211064; tracerScale = 0.5; ACE_caliber=9.042; ACE_bulletLength=15.494; @@ -358,7 +368,7 @@ class CfgAmmo { tracerScale = 0.5; }; class ACE_9x19_Ball : B_9x21_Ball { - airFriction=-0.0019835; + airFriction=-0.00201185; ACE_caliber=9.017; ACE_bulletLength=15.494; ACE_bulletMass=8.0352; @@ -371,10 +381,11 @@ class CfgAmmo { ACE_barrelLengths[]={101.6, 127.0, 228.6}; }; class B_93x64_Ball : BulletBase { - airFriction=-0.00108571; + airFriction=-0.00110727; ACE_caliber=9.296; ACE_bulletLength=34.29; ACE_bulletMass=14.904; + ACE_muzzleVelocityVariationSD=0.4; 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.368}; ACE_velocityBoundaries[]={}; @@ -385,12 +396,13 @@ class CfgAmmo { }; class B_408_Ball : BulletBase { timeToLive=10; - airFriction=-0.00044958; + airFriction=-0.00046249; tracerScale = 1.3; ACE_caliber=10.363; ACE_bulletLength=55.1942; ACE_bulletMass=27.1507; // 419 gr ACE_transonicStabilityCoef=1; + ACE_muzzleVelocityVariationSD=0.2; 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.434}; ACE_velocityBoundaries[]={}; @@ -401,13 +413,14 @@ class CfgAmmo { }; class ACE_408_Ball : BulletBase { timeToLive=10; - airFriction=-0.00063655; + 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_muzzleVelocityVariationSD=0.2; 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.279}; ACE_velocityBoundaries[]={}; @@ -418,10 +431,11 @@ class CfgAmmo { }; class B_338_Ball : BulletBase { timeToLive=10; - airFriction=-0.00059133; + airFriction=-0.00060841; ACE_caliber=8.585; ACE_bulletLength=39.573; ACE_bulletMass=16.2; + ACE_muzzleVelocityVariationSD=0.3; 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.322}; ACE_velocityBoundaries[]={}; @@ -431,7 +445,7 @@ class CfgAmmo { ACE_barrelLengths[]={508.0, 660.4, 711.2}; }; class B_338_NM_Ball : BulletBase { - airFriction=-0.00052201; + airFriction=-0.00053639; ACE_caliber=8.585; ACE_bulletLength=43.18; ACE_bulletMass=19.44; @@ -445,11 +459,12 @@ 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_bulletLength=44.0182; ACE_bulletMass=19.44; + ACE_muzzleVelocityVariationSD=0.3; 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.368}; ACE_velocityBoundaries[]={}; @@ -460,12 +475,13 @@ 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_muzzleVelocityVariationSD=0.4; 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.290}; ACE_velocityBoundaries[]={}; @@ -478,7 +494,7 @@ class CfgAmmo { tracerScale = 1.3; //1.2; }; class B_127x54_Ball : BulletBase { - airFriction=-0.00019268; + airFriction=-0.00019568; tracerScale = 1.3;// ACE_caliber=12.954; ACE_bulletLength=64.516; @@ -493,11 +509,12 @@ class CfgAmmo { }; class B_127x99_Ball : BulletBase { timeToLive=10; - airFriction=-0.00057503; + airFriction=-0.00058679; tracerScale = 1.3; //1.2; ACE_caliber=12.954; ACE_bulletLength=58.674; ACE_bulletMass=41.9256; + ACE_muzzleVelocityVariationSD=0.35; 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.670}; ACE_velocityBoundaries[]={}; @@ -508,13 +525,14 @@ class CfgAmmo { }; class ACE_127x99_API : B_127x99_Ball { timeToLive=10; - airFriction=-0.00057503; + airFriction=-0.00058679; tracerScale = 1.3;// hit=25; caliber=4.0; ACE_caliber=12.954; ACE_bulletLength=58.674; ACE_bulletMass=41.9904; + ACE_muzzleVelocityVariationSD=0.4; 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.670}; ACE_velocityBoundaries[]={}; @@ -525,11 +543,12 @@ class CfgAmmo { }; class ACE_127x99_Ball_AMAX : B_127x99_Ball { timeToLive=10; - airFriction=-0.00036645; + airFriction=-0.00037397; caliber=3.0; ACE_caliber=12.954; ACE_bulletLength=64.516; ACE_bulletMass=48.6; + ACE_muzzleVelocityVariationSD=0.2; 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[]={1.050}; ACE_velocityBoundaries[]={}; @@ -540,7 +559,7 @@ class CfgAmmo { }; class B_127x108_Ball : BulletBase { timeToLive=10; - airFriction=-0.00063800; + airFriction=-0.00065098; tracerScale = 1.3; //1.5; ACE_caliber=12.979; ACE_bulletLength=64.008; @@ -553,8 +572,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; + airFriction=-0.00082143; tracerScale = 0.6; ACE_caliber=11.481; ACE_bulletLength=17.272; @@ -568,7 +591,7 @@ class CfgAmmo { ACE_barrelLengths[]={101.6, 127.0, 228.6}; }; class B_50BW_Ball_F : BulletBase { - airFriction=-0.00202645; + airFriction=-0.00205896; ACE_caliber=12.7; ACE_bulletLength=24.13; ACE_bulletMass=21.7076; diff --git a/addons/ballistics/CfgMagazines.hpp b/addons/ballistics/CfgMagazines.hpp index 072fedde3c..a89cf7022d 100644 --- a/addons/ballistics/CfgMagazines.hpp +++ b/addons/ballistics/CfgMagazines.hpp @@ -2,24 +2,24 @@ class CfgMagazines { class CA_Magazine; + class VehicleMagazine; + class 30Rnd_580x42_Mag_F: CA_Magazine { - initSpeed = 930; - }; - class 100Rnd_580x42_Mag_F: 30Rnd_580x42_Mag_F { - initSpeed = 930; + initSpeed = 950; }; class 20Rnd_650x39_Cased_Mag_F: CA_Magazine { - initSpeed = 760; + initSpeed = 806; }; class 30Rnd_65x39_caseless_mag: CA_Magazine { - initSpeed = 760; + initSpeed = 774; + }; + class 30Rnd_65x39_caseless_green: 30Rnd_65x39_caseless_mag { + initSpeed = 788; }; class 100Rnd_65x39_caseless_mag: CA_Magazine { - initSpeed = 760; - }; - class 100Rnd_65x39_caseless_mag_Tracer: 100Rnd_65x39_caseless_mag { - initSpeed = 760; + initSpeed = 774; }; + class 100Rnd_65x39_caseless_mag_Tracer; class ACE_100Rnd_65x39_caseless_mag_Tracer_Dim: 100Rnd_65x39_caseless_mag_Tracer { author = ECSTRING(common,ACETeam); ammo = "ACE_65x39_Caseless_Tracer_Dim"; @@ -29,7 +29,7 @@ class CfgMagazines { picture = "\A3\weapons_f\data\ui\m_100rnd_65x39_yellow_ca.paa"; }; class 200Rnd_65x39_cased_Box: 100Rnd_65x39_caseless_mag { - initSpeed = 760; + initSpeed = 743; }; class ACE_200Rnd_65x39_cased_Box_Tracer_Dim: 200Rnd_65x39_cased_Box { author = ECSTRING(common,ACETeam); @@ -38,6 +38,7 @@ class CfgMagazines { displayNameShort = CSTRING(200Rnd_65x39_cased_Box_Tracer_DimNameShort); descriptionShort = CSTRING(200Rnd_65x39_cased_Box_Tracer_DimDescription); picture = "\A3\weapons_f\data\ui\m_200rnd_65x39_yellow_ca.paa"; + initSpeed = 774; }; class 30Rnd_65x39_caseless_mag_Tracer; class ACE_30Rnd_65x39_caseless_mag_Tracer_Dim: 30Rnd_65x39_caseless_mag_Tracer { @@ -61,6 +62,22 @@ class CfgMagazines { }; class 30Rnd_556x45_Stanag: CA_Magazine { + initSpeed = 909; + }; + class 30Rnd_556x45_Stanag_green: 30Rnd_556x45_Stanag { + initSpeed = 869; + }; + class 30Rnd_556x45_Stanag_red: 30Rnd_556x45_Stanag { + initSpeed = 869; + }; + class 30Rnd_556x45_Stanag_Tracer_Red: 30Rnd_556x45_Stanag { + initSpeed = 869; + }; + class 30Rnd_556x45_Stanag_Tracer_Green: 30Rnd_556x45_Stanag { + initSpeed = 869; + }; + class 30Rnd_556x45_Stanag_Tracer_Yellow: 30Rnd_556x45_Stanag { + initSpeed = 889; }; class ACE_30Rnd_556x45_Stanag_M995_AP_mag: 30Rnd_556x45_Stanag { author = ECSTRING(common,ACETeam); @@ -68,7 +85,7 @@ class CfgMagazines { displayName = CSTRING(30Rnd_556x45_Stanag_M995_AP_mag_Name); displayNameShort = CSTRING(30Rnd_556x45_Stanag_M995_AP_mag_NameShort); descriptionShort = CSTRING(30Rnd_556x45_Stanag_M995_AP_mag_Description); - initSpeed = 865; + initSpeed = 875; }; class ACE_30Rnd_556x45_Stanag_Mk262_mag: 30Rnd_556x45_Stanag { author = ECSTRING(common,ACETeam); @@ -84,9 +101,7 @@ class CfgMagazines { displayName = CSTRING(30Rnd_556x45_Stanag_Mk318_mag_Name); displayNameShort = CSTRING(30Rnd_556x45_Stanag_Mk318_mag_NameShort); descriptionShort = CSTRING(30Rnd_556x45_Stanag_Mk318_mag_Description); - initSpeed = 922; - }; - class 30Rnd_556x45_Stanag_Tracer_Red: 30Rnd_556x45_Stanag { + initSpeed = 923; }; class ACE_30Rnd_556x45_Stanag_Tracer_Dim: 30Rnd_556x45_Stanag_Tracer_Red { author = ECSTRING(common,ACETeam); @@ -98,15 +113,18 @@ class CfgMagazines { }; class 200Rnd_556x45_Box_F: CA_Magazine { - initSpeed = 872; + initSpeed = 889; + }; + class 200Rnd_556x45_Box_Red_F: 200Rnd_556x45_Box_F { + initSpeed = 869; }; class 30Rnd_762x39_Mag_F: CA_Magazine { - initSpeed = 715; + initSpeed = 716; }; class 20Rnd_762x51_Mag: CA_Magazine { - initSpeed = 833; + initSpeed = 827; }; class 10Rnd_762x51_Mag: 20Rnd_762x51_Mag { initSpeed = 833; @@ -140,7 +158,7 @@ class CfgMagazines { displayName = CSTRING(20Rnd_762x51_mag_SDName); displayNameShort = CSTRING(20Rnd_762x51_mag_SDNameShort); descriptionShort = CSTRING(20Rnd_762x51_mag_SDDescription); - initSpeed = 325; + initSpeed = 330; }; class ACE_10Rnd_762x51_M118LR_Mag: 10Rnd_762x51_Mag { @@ -185,7 +203,7 @@ class CfgMagazines { displayName = CSTRING(20Rnd_762x51_M118LR_Mag_Name); displayNameShort = CSTRING(20Rnd_762x51_M118LR_Mag_NameShort); descriptionShort = CSTRING(20Rnd_762x51_M118LR_Mag_Description); - initSpeed = 780; + initSpeed = 785; }; class ACE_20Rnd_762x51_Mk316_Mod_0_Mag: 20Rnd_762x51_Mag { author = ECSTRING(common,ACETeam); @@ -194,7 +212,7 @@ class CfgMagazines { displayName = CSTRING(20Rnd_762x51_Mk316_Mod_0_Mag_Name); displayNameShort = CSTRING(20Rnd_762x51_Mk316_Mod_0_Mag_NameShort); descriptionShort = CSTRING(20Rnd_762x51_Mk316_Mod_0_Mag_Description); - initSpeed = 790; + initSpeed = 798; }; class ACE_20Rnd_762x51_Mk319_Mod_0_Mag: 20Rnd_762x51_Mag { author = ECSTRING(common,ACETeam); @@ -202,7 +220,7 @@ class CfgMagazines { displayName = CSTRING(20Rnd_762x51_Mk319_Mod_0_Mag_Name); displayNameShort = CSTRING(20Rnd_762x51_Mk319_Mod_0_Mag_NameShort); descriptionShort = CSTRING(20Rnd_762x51_Mk319_Mod_0_Mag_Description); - initSpeed = 900; + initSpeed = 910; }; class ACE_20Rnd_762x51_M993_AP_Mag: 20Rnd_762x51_Mag { author = ECSTRING(common,ACETeam); @@ -211,7 +229,7 @@ class CfgMagazines { displayName = CSTRING(20Rnd_762x51_M993_AP_Mag_Name); displayNameShort = CSTRING(20Rnd_762x51_M993_AP_Mag_NameShort); descriptionShort = CSTRING(20Rnd_762x51_M993_AP_Mag_Description); - initSpeed = 920; + initSpeed = 930; }; class ACE_20Rnd_762x67_Mk248_Mod_0_Mag: 20Rnd_762x51_Mag { author = ECSTRING(common,ACETeam); @@ -219,7 +237,7 @@ class CfgMagazines { displayName = CSTRING(20Rnd_762x67_Mk248_Mod_0_Mag_Name); displayNameShort = CSTRING(20Rnd_762x67_Mk248_Mod_0_Mag_NameShort); descriptionShort = CSTRING(20Rnd_762x67_Mk248_Mod_0_Mag_Description); - initSpeed = 900; + initSpeed = 865; }; class ACE_20Rnd_762x67_Mk248_Mod_1_Mag: 20Rnd_762x51_Mag { author = ECSTRING(common,ACETeam); @@ -227,7 +245,7 @@ class CfgMagazines { displayName = CSTRING(20Rnd_762x67_Mk248_Mod_1_Mag_Name); displayNameShort = CSTRING(20Rnd_762x67_Mk248_Mod_1_Mag_NameShort); descriptionShort = CSTRING(20Rnd_762x67_Mk248_Mod_1_Mag_Description); - initSpeed = 880; + initSpeed = 847; }; class ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag: 20Rnd_762x51_Mag { author = ECSTRING(common,ACETeam); @@ -235,12 +253,12 @@ class CfgMagazines { displayName = CSTRING(20Rnd_762x67_Berger_Hybrid_OTM_Mag_Name); displayNameShort = CSTRING(20Rnd_762x67_Berger_Hybrid_OTM_Mag_NameShort); descriptionShort = CSTRING(20Rnd_762x67_Berger_Hybrid_OTM_Mag_Description); - initSpeed = 832; + initSpeed = 800; }; class ACE_30Rnd_65x47_Scenar_mag: 30Rnd_65x39_caseless_mag { author = ECSTRING(common,ACETeam); ammo = "ACE_65x47_Ball_Scenar"; - initSpeed = 761; + initSpeed = 826; displayName = CSTRING(30Rnd_65x47_Scenar_mag_Name); displayNameShort = CSTRING(30Rnd_65x47_Scenar_mag_NameShort); descriptionShort = CSTRING(30Rnd_65x47_Scenar_mag_Description); @@ -248,7 +266,7 @@ class CfgMagazines { class ACE_20Rnd_65x47_Scenar_mag: 20Rnd_650x39_Cased_Mag_F { author = ECSTRING(common,ACETeam); ammo = "ACE_65x47_Ball_Scenar"; - initSpeed = 779; + initSpeed = 826; displayName = CSTRING(20Rnd_65x47_Scenar_mag_Name); displayNameShort = CSTRING(20Rnd_65x47_Scenar_mag_NameShort); descriptionShort = CSTRING(20Rnd_65x47_Scenar_mag_Description); @@ -256,7 +274,7 @@ class CfgMagazines { class ACE_30Rnd_65_Creedmor_mag: 30Rnd_65x39_caseless_mag { author = ECSTRING(common,ACETeam); ammo = "ACE_65_Creedmor_Ball"; - initSpeed = 815; + initSpeed = 857; displayName = CSTRING(30Rnd_65_Creedmor_mag_Name); displayNameShort = CSTRING(30Rnd_65_Creedmor_mag_NameShort); descriptionShort = CSTRING(30Rnd_65_Creedmor_mag_Description); @@ -264,12 +282,14 @@ class CfgMagazines { class ACE_20Rnd_65_Creedmor_mag: 20Rnd_650x39_Cased_Mag_F { author = ECSTRING(common,ACETeam); ammo = "ACE_65_Creedmor_Ball"; - initSpeed = 808; + initSpeed = 857; 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 10Rnd_338_Mag: CA_Magazine { + initSpeed = 880; + }; class ACE_10Rnd_338_300gr_HPBT_Mag: 10Rnd_338_Mag { author = ECSTRING(common,ACETeam); ammo = "ACE_338_Ball"; @@ -300,6 +320,9 @@ class CfgMagazines { }; 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"; @@ -327,46 +350,47 @@ class CfgMagazines { class 30Rnd_9x21_Mag: CA_Magazine { - initSpeed = 390; + initSpeed = 430; }; - class ACE_30Rnd_9x19_mag: 30Rnd_9x21_Mag { - author = ECSTRING(common,ACETeam); - ammo = "ACE_9x19_Ball"; - displayName = CSTRING(30Rnd_9x19_mag_Name); - displayNameShort = CSTRING(30Rnd_9x19_mag_NameShort); - descriptionShort = CSTRING(30Rnd_9x19_mag_Description); - initSpeed = 370; + class 30Rnd_9x21_Green_Mag: 30Rnd_9x21_Mag { + initSpeed = 402; + }; + class 30Rnd_9x21_Mag_SMG_02: 30Rnd_9x21_Mag { + initSpeed = 430; + }; + class 30Rnd_9x21_Mag_SMG_02_Tracer_Green: 30Rnd_9x21_Mag_SMG_02 { + initSpeed = 402; }; class 10Rnd_50BW_Mag_F: CA_Magazine { initSpeed = 552; }; - + class 11Rnd_45ACP_Mag: CA_Magazine { - initSpeed = 250; + initSpeed = 254; }; class 6Rnd_45ACP_Cylinder : 11Rnd_45ACP_Mag { - initSpeed = 250; + initSpeed = 254; }; class 30Rnd_45ACP_Mag_SMG_01: 30Rnd_9x21_Mag { - initSpeed = 250; + initSpeed = 254; }; class 9Rnd_45ACP_Mag: 30Rnd_45ACP_Mag_SMG_01 { - initSpeed = 250; + initSpeed = 254; }; class 30Rnd_45ACP_Mag_SMG_01_Tracer_Green: 30Rnd_45ACP_Mag_SMG_01 { - initSpeed = 250; + initSpeed = 254; }; class 16Rnd_9x21_Mag: 30Rnd_9x21_Mag { - initSpeed = 390; + initSpeed = 430; }; class 10Rnd_9x21_Mag: 16Rnd_9x21_Mag { - initSpeed = 390; + initSpeed = 430; }; class ACE_16Rnd_9x19_mag: 16Rnd_9x21_Mag { author = ECSTRING(common,ACETeam); @@ -378,7 +402,7 @@ class CfgMagazines { }; class 10Rnd_762x54_Mag: 10Rnd_762x51_Mag { - initSpeed = 800; + initSpeed = 836; }; class ACE_10Rnd_762x54_Tracer_mag: 10Rnd_762x54_Mag { author = ECSTRING(common,ACETeam); @@ -386,19 +410,38 @@ class CfgMagazines { displayName = CSTRING(10Rnd_762x54_Tracer_mag_Name); displayNameShort = CSTRING(10Rnd_762x54_Tracer_mag_NameShort); descriptionShort = CSTRING(10Rnd_762x54_Tracer_mag_Description); - initSpeed = 800; + initSpeed = 810; tracersEvery = 1; }; class 150Rnd_762x54_Box: 150Rnd_762x51_Box { - initSpeed = 750; - }; - - class 150Rnd_93x64_Mag: CA_Magazine { - initSpeed = 860; + initSpeed = 778; }; class 10Rnd_127x54_Mag: CA_Magazine { initSpeed = 300; }; + + class 150Rnd_556x45_Drum_Mag_F: CA_Magazine { + initSpeed = 869; + }; + + class 130Rnd_338_Mag: CA_Magazine { + initSpeed = 807; + }; + + class 200Rnd_65x39_Belt: VehicleMagazine { + initSpeed = 806; + }; + + class 20Rnd_556x45_UW_mag: 30Rnd_556x45_Stanag { + initSpeed = 267; + }; + + class 150Rnd_93x64_Mag: CA_Magazine { + initSpeed = 870; + }; + class 10Rnd_93x64_DMR_05_Mag: 150Rnd_93x64_Mag { + initSpeed = 870; + }; }; diff --git a/addons/ballistics/CfgWeapons.hpp b/addons/ballistics/CfgWeapons.hpp index f95408d6a6..a2a0e0ff1d 100644 --- a/addons/ballistics/CfgWeapons.hpp +++ b/addons/ballistics/CfgWeapons.hpp @@ -11,97 +11,135 @@ class CfgWeapons { class Rifle_Base_F; class Rifle_Short_Base_F: Rifle_Base_F {}; class Rifle_Long_Base_F: Rifle_Base_F {}; - class MuzzleSlot; - - /* Long Rifles */ + // GM6 Lynx class GM6_base_F: Rifle_Long_Base_F { class Single: Mode_SemiAuto { - dispersion = 0.00029; // radians. Equal to 1.00 MOA. + dispersion = MOA_TO_RAD(0.45); }; }; + // M200 Intervention class LRR_base_F: Rifle_Long_Base_F { class Single: Mode_SemiAuto { - dispersion = 0.00020; // radians. Equal to 0.70 MOA. + dispersion = MOA_TO_RAD(0.50); }; }; - 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" + // MX + class arifle_MX_Base_F: Rifle_Base_F { + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(0.90); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(0.90); + }; + }; + + // KH2002 Sama + class arifle_katiba_Base_F: Rifle_Base_F { + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(0.90); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(0.90); + }; + }; + + // CTAR-21 + class Tavor_base_F: Rifle_Base_F { + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(1.12); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(1.12); }; }; - class DMR_06_base_F: Rifle_Long_Base_F { + // F2000 + class mk20_base_F: Rifle_Base_F { class Single: Mode_SemiAuto { - dispersion = 0.00029; // radians. Equal to 1.00 MOA. + dispersion = MOA_TO_RAD(1.12); }; class FullAuto: Mode_FullAuto { - dispersion = 0.00029; // radians. Equal to 1.00 MOA. - }; - }; - - class DMR_05_base_F: Rifle_Long_Base_F { - class Single: Mode_SemiAuto { - dispersion = 0.00029; // radians. Equal to 1.00 MOA. - }; - - class FullAuto: Mode_FullAuto { - dispersion = 0.00029; // radians. Equal to 1.00 MOA. - }; - }; - - class DMR_04_base_F: Rifle_Long_Base_F { - class Single: Mode_SemiAuto { - dispersion = 0.00029; // radians. Equal to 1.00 MOA. - }; - }; - - class DMR_03_base_F: Rifle_Long_Base_F { - class Single: Mode_SemiAuto { - dispersion = 0.00032; // radians. Equal to 1.10 MOA. - }; - - class FullAuto: Mode_FullAuto { - dispersion = 0.00032; // radians. Equal to 1.10 MOA. + dispersion = MOA_TO_RAD(1.12); }; }; + // Noreen "Bad News" ULR class DMR_02_base_F: Rifle_Long_Base_F { class Single: Mode_SemiAuto { - dispersion = 0.000262; // radians. Equal to 0.90 MOA. + dispersion = MOA_TO_RAD(0.61); }; }; + // VS-121 class DMR_01_base_F: Rifle_Long_Base_F { class Single: Mode_SemiAuto { - dispersion = 0.0004; // radians. Equal to 1.375 MOA. - }; - }; - - class EBR_base_F: Rifle_Long_Base_F { - class Single: Mode_SemiAuto { - dispersion = 0.00029; // radians. Equal to 1.00 MOA. + dispersion = MOA_TO_RAD(0.81); }; class FullAuto: Mode_FullAuto { - dispersion = 0.00029; // radians. Equal to 1.00 MOA. + dispersion = MOA_TO_RAD(0.81); }; }; - /* MX */ + // Mk14 Mod 1 EBR + class EBR_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(0.81); + }; - class arifle_MX_Base_F: Rifle_Base_F { - class Single: Mode_SemiAuto {}; - class FullAuto: Mode_FullAuto {}; + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(0.81); + }; }; + + // SIG 556 + class DMR_03_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(0.81); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(0.81); + }; + }; + + // ASP-1 Kir + class DMR_04_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(1.0); + }; + }; + + // Cyrus + class DMR_05_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(0.67); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(0.67); + }; + }; + + // M14 + class DMR_06_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(0.81); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(0.81); + }; + }; + + // MX LSW class arifle_MX_SW_F: arifle_MX_Base_F { magazines[] = { "100Rnd_65x39_caseless_mag_Tracer", @@ -111,10 +149,19 @@ class CfgWeapons { "ACE_100Rnd_65x39_caseless_mag_Tracer_Dim", "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; - initSpeed = -1.0; + initSpeed = -0.981912; ACE_barrelTwist = 228.6; ACE_barrelLength = 406.4; + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(0.90); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(0.90); + }; }; + + // MXM class arifle_MXM_F: arifle_MX_Base_F { magazines[] = { "30Rnd_65x39_caseless_mag", @@ -123,23 +170,19 @@ class CfgWeapons { "ACE_30Rnd_65x47_Scenar_mag", "ACE_30Rnd_65_Creedmor_mag" }; - initSpeed = -1.01842; + initSpeed = -1.0; ACE_barrelTwist = 228.6; ACE_barrelLength = 457.2; class Single: Single { - dispersion = 0.000436; // radians. Equal to 1.50 MOA. + dispersion = MOA_TO_RAD(0.90); }; class FullAuto: FullAuto { - dispersion = 0.000436; // radians. Equal to 1.50 MOA. + dispersion = MOA_TO_RAD(0.90); }; }; - - /* Katiba */ - class arifle_katiba_Base_F: Rifle_Base_F {}; - - /* SPAR */ + // HK416A5 11" class arifle_SPAR_01_base_F: Rifle_Base_F { magazines[] = { "30Rnd_556x45_Stanag", @@ -153,15 +196,33 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.859238; + initSpeed = -0.869636; ACE_barrelTwist = 177.8; ACE_barrelLength = 264.0; + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(1.12); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(1.12); + }; }; + + // HK416A5 14.5" class arifle_SPAR_02_base_F: Rifle_Base_F { - initSpeed = -0.934282; + initSpeed = -0.999864; ACE_barrelTwist = 177.8; ACE_barrelLength = 368.0; + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(1.12); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(1.12); + }; }; + + // HK417A2 20" class arifle_SPAR_03_base_F: Rifle_Base_F { magazines[] = { "20Rnd_762x51_Mag", @@ -173,201 +234,278 @@ class CfgWeapons { "ACE_20Rnd_762x51_M993_AP_Mag", "ACE_20Rnd_762x51_Mag_SD" }; - initSpeed = -0.984394; + initSpeed = -0.991536; ACE_barrelTwist = 279.4; ACE_barrelLength = 508.0; + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(0.81); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(0.81); + }; }; - /* Other */ + // Stoner 99 LMG class LMG_Mk200_F: Rifle_Long_Base_F { magazines[] = { "200Rnd_65x39_cased_Box", "200Rnd_65x39_cased_Box_Tracer", "ACE_200Rnd_65x39_cased_Box_Tracer_Dim" }; - initSpeed = -0.976974; + initSpeed = -0.999327; ACE_barrelTwist = 177.8; ACE_barrelLength = 317.5; }; + + // Negev NG7 class LMG_Zafir_F: Rifle_Long_Base_F { - initSpeed = -1.00333; + initSpeed = -1.00048; ACE_barrelTwist = 304.8; ACE_barrelLength = 459.74; }; + + // M249 SPW class LMG_03_base_F: Rifle_Long_Base_F { - initSpeed = -1.02002; + initSpeed = -1.00051; ACE_barrelTwist = 177.8; ACE_barrelLength = 414.02; }; - class Tavor_base_F: Rifle_Base_F {}; - class mk20_base_F: Rifle_Base_F {}; - /* SMGs */ + // RFB SDAR class SDAR_base_F: Rifle_Base_F { - initSpeed = -1.211; class Single: Mode_SemiAuto { - dispersion = 0.0008727; // radians. Equal to 3 MOA. + dispersion = MOA_TO_RAD(3.0); }; class Burst: Mode_Burst { - dispersion = 0.0008727; // radians. Equal to 3 MOA. + dispersion = MOA_TO_RAD(3.0); }; class FullAuto: Mode_FullAuto { - dispersion = 0.0008727; // radians. Equal to 3 MOA. + dispersion = MOA_TO_RAD(3.0); }; }; - /* Pistols */ - class Pistol; class Pistol_Base_F: Pistol {}; + // P99 class hgun_P07_F: Pistol_Base_F { - initSpeed = -1.0; + initSpeed = -0.906977; ACE_barrelTwist = 254.0; ACE_barrelLength = 101.6; }; + // MP-443 Grach class hgun_Rook40_F: Pistol_Base_F { - initSpeed = -1.03077; + initSpeed = -0.934884; ACE_barrelTwist = 254.0; ACE_barrelLength = 111.76; }; + // Custom Covert II class hgun_ACPC2_F: Pistol_Base_F { - initSpeed = -1.0; + initSpeed = -0.984252; ACE_barrelTwist = 406.4; ACE_barrelLength = 127.0; }; + // FNX-45 Tactical class hgun_Pistol_heavy_01_F: Pistol_Base_F { - initSpeed = -0.96; + initSpeed = -0.944882; ACE_barrelTwist = 406.4; ACE_barrelLength = 114.3; }; + // Chiappa Rhino 60DS class hgun_Pistol_heavy_02_F: Pistol_Base_F { - initSpeed = -0.92; + initSpeed = -0.905512; ACE_barrelTwist = 406.4; ACE_barrelLength = 76.2; }; - + + // Makarov PM class hgun_Pistol_01_F: Pistol_Base_F { - initSpeed = -0.974359; + initSpeed = -0.883721; ACE_barrelTwist = 254.0; ACE_barrelLength = 93.5; }; - - class pdw2000_base_F: Rifle_Short_Base_F { - initSpeed = -1.09615; + + class pdw2000_base_F: Rifle_Short_Base_F {}; + + // CPW + class hgun_PDW2000_F: pdw2000_base_F { + initSpeed = -0.994186; ACE_barrelTwist = 228.6; ACE_barrelLength = 177.8; }; - /* Rifles */ + // AKS class arifle_AKS_base_F: Rifle_Base_F { initSpeed = -1.0; ACE_barrelTwist = 160.02; ACE_barrelLength = 206.5; }; + + // AKM class arifle_AKM_base_F: Rifle_Base_F { - initSpeed = -1.0014; + initSpeed = -1.0; ACE_barrelTwist = 199.898; ACE_barrelLength = 414.02; }; + + // AK12 class arifle_AK12_base_F: Rifle_Base_F { - initSpeed = -1.0014; + initSpeed = -1.0; ACE_barrelTwist = 199.898; ACE_barrelLength = 414.02; }; + + // QBZ-95-1 class arifle_CTAR_base_F: Rifle_Base_F { + initSpeed = -0.978947; + ACE_barrelTwist = 244.0; + ACE_barrelLength = 463.0; + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(1.12); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(1.12); + }; + }; + + // QBU-88 + class DMR_07_base_F: Rifle_Long_Base_F { + initSpeed = -0.99998; + 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 Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(1.01); + }; + }; + + // QBZ-95-1 LSW + class arifle_CTARS_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 Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(1.12); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(1.12); + }; }; + + // Type 115 class arifle_ARX_base_F: Rifle_Base_F { - initSpeed = -1.02052; + initSpeed = -0.984262; ACE_barrelTwist = 228.6; ACE_barrelLength = 463.0; + class Single: Mode_SemiAuto { + dispersion = MOA_TO_RAD(0.90); + }; + + class FullAuto: Mode_FullAuto { + dispersion = MOA_TO_RAD(0.90); + }; }; + + // KH2002 Sama class arifle_Katiba_F: arifle_katiba_Base_F { magazines[] = { "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green_mag_Tracer", "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" }; - initSpeed = -1.08355; + initSpeed = -1.0; ACE_barrelTwist = 203.2; ACE_barrelLength = 508.0; }; + + // KH2002C Sama class arifle_Katiba_C_F: arifle_katiba_Base_F { magazines[] = { "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green_mag_Tracer", "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" }; - initSpeed = -1.07105; + initSpeed = -0.961294; ACE_barrelTwist = 203.2; ACE_barrelLength = 393.7; + class Single: Single { + dispersion = MOA_TO_RAD(0.90); + }; + + class FullAuto: FullAuto { + dispersion = MOA_TO_RAD(0.90); + }; }; + + // KH2002 Sama KGL class arifle_Katiba_GL_F: arifle_katiba_Base_F { magazines[] = { "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green_mag_Tracer", "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" }; - initSpeed = -1.08355; + initSpeed = -1.0; ACE_barrelTwist = 203.2; ACE_barrelLength = 508.0; }; + + // MX class arifle_MX_F: arifle_MX_Base_F { magazines[] = { "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag_Tracer", "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; - initSpeed = -0.990132; + initSpeed = -0.972222; ACE_barrelTwist = 228.6; ACE_barrelLength = 368.3; }; + + // MX 3GL class arifle_MX_GL_F: arifle_MX_Base_F { magazines[] = { "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag_Tracer", "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; - initSpeed = -0.99; + initSpeed = -0.972222; ACE_barrelTwist = 228.6; ACE_barrelLength = 368.3; }; - /* - class arifle_MX_SW_F: arifle_MX_Base_F { - ACE_barrelTwist=228.6; - ACE_barrelLength=406.4; - }; - */ + + // MXC class arifle_MXC_F: arifle_MX_Base_F { magazines[] = { "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag_Tracer", "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; - initSpeed = -0.963816; + initSpeed = -0.946382; ACE_barrelTwist = 203.2; ACE_barrelLength = 266.7; + class Single: Single { + dispersion = MOA_TO_RAD(0.90); + }; + + class FullAuto: FullAuto { + dispersion = MOA_TO_RAD(0.90); + }; }; - /* - class arifle_MXM_F: arifle_MX_Base_F { - ACE_barrelTwist=228.6; - ACE_barrelLength=457.2; - }; - */ + + // RFB SDAR class arifle_SDAR_F: SDAR_base_F { magazines[] = { "20Rnd_556x45_UW_mag", @@ -382,20 +520,28 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.989; + initSpeed = -0.998321; ACE_barrelTwist = 285.75; ACE_barrelLength = 457.2; }; - class SMG_02_base_F: Rifle_Short_Base_F { - initSpeed = -1.10288; + + class SMG_02_base_F: Rifle_Short_Base_F {}; + + // Scorpion Evo 3 A1 + class SMG_02_F: SMG_02_base_F { + initSpeed = -1.00029; ACE_barrelTwist = 254.0; ACE_barrelLength = 195.58; }; + + // MP5K class SMG_05_base_F: Rifle_Short_Base_F { - initSpeed = -1.04058; + initSpeed = -0.943783; ACE_barrelTwist = 254.0; ACE_barrelLength = 115.0; }; + + // CTAR-21 class arifle_TRG20_F: Tavor_base_F { magazines[] = { "30Rnd_556x45_Stanag", @@ -409,10 +555,12 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.95; + initSpeed = -0.961496; ACE_barrelTwist = 177.8; ACE_barrelLength = 381.0; }; + + // TAR-21 class arifle_TRG21_F: Tavor_base_F { magazines[] = { "30Rnd_556x45_Stanag", @@ -426,10 +574,19 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.988043; + initSpeed = -1.0; ACE_barrelTwist = 177.8; ACE_barrelLength = 459.74; + class Single: Single { + dispersion = MOA_TO_RAD(1.12); + }; + + class FullAuto: FullAuto { + dispersion = MOA_TO_RAD(1.12); + }; }; + + // TAR-21 EGLM class arifle_TRG21_GL_F: arifle_TRG21_F { magazines[] = { "30Rnd_556x45_Stanag", @@ -443,16 +600,12 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.988043; + initSpeed = -1.0; ACE_barrelTwist = 177.8; ACE_barrelLength = 459.74; }; - /* - class LMG_Zafir_F: Rifle_Long_Base_F { - ACE_barrelTwist=304.8; - ACE_barrelLength=459.74; - }; - */ + + // F2000 class arifle_Mk20_F: mk20_base_F { magazines[] = { "30Rnd_556x45_Stanag", @@ -466,10 +619,12 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.980978; + initSpeed = -0.992849; ACE_barrelTwist = 177.8; ACE_barrelLength = 441.96; }; + + // F2000 Tactical class arifle_Mk20C_F: mk20_base_F { magazines[] = { "30Rnd_556x45_Stanag", @@ -483,10 +638,19 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.962648; + initSpeed = -0.974297; ACE_barrelTwist = 177.8; ACE_barrelLength = 406.4; + class Single: Single { + dispersion = MOA_TO_RAD(1.12); + }; + + class FullAuto: FullAuto { + dispersion = MOA_TO_RAD(1.12); + }; }; + + // F2000 EGLM class arifle_Mk20_GL_F: mk20_base_F { magazines[] = { "30Rnd_556x45_Stanag", @@ -500,24 +664,32 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.962648; + initSpeed = -0.974297; ACE_barrelTwist = 177.8; ACE_barrelLength = 406.4; }; - class SMG_01_Base: Rifle_Short_Base_F { - initSpeed = -1.0175; + + class SMG_01_Base: Rifle_Short_Base_F {}; + + // Vector SMG + class SMG_01_F: SMG_01_Base { + initSpeed = -1.00148; ACE_barrelTwist = 406.4; ACE_barrelLength = 139.7; }; + + // VS-121 class srifle_DMR_01_F: DMR_01_base_F { magazines[] = { "10Rnd_762x54_Mag", "ACE_10Rnd_762x54_Tracer_mag" }; - initSpeed = -1.025; + initSpeed = -1.00019; ACE_barrelTwist = 241.3; ACE_barrelLength = 609.6; }; + + // Mk14 Mod 1 EBR class srifle_EBR_F: EBR_base_F { magazines[] = { "20Rnd_762x51_Mag", @@ -529,17 +701,12 @@ class CfgWeapons { "ACE_20Rnd_762x51_M993_AP_Mag", "ACE_20Rnd_762x51_Mag_SD" }; - initSpeed = -0.972389; + initSpeed = -0.979444; ACE_barrelTwist = 304.8; ACE_barrelLength = 457.2; }; - /* - class LMG_Mk200_F: Rifle_Long_Base_F { - initSpeed = -1.0; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; - }; - */ + + // M200 Intervention class srifle_LRR_F: LRR_base_F { magazines[] = { "7Rnd_408_Mag", @@ -549,6 +716,8 @@ class CfgWeapons { ACE_barrelTwist = 330.2; ACE_barrelLength = 736.6; }; + + // GM6 Lynx class srifle_GM6_F: GM6_base_F { magazines[] = { "5Rnd_127x108_Mag", @@ -561,6 +730,8 @@ class CfgWeapons { ACE_barrelTwist = 381.0; ACE_barrelLength = 730; }; + + // Noreen "Bad News" ULR class srifle_DMR_02_F: DMR_02_base_F { magazines[] = { "10Rnd_338_Mag", @@ -570,10 +741,12 @@ class CfgWeapons { "ACE_20Rnd_762x67_Mk248_Mod_1_Mag", "ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag" }; - initSpeed = -0.961749; + initSpeed = -1.0; ACE_barrelTwist = 254.0; ACE_barrelLength = 508.0; }; + + // SIG 556 class srifle_DMR_03_F: DMR_03_base_F { magazines[] = { "20Rnd_762x51_Mag", @@ -585,20 +758,26 @@ class CfgWeapons { "ACE_20Rnd_762x51_M993_AP_Mag", "ACE_20Rnd_762x51_Mag_SD" }; - initSpeed = -0.984394; + initSpeed = -0.991536; ACE_barrelTwist = 254.0; ACE_barrelLength = 508.0; }; + + // ASP-1 Kir class srifle_DMR_04_F: DMR_04_base_F { initSpeed = -1.0; ACE_barrelTwist = 203.2; ACE_barrelLength = 450.088; }; + + // Cyrus class srifle_DMR_05_blk_F: DMR_05_base_F { initSpeed = -1.0; ACE_barrelTwist = 359.918; ACE_barrelLength = 620.014; }; + + // M14 class srifle_DMR_06_camo_F: DMR_06_base_F { magazines[] = { "20Rnd_762x51_Mag", @@ -610,15 +789,19 @@ class CfgWeapons { "ACE_20Rnd_762x51_M993_AP_Mag", "ACE_20Rnd_762x51_Mag_SD" }; - initSpeed = -0.992197; + initSpeed = -0.999395; ACE_barrelTwist = 304.8; ACE_barrelLength = 558.8; }; + + // HK121 class MMG_01_hex_F: MMG_01_base_F { - initSpeed = -0.997073; + initSpeed = -0.985613; ACE_barrelTwist = 359.918; ACE_barrelLength = 549.91; }; + + // LWMMG class MMG_02_camo_F: MMG_02_base_F { initSpeed = -1.0; ACE_barrelTwist = 234.95; diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index f5bcbb758a..d8c09cbaeb 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -15,6 +15,8 @@ 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 @@ -29,6 +31,8 @@ 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 @@ -43,6 +47,8 @@ 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 @@ -57,6 +63,8 @@ 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 @@ -71,6 +79,8 @@ 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 @@ -85,6 +95,8 @@ 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 @@ -100,6 +112,8 @@ Магазин из 30-ти 6,5 мм ИК-трассирующих 6.5mm 30発入り IR-DIM曳光弾 弾倉 30발들이 6.5mm IR-DIM 예광탄 탄창 + 6.5mm 30發 低視度紅外線曳光彈 彈匣 + 6.5mm 30发 低视度红外线曳光弹 弹匣 6.5mm IR-DIM @@ -114,6 +128,8 @@ 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 @@ -128,6 +144,8 @@ Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: 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 @@ -142,6 +160,8 @@ Магазин из 30-ти 6,5 мм дозвуковых 6.5mm 30発入り 亜音速弾 弾倉 30발들이 6.5mm 아음속탄 탄창 + 6.5mm 30發 消音彈 彈匣 + 6.5mm 30发 消音弹 弹匣 6.5mm SD @@ -156,6 +176,8 @@ 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 @@ -170,6 +192,8 @@ Калибр: 6,5x39 мм дозвуковые<br />Патронов: 30<br />Используются с: 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 @@ -184,6 +208,8 @@ Магазин из 30-ти 6,5 мм бронебойных 6.5mm 30 発入り徹甲弾 弾倉 30발들이 6.5mm 철갑탄 탄창 + 6.5mm 30發 穿甲彈 彈匣 + 6.5mm 30发 穿甲弹 弹匣 6.5mm AP @@ -198,6 +224,8 @@ 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 @@ -212,6 +240,8 @@ Калибр: 6,5x39 мм бронебойные<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 + 口径: 6.5x39mm 穿甲弹<br />发数: 30<br />使用于: MX/C/M/SW/3GL @@ -227,6 +257,8 @@ Магазин из 30-ти 6,5 мм ИК-трассирующих 6.5mm 30発入り IR-DIM曳光弾 弾倉 30발들이 6.5mm IR-DIM 예광탄 탄창 + 6.5mm 30發 低視度紅外線曳光彈 彈匣 + 6.5mm 30发 低视度红外线曳光弹 弹匣 6.5mm IR-DIM @@ -241,6 +273,8 @@ 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 @@ -255,6 +289,8 @@ Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: 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 @@ -269,6 +305,8 @@ Магазин из 30-ти 6,5 мм дозвуковых 6.5mm 30発入り 亜音速弾 弾倉 30발들이 6.5mm 아음속탄 탄창 + 6.5mm 30發 消音彈 彈匣 + 6.5mm 30发 消音弹 弹匣 6.5mm SD @@ -283,6 +321,8 @@ 6,5 мм дозвуковые 6.5mm 亜音速弾 6.5mm 아음속탄 + 6.5mm 消音彈 + 6.5mm 消音弹 Caliber: 6.5x39mm SD<br />Rounds: 30<br />Used in: Katiba @@ -297,6 +337,8 @@ Калибр: 6,5x39 мм дозвуковые<br />Патронов: 30<br />Используются с: 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 @@ -311,6 +353,8 @@ Магазин из 30-ти 6,5 мм бронебойных 6.5mm 30 発入り徹甲弾 弾倉 30발들이 6.5mm 철갑탄 탄창 + 6.5mm 30發 穿甲彈 彈匣 + 6.5mm 30发 穿甲弹 弹匣 6.5mm AP @@ -325,6 +369,8 @@ 6,5 мм бронебойные 6.5mm 徹甲弾 6.5mm 철갑탄 + 6.5mm 穿甲彈 + 6.5mm 穿甲弹 Caliber: 6.5x39mm AP<br />Rounds: 30<br />Used in: Katiba @@ -339,6 +385,8 @@ Калибр: 6,5x39 мм бронебойные<br />Патронов: 30<br />Используются с: 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 @@ -354,6 +402,8 @@ Магазин из 30-ти 5,56 мм ИК-трассирующих 5.56mm 30発入り IR-DIM曳光弾 弾倉 30발 들이 5.56mm IR-DIM 예광탄 탄창 + 5.56mm 30發 低視度紅外線曳光彈 彈匣 + 5.56mm 30发 低视度红外线曳光弹 弹匣 5.56mm IR-DIM @@ -368,6 +418,8 @@ 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 @@ -382,6 +434,8 @@ Калибр: 5,56x45 мм ИК-трассирующие<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 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 @@ -397,6 +451,8 @@ Магазин из 20-ти 7,62 мм трассирующих 7.62mm 20発入り 曳光弾 20발들이 7.62mm 예광탄 탄창 + 7.62mm 20發 曳光彈 彈匣 + 7.62mm 20发 曳光弹 弹匣 7.62mm Tracer @@ -411,6 +467,8 @@ 7,62 мм трассирущие 7.62mm 曳光弾 7.62mm 예광탄 + 7.62mm 曳光彈 + 7.62mm 曳光弹 Caliber: 7.62x51mm Tracer<br />Rounds: 20<br />Used in: Mk18 ABR @@ -425,6 +483,8 @@ Калибр: 7,62x51 мм трассирующие<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.62x51mm 曳光弹<br />发数: 20<br />使用于: Mk18 ABR 7.62mm 20rnd Tracer IR-DIM Mag @@ -439,6 +499,8 @@ Магазин из 20-ти 7,62 мм ИК-трассирующих 7.62mm 20発入り IR-DIM曳光弾 20발들이 7.62mm IR-DIM 예광탄 탄창 + 7.62mm 20發 低視度紅外線曳光彈 彈匣 + 7.62mm 20发 低视度红外线曳光弹 弹匣 7.62mm IR-DIM @@ -453,6 +515,8 @@ 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 @@ -467,6 +531,8 @@ Калибр: 7,62x51 мм ИК-трассирующие<br />Патронов: 20<br />Используются с: 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 @@ -481,6 +547,8 @@ Магазин из 20-ти 7,62 мм дозвуковых 7.62mm 20発入り 亜音速弾 弾倉 20발들이 7.62mm 아음속탄 탄창 + 7.62mm 20發 消音彈 彈匣 + 7.62mm 20发 消音弹 弹匣 7.62mm SD @@ -495,6 +563,8 @@ 7,62 мм дозвуковые 7.62mm 亜音速弾 7.62mm 아음속탄 + 7.62mm 消音彈 + 7.62mm 消音弹 Caliber: 7.62x51mm SD<br />Rounds: 20<br />Used in: Mk18 ABR @@ -509,6 +579,8 @@ Калибр: 7,62x51 мм дозвуковые<br />Патронов: 20<br />Используются с: 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 @@ -524,6 +596,8 @@ .338 NM 130-lövedékes nyomkövető heveder .338 NM 130発入り 曳光弾ベルト 130발들이 .338 NM 예광탄 벨트 + .338 NM 130發 曳光彈 彈鏈 + .338 NM 130发 曳光弹 弹链 .338 NM Tracer @@ -538,6 +612,8 @@ .338 NM nyomkövető .338 NM 曳光弾 .338 NM 예광탄 + .338 NM 曳光彈 + .338 NM 曳光弹 Caliber: .338 Norma Magnum Tracer<br />Rounds: 130<br />Used in: SPMG @@ -552,6 +628,8 @@ Kaliber: .338 Norma Magnum nyomkövető<br />Lövedékek: 130<br />Használható: 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 @@ -566,6 +644,8 @@ .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 @@ -580,6 +660,8 @@ .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 @@ -594,6 +676,8 @@ Kaliber: .338 Norma Magnum infravörös nyomkövető<br />Lövedékek: 130<br />Használható: 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 @@ -608,6 +692,8 @@ .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 @@ -622,6 +708,8 @@ .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 @@ -636,6 +724,8 @@ Kaliber: .338 Norma Magnum páncéltörő<br />Lövedékek: 130<br />Használható: 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 @@ -651,6 +741,8 @@ 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 @@ -665,6 +757,8 @@ 9,3mm nyomkövető 9.3mm 曳光弾 9.3mm 예광탄 + 9.3mm 曳光彈 + 9.3mm 曳光弹 Caliber: 9.3x64mm Tracer<br />Rounds: 10<br />Used in: Cyrus @@ -679,6 +773,8 @@ Kaliber: 9,3x64mm nyomkövető<br />Lövedékek: 10<br />Használható: 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 @@ -693,6 +789,8 @@ 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 @@ -707,6 +805,8 @@ 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 @@ -721,6 +821,8 @@ Kaliber: 9,3x64mm infravörös nyomkövető<br />Lövedékek: 10<br /> Használható: 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 @@ -736,6 +838,8 @@ 9,3mm 150-lövedékes nyomkövető heveder 9.3mm 150発入り 曳光弾ベルト 150발들이 9.3mm 예광탄 벨트 + 9.3mm 150發 曳光彈 彈鏈 + 9.3mm 150发 曳光弹 弹链 9.3mm Tracer @@ -750,6 +854,8 @@ 9,3mm nyomkövető 9.3mm 曳光弾 9.3mm 예광탄 + 9.3mm 曳光彈 + 9.3mm 曳光弹 Caliber: 9.3x64mm Tracer<br />Rounds: 150<br />Used in: Navid @@ -764,6 +870,8 @@ Kaliber: 9,3x64mm nyomkövető<br />Lövedékek: 150<br />Használható: 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 @@ -778,6 +886,8 @@ 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 @@ -792,6 +902,8 @@ 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 @@ -806,6 +918,8 @@ Kaliber: 9,3x64mm infravörös nyomkövető<br />Lövedékek: 150<br />Használható: 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 @@ -820,6 +934,8 @@ 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 @@ -834,6 +950,8 @@ 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 @@ -848,6 +966,8 @@ Kaliber: 9,3x64mm páncéltörő<br />Lövedékek: 150<br />Használható: 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 @@ -862,6 +982,8 @@ 9x19mm 16-lövedékes tár 9x19mm 16発入り 弾倉 16발들이 9x19mm 탄창 + 9x19mm 16發 彈匣 + 9x19mm 16发 弹匣 9x19mm @@ -876,6 +998,8 @@ 9x19mm 9x19mm 9x19mm + 9x19mm + 9x19mm 9x19mm 30Rnd Mag @@ -890,6 +1014,8 @@ 9x19mm 16-lövedékes tár 9x19mm 30発入り 弾倉 30발들이 9x19mm 탄창 + 9x19mm 30發 彈匣 + 9x19mm 30发 弹匣 9x19mm 30Rnd Mag @@ -904,6 +1030,8 @@ 9x19mm 30-lövedékes tár 9x19mm 30発入り 弾倉 30발들이 9x19mm 탄창 + 9x19mm 30發 彈匣 + 9x19mm 30发 弹匣 9x19mm @@ -918,6 +1046,8 @@ 9x19mm 9x19mm 9x19mm + 9x19mm + 9x19mm 9x19mm 30Rnd Mag @@ -932,6 +1062,8 @@ 9x19mm 30-lövedékes tár 9x19mm 30発入り 弾倉 30발들이 9x19mm 탄창 + 9x19mm 30發 彈匣 + 9x19mm 30发 弹匣 7.62x54mm 10Rnd Tracer Mag @@ -946,6 +1078,8 @@ 7,62x54mm 10-lövedékes nyomkövető tár 7.62x54mm 10発入り 曳光弾 弾倉 10발들이 7.62x54mm 예광탄 탄창 + 7.62x54mm 10發 曳光彈 彈匣 + 7.62x54mm 10发 曳光弹 弹匣 7.62mm @@ -960,6 +1094,8 @@ 7,62mm 7.62mm 7.62mm + 7.62mm + 7.62mm 7.62x54mm 10Rnd Tracer Mag @@ -974,6 +1110,8 @@ 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 @@ -988,6 +1126,8 @@ 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 @@ -1002,6 +1142,8 @@ 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 @@ -1016,6 +1158,8 @@ 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曳光弾 弾倉<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 @@ -1030,6 +1174,8 @@ 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 @@ -1044,6 +1190,8 @@ 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 @@ -1058,6 +1206,8 @@ 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曳光弾ベルト<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) @@ -1072,6 +1222,8 @@ 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 @@ -1086,6 +1238,8 @@ 5,56mm Mk262 5.56mm Mk262 5.56mm Mk262 + 5.56mm Mk262 狙擊專用彈 + 5.56mm Mk262 狙击专用弹 Caliber: 5.56x45mm NATO (Mk262)<br />Rounds: 30 @@ -1100,6 +1254,8 @@ Kaliber: 5,56x45mm NATO (Mk262)<br />Lövedékek: 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) @@ -1114,6 +1270,8 @@ 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 @@ -1128,6 +1286,8 @@ 5,56mm Mk318 5.56mm Mk318 5.56mm Mk318 + 5.56mm Mk318 特戰專用彈 + 5.56mm Mk318 特战专用弹 Caliber: 5.56x45mm NATO (Mk318)<br />Rounds: 30 @@ -1142,6 +1302,8 @@ Kaliber: 5,56x45mm NATO (Mk318)<br />Lövedékek: 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) @@ -1156,6 +1318,8 @@ 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 @@ -1170,6 +1334,8 @@ 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 @@ -1184,6 +1350,8 @@ Kaliber: 5,56x45mm NATO (M995 páncéltörő)<br />Lövedékek: 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) @@ -1198,6 +1366,8 @@ 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 @@ -1212,6 +1382,8 @@ 7,62mm M118LR 7.62mm M118LR 7.62mm M118LR + 7.62mm M118LR 狙擊專用彈 + 7.62mm M118LR 狙击专用弹 Caliber: 7.62x51mm NATO (M118LR)<br />Rounds: 10 @@ -1226,6 +1398,8 @@ Kaliber: 7,62x51mm NATO (M118LR)<br />Lövedékek: 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) @@ -1240,6 +1414,8 @@ 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 @@ -1254,6 +1430,8 @@ 7,62mm M118LR 7.62mm M118LR 7.62mm M118LR + 7.62mm M118LR 狙擊專用彈 + 7.62mm M118LR 狙击专用弹 Caliber: 7.62x51mm NATO (M118LR)<br />Rounds: 20 @@ -1268,6 +1446,8 @@ Kaliber: 7,62x51mm NATO (M118LR)<br />Lövedékek: 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) @@ -1282,6 +1462,8 @@ 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 @@ -1296,6 +1478,8 @@ 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 @@ -1310,6 +1494,8 @@ Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Lövedékek: 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) @@ -1324,6 +1510,8 @@ 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 @@ -1338,6 +1526,8 @@ 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 @@ -1352,6 +1542,8 @@ Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Lövedékek: 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) @@ -1366,6 +1558,8 @@ 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 @@ -1380,6 +1574,8 @@ 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 @@ -1394,6 +1590,8 @@ Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Lövedékek: 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) @@ -1408,6 +1606,8 @@ 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 @@ -1422,6 +1622,8 @@ 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 @@ -1436,6 +1638,8 @@ Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Lövedékek: 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) @@ -1450,6 +1654,8 @@ 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 @@ -1464,6 +1670,8 @@ 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 @@ -1478,6 +1686,8 @@ Kaliber: 7,62x51mm NATO (M993 páncéltörő)<br />Lövedékek: 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) @@ -1492,6 +1702,8 @@ 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 @@ -1506,6 +1718,8 @@ 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 @@ -1520,6 +1734,8 @@ Kaliber: 7,62x51mm NATO (M993 páncéltörő)<br />Lövedékek: 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) @@ -1534,6 +1750,8 @@ 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 @@ -1548,6 +1766,8 @@ 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 @@ -1562,6 +1782,8 @@ Kaliber: 7,62x51mm NATO (Mk248 Mod 0)<br />Lövedékek: 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) @@ -1576,6 +1798,8 @@ 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 @@ -1590,6 +1814,8 @@ 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 @@ -1604,6 +1830,8 @@ Kaliber: 7,62x51mm NATO (Mk248 Mod 1)<br />Lövedékek: 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) @@ -1618,6 +1846,8 @@ 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 @@ -1632,6 +1862,8 @@ 7,62mm OTM 7.62mm OTM 7.62mm OTM + 7.62mm 空尖比賽專用彈 + 7.62mm 空尖比赛专用弹 Caliber: 7.62x67mm NATO (Berger Hybrid OTM)<br />Rounds: 20 @@ -1646,6 +1878,8 @@ Kaliber: 7,62x67mm NATO (Berger Hybrid OTM)<br />Lövedékek: 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) @@ -1660,6 +1894,8 @@ 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 @@ -1674,6 +1910,8 @@ 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 @@ -1688,6 +1926,8 @@ Kaliber: 6,5x47mm (HPBT Scenar)<br />Lövedékek: 30<br />Használható: 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 @@ -1702,6 +1942,8 @@ 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 @@ -1716,6 +1958,8 @@ 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 @@ -1730,48 +1974,54 @@ Kaliber: 6,5x47mm Creedmor<br />Lövedékek: 30<br />Használható: 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) - Ch. .338 10 Cps (300gr Sierra MatchKing HPBT) - Cargador de 10 balas de 8.6x70mm (300gr Sierra MatchKing HPBT) - Magazynek .338 10rd (300gr Sierra MatchKing HPBT) - Магазин из 10-ти .338 (300 гран Sierra MatchKing экспансивные) - .338 10-Patronen-Magazin (300gr Sierra MatchKing HPBT) - .338 10Munizioni Mag (300gr Sierra MatchKing HPBT) - .338 10náb. Zásobník (300gr Sierra MatchKing HPBT) - 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 10Rnd Mag (300gr Lapua Scenar) + Ch. .338 10 Cps (300gr Lapua Scenar) + Cargador de 10 balas de 8.6x70mm (300gr Lapua Scenar) + Magazynek .338 10rd (300gr Lapua Scenar) + Магазин из 10-ти .338 (300 гран Lapua Scenar) + .338 10-Patronen-Magazin (300gr Lapua Scenar) + .338 10Munizioni Mag (300gr Lapua Scenar) + .338 10náb. Zásobník (300gr Lapua Scenar) + Carregador .338 (300gr Lapua Scenar) com 10 cartuchos + .338 10-lövedékes tár (300gr Lapua Scenar) + .338 10発入り 弾倉 (300gr Lapua Scenar) + 10발들이 .338 탄창 (300gr Lapua Scenar) + .338 10發 彈匣 (300公克 Lapua Scenar) + .338 10发 弹匣 (300公克 Lapua Scenar) - .338 HPBT - .338 HPBT - .338 HPBT - .338 HPBT - .338 экспансивные - .338 HPBT - .338 HPBT - .338 HPBT - .338 HPBT - .338 HPBT - 338 HPBT - .338 HPBT + .338 Scenar + .338 Scenar + .338 Scenar + .338 Scenar + .338 Scenar + .338 Scenar + .338 Scenar + .338 Scenar + .338 Scenar + .338 Scenar + 338 Scenar + .338 Scenar - 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 />Balas: 10 - Kaliber: 8,6x70mm (300gr Sierra MatchKing HPBT)<br />Pociski: 10 - Калибр: 8,6x70mm (300 гран Sierra MatchKing экспансивные)<br />Патронов: 10 - Kaliber: 8,6x70mm (300gr Sierra MatchKing HPBT)<br />Patronen: 10 - Calibro: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Munizioni: 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)<br />装填数: 10 - 구경: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />장탄수: 10 + Caliber: 8.6x70mm (300gr Lapua Scenar)<br />Rounds: 10 + Calibre: 8,6x70mm (300gr Lapua Scenar)<br />Cartouches: 10 + Calibre: 8.6x70mm (300gr Lapua Scenar)<br />Balas: 10 + Kaliber: 8,6x70mm (300gr Lapua Scenar)<br />Pociski: 10 + Калибр: 8,6x70mm (300 гран Lapua Scenar)<br />Патронов: 10 + Kaliber: 8,6x70mm (300gr Lapua Scenar)<br />Patronen: 10 + Calibro: 8.6x70mm (300gr Lapua Scenar)<br />Munizioni: 10 + Ráže: 8.6x70mm (300gr Lapua Scenar)<br />Nábojů: 10 + Calibre: 8.6x70mm (300gr Lapua Scenar)<br/>Cartuchos: 10 + Kaliber: 8,6x70mm (300gr Lapua Scenar)<br />Lövedékek: 10 + 口径: 8.6x70mm (300gr Lapua Scenar)<br />装填数: 10 + 구경: 8.6x70mm (300gr Lapua Scenar)<br />장탄수: 10 + 口徑: 8.6x70mm (300公克 Lapua Scenar)<br />發數: 10 + 口径: 8.6x70mm (300公克 Lapua Scenar)<br />发数: 10 .338 10Rnd Mag (API526) @@ -1786,6 +2036,8 @@ .338 10-lövedékes tár (API526) .338 10発入り 弾倉 (API526) 10발들이 .338 탄창 (API526) + .338 10發 彈匣 (API526 穿甲燃燒彈) + .338 10发 弹匣 (API526 穿甲燃烧弹) .338 AP @@ -1800,6 +2052,8 @@ .338 páncéltörő .338 徹甲弾 .338 철갑탄 + .338 API526 穿甲燃燒彈 + .338 API526 穿甲燃烧弹 Caliber: 8.6x70mm (API526)<br />Rounds: 10 @@ -1814,6 +2068,8 @@ Kaliber: 8,6x70mm (API526)<br />Lövedékek: 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) @@ -1828,6 +2084,8 @@ .408 7-lövedékes tár (305gr) .408 7発入り 弾倉 (305gr) 7발들이 .408 탄창 (305gr) + .408 7發 彈匣 (305公克) + .408 7发 弹匣 (305公克) .408 @@ -1842,6 +2100,8 @@ .408 .408 .408 + .408 + .408 Caliber: .408 CheyTac (305gr)<br />Rounds: 7 @@ -1856,6 +2116,8 @@ 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 @@ -1870,6 +2132,8 @@ 12,7x99mm 5-lövedékes tár 12.7x99mm 5発入り 弾倉 5발들이 12.7x99mm 탄창 + 12.7x99mm 5發 彈匣 + 12.7x99mm 5发 弹匣 12.7mm @@ -1884,6 +2148,8 @@ 12,7mm 12.7mm 12.7mm + 12.7mm + 12.7mm Caliber: 12.7x99mm<br />Rounds: 5 @@ -1898,6 +2164,8 @@ Kaliber: 12,7x99mm<br />Lövedékek: 5 口径: 12.7x99mm<br />装填数: 5 구경: 12.7x99mm<br />장탄수: 5 + 口徑: 12.7x99mm<br />發數: 5 + 口径: 12.7x99mm<br />发数: 5 12.7x99mm API 5Rnd Mag @@ -1912,6 +2180,8 @@ 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 @@ -1926,6 +2196,8 @@ 12,7mm páncéltörő-gyújtó 12.7mm 焼夷徹甲弾 12.7mm 철갑소이탄 + 12.7mm 穿甲燃燒彈 + 12.7mm 穿甲燃烧弹 Caliber: 12.7x99mm API<br />Rounds: 5 @@ -1940,6 +2212,8 @@ Kaliber: 12,7x99mm API<br />Lövedékek: 5 口径: 12.7x99mm 焼夷徹甲弾<br />装填数: 5 구경: 12.7x99mm 철갑소이탄<br />장탄수: 5 + 口徑: 12.7x99mm 穿甲燃燒彈<br />發數: 5 + 口径: 12.7x99mm 穿甲燃烧弹<br />发数: 5 12.7x99mm 5Rnd Mag (AMAX) @@ -1954,6 +2228,8 @@ 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 @@ -1968,6 +2244,8 @@ 12,7mm 12.7mm 12.7mm + 12.7mm AMAX 比賽專用彈 + 12.7mm AMAX 比赛专用弹 Caliber: 12.7x99mm (AMAX)<br />Rounds: 5 @@ -1982,6 +2260,8 @@ Kaliber: 12,7x99mm (AMAX)<br />Lövedékek: 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 @@ -1996,6 +2276,8 @@ [ACE] Cassa munizioni [ACE] 弾薬物資箱 [ACE] 탄약 보급 상자 + [ACE] 彈藥補給箱 + [ACE] 弹药补给箱 diff --git a/addons/captives/ACE_Settings.hpp b/addons/captives/ACE_Settings.hpp index 1d0ebbf491..50d4c17aa7 100644 --- a/addons/captives/ACE_Settings.hpp +++ b/addons/captives/ACE_Settings.hpp @@ -1,11 +1,13 @@ class ACE_Settings { class GVAR(allowHandcuffOwnSide) { + category = CSTRING(DisplayName); displayName = CSTRING(ModuleSettings_handcuffSide_name); description = CSTRING(ModuleSettings_handcuffSide_description); typeName = "BOOL"; value = 1; }; class GVAR(requireSurrender) { + category = CSTRING(DisplayName); displayName = CSTRING(ModuleSettings_requireSurrender_name); description = CSTRING(ModuleSettings_requireSurrender_description); typeName = "SCALAR"; @@ -13,9 +15,17 @@ class ACE_Settings { value = 1; }; class GVAR(allowSurrender) { + category = CSTRING(DisplayName); displayName = CSTRING(ModuleSettings_allowSurrender_name); description = CSTRING(ModuleSettings_allowSurrender_description); typeName = "BOOL"; value = 1; }; + class GVAR(requireSurrenderAi) { + category = CSTRING(DisplayName); + 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..8fdb45396e 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; \ }; \ }; \ @@ -151,7 +152,7 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(ModuleSurrender_DisplayName); function = QFUNC(moduleSurrender); - scope = 2; //show in editor + scope = 1; //show in editor isGlobal = 0; //run on server isTriggerActivated = 1; //Wait for triggers icon = QPATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa); @@ -167,7 +168,7 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(ModuleHandcuffed_DisplayName); function = QFUNC(moduleHandcuffed); - scope = 2; //show in editor + scope = 1; //show in editor isGlobal = 0; //run on server isTriggerActivated = 1; //Wait for triggers icon = QPATHTOF(UI\Icon_Module_Make_Unit_Handcuffed_ca.paa); @@ -185,7 +186,7 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(ModuleSettings_DisplayName); function = QFUNC(moduleSettings); - scope = 2; + scope = 1; icon = QPATHTOF(UI\Icon_Module_settings_ca.paa); isGlobal = 1; isSingular = 1; @@ -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..34f7b59e10 100644 --- a/addons/captives/CfgWeapons.hpp +++ b/addons/captives/CfgWeapons.hpp @@ -1,14 +1,15 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_CableTie: ACE_ItemCore { + author = ECSTRING(common,ACETeam); displayName = CSTRING(CableTie); descriptionShort = CSTRING(CableTieDescription); 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..70d708ced2 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,22 @@ if (isServer) then { if (!hasInterface) exitWith {}; -["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); +["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") exitWith {false}; + if ((_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/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 ad57dabcd7..b17a48f7b8 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -32,7 +32,7 @@ if (_state) then { //Add Actionmenu to release captive 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)))]; + nil, 20, false, true, "", QUOTE(!isNull GETVAR(_target,QGVAR(escortedUnit),objNull))]; [{ params ["_args", "_pfID"]; 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 c876a4f364..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 */ 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_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 0181640a28..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 {}; 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 f54f53e48e..5e05def185 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -1,6 +1,14 @@ - + + + Captives + Gefangene + Prigionieri + 俘虜 + 俘虏 + 捕虜 + Take Prisoner Gefangen nehmen @@ -13,7 +21,9 @@ Foglyul ejtés Взять в плен 捕虜にする - 사로잡기 + 포박하기 + 逮捕俘虜 + 逮捕俘虏 Free Prisoner @@ -28,6 +38,8 @@ Освободить пленника 捕虜を解放する 풀어주기 + 釋放俘虜 + 释放俘虏 Escort Prisoner @@ -42,6 +54,8 @@ Конвоировать пленника 捕虜を移動させる 포로 호송하기 + 護送俘虜 + 护送俘虏 Release Prisoner @@ -56,6 +70,8 @@ Прекратить конвоирование 捕虜を解放する 포로 풀어주기 + 停止護送俘虜 + 停止护送俘虏 You need to take him as prisoner first! @@ -70,6 +86,8 @@ Вы должны сначала взять его в плен! あなたは先に捕虜を取る必要があります。 먼저 포로로 만들어야합니다! + 你必須先逮捕他! + 你必须先逮捕他! Load Captive @@ -84,6 +102,8 @@ Fai salire il prigioniero 捕虜を乗せる 포로 태우기 + 將俘虜放入載具 + 将俘虏放入载具 Unload Captive @@ -98,6 +118,8 @@ Fai scendere il prigioniero 捕虜を降ろす 포로 내리기 + 將俘虜帶出載具 + 将俘虏带出载具 Cable Tie @@ -112,6 +134,8 @@ Кабельная стяжка ケーブル タイ 케이블 타이 + 束線帶 + 束线带 Cable ties that allow you to restrain prisoners. @@ -126,6 +150,8 @@ Кабельные стяжки позволяют связывать пленников. ケーブル タイは捕虜を制圧できます。 케이블 타이는 포로를 구류시킬때 씁니다. + 束線帶可以綁住俘虜 + 束线带可以绑住俘虏 Inventory of frisked person @@ -140,6 +166,8 @@ Inventario della persona perquisita 捕虜の持ち物を確認する 검문당한 사람의 소지품 + 搜身選單 + 搜身选单 Frisk person @@ -154,6 +182,8 @@ Perquisisci la persona 捕虜の持ち物 검문당한사람 + 搜身 + 搜身 Surrender @@ -168,6 +198,8 @@ Arrenditi 投降 투항 + 投降 + 投降 Stop Surrendering @@ -182,6 +214,8 @@ Smetti di arrenderti 投降をやめる 투항하는것을 멈춤 + 停止投降 + 停止投降 Make Unit Surrender @@ -196,6 +230,8 @@ Fai arrendere l'unità ユニットを投降させる 투항시키기 + 使單位投降 + 使单位投降 Sync a unit to make them surrender. @@ -210,6 +246,8 @@ Sincronizza una unità per farla arrendere. 同期されたユニットを投降させます。 투항시키기 위해 동기화합니다. + 同步此模塊到一個單位,使該單位投降 + 同步此模块到一个单位,使该单位投降 Make Unit Handcuffed @@ -222,11 +260,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. Синхронизируйте с юнитами, чтобы сделать их связанными. @@ -236,6 +276,8 @@ Synchronisez une unité pour la rendre captive. 同期されたユニットを拘束させます。 수갑을 채우기 위해 동기화합니다. + 使單位戴上手銬 + 使单位戴上手铐 Captives Settings @@ -249,7 +291,9 @@ Настройки пленения Impostazioni Prigionieri 拘束の設定 - 포로 설정 + 포박 설정 + 俘虜設定 + 俘虏设定 Controls settings for surrender and cable ties @@ -264,6 +308,8 @@ Controlla le impostazioni per la resa e le manette 投降したユニットや拘束されたユニットの扱いを設定します。 투항과 케이블 타이에 관련한 설정 + 定義投降與束帶等設定 + 定义投降与束带等设定 Can handcuff own side @@ -276,22 +322,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 @@ -306,6 +356,8 @@ Permetti Resa 投降を許可 투항 활성화 + 允許投降 + 允许投降 Players can surrender after holstering their weapon @@ -318,8 +370,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 @@ -333,6 +387,8 @@ Requiert la reddition 投降を必要とする 투항 필요 + 要求目標投降 + 要求目标投降 Require Players to surrender before they can be arrested @@ -345,7 +401,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 @@ -359,6 +417,8 @@ Reddition seulement 投降中のみ 투항 중에만 + 只能在投降狀態 + 只能在投降状态 Surrendering or No weapon @@ -372,6 +432,35 @@ 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先行投降 + 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必须先进入投降状态。 + 포박하기 전에 먼저 AI가 투항해야만 합니다. diff --git a/addons/cargo/ACE_Settings.hpp b/addons/cargo/ACE_Settings.hpp index 595de28459..e95465e647 100644 --- a/addons/cargo/ACE_Settings.hpp +++ b/addons/cargo/ACE_Settings.hpp @@ -12,5 +12,6 @@ class ACE_Settings { typeName = "SCALAR"; value = 2.5; category = ECSTRING(OptionsMenu,CategoryLogistics); + sliderSettings[] = {0, 10, 2.5, 1}; }; }; 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 4c4647581e..8588296154 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -8,7 +8,7 @@ class CfgVehicles { }; class ACE_Module: Module_F {}; class ACE_moduleCargoSettings: ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(SettingsModule_DisplayName); icon = QPATHTOF(UI\Icon_Module_Cargo_ca.paa); category = "ACE_Logistics"; @@ -39,32 +39,9 @@ class CfgVehicles { sync[] = {}; }; }; - class GVAR(makeLoadable): ACE_Module { - scope = 2; - displayName = CSTRING(makeLoadable_displayName); - icon = QPATHTOF(UI\Icon_Module_makeLoadable_ca.paa); - category = "ACE_Logistics"; - function = QFUNC(moduleMakeLoadable); - isGlobal = 1; - isTriggerActivated = 0; - author = ECSTRING(common,ACETeam); - class Arguments { - class canLoad { - displayName = CSTRING(makeLoadable_displayName); - description = CSTRING(MakeLoadable_description); - typeName = "BOOL"; - defaultValue = 1; - }; - class setSize { - displayName = CSTRING(makeLoadable_setSize_displayName); - typeName = "NUMBER"; - defaultValue = 1; - }; - }; - class ModuleDescription: ModuleDescription { - description = CSTRING(makeLoadable_description); - sync[] = {"AnyStaticObject"}; - }; + class GVAR(makeLoadable): Logic { + scope = 1; + displayName = "Delete (Deprecated in ACE3 3.12.0)"; }; class LandVehicle; @@ -200,6 +177,11 @@ class CfgVehicles { GVAR(hasCargo) = 1; }; + class ParachuteBase: Helicopter { + GVAR(space) = 0; + GVAR(hasCargo) = 0; + }; + class Helicopter_Base_H; class Heli_Light_01_base_F: Helicopter_Base_H { GVAR(space) = 0; @@ -285,12 +267,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; @@ -327,26 +317,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 @@ -375,8 +345,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 @@ -395,7 +414,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; @@ -403,6 +429,10 @@ 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 { @@ -713,7 +743,7 @@ class CfgVehicles { GVAR(size) = 100; }; - // small + // Small class Land_CargoBox_V1_F: ThingX { class EventHandlers { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; @@ -734,10 +764,55 @@ class CfgVehicles { }; }; }; + class Land_PaperBox_01_small_closed_base_F: Items_base_F { + GVAR(size) = 1; + GVAR(canLoad) = 1; - class Lamps_base_F; - class Land_PortableLight_single_F: Lamps_base_F { + 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_Module_makeLoadable_ca.paa b/addons/cargo/UI/Icon_Module_makeLoadable_ca.paa deleted file mode 100644 index 1577116a66..0000000000 Binary files a/addons/cargo/UI/Icon_Module_makeLoadable_ca.paa and /dev/null differ 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..154956c74a 100644 --- a/addons/cargo/XEH_PREP.hpp +++ b/addons/cargo/XEH_PREP.hpp @@ -1,20 +1,19 @@ - PREP(addCargoItem); -PREP(canLoad); +PREP(addCargoVehiclesActions); PREP(canLoadItemIn); PREP(canUnloadItem); -PREP(findNearestVehicle); PREP(getCargoSpaceLeft); PREP(getSizeItem); PREP(handleDestroyed); PREP(initObject); PREP(initVehicle); PREP(loadItem); -PREP(makeLoadable); -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 7784968d3f..5ee6406a7d 100644 --- a/addons/cargo/XEH_preInit.sqf +++ b/addons/cargo/XEH_preInit.sqf @@ -8,5 +8,6 @@ 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..e13cc65542 --- /dev/null +++ b/addons/cargo/functions/fnc_addCargoVehiclesActions.sqf @@ -0,0 +1,32 @@ +/* + * 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 + 10)]) select { + private _hasCargoConfig = 1 == getNumber (configFile >> "CfgVehicles" >> typeOf _x >> QGVAR(hasCargo)); + private _hasCargoPublic = _x getVariable [QGVAR(hasCargo), false]; + (_hasCargoConfig || {_hasCargoPublic}) && {_x != _target} && + {([_target, _x] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} +}; + +[_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 e0fd172eef..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, _object] 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 092272f94f..8780689241 100644 --- a/addons/cargo/functions/fnc_canLoadItemIn.sqf +++ b/addons/cargo/functions/fnc_canLoadItemIn.sqf @@ -34,7 +34,7 @@ if (_item isEqualType "") then { } else { _validItem = (alive _item) && - {(_item distance _vehicle) <= MAX_LOAD_DISTANCE}; + {([_item, _vehicle] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE}; }; _validItem && 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 7981782255..0000000000 --- a/addons/cargo/functions/fnc_findNearestVehicle.sqf +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Author: Glowbal - * Get nearest vehicle from unit that is not excluded, priority: Car-Air-Tank-Ship. - * - * Arguments: - * 0: Unit - * 1: Object to exclude - * - * Return Value: - * Vehicle in Distance - * - * Example: - * [unit, object] call ace_cargo_fnc_findNearestVehicle - * - * Public: No - */ -#include "script_component.hpp" - -params ["_unit","_object"]; - -private _loadCar = nearestObjects [_unit, ["car"], MAX_LOAD_DISTANCE]; -_loadCar deleteAt (_loadCar find _object); -if !(_loadCar isEqualTo []) exitWith {_loadCar select 0}; - -private _loadHelicopter = nearestObjects [_unit, ["air"], MAX_LOAD_DISTANCE]; -_loadHelicopter deleteAt (_loadHelicopter find _object); -if !(_loadHelicopter isEqualTo []) exitWith {_loadHelicopter select 0}; - -private _loadTank = nearestObjects [_unit, ["tank"], MAX_LOAD_DISTANCE]; -_loadTank deleteAt (_loadTank find _object); -if !(_loadTank isEqualTo []) exitWith {_loadTank select 0}; - -private _loadShip = nearestObjects [_unit, ["ship"], MAX_LOAD_DISTANCE]; -_loadShip deleteAt (_loadShip find _object);; -if !(_loadShip isEqualTo []) exitWith {_loadShip select 0}; - -private _loadContainer = nearestObjects [_unit, ["Cargo_base_F"], MAX_LOAD_DISTANCE]; -_loadContainer deleteAt (_loadContainer find _object); -if !(_loadContainer isEqualTo []) exitWith {_loadContainer select 0}; - -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..d0e1e66a8f 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,60 @@ 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} && + {([_target, _x] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} + } count (nearestObjects [_player, GVAR(cargoHolderTypes), (MAX_LOAD_DISTANCE + 10)])} }; 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..474b1b0d8f 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,34 @@ 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} && + {([_player, _target] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} && + {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 +85,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 +102,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 +111,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 deleted file mode 100644 index 6bd962398a..0000000000 --- a/addons/cargo/functions/fnc_makeLoadable.sqf +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Author: PabstMirror - * Makes any object loadable. Needs to be called on all machines. - * - * Arguments: - * 0: Object - * 1: Set as loadable (default: true) - * 2: Size. (default: 1) - * - * Return Value: - * None - * - * Example: - * [cursorTarget, true, 1] call ace_cargo_fnc_makeLoadable - * - * Public: Yes - */ -#include "script_component.hpp" - -params [["_object", objNull, [objNull]], ["_canLoad", true, [false, 0]], ["_setSize", 1, [0]]]; -TRACE_3("params",_object,_canLoad,_setSize); - -if (isNull _object) exitWith {TRACE_1("null",_object);}; -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 - -if ((_canLoad == 1) && {_setSize <= 0}) exitWith { - ERROR("ace_cargo_fnc_makeLoadable (size <= 0) when making loadable"); -}; - -TRACE_2("setVar if different from config",_canLoad,_cfgCanLoad); -if (_canLoad != _cfgCanLoad) then { - _object setVariable [QGVAR(canLoad), _canLoad]; -}; - -TRACE_2("setVar if different from config",_setSize,_curSize); -if (_setSize != _curSize) then { - _object setVariable [QGVAR(size), _setSize]; -}; - -//Add the load actions to the object class if not already added -[_object] call FUNC(initObject); - -nil diff --git a/addons/cargo/functions/fnc_moduleMakeLoadable.sqf b/addons/cargo/functions/fnc_moduleMakeLoadable.sqf deleted file mode 100644 index 9c7fb06742..0000000000 --- a/addons/cargo/functions/fnc_moduleMakeLoadable.sqf +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Author: PabstMirror - * Module to make an object loadable. - * - * Arguments: - * 0: The module logic - * 1: Synchronized units - * 2: Activated - * - * Return Value: - * None - * - * Example: - * [logic, [box], true] call ace_cargo_fnc_moduleMakeLoadable - * - * Public: No - */ -#include "script_component.hpp" - -params ["_logic", "_objects", "_activated"]; -TRACE_3("params",_logic,_objects,_activated); - -if ((isNull _logic) || {!_activated}) exitWith {}; -if (_objects isEqualTo []) exitWith { - WARNING_1("ace_cargo_fnc_moduleMakeLoadable has no synced objects [%1]", _logic); -}; - -private _canLoad = _logic getVariable ["canLoad", true]; -private _setSize = _logic getVariable ["setSize", 1]; -TRACE_2("settings",_canLoad,_setSize); - -{ - [_x, _canLoad, _setSize] call FUNC(makeLoadable); -} forEach _objects; diff --git a/addons/cargo/functions/fnc_moduleSettings.sqf b/addons/cargo/functions/fnc_moduleSettings.sqf index b7af19c76a..6712d947fa 100644 --- a/addons/cargo/functions/fnc_moduleSettings.sqf +++ b/addons/cargo/functions/fnc_moduleSettings.sqf @@ -17,8 +17,6 @@ */ #include "script_component.hpp" -if (!isServer) exitWith {}; - params ["_logic", "", "_activated"]; if (!_activated) exitWith {}; diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index 8b3847993d..e08c7a478a 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -32,7 +32,7 @@ if (GVAR(interactionParadrop)) then { [_this select 1] call CBA_fnc_removePerFrameHandler; }; - if (isNull GVAR(interactionVehicle) || {(ACE_player distance GVAR(interactionVehicle) >= 10) && {(vehicle ACE_player) != GVAR(interactionVehicle)}}) exitWith { + if (isNull GVAR(interactionVehicle) || {(([ACE_player, GVAR(interactionVehicle)] call EFUNC(interaction,getInteractionDistance)) >= MAX_LOAD_DISTANCE) && {(vehicle ACE_player) != GVAR(interactionVehicle)}}) exitWith { closeDialog 0; [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/cargo/functions/fnc_paradropItem.sqf b/addons/cargo/functions/fnc_paradropItem.sqf index 4c34e61e4e..4c1929a1dc 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 { @@ -44,12 +44,12 @@ private _itemObject = if (_item isEqualType objNull) then { [QGVAR(serverUnload), [_item, _posBehindVehicleAGL]] call CBA_fnc_serverEvent; _item } else { - private _newItem = createVehicle [_item, _posBehindVehicleAGL, [], 0, ""]; + private _newItem = createVehicle [_item, _posBehindVehicleAGL, [], 0, "NONE"]; _newItem setPosASL (AGLtoASL _posBehindVehicleAGL); _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 [{ 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 8af411bddd..092440e5d4 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, _object] 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 + 10)]); }; if (isNull _vehicle) exitWith { @@ -35,14 +35,20 @@ if (isNull _vehicle) exitWith { private _return = false; // Start progress bar if ([_object, _vehicle] call FUNC(canLoadItemIn)) then { + [_player, _object, true] call EFUNC(common,claim); private _size = [_object] call FUNC(getSizeItem); [ 5 * _size, - [_object,_vehicle], - {["ace_loadCargo", _this select 0] call CBA_fnc_localEvent}, - {}, - localize LSTRING(LoadingItem) + [_object, _vehicle], + { + [objNull, _this select 0 select 0, true] call EFUNC(common,claim); + ["ace_loadCargo", _this select 0] call CBA_fnc_localEvent; + }, + {[objNull, _this select 0 select 0, true] call EFUNC(common,claim)}, + localize LSTRING(LoadingItem), + {true}, + ["isNotSwimming"] ] call EFUNC(common,progressBar); _return = true; } else { diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index 47ff3ba36e..702f145405 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" @@ -54,7 +55,7 @@ if (_item isEqualType objNull) then { // do both on server to ensure they are executed in the correct order [QGVAR(serverUnload), [_item, _emptyPosAGL]] call CBA_fnc_serverEvent; } else { - private _newItem = createVehicle [_item, _emptyPosAGL, [], 0, ""]; + private _newItem = createVehicle [_item, _emptyPosAGL, [], 0, "NONE"]; _newItem setPosASL (AGLtoASL _emptyPosAGL); }; diff --git a/addons/cargo/script_component.hpp b/addons/cargo/script_component.hpp index 4a1305a160..d5cee60c39 100644 --- a/addons/cargo/script_component.hpp +++ b/addons/cargo/script_component.hpp @@ -16,4 +16,10 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define MAX_LOAD_DISTANCE 10 +#define MAX_LOAD_DISTANCE 5 + +#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 1caeccb40a..0d42954b7f 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,8 @@ Charger 積み込む 싣기 + 裝載 + 装载 Unload @@ -26,6 +28,8 @@ Décharger 下ろす 내리기 + 卸載 + 卸载 Cargo @@ -39,6 +43,8 @@ Cargaison カーゴ 화물 + 貨物 + 货物 Cargo Menu @@ -52,6 +58,8 @@ Menu de cargaison カーゴ メニュー 화물 메뉴 + 貨物選單 + 货物选单 Cargo space left: %1 @@ -65,6 +73,8 @@ Espace de cargaison restant : %1 カーゴの空き容量: %1 선적 공간 남음: %1 + 貨物剩餘空間: %1 + 货物剩余空间: %1 Enable Cargo @@ -78,6 +88,8 @@ Activer la mise en cargaison カーゴを有効化 화물 활성화 + 啟用貨物裝載 + 启用货物装载 Enable the load in cargo module @@ -91,6 +103,8 @@ Active le chargement de cargaison dans un vehicule カーゴ モジュールで積み込みを有効化 화물 모듈에 싣기를 활성화합니다 + 啟用貨物裝載功能 + 启用货物装载功能 Cargo Settings @@ -104,6 +118,8 @@ Paramètres de cargaison カーゴ設定 화물 설정 + 貨物設定 + 货物设定 Configure the cargo module settings @@ -117,6 +133,8 @@ Configure les paramètres du module de cargaison カーゴ モジュールの設定を構成 화물 모듈의 환경 설정을 바꿉니다 + 配置貨物模塊設定 + 配置货物模块设定 %1<br/>loaded into<br/>%2 @@ -131,6 +149,8 @@ %1<br/>загружен в<br/>%2 %1<br/>は<br/>%2へ積み込まれた %1<br/>는<br/>%2 에 실림 + %1<br/>裝載至<br/>%2 + %1<br/>装载至<br/>%2 Unloaded<br/>%1 from<br/>%2 @@ -145,6 +165,8 @@ %1<br/>разгружен из<br/>%2 <br/>%1が<br/>%2から降ろされた %1<br/>는<br/>%2 에서 내려짐 + 從<br/>%2卸載<br/>%1 + 从<br/>%2卸载<br/>%1 Loading Cargo @@ -158,6 +180,8 @@ Chargement de la cargaison カーゴへ積み込んでいる 화물 싣기 + 裝載貨物中 + 装载货物中 Unloading Cargo @@ -171,6 +195,8 @@ Déchargement de la cargaison カーゴから降ろしている 화물 내리기 + 卸載貨物中 + 卸载货物中 %1<br/>could not be loaded @@ -184,6 +210,8 @@ %1<br /> n'a pas pu être chargé %1<br/>は積み込めなかった %1<br/>이 실릴 수가 없습니다 + %1<br/>無法被裝載 + %1<br/>无法被装载 %1<br/>could not be unloaded @@ -197,45 +225,48 @@ %1<br /> n'a pas pu être déchargé %1<br/>は降ろせなかった %1<br/>이 내려질 수가 없습니다 + %1<br/>無法被卸載 + %1<br/>无法被卸载 - - Make Object Loadable - Füge Objekt zum Frachtsystem hinzu - Ustaw jako ładowalny - Rendi oggetto caricabile - Hacer objeto cargable - Rendre l'objet chargeable - Vytvořit objekt nakladatelným - Fazer objeto carregável - Сделать объект загружаемым - オブジェクトを積載可能に - 물체를 화물화시키기 + + Cargo Space + Frachtraum + Spazio Cargo + カーゴ スペース + 貨物空間 + 货物空间 + Przestrzeń ładunkowa + 화물 공간 - - Sets the synced object as loadable by the cargo system. - Das synchronisierte Objekt wird dem Frachtsystem hinzugefügt und ist be- 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. - Rend l'objet synchronisé comme chargeable par le système de cargaison. - Nastaví synchronizované objekty nakladatelnými za pomocí Nákladního systému. - Seta o objeto sincronizado como carregável - Делает синхронизированный объект загружаемым для модуля перевозки грузов. - オブジェクトを同期させると、カーゴ システムによる積載が可能になります。 - 물체를 화물 시스템과 동기화시켜 실을 수 있게 합니다 + + 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 + 이 차량/컨테이너에서 사용가능한 화물 공간 - - Object's Size - Objektgröße - Rozmiar obiektu - Dimensioni dell'oggetto - Tamaño del objeto - Taille de l'objet - Velikost objektu - Tamanho do objeto - Размер объекта - オブジェクトの大きさ - 물체 크기 + + 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) + 이 화물을 적재하는데 필요한 공간 (-1=무조건 적재가능) Airdrop @@ -245,6 +276,8 @@ 공중 투하 Largage aérien Lancio Aereo + 空投 + 空投 Unlevel Flight @@ -254,16 +287,30 @@ 기체가 수평이 아닙니다 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 c182ded34b..de6f3920f5 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); @@ -45,7 +45,7 @@ class CfgWeapons { model = "\A3\weapons_F\ammo\mag_univ.p3d"; picture = QPATHTOF(UI\ace_chemlight_shield_x_ca.paa); scope = 2; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; @@ -57,8 +57,9 @@ class CfgWeapons { descriptionShort = CSTRING(Shield_Green_DescriptionShort); model = "\A3\weapons_F\ammo\mag_univ.p3d"; picture = QPATHTOF(UI\ace_chemlight_shield_green_x_ca.paa); + ace_arsenal_uniqueBase = "ACE_Chemlight_Shield"; scope = 1; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; class FlashLight { ACE_Flashlight_Colour = "green"; @@ -73,7 +74,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 +89,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 +104,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 +119,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 +134,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/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 76e1ffd27e..eeac958a6d 100644 --- a/addons/chemlights/stringtable.xml +++ b/addons/chemlights/stringtable.xml @@ -9,6 +9,8 @@ 켐라이트 Cyalumes Luce chimica + 螢光棒 + 萤光棒 Prepare %1 @@ -18,6 +20,8 @@ %1 준비 Prépare %1 Prepara %1 + 使用%1 + 使用%1 %1<br/>Prepared @@ -27,6 +31,8 @@ %1<br/>준비됨 %1<br/>prêt %1 <br/> Preparata + %1<br/>已使用 + %1<br/>已使用 No inventory space @@ -41,6 +47,8 @@ В инвентаре нет места インベントリに空きがありません 소지품 공간이 없음 + 已無存放空間 + 已无存放空间 [ACE] Chemlights @@ -50,6 +58,8 @@ [ACE] 켐라이트 [ACE] Cyalume [ACE] Luci chimiche + [ACE] 螢光棒 + [ACE] 萤光棒 Chemlight (Orange) @@ -59,6 +69,8 @@ 켐라이트 (주황) Cyalume (orange) Luce chimica (Arancione) + 螢光棒 (橘色) + 萤光棒 (橘色) Orange Light @@ -68,6 +80,8 @@ 주황색 Lum. orange Luce Arancione + 橘色光 + 橘色光 Type: Light - Orange<br />Rounds: 1<br />Used in: Hand @@ -77,6 +91,8 @@ 종류:밝은 오렌지<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) @@ -86,6 +102,8 @@ 켐라이트 (하양) Cyalume (blanc) Luce chimica (Bianca) + 螢光棒 (白色) + 萤光棒 (白色) White Light @@ -95,6 +113,8 @@ 하얀색 Lum. blanche Luce Bianca + 白色光 + 白色光 Type: Light - White<br />Rounds: 1<br />Used in: Hand @@ -104,6 +124,8 @@ 종류:하얀색<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) @@ -113,6 +135,8 @@ 켐라이트 (밝은 빨간색) Cyalume (Hi rouge) Luce chimica (Hi Rossa) + 螢光棒 (超亮紅色) + 萤光棒 (超亮红色) Red Hi Light @@ -122,6 +146,8 @@ 밝은 빨간색 Lum. rouge haute intensité Luce Hi Rossa + 超亮紅色光 + 超亮红色光 Type: Light - Red Hi (5 minute)<br />Rounds: 1<br />Used in: Hand @@ -131,6 +157,8 @@ 종류: 밝은 빨간색 (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) @@ -140,6 +168,8 @@ 켐라이트 (밝은 노란색) Cyalume (Hi jaune) Luce chimica (Hi Gialla) + 螢光棒 (超亮黃色) + 萤光棒 (超亮黄色) Yellow Hi Light @@ -149,6 +179,8 @@ 밝은 노란색 Lum. jaune haute intensité Luce Hi Gialla + 超亮黃色光 + 超亮黄色光 Type: Light - Yellow Hi (5 minute)<br />Rounds: 1<br />Used in: Hand @@ -158,6 +190,8 @@ 종류:밝은 노란색 (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) @@ -167,6 +201,8 @@ 켐라이트 (밝은 주황색) Cyalume (Hi orange) Luce chimica (Hi Arancione) + 螢光棒 (超亮橘色) + 萤光棒 (超亮橘色) Orange Hi Light @@ -176,6 +212,8 @@ 밝은 주황색 Lum. orange haute intensité Luce Hi Arancione + 超亮橘色光 + 超亮橘色光 Type: Light - Orange Hi (5 minute)<br />Rounds: 1<br />Used in: Hand @@ -185,6 +223,8 @@ 종류: 밝은 주황색 (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) @@ -194,6 +234,8 @@ 켐라이트 (밝은 하얀색) Cyalume (Hi blanc) Luce chimica (Hi Bianca) + 螢光棒 (超亮白色) + 萤光棒 (超亮白色) White Hi Light @@ -203,6 +245,8 @@ 밝은 하얀색 Lum. blanche haute intensité Luce Hi Bianca + 超亮白色光 + 超亮白色光 Type: Light - White Hi (5 minute)<br />Rounds: 1<br />Used in: Hand @@ -212,6 +256,8 @@ 종류: 밝은 하얀색 (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) @@ -221,6 +267,8 @@ 켐라이트 (적외선) Cyalume (IR) Luce chimica (IR) + 螢光棒 (紅外線) + 萤光棒 (红外线) IR Light @@ -230,6 +278,8 @@ 적외선 켐라이트 Lumière IR Luce IR + 紅外線光 + 红外线光 Type: Light - Infrared<br />Rounds: 1<br />Used in: Hand @@ -239,6 +289,8 @@ 종류: 적외선<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) @@ -248,6 +300,8 @@ 켐라이트 쉴드 (비어있음) Étui cyalume (vide) Scudo Luce chimica (Vuoto) + 螢光棒保護殼 (空) + 萤光棒保护壳 (空) Shield for chemlights. Combine with chemlight to prepare reading light. @@ -257,6 +311,8 @@ 켐라이트를 위한 가림막입니다. 켐라이트와 같이 사용하여 읽을 때 씁니다. É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) @@ -266,6 +322,8 @@ 켐라이트 쉴드 (초록) Étui cyalume (vert) Scudo Luce Chimica (Verde) + 螢光棒保護殼 (綠色) + 萤光棒保护壳 (绿色) Green reading light. @@ -275,6 +333,8 @@ 초록빛 조명 Lampe d'orientation verte. Luce da lettura Verde. + 綠色閱讀燈。 + 绿色阅读灯。 Chemlight Shield (Red) @@ -284,6 +344,8 @@ 켐라이트 쉴드 (빨강) Étui cyalume (rouge) Scudo Luce Chimica (Rossa) + 螢光棒保護殼 (紅色) + 萤光棒保护壳 (红色) Red reading light. @@ -293,6 +355,8 @@ 빨간색 조명 Lampe d'orientation rouge. Luce da lettura Rossa. + 紅色閱讀燈。 + 红色阅读灯。 Chemlight Shield (Blue) @@ -302,6 +366,8 @@ 켐라이트 쉴드 (파랑) Étui cyalume (bleu) Scudo Luce Chimica (Blu) + 螢光棒保護殼 (藍色) + 萤光棒保护壳 (蓝色) Blue reading light. @@ -311,6 +377,8 @@ 파란색 조명 Lampe d'orientation bleue. Luce da lettura Blu. + 藍色閱讀燈。 + 蓝色阅读灯。 Chemlight Shield (Yellow) @@ -320,6 +388,8 @@ 켐라이트 쉴드 (노랑) Étui cyalume (jaune) Scudo Luce Chimica (Gialla) + 螢光棒保護殼 (黃色) + 萤光棒保护壳 (黄色) Yellow reading light. @@ -329,6 +399,8 @@ 노란색 조명 Lampe d'orientation jaune. Luce da lettura Gialla. + 黃色閱讀燈。 + 黄色阅读灯。 Chemlight Shield (Orange) @@ -338,6 +410,8 @@ 켐라이트 쉴드 (주황) Étui cyalume (orange) Scudo Luce Chimica (Arancione) + 螢光棒保護殼 (橘色) + 萤光棒保护壳 (橘色) Orange reading light. @@ -347,6 +421,8 @@ 주황색 조명 Lampe d'orientation orange. Luce da lettura Arancione. + 橘色閱讀燈。 + 橘色阅读灯。 Chemlight Shield (White) @@ -356,6 +432,8 @@ 켐라이트 쉴드 (하양) Étui cyalume (blanc) Scudo Luce Chimica (Bianca) + 螢光棒保護殼 (白色) + 萤光棒保护壳 (白色) White reading light. @@ -365,6 +443,8 @@ 주황색 조명 Lampe d'orientation blanche. Luce da lettura Bianca. + 白色閱讀燈。 + 白色阅读灯。 diff --git a/addons/common/ACE_Settings.hpp b/addons/common/ACE_Settings.hpp index 2d8a5d7a27..eeee9c2f37 100644 --- a/addons/common/ACE_Settings.hpp +++ b/addons/common/ACE_Settings.hpp @@ -14,25 +14,27 @@ class ACE_Settings { * values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; // Stringtable entries that describe the options * }; */ - class GVAR(forceAllSettings) { - value = 0; - typeName = "BOOL"; - }; class GVAR(checkPBOsAction) { + category = CSTRING(DisplayName); value = 0; typeName = "SCALAR"; isClientSettable = 0; + displayName = CSTRING(CheckPBOsAction); values[] = {CSTRING(CheckPBO_Action_WarnOnce), CSTRING(CheckPBO_Action_WarnPerm), CSTRING(CheckPBO_Action_Kick)}; }; class GVAR(checkPBOsCheckAll) { + category = CSTRING(DisplayName); value = 0; typeName = "BOOL"; isClientSettable = 0; + displayName = CSTRING(CheckPBOsCheckAll); }; class GVAR(checkPBOsWhitelist) { + category = CSTRING(DisplayName); value = "[]"; typeName = "STRING"; isClientSettable = 0; + displayName = CSTRING(CheckPBOsWhitelist); }; /*class GVAR(enableNumberHotkeys) { value = 1; @@ -41,6 +43,7 @@ class ACE_Settings { displayName = CSTRING(EnableNumberHotkeys); };*/ class GVAR(settingFeedbackIcons) { + category = CSTRING(DisplayName); value = 1; typeName = "SCALAR"; force = 0; @@ -50,6 +53,7 @@ class ACE_Settings { values[] = {ECSTRING(optionsmenu,Hide), ECSTRING(optionsmenu,TopRightDown), ECSTRING(optionsmenu,TopRightLeft), ECSTRING(optionsmenu,TopLeftDown), ECSTRING(optionsmenu,TopLeftRight)}; }; class GVAR(settingProgressBarLocation) { + category = CSTRING(DisplayName); value = 0; typeName = "SCALAR"; force = 0; @@ -59,6 +63,7 @@ class ACE_Settings { values[] = {ECSTRING(optionsmenu,Top), ECSTRING(optionsmenu,Bottom)}; }; class GVAR(displayTextColor) { + category = CSTRING(DisplayName); value[] = {0,0,0,0.1}; typeName = "COLOR"; isClientSettable = 1; @@ -66,6 +71,7 @@ class ACE_Settings { description = CSTRING(SettingDisplayTextColorDesc); }; class GVAR(displayTextFontColor) { + category = CSTRING(DisplayName); value[] = {1,1,1,1}; typeName = "COLOR"; isClientSettable = 1; diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp index 1e958027be..a3ddef155e 100644 --- a/addons/common/CfgVehicles.hpp +++ b/addons/common/CfgVehicles.hpp @@ -33,7 +33,7 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(CheckPBO_DisplayName); function = QFUNC(moduleCheckPBOs); - scope = 2; + scope = 1; isGlobal = 1; isSingular = 1; icon = QPATHTOF(UI\Icon_Module_CheckPBO_ca.paa); 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/CompassControl.hpp b/addons/common/CompassControl.hpp new file mode 100644 index 0000000000..899c609161 --- /dev/null +++ b/addons/common/CompassControl.hpp @@ -0,0 +1,110 @@ +#include "\a3\ui_f\hpp\defineCommonGrids.inc" + +#define TEXTURE_0 "\a3\ui_f_curator\Data\CfgIngameUI\Compass\texture0_ca.paa" +#define TEXTURE_1 "\a3\ui_f_curator\Data\CfgIngameUI\Compass\texture90_ca.paa" +#define TEXTURE_2 "\a3\ui_f_curator\Data\CfgIngameUI\Compass\texture180_ca.paa" +#define TEXTURE_3 "\a3\ui_f_curator\Data\CfgIngameUI\Compass\texture270_ca.paa" + +#define BACKGROUND_COLOR {0.1,0.1,0.1,0.4} +#define POINTER_COLOR {0.1,0.1,0.1,1} +#define POINTER_WIDTH_FACTOR (1/128) + +#define LEFT (0.5 - 8 * GUI_GRID_W) +#define TOP (safezoneY + 1.6 * GUI_GRID_H) +#define WIDTH (16 * GUI_GRID_W) +#define HEIGHT (0.5 * GUI_GRID_H) + +class RscText; +class RscPicture; +class RscControlsGroupNoScrollbars; + +class GVAR(CompassControl): RscControlsGroupNoScrollbars { + onLoad = QUOTE(\ + params ['_control'];\ + private _display = ctrlParent _control;\ + private _fnc_update = {\ + params ['_display'];\ + private _compassControl = _display getVariable 'GVAR(compassControl)';\ + private _view = AGLToASL positionCameraToWorld [ARR_3(0,0,0)] vectorFromTo AGLToASL positionCameraToWorld [ARR_3(0,0,1)];\ + private _viewHorizontal = vectorNormalized (_view vectorCrossProduct [ARR_3(0,0,1)]);\ + private _dir = acos (_viewHorizontal select 0);\ + if (_viewHorizontal select 1 > 0) then {\ + _dir = 360 - _dir;\ + };\ + _compassControl ctrlSetPosition [ARR_2(-(16 * GUI_GRID_W) * (_dir / 360),0)];\ + _compassControl ctrlCommit 0;\ + };\ + _display displayAddEventHandler [ARR_2('MouseMoving',_fnc_update)];\ + _display displayAddEventHandler [ARR_2('MouseHolding',_fnc_update)];\ + ); + x = LEFT; + y = TOP; + w = WIDTH; + h = HEIGHT; + + class controls { + class Background: RscText { + colorBackground[] = BACKGROUND_COLOR; + x = 0; + y = 0; + w = WIDTH; + h = HEIGHT; + }; + class Pointer: RscText { + colorBackground[] = POINTER_COLOR; + x = WIDTH/2 - WIDTH*POINTER_WIDTH_FACTOR/2; + y = 0; + w = WIDTH*POINTER_WIDTH_FACTOR; + h = HEIGHT; + }; + class CompassGroup: RscControlsGroupNoScrollbars { + onLoad = QUOTE(\ + params ['_control'];\ + private _display = ctrlParent _control;\ + _display setVariable [ARR_2('GVAR(compassControl)',_control)];\ + ); + x = 0; + y = 0; + w = 2*WIDTH; + h = 2*HEIGHT; + + class controls { + class Compass0: RscPicture { + text = TEXTURE_0; + x = 0 * (WIDTH / 4); + y = 0; + w = WIDTH/4; + h = HEIGHT; + }; + class Compass1: Compass0 { + text = TEXTURE_1; + x = 1 * (WIDTH / 4); + }; + class Compass2: Compass0 { + text = TEXTURE_2; + x = 2 * (WIDTH / 4); + }; + class Compass3: Compass0 { + text = TEXTURE_3; + x = 3 * (WIDTH / 4); + }; + class Compass4: Compass0 { + text = TEXTURE_0; + x = 4 * (WIDTH / 4); + }; + class Compass5: Compass0 { + text = TEXTURE_1; + x = 5 * (WIDTH / 4); + }; + class Compass6: Compass0 { + text = TEXTURE_2; + x = 6 * (WIDTH / 4); + }; + class Compass7: Compass0 { + text = TEXTURE_3; + x = 7 * (WIDTH / 4); + }; + }; + }; + }; +}; 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 9cdee7bb54..e0bd01ba51 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -1,8 +1,14 @@ +TRACE_1("",QUOTE(ADDON)); + +PREP(cbaSettings); +PREP(cbaSettings_loadFromConfig); +PREP(cbaSettings_settingChanged); +PREP(cbaSettings_transferUserSettings); +PREP(readSettingsFromParamsArray); PREP(actionKeysNamesConverted); PREP(addCanInteractWithCondition); PREP(addLineToDebugDraw); -PREP(addSetting); PREP(addToInventory); PREP(assignedItemFix); PREP(assignObjectsInList); @@ -37,6 +43,7 @@ PREP(displayTextPicture); PREP(displayTextStructured); PREP(doAnimation); PREP(doGesture); +PREP(dummy); PREP(dropBackpack); PREP(endRadioTransmission); PREP(eraseCache); @@ -67,6 +74,7 @@ PREP(getMGRSdata); PREP(getName); PREP(getNumberMagazinesIn); PREP(getPitchBankYaw); +PREP(getPylonTurret); PREP(getSettingData); PREP(getStaminaBarControl); PREP(getTargetAzimuthAndInclination); @@ -77,10 +85,12 @@ PREP(getTurretDirection); PREP(getUavControlPosition); PREP(getVehicleCargo); PREP(getVehicleCodriver); +PREP(getVehicleIcon); PREP(getVersion); PREP(getWeaponAzimuthAndInclination); PREP(getWeaponIndex); PREP(getWeaponState); +PREP(getWeight); PREP(getWindDirection); PREP(getZoom); PREP(goKneeling); @@ -99,20 +109,20 @@ PREP(isEngineer); PREP(isEOD); PREP(isFeatureCameraActive); PREP(isInBuilding); +PREP(isMedic); PREP(isModLoaded); PREP(isPlayer); +PREP(isSwimming); PREP(isUnderwater); PREP(lightIntensityFromObject); PREP(loadPerson); PREP(loadPersonLocal); -PREP(loadSettingsFromProfile); -PREP(loadSettingsOnServer); -PREP(loadSettingsLocalizedText); PREP(moduleCheckPBOs); PREP(moduleLSDVehicles); PREP(muteUnit); PREP(muteUnitHandleInitPost); PREP(muteUnitHandleRespawn); +PREP(nearestVehiclesFreeSeat); PREP(numberToDigits); PREP(numberToDigitsString); PREP(numberToString); @@ -125,7 +135,6 @@ PREP(playerSide); PREP(positionToASL); PREP(progressBar); PREP(readSettingFromModule); -PREP(readSettingsFromParamsArray); PREP(receiveRequest); PREP(removeCanInteractWithCondition); PREP(removeSpecificMagazine); @@ -133,6 +142,7 @@ PREP(requestCallback); PREP(resetAllDefaults); PREP(restoreVariablesJIP); PREP(runAfterSettingsInit); +PREP(runTests); PREP(sanitizeString); PREP(sendRequest); PREP(serverLog); @@ -146,7 +156,6 @@ PREP(setPitchBankYaw); PREP(setPlayerOwner); PREP(setProne); PREP(setSetting); -PREP(setSettingFromConfig); PREP(setVariableJIP); PREP(setVariablePublic); PREP(setVolume); @@ -160,7 +169,7 @@ PREP(statusEffect_sendEffects); PREP(statusEffect_set); PREP(stringCompare); PREP(stringToColoredText); -PREP(stringRemoveWhiteSpace); +PREP(switchPersistentLaser); PREP(switchToGroupSide); PREP(throttledPublicVariable); PREP(toBin); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index af5303c526..369f7b87c2 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -19,41 +19,63 @@ //Status Effect EHs: [QGVAR(setStatusEffect), {_this call FUNC(statusEffect_set)}] call CBA_fnc_addEventHandler; -["forceWalk", false, ["ACE_SwitchUnits", "ACE_Attach", "ACE_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_Sandbag", "ACE_refuel", "ACE_rearm", "ACE_dragging"]] call FUNC(statusEffect_addType); +["forceWalk", false, ["ACE_SwitchUnits", "ACE_Attach", "ACE_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_Sandbag", "ACE_refuel", "ACE_rearm", "ACE_Trenches"]] 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); +["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered)]] call FUNC(statusEffect_addType); +["blockDamage", false, ["fixCollision", "ACE_cargo"]] call FUNC(statusEffect_addType); ["blockEngine", false, ["ACE_Refuel"]] call FUNC(statusEffect_addType); +["blockThrow", false, ["ACE_Attach", "ACE_concertina_wire", "ACE_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_rearm", "ACE_refuel", "ACE_Sandbag", "ACE_Trenches", "ACE_tripod"]] call FUNC(statusEffect_addType); +["setHidden", true, ["ace_unconscious"]] call FUNC(statusEffect_addType); [QGVAR(forceWalk), { params ["_object", "_set"]; TRACE_2("forceWalk EH",_object,_set); _object forceWalk (_set > 0); }] call CBA_fnc_addEventHandler; + [QGVAR(blockSprint), { //Name reversed from `allowSprint` because we want NOR logic params ["_object", "_set"]; TRACE_2("blockSprint EH",_object,_set); _object allowSprint (_set == 0); }] call CBA_fnc_addEventHandler; + [QGVAR(setAnimSpeedCoef), { params ["_object", "_set"]; _object setAnimSpeedCoef _set; }] call CBA_fnc_addEventHandler; + [QGVAR(setCaptive), { params ["_object", "_set"]; TRACE_2("setCaptive EH",_object,_set); _object setCaptive (_set > 0); }] call CBA_fnc_addEventHandler; + +[QGVAR(setHidden), { + params ["_object", "_set"]; + TRACE_2("setHidden EH",_object,_set); + private _vis = _object getUnitTrait "camouflageCoef"; + if (_set > 0) then { + if (_vis != 0) then { + _object setVariable [QGVAR(oldVisibility), _vis]; + _object setUnitTrait ["camouflageCoef", 0]; + }; + } else { + _vis = _object getVariable [QGVAR(oldVisibility), _vis]; + _object setUnitTrait ["camouflageCoef", _vis]; + }; +}] call CBA_fnc_addEventHandler; + [QGVAR(blockDamage), { //Name reversed from `allowDamage` because we want NOR logic params ["_object", "_set"]; if ((_object isKindOf "CAManBase") && {(["ace_medical"] call FUNC(isModLoaded))}) then { TRACE_2("blockDamage EH (using medical)",_object,_set); - _object setvariable [QEGVAR(medical,allowDamage), (_set == 0), true]; + _object setVariable [QEGVAR(medical,allowDamage), (_set == 0), true]; } else { TRACE_2("blockDamage EH (using allowDamage)",_object,_set); _object allowDamage (_set == 0); }; }] call CBA_fnc_addEventHandler; + [QGVAR(blockEngine), { params ["_vehicle", "_set"]; _vehicle setVariable [QGVAR(blockEngine), _set > 0, true]; @@ -78,20 +100,6 @@ if (isServer) then { }]; }; -// Listens for global "SettingChanged" events, to update the force status locally -["ace_settingChanged", { - params ["_name", "_value", "_force"]; - - if (_force) then { - private _settingData = [_name] call FUNC(getSettingData); - - if (_settingData isEqualTo []) exitWith {}; - - _settingData set [6, _force]; - }; -}] call CBA_fnc_addEventHandler; - - // Event to log Fix Headbug output [QGVAR(headbugFixUsed), { params ["_profileName", "_animation"]; @@ -127,6 +135,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; @@ -175,8 +184,8 @@ private _previousVersion = profileNamespace getVariable ["ACE_VersionNumberStrin // check previous version number from profile if (_currentVersion != _previousVersion) then { - // do something - + INFO_2("Updating ACE from [%1] to [%2]",_previousVersion,_currentVersion); + [_previousVersion] call FUNC(cbaSettings_transferUserSettings); profileNamespace setVariable ["ACE_VersionNumberString", _currentVersion]; }; @@ -195,60 +204,6 @@ call FUNC(checkFiles); ] call FUNC(checkPBOs) }] call CBA_fnc_addEventHandler; -// Create a pfh to wait until all postinits are ready and settings are initialized -[{ - params ["_args"]; - - _args params ["_waitingMsgSent"]; - - // If post inits are not ready then wait - if !(SLX_XEH_MACHINE select 8) exitWith {}; - - // If settings are not initialized then wait - if (isNil QGVAR(settings) || {!isServer && isNil QEGVAR(modules,serverModulesRead)}) exitWith { - if !(_waitingMsgSent) then { - _args set [0, true]; - INFO("Waiting on settings from server..."); - }; - }; - - [_this select 1] call CBA_fnc_removePerFrameHandler; - - INFO("Settings received from server."); - - if (isServer) then { //read settings from paramsArray - [] call FUNC(readSettingsFromParamsArray); - }; - // Event so that ACE_Modules have their settings loaded: - [QGVAR(initSettingsFromModules), []] call CBA_fnc_localEvent; - - if (isServer) then { - // Publish all settings data after all configs and modules are read - publicVariable QGVAR(settings); - }; - - // Load user settings from profile - if (hasInterface) then { - call FUNC(loadSettingsFromProfile); - call FUNC(loadSettingsLocalizedText); - }; - - INFO("Settings initialized."); - - //Event that settings are safe to use: - ["ace_settingsInitialized", []] call CBA_fnc_localEvent; - - //Set init finished and run all delayed functions: - GVAR(settingsInitFinished) = true; - INFO_1("%1 delayed functions running.",count GVAR(runAtSettingsInitialized)); - - { - (_x select 1) call (_x select 0); - false - } count GVAR(runAtSettingsInitialized); - - GVAR(runAtSettingsInitialized) = nil; //cleanup -}, 0, [false]] call CBA_fnc_addPerFrameHandler; /***************************************************************************/ @@ -321,6 +276,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 @@ -359,7 +357,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); @@ -377,7 +377,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; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 355ffb2a7d..d8fccd3884 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -9,6 +9,7 @@ PREP_RECOMPILE_END; GVAR(syncedEvents) = [] call CBA_fnc_hashCreate; GVAR(showHudHash) = [] call CBA_fnc_hashCreate; +GVAR(vehicleIconCache) = call CBA_fnc_createNamespace; // for getVehicleIcon GVAR(settingsInitFinished) = false; GVAR(runAtSettingsInitialized) = []; @@ -18,10 +19,8 @@ GVAR(runAtSettingsInitialized) = []; //Debug ACE_COUNTERS = []; -// Load settings on the server and broadcast them -if (isServer) then { - call FUNC(loadSettingsOnServer); -}; +// Load ace_settings into CBA Settings +[] call FUNC(cbaSettings); GVAR(statusEffect_Names) = []; GVAR(statusEffect_isGlobal) = []; @@ -42,4 +41,14 @@ isHC = !hasInterface && !isDedicated; // deprecated because no tag missionNamespace setVariable ["ACE_isHC", ACE_isHC]; uiNamespace setVariable ["ACE_isHC", ACE_isHC]; +[ + QGVAR(persistentLaserEnabled), + "CHECKBOX", + [localize LSTRING(SettingPersistentLaserName), localize LSTRING(SettingPersistentLaserDesc)], + localize LSTRING(ACEKeybindCategoryWeapons), + false, + false, + LINKFUNC(switchPersistentLaser) +] call CBA_settings_fnc_init; + ADDON = true; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 2cddf76bd8..6280f186d8 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 = ""; @@ -65,6 +64,7 @@ class ACE_Rsc_Control_Base { #include #include #include +#include "CompassControl.hpp" class CfgUIGrids { class IGUI { @@ -90,3 +90,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 5fd7f028ba..46f015c5e0 100644 --- a/addons/common/functions/fnc_addLineToDebugDraw.sqf +++ b/addons/common/functions/fnc_addLineToDebugDraw.sqf @@ -8,10 +8,10 @@ * 2: Color * * Return Value: - * Nothing + * None * * Example: - * [[0,0,0], [1,1,0], [1,0,0,1]]] call ace_common_fnc_addLineToDebugDraw; + * [[0,0,0], [1,1,0], [1,0,0,1]] call ace_common_fnc_addLineToDebugDraw; * * Public: No */ 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 deleted file mode 100644 index c4b97ddcce..0000000000 --- a/addons/common/functions/fnc_addSetting.sqf +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Author: esteldunedain - * Adds a new setting at runtime, with all it's metadata. - * If has only local effects. - * - * Arguments: - * 0: name - * 1: typeName - * 2: isClientSetable - * 3: localizedName - * 4: localizedDescription - * 5: possibleValues - * 6: isForced - * 7: defaultValue - * - * Return Value: - * None - * - * Public: No - */ -#include "script_component.hpp" - -params ["_name", "", "", "", "", "", "", "_value"]; //["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_isForced", "_value"]; - -private _settingData = [_name] call FUNC(getSettingData); - -// Exit if the setting already exists -if (count _settingData > 0) exitWith {}; - -// Update the variable -TRACE_2("Setting added",_name,_value); - -// Init the variable -missionNamespace setVariable [_name, _value]; - -// Add the setting data -GVAR(settings) pushBack _this; - -// Raise event locally -["ace_settingChanged", [_name, _value]] call CBA_fnc_localEvent; 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 index b3cdfd8405..2b0412f730 100644 --- a/addons/common/functions/fnc_canDig.sqf +++ b/addons/common/functions/fnc_canDig.sqf @@ -24,8 +24,14 @@ if ((getPosATL _unit) select 2 > 0.05 || // Walking on objects, such as building ) exitWith {false}; private _surfaceClass = (surfaceType _posASL) select [1]; -private _surfaceType = getText (configFile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); -private _surfaceDust = getNumber (configFile >> "CfgSurfaces" >> _surfaceClass >> "dust"); +private _config = configFile >> "CfgSurfaces" >> _surfaceClass; +private _surfaceType = getText (_config >> "soundEnviron"); +private _surfaceDust = getNumber (_config >> "dust"); + TRACE_2("Surface",_surfaceType,_surfaceDust); -!(_surfaceType in DIG_SURFACE_BLACKLIST) && {_surfaceDust >= 0.1} +if (isNumber (_config >> "ACE_canDig")) then { + getNumber (_config >> "ACE_canDig") // return +} else { + !(_surfaceType in DIG_SURFACE_BLACKLIST) && {(_surfaceDust >= 0.1) || {_surfaceType in DIG_SURFACE_WHITELIST}} // return +}; 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_cbaSettings.sqf b/addons/common/functions/fnc_cbaSettings.sqf new file mode 100644 index 0000000000..97978c590c --- /dev/null +++ b/addons/common/functions/fnc_cbaSettings.sqf @@ -0,0 +1,112 @@ +/* + * Author: PabstMirror + * Called at pre-init: Loads all ace_settings and converts them to CBA Settings. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_common_fnc_cbaSettings; + * + * Public: No + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +LOG("Adding ACE_Settings to CBA_settings"); + +// Init Vars: +GVAR(cbaSettings_forcedSettings) = []; +GVAR(cbaSettings_missionSettings) = []; +GVAR(settings) = []; // will stay empty - for BWC? + +// Add Event Handlers: +[QGVAR(setSetting), { + params ["_settingName", "_value"]; + TRACE_2("setSettingMission from setSetting",_settingName,_value); + ["CBA_settings_setSettingMission", [_settingName, _value, true]] call CBA_fnc_localEvent; + ["CBA_settings_refreshSetting", [_settingName]] call CBA_fnc_localEvent; +}] call CBA_fnc_addEventHandler; + +["CBA_beforeSettingsInitialized", { + TRACE_1("CBA_beforeSettingsInitialized EH",_this); + + // First: Process missionConfig settings: + { + _x params ["_settingName", "_value"]; + TRACE_2("setSettingMission from missionConfig",_settingName,_value); + ["CBA_settings_setSettingMission", [_settingName, _value, true]] call CBA_fnc_localEvent; + } forEach GVAR(cbaSettings_missionSettings); + GVAR(cbaSettings_missionSettings) = nil; + + // Second: Read settings from mission params + [] call FUNC(readSettingsFromParamsArray); + + // Third: Event so that ACE_Modules have their settings loaded: + [QGVAR(initSettingsFromModules), []] call CBA_fnc_localEvent; + + TRACE_1("Finished mission settings",_this); +}] call CBA_fnc_addEventHandler; + +["CBA_settingsInitialized", { + TRACE_1("CBA_settingsInitialized EH",_this); + if !(SLX_XEH_MACHINE select 8) then {WARNING("PostInit not finished");}; + INFO("Settings initialized."); + + //Event that settings are safe to use: + ["ace_settingsInitialized", []] call CBA_fnc_localEvent; + + //Set init finished and run all delayed functions: + GVAR(settingsInitFinished) = true; + INFO_1("%1 delayed functions running.",count GVAR(runAtSettingsInitialized)); + { + (_x select 1) call (_x select 0); + false + } count GVAR(runAtSettingsInitialized); + GVAR(runAtSettingsInitialized) = nil; //cleanup +}] call CBA_fnc_addEventHandler; + +private _start = diag_tickTime; + +private _settingsConfig = configFile >> "ACE_Settings"; +private _countOptions = count _settingsConfig; +TRACE_1("Reading settings from configFile",_countOptions); +for "_index" from 0 to (_countOptions - 1) do { + private _optionEntry = _settingsConfig select _index; + if (isNil (configName _optionEntry)) then { + [_optionEntry] call FUNC(cbaSettings_loadFromConfig); + } else { + WARNING_1("Setting [%1] - Already defined from somewhere else??",_varName); + }; +}; + +_settingsConfig = missionConfigFile >> "ACE_Settings"; +_countOptions = count _settingsConfig; +TRACE_1("Reading settings from missionConfigFile",_countOptions); +for "_index" from 0 to (_countOptions - 1) do { + private _optionEntry = _settingsConfig select _index; + private _settingName = configName _optionEntry; + if ((toLower _settingName) in GVAR(cbaSettings_forcedSettings)) then { + WARNING_1("Setting [%1] - Already Forced - ignoring missionConfig",_varName); + } else { + if (isNil _settingName) then { + // New setting, that was first defined in missionConfigFile + [_optionEntry] call FUNC(cbaSettings_loadFromConfig); + } else { + private _value = (_optionEntry >> "value") call BIS_fnc_getCfgData; + if (isNil "_value") exitWith {ERROR_1("Setting [%1] - Has bad value",_settingName);}; + TRACE_2("queuing missionConfig setting",_settingName,_value); + GVAR(cbaSettings_missionSettings) pushBack [_settingName, _value]; + }; + }; +}; + +// Warning if using a custom ACE_ServerSettings config +if (isServer && {isClass (configFile >> "ACE_ServerSettings")}) then { + WARNING("ACE_ServerSettings is no longer supported and will be ignored"); +}; + +INFO_1("Parsed Settings Configs [%1 ms]",(1000 * (diag_tickTime - _start)) toFixed 1); diff --git a/addons/common/functions/fnc_cbaSettings_loadFromConfig.sqf b/addons/common/functions/fnc_cbaSettings_loadFromConfig.sqf new file mode 100644 index 0000000000..1382942732 --- /dev/null +++ b/addons/common/functions/fnc_cbaSettings_loadFromConfig.sqf @@ -0,0 +1,105 @@ +/* + * Author: PabstMirror + * Converts a ace_setting config into a cba setting + * + * Arguments: + * 0: Setting config + * + * Return Value: + * None + * + * Example: + * [] call ace_common_fnc_cbaSettings_loadFromConfig; + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["_config"]; + +private _varName = configName _config; +private _typeName = toUpper getText (_config >> "typeName"); +if (_typeName == "") then { + WARNING_1("Setting [%1] Has no typeName",_varName); + _typeName = "SCALAR"; +}; +TRACE_3("loadFromConfig",_var,_typeName,_config); + +private _isClientSettable = (getNumber (_config >> "isClientSettable")) > 0; +private _localizedName = getText (_config >> "displayName"); +private _localizedDescription = getText (_config >> "description"); +private _isForced = (getNumber (_config >> "force")) > 0; +private _category = getText (_config >> "category"); + +private _cbaIsGlobal = (!_isClientSettable) || _isForced; +if (_isForced) then {GVAR(cbaSettings_forcedSettings) pushBack (toLower _varName);}; + +// Basic handling of setting types CBA doesn't support: +if (_typeName == "ARRAY") exitWith { + WARNING_1("Setting [%1] is type ARRAY - limited support",_varName); + private _value = getArray (_config >> "value"); + if (isServer) then {missionNamespace setVariable [_varName, _value, true];}; +}; + +private _cbaSettingType = ""; +private _cbaValueInfo = []; +switch (_typeName) do { +case ("SCALAR"): { // ACE's Scalar can be a float or an index for a list + if (!isNumber (_config >> "value")) then {WARNING_2("Setting [%1] - value type [%2] is missing number",_varName,_typeName);}; + if (isArray (_config >> "values")) then { + _cbaSettingType = "LIST"; // [_values, _valueTitles, _defaultIndex] + private _values = []; + private _valueTitles = []; + { + _values pushBack _forEachIndex; + _valueTitles pushBack (if ((_x select [0, 1]) == "$") then {localize (_x select [1]);} else {_x}); + } forEach (getArray (_config >> "values")); + _cbaValueInfo = [_values, _valueTitles, getNumber (_config >> "value")]; + } else { + _cbaSettingType = "SLIDER"; // [_min, _max, _default, _trailingDecimals] + _cbaValueInfo = if (isArray (_config >> "sliderSettings")) then { + getArray (_config >> "sliderSettings"); + } else { + INFO_1("Using auto min/max for [%1]",_varName); + [-1, 5000, 0, 1] + }; + _cbaValueInfo set [2, getNumber (_config >> "value")]; + }; + }; +case ("BOOL"): { + if (!isNumber (_config >> "value")) then {WARNING_2("Setting [%1] - value type [%2] is missing number",_varName,_typeName);}; + _cbaSettingType = "CHECKBOX"; + _cbaValueInfo = (getNumber (_config >> "value")) > 0; + }; +case ("COLOR"): { + if (!isArray (_config >> "value")) then {WARNING_2("Setting [%1] - value type [%2] is missing array",_varName,_typeName);}; + _cbaSettingType = "COLOR"; + _cbaValueInfo = getArray (_config >> "value"); + }; +case ("STRING"): { + if (!isText (_config >> "value")) then {WARNING_2("Setting [%1] - value type [%2] is missing text",_varName,_typeName);}; + _cbaSettingType = "EDITBOX"; + _cbaValueInfo = getText (_config >> "value"); + }; +}; + +if (_cbaSettingType == "") exitWith {ERROR_3("Setting [%1] - value type [%2] is unknown - %3",_varName,_typeName,_cbaValueInfo);}; + +if (_localizedDescription == "") then {_localizedDescription = _varName}; +if (_category == "") then { + // WARNING_1("Setting [%1] - no category",_varName); + _category = "Uncategorized"; +}; +if (((_varName select [0, 4]) == "ACE_") && {(_category select [0, 3]) != "ACE"}) then {_category = format ["ACE %1", _category];}; +if (((_varName select [0, 5]) == "ACEX_") && {(_category select [0, 4]) != "ACEX"}) then {_category = format ["ACEX %1", _category];}; + +private _code = compile format ['["%1", _this] call FUNC(cbaSettings_settingChanged)', _varName]; + +TRACE_2("setting",_cbaSettingType,_cbaValueInfo); +TRACE_4("",_isForced,_cbaIsGlobal,_category,_cbaValueInfo); +private _return = [_varName, _cbaSettingType, [_localizedName, _localizedDescription], _category, _cbaValueInfo, _cbaIsGlobal, _code] call CBA_settings_fnc_init; +TRACE_1("returned",_return); +if ((isNil "_return") || {_return != 0}) then {ERROR_1("Setting [%1] - CBA Error",_varName);}; +_return + diff --git a/addons/common/functions/fnc_cbaSettings_settingChanged.sqf b/addons/common/functions/fnc_cbaSettings_settingChanged.sqf new file mode 100644 index 0000000000..6fa99e313d --- /dev/null +++ b/addons/common/functions/fnc_cbaSettings_settingChanged.sqf @@ -0,0 +1,33 @@ +/* + * Author: PabstMirror + * Function for handeling a cba setting being changed. + * Adds warning if global setting is changed after ace_settingsInitialized + * + * Arguments: + * 0: Setting Name + * 1: New Value + * 2: Can be changed mid-mission (default: false) + * + * Return Value: + * None + * + * Example: + * ["ace_medical_level", 1, false] call ace_common_fnc_cbaSettings_settingChanged; + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["_settingName", "_newValue", ["_canBeChanged", false]]; +TRACE_2("",_settingName,_newValue); + +["ace_settingChanged", [_settingName, _newValue]] call CBA_fnc_localEvent; + +if (_canBeChanged) exitWith {}; +if (!GVAR(settingsInitFinished)) exitWith {}; // Ignore changed event before CBA_settingsInitialized +if (CBA_settings_default getVariable [_settingName, []] param [7, 0] == 0) exitWith {}; // Ignore if not a global setting +if ((getNumber (configFile >> "ACE_settings" >> _settingName >> "canBeChanged")) == 1) exitWith {}; // Ignore if flagged as ok to change + +WARNING_1("Global setting [%1] changed mid-mission",_settingName); +[QGVAR(displayTextStructured), [format ["Global setting %1 changed mid-mission. Mission restart may be required to prevent issues", _settingName], 4]] call CBA_fnc_localEvent; diff --git a/addons/common/functions/fnc_cbaSettings_transferUserSettings.sqf b/addons/common/functions/fnc_cbaSettings_transferUserSettings.sqf new file mode 100644 index 0000000000..8d55f671b7 --- /dev/null +++ b/addons/common/functions/fnc_cbaSettings_transferUserSettings.sqf @@ -0,0 +1,42 @@ +/* + * Author: PabstMirror + * Transfers a client's old ace settings to cba + * + * Arguments: + * 0: Old Version + * + * Return Value: + * None + * + * Example: + * ["3.11.0"] call ace_common_fnc_cbaSettings_transferUserSettings + * + * Public: No + */ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +params [["_lastVersion", "", [""]]]; + +if ((parseNumber _lastVersion) >= 3.12) exitWith {}; + +INFO("-Transfering old ACE_Settings to CBA-"); + +private _aceSettings = configProperties [configFile >> "ACE_Settings", "isClass _x"]; +{ + private _settingName = configName _x; + private _isClientSettable = (getNumber (_x >> "isClientSettable")) > 0; + private _profileVar = profileNamespace getVariable _settingName; + + if (!isNil "_profileVar") then { + private _currentValue = [_settingName, "client"] call CBA_settings_fnc_get; + if (_isClientSettable && {!(_currentValue isEqualTo _profileVar)}) then { + // CBA_settings_fnc_set will do type checking for the old profile var + private _ret = [_settingName, _profileVar, 0, "client", true] call CBA_settings_fnc_set; + INFO_3("Transfering setting [%1: %2] returned %3", _settingName, _profileVar, _ret); + }; + }; +} forEach _aceSettings; + +INFO("-Finished Transfering-"); 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 f0821f3f4c..1a3d34bc86 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" @@ -75,7 +78,17 @@ if (toLower (productVersion select 6) in ["linux", "osx"]) then { private _versionEx = _x callExtension "version"; if (_versionEx == "") then { - private _errorMsg = format ["Extension %1.dll not installed.", _x]; + private _extension = ".dll"; + + if (productVersion select 7 == "x64") then { + _extension = "_x64.dll"; + }; + + if (productVersion select 6 == "Linux") then { + _extension = ".so"; + }; + + private _errorMsg = format ["Extension %1%2 not found.", _x, _extension]; 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..8df41cb241 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" @@ -27,10 +30,17 @@ _target setVariable [QGVAR(owner), _unit, true]; // lock target object if (_lockTarget) then { + private _canBeDisassembled = !([] isEqualTo getArray (_target call CBA_fnc_getObjectConfig >> "assembleInfo" >> "dissasembleTo")); if (!isNull _unit) then { [QGVAR(lockVehicle), _target, _target] call CBA_fnc_targetEvent; + if (_canBeDisassembled) then { + _target enableWeaponDisassembly false; + }; } else { [QGVAR(unlockVehicle), _target, _target] call CBA_fnc_targetEvent; + if (_canBeDisassembled) then { + _target enableWeaponDisassembly true; + }; }; }; 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 7b692ce300..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) 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..57099afe90 100644 --- a/addons/common/functions/fnc_endRadioTransmission.sqf +++ b/addons/common/functions/fnc_endRadioTransmission.sqf @@ -1,7 +1,7 @@ /* * Author: commy2 * - * End radio transmissions of addons TFAR and ACRE2. TFAR v0.9.7, ACRE Public Beta 2.0.3.571 + * End radio transmissions of addons TFAR and ACRE2. TFAR v0.9.x, ACRE Public Beta 2.0.3.571 * * Arguments: * None @@ -9,10 +9,15 @@ * Return Value: * None * + * Example: + * call ace_common_fnc_endRadioTransmission + * * Public: No */ #include "script_component.hpp" +["ace_endRadioTransmissions"] call CBA_fnc_localEvent; + // ACRE if (isClass (configFile >> "CfgPatches" >> "acre_main")) then { [-1] call acre_sys_core_fnc_handleMultiPttKeyPressUp; 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..1be21e0e58 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" @@ -35,7 +38,7 @@ if (_textMessage isEqualType "") then { _textMessage = parseText _textMessage; }; -(ARR_SELECT(_this,4,call BIS_fnc_displayMission)) createDisplay "RscDisplayCommonMessagePause"; +ARR_SELECT(_this,4,call BIS_fnc_displayMission) createDisplay "RscDisplayCommonMessagePause"; private _display = uiNamespace getVariable "RscDisplayCommonMessage_display"; private _ctrlRscMessageBox = _display displayCtrl 2351; 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..3eaf7665cd 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 9ef2ad4704..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" 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 7854380b18..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,7 +22,7 @@ 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); diff --git a/addons/common/functions/fnc_getMapData.sqf b/addons/common/functions/fnc_getMapData.sqf index 5fd183a3a3..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,13 +24,14 @@ _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 ["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] }; @@ -95,6 +99,7 @@ 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] }; diff --git a/addons/common/functions/fnc_getMapGridData.sqf b/addons/common/functions/fnc_getMapGridData.sqf index 60edb8941d..a33e49e7d0 100644 --- a/addons/common/functions/fnc_getMapGridData.sqf +++ b/addons/common/functions/fnc_getMapGridData.sqf @@ -68,15 +68,13 @@ 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..fd556ed580 --- /dev/null +++ b/addons/common/functions/fnc_getVehicleIcon.sqf @@ -0,0 +1,48 @@ +/* + * 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 }; + +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/movement/functions/fnc_getWeight.sqf b/addons/common/functions/fnc_getWeight.sqf similarity index 56% rename from addons/movement/functions/fnc_getWeight.sqf rename to addons/common/functions/fnc_getWeight.sqf index b64abc3623..6c3a224582 100644 --- a/addons/movement/functions/fnc_getWeight.sqf +++ b/addons/common/functions/fnc_getWeight.sqf @@ -4,23 +4,24 @@ * * Arguments: * 0: The Unit (usually the player) + * 1: Force a return type * * Return Value: * The return value * * Example: - * [player] call ace_movement_fnc_getWeight + * [player] call ace_common_fnc_getWeight * * Public: No */ #include "script_component.hpp" -params ["_unit"]; +params ["_unit", ["_useImperial", false, [false, 0]]]; private _virtualLoad = 0; { - _virtualLoad = _virtualLoad + (_x getVariable [QGVAR(vLoad), 0]); + _virtualLoad = _virtualLoad + (_x getVariable [QEGVAR(movement,vLoad), 0]); } forEach [ _unit, uniformContainer _unit, @@ -30,10 +31,9 @@ private _virtualLoad = 0; private _weight = (loadAbs _unit + _virtualLoad) * 0.1; -if (GVAR(useImperial)) then { - _weight = format ["%1lb", (round (_weight * 100)) / 100]; +//Return +if (_useImperial in [true, 1]) then { + format ["%1lb", (round (_weight * 100)) / 100] } else { - _weight = format ["%1kg", (round (_weight * FACTOR_POUND_TO_KILOGRAMM * 100)) / 100]; + format ["%1kg", (round (_weight * (1/2.2046) * 100)) / 100] }; - -_weight 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 aac21aab7a..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" diff --git a/addons/common/functions/fnc_isAwake.sqf b/addons/common/functions/fnc_isAwake.sqf index c23052e3f6..1632e1800e 100644 --- a/addons/common/functions/fnc_isAwake.sqf +++ b/addons/common/functions/fnc_isAwake.sqf @@ -8,10 +8,13 @@ * Return Value: * if unit is awake * + * Example: + * [bob] call ace_common_fnc_isAwake + * * Public: Yes */ #include "script_component.hpp" params ["_unit"]; -alive _unit && {!(_unit getVariable [QEGVAR(medical,isUnconscious), false])} +alive _unit && {!(_unit getVariable ["ACE_isUnconscious", false])} 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..dfe3869905 100644 --- a/addons/common/functions/fnc_isFeatureCameraActive.sqf +++ b/addons/common/functions/fnc_isFeatureCameraActive.sqf @@ -5,6 +5,7 @@ * - Curator * - ACE Spectator * - Arsenal camera (BIS_fnc_arsenal) + * - Nexus Spectator (BIS_fnc_EGSpectator) * - Establishing shot (BIS_fnc_establishingShot) * - Splendid camera (BIS_fnc_camera) * - Animation viewer (BIS_fnc_animViewer) @@ -25,10 +26,11 @@ !( isNull curatorCamera && // Curator - {isNull (GETMVAR(EGVAR(spectator,camera),objNull))} && // 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 - {isNull (GETUVAR(BIS_fnc_animViewer_cam, objNull))} && // Animation viewer camera - {isNull (GETMVAR(BIS_DEBUG_CAM, objNull))} // Classic camera + {!GETMVAR(EGVAR(spectator,isSet),false)} && // ACE Spectator + {isNull GETMVAR(BIS_EGSpectatorCamera_camera, objNull)} && // BIS Nexus 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 + {isNull GETUVAR(BIS_fnc_animViewer_cam, objNull)} && // Animation viewer camera + {isNull GETMVAR(BIS_DEBUG_CAM, objNull)} // Classic camera ) // return 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..f6a759add8 100644 --- a/addons/common/functions/fnc_loadPersonLocal.sqf +++ b/addons/common/functions/fnc_loadPersonLocal.sqf @@ -10,15 +10,18 @@ * Return Value: * None * + * Example: + * [bob, car, kevin] call ace_common_fnc_loadPersonLocal + * * Public: Yes */ #include "script_component.hpp" params ["_unit", "_vehicle", "_caller"]; -if (!alive _unit) then { - // _unit = [_unit, _caller] call FUNC(makeCopyOfBody); //func does not exist -}; +// if (!alive _unit) then { +// _unit = [_unit, _caller] call makeCopyOfBody; //func does not exist +// }; private _slotsOpen = false; diff --git a/addons/common/functions/fnc_loadSettingsFromProfile.sqf b/addons/common/functions/fnc_loadSettingsFromProfile.sqf deleted file mode 100644 index 46b0134740..0000000000 --- a/addons/common/functions/fnc_loadSettingsFromProfile.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Author: esteldunedain - * Load the user setable settings from the user profile. - * Config < Server UserConfig < Mission Config < Client settings - * - * Arguments: - * None - * - * Return Value: - * None - * - * Public: No - */ -#include "script_component.hpp" - -// Iterate through settings -{ - _x params ["_name", "", "_isClientSetable", "", "", "", "_isForced"]; - - // If setting is user setable - if (_isClientSetable) then { - // If setting is not forced - if !(_isForced) then { - private _profileValue = profileNamespace getVariable _name; - - // If the setting is stored on the profile - if !(isNil "_profileValue") then { - // If the profile variable has the correct type - if (_profileValue isEqualType (missionNamespace getVariable _name)) then { - // Load the setting from the profile - missionNamespace setVariable [_name, _profileValue]; - }; - }; - }; - }; - false -} count GVAR(settings); diff --git a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf deleted file mode 100644 index 3fe182b7e3..0000000000 --- a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Author: Glowbal - * Parse all settings and load the localized displayName and description for all text - * - * Arguments: - * None - * - * Return Value: - * None - * - * Public: No - */ -#include "script_component.hpp" - -private _fnc_parseConfigForDisplayNames = { - params ["_optionEntry"]; - - if !(isClass _optionEntry) exitWith {false}; - - private _values = getArray (_optionEntry >> "values"); - - _x set [3, getText (_optionEntry >> "displayName")]; - _x set [4, getText (_optionEntry >> "description")]; - _x set [5, _values]; - _x set [8, getText (_optionEntry >> "category")]; - - { - private _text = _x; - - if (_text isEqualType "" && {count _text > 1} && {_text select [0, 1] == "$"}) then { - _text = localize (_text select [1]); //chop off the leading $ - _values set [_forEachIndex, _text]; - }; - } forEach _values; - - if (!(_values isEqualTo [])) then { - if (_typeOf != "SCALAR") then { - WARNING_2("Setting [%1] has values[] but is not SCALAR (%2)", _name, _typeOf); - } else { - private _value = missionNamespace getVariable [_name, -1]; - if ((_value < 0) || {_value >= (count _values)}) then { - WARNING_3("Setting [%1] out of bounds %2 (values[] count is %3)", _name, _value, count _values); - }; - }; - }; - true -}; - -// Iterate through settings -{ - _x params ["_name", "_typeOf"]; - - if !([configFile >> "ACE_Settings" >> _name] call _fnc_parseConfigForDisplayNames) then { - if !([configFile >> "ACE_ServerSettings" >> _name] call _fnc_parseConfigForDisplayNames) then { - if !([missionConfigFile >> "ACE_Settings" >> _name] call _fnc_parseConfigForDisplayNames) then { - WARNING_1("Setting found, but couldn't localize [%1] (server has but we don't?)",_name); - }; - }; - }; - false -} count GVAR(settings); diff --git a/addons/common/functions/fnc_loadSettingsOnServer.sqf b/addons/common/functions/fnc_loadSettingsOnServer.sqf deleted file mode 100644 index 4498c9d058..0000000000 --- a/addons/common/functions/fnc_loadSettingsOnServer.sqf +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Author: esteldunedain - * Load the parameters on the server. - * Config < Server UserConfig < Mission Config - * - * Arguments: - * None - * - * Return Value: - * None - * - * Public: No - */ -#include "script_component.hpp" - -GVAR(settings) = []; - -private _fnc_parseConfigForSettings = { - params ["_config"]; - - private _countOptions = count _config; - - for "_index" from 0 to (_countOptions - 1) do { - private _optionEntry = _config select _index; - [_optionEntry] call FUNC(setSettingFromConfig); - }; - - // Check if all settings should be forced - if (GVAR(forceAllSettings)) then { - { - _x set [6, true]; - false - } count GVAR(settings); - }; -}; - -// Order is this way because: -// ACE_Settings should never force any setting by default. Loading it first ensures that all settings from ACE_Settings exist. -// This way, ACE_ServerSettings will override ACE_Settings, even if no force is used. -// Mission settings will override the server config settings, if no force is used. -// This ensures that all settings are of their correct type, in case an outdated or corrupt server config is used , as well as have their correct localized display name and description - -// Regular config -[configFile >> "ACE_Settings"] call _fnc_parseConfigForSettings; - -// Server config -[configFile >> "ACE_ServerSettings"] call _fnc_parseConfigForSettings; - -// mission side settings -[missionConfigFile >> "ACE_Settings"] call _fnc_parseConfigForSettings; - -// Publish all setting values -{ - publicVariable (_x select 0); - false -} count GVAR(settings); diff --git a/addons/common/functions/fnc_moduleCheckPBOs.sqf b/addons/common/functions/fnc_moduleCheckPBOs.sqf index 23c9b7ffd3..6cdfd0d811 100644 --- a/addons/common/functions/fnc_moduleCheckPBOs.sqf +++ b/addons/common/functions/fnc_moduleCheckPBOs.sqf @@ -10,12 +10,13 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_common_fnc_moduleCheckPBOs + * * Public: No */ #include "script_component.hpp" -if !(isServer) exitWith {}; - params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; 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..fde3848cf8 100644 --- a/addons/common/functions/fnc_playConfigSound3D.sqf +++ b/addons/common/functions/fnc_playConfigSound3D.sqf @@ -1,35 +1,43 @@ /* * Author: esteldunedain - * Plays a sound defined in CfgSounds using playSound3D, with global effect + * Plays a sound defined in CfgSounds using playSound3D, with global effect. * * Arguments: * 0: Sound class * 1: Position ASL - * 2: Volume - * 3: Distance + * 2: Volume (default: from sound config) + * 3: Distance (default: from sound config) * * Return Value: * None * + * Example: + * ["hint", getPosASL player, 5, 5] call ace_common_fnc_playConfigSound3D + * * Public: Yes */ -#define DEBUG_MODE_FULL #include "script_component.hpp" params ["_soundClass", "_posASL", "_volume", "_distance"]; -private _cfgSound = configFile >> "CfgSounds" >> _soundClass; - -if (!isClass _cfgSound) exitWith { - ERROR_1("CfgSounds class [%1] does not exist", _soundClass); +private _sound = getArray (configFile >> "CfgSounds" >> _soundClass >> "sound"); +if (_sound isEqualTo []) exitWith { + ERROR_1("CfgSounds class [%1] does not exist or contains empty sound array", _soundClass); }; +TRACE_2("sound",_soundClass,_sound); + +_sound params ["_fileName", "_cfgVolume", "_pitch", ["_cfgDistance", 0]]; + +ISNILS(_volume,_cfgVolume); +ISNILS(_distance,_cfgDistance); -private _args = getArray (_cfgSound >> "sound"); -TRACE_1("playConfigSound3D args", _args); -private _pitch = (_args select 2); // Strip the first \ from the filename -private _fileName = _args select 0; -_fileName = _fileName select [1, count _fileName - 1]; -TRACE_1("playConfigSound3D filename", _fileName); +_fileName = _fileName select [1]; + +// add file extension .wss as default +if !(toLower (_fileName select [count _fileName - 4]) in [".wav", ".ogg", ".wss"]) then { + ADD(_fileName,".wss"); +}; +TRACE_5("vars",_fileName,_posASL,_volume,_pitch,_distance); playSound3D [_fileName, objNull, false, _posASL, _volume, _pitch, _distance]; diff --git a/addons/common/functions/fnc_player.sqf b/addons/common/functions/fnc_player.sqf index 1a268515a7..537b54568f 100644 --- a/addons/common/functions/fnc_player.sqf +++ b/addons/common/functions/fnc_player.sqf @@ -4,11 +4,14 @@ * Use this in INIT and RESPAWN eh scripts, because ACE_player isn't reset yet. * * Arguments: - * NONE. + * None * * 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..0e40f55412 100644 --- a/addons/common/functions/fnc_readSettingFromModule.sqf +++ b/addons/common/functions/fnc_readSettingFromModule.sqf @@ -1,7 +1,7 @@ /* * Author: esteldunedain * Reads a setting value from a module, set it and force it. Logs if the setting is missing from the module. - * Must be called on the server, effect is global. + * Must be called on all machines!!!!!!! * * Arguments: * 0: Module @@ -11,14 +11,21 @@ * Return Value: * None * + * Example: + * [MODULE, "Param", "paramname"] call ace_common_fnc_readSettingFromModule + * * Public: No */ +#define DEBUG_MODE_FULL #include "script_component.hpp" -if !(isServer) exitWith {}; - params ["_logic", "_settingName", "_moduleVariable"]; +// Check if the variable is already defined +if (isNil _settingName) exitWith { + ERROR_1("readSettingFromModule - param [%1] is not an ace_setting", _settingName); +}; + // Check if the parameter is defined in the module if (isNil {_logic getVariable _moduleVariable}) exitWith { WARNING_2("Warning in %1 module: %2 setting is missing. Probably an obsolete version of the module is used in the mission.",typeOf _logic,_moduleVariable); @@ -34,5 +41,10 @@ if (_value isEqualTo -1) then { }; }; -// Set the setting globally and force it -[_settingName, _value, true, true] call FUNC(setSetting); +if ([_settingName, "mission"] call CBA_settings_fnc_isForced) then { + WARNING_1("Setting [%1] - Already Forced",_settingName); +}; + +// Set the setting as a mission setting and force it +TRACE_2("setSettingMission from module",_settingName,_value); +["CBA_settings_setSettingMission", [_settingName, _value, true]] call CBA_fnc_localEvent; diff --git a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf index 5faf1f52cf..8b8a0ee9c6 100644 --- a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf +++ b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf @@ -14,6 +14,7 @@ * * Public: No */ +#define DEBUG_MODE_FULL #include "script_component.hpp" //paramsArray is a normal variable not a command @@ -35,12 +36,6 @@ TRACE_1("Reading missionConfigFile params",_paramsArray); ERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting", _settingName); }; - private _settingData = [_settingName] call FUNC(getSettingData); - _settingData params ["", "_typeName", "", "", "", "", "_isForced"]; - - // Check if it's already forced and quit - if (_isForced) exitWith {WARNING_1("readSettingsFromParamsArray - param [%1] is already set and forced", _settingName);}; - // The setting is not forced, so update the value // Read entry and cast it to the correct type from the existing variable private _validValue = false; @@ -57,7 +52,12 @@ TRACE_1("Reading missionConfigFile params",_paramsArray); WARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]", _settingName,_settingValue,_typeName); }; - // Update the variable globaly and Force - [_settingName, _settingValue, true, true] call FUNC(setSetting); + if ([_settingName, "mission"] call CBA_settings_fnc_isForced) then { + WARNING_1("Setting [%1] - Already Forced",_settingName); + }; + + // Set the setting as a mission setting and force it + TRACE_2("setSettingMission from module",_settingName,_value); + ["CBA_settings_setSettingMission", [_settingName, _value, true]] call CBA_fnc_localEvent; }; } forEach _paramsArray; 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 f4858b877b..e93e09c0f0 100644 --- a/addons/common/functions/fnc_setName.sqf +++ b/addons/common/functions/fnc_setName.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_common_fnc_setName + * * Public: No */ #include "script_component.hpp" 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_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_setSetting.sqf b/addons/common/functions/fnc_setSetting.sqf index fc2dc92339..1d98f613fd 100644 --- a/addons/common/functions/fnc_setSetting.sqf +++ b/addons/common/functions/fnc_setSetting.sqf @@ -18,68 +18,19 @@ * * Public: No */ +#define DEBUG_MODE_FULL #include "script_component.hpp" params ["_name", "_value", ["_force", false], ["_broadcastChanges", false]]; +TRACE_4("setSetting",_name,_value,_force,_broadcastChanges); -private _settingData = [_name] call FUNC(getSettingData); - -// Exit if the setting does not exist -if (_settingData isEqualTo []) exitWith { - ERROR_1("SetSetting [%1] setting does not exist", _name); +if (!isServer) exitWith {}; +if (!_broadcastChanges) exitWith { + ERROR_1("Setting [%1] - SetSetting no longer supports non-global settings",_name); }; -_settingData params ["", "_typeName", "_isClientSetable", "", "", "", "_isForced"]; - -// Exit if the setting is already forced -if (_isForced) exitWith { - INFO_1("SetSetting [%1] Trying to set forced setting", _name); +if ([_settingName, "mission"] call CBA_settings_fnc_isForced) then { + WARNING_1("Setting [%1] - Already mission forced - Ignoring",_settingName); }; -//This does NOT broadcast changes to GVAR(settings), so clients would not get updated force status -if ((missionNamespace getVariable [QEGVAR(modules,serverModulesRead), false]) && {!(_isForced isEqualTo _force)}) then { - WARNING_3("SetSetting [%1] attempting to broadcast a change to force (%2 to %3)", _name, _isForced, _force); -}; - -// If the type is not equal, try to cast it -private _failed = false; -if (typeName _value != _settingData select 1) then { - _failed = true; - if ((_typeName == "BOOL") && {_value isEqualType 0}) then { - // If value is not 0 or 1 consider it invalid and don't set anything - if (_value isEqualTo 0) then { - _value = false; - _failed = false; - }; - if (_value isEqualTo 1) then { - _value = true; - _failed = false; - }; - }; - if ((_typeName == "COLOR") && {_value isEqualType []}) then { - _failed = false; - }; -}; - -if (_failed) exitWith {ERROR_3("SetSetting [%1] bad data type expected %2 got %3", _name, _typeName, typeName _value);}; - -// Force it if it was required -_settingData set [6, _force]; - -// Exit if the value didn't change -if (_value isEqualTo (missionNamespace getVariable _name)) exitWith {}; - -// Update the variable -TRACE_2("Variable Updated",_name,_value); -missionNamespace setVariable [_name, _value]; - -if (isServer && {_broadcastChanges}) then { - // Publicize the new value - publicVariable _name; - - // Raise event globally, this publicizes eventual changes in _force status so clients can update it locally - ["ace_settingChanged", [_name, _value, _force]] call CBA_fnc_globalEvent; -} else { - // Raise event locally - ["ace_settingChanged", [_name, _value, _force]] call CBA_fnc_localEvent; -}; +[QGVAR(setSetting), [_name, _value], (format [QGVAR(setSetting_%1), _name])] call CBA_fnc_globalEventJIP; diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf deleted file mode 100644 index ac7a0f4875..0000000000 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Author: esteldunedain - * Load a setting from config if it was not previosuly forced. Force if neccesary. - * - * Arguments: - * 0: Config entry - * - * Return Value: - * None - * - * Public: No - */ -#include "script_component.hpp" - -params ["_optionEntry"]; - -private _fnc_getValueWithType = { - params ["_optionEntry", "_typeName"]; - - private _valueConfig = (_optionEntry >> "value"); - private _value = if (isNumber (_optionEntry >> "value")) then {getNumber (_optionEntry >> "value")} else {0}; - TRACE_3("_fnc_getValueWithType:", configName _optionEntry, _typeName, _value); - if (_typeName == "BOOL") exitWith { - _value > 0 - }; - if (_typeName == "STRING") exitWith { - getText (_optionEntry >> "value") - }; - if (_typeName == "ARRAY") exitWith { - getArray (_optionEntry >> "value") - }; - if (_typeName == "COLOR") exitWith { - getArray (_optionEntry >> "value") - }; - _value -}; - -private _name = configName _optionEntry; - -// Check if the variable is already defined -if (isNil _name) then { - // That setting was not loaded yet - - // Get type from config - private _typeName = getText (_optionEntry >> "typeName"); - if (_typeName == "") then { - _typeName = "SCALAR"; - }; - - // Read entry and cast it to the correct type - private _value = [_optionEntry, _typeName] call _fnc_getValueWithType; - - // Init the variable - missionNamespace setVariable [_name, _value]; - - // Add the setting to a list on the server - // Set the variable to not forced - /*private _settingData = [ - name, - typeName, - isClientSettable, - localizedName, - localizedDescription, - possibleValues, - isForced, - defaultValue, - category - ];*/ - private _settingData = [ - _name, - _typeName, - (getNumber (_optionEntry >> "isClientSettable")) > 0, - "", //getText (_optionEntry >> "displayName"), //No need to broadcast, handeled by fnc_loadSettingsLocalizedText - "", //getText (_optionEntry >> "description"), //No need to broadcast, handeled by fnc_loadSettingsLocalizedText - [], //getArray (_optionEntry >> "values"), //No need to broadcast, handeled by fnc_loadSettingsLocalizedText - getNumber (_optionEntry >> "force") > 0, - _value, - "" //getText (_optionEntry >> "category") //No need to broadcast, handeled by fnc_loadSettingsLocalizedText - ]; - - //Strings in the values array won't be localized from the config, so just do that now: - /*private _values = _settingData select 5; - - { - private _text = _x; - if (((typeName _text) == "STRING") && {(count _text) > 1} && {(_text select [0,1]) == "$"}) then { - _text = localize (_text select [1, ((count _text) - 1)]); //chop off the leading $ - _values set [_forEachIndex, _text]; - }; - } forEach _values;*/ - - - GVAR(settings) pushBack _settingData; - -} else { - // The setting already exists. - - // Check if it's already forced and quit - private _settingData = [_name] call FUNC(getSettingData); - if (_settingData select 6) exitWith {}; - - // The setting is not forced, so update the value - - // Read entry and cast it to the correct type from the existing variable - private _value = [_optionEntry, _settingData select 1] call _fnc_getValueWithType; - - // Update the variable - missionNamespace setVariable [_name, _value]; - - // Force the setting if requested - if (getNumber (_optionEntry >> "force") > 0) then { - _settingData set [6, true]; - }; -}; 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 d1dcc4c922..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; 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..27824cfe2e 100644 --- a/addons/common/functions/fnc_statusEffect_set.sqf +++ b/addons/common/functions/fnc_statusEffect_set.sqf @@ -9,14 +9,13 @@ * 3: Is Set (true adds/false removes) * * Return Value: - * Nothing + * None * * Example: * [player, "setCaptive", "reason1", true] call ace_common_fnc_statusEffect_set * * Public: Yes */ -// #define DEBUG_MODE_FULL #include "script_component.hpp" params [["_object", objNull, [objNull]], ["_effectName", "", [""]], ["_ID", "", [""]], ["_set", true, [false]]]; @@ -32,7 +31,7 @@ if (isNull _object) exitWith {TRACE_1("null",_object);}; [_object, true] call FUNC(statusEffect_resetVariables); //Check for mismatch, and set object ref -//check ID case and set globaly if not already set: +//check ID case and set globally if not already set: _ID = toLower _ID; private _statusReasons = missionNamespace getVariable [(format [QGVAR(statusEffects_%1), _effectName]), []]; private _statusIndex = _statusReasons find _ID; @@ -62,9 +61,13 @@ if (_set isEqualTo (_effectBoolArray select _statusIndex)) exitWith { TRACE_2("Setting to new value",_set,_effectBoolArray select _statusIndex); _effectBoolArray set [_statusIndex, _set]; -_effectNumber = _effectBoolArray call FUNC(toBitmask); //Convert array back to number +private _newEffectNumber = _effectBoolArray call FUNC(toBitmask); //Convert array back to number -TRACE_2("Saving globaly",_effectVarName,_effectNumber); -_object setVariable [_effectVarName, _effectNumber, true]; +TRACE_2("Saving globally",_effectVarName,_newEffectNumber); +_object setVariable [_effectVarName, _newEffectNumber, true]; -[_object, _effectName] call FUNC(statusEffect_sendEffects); +if (_effectNumber == 0 || {_newEffectNumber == 0}) then { + [_object, _effectName] call FUNC(statusEffect_sendEffects); +} else { + LOG("not sending more than once"); +}; 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_switchPersistentLaser.sqf b/addons/common/functions/fnc_switchPersistentLaser.sqf new file mode 100644 index 0000000000..5ba9d5ce05 --- /dev/null +++ b/addons/common/functions/fnc_switchPersistentLaser.sqf @@ -0,0 +1,65 @@ +/* + * Author: Dystopian + * Controls persistent laser state. + * + * Arguments: + * 0: Enabled + * + * Return Value: + * None + * + * Example: + * true call ace_common_fnc_switchPersistentLaser + * + * Public: No + */ +#include "script_component.hpp" + +params ["_enabled"]; + +if (!_enabled) exitWith { + if (isNil QGVAR(laserKeyDownEH)) exitWith {}; + ["KeyDown", GVAR(laserKeyDownEH)] call CBA_fnc_removeDisplayHandler; + ["weapon", GVAR(laserWeaponEH)] call CBA_fnc_removePlayerEventHandler; + ["turret", GVAR(laserTurretEH)] call CBA_fnc_removePlayerEventHandler; + ["vehicle", GVAR(laserVehicleEH)] call CBA_fnc_removePlayerEventHandler; +}; + +GVAR(laserKeyDownEH) = ["KeyDown", { + if !((_this select 1) in actionKeys "headlights") exitWith {false}; + private _weapon = currentWeapon ACE_player; + [ + { + params ["_weapon", "_laserWasEnabled"]; + private _laserEnabled = ACE_player isIRLaserOn _weapon || {ACE_player isFlashlightOn _weapon}; + if (_laserEnabled && {_laserWasEnabled} || {!_laserEnabled && {!_laserWasEnabled}}) exitWith {}; + private _weaponIndex = [ACE_player, _weapon] call FUNC(getWeaponIndex); + ACE_player setVariable [QGVAR(laserEnabled_) + str _weaponIndex, [nil, true] select _laserEnabled]; + }, + [_weapon, ACE_player isIRLaserOn _weapon || {ACE_player isFlashlightOn _weapon}] + ] call CBA_fnc_execNextFrame; + false +}] call CBA_fnc_addDisplayHandler; + +private _laserEH = { + if (sunOrMoon > 0.5) exitWith {}; + params ["_player"]; + private _weaponIndex = [_player, currentWeapon _player] call FUNC(getWeaponIndex); + if ( + !(_player getVariable [QGVAR(laserEnabled_) + str _weaponIndex, false]) + || {_weaponIndex > 0 && {"" != primaryWeapon _player}} // Arma switches to primary weapon if exists + || {!(_player call CBA_fnc_canUseWeapon)} // ignore in vehicle except FFV + ) exitWith {}; + [ + // wait for weapon in "ready to fire" direction + {0.01 > getCameraViewDirection _this vectorDistance (_this weaponDirection currentWeapon _this)}, + {{_this action [_x, _this]} forEach ["GunLightOn", "IRLaserOn"]}, + _player, + 3, + {{_this action [_x, _this]} forEach ["GunLightOn", "IRLaserOn"]} + ] call CBA_fnc_waitUntilAndExecute; +}; + +GVAR(laserWeaponEH) = ["weapon", _laserEH] call CBA_fnc_addPlayerEventHandler; +GVAR(laserTurretEH) = ["turret", _laserEH] call CBA_fnc_addPlayerEventHandler; +GVAR(laserVehicleEH) = ["vehicle", _laserEH] call CBA_fnc_addPlayerEventHandler; 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_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..c578bbf2df 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -3,15 +3,19 @@ * 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 */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" #define GROUP_SWITCH_ID QFUNC(loadPerson) @@ -35,32 +39,51 @@ if (count _emptyPos != 3) exitwith { unassignVehicle _unit; [_unit] orderGetIn false; -TRACE_1("Ejecting", alive _unit); +private _resetUncon = false; +if (lifeState _unit == "INCAPACITATED") then { + _resetUncon = true; + _unit setUnconscious false; + TRACE_1("pausing setUnconscious",_unit); +}; +TRACE_1("Ejecting", alive _unit); _unit action ["Eject", vehicle _unit]; [{ - params ["_unit", "_emptyPos"]; + params ["_unit", "_emptyPos", "_resetUncon"]; + + if ((vehicle _unit) != _unit) then { + WARNING_2("Failed to unload in time [%1 - %2]",_unit, vehicle _unit); + }; _unit setPosASL AGLToASL _emptyPos; - if !([_unit] call FUNC(isAwake)) then { - TRACE_1("Check if isAwake", [_unit] call FUNC(isAwake)); - - if (driver _unit == _unit) then { - private _anim = [_unit] call FUNC(getDeathAnim); - - [_unit, _anim, 1, true] call FUNC(doAnimation); - - [{ - params ["_unit", "_anim"]; - if ((_unit getVariable "ACE_isUnconscious") and (animationState _unit != _anim)) then { - [_unit, _anim, 2, true] call FUNC(doAnimation); - }; - }, [_unit, _anim], 0.5] call CBA_fnc_waitAndExecute; - }; + if (_resetUncon) then { + TRACE_1("resuming setUnconscious",_unit); + // This should reset the unit to an Unconscious animation + // Also has the hilarious effect of violently ragdolling the guy + _unit setUnconscious true; }; -}, [_unit, _emptyPos], 0.5] call CBA_fnc_waitAndExecute; + + // ToDo [medical-rewrite]: verify we can remove the following commented code + + // if !([_unit] call FUNC(isAwake)) then { + // TRACE_1("Check if isAwake", [_unit] call FUNC(isAwake)); + + // if (driver _unit == _unit) then { + // private _anim = [_unit] call FUNC(getDeathAnim); + + // [_unit, _anim, 1, true] call FUNC(doAnimation); + + // [{ + // params ["_unit", "_anim"]; + // if ((_unit getVariable "ACE_isUnconscious") and (animationState _unit != _anim)) then { + // [_unit, _anim, 2, true] call FUNC(doAnimation); + // }; + // }, [_unit, _anim], 0.5] call CBA_fnc_waitAndExecute; + // }; + // }; +}, [_unit, _emptyPos, _resetUncon], 0.5] call CBA_fnc_waitAndExecute; [_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide); 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 77df6e47bf..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" diff --git a/addons/common/script_component.hpp b/addons/common/script_component.hpp index 66f7ac63bf..9eb8af601f 100644 --- a/addons/common/script_component.hpp +++ b/addons/common/script_component.hpp @@ -32,3 +32,5 @@ "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", "grasstall_exp", "forest_exp"] diff --git a/addons/common/scripts/checkVersionNumber.sqf b/addons/common/scripts/checkVersionNumber.sqf index f407ed57b0..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,9 +63,9 @@ 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; } @@ -75,10 +73,10 @@ if (!isServer) then { // display and log error messages private _fnc_cutComma = { - _string = _this; + 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 7322df6bde..51c9d3c6ff 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -1,6 +1,14 @@ - + + + Common + Allgemein + Comuni + 全般 + 通用 + 通用 + ACE-Team ACE-Team @@ -12,8 +20,10 @@ ACE-Team ACE-Team ACE-Team - ACE-Team + ACE-チーム ACE-Team + ACE-製作團隊 + ACE-制作团队 Advanced @@ -42,6 +52,8 @@ Salva 保存 저장 + 儲存 + 储存 Cancel @@ -56,6 +68,8 @@ Annulla 中止 취소 + 取消 + 取消 ACE Options @@ -70,6 +84,8 @@ Opzioni ACE ACE オプション ACE 옵션 + ACE設定選項 + ACE设定选项 @@ -85,6 +101,8 @@ N + + NNE @@ -99,6 +117,8 @@ NNE 北北東 북북동 + 北北東 + 北北东 NE @@ -113,6 +133,8 @@ NE 北東 북동 + 東北 + 东北 ENE @@ -127,6 +149,8 @@ ENE 東北東 동북동 + 東北東 + 东北东 E @@ -141,6 +165,8 @@ E + + ESE @@ -155,6 +181,8 @@ ESE 東南東 동남동 + 東南東 + 东南东 SE @@ -169,6 +197,8 @@ SE 南東 남동 + 東南 + 东南 SSE @@ -183,6 +213,8 @@ SSE 南南東 남남동 + 南南東 + 南南东 S @@ -197,6 +229,8 @@ S + + SSW @@ -211,6 +245,8 @@ SSO 南南西 남남서 + 南南西 + 南南西 SW @@ -225,6 +261,8 @@ SO 南西 남서 + 西南 + 西南 WSW @@ -239,6 +277,8 @@ OSO 西南西 서남서 + 西南西 + 西南西 W @@ -253,6 +293,8 @@ O 西 + 西 + 西 WNW @@ -267,6 +309,8 @@ ONO 北北西 서북서 + 西北西 + 西北西 NW @@ -281,6 +325,8 @@ NO 北西 북서 + 西北 + 西北 NNW @@ -295,6 +341,8 @@ NNO 北北西 북북서 + 北北西 + 北北西 Action cancelled. @@ -309,6 +357,8 @@ Azione cancellata. 動作を中止した。 행동 취소됨. + 動作已被取消 + 动作已被取消 [ACE] Miscellaneous Items @@ -321,8 +371,10 @@ [ACE] Itens diversos [ACE] Egyéb tárgyak [ACE] Oggetti vari - [ACE] その他のアイテム + [ACE] その他アイテム [ACE] 기타 물품. + [ACE] 雜項 + [ACE] 杂项 Disable Command Menu @@ -337,6 +389,8 @@ Desabilitar menu de comando 指揮メニューを無効化 지휘 메뉴 종료 + 關閉命令選單 + 关闭命令选单 Unknown @@ -351,6 +405,8 @@ Desconhecido 不明 알 수 없음 + 未知的 + 未知的 Normal @@ -379,6 +435,8 @@ Sem voz 音声なし 무음 + 沒聲音 + 没声音 Accept Requests @@ -393,6 +451,8 @@ Accetta la richiesta 要求を受け入れ 요청 수락 + 接受請求 + 接受请求 Decline Requests @@ -407,6 +467,8 @@ Rifiuta la richiesta 要求を拒否 요청 거부 + 拒絕請求 + 拒绝请求 Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions. @@ -421,6 +483,8 @@ 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. @@ -435,6 +499,29 @@ Rejeita pedidos enviados por outros jogadores. Podem ser pedidos para usar/ compartilhar equipamento, realizar certas ações. 他プレイヤからの要求を拒否します。他プレイヤは装備を共有し、使うなど特定の動作をできません。 다른 플레이어가 보내온 요청을 거부합니다. 이것은 장비 사용 / 공유 요청, 특정 작업 수행 등이 될 수 있습니다. + 拒絕由其他玩家送出的請求。包含使用/共享裝備與執行特定動作。 + 拒绝由其他玩家送出的请求。包含使用/共享装备与执行特定动作。 + + + Check PBO Action + Controlla Azioni PBO + 檢查PBO動作 + 检查PBO动作 + PBO 検査の挙動 + + + Check PBO All + Controlla Tutti i PBO + 檢查所有PBO + 检查所有PBO + PBO 全てを検査 + + + Check PBO Whitelist + Controlla Whitelist PBO + 檢查PBO白名單 + 检查PBO白名单 + 許可リスト内の PBO を検査 Feedback icons @@ -449,6 +536,8 @@ Í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. @@ -463,6 +552,8 @@ 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 @@ -477,6 +568,8 @@ Local da barra de progresso プログレス バーの位置 진행 막대의 위치 + 進度欄位置 + 进度栏位置 Set the desired location of the progress bar on your screen. @@ -491,6 +584,8 @@ Define o local desejado da barra de progresso na sua tela. 画面上に表示されるプログレス バーの位置を設定できます。 진행 막대를 원하는 곳에 배치합니다. + 設定進度欄在畫面中的位置 + 设定进度栏在画面中的位置 Hint Background color @@ -505,6 +600,8 @@ Cor do fundo da hint ヒントの背景色 힌트 배경색 + 提示的背景顏色 + 提示的背景颜色 The color of the background from the ACE hints. @@ -519,6 +616,8 @@ A cor de fundo das hints do ACE. ACE によるヒントの背景色を指定します。 ACE힌트의 배경색을 정합니다. + 設定ACE提示的背景顏色. + 设定ACE提示的背景颜色. Hint text font color @@ -533,6 +632,8 @@ 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. @@ -547,6 +648,20 @@ 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系统的预设颜色。 + + + Persistent weapon laserpointer/flashlight + Автоматический ЛЦУ/тактический фонарь + 武器のレーザー ポインタ/フラッシュライトの永続 + Laser/torcia dell'arma costantemente accesi + + + Enable gunlight after weapon switch or vehicle enter/exit if it was previously enabled. + Включать ЛЦУ/тактический фонарь после смены оружия или входа/выхода из машины, если он был до этого включен. + 銃のライト等を点けていると武器を切り替えた後や車両を乗り降りしても、ライト等を点けたままにします。 + Abilita la torcia/laser dopo il cambio dell'arma o l'entrata/uscita del veicolo se precedentemente attiva. Banana @@ -561,6 +676,8 @@ Banana 甘蕉 바나나 + 香蕉 + 香蕉 A banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa. @@ -575,6 +692,8 @@ 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 @@ -589,6 +708,8 @@ Controlla PBO PBO を検査 PBO 검사 + 檢查PBO檔 + 检查PBO档 Check addon integrity with server and do selected action if an addon is missing. @@ -602,6 +723,8 @@ Controlla l'integrità degli addon con il server ed esegui l'azione selezionata se un addon è mancante サーバがアドオンの整合性を検査し、もし不備があれば実行する動作を選択できます。 서버 에드온의 무결성을 검사하고 사라진 에드온이 있을경우 행동을 선택합니다. + 檢查客戶端與伺服器端的模組清單是否一致且完整,並提供訊息表示遺失的模組。 + 检查客户端与伺服器端的模组清单是否一致且完整,并提供讯息表示遗失的模组。 Action @@ -616,6 +739,8 @@ Azione 動作 작동 + 動作 + 动作 What to do with people who do not have the right PBOs? @@ -628,8 +753,10 @@ Mi legyen azokkal a személyekkel, akiknek nincsenek meg a helyes PBO-k? Что делать с игроками с неправильными аддонами? Cosa fare con giocatori che non hanno i PBO corretti? - プレイヤーが正しい PBO を持っていない場合は? + プレイヤーが正しい PBO を持っていない場合は? 올바르지 않는 PBO를 가진 사람을 어떻게 할까요? + 若玩家沒有正確的PBO檔時,將採取何種動作? + 若玩家没有正确的PBO档时,将采取何种动作? Warn once @@ -644,6 +771,8 @@ Avverti una volta 一度の警告 경고 한 번 + 警告 (一次) + 警告 (一次) Warn (permanent) @@ -656,8 +785,10 @@ Figyelmeztetés (tartós) Предупреждать (постоянно) Avverti (permanente) - 警告(永久的) + 警告 (永久的) 경고 (영구적) + 警告 (持續) + 警告 (持续) Kick @@ -672,6 +803,8 @@ Kick 排除 추방 + 踢除 + 踢除 Check all addons @@ -686,6 +819,8 @@ Controlla tutti gli addon 全アドオンを検査 모든 에드온 검사 + 檢查所有模組 + 检查所有模组 Check all addons instead of only those of ACE? @@ -698,8 +833,10 @@ Az összes bővítmény ellenőrzése, csak az ACE helyett? Проверять все аддоны, а не только ACE? Controlla tutti gli addon invece dei soli addon ACE? - ACE MOD の代わりに全アドオンを検査しますか? + ACE MOD の代わりに全アドオンを検査しますか? ACE를 제외한 모든 모드를 검사할까요? + 檢查包含ACE之外的其他模組? + 检查包含ACE之外的其他模组? Whitelist @@ -714,6 +851,8 @@ Lista Bianca 許可制 화이트리스트 + 白名單 + 白名单 What addons are allowed regardless? @@ -726,8 +865,10 @@ Milyen bővítmények vannak feltétlenül engedélyezve? Какие аддоны дополнительно разрешены? Quali addon sono permessi in ogni caso? - どのようなアドオンを許可しますか? + どのようなアドオンを許可しますか? 허가되는 에드온은 어느것입니까? + 哪些模組是可被允許/忽略的? + 哪些模组是可被允许/忽略的? LSD Vehicles @@ -742,6 +883,8 @@ Veicoli LSD LSD 車両 LSD 차량 + 迷幻載具 + 迷幻载具 Adds LSD effect to synchronized vehicle @@ -756,6 +899,8 @@ Aggiunge effetti LSD ai veicoli sincronizzati 同期されたオブジェクトに LSD の効果を追加します 동기화된 차량에 LSD효과를 추가합니다. + 使被同步的載具產生瘋狂的迷幻效果。(後果自負) + 使被同步的载具产生疯狂的迷幻效果。(后果自负) Toggle Handheld Device @@ -770,6 +915,8 @@ Apri dispositivo palmare デバイスを常に表示 휴대장치 토글 + 切換手持裝備 + 切换手持装备 Close Handheld Device @@ -784,6 +931,8 @@ Chiudi dispositivo palmare デバイスを閉じる 휴대장치 닫기 + 關閉手持裝備 + 关闭手持装备 Cycle Handheld Devices @@ -798,6 +947,8 @@ Cicla tra dispositivi palmari 表示するデバイスを変える 휴대장치 순환 + 循環切換手持裝備 + 循环切换手持装备 Disabled @@ -811,6 +962,8 @@ Desactivado 無効化 비활성화 + 停用 + 停用 Enabled @@ -824,6 +977,8 @@ Activado 有効化 활성화 + 啟用 + 启用 Always @@ -883,6 +1038,8 @@ Si はい + + No @@ -897,6 +1054,8 @@ No いいえ 아니오 + + Never @@ -913,6 +1072,8 @@ Vehicules seulement 車両のみ 차량 전용 + 只有載具 + 只有载具 Do Not Force @@ -926,84 +1087,98 @@ Ne pas forcer 強制しない 강제하지 말것 + 不要強行 + 不要强行 - ACE3 Equipment - ACE-Ausrüstung - ACE3 Wyposażenie - Equipamentos ACE3 - ACE3 Снаряжение - ACE3 Vybavení - ACE3 Equipo - Equipaggiamento ACE3 - ACE3 Equipement - ACE3 装備 - ACE3 장비 + ACE Equipment + ACE Ausrüstung + ACE Wyposażenie + ACE Equipamentos + ACE Снаряжение + ACE Vybavení + ACE Equipo + ACE Equipaggiamento + ACE Equipement + ACE 装備 + ACE 장비 + ACE 裝備按鍵 + ACE 装备按键 - ACE3 Common - ACE3 Allgemein - ACE3 Ogólne - Comum ACE3 - ACE3 Общие - ACE3 Común - ACE3 Obecné - Comune ACE3 - ACE3 Commun - ACE3 全般 - ACE3 일반 + ACE Common + ACE Allgemein + ACE Ogólne + ACE Comum + ACE Общие + ACE Común + ACE Obecné + ACE Comune + ACE Commun + ACE 全般 + ACE 일반 + ACE 通用按鍵 + ACE 通用按键 - ACE3 Weapons - ACE3 Waffen - ACE3 Broń - Armamento ACE3 - ACE3 Оружие - ACE3 Zbraně - ACE3 Armas - Armi ACE3 - ACE3 Armes - ACE3 武器 - ACE3 무기 + ACE Weapons + ACE Waffen + ACE Broń + ACE Armamento + ACE Оружие + ACE Zbraně + ACE Armas + ACE Armi + ACE Armes + ACE 武器 + ACE 무기 + ACE 武器按鍵 + ACE 武器按键 - ACE3 Movement - ACE3 Bewegung - ACE3 Ruch - Movimento ACE3 - ACE3 Перемещение - ACE3 Movimiento - ACE3 Pohyb - Movimento ACE3 - ACE3 Mouvement - ACE3 移動 - ACE3 움직임 + ACE Movement + ACE Bewegung + ACE Ruch + ACE Movimento + ACE Перемещение + ACE Movimiento + ACE Pohyb + ACE Movimento + ACE Mouvement + ACE 移動 + ACE 움직임 + ACE 動作按鍵 + ACE 动作按键 - ACE3 Scope Adjustment - ACE3 Visiereinstellung - ACE3 Regulacja optyki - Ajuste de luneta ACE3 - ACE3 Прицелы - ACE3 Nastavení optiky - ACE3 Ajuste de miras - Regolazione Ottiche ACE3 - ACE3 Ajustement de la lunette - ACE3 スコープ調節 - ACE3 조준경 조정 + ACE Scope Adjustment + ACE Visiereinstellung + ACE Regulacja optyki + ACE Ajuste de luneta + ACE Прицелы + ACE Nastavení optiky + ACE Ajuste de miras + ACE Regolazione Ottiche + ACE Ajustement de la lunette + ACE スコープ調節 + ACE 조준경 조정 + ACE 瞄準鏡調節按鍵 + ACE 瞄准镜调节按键 - ACE3 Vehicles - ACE3 Fahrzeuge - ACE3 Pojazdy - Veículos ACE3 - ACE3 Транспорт - ACE3 Vozidla - ACE3 Vehículos - Veicoli ACE3 - ACE3 Vehicules - ACE3 車両 - ACE3 차량 + ACE Vehicles + ACE Fahrzeuge + ACE Pojazdy + ACE Veículos + ACE Транспорт + ACE Vozidla + ACE Vehículos + ACE Veicoli + ACE Vehicules + ACE 車両 + ACE 차량 + ACE 載具按鍵 + ACE 载具按键 No Room to unload @@ -1016,20 +1191,41 @@ Sem espaço para descarregar Нет места для выгрузки 降ろすための空間がありません - + 沒有空間可卸載 + 没有空间可卸载 + 언로드 할 공간이 없습니다. + Toggle переключить переключить Basculer Cambiar - camb. + Cambia Umschalten pecek přep. alternar - トグル + 切り替え 토글 + 切換 + 切换 + + + Weight: + Gewicht: + Peso: + Poids : + Waga: + Váha: + Peso: + Peso: + Súly: + Вес: + 重量: + 무게: + 重量: + 重量: diff --git a/addons/concertina_wire/CfgEventHandlers.hpp b/addons/concertina_wire/CfgEventHandlers.hpp index 80711b5390..b0ff603096 100644 --- a/addons/concertina_wire/CfgEventHandlers.hpp +++ b/addons/concertina_wire/CfgEventHandlers.hpp @@ -40,12 +40,12 @@ class Extended_Init_EventHandlers { }; class ACE_ConcertinaWire { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_init)); + init = QUOTE(call FUNC(handleInit)); }; }; class Land_Razorwire_F { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_init)); + init = QUOTE(call FUNC(handleInit)); }; }; }; diff --git a/addons/concertina_wire/XEH_PREP.hpp b/addons/concertina_wire/XEH_PREP.hpp index 34a666a6b9..5fffc24969 100644 --- a/addons/concertina_wire/XEH_PREP.hpp +++ b/addons/concertina_wire/XEH_PREP.hpp @@ -3,5 +3,6 @@ PREP(deploy); PREP(dismount); PREP(dismountSuccess); PREP(handleDamage); +PREP(handleInit); PREP(handleKilled); PREP(vehicleDamage); diff --git a/addons/concertina_wire/XEH_init.sqf b/addons/concertina_wire/XEH_init.sqf deleted file mode 100644 index b24353b4df..0000000000 --- a/addons/concertina_wire/XEH_init.sqf +++ /dev/null @@ -1,3 +0,0 @@ -#include "script_component.hpp" -params ["_wire"]; -_wire addEventHandler ["HandleDamage", {call FUNC(handleDamage)}]; diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index 67b3584de2..6782f64342 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]; { @@ -62,6 +65,7 @@ GVAR(deployPFH) = [{ }, 0, [_wireNoGeo, _wire, _anim, _dir, _wireNoGeoPos]] call CBA_fnc_addPerFrameHandler; [_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); + [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); call EFUNC(interaction,hideMouseHint); [_idPFH] call CBA_fnc_removePerFrameHandler; @@ -75,6 +79,8 @@ GVAR(deployPFH) = [{ [localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + GVAR(placer) setVariable [QGVAR(Deploy), [GVAR(placer), "DefaultAction", {GVAR(deployPFH) != -1}, diff --git a/addons/concertina_wire/functions/fnc_dismount.sqf b/addons/concertina_wire/functions/fnc_dismount.sqf index f2d3bc76c1..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" 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_handleInit.sqf b/addons/concertina_wire/functions/fnc_handleInit.sqf new file mode 100644 index 0000000000..d547a09463 --- /dev/null +++ b/addons/concertina_wire/functions/fnc_handleInit.sqf @@ -0,0 +1,18 @@ +/* + * Author: Rocko + * Handles wire Init + * + * Arguments: + * 0: wire + * + * Return Value: + * None + * + * Example: + * [wire] call ace_concertina_wire_fnc_handleInit + * + * Public: No + */ +#include "script_component.hpp" +params ["_wire"]; +_wire addEventHandler ["HandleDamage", {call FUNC(handleDamage)}]; 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 2bc0005a35..6c510c56b7 100644 --- a/addons/concertina_wire/stringtable.xml +++ b/addons/concertina_wire/stringtable.xml @@ -14,6 +14,8 @@ Arame farpado 鉄条網 철조망 + 鐵絲網 + 铁丝网 Concertina Wire Coil @@ -28,6 +30,8 @@ Bobina de arame farpado 鉄条網コイル 윤형 철조망 + 鐵絲網捲 + 铁丝网卷 Dismount Concertina Wire @@ -42,6 +46,8 @@ Desmontar arame farpado 鉄条網をほどく 철조망 해체 + 卸下鐵絲網 + 卸下铁丝网 Deploy Concertina Wire @@ -56,6 +62,8 @@ Colocar arame farpado 鉄条網を置く 철조망 배치 + 佈署鐵絲網 + 布署铁丝网 diff --git a/addons/cookoff/ACE_Settings.hpp b/addons/cookoff/ACE_Settings.hpp index 13ef915ffb..b06aaf7b9a 100644 --- a/addons/cookoff/ACE_Settings.hpp +++ b/addons/cookoff/ACE_Settings.hpp @@ -1,27 +1,40 @@ class ACE_Settings { class GVAR(enable) { + category = CSTRING(displayName); displayName = CSTRING(enable_name); description = CSTRING(enable_tooltip); value = 1; typeName = "BOOL"; }; class GVAR(enableAmmobox) { + category = CSTRING(displayName); displayName = CSTRING(enableBoxCookoff_name); description = CSTRING(enableBoxCookoff_tooltip); value = 1; typeName = "BOOL"; }; class GVAR(enableAmmoCookoff) { // For CBA Setting Switch: we can eliminate and just use (ammoCookoffDuration == 0) + category = CSTRING(displayName); displayName = CSTRING(enableAmmoCookoff_name); description = CSTRING(enableAmmoCookoff_tooltip); value = 1; typeName = "BOOL"; }; class GVAR(ammoCookoffDuration) { + category = CSTRING(displayName); displayName = CSTRING(ammoCookoffDuration_name); description = CSTRING(ammoCookoffDuration_tooltip); value = 1; typeName = "SCALAR"; + sliderSettings[] = {0, 5, 1, 1}; + }; + class GVAR(probabilityCoef) { + category = CSTRING(displayName); + displayName = CSTRING(probabilityCoef_name); + description = CSTRING(probabilityCoef_tooltip); + value = 1; + typeName = "SCALAR"; + sliderSettings[] = {0, 5, 1, 1}; }; }; diff --git a/addons/cookoff/CfgEden.hpp b/addons/cookoff/CfgEden.hpp index aa550a9228..04e7762a41 100644 --- a/addons/cookoff/CfgEden.hpp +++ b/addons/cookoff/CfgEden.hpp @@ -11,8 +11,18 @@ class Cfg3DEN { tooltip = CSTRING(enable_tooltip); expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};); typeName = "BOOL"; + condition = "objectVehicle"; + defaultValue = QUOTE(GETMVAR(QGVAR(enable),true)); + }; + class GVAR(enableAmmoCookoff) { + property = QGVAR(enableAmmoCookoff); + control = "Checkbox"; + displayName = CSTRING(enableAmmoCookoff_name); + tooltip = CSTRING(enableAmmoCookoff_tooltip); + expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};); + typeName = "BOOL"; condition = "objectHasInventoryCargo"; - defaultValue = "(true)"; // fix pbo project preprocessing bug + defaultValue = QUOTE(if (_this isKindOf 'ReammoBox_F') then { GETMVAR(QGVAR(enableAmmobox),true) } else { GETMVAR(QGVAR(enableAmmoCookoff),true) };); }; }; }; 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 1155b9ba52..7a682ca9d0 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; @@ -30,6 +37,7 @@ class CfgVehicles { class Tank_F: Tank { GVAR(ammoLocation) = "HitHull"; GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"}; + GVAR(probability) = 0.5; }; class MBT_02_base_F: Tank_F { GVAR(ammoLocation) = "HitTurret"; @@ -39,11 +47,19 @@ class CfgVehicles { class Wheeled_APC_F: Car_F { GVAR(ammoLocation) = "HitHull"; GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"}; + GVAR(probability) = 0.8; // big explosions for wheeled APCs (same as for tanks) explosionEffect = "FuelExplosionBig"; }; + class APC_Wheeled_02_base_F: Wheeled_APC_F { // Otokar ARMA - RCWS Turret + GVAR(ignoreTurret) = 1; + }; + class APC_Tracked_01_base_F: Tank_F { // Namera, Nemmera - RCWS Turret + GVAR(ignoreTurret) = 1; + }; + class B_MBT_01_base_F; class B_MBT_01_cannon_F: B_MBT_01_base_F { GVAR(turret)[] = {QGVAR(Turret_MBT_01),{0,-1,0.5}}; diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index b7bed03475..fad901982d 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -71,7 +71,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; ["ReammoBox_F", "init", { (_this select 0) addEventHandler ["HandleDamage", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enableAmmobox)]) then { + if ((_this select 0) getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmobox)]) then { ["box", _this] call FUNC(handleDamage); }; }]; diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf index b75eaf9eb3..a86564e74d 100644 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ b/addons/cookoff/functions/fnc_cookOff.sqf @@ -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,11 +109,12 @@ 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]; @@ -132,6 +135,6 @@ if (local _vehicle) then { if (local _vehicle) then { _vehicle setDamage 1; }; - }, [_vehicle, _effects], 14] call CBA_fnc_waitAndExecute; - }, [_vehicle, _effects, _positions], 10.5] call CBA_fnc_waitAndExecute; -}, _vehicle, 3] 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 6f834a15b6..1f2c0b3b90 100644 --- a/addons/cookoff/functions/fnc_cookOffBox.sqf +++ b/addons/cookoff/functions/fnc_cookOffBox.sqf @@ -44,11 +44,9 @@ if (local _box) then { // These functions are smart and do all the cooking off work if (local _box) then { - if (_box getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]) then { - if (GVAR(ammoCookoffDuration) == 0) exitWith {}; - ([_box] call FUNC(getVehicleAmmo)) params ["_mags", "_total"]; - [_box, _mags, _total] 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 clearMagazineCargoGlobal _box; @@ -71,6 +69,6 @@ if (local _box) then { if (local _box) then { _box setDamage 1; }; - }, [_box, _effects], 82.5] call CBA_fnc_waitAndExecute; // Give signifcant time for ammo cookoff to occur (perhaps keep the box alive until all cooked off?) - }, [_box, _effects], 10.5] call CBA_fnc_waitAndExecute; -}, _box, 3] 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_getVehicleAmmo.sqf b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf index 67c7f6e56e..78d13ee301 100644 --- a/addons/cookoff/functions/fnc_getVehicleAmmo.sqf +++ b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf @@ -28,6 +28,9 @@ private _totalAmmo = 0; { _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; }; @@ -44,7 +47,9 @@ private _totalAmmo = 0; // Get ammo from transportAmmo / ace_rearm private _vehCfg = configFile >> "CfgVehicles" >> typeOf _vehicle; -if (((getNumber (_vehCfg >> "transportAmmo")) > 1000) || {isClass (_vehCfg >> "ACE_Actions" >> "ACE_MainActions" >> QEGVAR(rearm,TakeAmmo))}) then { + +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]; diff --git a/addons/cookoff/functions/fnc_handleDamage.sqf b/addons/cookoff/functions/fnc_handleDamage.sqf index 331c1d177a..d9fbaf4cef 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; @@ -66,12 +66,23 @@ if (_simulationType == "tank") exitWith { // ammo was hit, high chance for cook-off if (_hitpoint == _ammoLocationHitpoint) then { - if (_damage > 0.5 && {random 1 < 0.7}) then { - _vehicle call FUNC(cookOff); + if (_damage > 0.5) then { + // get cookoff probability for vehicle + private _probability = [_vehicle call CBA_fnc_getObjectConfig >> QGVAR(probability), "number", 0.7] call CBA_fnc_getConfigEntry; + // probability multiplied by coef for global probability control (higher coef = more probable cookoff) + if (GVAR(probabilityCoef) > 1) then { + _probability = 1 - (1 - _probability) / GVAR(probabilityCoef); + } else { + _probability = _probability * GVAR(probabilityCoef); + }; + if (random 1 < _probability) then { + _vehicle call FUNC(cookOff); + }; }; } else { - if (_hitpoint in ["hithull", "hitturret", "#structural"] && {_newDamage > 0.6 + random 0.3}) then { - _vehicle call FUNC(cookOff); + if (_hitpoint in ["hithull", "hitturret", "#structural"] && {_newDamage > 0.8 + random 0.2}) then { + if ((_hitpoint == "hitturret") && {(getNumber (_vehicle call CBA_fnc_getObjectConfig >> QGVAR(ignoreTurret))) == 1}) exitWith {}; // ignore turrets like RCWS + _vehicle setDamage 1; }; }; 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 8e8e41ff4f..79db993245 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -1,6 +1,13 @@  + + Cook off + Esplosione + 殉爆效果 + 殉爆效果 + 誘爆 + Enable cook off Selbstzündung ermöglichen @@ -11,6 +18,8 @@ Aktywuj efekty samozapłonu amunicji Active le cook-off Abilita Esplosione + 開啟殉爆效果 + 开启殉爆效果 Enables cook off and related vehicle destruction effects. @@ -22,6 +31,8 @@ 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) @@ -35,7 +46,9 @@ Wreck (Turret) Ruínas (torre) 잔해(포탑) - 残骸(タレット) + 残骸 (砲塔) + 殘骸 (砲塔) + 残骸 (炮塔) Enable ammo box cook off @@ -45,6 +58,8 @@ Aktywuj samozapłon skrzyń z amunicją Cook-off caisses de munitions Abilita esplosione cassa munizioni + 開啟彈藥箱殉爆效果 + 开启弹药箱殉爆效果 Enables cooking off of ammo boxes. @@ -54,6 +69,8 @@ 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 @@ -63,28 +80,51 @@ 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 이면 비활성] + + + Cook-off probability coefficient + 誘爆の可能性係数 + Coefficiente probabilità esplosione + + + Multiplier for cook-off probability. Higher value results in higher cook-off probability + 誘爆する可能性の乗数。高い値では誘爆する可能性が高まります。 + Moltiplicatore per la probabilità dell'esplosione. Un valore più alto aumenta la probabilità dell'esplosione diff --git a/addons/dagr/CfgWeapons.hpp b/addons/dagr/CfgWeapons.hpp index b6601e094c..55692e7f9a 100644 --- a/addons/dagr/CfgWeapons.hpp +++ b/addons/dagr/CfgWeapons.hpp @@ -1,10 +1,10 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_DAGR: ACE_ItemCore { - author[] = {$STR_ACE_Common_ACETeam, "Ruthberg"}; + author = ECSTRING(common,ACETeam); scope = 2; displayName = CSTRING(Name); model = QPATHTOF(data\DAGR.p3d); @@ -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/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 2a877ba593..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,21 @@ 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 (if (GVAR(useDegrees)) then { + 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)) 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 e72e4f7770..c364eedabe 100644 --- a/addons/dagr/stringtable.xml +++ b/addons/dagr/stringtable.xml @@ -13,6 +13,8 @@ DAGR DAGR DAGR + 軍用GPS接收器 + 军用GPS接收器 Configure DAGR @@ -26,6 +28,8 @@ Configurer le DAGR DAGR を設定 DAGR 설정 + 設定軍用GPS接收器 + 设定军用GPS接收器 Toggle DAGR @@ -39,6 +43,8 @@ Activer/Desactiver le DAGR DAGR を常に表示 DAGR 토글 + 切換軍用GPS接收器 + 切换军用GPS接收器 Defense Advanced GPS Receiver @@ -52,6 +58,8 @@ Defense Advanced GPS Receiver アドバンスド DAGR の受信を定義します 국방 고급위성항법시스템 수신기 + 軍用高級防禦GPS接收器 + 军用高级防御GPS接收器 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/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 eaf572cc56..30f9fa4b85 100644 --- a/addons/disarming/stringtable.xml +++ b/addons/disarming/stringtable.xml @@ -14,6 +14,8 @@ Abrir inventário インベントリを開く 소지품 열기 + 開啟裝備 + 开启装备 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/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 3d9df039a1..f41b2cad88 100644 --- a/addons/disposable/stringtable.xml +++ b/addons/disposable/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Tubo utilizado 使用済み 사용함 + 使用過的火箭筒 + 使用过的火箭筒 Used disposable rocket launcher @@ -28,6 +30,8 @@ Lança foguetes descartável utilizado 使い終わったロケット ランチャーの筒部分 사용한 일회용 발사관 + 使用過的一次性火箭發射器 + 使用过的一次性火箭发射器 Preloaded Missile Dummy @@ -42,6 +46,8 @@ Míssel inerte pré-carregado 仮置きのミサイルをあらかじめ装填 임시로 미사일을 미리 장전 + 預裝訓練導彈 + 预装训练导弹 diff --git a/addons/dogtags/CfgVehicles.hpp b/addons/dogtags/CfgVehicles.hpp index f583164b1f..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,7 +37,7 @@ class CfgVehicles { displayName = CSTRING(checkItem); condition = "true"; statement = ""; - exceptions[] = {"isNotInside", "isNotSitting"}; + 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_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index 6a50ce61cf..02d2db862b 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -46,5 +46,35 @@ if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then { }; }; +if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(arsenal,rightPanelFilled), { + + params ["_display", "_leftPanelIDC", "_rightPanelIDC"]; + + if (_leftPanelIDC in [2010, 2012, 2014] && {_rightPanelIDC == 38}) then { + LOG("passed"); + private _rightPanel = _display displayCtrl 15; + (lnbSize _rightPanel) params ["_rows", "_columns"]; + + private _allDogtags = missionNameSpace getVariable [QGVAR(allDogtags), []]; + private _allDogtagDatas = missionNameSpace getVariable [QGVAR(allDogtagDatas), []]; + + for "_r" from 0 to (_rows - 1) do { + private _data = _rightPanel lnbData [_r, 0]; + + if (_data isKindOf ["ACE_dogtag", (configFile >> "CfgWeapons")]) then { + + private _dogtagData = []; + private _index = _allDogtags find _data; + _dogtagData = _allDogtagDatas select _index; + private _dogtagString = [localize LSTRING(itemName), ": ", (_dogtagData select 0)] joinString ""; + + _rightPanel lnbSetText [[_r, 1], _dogtagString]; + }; + }; + }; + }] call CBA_fnc_addEventHandler; +}; + // disable dogtags for civilians "CIV_F" call FUNC(disableFactionDogtags); 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 5aa5d80a4e..a60f325652 100644 --- a/addons/dogtags/stringtable.xml +++ b/addons/dogtags/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -11,6 +11,8 @@ 군번줄 Plaque d'identification Piastrina + 兵籍牌 + 兵籍牌 Check Dog Tag @@ -22,6 +24,8 @@ 군번줄 확인 Vérifier les plaques d'identification Controlla Piastrina + 檢查兵籍牌 + 检查兵籍牌 Check @@ -33,6 +37,8 @@ 확인 Vérifier Controlla + 檢查 + 检查 Take @@ -44,28 +50,34 @@ 회수 Prendre Prendi + 拿取 + 拿取 Dogtag taken from %1... Zabrałeś nieśmiertelnik %1... Жетон снят с %1... Sebral jsem známku od %1... - %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... Ktoś już zabrał ten nieśmiertelnik... Кто-то уже забрал жетон... 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... + 已經有人把他的兵籍牌拿走了... + 已经有人把他的兵籍牌拿走了... 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/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..6553c84929 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -46,6 +46,8 @@ if (_target isKindOf "CAManBase") then { _unit removeWeapon "ACE_FakePrimaryWeapon"; +[_unit, "blockThrow", "ACE_dragging", false] call EFUNC(common,statusEffect_set); + // prevent object from flipping inside buildings if (_inBuilding) then { _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); @@ -58,7 +60,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_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index c3521bbed0..857e64bb7a 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -51,6 +51,7 @@ _unit removeWeapon "ACE_FakePrimaryWeapon"; _unit selectWeapon primaryWeapon _unit; [_unit, "forceWalk", "ACE_dragging", false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_dragging", false] call EFUNC(common,statusEffect_set); // prevent object from flipping inside buildings if (_inBuilding) 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 7a5341b8a8..1a53a06994 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -58,6 +58,8 @@ if (_target isKindOf "CAManBase") then { }; +[_unit, "blockThrow", "ACE_dragging", true] call EFUNC(common,statusEffect_set); + // prevent multiple players from accessing the same object [_unit, _target, true] call EFUNC(common,claim); diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index cf08074d94..8cf552e3d1 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -35,13 +35,17 @@ if (primaryWeapon _unit == "") then { // select primary, otherwise the drag animation actions don't work. _unit selectWeapon primaryWeapon _unit; +[_unit, "blockThrow", "ACE_dragging", true] call EFUNC(common,statusEffect_set); + // prevent multiple players from accessing the same object [_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 50b5947ac9..767ae3fd73 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -14,6 +14,8 @@ Húzás 引きずる 끌기 + 拖拉 + 拖拉 Release @@ -28,6 +30,8 @@ Elengedés はなす 놓기 + 放開 + 放开 Drag/Release Object @@ -42,6 +46,8 @@ Húzás/Elengedés Objektum オブジェクトを引きずる/はなす 물건 끌기/놓기 + 拖拉/放開物品 + 拖拉/放开物品 Item too heavy @@ -56,6 +62,8 @@ Az objektum túl nehéz アイテムが重すぎる 물체가 너무 무겁습니다 + 此物品過重 + 此物品过重 Carry @@ -70,6 +78,8 @@ Нести 運ぶ 업기 + 背起 + 背起 Raise/Lower @@ -83,6 +93,8 @@ Lever/Baisser 上げる/下げる 높이기/낮추기 + 提高/下降 + 提高/下降 diff --git a/addons/explosives/ACE_Settings.hpp b/addons/explosives/ACE_Settings.hpp index e103b6e018..dbde3ea19b 100644 --- a/addons/explosives/ACE_Settings.hpp +++ b/addons/explosives/ACE_Settings.hpp @@ -1,17 +1,20 @@ class ACE_Settings { class GVAR(requireSpecialist) { + category = CSTRING(Menu); displayName = CSTRING(RequireSpecialist_DisplayName); description = CSTRING(RequireSpecialist_Description); value = 0; typeName = "BOOL"; }; class GVAR(punishNonSpecialists) { + category = CSTRING(Menu); displayName = CSTRING(PunishNonSpecialists_DisplayName); description = CSTRING(PunishNonSpecialists_Description); value = 1; typeName = "BOOL"; }; class GVAR(explodeOnDefuse) { + category = CSTRING(Menu); displayName = CSTRING(ExplodeOnDefuse_DisplayName); description = CSTRING(ExplodeOnDefuse_Description); value = 1; 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/CfgModule.hpp b/addons/explosives/CfgModule.hpp index a4e0d8dbd2..081df5d72d 100644 --- a/addons/explosives/CfgModule.hpp +++ b/addons/explosives/CfgModule.hpp @@ -4,7 +4,7 @@ class ACE_ModuleExplosive: ACE_Module { category = "ACE"; displayName = CSTRING(Module_DisplayName); function = QFUNC(module); - scope = 2; + scope = 1; isGlobal = 1; isSingular = 1; icon = QPATHTOF(UI\Icon_Module_Explosives_ca.paa); 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..9296813ee5 100644 --- a/addons/explosives/CfgWeapons.hpp +++ b/addons/explosives/CfgWeapons.hpp @@ -1,14 +1,24 @@ 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; }; class ACE_Clacker: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(clacker_displayName); descriptionShort = CSTRING(clacker_description); picture = QPATHTOF(Data\UI\Clacker.paa); @@ -23,6 +33,7 @@ class CfgWeapons { }; }; class ACE_M26_Clacker: ACE_Clacker { + author = ECSTRING(common,ACETeam); displayName = CSTRING(M152_Clacker_displayName); picture = QPATHTOF(Data\UI\MK26_Transmitter_ca.paa); GVAR(Range) = 5000; @@ -30,6 +41,7 @@ class CfgWeapons { }; class ACE_DefusalKit: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(DefusalKit_displayName); descriptionShort = CSTRING(DefusalKit_description); picture = QPATHTOF(Data\UI\Pliers.paa); @@ -42,6 +54,7 @@ class CfgWeapons { }; class ACE_DeadManSwitch: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(DeadManSwitch_displayName); descriptionShort = CSTRING(DeadManSwitch_description); picture = QPATHTOF(Data\UI\DeadmanSwitch.paa); @@ -57,6 +70,7 @@ class CfgWeapons { }; class ACE_Cellphone: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(cellphone_displayName); descriptionShort = CSTRING(cellphone_description); picture = QPATHTOF(Data\UI\Cellphone_UI.paa); 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/functions/fnc_addCellphoneIED.sqf b/addons/explosives/functions/fnc_addCellphoneIED.sqf index df198fafb3..88da983be9 100644 --- a/addons/explosives/functions/fnc_addCellphoneIED.sqf +++ b/addons/explosives/functions/fnc_addCellphoneIED.sqf @@ -21,21 +21,22 @@ 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); + +private _requiredItems = getArray(_config >> "requires"); +private _hasRequired = true; +private _detonators = [_unit] call FUNC(getDetonators); -_requiredItems = getArray(_config >> "requires"); -_hasRequired = true; -_detonators = [_unit] call FUNC(getDetonators); { if !(_x in _detonators) exitWith{ _hasRequired = false; }; } count _requiredItems; -_codeSet = false; +private _code = ""; +private _codeSet = false; + while {!_codeSet} do { _code = str(round (random 9999)); _count = 4 - count (toArray _code); @@ -45,10 +46,12 @@ while {!_codeSet} do { }; _codeSet = (count ([_code] call FUNC(getSpeedDialExplosive))) == 0; }; + 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 5b61de01f4..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; 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_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index 822a04aeaf..3e0f3bdf6f 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -24,12 +24,10 @@ params ["_unit", "_range", "_item", ["_triggerClassname", "#unknown", [""]]]; TRACE_4("detonateExplosive",_unit,_range,_item,_triggerClassname); -private ["_result", "_ignoreRange", "_pos"]; - -_ignoreRange = (_range == -1); +private _ignoreRange = (_range == -1); if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {TRACE_1("out of range",_range); false}; -_result = true; +private _result = true; { // Pass [Unit, MaxRange , Explosive , FuzeTime , TriggerItem ] private _handlerResult = [_unit, _range, _item select 0, _item select 1, _triggerClassname] call _x; @@ -38,19 +36,25 @@ _result = true; 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; }; }; +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_dialPhone.sqf b/addons/explosives/functions/fnc_dialPhone.sqf index 7e715c2ac7..f4bdd68279 100644 --- a/addons/explosives/functions/fnc_dialPhone.sqf +++ b/addons/explosives/functions/fnc_dialPhone.sqf @@ -19,23 +19,20 @@ 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]; 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_module.sqf b/addons/explosives/functions/fnc_module.sqf index cbe7c3e2ad..f6a486591a 100644 --- a/addons/explosives/functions/fnc_module.sqf +++ b/addons/explosives/functions/fnc_module.sqf @@ -15,8 +15,6 @@ */ #include "script_component.hpp" -if !(isServer) exitWith {}; - params ["_logic"]; [_logic, QGVAR(RequireSpecialist), "RequireSpecialist"] call EFUNC(Common,readSettingFromModule); diff --git a/addons/explosives/functions/fnc_onIncapacitated.sqf b/addons/explosives/functions/fnc_onIncapacitated.sqf index 6f9a9f498a..7e2cb249cc 100644 --- a/addons/explosives/functions/fnc_onIncapacitated.sqf +++ b/addons/explosives/functions/fnc_onIncapacitated.sqf @@ -19,6 +19,11 @@ params ["_unit"]; TRACE_1("params",_unit); +if (_unit == ace_player) then { + // close cellphone if open + closeDialog 0; +}; + // Exit if no item: if (({_x == "ACE_DeadManSwitch"} count (items _unit)) == 0) exitWith {}; diff --git a/addons/explosives/functions/fnc_onInventoryChanged.sqf b/addons/explosives/functions/fnc_onInventoryChanged.sqf index f67995b1c9..185fdef6c3 100644 --- a/addons/explosives/functions/fnc_onInventoryChanged.sqf +++ b/addons/explosives/functions/fnc_onInventoryChanged.sqf @@ -25,8 +25,7 @@ if ((_receiver != ace_player) && {_giver != ace_player}) exitWith {}; 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]; private _detonators = [_giver] call FUNC(getDetonators); 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 ff7a2ca1a0..5c27e35e60 100644 --- a/addons/explosives/functions/fnc_scriptedExplosive.sqf +++ b/addons/explosives/functions/fnc_scriptedExplosive.sqf @@ -1,19 +1,18 @@ /* * 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) - * 2: Trigger Item Classname + * 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 */ diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index 47608d03e5..6e356a6f8d 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -24,15 +24,14 @@ 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); +[_unit, "blockThrow", "ACE_Explosives", true] call EFUNC(common,statusEffect_set); //Show mouse buttons: [localize LSTRING(PlaceAction), localize LSTRING(CancelAction), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint); @@ -44,8 +43,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 +61,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 +71,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 +86,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 +117,7 @@ GVAR(TweakedAngle) = 0; }; }; - _virtualPosASL = _basePosASL vectorAdd (_lookDirVector vectorMultiply _distanceFromBase); + private _virtualPosASL = _basePosASL vectorAdd (_lookDirVector vectorMultiply _distanceFromBase); //Update mouse hint: if (_badPosition) then { @@ -153,6 +150,7 @@ GVAR(TweakedAngle) = 0; GVAR(pfeh_running) = false; [_unit, "forceWalk", "ACE_Explosives", false] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", "ACE_Explosives", false] call EFUNC(common,statusEffect_set); [] call EFUNC(interaction,hideMouseHint); [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); [_unit, "zoomtemp", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler); @@ -160,8 +158,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 +171,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 +189,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_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 6694d5dc0d..737e6a6586 100644 --- a/addons/explosives/functions/fnc_startTimer.sqf +++ b/addons/explosives/functions/fnc_startTimer.sqf @@ -5,13 +5,13 @@ * Arguments: * 0: Explosive * 1: Time till detonate - * 2: Trigger Item Classname + * 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 */ 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 e0cb44badf..2ca36bcdc1 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Взрывчатка 爆発物 폭발물 + 炸药 + 炸藥 Place @@ -28,6 +30,8 @@ Установить 設置 설치 + 放置 + 放置 Detonate @@ -42,6 +46,8 @@ Подрыв 点火 폭파 + 引爆 + 引爆 Detonate All @@ -55,6 +61,8 @@ Detonar Tudo すべて点火 모두 폭파 + 引爆全部 + 引爆全部 Explosive code: %1 @@ -69,6 +77,8 @@ Codice esplosivo: %1 爆破コード: %1 폭파 코드: %1 + 炸药代码: %1 + 炸藥代碼: %1 Place @@ -83,6 +93,8 @@ Установить 設置 설치 + 放置 + 放置 Attach @@ -97,6 +109,8 @@ Прикрепить 取り付け 부착 + 连接 + 連接 Blocked @@ -110,6 +124,8 @@ Bloqué 取り付けできない 막힘 + 断开 + 斷開 Cancel @@ -124,6 +140,8 @@ Отмена 中止 취소 + 取消 + 取消 Rotate @@ -136,8 +154,10 @@ Obrót Rotaciona Bращать - 向きを変える + 回転 회전 + 旋转 + 旋轉 Turn On Thor III @@ -152,6 +172,8 @@ Активировать Thor III Thor III を使う Thor III 켜기 + 开启索尔三型 + 開啟索爾三型 Turn Off Thor III @@ -166,6 +188,8 @@ Деактивировать Thor III Thor III を止める Thor III 끄기 + 关闭索尔三型 + 關閉索爾三型 Cellphone @@ -180,6 +204,8 @@ Сотовый телефон 携帯電話 휴대전화 + 手机 + 手機 Used to remotely trigger explosives @@ -194,6 +220,8 @@ Используется для удаленной детонации СВУ 爆発物を遠隔で起爆させるのに使います 원격으로 폭발물을 폭파시킬때 씁니다. + 用于远端引爆炸药 + 用於遠端引爆炸藥 M57 Firing Device @@ -208,6 +236,8 @@ Взрыватель M57 M57 起爆装置 M57 격발기 + M57 引爆装置 + M57 引爆裝置 Used to remotely trigger explosives @@ -222,6 +252,8 @@ Используется для удаленной детонации зарядов 爆発物を遠隔で起爆させるのに使います 원격으로 폭발물을 폭파시킬때 씁니다. + 用于远端引爆炸药 + 用於遠端引爆炸藥 M152 Firing Device @@ -236,6 +268,8 @@ Взрыватель M152 M152 起爆装置 M152 격발기 + M152 引爆装置 + M152 引爆裝置 M152 RAMS @@ -250,6 +284,8 @@ M152 RAMS M152 RAMS M152 RAMS + M152 远端炸药引爆系统 + M152 遠端炸藥引爆系統 Defusal Kit @@ -264,6 +300,8 @@ Комплект разминирования 解除キット 해체 장비 + 拆弹工具 + 拆彈工具 Allows defusing of explosives @@ -278,6 +316,8 @@ Позволяет обезвреживать взрывчатку 爆発物を無力化できます 폭발물을 해체할 수 있게 해줍니다 + 可以用来拆除炸弹 + 可以用來拆除炸彈 Add to Speed Dial @@ -292,6 +332,8 @@ Добавить в быстрый вызов 短縮ダイアルに追加 단축키에 지정 + 增加到快速拨号 + 增加到快速撥號 Clear @@ -306,6 +348,8 @@ Очистить 消去 삭제 + 清除 + 清除 Dial @@ -320,6 +364,8 @@ Hабрать ダイアル 다이얼 + 拨号 + 撥號 Up @@ -334,6 +380,8 @@ Вызов 上へ + + Down @@ -348,6 +396,8 @@ Сброс 下へ 아래 + + Cancel @@ -362,6 +412,8 @@ Отмена 中止 취소 + 取消 + 取消 Detonate Menu @@ -376,6 +428,8 @@ Меню подрыва 点火メニュー 폭파 메뉴 + 引爆选单 + 引爆選單 Place Menu @@ -390,6 +444,8 @@ Меню установки 設置メニュー 설치 메뉴 + 放置选单 + 放置選單 Defuse @@ -404,6 +460,8 @@ Обезвредить 無力化 해체 + 拆除 + 拆除 Defusing Explosive... @@ -416,8 +474,10 @@ Robbanóanyag hatástalanítása... Desarmando Explosivo... Обезвреживание... - 爆発物を無力化中・・・ + 爆発物を無力化しています・・・ 폭발물 해체중... + 炸弹拆除中... + 炸彈拆除中... Timer @@ -432,6 +492,8 @@ Таймер タイマー 타이머 + 计时器 + 計時器 Time: %1m %2s @@ -446,6 +508,8 @@ Время: %1m %2c 設定時間: %1分 %2秒 시간: %1분 %2초 + 时间: %1分%2秒 + 時間: %1分%2秒 Set Time @@ -460,6 +524,8 @@ Установить время 時間を設定 시간 설정 + 设定时间 + 設定時間 Select a Trigger @@ -474,6 +540,8 @@ Выберите детонатор 点火装置を選択 작동방식 선택 + 选择一个触发器 + 選擇一個觸發器 Select @@ -488,6 +556,8 @@ Выбрать 選択 선택 + 选择 + 選擇 Pressure Plate @@ -502,6 +572,8 @@ Нажимная плита 圧力感知式 압력식 + 压力盘 + 壓力盤 Tripwire @@ -516,6 +588,8 @@ Растяжка 仕掛け線 인계철선 + 绊线 + 絆線 IR Sensor @@ -530,6 +604,8 @@ ИК сенсор 赤外線感知式 적외선 센서 + 红外线感应器 + 紅外線感應器 No triggers available for %1 @@ -544,6 +620,8 @@ Нет доступных взрывателей для %1 %1 につかえる点火装置がありません %1(을)를 작동할 장치가 없습니다. + 没有适合%1的触发器 + 沒有適合%1的觸發器 IR Sensor (Side Attack) @@ -556,8 +634,10 @@ Infravörös szenzor (Side Attack) Sensor infravermelho (ataque lateral) ИК сенсор (детонация вбок) - 赤外線感知式 (横からの攻撃) + 赤外線感知式 (側面攻撃) 적외선 센서 (측면 공격) + 红外线感应器 (侧边攻击) + 紅外線感應器 (側邊攻擊) Magnetic Influence Sensor (Bottom Attack) @@ -570,8 +650,10 @@ Mágneses mező érzékelő (Bottom Attack) Influência magnética (ataque inferior) Магнитный сенсор (детонация вверх) - 磁気感知式 (下からの攻撃) + 磁気感知式 (底面攻撃) 자기장 감지센서 (바닥 공격) + 磁性感应器 (底部攻击) + 磁性感應器 (底部攻擊) No explosives on trigger. @@ -586,6 +668,8 @@ Взрыватель не подсоединён к взрывчатке 点火装置に爆発物がありません。 격발기에 등록된 폭발물이 없습니다. + 触发器上并没有炸药 + 觸發器上並沒有炸藥 Dead Man's Switch @@ -600,6 +684,8 @@ Detonatore a rilascio 自爆装置 자폭 장치 + 自杀炸弹客引爆器 + 自殺炸彈客引爆器 Used to remotely trigger explosives when released. @@ -614,6 +700,8 @@ Usato per attivare a distanza esplosivi al momento del rilascio 点火装置を離すと遠隔で起爆したいときに使います。 압력이 해제될때 원격으로 폭발시킵니다. + 当放开按钮时, 将会引爆炸弹. + 當放開按鈕時, 將會引爆炸彈. Pick up @@ -628,6 +716,8 @@ Pegar 拾う 줍기 + 捡起 + 撿起 Explosive System @@ -642,6 +732,8 @@ Sistema Esplosivi 爆発システム 폭발물 시스템 + 炸药系统 + 炸藥系統 Require specialists? @@ -654,8 +746,10 @@ Specialisták igénylése? Требуется специалист? Richiedi specialisti? - 特技兵を必要としますか? + 特技兵を必要としますか? 전문가가 필요합니까? + 需要专家? + 需要專家? Require explosive specialists to disable explosives? Default: No @@ -668,8 +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? @@ -682,8 +778,10 @@ Nem-specialisták büntetése? Штраф не-специалистам? Punisci non-specialisti? - 非特技兵へ足かせを与えますか? + 非特技兵へ足かせを与えますか? 비-전문가에 불이익을 줍니까? + 折磨非专业人员? + 折磨非專業人員? Increase the time it takes to complete actions for non-specialists? Default: Yes @@ -696,8 +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? @@ -710,8 +810,10 @@ Robbanás hatástalanításkor? Взрыв при разминир.? Fai esplodere quando disarmato? - 解除時に爆発させますか? + 解除中に爆発させますか? 해제시 폭발합니까? + 拆除时引爆? + 拆除時引爆? Enable certain explosives to explode on defusal? Default: Yes @@ -724,8 +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. @@ -740,6 +844,8 @@ Questo modulo cambia le impostazioni relative agli esplosivi このモジュールを調節し爆発物に設定を反映させます。 이 모듈은 폭발물에 관한 설정을 수정할 수 있게합니다. + 此模块用来调整炸药的相关设定 + 此模塊用來調整炸藥的相關設定 M6 SLAM Mine (Bottom Attack) @@ -758,8 +864,10 @@ M6 SLAM (Útok zespoda) Mina M6 SLAM (Ataque Inferior) Мина M6 SLAM (направлена вверх) - M6 SLAM 地雷 (下からの攻撃) + M6 SLAM 地雷 (底面攻撃) M6 SLAM 지뢰 (바닥 공격) + M6指向性反装甲地雷 (底部攻击) + M6指向性反裝甲地雷 (底部攻擊) M6 SLAM Mine (Side Attack) @@ -778,8 +886,10 @@ M6 SLAM (Útok do strany) Mina M6 SLAM (Ataque Lateral) Мина M6 SLAM (направлена вбок) - M6 SLAM 地雷 (横からの攻撃) + M6 SLAM 地雷 (側面攻撃) M6 SLAM 지뢰 (측면 공격) + M6指向性反装甲地雷 (侧边攻击) + M6指向性反裝甲地雷 (側邊攻擊) Large IED (Urban, Pressure Plate) @@ -800,6 +910,8 @@ Большое СВУ (городское, нажимного действия) 大きな IED (市街地用、圧力感知) 대형 급조폭발물 (시가지, 압력식) + 大型简易爆炸装置 (地表上, 压力盘) + 大型簡易爆炸裝置 (地表上, 壓力盤) Large IED (Dug-in, Pressure Plate) @@ -820,6 +932,8 @@ Большое СВУ (закопанное, нажимного действия) 大きな IED (埋め込み型、圧力感知) 대형 급조폭발물 (묻힘, 압력식) + 大型简易爆炸装置 (地表下, 压力盘) + 大型簡易爆炸裝置 (地表下, 壓力盤) Small IED (Urban, Pressure Plate) @@ -840,6 +954,8 @@ Малое СВУ (городское, нажимного действия) 小さな IED (市街地用、圧力感知) 소형 급조폭발물 (시가지, 압력식) + 小型简易爆炸装置 (地表上, 压力盘) + 小型簡易爆炸裝置 (地表上, 壓力盤) Small IED (Dug-in, Pressure Plate) @@ -860,6 +976,8 @@ Малое СВУ (закопанное, нажимного действия) 小さな IED (埋め込み型、圧力感知) 소형 급조폭발물 (묻힘, 압력식) + 小型简易爆炸装置 (地表下, 压力盘) + 小型簡易爆炸裝置 (地表下, 壓力盤) Connect to %1 @@ -874,6 +992,8 @@ Conectar à %1 %1 へ接続 %1에 연결중 + 连接到%1 + 連接到%1 Tripwire Flare @@ -884,6 +1004,8 @@ 조명지뢰 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 @@ -894,6 +1016,8 @@ 종류: 조명지뢰 - 작동시 무해한 조명을 사출합니다.<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..94992669d9 100644 --- a/addons/fastroping/CfgVehicles.hpp +++ b/addons/fastroping/CfgVehicles.hpp @@ -4,7 +4,7 @@ control = "Checkbox"; \ displayName = CSTRING(Eden_equipFRIES); \ tooltip = CSTRING(Eden_equipFRIES_Tooltip); \ - expression = QUOTE([_this] call FUNC(equipFRIES)); \ + expression = QUOTE(if (_value) then {[_this] call FUNC(equipFRIES)}); \ typeName = "BOOL"; \ condition = "objectVehicle"; \ defaultValue = false; \ @@ -18,7 +18,7 @@ class CfgVehicles { }; class ACE_Module: Module_F {}; class ACE_moduleEquipFRIES: ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(Module_FRIES_DisplayName); icon = QPATHTOF(UI\Icon_Module_FRIES_ca.paa); category = "ACE"; @@ -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 1efb204247..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 @@ -18,7 +32,6 @@ }, {false}] call CBA_fnc_addKeybind; - #ifdef DRAW_FASTROPE_INFO addMissionEventHandler ["Draw3D", { if (!(cursorObject isKindOf "Helicopter")) exitWith {}; 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 0011e0ecf9..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]; @@ -65,7 +70,7 @@ if ( 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 @@ -79,7 +84,7 @@ if ( _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 19bdd1a109..77c8168f8d 100644 --- a/addons/fastroping/script_component.hpp +++ b/addons/fastroping/script_component.hpp @@ -16,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 26573f3e0d..8c8e4ee600 100644 --- a/addons/fastroping/stringtable.xml +++ b/addons/fastroping/stringtable.xml @@ -13,6 +13,8 @@ Десантирование по канатам FRIES を装備 FRIES 장착 + 启用快速绳降及撤离系统 + 啟用快速繩降及撤離系統 Equips compatible helicopters with a Fast Rope Insertion Extraction System. @@ -26,10 +28,12 @@ Снаряжает совместимые вертолеты оборудованием для спуска десанта по канатам. ヘリコプターで 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 @@ -39,6 +43,17 @@ Подготовить канаты ファスト ロープのシステムを準備 패스트로프 준비 + 准备快速绳降系统 + 準備快速繩降系統 + + + Stow fast roping system + Verstaue "Fast Roping"-System + Arrotola le corde + ファスト ロープのシステムを収容 + 收起快速繩降系統 + 收起快速绳降系统 + 패스트 로프 시스템 보관 Deploy ropes @@ -52,6 +67,8 @@ Зацепить канаты ロープを展開 줄 배치 + 部属绳索 + 部屬繩索 Fast rope @@ -65,6 +82,8 @@ Спуститься по канату ファスト ロープをする 강하하기 + 快速绳降 + 快速繩降 Cut ropes @@ -78,6 +97,8 @@ Обрезать канаты ロープを切断 줄 자르기 + 剪掉绳索 + 剪掉繩索 Equip helicopter with FRIES @@ -91,6 +112,8 @@ Снарядить вертолет канатами для спуска ヘリコプターへ FRIES を装備 헬리콥터에 FRIES 장착 + 启用快速绳降及撤离系统给指定的直升机 + 啟用快速繩降及撤離系統給指定的直升機 Equips the selected helicopter with a Fast Rope Insertion Extraction System @@ -104,6 +127,8 @@ Снаряжает выбранный вертолет оборудованием для спуска десанта по канатам 選択されたヘリコプターで Fast Rope Insertion Extraction System を使えるようにします。 선택된 헬리콥터에 패스트로프 투입 및 탈출 시스템을 장착합니다. + 使指定的直升机启用快速绳降及撤离系统 + 使指定的直升機啟用快速繩降及撤離系統 LET UNITS FAST ROPE @@ -114,6 +139,9 @@ ДЕСАНТИРОВАНИЕ ПО КАНАТУ ユニットへファスト ロープをさせる ZJAZD NA LINACH + 让单位快速绳降 + 讓單位快速繩降 + 패스트 로프를 놓음 diff --git a/addons/fcs/CfgVehicles.hpp b/addons/fcs/CfgVehicles.hpp index 47b731a66c..5b5935506e 100644 --- a/addons/fcs/CfgVehicles.hpp +++ b/addons/fcs/CfgVehicles.hpp @@ -47,25 +47,19 @@ class CfgVehicles { }; }; class Turrets { - class MainTurret: NewTurret { - GVAR(Enabled) = 1; // all tracked vehicles get one by default - }; + class MainTurret: NewTurret {}; }; }; class Tank_F: Tank { class Turrets { - class MainTurret: NewTurret { - GVAR(Enabled) = 1; // all tracked vehicles get one by default - }; + class MainTurret: NewTurret {}; }; }; class APC_Tracked_01_base_F: Tank_F { class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 0; - }; + class MainTurret: MainTurret {}; }; }; @@ -86,14 +80,11 @@ class CfgVehicles { class APC_Tracked_02_base_F: Tank_F { class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 0; - }; + class MainTurret: MainTurret {}; }; }; class O_APC_Tracked_02_base_F: APC_Tracked_02_base_F {}; - class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F { class Turrets: Turrets { class MainTurret: MainTurret { @@ -107,38 +98,6 @@ class CfgVehicles { }; }; - class APC_Tracked_03_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 0; - }; - }; - }; - - class MBT_01_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 0; - }; - }; - }; - - class MBT_02_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 0; - }; - }; - }; - - class MBT_03_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 0; - }; - }; - }; - // AIR VEHICLES class Air: AllVehicles {}; 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/functions/dev_debugConfigs.sqf b/addons/fcs/dev/test_debugConfigs.sqf similarity index 89% rename from addons/fcs/functions/dev_debugConfigs.sqf rename to addons/fcs/dev/test_debugConfigs.sqf index 73abd89771..89fa6b0d31 100644 --- a/addons/fcs/functions/dev_debugConfigs.sqf +++ b/addons/fcs/dev/test_debugConfigs.sqf @@ -1,5 +1,8 @@ // PabstMirror -#include "script_component.hpp" +// ["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]; @@ -20,7 +23,10 @@ private _problemUIs = []; _ballisticComputer = [_ballisticComputer, 5] call ace_common_fnc_toBin; if ((_ballisticComputer select [(count _ballisticComputer) - 5, 1]) == "1") then { _vanillaFCS = true; - if (_aceFCS) then {diag_log text format ["%1 -> %2: ACE FCS Enabled CONFLICTS with vanilla FCS [%3]", _vehicleType, _weapon, _ballisticComputer];}; + if (_aceFCS) then { + _testPass = false; + diag_log text format ["%1 -> %2: ACE FCS Enabled CONFLICTS with vanilla FCS [%3]", _vehicleType, _weapon, _ballisticComputer]; + }; }; } forEach _weapons; @@ -76,7 +82,8 @@ private _problemUIs = []; }; }; }; - } forEach [[0],[0,0]]; + // } forEach [[0],[0,0]]; + } forEach [[0],[0,0], [1], [2]]; } forEach _vehicles; _problemUIs sort true; @@ -86,3 +93,5 @@ 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 41cbfa5069..f28a1c7048 100644 --- a/addons/fcs/functions/fnc_calculateSolution.sqf +++ b/addons/fcs/functions/fnc_calculateSolution.sqf @@ -3,14 +3,17 @@ * 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" 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 dbfebae025..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" 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 2418d649ce..5c0b77d75b 100644 --- a/addons/fcs/stringtable.xml +++ b/addons/fcs/stringtable.xml @@ -14,10 +14,12 @@ Marcar com laser / Medir Distância レーザー ターゲット / 計測距離 목표까지 거리를 레이저로 취득 + 雷射指示目标 / 测量距离 + 雷射指示目標 / 測量距離 Zeroed To - Haltepunkt + Genullt auf Ajustado a Wyzerowany na Nastaveno na @@ -28,6 +30,8 @@ Azzeramento a 次にゼロイン 영점 조절 + 归零到 + 歸零到 Adjust FCS Range (Up) @@ -42,6 +46,8 @@ Диапазон СУО (Выше) FCS による距離を調節 (上げ) 사통장치 거리 조정 (위로) + 调整火控系统距离 (上) + 調整火控系統距離 (上) Adjust FCS Range (Down) @@ -56,6 +62,8 @@ Диапазон СУО (Ниже) FCS による距離を調節 (下げ) 사통장치 거리 조정 (아래로) + 调整火控系统距离 (下) + 調整火控系統距離 (下) Reset FCS @@ -70,6 +78,8 @@ Обнулить СУО FCS を初期化 사통장치 초기화 + 重置火控系统 + 重置火控系統 FCS has been reset. @@ -84,6 +94,8 @@ СУО обнулен. FCS は初期化された 사통장치 초기화됨 + 火控系统已被重置 + 火控系統已被重置 diff --git a/addons/finger/ACE_Settings.hpp b/addons/finger/ACE_Settings.hpp index 73e1db1904..c28b33dd74 100644 --- a/addons/finger/ACE_Settings.hpp +++ b/addons/finger/ACE_Settings.hpp @@ -1,16 +1,20 @@ class ACE_Settings { class GVAR(enabled) { + category = CSTRING(DisplayName); value = 0; typeName = "BOOL"; displayName = CSTRING(enabled_displayName); }; class GVAR(maxRange) { + category = CSTRING(DisplayName); value = 4; typeName = "SCALAR"; displayName = CSTRING(maxRange_displayName); description = CSTRING(maxRange_description); + sliderSettings[] = {0, 50, 4, 1}; }; class GVAR(indicatorForSelf) { + category = CSTRING(DisplayName); value = 1; typeName = "BOOL"; isClientSettable = 1; @@ -18,6 +22,7 @@ class ACE_Settings { description = CSTRING(indicatorForSelf_description); }; class GVAR(indicatorColor) { + category = CSTRING(DisplayName); value[] = {0.83, 0.68, 0.21, 0.75}; typeName = "COLOR"; isClientSettable = 1; diff --git a/addons/finger/CfgVehicles.hpp b/addons/finger/CfgVehicles.hpp index 8125e7f2f5..8d6d1a4146 100644 --- a/addons/finger/CfgVehicles.hpp +++ b/addons/finger/CfgVehicles.hpp @@ -1,12 +1,12 @@ class CfgVehicles { class ACE_Module; class GVAR(moduleSettings): ACE_Module { - scope = 2; + scope = 1; category = "ACE"; displayName = CSTRING(moduleSettings_displayName); icon = QPATHTOF(UI\Icon_Module_finger_ca.paa); function = QFUNC(moduleSettings); - isGlobal = 0; + isGlobal = 1; isSingular = 1; author = ECSTRING(common,ACETeam); class Arguments { 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..678b51ac5f 100644 --- a/addons/finger/functions/fnc_moduleSettings.sqf +++ b/addons/finger/functions/fnc_moduleSettings.sqf @@ -8,13 +8,15 @@ * Return Value: * None * + * Example: + * [logic] call ace_finger_fnc_moduleSettings + * * Public: No */ #include "script_component.hpp" params ["_logic"]; -if !(isServer) exitWith {}; [_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule); 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 c447e894cf..72f0b67d55 100644 --- a/addons/finger/stringtable.xml +++ b/addons/finger/stringtable.xml @@ -1,6 +1,14 @@ - + + + Pointing + Fingerzeig + Puntamento + 指向指示器 + 指向指示器 + 指差し + Show pointing indicator to self Zeigersymbol einem selbst anzeigen @@ -12,8 +20,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 @@ -26,8 +36,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 @@ -40,8 +52,10 @@ Indicador de señalado Ukazování směru Indicatore di puntamento - ポインティング表記 + 指差し表記 가리키기 표시기 + 指向指示器 + 指向指示器 Color of the pointing indicator circle @@ -54,8 +68,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" @@ -68,8 +84,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. @@ -82,8 +100,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 @@ -96,8 +116,10 @@ Ajustes de señalado Nastavení ukázování směru Impostazioni puntamento - ポインティング設定 + 指差し設定 가리키기 설정 + 指向设定 + 指向設定 Pointing Enabled @@ -110,8 +132,10 @@ Señalado habilitado Ukazování povoleno Puntamento abilitato - ポインティングを有効 + 指差しを有効 가리키기 활성화 + 指向系统启动 + 指向系統啟動 Pointing Max Range @@ -124,8 +148,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] @@ -138,8 +164,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公尺] diff --git a/addons/flashlights/CfgWeapons.hpp b/addons/flashlights/CfgWeapons.hpp index a708e1eb74..9623b4d069 100644 --- a/addons/flashlights/CfgWeapons.hpp +++ b/addons/flashlights/CfgWeapons.hpp @@ -1,15 +1,16 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_Flashlight_MX991: ACE_ItemCore { + author = ECSTRING(common,ACETeam); displayName = CSTRING(MX991_DisplayName); descriptionShort = CSTRING(MX991_Description); 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"; @@ -21,12 +22,13 @@ class CfgWeapons { }; class ACE_Flashlight_KSF1: ACE_ItemCore { + author = ECSTRING(common,ACETeam); displayName = CSTRING(KSF1_DisplayName); descriptionShort = CSTRING(KSF1_Description); 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"; @@ -38,12 +40,13 @@ class CfgWeapons { }; class ACE_Flashlight_XL50: ACE_ItemCore { + author = ECSTRING(common,ACETeam); displayName = CSTRING(XL50_DisplayName); descriptionShort = CSTRING(XL50_Description); 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 +56,4 @@ class CfgWeapons { }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/flashlights/stringtable.xml b/addons/flashlights/stringtable.xml index 2a411e9158..08e291a2b6 100644 --- a/addons/flashlights/stringtable.xml +++ b/addons/flashlights/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -11,8 +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. @@ -26,6 +28,8 @@ Lampe torche avec un filtre rouge. Pour utilisation sur carte. 赤色フィルタ付きのフラッシュライト。地図上でつかいます。 빨간색 필터가 달린 손전등입니다. 지도를 비출때 씁니다. + 拥有红色滤光片的手电筒。用来照亮地图。 + 擁有紅色濾光片的手電筒。用來照亮地圖。 Maglite XL50 @@ -37,8 +41,10 @@ Maglite XL50 Maglite XL50 Maglite XL50 - Maglite XL50 + マグライト XL50 Maglite XL50 + Maglite XL50 + Maglite XL50 White mini flashlight. For use on map. @@ -52,6 +58,8 @@ Mini lampe torche blanche. Pour utilisation sur carte. 白色光の小さなフラッシュライト。地図上でつかいます。 하얀색 조그마한 손전등. 지도를 비출때 씁니다. + 白色的迷你手电筒。用来照亮地图。 + 白色的迷你手電筒。用來照亮地圖。 KSF-1 @@ -65,10 +73,12 @@ 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. Фонарь с красным светофильтром. Для использования на карте. @@ -78,6 +88,8 @@ Lampe torche avec un filtre rouge. Pour utilisation sur carte. 赤色フィルタ付きのフラッシュライト。地図上でつかいます。 빨간색 필터가 달린 손전등입니다. 지도를 비출때 씁니다. + 拥有红色滤光片的手电筒。用来照亮地图。 + 擁有紅色濾光片的手電筒。用來照亮地圖。 diff --git a/addons/flashsuppressors/stringtable.xml b/addons/flashsuppressors/stringtable.xml index e35d442136..52563ea1c4 100644 --- a/addons/flashsuppressors/stringtable.xml +++ b/addons/flashsuppressors/stringtable.xml @@ -14,6 +14,8 @@ Bocacha (6,5 mm) 消炎器 (6.5 mm) 소염기 (6.5 mm) + 消光器 (6.5 mm) + 消光器 (6.5 mm) Flash Suppressor (7.62 mm) @@ -28,6 +30,8 @@ Bocacha (7,62 mm) 消炎器 (7.62 mm) 소염기 (7.62 mm) + 消光器 (7.62 mm) + 消光器 (7.62 mm) Flash Suppressor (5.56 mm) @@ -42,6 +46,8 @@ Bocacha (5,56 mm) 消炎器 (5.56 mm) 소염기 (5.56 mm) + 消光器 (5.56 mm) + 消光器 (5.56 mm) Flash Suppressor (.45 ACP) @@ -56,6 +62,8 @@ Bocacha (.45 ACP) 消炎器 (.45 ACP) 소염기 (.45 ACP) + 消光器 (.45 ACP) + 消光器 (.45 ACP) Flash Suppressor (9 mm) @@ -70,6 +78,8 @@ Bocacha (9 mm) 消炎器 (9 mm) 소염기 (9 mm) + 消光器 (9 mm) + 消光器 (9 mm) Flash Suppressor (.338) @@ -84,6 +94,8 @@ Bocacha (.338) 消炎器 (.338) 소염기 (.338) + 消光器 (.338) + 消光器 (.338) Flash Suppressor (9.3 mm) @@ -98,6 +110,8 @@ Bocacha (9,3 mm) 消炎器 (9.3 mm) 소염기 (9.3 mm) + 消光器 (9.3 mm) + 消光器 (9.3 mm) 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/ACE_Settings.hpp b/addons/frag/ACE_Settings.hpp index 63a3d564d2..6d511d3c3d 100644 --- a/addons/frag/ACE_Settings.hpp +++ b/addons/frag/ACE_Settings.hpp @@ -26,6 +26,7 @@ class ACE_Settings { description = CSTRING(MaxTrack_Desc); typeName = "SCALAR"; value = 10; + sliderSettings[] = {0, 50, 10, -1}; }; class GVAR(maxTrackPerFrame) { category = CSTRING(Module_DisplayName); @@ -33,5 +34,6 @@ class ACE_Settings { description = CSTRING(MaxTrackPerFrame_Desc); typeName = "SCALAR"; value = 10; + sliderSettings[] = {0, 50, 10, -1}; }; }; diff --git a/addons/frag/functions/fnc_addBlackList.sqf b/addons/frag/functions/fnc_addBlackList.sqf index 79cb41adab..cfa96c9784 100644 --- a/addons/frag/functions/fnc_addBlackList.sqf +++ b/addons/frag/functions/fnc_addBlackList.sqf @@ -6,7 +6,7 @@ * 0: Projectile * * Return Value: - * Nothing + * None * * Example: * [bullet] call ace_frag_fnc_addBlackList diff --git a/addons/frag/functions/fnc_addPfhRound.sqf b/addons/frag/functions/fnc_addPfhRound.sqf index 7c609f2146..f97d868b9d 100644 --- a/addons/frag/functions/fnc_addPfhRound.sqf +++ b/addons/frag/functions/fnc_addPfhRound.sqf @@ -9,7 +9,7 @@ * 2: Projectile * * Return Value: - * Nothing + * None * * Example: * [player, "handGrenade", bullet] call ace_frag_fnc_addPfhRound diff --git a/addons/frag/functions/fnc_dev_addTrack.sqf b/addons/frag/functions/fnc_dev_addTrack.sqf index 764627b60f..fd180eacfe 100644 --- a/addons/frag/functions/fnc_dev_addTrack.sqf +++ b/addons/frag/functions/fnc_dev_addTrack.sqf @@ -1,3 +1,19 @@ +/* + * 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]]]; diff --git a/addons/frag/functions/fnc_dev_debugAmmo.sqf b/addons/frag/functions/fnc_dev_debugAmmo.sqf index 894c532728..8eec5f04f5 100644 --- a/addons/frag/functions/fnc_dev_debugAmmo.sqf +++ b/addons/frag/functions/fnc_dev_debugAmmo.sqf @@ -1,3 +1,19 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_debugAmmo + * + * Public: No + */ + #define DEBUG_MODE_FULL #include "script_component.hpp" diff --git a/addons/frag/functions/fnc_dev_drawTraces.sqf b/addons/frag/functions/fnc_dev_drawTraces.sqf index c6ab838e84..f7d36b4f02 100644 --- a/addons/frag/functions/fnc_dev_drawTraces.sqf +++ b/addons/frag/functions/fnc_dev_drawTraces.sqf @@ -1,3 +1,19 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_drawTraces + * + * Public: No + */ + #include "script_component.hpp" { diff --git a/addons/frag/functions/fnc_dev_startTracing.sqf b/addons/frag/functions/fnc_dev_startTracing.sqf index b58a491896..e58445ec83 100644 --- a/addons/frag/functions/fnc_dev_startTracing.sqf +++ b/addons/frag/functions/fnc_dev_startTracing.sqf @@ -1,3 +1,19 @@ +/* + * 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 {}; diff --git a/addons/frag/functions/fnc_dev_stopTracing.sqf b/addons/frag/functions/fnc_dev_stopTracing.sqf index c25021bb4e..f3b8fa234b 100644 --- a/addons/frag/functions/fnc_dev_stopTracing.sqf +++ b/addons/frag/functions/fnc_dev_stopTracing.sqf @@ -1,3 +1,18 @@ +/* + * Author: ACE-Team + * Dev things + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * + * Public: No + */ + #include "script_component.hpp" if (!GVAR(tracesStarted)) exitWith {}; diff --git a/addons/frag/functions/fnc_dev_trackTrace.sqf b/addons/frag/functions/fnc_dev_trackTrace.sqf index 07867ba1ff..b71f1982ff 100644 --- a/addons/frag/functions/fnc_dev_trackTrace.sqf +++ b/addons/frag/functions/fnc_dev_trackTrace.sqf @@ -1,3 +1,19 @@ +/* + * 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"]; diff --git a/addons/frag/functions/fnc_doExplosions.sqf b/addons/frag/functions/fnc_doExplosions.sqf index 85074bdb13..25302cca7c 100644 --- a/addons/frag/functions/fnc_doExplosions.sqf +++ b/addons/frag/functions/fnc_doExplosions.sqf @@ -1,3 +1,19 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_doExplosions + * + * Public: No + */ + //fnc_doExplosions.sqf #include "script_component.hpp" diff --git a/addons/frag/functions/fnc_doReflections.sqf b/addons/frag/functions/fnc_doReflections.sqf index b4bec189f7..622c4c57f4 100644 --- a/addons/frag/functions/fnc_doReflections.sqf +++ b/addons/frag/functions/fnc_doReflections.sqf @@ -1,3 +1,19 @@ +/* + * 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" diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index ee1bc37384..65b9327d5a 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -1,6 +1,21 @@ -//fnc_doSpall.sqf +/* + * Author: ACE-Team + * Dev things + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_doSpall + * + * Public: No + */ #include "script_component.hpp" -// ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA"; + +#define WEIGHTED_SIZE [QGVAR(spall_small), 4, QGVAR(spall_medium), 3, QGVAR(spall_large), 2, QGVAR(spall_huge), 1] params ["_hitData", "_hitPartDataIndex"]; private _initialData = GVAR(spallHPData) select (_hitData select 0); @@ -35,6 +50,7 @@ if (alive _round) then { }; }; if (_exit) exitWith {}; + private _unitDir = vectorNormalized _velocity; private _pos = _hpData select 3; private _spallPos = []; @@ -72,14 +88,6 @@ if (_explosive > 0) then { _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); @@ -94,8 +102,7 @@ for "_i" from 1 to _spallCount do { _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]; + private _fragment = (selectRandomWeighted WEIGHTED_SIZE) createVehicleLocal [0,0,10000]; _fragment setPosASL _spallPos; _fragment setVelocity _spallFragVect; @@ -117,8 +124,7 @@ for "_i" from 1 to _spallCount do { _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]; + private _fragment = (selectRandomWeighted WEIGHTED_SIZE) createVehicleLocal [0, 0, 10000]; _fragment setPosASL _spallPos; _fragment setVelocity _spallFragVect; diff --git a/addons/frag/functions/fnc_findReflections.sqf b/addons/frag/functions/fnc_findReflections.sqf index dbde4d7a98..774e1764ea 100644 --- a/addons/frag/functions/fnc_findReflections.sqf +++ b/addons/frag/functions/fnc_findReflections.sqf @@ -1,3 +1,19 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_findReflections + * + * Public: No + */ + //fnc_findReflections.sqf #include "script_component.hpp" @@ -78,7 +94,7 @@ if (_zIndex < 5) then { private _avg = [0, 0, 0]; { - _avg = _avg vectorAdd _x; + _avg = _avg vectorAdd _x; } forEach _blist; _c = count _blist; private _bpos = _avg vectorMultiply (1 / _c); diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index 42885d55b0..a9d13cde08 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 @@ -54,10 +54,11 @@ if (_shouldAdd) then { private _localShooter = if (isNil "_gunner") then {local _unit} else {local _gunner}; TRACE_4("",_localShooter,_unit,_ammo,_projectile); if (!_localShooter) exitWith {}; + if (_weapon == "Put") exitWith {}; // Ignore explosives placed without ace_explosives // 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 49f1a62237..a21e92d4b3 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -8,7 +8,7 @@ * 2: Ammo Classname * * Return Value: - * Nothing + * None * * Example: * [[], [], "handGrenade"] call ace_frag_fnc_frago diff --git a/addons/frag/functions/fnc_masterPFH.sqf b/addons/frag/functions/fnc_masterPFH.sqf index 10b7743102..638a91ee63 100644 --- a/addons/frag/functions/fnc_masterPFH.sqf +++ b/addons/frag/functions/fnc_masterPFH.sqf @@ -7,7 +7,13 @@ * * Return Value: * None + * + * Example: + * call ace_frag_fnc_masterPFH + * + * Public: No */ + //#define DEBUG_MODE_FULL #include "script_component.hpp" diff --git a/addons/frag/functions/fnc_pfhRound.sqf b/addons/frag/functions/fnc_pfhRound.sqf index 3c72a525c9..9d63df3f2a 100644 --- a/addons/frag/functions/fnc_pfhRound.sqf +++ b/addons/frag/functions/fnc_pfhRound.sqf @@ -1,3 +1,19 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_pfhRound + * + * Public: No + */ + #include "script_component.hpp" params ["_round", "_lastPos", "_lastVel", "_shellType", "_firedFrame", "_gun", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"]; diff --git a/addons/frag/functions/fnc_spallHP.sqf b/addons/frag/functions/fnc_spallHP.sqf index 085e037e70..643f5aefe4 100644 --- a/addons/frag/functions/fnc_spallHP.sqf +++ b/addons/frag/functions/fnc_spallHP.sqf @@ -1,3 +1,19 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_spallHP + * + * Public: No + */ + #include "script_component.hpp" //player sideChat format ["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))]; diff --git a/addons/frag/functions/fnc_spallTrack.sqf b/addons/frag/functions/fnc_spallTrack.sqf index aedcf56cf8..ee928b35c0 100644 --- a/addons/frag/functions/fnc_spallTrack.sqf +++ b/addons/frag/functions/fnc_spallTrack.sqf @@ -1,3 +1,19 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_spallTrack + * + * Public: No + */ + //fnc_spallTrack.sqf #include "script_component.hpp" diff --git a/addons/frag/stringtable.xml b/addons/frag/stringtable.xml index 8429cad3b3..071924ac65 100644 --- a/addons/frag/stringtable.xml +++ b/addons/frag/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Simulazione Frammentazione 破片シミュレーション 조각 시뮬레이션 + 模拟碎片 + 模擬碎片 Fragmentation Simulation @@ -28,6 +30,8 @@ Simulazione Frammentazione 破片シミュレーション 조각 시뮬레이션 + 模拟碎片 + 模擬碎片 Enable the ACE Fragmentation Simulation @@ -42,6 +46,8 @@ Abilita la Simulazione Frammentazione di ACE ACE 破片シミュレーションを有効化 ACE 조각 시뮬레이션을 적용합니다. + 启用ACE模拟碎片 + 啟用ACE模擬碎片 Spalling Simulation @@ -56,6 +62,8 @@ Simulazione Spalling 剥離シミュレーション 파편 시뮬레이션 + 模拟剥落 + 模擬剝落 Enable the ACE Spalling Simulation @@ -70,6 +78,8 @@ Abilita la Simulazione Spalling di ACE ACE 剥離シミュレーションを有効化 ACE 파편 시뮬레이션을 적용합니다. + 启用ACE模拟剥落 + 啟用ACE模擬剝落 Explosion Reflections Simulation @@ -82,6 +92,8 @@ Cимуляция отражения взрывов ACE 爆発による飛翔シミュレーション 폭발 반사 시뮬레이션 + 模拟爆炸反射 + 模擬爆炸反射 Enable the ACE Explosion Reflection Simulation @@ -94,6 +106,8 @@ Включить симуляцию отражения взрывов ACE 爆発による飛翔シミュレーションを有効化 ACE 폭발 반사 시뮬레이션을 적용합니다. + 启用ACE模拟爆炸反射 + 啟用ACE模擬爆炸反射 Maximum Projectiles Tracked @@ -108,6 +122,8 @@ 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) @@ -122,6 +138,8 @@ 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 @@ -136,6 +154,8 @@ 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. @@ -150,6 +170,8 @@ 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 @@ -164,6 +186,8 @@ (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. @@ -177,6 +201,9 @@ (Только для одиночной игры) Требует перезапуска миссии/редактора. Включает визуальные следы от осколков и обломков в режиме одиночной игры. (Solo SP) Richiede un restart editor/missione. Abilita il tracciamento visivo di schegge da frammentazione/spalling in modalità Giocatore Singolo. (SP のみ) ミッションとエディタの再起動が必要です。有効化すると、シングルプレイでのみ破片と剥離の弾頭が見えるようになります。 + (仅在单人模式) 让你在单人模式下可观察到碎片/剥落粒子的移动轨迹。 + (僅在單人模式) 讓你在單人模式下可觀察到碎片/剝落粒子的移動軌跡。 + (SP 전용) 임무 / 편집자가 다시 시작해야합니다. SP 게임 모드에서만 조각화 및 스 폴링 라운드의 시각적 추적을 가능하게합니다. 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/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 4f5063721b..fce2270cbb 100644 --- a/addons/gestures/stringtable.xml +++ b/addons/gestures/stringtable.xml @@ -1,6 +1,22 @@  + + ACE Gestures + ACE Gesten + ACE Gesty + ACE Posunky + ACE Gestes + ACE Kézjelek + ACE Gesti + ACE Gestos + ACE Жесты + ACE Gestos + ACE ジェスチャー + ACE 수신호 + ACE 手势 + ACE 手勢 + ACE Gestures ACE Gesten @@ -8,12 +24,14 @@ ACE Posunky ACE Gestes ACE Kézjelek - Gesti ACE + ACE Gesti ACE Gestos ACE Жесты ACE Gestos ACE ジェスチャー ACE 수신호 + ACE 手势 + ACE 手勢 Gestures @@ -28,6 +46,8 @@ Gesti ジェスチャー 수신호 + 手势 + 手勢 Advance @@ -42,6 +62,8 @@ Avanzare 警戒 전진 + 前进 + 前進 Go @@ -56,6 +78,8 @@ Muoversi 進め 이동 + 出发 + 出發 Follow @@ -70,6 +94,8 @@ Seguire ついて来い 따라올것 + 跟进 + 跟進 Up @@ -84,6 +110,8 @@ Alzarsi 立ち上がれ + 起立 + 起立 Cease Fire @@ -98,6 +126,8 @@ Cessare il Fuoco 撃つな 사격 중지 + 停火 + 停火 Stop @@ -111,6 +141,8 @@ Detenerse 止まれ 멈춰 + 停止 + 停止 Freeze @@ -125,6 +157,8 @@ Fermi 動くな 정지 + 不准动 + 不准動 Cover @@ -139,6 +173,8 @@ Copertura 隠れろ 엄폐 + 掩护 + 掩護 Rally up @@ -152,6 +188,8 @@ Reunirse 集合 집결 + 集合 + 集合 Move forward @@ -165,6 +203,8 @@ Avanzar 前に進め 앞으로 이동 + 往前走 + 往前走 Engage @@ -178,6 +218,8 @@ Atacar 交戦しろ 교전할것 + 交战 + 交戰 Point @@ -191,6 +233,8 @@ Señalar 指示 가리키기 + 指出 + 指出 Hold @@ -204,6 +248,8 @@ Esperar そこにいろ 기다려 + 停住 + 停住 Warning @@ -217,6 +263,8 @@ Atención 注意 주의 + 警告 + 警告 Show Gestures On Interaction Menu @@ -230,6 +278,8 @@ Показать жесты в меню взаимодействия インタラクション メニュー上でジェスチャーを表示する 수신호를 상호작용 메뉴에서 보여줍니다 + 显示手势互动选单 + 顯示手勢互動選單 Show gestures on the self interaction menu, or just use keybinds, or disable completely @@ -243,6 +293,8 @@ Показать жесты в меню взамиодейтсвия с собой или только использовать горячие клавиши, или полностью отключить キー操作や同時使用を無効化している場合はセルフ インタラクション メニュ上でジェスチャーを表示します 수신호를 상호작용 메뉴에서 보여주거나 혹은 단축키를 지정하거나 아니면 아예 사용하지 않습니다. + 显示手势选项在自己的互动选单上,或只利用键盘来使用手势,或完全禁用 + 顯示手勢選項在自己的互動選單上,或只利用鍵盤來使用手勢,或完全禁用 Just Keybinds @@ -256,6 +308,8 @@ Только горячие клавиши キー操作のみ 오직 단축키만 + 只利用键盘 + 只利用鍵盤 Keybinds + Interaction Menu @@ -269,6 +323,8 @@ Клавиши + Меню взаимодействия キー操作とインタラクション メニュ 단축키및 상호작용 메뉴 + 键盘 + 互动选单 + 鍵盤 + 互動選單 diff --git a/addons/gforces/functions/fnc_addPFEH.sqf b/addons/gforces/functions/fnc_addPFEH.sqf index bf320e0fe5..2464575fdc 100644 --- a/addons/gforces/functions/fnc_addPFEH.sqf +++ b/addons/gforces/functions/fnc_addPFEH.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_gforces_fnc_addPFEH + * * Public: No */ #include "script_component.hpp" diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index f4f7c4becd..29df88e9c4 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" @@ -69,7 +72,7 @@ private _gBlackOut = MAXVIRTUALG / _classCoef + MAXVIRTUALG / _suitCoef - MAXVIR // Unconsciousness if ((_average > _gBlackOut) and {isClass (configFile >> "CfgPatches" >> "ACE_Medical") and {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then { - [ACE_player, true, (10 + floor(random 5))] call EFUNC(medical,setUnconscious); + [ACE_player, true, (10 + floor(random 5)), true] call EFUNC(medical,setUnconscious); }; GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]]; diff --git a/addons/gforces/stringtable.xml b/addons/gforces/stringtable.xml index 2abb558b58..12d3d0ba53 100644 --- a/addons/gforces/stringtable.xml +++ b/addons/gforces/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,8 @@ Efekty przeciążeń 중력가속도 효과 Effetti forza G + G力影响 + G力影響 Only Aircraft @@ -26,6 +28,8 @@ Tylko samoloty 비행기에만 적용 Solo Aerei + 只有战斗机 + 只有戰鬥機 diff --git a/addons/goggles/ACE_Settings.hpp b/addons/goggles/ACE_Settings.hpp index 659a10b4e3..2b20b46514 100644 --- a/addons/goggles/ACE_Settings.hpp +++ b/addons/goggles/ACE_Settings.hpp @@ -1,12 +1,14 @@ class ACE_Settings { class GVAR(effects) { + category = CSTRING(DisplayName); displayName = CSTRING(effects_displayName); typeName = "SCALAR"; value = 2; values[] = {ECSTRING(common,Disabled), CSTRING(effects_tintOnly), CSTRING(enabled_tintAndEffects)}; }; class GVAR(showInThirdPerson) { + category = CSTRING(DisplayName); value = 0; typeName = "BOOL"; isClientSettable = 1; diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 5b93a7a459..9927a165f1 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -4,7 +4,7 @@ if (!hasInterface) exitWith {}; ["ACE3 Common", QGVAR(wipeGlasses), localize LSTRING(WipeGlasses), { if (GVAR(effects) != 2) exitWith {false}; //Can only wipe if full effects setting is set - if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith { + if (!GETVAR(ace_player,ACE_isUnconscious,false)) exitWith { call FUNC(clearGlasses); 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 71425ce6ca..ccefe45541 100644 --- a/addons/goggles/functions/fnc_applyGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_applyGlassesEffect.sqf @@ -28,12 +28,10 @@ if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _player) >> "isPlayableLo TRACE_1("skipping playable logic",typeOf _player); // VirtualMan_F (placeable logic zeus / spectator) }; -private ["_config", "_postProcessColour", "_postProcessTintAmount", "_imagePath"]; +private _config = configFile >> "CfgGlasses" >> _glasses; -_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]; @@ -45,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/script_component.hpp b/addons/goggles/script_component.hpp index c0c8e43df4..854e27fab3 100644 --- a/addons/goggles/script_component.hpp +++ b/addons/goggles/script_component.hpp @@ -37,6 +37,6 @@ #define DBULLETS 2 #define DAMOUNT 3 -#define GLASSDISPLAY (GETUVAR(GVAR(Display),displayNull)) +#define GLASSDISPLAY GETUVAR(GVAR(Display),displayNull) #define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) diff --git a/addons/goggles/stringtable.xml b/addons/goggles/stringtable.xml index c06d310ef7..44d0328726 100644 --- a/addons/goggles/stringtable.xml +++ b/addons/goggles/stringtable.xml @@ -1,6 +1,14 @@  + + Goggles + Schutzbrille + Occhiali + 護目鏡 + 护目镜 + ゴーグル + Show Goggle Effects in Third Person Brilleneffekt in dritter Person anzeigen @@ -14,6 +22,8 @@ Attiva l'effetto degli occhiali in terza persona 三人称視点でもゴーグルによる効果を出す 3인칭시에도 고글 효과를 보이게 합니다 + 在第三人称视角显示护目镜效果 + 在第三人稱視角顯示護目鏡效果 Wipe Goggles @@ -28,6 +38,8 @@ Pulisci gli occhiali ゴーグルを拭く 고글 닦기 + 擦拭护目镜 + 擦拭護目鏡 Goggle Effects @@ -37,7 +49,9 @@ Brilleneffekt 고글 효과 Effets des lunettes - Effetto Occhiali + Effetti Occhiali + 护目镜效果 + 護目鏡效果 Tint @@ -48,6 +62,8 @@ 색조 Teinte Colore + 染色 + 染色 Tint + Effects @@ -58,6 +74,8 @@ 색조+효과 Teinte + effets Colore + Effetti + 染色 + 影响 + 染色 + 影響 diff --git a/addons/grenades/functions/fnc_incendiary.sqf b/addons/grenades/functions/fnc_incendiary.sqf index 6081daa8af..5b0384da3b 100644 --- a/addons/grenades/functions/fnc_incendiary.sqf +++ b/addons/grenades/functions/fnc_incendiary.sqf @@ -34,6 +34,8 @@ #define ORIENTATION 5.4 #define EXPANSION 1 +#define DESTRUCTION_RADIUS 1.8 + params ["_projectile", "_timeToLive", "_center"]; if (isNull _projectile) exitWith {TRACE_1("null",_projectile);}; @@ -169,7 +171,10 @@ if (isServer) then { _x setDamage 1; }; if (_x isKindOf "ReammoBox_F") then { - if ("ace_cookoff" call EFUNC(common,isModLoaded) && {EGVAR(cookoff,enable)}) then { + if ( + "ace_cookoff" call EFUNC(common,isModLoaded) && + {GETVAR(_x,EGVAR(cookoff,enableAmmoCookoff),EGVAR(cookoff,enableAmmobox))} + ) then { _x call EFUNC(cookoff,cookOffBox); } else { _x setDamage 1; @@ -184,7 +189,7 @@ if (isServer) then { // --- inflame fireplace, barrels etc. _x inflame true; }; -} forEach (_position nearObjects EFFECT_SIZE); +} forEach (_position nearObjects DESTRUCTION_RADIUS); // --- damage local vehicle private _vehicle = _position nearestObject "Car"; diff --git a/addons/grenades/stringtable.xml b/addons/grenades/stringtable.xml index fe102bec8f..3fc5ce6208 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -12,8 +12,10 @@ Gránátkezelési mód váltása Cambia tipo di granata Alternar Modo de Granada - グレネード モードを切り替え + 投てき方法を切り替え 투척 종류 전환 + 切换投掷模式 + 切換投擲模式 Normal Throw @@ -26,8 +28,10 @@ Normál dobás Lancio normale Arremesso Normal - 通常で投げる + 普通に投げる 일반 던지기 + 普通投掷 + 普通投擲 High Throw @@ -42,6 +46,8 @@ Arremesso Alto 高く投げる 높이 던지기 + 高抛 + 高拋 Precise Throw @@ -56,6 +62,8 @@ Arremesso Preciso 低く投げる 정확한 던지기 + 精准投掷 + 精準投擲 Roll Grenade @@ -70,6 +78,8 @@ Rolar Granada 転がす 굴려넣기 + 地面滚抛 + 地面滾拋 Drop Grenade @@ -84,6 +94,8 @@ Largar Granada 落とす 떨어뜨리기 + 下丢投掷 + 下丟投擲 M84 Stun Grenade @@ -98,6 +110,8 @@ M84 granada de atordoamento M84 閃光手榴弾 M84 섬광 수류탄 + M84 震撼弹 + M84 震撼彈 M84 @@ -112,6 +126,8 @@ M84 M84 M84 + M84 + M84 Also known as flashbang. Causes immediate flash blindness, deafness, tinnitus, and inner ear disturbance. @@ -126,6 +142,8 @@ Também conhecida como flashbang. Causa uma clarão imediato, cegueira, surdez, zumbido e distúrbio no tímpano. フラッシュバンとも知られています。即時に失明と難聴、耳鳴り、内耳障害を引き起こします。 플래시뱅이라고도 알려져있습니다. 사용즉시 섬광으로 인한 시력장애, 청각장애, 이명, 내이기관방해를 유발합니다. + 也被称为闪光弹,会造成暂时性失明,耳聋,耳鸣等效果。 + 也被稱為閃光彈,會造成暫時性失明,耳聾,耳鳴等效果。 M127A1 Hand Held Signal (White) @@ -140,6 +158,8 @@ M127A1 Feux à main (Blanc) M127A1 信号弾 (白) M127A1 신호탄 (하얀색) + M127A1 手持式信号弹 (白色) + M127A1 手持式信號彈 (白色) M127A1 Hand Held Signal (Red) @@ -154,6 +174,8 @@ M127A1 Feux à main (Rouge) M127A1 信号弾 (赤) M127A1 신호탄 (빨간색) + M127A1 手持式信号弹 (红色) + M127A1 手持式信號彈 (紅色) M127A1 Hand Held Signal (Green) @@ -168,6 +190,8 @@ M127A1 Feux à main (Vert) M127A1 信号弾 (緑) M127A1 신호탄 (초록색) + M127A1 手持式信号弹 (绿色) + M127A1 手持式信號彈 (綠色) M127A1 Hand Held Signal (Yellow) @@ -182,6 +206,8 @@ M127A1 Feux à main (Jaune) M127A1 信号弾 (黄) M127A1 신호탄 (노란색) + M127A1 手持式信号弹 (黄色) + M127A1 手持式信號彈 (黃色) White Hand Flare @@ -196,6 +222,8 @@ Feux à main (Blanc) 白の発炎筒 하얀색 불꽃신호기 + 白色手持式信号弹 + 白色手持式信號彈 Red Hand Flare @@ -210,6 +238,8 @@ Feux à main (Rouge) 赤の発炎筒 빨간색 불꽃신호기 + 红色手持式信号弹 + 紅色手持式信號彈 Green Hand Flare @@ -224,6 +254,8 @@ Feux à main (Vert) 緑の発炎筒 초록색 불꽃신호기 + 绿色手持式信号弹 + 綠色手持式信號彈 Yellow Hand Flare @@ -238,6 +270,8 @@ Feux à main (Jaune) 黄の発炎筒 노란색 불꽃신호기 + 黄色手持式信号弹 + 黃色手持式信號彈 M127A1 (White) @@ -252,6 +286,8 @@ M127A1 (Blanca) M127A1 (白) M127A1 (하양) + M127A1 (白色) + M127A1 (白色) M127A1 (Red) @@ -266,6 +302,8 @@ M127A1 (Roja) M127A1 (赤) M127A1 (빨강) + M127A1 (红色) + M127A1 (紅色) M127A1 (Green) @@ -280,6 +318,8 @@ M127A1 (Verde) M127A1 (緑) M127A1 (초록) + M127A1 (绿色) + M127A1 (綠色) M127A1 (Yellow) @@ -294,6 +334,8 @@ M127A1 (Amarilla) M127A1 (黄) M127A1 (노랑) + M127A1 (黄色) + M127A1 (黃色) AN-M14 Incendiary Grenade @@ -304,6 +346,8 @@ AN-M14 소이 수류탄 Grenade incendiaire AN-M14 AN-M14 Granata Incendiaria + AN-M14 燃烧手榴弹 + AN-M14 燃燒手榴彈 AN-M14 @@ -314,6 +358,8 @@ AN-M14 AN-M14 AN-M14 + AN-M14 + AN-M14 Incendiary grenade used to destroy weapons, ammunition and other equipment. @@ -324,6 +370,8 @@ 소이 수류탄은 무기나 탄약 그리고 장비를 파괴할때 쓰입니다. 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/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/stringtable.xml b/addons/gunbag/stringtable.xml index 5e5d8a7526..ab4fdf5ac7 100644 --- a/addons/gunbag/stringtable.xml +++ b/addons/gunbag/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -11,6 +11,8 @@ Torba na broń 총가방 Borsa per Armi + 枪袋 + 槍袋 Gunbag (Tan) @@ -22,6 +24,8 @@ Torba na broń (jasnobrązowa) 총가방 (황갈색) Borsa per Armi (Tan) + 枪袋 (黄褐色) + 槍袋 (黃褐色) Put weapon into gunbag @@ -33,6 +37,8 @@ Włóż broń do torby 무기를 총가방에 넣기 Metti l'arma nella borsa per armi + 将武器放置枪袋 + 將武器放置槍袋 Get weapon out of gunbag @@ -44,6 +50,8 @@ Wyciągnij broń z torby 무기를 총가방에서 꺼내기 Prendi l'arma dalla borsa per armi + 将武器拿出枪袋 + 將武器拿出槍袋 Status @@ -55,6 +63,8 @@ Status 상태 Stato + 状态 + 狀態 Gunbag Empty @@ -66,6 +76,8 @@ Torba jest pusta 총가방 비어있음 Borsa per armi vuota + 枪袋为空 + 槍袋為空 diff --git a/addons/hearing/ACE_Settings.hpp b/addons/hearing/ACE_Settings.hpp index 2fb2a46211..8814f2466d 100644 --- a/addons/hearing/ACE_Settings.hpp +++ b/addons/hearing/ACE_Settings.hpp @@ -10,11 +10,13 @@ class ACE_Settings { category = CSTRING(Module_DisplayName); value = 0.5; typeName = "SCALAR"; + sliderSettings[] = {0, 1, 0.5, 1}; }; class GVAR(unconsciousnessVolume) { category = CSTRING(Module_DisplayName); value = 0.4; typeName = "SCALAR"; + sliderSettings[] = {0, 1, 0.4, 1}; }; class GVAR(disableEarRinging) { category = CSTRING(Module_DisplayName); diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index f44e50e6d0..51e064d16b 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -6,7 +6,7 @@ class CfgVehicles { class ACE_PutInEarplugs { displayName = CSTRING(EarPlugs_On); condition = QUOTE(GVAR(EnableCombatDeafness) && {!([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player}}); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; statement = QUOTE( [_player] call FUNC(putInEarPlugs) ); showDisabled = 0; priority = 2.5; @@ -15,7 +15,7 @@ class CfgVehicles { class ACE_RemoveEarplugs { displayName = CSTRING(EarPlugs_Off); condition = QUOTE( GVAR(EnableCombatDeafness) && {[_player] call FUNC(hasEarPlugsIn)}); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; statement = QUOTE( [_player] call FUNC(removeEarPlugs) ); showDisabled = 0; priority = 2.5; @@ -97,7 +97,7 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleHearing); - scope = 2; + scope = 1; isGlobal = 1; isSingular = 1; icon = QPATHTOF(UI\Icon_Module_Hearing_ca.paa); diff --git a/addons/hearing/CfgWeapons.hpp b/addons/hearing/CfgWeapons.hpp index 8b138271b3..85d941909a 100644 --- a/addons/hearing/CfgWeapons.hpp +++ b/addons/hearing/CfgWeapons.hpp @@ -1,14 +1,15 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_EarPlugs: ACE_ItemCore { + author = ECSTRING(common,ACETeam); displayName = CSTRING(EarPlugs_Name); descriptionShort = CSTRING(EarPlugs_Description); 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; }; }; diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index 9087984b50..4917ac009b 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -20,8 +20,7 @@ params ["_unit", "_damage"]; 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_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 4075a982db..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 diff --git a/addons/hearing/functions/fnc_removeEarplugs.sqf b/addons/hearing/functions/fnc_removeEarplugs.sqf index 20bc7b8dcc..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 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 0b82e64659..d745734ca1 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Tappi auricolari 耳栓 귀마개 + 耳塞 + 耳塞 Protective Earplugs allow the wearer to be near loud weaponry without damage to his hearing. @@ -28,6 +30,8 @@ Proteggono l'apparato uditivo, permettendo a chi li indossa di resistere ai suoni particolarmente forti senza alcun danno. 着けることにより、近くの大きな銃声から聴覚を保護します。 보호용 귀마개는 화기로부터의 큰소리로부터 사용자의 청력을 보호합니다. + 配戴防护耳塞,遇到大声的武器发射时也不会损害听力。 + 配戴防護耳塞,遇到大聲的武器發射時也不會損害聽力。 Earplugs in @@ -42,6 +46,8 @@ Indossa i tappi auricolari 耳栓を着ける 귀마개 착용 + 塞入耳塞 + 塞入耳塞 Earplugs out @@ -56,6 +62,8 @@ Levati i tappi auricolari 耳栓を外す 귀마개 뺌 + 取出耳塞 + 取出耳塞 Earplugs in @@ -70,6 +78,8 @@ Indossa i tappi auricolari 耳栓を着けた 귀마개 착용 + 耳塞已塞入 + 耳塞已塞入 Earplugs out @@ -84,6 +94,8 @@ Levati i tappi auricolari 耳栓を外した 귀마개 뺌 + 耳塞已取出 + 耳塞已取出 You have no earplugs @@ -98,6 +110,8 @@ Non hai i tappi auricolari 耳栓を持っていません 귀마개가 없습니다 + 你没有耳塞 + 你沒有耳塞 No inventory space @@ -112,6 +126,8 @@ Нет места в инвентаре インベントリに空きがありません。 넣을 공간이 없습니다 + 无可用空间 + 無可用空間 Disable ear ringing @@ -126,6 +142,8 @@ Desabilitar zumbido de ouvidos 耳鳴りを無効化する 이명현상 끄기 + 关闭耳鸣效果 + 關閉耳鳴效果 Remove tinnitus effect when the player takes hearing damage @@ -138,6 +156,8 @@ Убирает эффект звона в ушах, когда игрок получает повреждение слуха プレイヤーの聴覚が損傷をしたら耳鳴りの効果を削除します 플레이어가 청력손실을 입을때 생기는 이명현상을 제거합니다. + 关闭耳鸣效果时,就算玩家受到相当程度的听力伤害, 也不会造成耳鸣效果 + 關閉耳鳴效果時,就算玩家受到相當程度的聽力傷害, 也不會造成耳鳴效果 Hearing @@ -152,6 +172,8 @@ Udito 聴覚 청력 + 听力设定 + 聽力設定 Enable Combat Deafness @@ -166,6 +188,8 @@ Sordità da combattimento 戦闘による難聴を有効化 전투 난청 켜기 + 启用战斗性耳聋? + 啟用戰鬥性耳聾? Reduces the hearing ability as the player takes hearing damage @@ -179,6 +203,8 @@ 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 @@ -193,6 +219,8 @@ 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 @@ -206,6 +234,8 @@ Effet sur le CàD du Zeus Zeus RC への効果 Zeus RC 효과 + 启用效果在宙斯远程遥控 + 啟用效果在宙斯遠程遙控 Allow zeus remote controlled units to be able to take hearing damage. @@ -219,6 +249,8 @@ Permet aux unités controlées à distance de subir des traumatismes sonores. Zeus により遠隔操作されたユニットにも、聴覚へ損傷を受けるようにします。 Zeus가 원격으로 청력손실을 입힐 수 있게 합니다. + 设定宙斯远程遥控的单位也会受到耳鸣的效果。 + 設定宙斯遠程遙控的單位也會受到耳鳴的效果。 Add earplugs to units @@ -232,10 +264,12 @@ 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. - Fügt die "ACE_EarPlugs" zu allen Einheiten mit lauten Waffen hinzu. Wird deaktiviert wenn eine eigene Inventarkonfiguration vorgenommen wurde. + Fügt die "ACE_EarPlugs" zu allen Einheiten mit lauten Waffen hinzu. Wird deaktiviert wenn eigene Ausrüstungsprofile verwendet werden. Dodaje `ACE_EarPlugs` - stopery - do wszystkich jednostek, które posiadają głośną broń. Można wyłaczyć w przypadku korzystania z niestandardowych loadoutów. Добавляет предмет `ACE_EarPlugs` всем юнитам, которые имеют громкое оружие. Можно отключить при ручной настройке снаряжения. Adicionar o item `ACE_EarPlugs` a todas as unidades que tenham armas barulhentas. Pode ser desabilitado com carregamentos customizados. @@ -245,6 +279,8 @@ 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`物品給擁有巨大噪音武器的單位。當你想自定裝備時,此功能可被關閉。 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..34ed9555ed --- /dev/null +++ b/addons/hellfire/stringtable.xml @@ -0,0 +1,15 @@ + + + + + Set Hellfire mode + Setze Hellfire-Modus + Imposta modalità Hellfire + ヘルファイア モードを設定 + 设定地狱火模式 + 設定地獄火模式 + Ustaw tryb pocisku Hellfire + 헬파이어 모드 세팅 + + + diff --git a/addons/hitreactions/ACE_Settings.hpp b/addons/hitreactions/ACE_Settings.hpp index 4fa45e8ebc..0220e09629 100644 --- a/addons/hitreactions/ACE_Settings.hpp +++ b/addons/hitreactions/ACE_Settings.hpp @@ -4,5 +4,7 @@ class ACE_Settings { //Minimum mamage needed to trigger falling down while moving. Set to -1 to disable completely. typeName = "SCALAR"; value = 0.1; + displayName = CSTRING(minDamageToTrigger_displayName); + sliderSettings[] = {-1, 1, 0.1, 1}; }; }; diff --git a/addons/hitreactions/functions/fnc_fallDown.sqf b/addons/hitreactions/functions/fnc_fallDown.sqf index d742e96869..dc4a028ffa 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" 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/hitreactions/stringtable.xml b/addons/hitreactions/stringtable.xml new file mode 100644 index 0000000000..01f344741b --- /dev/null +++ b/addons/hitreactions/stringtable.xml @@ -0,0 +1,12 @@ + + + + + Min Damage to trigger falling + Danno Minimo da caduta se colpiti + 觸發倒下前最低需受到多少傷害 + 触发倒下前最低需受到多少伤害 + 崩れ落ちるまでの最低損傷値 + + + diff --git a/addons/huntir/CfgWeapons.hpp b/addons/huntir/CfgWeapons.hpp index 8a3b57c4b0..7cda0e7066 100644 --- a/addons/huntir/CfgWeapons.hpp +++ b/addons/huntir/CfgWeapons.hpp @@ -1,16 +1,17 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_HuntIR_monitor: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(monitor_displayName); picture = QPATHTOF(UI\w_huntir_monitor_ca.paa); descriptionShort = CSTRING(monitor_displayName); model = QPATHTOF(data\ace_huntir_monitor.p3d); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 20; }; }; 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 a65c98f8b5..9360774031 100644 --- a/addons/huntir/stringtable.xml +++ b/addons/huntir/stringtable.xml @@ -14,6 +14,8 @@ Caixa de transporte do HuntIR HuntIR 輸送箱 HuntIR 수송함 + 高空战术成像器运输箱 + 高空戰術成像器運輸箱 HuntIR Round @@ -28,6 +30,8 @@ Cartucho HuntIR HuntIR 弾頭 HuntIR 유탄 + 高空战术成像器弹药 + 高空戰術成像器彈藥 HuntIR monitor @@ -42,6 +46,8 @@ Monitor HuntIR HuntIR モニタ HuntIR 모니터 + 高空战术成像器显示面板 + 高空戰術成像器顯示面板 Activate HuntIR monitor @@ -56,6 +62,8 @@ Ativar monitor do HuntIR HuntIR を起動する HuntIR 모니터 켜기 + 开启高空战术成像器显示面板 + 開啟高空戰術成像器顯示面板 Camera: @@ -70,6 +78,8 @@ Câmera: カメラ: 카메라: + 摄影机: + 攝影機: Altitude: @@ -84,6 +94,8 @@ Altitude: 高度: 고도: + 高度: + 高度: Recording Time: @@ -98,6 +110,8 @@ Tempo de gravação: 録画時間: 녹화시간: + 记录时间: + 記錄時間: Press ESC to quit camera @@ -112,6 +126,8 @@ Pressione ESC para sair da câmera ESC を押しカメラを抜ける ESC를 눌러 카메라 나가기 + 按下ESC退出摄影机 + 按下ESC退出攝影機 Help @@ -126,6 +142,8 @@ Ajuda ヘルプ 도움말 + 帮助 + 幫助 A/D - Cycle zoom @@ -140,6 +158,8 @@ A/D - Troca zoom A/D - 倍率の変更 A/D - 줌 전환 + A/D - 切换放大倍率 + A/D - 切換放大倍率 W/S - Select camera @@ -154,6 +174,8 @@ W/S - Seleciona câmera W/S - カメラを選択 W/S - 카메라 선택 + W/S - 切换摄影机 + W/S - 切換攝影機 Left/Right - Rotate camera @@ -166,8 +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 @@ -182,6 +206,8 @@ Acima/Abaixo - Eleva/Abaixa a câmera Up/Down - カメラ角度を変更 상/하 카메라 올리기/내리기 + 上/下 - 上升/下降摄影机 + 上/下 - 上升/下降攝影機 N - Cycle IT modes @@ -196,6 +222,8 @@ N - Troca modo IT N - IT モードを変更 N - IT모드 순환 + N - 切换热显模式 + N - 切換熱顯模式 R - Reset camera @@ -210,6 +238,8 @@ R - Redefine a câmera R - カメラを初期化 R - 카메라 초기화 + R - 重置摄影机 + R - 重置攝影機 Esc - Exit help @@ -222,8 +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 - 離開幫助 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/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 ed38e41ada..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"]; 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..4f29b9e65b --- /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 _type = typeOf _x; + private _name = getText (configFile >> "CfgVehicles" >> _type >> "displayName"); + private _ownerName = [_x, true] call EFUNC(common,getName); + if ("" != _ownerName) then { + _name = format ["%1 (%2)", _name, _ownerName]; + }; + private _icon = [_type] call EFUNC(common,getVehicleIcon); + 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 ba9647e99a..a05dcee3e4 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Sempre mostrar cursor para interação pessoal セルフ インタラクションへ常にカーソルを表示 자기상호작용시 항상 커서를 보이기 + 自我互动时永远显示游标 + 自我互動時永遠顯示游標 Always display cursor for interaction @@ -28,6 +30,8 @@ Sempre mostrar cursor para interação インタラクションへ常にカーソルを表示 상호작용시 항상 커서를 보이기 + 互动时永远显示游标 + 互動時永遠顯示游標 Display interaction menus as lists @@ -42,6 +46,8 @@ Mostrar menu de interação como listas 表示されるインタラクション メニューを一覧表示 상호작용메뉴를 리스트화 해서 보이기 + 以列表方式显示互动表单 + 以列表方式顯示互動表單 Interact Key @@ -56,6 +62,8 @@ Tecla de Interação インタラクション キー 상호작용 키 + 互动键 + 互動鍵 Self Interaction Key @@ -70,6 +78,8 @@ Tecla de Interação Pessoal セルフ インタラクション キー 자기상호작용 키 + 自我互动键 + 自我互動鍵 Self Actions @@ -84,6 +94,8 @@ Ações Pessoais 自分への動作 자기 동작 + 自我动作 + 自我動作 Vehicle Actions @@ -98,6 +110,8 @@ Ações de Veículos 車両への動作 차량 동작 + 载具动作 + 載具動作 Zeus Actions @@ -112,6 +126,8 @@ Azioni Zeus Zeus への動作 Zeus 동작 + 宙斯操作 + 宙斯操作 Interaction - Text Max @@ -126,6 +142,8 @@ Interação - Max. de Texto インタラクション - 文字の色 상호작용 - 문자색깔 + 互动 - 文字最大化 + 互動 - 文字最大化 Interaction - Text Min @@ -140,6 +158,8 @@ Interação - Min. de Texto インタラクション - 文字の背景色 상호작용 - 문자배경색 + 互动 - 文字最小化 + 互動 - 文字最小化 Interaction - Shadow Max @@ -154,6 +174,8 @@ Interação - Max. de Sombra インタラクション - 文字への影の色 상호작용 - 문자그림자색 + 互动 - 阴影最大化 + 互動 - 陰影最大化 Interaction - Shadow Min @@ -168,6 +190,8 @@ Interação - Min. de Sombra インタラクション - 文字への影の最低色 상호작용 - 문자그림자배경색 + 互动 - 阴影最小化 + 互動 - 陰影最小化 Keep cursor centered @@ -182,6 +206,8 @@ Mantieni il cursore centrato 常にカーソルを中央にする 커서를 항상 가운데에 둡니다 + 保持游标在中心点 + 保持游標在中心點 Keeps cursor centered and pans the option menu around. Useful if screen size is limited. @@ -196,6 +222,8 @@ Mantieni il cursore centrato e sposta il menù intorno. Utile se lo schermo è piccolo. 常にカーソルを中央へ表示させ、オプション メニューが移動します。画面の大きさが制限されている時に使いやすくなります。 커서를 항상 가운데에 두고 메뉴를 움직입니다. 화면의 크기가 제한되있을때 유용합니다. + 保持游标在中心点并平移周遭的选项选单。这对在荧幕尺寸有限的玩家很有用! + 保持游標在中心點並平移周遭的選項選單。這對在螢幕尺寸有限的玩家很有用! Do action when releasing menu key @@ -210,6 +238,8 @@ Esegui l'azione quando rilasci il tasto menu メニュー キーを離したときに動作を実行します。 메뉴키를 놓을때 행동하기 + 当放开选单键后就执行动作 + 當放開選單鍵後就執行動作 Interaction Text Size @@ -224,6 +254,8 @@ Dimensione del testo d'interazione インタラクション文字の大きさ 상호작용 - 문자크기 + 互动选单文字大小 + 互動選單文字大小 Interaction Text Shadow @@ -238,6 +270,8 @@ Ombra del testo d'interazione インタラクション文字へ影 상호작용 - 문자그림자 + 互动选单文字阴影 + 互動選單文字陰影 Allows controlling the text's shadow. Outline ignores custom shadow colors. @@ -252,6 +286,8 @@ Permette di controllare l'ombra del testo. L'impostazione "Contorno" ignora il colore dell'ombra. 文字への影を設定します。縁取りは設定された影の色を無視します。 문자의 그림자를 조절하는것을 가능케합니다. 외각선은 임의의 그림자색을 무시합니다. + 允许控制文字阴影。轮廓部分则会忽略自定义的阴影颜色。 + 允許控制文字陰影。輪廓部分則會忽略自定義的陰影顏色。 Outline @@ -266,6 +302,8 @@ Contorno 縁取り 외각선 + 只显示轮廓 + 只顯示輪廓 Interaction menu background @@ -280,6 +318,8 @@ Sfondo Menù Interazioni インタラクション メニューの背景 상호작용 메뉴 배경 + 互动选单背景 + 互動選單背景 Blur the background while the interaction menu is open. @@ -294,6 +334,8 @@ Sfoca lo sfondo mentre il Menù Interazioni è aperto. インタラクション メニューを開いたとき、背景にボケを与えます。 상호작용 메뉴가 열릴시 배경을 흐릿하게 처리합니다. + 当互动选单开启时,模糊背景画面。 + 當互動選單開啟時,模糊背景畫面。 Blur screen @@ -308,6 +350,8 @@ Sfoca schermo ボケ画面 화면 흐리게 + 模糊画面 + 模糊畫面 Black @@ -322,6 +366,8 @@ Nero ブラック 까맣게 + 黑色 + 黑色 Show actions for buildings @@ -336,6 +382,8 @@ 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) @@ -350,6 +398,8 @@ 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 @@ -363,6 +413,8 @@ Menu d'interaction インタラクション メニュー 상호작용 메뉴 + 互动选单 + 互動選單 Interaction Animation Speed @@ -376,6 +428,8 @@ Vitesse de l'aniamtion d'interaction インタラクションのアニメーション速度 상호작용 움직임 속도 + 互动选单动画速度 + 互動選單動畫速度 Makes menu animations faster and decreases the time needed to hover to show sub actions @@ -388,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 サブ動作が表示されるホバーをした時に、表示されるメニューのアニメーション速度を早くしたり遅くしたりできます + 使选单的动画速度更快,并减少子选项显现出来的时间 + 使選單的動畫速度更快,並減少子選項顯現出來的時間 + 상호 작용을 표시하기 위해 메뉴 애니메이션을 빠르게 만들고 마우스를 가져 오는 데 필요한 시간을 줄입니다. diff --git a/addons/interaction/ACE_Settings.hpp b/addons/interaction/ACE_Settings.hpp index e95947ec75..3efb745a6b 100644 --- a/addons/interaction/ACE_Settings.hpp +++ b/addons/interaction/ACE_Settings.hpp @@ -1,16 +1,24 @@ class ACE_Settings { class GVAR(enableTeamManagement) { + category = CSTRING(DisplayName); displayName = CSTRING(EnableTeamManagement_DisplayName); description = CSTRING(EnableTeamManagement_Description); value = 1; typeName = "BOOL"; }; class GVAR(enableMagazinePassing) { + category = CSTRING(DisplayName); value = 1; typeName = "BOOL"; isClientSettable = 1; displayName = CSTRING(PassMagazineSetting); - category = ECSTRING(interact_menu,Category_InteractionMenu); + }; + class GVAR(disableNegativeRating) { + category = CSTRING(DisplayName); + 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..af6b4504e1 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,62 +11,63 @@ 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;); }; }; class remoteControl { displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F"; icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa"; - statement = "_unit = objNull; { if ((side _x in [east,west,resistance,civilian]) && !(isPlayer _x)) exitWith { _unit = _x; }; } forEach (curatorSelected select 0); bis_fnc_curatorObjectPlaced_mouseOver = ['OBJECT',_unit]; (group _target) createUnit ['ModuleRemoteControl_F',[0,0,0],[],0,''];"; + statement = "_unit = objNull; { if ((side _x in [east,west,resistance,civilian]) && !(isPlayer _x)) exitWith { _unit = _x; }; } forEach (curatorSelected select 0); bis_fnc_curatorObjectPlaced_mouseOver = ['OBJECT',_unit]; (group _target) createUnit ['ModuleRemoteControl_F',[0,0,0],[],0,'NONE'];"; }; }; 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('SAFE',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..9bd70a00da 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -7,8 +7,8 @@ class CfgVehicles { author = ECSTRING(common,ACETeam); category = "ACE"; displayName = CSTRING(Module_DisplayName); - function = "ACE_Interaction_fnc_moduleInteraction"; - scope = 2; + function = QFUNC(moduleInteraction); + scope = 1; isGlobal = 1; isSingular = 1; icon = QPATHTOF(UI\Icon_Module_Interaction_ca.paa); @@ -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,9 +164,18 @@ 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; }; + + class GVAR(PullOutBody) { + displayName = CSTRING(PullOutBody); + condition = QUOTE(call DFUNC(canPullOutBody)); + statement = QUOTE(call DFUNC(pullOutBody)); + exceptions[] = {"isNotSwimming"}; + icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\getout_ca.paa"; + }; }; class ACE_Torso { @@ -156,6 +184,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_Head { displayName = CSTRING(Head); @@ -163,6 +192,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_ArmLeft { displayName = CSTRING(ArmLeft); @@ -170,6 +200,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_ArmRight { displayName = CSTRING(ArmRight); @@ -177,6 +208,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_LegLeft { displayName = CSTRING(LegLeft); @@ -184,6 +216,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_LegRight { displayName = CSTRING(LegRight); @@ -191,6 +224,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_Weapon { displayName = CSTRING(Weapon); @@ -198,6 +232,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_TapShoulderRight { displayName = CSTRING(TapShoulder); @@ -205,6 +240,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 +248,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 +256,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 +265,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 +274,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 +283,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 +292,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 +301,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 +310,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 +319,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 +330,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; @@ -313,8 +350,9 @@ class CfgVehicles { condition = "true"; class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -323,7 +361,7 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; @@ -340,8 +378,9 @@ class CfgVehicles { condition = "true"; class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -350,7 +389,7 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; @@ -366,8 +405,9 @@ class CfgVehicles { condition = "true"; class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -376,8 +416,9 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -395,8 +436,9 @@ class CfgVehicles { condition = "true"; class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -405,7 +447,7 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; @@ -422,8 +464,9 @@ class CfgVehicles { condition = "true"; class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -432,7 +475,7 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; @@ -464,13 +507,15 @@ class CfgVehicles { distance = 6; condition = QUOTE(_target call FUNC(canPush)); statement = QUOTE(_this call FUNC(push)); + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = -1; }; class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -479,7 +524,7 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; @@ -495,8 +540,9 @@ class CfgVehicles { condition = "true"; class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -505,7 +551,7 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); - condition = "true"; + condition = QUOTE(alive _target); statement = ""; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; @@ -550,7 +596,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 +607,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 be4669cc27..1a70de8831 100644 --- a/addons/interaction/XEH_PREP.hpp +++ b/addons/interaction/XEH_PREP.hpp @@ -17,6 +17,7 @@ PREP(canInteractWithCivilian); PREP(getDown); PREP(sendAway); PREP(canJoinGroup); +PREP(modifyJoinGroupAction); PREP(canJoinTeam); PREP(joinTeam); PREP(canPassMagazine); @@ -27,9 +28,12 @@ PREP(canTapShoulder); PREP(tapShoulder); PREP(canPardon); PREP(pardon); +PREP(canPullOutBody); +PREP(pullOutBody); // 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/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_canPullOutBody.sqf b/addons/interaction/functions/fnc_canPullOutBody.sqf new file mode 100644 index 0000000000..f0f8f32db9 --- /dev/null +++ b/addons/interaction/functions/fnc_canPullOutBody.sqf @@ -0,0 +1,47 @@ +/* + * Author: Dystopian + * Checks if unit can pull target body out of vehicle. + * + * Arguments: + * 1: Body + * 2: Unit + * + * Return Value: + * Able to pull out target body + * + * Example: + * [crew cursorObject select 0, player] call ace_interaction_fnc_canPullOutBody + * + * Public: No + */ +#include "script_component.hpp" + +params ["_body", "_unit"]; + +private _vehicle = objectParent _body; + +if ( + !isNull objectParent _unit + || {alive _body} + || {isNull _vehicle} + || {1 < locked _vehicle} + || { + 0 < {alive _x} count crew _vehicle // alive is in vehicle + // group is used here for situations when side player == ENEMY + && {0.6 > side group _unit getFriend side group _vehicle} // player is enemy + } +) exitWith {false}; + +((fullCrew [_vehicle, ""] select {_body == _x select 0}) select 0) params ["", "", "_cargoIndex", "_turretPath"]; + +private _locked = if (!(_turretPath isEqualTo [])) then { + _vehicle lockedTurret _turretPath; +} else { + if (_cargoIndex > -1) then { + _vehicle lockedCargo _cargoIndex; + } else { + lockedDriver _vehicle; + }; +}; + +!_locked 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 a5c185d7d6..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 index 12c9bbd7e9..c731c6e7d1 100644 --- a/addons/interaction/functions/fnc_getInteractionDistance.sqf +++ b/addons/interaction/functions/fnc_getInteractionDistance.sqf @@ -6,7 +6,7 @@ * 0: Player * 0: Target Vehicle * - * Return value: + * Return Value: * Distance to interaction point * * Example: 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_pullOutBody.sqf b/addons/interaction/functions/fnc_pullOutBody.sqf new file mode 100644 index 0000000000..bab54a0805 --- /dev/null +++ b/addons/interaction/functions/fnc_pullOutBody.sqf @@ -0,0 +1,63 @@ +/* + * Author: Dystopian + * Makes unit pull target body out of vehicle. + * + * Arguments: + * 0: Body + * 1: Unit + * + * Return Value: + * None + * + * Example: + * [crew cursorObject select 0, player] call ace_interaction_fnc_pullOutBody + * + * Public: No + */ +#include "script_component.hpp" + +params ["_body", "_unit"]; + +private _vehicle = objectParent _body; // vehicle command doesn't work for dead + +// get target crew properties +private ["_cargoIndex", "_turretPath"]; +private _cargoNumber = -1; +{ + if ("cargo" == _x select 1) then { + INC(_cargoNumber); + }; + if (_body == _x select 0) exitWith { + _cargoIndex = _x select 2; + _turretPath = _x select 3; + }; +} forEach fullCrew [_vehicle, "", true]; +TRACE_3("",_cargoIndex,_cargoNumber,_turretPath); + +private _preserveEngineOn = false; + +// first get in to target seat +if (!(_turretPath isEqualTo [])) then { + _unit action ["GetInTurret", _vehicle, _turretPath]; +} else { + if (_cargoIndex > -1) then { + _unit action ["GetInCargo", _vehicle, _cargoNumber]; + } else { + _unit action ["GetInDriver", _vehicle]; + _preserveEngineOn = isEngineOn _vehicle; + }; +}; + +// then get out +[ + {(_this select 0) in (_this select 1)}, + { + params ["_unit", "_vehicle", "_preserveEngineOn"]; + TRACE_3("",_unit,_vehicle,_preserveEngineOn); + _unit action ["GetOut", _vehicle]; + if (_preserveEngineOn) then { + [{isNull driver _this}, {_this engineOn true}, _vehicle] call CBA_fnc_waitUntilAndExecute; + }; + }, + [_unit, _vehicle, _preserveEngineOn] +] call CBA_fnc_waitUntilAndExecute; 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/stringtable.xml b/addons/interaction/stringtable.xml index 2679f228aa..f1aa5944d0 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -1,6 +1,14 @@ - + + + Interaction + Interaktion + Interazione + 互動 + 互动 + インタラクション + Interactions Interaktionen @@ -14,6 +22,8 @@ Interaçãoes インタラクション 상호작용 + 互动 + 互動 Torso @@ -28,6 +38,8 @@ Torso 胴体 몸통 + 身体 + 身體 Head @@ -42,6 +54,8 @@ Cabeça 頭部 머리 + 头部 + 頭部 Left Arm @@ -56,6 +70,8 @@ Braço Esquerdo 左腕 왼쪽 팔 + 左手 + 左手 Right Arm @@ -70,6 +86,8 @@ Braço Direito 右腕 오른쪽 팔 + 右手 + 右手 Left Leg @@ -84,6 +102,8 @@ Perna Esquerda 左足 왼쪽 다리 + 左脚 + 左腳 Right Leg @@ -98,6 +118,8 @@ Perna Direita 右足 오른쪽 다리 + 右脚 + 右腳 Weapon @@ -112,6 +134,8 @@ Arma 武器 무기 + 武器 + 武器 Interaction Menu @@ -126,6 +150,8 @@ Menù interazione インタラクション メニュー 상호작용 메뉴 + 互动选单 + 互動選單 Interaction Menu (Self) @@ -140,6 +166,8 @@ Menù interazione (individuale) インタラクション メニュー (セルフ) 상호작용 메뉴(자신) + 互动选单 (自我) + 互動選單 (自我) Open / Close Door @@ -154,6 +182,8 @@ Apri / Chiudi la porta ドアの開け閉め 문 열기 / 닫기 + 打开/关上 门 + 打開/關上 門 Lock Door @@ -166,8 +196,10 @@ Ajtó bezárása Zablokuj drzwi Zamknout dveře - ドアの鍵を閉める + ドアの鍵をしめる 문 잠그기 + 锁门 + 鎖門 Unlock Door @@ -180,8 +212,10 @@ Zár kinyitása Odblokuj drzwi Odemknout dveře - ドアの鍵を開ける + ドアの鍵をあける 잠긴문 열기 + 解锁门 + 解鎖門 Locked Door @@ -194,8 +228,10 @@ Zárt ajtó Zablokowano drzwi Zamčené dveře - ドアの鍵を締めた + ドアの鍵をしめた 잠긴 문 + 门已上锁 + 門已上鎖 Unlocked Door @@ -208,8 +244,10 @@ Nyitott ajtó Odblokowano drzwi Odemčené dveře - ドアの鍵を開けられた + ドアの鍵をあけた 열린 문 + 门未上锁 + 門未上鎖 Join group @@ -222,8 +260,10 @@ Csatlakozás a csoporthoz Unir-se ao grupo Unisciti alla squadra - グループにはいる + グループに入る 그룹 참여 + 加入小队 + 加入小隊 Leave Group @@ -236,8 +276,10 @@ Csoport elhagyása Deixar grupo Lascia la squadra - グループをぬける + グループを抜ける 그룹 나가기 + 离开小队 + 離開小隊 Become Leader @@ -252,6 +294,8 @@ Prendi il comando リーダーになる 리더 되기 + 成为队长 + 成為隊長 DANCE! @@ -264,8 +308,10 @@ TÁNC! DANCE! DANZA! - おどれ! + おどれ! 춤추기! + 跳舞 + 跳舞 Stop Dancing @@ -280,6 +326,8 @@ Smetti di ballare 踊るのをやめる 춤 멈추기 + 停止跳舞 + 停止跳舞 << Back @@ -292,8 +340,10 @@ << Vissza << Voltar << Indietro - &lt;&lt; もどる + <<もどる <<뒤로 + <<返回 + <<返回 Put weapon on back @@ -308,6 +358,8 @@ Metti l'arma in spalla 武器を背負う 등에 무기 메기 + 将武器放到背后 + 將武器放到背後 Tap Shoulder @@ -320,8 +372,10 @@ Vállveregetés Tocar ombro Dai un colpetto - 肩をたたく - 어깨 두드리기 + 肩を叩く + 어깨 치기 + 轻拍肩膀 + 輕拍肩膀 You were tapped on the RIGHT shoulder @@ -336,6 +390,8 @@ Ti è stato dato un colpetto sulla spalla destra 右肩を叩かれた 누군가 오른쪽 어깨를 쳤다 + 你的右肩膀被轻拍了一下 + 你的右肩膀被輕拍了一下 You were tapped on the LEFT shoulder. @@ -350,6 +406,8 @@ Ti è stato dato un colpetto sulla spalla sinistra 左肩を叩かれた 누군가 왼쪽 어깨를 쳤다 + 你的左肩膀被轻拍了一下 + 你的左肩膀被輕拍了一下 Cancel @@ -364,6 +422,8 @@ Mégse 中止 취소 + 取消 + 取消 Select @@ -378,6 +438,8 @@ Kiválaszt 選択 선택 + 选择 + 選擇 Go Away! @@ -390,8 +452,10 @@ Tűnés! Vá Embora! Via di qui! - うせろ! + 失せろ! 저리 가! + 走开! + 走開! Get Down! @@ -404,8 +468,10 @@ Ложись! Abaixe-se! A terra! - ふせろ! + 伏せろ! 엎드려! + 趴下! + 趴下! Get Out @@ -416,8 +482,10 @@ Sortez ! Выходи Vystupte - 降りる + 降りろ 나가 + 出去 + 出去 Team Management @@ -432,6 +500,8 @@ Csapat kezelése チーム管理 팀 설정 + 小队管理 + 小隊管理 Red @@ -446,6 +516,8 @@ Piros レッド 빨강 + 红色 + 紅色 Green @@ -460,6 +532,8 @@ Zöld グリーン 초록 + 绿色 + 綠色 Blue @@ -474,6 +548,8 @@ Kék ブルー 파랑 + 蓝色 + 藍色 Yellow @@ -488,6 +564,8 @@ Sárga イエロー 노랑 + 黄色 + 黃色 Assign Red @@ -502,6 +580,8 @@ Assegna al team rosso レッドにする 빨강에 등록 + 指派为红组 + 指派為紅組 Assign Green @@ -516,6 +596,8 @@ Assegna al team verde グリーンにする 초록에 등록 + 指派为绿组 + 指派為綠組 Assign Blue @@ -530,6 +612,8 @@ Assegna al team blu ブルーにする 파랑이 등록 + 指派为蓝组 + 指派為藍組 Assign Yellow @@ -544,6 +628,8 @@ Assegna al team giallo イエローにする 노랑에 등록 + 指派为黄组 + 指派為黃組 Join Red @@ -558,6 +644,8 @@ Unirsi al team rosso レッドに入る 빨강에 참여 + 加入红组 + 加入紅組 Join Green @@ -572,6 +660,8 @@ Unirsi al team verde グリーンに入る 초록에 참여 + 加入绿组 + 加入綠組 Join Blue @@ -586,6 +676,8 @@ Unirsi al team blu ブルーに入る 파랑에 참여 + 加入蓝组 + 加入藍組 Join Yellow @@ -600,6 +692,8 @@ Unirsi al team giallo イエローに入る 노랑에 참여 + 加入黄组 + 加入黃組 You joined Team %1 @@ -614,6 +708,8 @@ Csatlakoztál a %1 csapathoz チーム %1 に入った 당신은 %1팀에 참여했습니다 + 你已加入%1组 + 你已加入%1組 Leave Team @@ -628,6 +724,8 @@ Csapat elhagyása チームを抜ける 팀 나가기 + 离开小队 + 離開小隊 You left the Team @@ -642,6 +740,8 @@ Elhagytad a csapatot チームを抜けた 팀을 나갔습니다 + 你已离开小队 + 你已離開小隊 Pardon @@ -656,6 +756,8 @@ Megbocsátás 許す 허용 + 原谅 + 原諒 Scroll @@ -670,6 +772,8 @@ Posunout スクロール 스크롤 + 滚动 + 滾動 Modifier Key @@ -684,6 +788,8 @@ Modifikátor キーを割り当て 키 할당하기 + 编辑按键 + 編輯按鍵 Not in Range @@ -698,6 +804,8 @@ Fuori limite 範囲内にありません 범위 내에 없습니다 + 不在范围内 + 不在範圍內 Equipment @@ -712,6 +820,8 @@ Equipamento 装備 장비 + 装备 + 裝備 Push @@ -726,6 +836,8 @@ Spingere 押す 밀기 + + Interact @@ -740,6 +852,8 @@ Interagir インタラクト 상호작용 + 互动 + 互動 Passengers @@ -754,6 +868,8 @@ Passageiros 後部座席 승객 + 乘客 + 乘客 Open @@ -768,6 +884,8 @@ Öffnen 開く 열기 + 打开 + 打開 Interaction System @@ -782,6 +900,8 @@ Sistema Interazioni インタラクション システム 상호작용 시스템 + 互动系统 + 互動系統 Enable Team Management @@ -794,8 +914,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 @@ -808,8 +930,28 @@ A játékosoknak engedélyezve legyen a csapatkezelő menü? Alapértelmezett: Igen 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、毁坏友军装备或杀害小队伙伴都不会收到负面评价。 + 플레이어의 부정행위 가중치를 계산합니까? 활성화된 플레이어는 높은 레이팅을 가질때, 아군의 장비나 병력을 사격해도 아군 AI의 사격을 받지 않습니다. Team management allows color allocation for team members, taking team command and joining/leaving teams. @@ -824,6 +966,8 @@ Management Squadra permette l'assegnazione di colori per membri della squadra, prendere il comando ed entrare/uscire dalle squadre. チーム管理はチーム メンバーへ色の割り当てや指揮権を取ったり、チームの出入りを許可します。 팀 설정은 팀 멤버에게 색을 부여하거나 팀에 참여 혹은 나가게 할 수 있게 합니다. + 队伍管理系统允许将指定颜色分配到队伍成员上,接管队长职位或加入/离开队伍 + 隊伍管理系統允許將指定顏色分配到隊伍成員上,接管隊長職位或加入/離開隊伍 Turn on @@ -835,8 +979,10 @@ Zapnout Ligar Включить - 中に入る + 有効化 켜기 + 开启 + 開啟 Turn off @@ -848,8 +994,10 @@ Vypnout Desligar Выключить - 外に出す + 無効化 끄기 + 关闭 + 關閉 Pass magazine @@ -863,6 +1011,8 @@ Passer un chargeur 弾倉をわたす 탄창 건네기 + 给予弹匣 + 給予彈匣 Primary magazine @@ -876,6 +1026,8 @@ Chargeur de l'arme principale プライマリ用弾倉 주무기 탄창 + 给予主武器弹匣 + 給予主武器彈匣 Pistol magazine @@ -889,6 +1041,8 @@ Chargeur de pistolet 拳銃の弾倉 부무기 탄창 + 给予手枪弹匣 + 給予手槍彈匣 %1 passed you a %2 magazine. @@ -902,6 +1056,8 @@ %1 vous a passé un chargeur de %2. %1 はあなたに %2 弾倉をわたした %1에게서 %2탄창을 받았다 + %1给你%2弹匣 + %1給你%2彈匣 Show "pass magazine" interaction @@ -915,6 +1071,14 @@ Montrer l'interaction "Passer un chargeur" "弾倉をわたす"をインタラクションに表示する '탄창 건네기'를 상호작용에서 보여줌 + 显示"给予弹匣"互动动作 + 顯示"給予彈匣"互動動作 + + + Pull out body + Вытащить тело + 身体を引き出す + Estrai il corpo 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 c421891f49..713c8b082b 100644 --- a/addons/inventory/stringtable.xml +++ b/addons/inventory/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ 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. @@ -26,8 +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 @@ -41,6 +45,8 @@ Рюкзаки バックパック 가방 + 背包 + 背包 Headgear @@ -54,6 +60,8 @@ Головные уборы ヘッドギア 헬멧 + 头盔 + 頭盔 Glasses @@ -67,6 +75,8 @@ Очки メガネ 안경 + 眼镜 + 眼鏡 Uniforms @@ -80,6 +90,8 @@ Униформа 戦闘服 복장 + 服装 + 服裝 Vests @@ -93,6 +105,8 @@ Жилеты ベスト 조끼 + 背心 + 背心 Grenades @@ -106,6 +120,8 @@ Гранаты 手榴弾 수류탄 + 手榴弹 + 手榴彈 Medical @@ -119,6 +135,8 @@ Медицина 医療 의료 + 医疗 + 醫療 diff --git a/addons/javelin/functions/fnc_getTarget.sqf b/addons/javelin/functions/fnc_getTarget.sqf index 04d9c76ef0..49748e2883 100644 --- a/addons/javelin/functions/fnc_getTarget.sqf +++ b/addons/javelin/functions/fnc_getTarget.sqf @@ -4,13 +4,13 @@ * * Arguments: * 0: Last Target (seeds the scan) - * 1: Max Range (meters) * * Return Value: * Target * * Example: - * [] call ace_javelin_fnc_getTarget + * [bob, 5] call ace_javelin_fnc_getTarget * * Public: No */ @@ -27,12 +27,12 @@ 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 {}; - + 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) diff --git a/addons/javelin/stringtable.xml b/addons/javelin/stringtable.xml index a1f786da72..96dc8d33ee 100644 --- a/addons/javelin/stringtable.xml +++ b/addons/javelin/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Travar Alvo(Segurar) 目標を捕捉 (押しっぱ) 표적 획득 (누르기) + 锁定目标 (按住) + 鎖定目標 (按住) 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/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 ccc2ab57e3..240862b4f2 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 = (wind select 0) atan2 (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; @@ -136,14 +134,14 @@ if (GVAR(referenceHeadingMenu) == 0) then { _textCenterBig = Str(round(abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); _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 = "--. -"; @@ -168,14 +166,14 @@ if (GVAR(referenceHeadingMenu) == 0) then { _textCenterBig = Str(round(cos(GVAR(RefHeading) - _playerDir) * _windSpeed * 10) / 10); _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..c023d8ec8d 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 wind; +private _windDir = (wind select 0) atan2 (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 c129b1e019..f83c875d57 100644 --- a/addons/kestrel4500/stringtable.xml +++ b/addons/kestrel4500/stringtable.xml @@ -12,8 +12,10 @@ Kestrel 4500NV Kestrel 4500NV Kestrel 4500NV - Kestrel 4500NV + ケストレル 4500NV Kestrel 4500NV + 猎隼4500测风仪 + 獵隼4500測風儀 Kestrel 4500 Pocket Weather Tracker @@ -26,8 +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 @@ -42,6 +46,8 @@ Otevřít Kestrel 4500 Kestrel 4500 を開く Kestrel 4500 열기 + 开启猎隼4500测风仪 + 開啟獵隼4500測風儀 Show Kestrel 4500 @@ -54,8 +60,10 @@ Kestrel 4500 mutatása Zobrazit Kestrel 4500 Mostrar Kestrel 4500 - Kestrel 4500 を見る + ケストレル 4500 を見る Kestrel 4500 보이기 + 显示猎隼4500测风仪 + 顯示獵隼4500測風儀 Hide Kestrel 4500 @@ -70,6 +78,8 @@ Ocultar Kestrel 4500 Kestrel 4500 を隠す Kestrel 4500 숨기기 + 隐藏猎隼4500测风仪 + 隱藏獵隼4500測風儀 Open Kestrel 4500 @@ -82,8 +92,10 @@ Kestrel 4500 elővétele Otevřít Kestrel 4500 Abrir Kestrel 4500 - Kestrel 4500 を開く + ケストレル 4500 を開く Kestrel 4500 열기 + 开启猎隼4500测风仪 + 開啟獵隼4500測風儀 Show Kestrel 4500 @@ -96,8 +108,10 @@ Kestrel 4500 mutatása Zobrazit Kestrel 4500 Mostrar Kestrel 4500 - Kestrel 4500 を見る + ケストレル 4500 を見る Kestrel 4500 숨기기 + 显示猎隼4500测风仪 + 顯示獵隼4500測風儀 diff --git a/addons/laser/ACE_Settings.hpp b/addons/laser/ACE_Settings.hpp index 72c513f928..3584a2086f 100644 --- a/addons/laser/ACE_Settings.hpp +++ b/addons/laser/ACE_Settings.hpp @@ -3,5 +3,6 @@ class ACE_Settings { value = 2; typeName = "SCALAR"; displayName = CSTRING(dispersionCount_displayName); + sliderSettings[] = {0, 5, 2, -1}; }; }; 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 b439fd1f06..709682853b 100644 --- a/addons/laser/XEH_postInit.sqf +++ b/addons/laser/XEH_postInit.sqf @@ -1,7 +1,27 @@ #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); + } else { + [ace_player] call FUNC(showVehicleHud); + }; + }] call CBA_fnc_addEventHandler; + }] call CBA_fnc_addEventHandler; +}; + // Global Laser EHs ["ace_laserOn", { params ["_uuid", "_args"]; 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 1635b4e37f..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: diff --git a/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf b/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf index 7598bf8f46..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: @@ -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 fb81d9da60..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: 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 612cc17fe5..200e00acae 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -8,15 +8,15 @@ * 1: Direction vector (will be normalized) * 2: Seeker FOV in degrees * 3: Seeker max distance in meters - * 4: Seeker wavelength sensitivity range, [1550,1550] is common eye safe. + * 4: Seeker wavelength sensitivity range, [1550,1550] is common eye safe * 5: Seeker laser code. - * 6: Ignore 1 (e.g. Player's vehicle) + * 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 */ @@ -25,15 +25,15 @@ BEGIN_COUNTER(seekerFindLaserSpot); -params ["_posASL", "_dir", "_seekerFov", "_seekerMaxDistnace", "_seekerWavelengths", "_seekerCode", ["_ignoreObj1", objNull]]; +params ["_posASL", "_dir", "_seekerFov", "_seekerMaxDistance", "_seekerWavelengths", "_seekerCode", ["_ignoreObj1", objNull]]; _dir = vectorNormalized _dir; _seekerWavelengths params ["_seekerWavelengthMin", "_seekerWavelengthMax"]; private _seekerCos = cos _seekerFov; -private _seekerMaxDistSq = _seekerMaxDistnace ^ 2; +private _seekerMaxDistSq = _seekerMaxDistance ^ 2; -TRACE_6("",_posASL,_dir,_seekerFov,_seekerMaxDistnace,_seekerWavelengths,_seekerCode); +TRACE_6("",_posASL,_dir,_seekerFov,_seekerMaxDistance,_seekerWavelengths,_seekerCode); private _spots = []; private _finalPos = nil; @@ -76,7 +76,7 @@ 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) && {(_testPoint vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then { @@ -90,7 +90,7 @@ private _finalOwner = objNull; if (_distance > 0) then { private _testPointVector = _posASL vectorFromTo _resultPos; private _testDotProduct = _dir vectorDotProduct _testPointVector; - if ((_testDotProduct > _seekerCos) && {(_testPoint vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then { + if ((_testDotProduct > _seekerCos) && {(_resultPos vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then { _spots pushBack [_resultPos, _owner]; }; }; @@ -178,6 +178,7 @@ if ((count _spots) > 0) then { private _maxOwnerCount = -1; [_ownersHash, { + //IGNORE_PRIVATE_WARNING ["_key", "_value"]; if (_value > _maxOwnerCount) then { _finalOwner = _key; }; @@ -189,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 7e8db0c87c..aa09f5de0e 100644 --- a/addons/laser/stringtable.xml +++ b/addons/laser/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -9,6 +9,8 @@ Wskaźnik poziomu rozproszenia wiązki lasera Compte de la simulation de la dispersion du laser Contatore Simulazione Dispersione Laser + 雷射散射模拟计算 + 雷射散射模擬計算 Laser Code @@ -23,6 +25,8 @@ Codice laser レーザ コード 레이저 코드 + 雷射码 + 雷射碼 Laser - Cycle Code Up @@ -37,6 +41,8 @@ Codice laser + レーザ - コードの数値を増やす 레이저 - 코드 순환 위 + 雷射 - 循环切换雷射码 上 + 雷射 - 循環切換雷射碼 上 Laser - Cycle Code Down @@ -51,6 +57,8 @@ Codice laser - レーザ - コードの数値を減らす 레이저 - 코드 순환 아래 + 雷射 - 循环切换雷射码 下 + 雷射 - 循環切換雷射碼 下 diff --git a/addons/laserpointer/ACE_Settings.hpp b/addons/laserpointer/ACE_Settings.hpp index 0536db730d..833167ba28 100644 --- a/addons/laserpointer/ACE_Settings.hpp +++ b/addons/laserpointer/ACE_Settings.hpp @@ -1,5 +1,7 @@ class ACE_Settings { class GVAR(enabled) { + category = ECSTRING(common,ACEKeybindCategoryWeapons); + displayName = CSTRING(DisplayName); typeName = "BOOL"; value = 1; }; diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index d8857da32a..7e90e29259 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -41,9 +41,16 @@ GVAR(greenLaserUnits) = []; 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 {}; + if (_laser isEqualTo "") exitWith { + GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit); + GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit); + }; private _laserID = GVAR(laserClassesCache) getVariable _laser; @@ -51,21 +58,17 @@ GVAR(greenLaserUnits) = []; _laserID = getNumber (configFile >> "CfgWeapons" >> _laser >> "ACE_laserpointer"); GVAR(laserClassesCache) setVariable [_laser, _laserID]; }; + TRACE_3("",_weapon,_laser,_laserID); - if (_unit isFlashlightOn _weapon) then { - 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); - }; - } else { - GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit); + 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 diff --git a/addons/laserpointer/functions/fnc_getNearUnits.sqf b/addons/laserpointer/functions/fnc_getNearUnits.sqf index 6f31a99a2a..baeb07c86e 100644 --- a/addons/laserpointer/functions/fnc_getNearUnits.sqf +++ b/addons/laserpointer/functions/fnc_getNearUnits.sqf @@ -6,7 +6,10 @@ * None * * Return Value: - * None + * Near Units + * + * Example: + * call ACE_laserpointer_fnc_getNearUnits * * Public: No */ @@ -15,7 +18,7 @@ private _camPosAGL = positionCameraToWorld [0, 0, 0]; // handle RHS / bugged vehicle slots -if !((_camPosAGL select 0) isEqualType 0) exitWith {}; +if !((_camPosAGL select 0) isEqualType 0) exitWith { [] }; private _nearUnits = []; diff --git a/addons/laserpointer/functions/fnc_onDraw.sqf b/addons/laserpointer/functions/fnc_onDraw.sqf index 0559386827..4c614064e7 100644 --- a/addons/laserpointer/functions/fnc_onDraw.sqf +++ b/addons/laserpointer/functions/fnc_onDraw.sqf @@ -8,12 +8,14 @@ * Return Value: * None * + * Example: + * call ACE_laserpointer_fnc_onDraw + * * Public: No */ #include "script_component.hpp" -// no lasers in thermal mode -if !(GVAR(isTI)) then { +if (count GVAR(redLaserUnits) + count GVAR(greenLaserUnits) > 0 && {!GVAR(isTI)}) then { private _brightness = 2 - call EFUNC(common,ambientBrightness); { diff --git a/addons/laserpointer/stringtable.xml b/addons/laserpointer/stringtable.xml index 1de5c8a8db..17b7dbe933 100644 --- a/addons/laserpointer/stringtable.xml +++ b/addons/laserpointer/stringtable.xml @@ -1,6 +1,22 @@ + + Laser Pointer + Pointeur laser + Laserpointer + Лазерный прицел + Laserové ukazovátko + Wskaźnik laserowy + Lézer-pointer + Puntero láser + Puntatore laser + Laser + レーザ ポインタ + 레이저 지시기 + 雷射指示器 + 雷射指示器 + Laser Pointer (red) Pointeur laser (rouge) @@ -14,6 +30,8 @@ Laser (vermelho) レーザ ポインタ (赤) 레이저 지시기 (빨강) + 雷射指示器 (红色) + 雷射指示器 (紅色) Laser Pointer (green) @@ -28,6 +46,8 @@ Laser (verde) レーザ ポインタ (緑) 레이저 지시기 (초록) + 雷射指示器 (绿色) + 雷射指示器 (綠色) Emits visible light. @@ -42,6 +62,8 @@ Emite luz visível. 可視光をだします。 밝은 곳에서도 보임 + 发射出可见光 + 發射出可見光 <t color='#9cf953'>Use: </t>Turn Laser ON/OFF @@ -56,6 +78,8 @@ <t color='#9cf953'>Használat: </t>Lézer BE/KI kapcsolása <t color='#9cf953'>つかう: </t>レーザの起動/停止 <t color='#9cf953'>사용키: </t>레이저 켜기/끄기 + <t color='#9cf953'>使用: </t>雷射开启/关闭 + <t color='#9cf953'>使用: </t>雷射開啟/關閉 Laser @@ -70,6 +94,8 @@ Laser レーザ 레이저 + 雷射 + 雷射 IR Laser @@ -84,6 +110,8 @@ Laser IV 赤外線レーザ 적외선 레이저 + 红外线雷射 + 紅外線雷射 Switch Laser / IR Laser @@ -98,6 +126,8 @@ Alternar entre Laser / Laser IV レーザ/赤外線レーザを切り替える 레이저 / 적외선 레이저 전환 + 切换雷射/红外线雷射 + 切換雷射/紅外線雷射 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..c4092dc017 100644 --- a/addons/logistics_uavbattery/CfgWeapons.hpp +++ b/addons/logistics_uavbattery/CfgWeapons.hpp @@ -1,14 +1,15 @@ class CfgWeapons { - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_ItemCore; class ACE_UAVBattery: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(Battery_Name); 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/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 af9bbace05..bd3ea82684 100644 --- a/addons/logistics_uavbattery/stringtable.xml +++ b/addons/logistics_uavbattery/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,7 +13,9 @@ Il drone è pieno БПЛА полностью заряжен ドローンは充電完了 - 드론 충전완료 + 무인기 충전완료 + 无人载具电池已充满 + 無人載具電池已充滿 You need a UAV Battery @@ -27,7 +29,9 @@ Hai bisogno di una Batteria UAV Требуется аккумулятор для БПЛА UAV バッテリが必要です - UAV 배터리가 필요합니다 + 무인기 배터리가 필요합니다 + 你需要一个无人载具电池 + 你需要一個無人載具電池 Recharge @@ -42,6 +46,8 @@ Зарядить 充電 재충전 + 充电 + 充電 UAV Battery @@ -55,7 +61,9 @@ Batteria UAV Аккумулятор БПЛА UAV バッテリ - UAV 배터리 + 무인기 배터리 + 无人载具电池 + 無人載具電池 Used to refuel Carried UAV's @@ -69,7 +77,9 @@ Usata per ricaricare la Batteria dell'UAV Используется для зарядки переносных БПЛА 運んでいる UAV を充電に使う - UAV를 재충전 할때 씁니다. + 무인기를 재충전 할때 씁니다. + 对可携式无人载具进行充电 + 對可攜式無人載具進行充電 Recharging... @@ -82,7 +92,10 @@ Recarregando... In ricarica... Заряжается... - 充電中 + 充電しています・・・ + 充电中... + 充電中... + 충전중... 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/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index 2bf807975f..911ddcf01d 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,43 @@ 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); + +["ace_wireCuttingStarted", [_unit, _fenceObject]] call CBA_fnc_globalEvent; 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/script_component.hpp b/addons/logistics_wirecutter/script_component.hpp index 7ec3a5dc0d..69711d289b 100644 --- a/addons/logistics_wirecutter/script_component.hpp +++ b/addons/logistics_wirecutter/script_component.hpp @@ -18,6 +18,6 @@ //find is case sensitive, so keep everything lowercase -#define FENCE_P3DS ["mil_wiredfence_f.p3d","wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"] +#define FENCE_P3DS ["mil_wiredfence_f.p3d","wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d", "net_fence_8m_f.p3d"] #define SOUND_CLIP_TIME_SPACEING 1.5 diff --git a/addons/logistics_wirecutter/stringtable.xml b/addons/logistics_wirecutter/stringtable.xml index 542b152af3..62b7ef77d2 100644 --- a/addons/logistics_wirecutter/stringtable.xml +++ b/addons/logistics_wirecutter/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Cortador de Arame ワイヤーカッター 절단기 + 剪铁丝网钳 + 剪鐵絲網鉗 Wirecutter @@ -28,6 +30,8 @@ Cortador de Arame ワイヤーカッター 절단기 + 剪铁丝网钳 + 剪鐵絲網鉗 Cut Fence @@ -42,6 +46,8 @@ Разрезать забор フェンスを切断する 철조망 자르기 + 剪断护栏 + 剪斷護欄 Cutting Fences / Wires... @@ -54,8 +60,10 @@ Sto tagliando... Drótok elvágása... Разрезаем забор / провода... - フェンス/ワイヤを切断中・・・ + フェンス/ワイヤを切断しています・・・ 철망/철조망 자르는중... + 剪断护栏/刺网中... + 剪斷護欄/刺網中... Fence cut @@ -70,6 +78,8 @@ Забор разрезан フェンスを切断した 절단됨 + 护栏已被剪断 + 護欄已被剪斷 diff --git a/addons/magazinerepack/ACE_Settings.hpp b/addons/magazinerepack/ACE_Settings.hpp index 940af87d15..b66fe5f254 100644 --- a/addons/magazinerepack/ACE_Settings.hpp +++ b/addons/magazinerepack/ACE_Settings.hpp @@ -1,17 +1,26 @@ class ACE_Settings { //Time to move a round from one magazine to another class GVAR(timePerAmmo) { + category = CSTRING(DisplayName); + displayName = CSTRING(timePerAmmo); value = 1.5; typeName = "SCALAR"; + sliderSettings[] = {1, 10, 1.5, 1}; }; //Time to swap between magazines when repacking class GVAR(timePerMagazine) { + category = CSTRING(DisplayName); + displayName = CSTRING(timePerMagazine); value = 2.0; typeName = "SCALAR"; + sliderSettings[] = {1, 10, 2, 1}; }; //Time to relink 2 belts together class GVAR(timePerBeltLink) { + category = CSTRING(DisplayName); + displayName = CSTRING(timePerBeltLink); value = 8.0; typeName = "SCALAR"; + sliderSettings[] = {1, 10, 8, 1}; }; }; 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/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_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 f25f6f9810..23dc18c3fd 100644 --- a/addons/magazinerepack/stringtable.xml +++ b/addons/magazinerepack/stringtable.xml @@ -1,6 +1,37 @@ - + + + Magazine Repack + Riempimento Caricatori + 重新整理彈匣 + 重新整理弹匣 + 弾倉詰め替え + + + Time per round + Zeit pro Patrone + Durata per proiettile + 每發所需時間 + 每发所需时间 + 弾頭毎の所有時間 + + + Time per magazine + Zeit pro Magazin + Durata per caricatore + 每匣所需時間 + 每匣所需时间 + 弾倉毎の所有時間 + + + Time per belt link + Zeit pro Gurtglied + Durata per caricatore a nastro + 每彈鍊所需時間 + 每弹炼所需时间 + ベルトリンク毎の所有時間 + Repack Magazines Magazine umpacken @@ -8,40 +39,14 @@ Réorganiser les chargeurs Przepakuj magazynki Přepáskovat zásobníky - Riempi i caricatori + Riempi Caricatori Reorganizar Carregadores Ú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... @@ -50,26 +55,14 @@ Réorganisation des chargeurs... Przepakowywanie magazynków... Přepáskovávám zásobník... - Sto riempendo i caricatori... + Riempendo i caricatori... Reorganizando Carregadores... Ú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) @@ -82,8 +75,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 @@ -94,10 +89,12 @@ Páskování dokončeno Przepakowywanie zakończone Újratárazás befejezve - Caricatori riempiti + Caricatori Riempiti Reorganização Terminada 詰め替えが完了 탄창 채우기 끝남 + 重整完成 + 重整完成 Repacking Interrupted @@ -108,24 +105,28 @@ Páskování přerušeno Przepakowywanie przerwane Újratárazás megszakítva - Riempimento interrotto + 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ě Pełnych: %1.<br/>Częściowo pełnych: %2. %1 teljes és %2 részleges - %1 pieno(i) e %2 parziale(i) + %1 Pieno(i) e %2 Parziale(i) %1 Total e %2 Parcial - %1 個の満杯で、 %2 の余分数 + %1 個の満杯と %2 個の弾薬入り弾倉 %1 꽉찼고 %2 부분참 + %1个满的与%2个部分的 + %1個滿的與%2個部分的 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 d0574bcd32..bb08e34e09 100644 --- a/addons/main/script_debug.hpp +++ b/addons/main/script_debug.hpp @@ -23,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 @@ -40,7 +40,7 @@ STACK TRACING PERFORMANCE COUNTERS SECTION **/ //#define ENABLE_PERFORMANCE_COUNTERS -// To Use: [] call ace_common_fnc_dumpPerformanceCounters; +// 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_macros.hpp b/addons/main/script_macros.hpp index 167884616f..16a33583a0 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -20,11 +20,11 @@ #define SETPVAR_SYS(var1,var2) setVariable [ARR_3(QUOTE(var1),var2,true)] #undef GETVAR -#define GETVAR(var1,var2,var3) var1 GETVAR_SYS(var2,var3) -#define GETMVAR(var1,var2) missionNamespace GETVAR_SYS(var1,var2) -#define GETUVAR(var1,var2) uiNamespace GETVAR_SYS(var1,var2) -#define GETPRVAR(var1,var2) profileNamespace GETVAR_SYS(var1,var2) -#define GETPAVAR(var1,var2) parsingNamespace GETVAR_SYS(var1,var2) +#define GETVAR(var1,var2,var3) (var1 GETVAR_SYS(var2,var3)) +#define GETMVAR(var1,var2) (missionNamespace GETVAR_SYS(var1,var2)) +#define GETUVAR(var1,var2) (uiNamespace GETVAR_SYS(var1,var2)) +#define GETPRVAR(var1,var2) (profileNamespace GETVAR_SYS(var1,var2)) +#define GETPAVAR(var1,var2) (parsingNamespace GETVAR_SYS(var1,var2)) #undef SETVAR #define SETVAR(var1,var2,var3) var1 SETVAR_SYS(var2,var3) @@ -37,7 +37,7 @@ #define GETGVAR(var1,var2) GETMVAR(GVAR(var1),var2) #define GETEGVAR(var1,var2,var3) GETMVAR(EGVAR(var1,var2),var3) -#define ARR_SELECT(ARRAY,INDEX,DEFAULT) if (count ARRAY > INDEX) then {ARRAY select INDEX} else {DEFAULT} +#define ARR_SELECT(ARRAY,INDEX,DEFAULT) (if (count ARRAY > INDEX) then {ARRAY select INDEX} else {DEFAULT}) #define MACRO_ADDWEAPON(WEAPON,COUNT) class _xx_##WEAPON { \ @@ -109,4 +109,17 @@ #define TRACE_10(MESSAGE,A,B,C,D,E,F,G,H,I,J) /* disabled */ #endif +#define GRAVITY 9.8066 + +#define SD_TO_MIN_MAX(d) ((d) * 3.371) // Standard deviation -> min / max of random [min, mid, max] + +// Angular unit conversion +#define MRAD_TO_MOA(d) ((d) * 3.43774677) // Conversion factor: 54 / (5 * PI) +#define MOA_TO_MRAD(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 MOA_TO_RAD(d) ((d) * 0.00029088) // Conversion factor: PI / 10800 + #include "script_debug.hpp" diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index f0681137a6..04785a35a6 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -9,8 +9,8 @@ #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD // MINIMAL required version for the Mod. Components can specify others.. -#define REQUIRED_VERSION 1.70 -#define REQUIRED_CBA_VERSION {3,2,1} +#define REQUIRED_VERSION 1.78 +#define REQUIRED_CBA_VERSION {3,5,0} #ifdef COMPONENT_BEAUTIFIED #define COMPONENT_NAME QUOTE(ACE3 - COMPONENT_BEAUTIFIED) diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index a52346e875..ed6780a32f 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 3 -#define MINOR 9 -#define PATCHLVL 2 -#define BUILD 18 +#define MINOR 12 +#define PATCHLVL 0 +#define BUILD 29 diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml index 0442d4e9fb..7e6a6fb76a 100644 --- a/addons/main/stringtable.xml +++ b/addons/main/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -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/ diff --git a/addons/map/ACE_Settings.hpp b/addons/map/ACE_Settings.hpp index b04c7b39b3..591ec24116 100644 --- a/addons/map/ACE_Settings.hpp +++ b/addons/map/ACE_Settings.hpp @@ -5,6 +5,7 @@ class ACE_Settings { typeName = "SCALAR"; displayName = CSTRING(BFT_Interval_DisplayName); description = CSTRING(BFT_Interval_Description); + sliderSettings[] = {0, 30, 1, 1}; }; class GVAR(BFT_Enabled) { category = CSTRING(Module_DisplayName); @@ -68,5 +69,6 @@ class ACE_Settings { typeName = "SCALAR"; displayName = CSTRING(DefaultChannel_DisplayName); description = CSTRING(DefaultChannel_Description); + sliderSettings[] = {-1, 5, -1, -1}; }; }; 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/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 16eba79cb2..3a28fe4c3e 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -21,7 +21,7 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleMap); - scope = 2; + scope = 1; isGlobal = 1; isSingular = 1; icon = QPATHTOF(UI\Icon_Module_Map_ca.paa); @@ -81,8 +81,8 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(BFT_Module_DisplayName); function = QFUNC(blueForceTrackingModule); - scope = 2; - isGlobal = 0; + scope = 1; + isGlobal = 1; isSingular = 1; icon = QPATHTOF(UI\Icon_Module_BFTracking_ca.paa); class Arguments { diff --git a/addons/map/CfgWeapons.hpp b/addons/map/CfgWeapons.hpp index c7f350a454..5831428c6c 100644 --- a/addons/map/CfgWeapons.hpp +++ b/addons/map/CfgWeapons.hpp @@ -13,4 +13,14 @@ class CfgWeapons { }; }; }; -}; \ No newline at end of file + class acc_flashlight_pistol: ItemCore { + class ItemInfo: InventoryFlashlightItem_Base_F { + class FlashLight { + ACE_Flashlight_Colour = "white"; + ACE_Flashlight_Beam = QPATHTOF(UI\Flashlight_beam_white_ca.paa); + ACE_Flashlight_Size = 2.75; + ACE_Flashlight_Sound = 1; + }; + }; + }; +}; diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index f022e2c81e..6f2f60fc0c 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -126,3 +126,43 @@ GVAR(hasWatch) = true; false } 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/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index f31386b204..f19fc84e57 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -1,18 +1,21 @@ /* -* 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" -if (!isServer) exitWith {}; - params ["_logic"]; [_logic, QGVAR(BFT_Enabled), "Enabled"] call EFUNC(common,readSettingFromModule); 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_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..077106eabe 100644 --- a/addons/map/functions/fnc_moduleMap.sqf +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -3,16 +3,19 @@ * 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" -if !(isServer) exitWith {}; - params ["_logic", "", "_activated"]; if !(_activated) exitWith {}; 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..2c0f3c128c 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 */ @@ -32,7 +35,7 @@ if (GVAR(mapShake)) then { // Only shake map while moving on foot private _speed = 0; - if (vehicle ACE_player == ACE_player) then { + if ((alive ACE_player) && {vehicle ACE_player == ACE_player}) then { _speed = vectorMagnitude (velocity ACE_player); }; diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index d7fb92a3d6..eab4549f75 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -14,6 +14,8 @@ Mappa 地図 지도 + 地图 + 地圖 Map illumination? @@ -26,8 +28,10 @@ Térkép megvilágítása? Освещение карты? Illuminazione Mappa? - 地図に照明? + 地図に照明? 지도에 조명? + 地图照明? + 地圖照明? Simulate map lighting based on ambient lighting and player's items? @@ -39,8 +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? @@ -52,8 +58,10 @@ Nasvícení mapy pomocí baterky? Luce della torcia in mappa? Lumière de la lampe de carte ? - 地図をフラッシュライトで照らしますか? + 地図をライトで照らしますか? 지도 조명이 빛이 납니까? + 增加地图亮度? + 增加地圖亮度? Add external glow to players who use flashlight on map? @@ -65,8 +73,10 @@ Añadir resplandor externo a los jugadores que utilizan la linterna en el mapa? 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? @@ -79,8 +89,10 @@ Térkép-rázkódás? Тряска карты? Scuoti la mappa? - 地図を揺らしますか? + 地図を揺らしますか? 지도 흔들림? + 地图震动? + 地圖震動? Make map shake when walking? @@ -93,8 +105,10 @@ Rázkódjon-e a térkép mozgáskor? Заставлять карту трястись при ходьбе? Far scuotere la mappa mentre cammini? - 歩いているときは地図を揺らしますか? + 歩いているときは地図を揺らしますか? 걸을때 지도보면 흔들리게 합니까? + 走路时让地图有震动的感觉? + 走路時讓地圖有震動的感覺? Limit map zoom? @@ -107,8 +121,10 @@ Térkép-nagyítás korlátozása? Ограничить приближение карты? Limita lo zoom in mappa? - 地図の拡大を制限しますか? + 地図の拡大を制限しますか? 지도 확대 제한? + 限制地图缩放倍率? + 限制地圖縮放倍率? Limit the amount of zoom available for the map? @@ -121,8 +137,10 @@ Korlátozva legyen-e a nagyítás mennyisége a térképnél? Ограничить максимальное приближение, доступное на карте? Limita l'ammontare di zoom disponibile per la mappa? - 地図上で利用できる拡大倍率を制限しますか? + 地図上で利用できる拡大倍率を制限しますか? 지도 확대에 제한을 둡니까? + 限制地图上可允许缩放的倍率? + 限制地圖上可允許縮放的倍率? Show cursor coordinates? @@ -135,8 +153,10 @@ Kurzor-koordináták mutatása? Показывать координаты курсора? Mostra coordinate sul cursore? - カーソル先で座標を表示しますか? + カーソル先で座標を表示しますか? 커서에 좌표를 보이게 합니까? + 显示游标的座标? + 顯示游標的座標? Show the grid coordinates on the mouse pointer? @@ -149,8 +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. @@ -163,8 +185,10 @@ Этот модуль позволяет настроить отображение карты. Este módulo permite personalizar la pantalla del mapa. Questo modulo ti permette di customizzare lo schermo della mappa. - モジュールは地図画面をカスタマイズできます。 + このモジュールは地図画面を変更できます。 이 모듈은 지도 화면을 임의로 설정할 수 있게 해줍니다. + 此模块允许自定地图的相关效果. + 此模塊允許自定地圖的相關效果. Blue Force Tracking @@ -179,6 +203,8 @@ Blue Force Tracking ブルー フォース トラッキング GPS피아식별기 + 显示蓝方踪迹 + 顯示藍方蹤跡 BFT Enable @@ -193,6 +219,8 @@ Abilita BFT BFT を有効化 GPS피아식별기 켜기 + 蓝方踪迹启用 + 藍方蹤跡啟用 Enable Blue Force Tracking. Default: No @@ -205,8 +233,10 @@ Blue Force követés engedélyezése. Alapértelmezett: Nem Включает систему служения BFT. По-умолчанию: Нет Abilita Blue Force Tracking. Default: No - ブルー フォース トラッキングを有効化します。標準:無効 + ブルー フォース トラッキングを有効化します。標準: 無効 GPS피아식별기 켭니다. 기본설정: 아니요 + 启用显示蓝方踪迹. 预设: 否 + 啟用顯示藍方蹤跡. 預設: 否 Interval @@ -221,6 +251,8 @@ Intervallo 間隔 간격 + 间隔 + 間隔 How often the markers should be refreshed (in seconds) @@ -233,8 +265,10 @@ Milyen gyakran frissüljenek a jelölők (másodpercben) Как часто должны обновляться маркеры (в секундах) Quanto spesso vengono aggiornati i marker (in secondi) - マーカが再描画される間隔を設定できます(秒) + マーカが再描画される間隔を設定できます (秒) 몇 초마다 마커를 새로 갱신합니까? + 设定每多少时间重新标示出单位位置 (秒) + 設定每多少時間重新標示出單位位置 (秒) Hide AI groups? @@ -247,8 +281,10 @@ AI csoportok elrejtése? Скрыть группы ботов? Nascondere gruppi IA? - AI グループを非表示にしますか? + AI グループを非表示にしますか? 인공지능 그룹을 숨깁니까? + 隐藏AI小队? + 隱藏AI小隊? Hide markers for 'AI only' groups? @@ -261,8 +297,10 @@ Jelölők elrejtése "csak AI" csoportoknál? Скрыть маркеры групп, которые состоят полностью из ботов? Nascondi markers per gruppi di sole IA? - 'AI のみ'グループのマーカを隠しますか? + 'AI のみ'グループのマーカを隠しますか? 인공지능만 있는 그룹의 마커를 숨깁니까? + 隐藏'AI小队'的踪迹? + 隱藏'AI小隊'的蹤跡? Show player names? @@ -275,8 +313,10 @@ Itt található az a játékos nevét? Показать имена игроков? Mostra i nomi dei giocatori? - プレイヤ名を表示しますか? + プレイヤ名を表示しますか? 플레이어 이름을 표시합니까? + 显示玩家名称? + 顯示玩家名稱? Show individual player names? @@ -289,8 +329,10 @@ Itt található az adott játékos neveket? Показать отдельные имена игроков? Mostra i nomi dei giocatori singoli? - プレイヤの名前を表示しますか? + プレイヤの名前を表示しますか? 각 플레이어의 이름을 표시합니까? + 显示玩家的个别名称? + 顯示玩家的個別名稱? This module allows the tracking of allied units with BFT map markers. @@ -305,6 +347,8 @@ Questo modulo permette il tracciamento di unità alleate con i marker BFT in mappa モジュールは BFT マップ マーカとともに、同勢力ユニットの追跡を許可します。 이 모듈은 아군을 지도상에서 추적할 수 있게 해줍니다. + 此模块将使你能在地图上看见友方单位的踪迹 + 此模塊將使你能在地圖上看見友方單位的蹤跡 Flashlights @@ -318,6 +362,8 @@ Torcia フラッシュライト 손전등 + 手电筒 + 手電筒 NVG @@ -331,6 +377,8 @@ NVG 夜間暗視装置 야투경 + 夜视镜 + 夜視鏡 On @@ -344,6 +392,8 @@ Acceso 起動 켜기 + 开启 + 開啟 Off @@ -357,6 +407,8 @@ Spento 停止 끄기 + 关闭 + 關閉 Increase Brightness @@ -368,8 +420,10 @@ Zvýšit jas Aumentar brillo Aumenta Luminosità - 感度を上げる + 明度を上げる 밝기 올리기 + 增加亮度 + 增加亮度 Decrease Brightness @@ -381,8 +435,10 @@ Snížit jas Reducir brillo Diminuisci Luminosità - 感度を下げる + 明度を下げる 밝기 내리기 + 降低亮度 + 降低亮度 Turn On %1 @@ -397,6 +453,8 @@ Активировать %1 %1 を点ける %1 켜기 + 开启%1 + 開啟%1 Turn Off %1 @@ -411,6 +469,8 @@ Деактивировать %1 %1 を消す %1 끄기 + 关闭%1 + 關閉%1 Set Channel At Start @@ -424,6 +484,8 @@ Mettre un canal par défaut 開始時のチャンネルを決定 시작시 채널 + 设定游戏开始时的聊天频道 + 設定遊戲開始時的聊天頻道 Change the starting marker channel at mission start @@ -437,6 +499,8 @@ Change le canal de communication par défaut au début de la mission. ミッション開始時にあらかじめ設定されているマーカ チャンネルを変更します 미션시작시 마커채널을 변경합니다 + 更改任务启动时的聊天频道 + 更改任務啟動時的聊天頻道 Disable BFT @@ -446,6 +510,8 @@ Wyłącz BFT Désactive le BFT Disablita BFT + 关闭友军踪迹 + 關閉友軍蹤跡 Always disable Blue Force Tracking for this group. @@ -455,6 +521,8 @@ 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 bb01592230..d74d58a1a5 100644 --- a/addons/map_gestures/ACE_Settings.hpp +++ b/addons/map_gestures/ACE_Settings.hpp @@ -12,6 +12,7 @@ class ACE_Settings { category = CSTRING(mapGestures_category); typeName = "SCALAR"; value = 7; + sliderSettings[] = {0, 50, 7, 1}; }; class GVAR(interval) { displayName = CSTRING(interval_displayName); @@ -19,6 +20,7 @@ class ACE_Settings { category = CSTRING(mapGestures_category); typeName = "SCALAR"; value = 0.03; + sliderSettings[] = {0, 1, 0.03, 2}; }; class GVAR(nameTextColor) { displayName = CSTRING(nameTextColor_displayName); diff --git a/addons/map_gestures/CfgVehicles.hpp b/addons/map_gestures/CfgVehicles.hpp index 0745c70a16..4823460971 100644 --- a/addons/map_gestures/CfgVehicles.hpp +++ b/addons/map_gestures/CfgVehicles.hpp @@ -1,11 +1,11 @@ class CfgVehicles { class ACE_Module; class GVAR(moduleSettings): ACE_Module { - scope = 2; + scope = 1; category = "ACE"; displayName = CSTRING(moduleSettings_displayName); function = QFUNC(moduleSettings); - isGlobal = 0; + isGlobal = 1; isSingular = 1; author = ECSTRING(common,ACETeam); icon = QPATHTOF(ui\icon_module_map_gestures_ca.paa); diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf index 6e292ce75e..f49e1d4525 100644 --- a/addons/map_gestures/functions/fnc_moduleSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf @@ -19,7 +19,7 @@ params ["_logic", "", "_activated"]; -if (!_activated || !isServer) exitWith {}; +if (!_activated) exitWith {}; [_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule); @@ -30,14 +30,14 @@ private _defaultLeadColor = _logic getVariable ["defaultLeadColor", ""]; if (_defaultLeadColor != "") then { _defaultLeadColor = call compile ("[" + _defaultLeadColor + "]"); if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultLeadColor is not a valid color array.")}; - [QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting); + ["CBA_settings_setSettingMission", [QGVAR(defaultLeadColor), _defaultLeadColor, true]] call CBA_fnc_localEvent; }; private _defaultColor = _logic getVariable ["defaultColor", ""]; if (_defaultColor != "") then { _defaultColor = call compile ("[" + _defaultColor + "]"); if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")}; - [QGVAR(defaultColor), _defaultColor, true, true] call EFUNC(common,setSetting); + ["CBA_settings_setSettingMission", [QGVAR(defaultColor), _defaultColor, true]] call CBA_fnc_localEvent; }; INFO("Map Gestures Module Initialized."); diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml index fc543116eb..2bcc1ca4bd 100644 --- a/addons/map_gestures/stringtable.xml +++ b/addons/map_gestures/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,8 @@ Gestes de carte マップ ジェスチャ 지도 신호 + 地图指示器 + 地圖指示器 Enabled @@ -26,6 +28,8 @@ Activer 有効化 켜기 + 启用 + 啟用 Map Gesture Max Range @@ -39,6 +43,8 @@ Distance max. des gestes de carte マップ ジェスチャの最大範囲 지도 신호 최대 거리 + 地图指示器最大范围 + 地圖指示器最大範圍 Max range between players to show the map gesture indicator [default: 7 meters] @@ -52,6 +58,8 @@ Distance max. entre les joueurs pour montrer le pointage sur carte. (Défaut : 7m) プレイヤのマップ ジェスチャによる表示範囲を設定します [標準:7 メートル] 플레이어간에 지도 신호 표시거리를 설정합니다. [기본: 7 미터] + 设定地图指示器显示的最大范围距离 [预设: 7公尺] + 設定地圖指示器顯示的最大範圍距離 [預設: 7公尺] Lead Default Color @@ -65,6 +73,8 @@ Couleur principale de commandement. リーダー用標準の色 리더 기본 색상 + 队长预设颜色 + 隊長預設顏色 Fallback Color value for group leaders when there is no group setting. [Module: leave blank to not force on clients] @@ -77,6 +87,8 @@ 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 @@ -90,6 +102,8 @@ Couleur par défaut 標準色 기본 색상 + 预设颜色 + 預設顏色 Fallback Color value when there is no group setting. [Module: leave blank to not force on clients] @@ -102,6 +116,8 @@ 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 @@ -115,6 +131,8 @@ Couleur de commandement リーダー用の色 리더 색상 + 队长颜色 + 隊長顏色 Color value for group leaders of groups synced with this module. @@ -127,6 +145,8 @@ Couleur pour les chefs de groupe des groupes synchronisés avec le module. モジュールで同期されたグループのリーダー用に色の値を決定します。 그룹이 이 모듈에 동기화 됐을때의 리더 색상입니다. + 改变与此同步小队队长的指示器颜色。 + 改變與此同步小隊隊長的指示器顏色。 Color @@ -140,6 +160,8 @@ Couleur 색상 + 颜色 + 顏色 Color value for group members of groups synced with this module. @@ -152,6 +174,8 @@ Couleur pour les membres du groupe synchronisé avec ce module. モジュールで同期されたグループのメンバ用に色の値を決定します。 그룹이 이 모듈에 동기화 됐을때의 멤버 색상입니다. + 改变与此同步小队队员的指示器颜色 + 改變與此同步小隊隊員的指示器顏色 Map Gestures - Group Settings @@ -165,6 +189,8 @@ Gestes de carte - réglages de groupe マップ ジェスチャ - グループ設定 지도 신호 - 그룹 설정 + 地图指示器 - 队伍设定 + 地圖指示器 - 隊伍設定 Update Interval @@ -178,6 +204,8 @@ Intervalle de mise à jour 更新間隔 갱신 간격 + 更新间隔 + 更新間隔 Time between data updates. @@ -191,6 +219,8 @@ Temps entre les actualisations de données データの更新間隔 데이터 갱신 간격 + 定义每次更新数据的时间. + 定義每次更新數據的時間. Enables the Map Gestures. @@ -204,6 +234,8 @@ Activer les gestes de carte マップ ジェスチャを有効化 지도 신호 활성화 + 启用地图指示器 + 啟用地圖指示器 Name Text Color @@ -217,6 +249,8 @@ Couleur du texte du nom 名前への色 글 색상 명칭 + 名称文字颜色 + 名稱文字顏色 Color of the name tag text besides the map gestures mark. @@ -229,6 +263,8 @@ Couleur des tags de nom à côté de marqueur de pointage sur carte. マップ ジェスチャに表示される、名前の色を決定します。 지도 색상에 표시되는 이름의 색상을 결정합니다. + 定义名称文字颜色。使其与地图指示器颜色有所区别。 + 定義名稱文字顏色。使其與地圖指示器顏色有所區別。 Map Gestures @@ -242,6 +278,8 @@ Gestes de carte マップ ジェスチャ 지도 신호 + 地图指示器 + 地圖指示器 diff --git a/addons/maptools/ACE_Settings.hpp b/addons/maptools/ACE_Settings.hpp index cb2d98e1ce..c0642ed4e7 100644 --- a/addons/maptools/ACE_Settings.hpp +++ b/addons/maptools/ACE_Settings.hpp @@ -1,5 +1,6 @@ class ACE_Settings { class GVAR(rotateModifierKey) { + category = CSTRING(Name); value = 1; typeName = "SCALAR"; isClientSettable = 1; @@ -7,11 +8,12 @@ class ACE_Settings { description = CSTRING(rotateModifierKey_description); values[] = {"$STR_A3_OPTIONS_DISABLED", "ALT", "CTRL", "SHIFT"}; }; - class GVAR(drawStaightLines) { + class GVAR(drawStraightLines) { + category = CSTRING(Name); value = 1; typeName = "BOOL"; isClientSettable = 1; - displayName = CSTRING(drawStaightLines_displayName); - description = CSTRING(drawStaightLines_description); + displayName = CSTRING(drawStraightLines_displayName); + description = CSTRING(drawStraightLines_description); }; }; diff --git a/addons/maptools/CfgWeapons.hpp b/addons/maptools/CfgWeapons.hpp index dc7a7046dd..31d8bc491e 100644 --- a/addons/maptools/CfgWeapons.hpp +++ b/addons/maptools/CfgWeapons.hpp @@ -1,14 +1,15 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_MapTools: ACE_ItemCore { displayName = CSTRING(Name); + author = ECSTRING(common,ACETeam); descriptionShort = CSTRING(Description); 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/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..ef354f0798 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 @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -if (!GVAR(drawStaightLines)) exitWith {}; +if (!GVAR(drawStraightLines)) exitWith {}; params ["_theMap", "_roamerWidth"]; GVAR(mapTool_pos) params ["_roamerPosX", "_roamerPosY"]; 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 da72ba5a52..c467da5f2a 100644 --- a/addons/maptools/stringtable.xml +++ b/addons/maptools/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Инструменты карты マップ ツール 독도용 도구 + 地图工具 + 地圖工具 The Map Tools allow you to measure distances and angles on the map. @@ -28,6 +30,8 @@ Картографические инструменты позволяют измерять расстояния и углы на карте. マップ ツールは地図上で距離や角度を測れます。 독도용 도구는 지도상에서 거리나 각도를 잴 수 있게 해줍니다. + 地图工具能够让你在地图上测量距离与角度 + 地圖工具能夠讓你在地圖上測量距離與角度 Map Tools @@ -42,6 +46,8 @@ Инструменты карты マップ ツール 독도용 도구 + 地图工具 + 地圖工具 Hide Map Tool @@ -56,6 +62,8 @@ Скрыть инструменты マップ ツールを隠す 독도용 도구 숨기기 + 隐藏地图工具 + 隱藏地圖工具 Show Normal Map Tool @@ -70,6 +78,8 @@ Показать инструменты (средн. размер) マップ ツールを表示する 보통 독도용 도구로 보기 + 显示地图工具 + 顯示地圖工具 Show Small Map Tool @@ -84,6 +94,8 @@ Показать инструменты (малый размер) 小さいマップ ツールを表示する 작은 독도용 도구로 보기 + 显示小的地图工具 + 顯示小的地圖工具 Align Map Tool to North @@ -98,6 +110,8 @@ Выровнять инструменты на север マップ ツールを北に合わせる 독도용 도구를 북쪽으로 정렬 + 地图工具对准北方 + 地圖工具對準北方 Align Map Tool to Compass @@ -112,6 +126,8 @@ Выровнять инструменты по компасу マップ ツールを方位磁石に合わせる 독도용 도구를 나침반에 정렬 + 地图工具对准指北针 + 地圖工具對準指北針 Show GPS on Map @@ -126,6 +142,8 @@ Показать GPS на карте 地図上に GPS を表示する GPS를 지도상에 꺼내기 + 在地图上显示GPS + 在地圖上顯示GPS Hide GPS on Map @@ -140,6 +158,8 @@ Скрыть GPS на карте 地図上から GPS を隠す GPS를 지도상에서 숨기기 + 在地图上隐藏GPS + 在地圖上隱藏GPS Direction: %1° @@ -154,6 +174,8 @@ Direção: %1 方位:%1° 방위: %1° + 方位: %1° + 方位: %1° Rotate Map Tools Key @@ -164,6 +186,8 @@ Taste zum Drehen des Kartenwerkzeugs 독도용 도구 돌리기 키 Ruota Strumenti di Mappatura + 选转地图工具的按键 + 選轉地圖工具的按鍵 Modifier key to allow rotating map tools @@ -174,8 +198,10 @@ 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 @@ -183,8 +209,10 @@ 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 @@ -192,6 +220,8 @@ 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..dd20546fb0 --- /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 = 1; + 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/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 261d7a0687..8ce677cbbc 100644 --- a/addons/markers/stringtable.xml +++ b/addons/markers/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -12,8 +12,100 @@ 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..275e9d739e --- /dev/null +++ b/addons/maverick/CfgAmmo.hpp @@ -0,0 +1,75 @@ +class CfgAmmo { + class MissileCore; + class MissileBase : MissileCore { + class Components; + }; + class Missile_AGM_02_F : MissileBase {}; + + class GVAR(L) : Missile_AGM_02_F { + author = "xrufix"; + 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"}; + }; + }; + + class Missile_AGM_01_F : MissileBase {}; + class ace_kh25ml : Missile_AGM_01_F { + author = "xrufix"; + irLock = 0 + missileLockMaxDistance = 10000; + 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"}; + + seekLastTargetPos = 1; + seekerAngle = 40; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 10000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; + }; + }; +}; diff --git a/addons/maverick/CfgMagazines.hpp b/addons/maverick/CfgMagazines.hpp new file mode 100644 index 0000000000..3254f605c0 --- /dev/null +++ b/addons/maverick/CfgMagazines.hpp @@ -0,0 +1,113 @@ +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); + }; + + // KH-25 + class 4Rnd_Missile_AGM_01_F; + class PylonRack_1Rnd_Missile_AGM_01_F : 4Rnd_Missile_AGM_01_F {}; + class magazine_Missile_AGM_KH25_x1 : VehicleMagazine {}; + class PylonMissile_Missile_AGM_KH25_x1 : magazine_Missile_AGM_KH25_x1 {}; + class PylonMissile_Missile_AGM_KH25_INT_x1 : PylonMissile_Missile_AGM_KH25_x1 {}; + + class ace_kh25ml_pylonrack_x1 : PylonRack_1Rnd_Missile_AGM_01_F { + ammo = "ace_kh25ml"; + author = "xrufix"; + descriptionShort = CSTRING(KH25ML_MAG_DESCR); + displayName = CSTRING(KH25ML_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = "ace_kh25ml_launcher"; + }; + class ace_kh25ml_magazine_x1 : magazine_Missile_AGM_KH25_x1 { + ammo = "ace_kh25ml"; + author = "xrufix"; + descriptionShort = CSTRING(KH25ML_MAG_DESCR); + displayName = CSTRING(KH25ML_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + }; + class ace_kh25ml_pylonmissile_x1 : PylonMissile_Missile_AGM_KH25_x1 { + ammo = "ace_kh25ml"; + author = "xrufix"; + descriptionShort = CSTRING(KH25ML_MAG_DESCR); + displayName = CSTRING(KH25ML_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = "ace_kh25ml_launcher"; + }; + class ace_kh25ml_pylonmissile_int_x1 : PylonMissile_Missile_AGM_KH25_INT_x1 { + ammo = "ace_kh25ml"; + author = "xrufix"; + descriptionShort = CSTRING(KH25ML_MAG_DESCR); + displayName = CSTRING(KH25ML_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = "ace_kh25ml_launcher"; + }; +}; diff --git a/addons/maverick/CfgWeapons.hpp b/addons/maverick/CfgWeapons.hpp new file mode 100644 index 0000000000..c3157f34dd --- /dev/null +++ b/addons/maverick/CfgWeapons.hpp @@ -0,0 +1,66 @@ +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; + }; + + class weapon_AGM_KH25Launcher : MissileLauncher {}; + class ace_kh25ml_launcher : weapon_AGM_KH25Launcher { + author = "xrufix"; + displayName = CSTRING(KH25ML); + magazines[] = { + "ace_kh25ml_pylonrack_x1", + "ace_kh25ml_magazine_x1", + "ace_kh25ml_pylonmissile_x1", + "ace_kh25ml_pylonmissile_int_x1" + }; + 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..a931a2bc08 --- /dev/null +++ b/addons/maverick/README.md @@ -0,0 +1,17 @@ +ace_maverick +========== + +Adds pylon magazines with laser guided AGM-65 Maverick L and KH25ML. + +* The Mavericks can be added to every plane the vanilla Macer II can be added to. +* The KH25ML can be added to every plane the vanilla KH25 and Sharur missiles can be added to. +* The missile uses laser guidance based on ACE's Advanced Missile Guidance framework. +* The PylonWeapon 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..dbfabf7f9d --- /dev/null +++ b/addons/maverick/config.cpp @@ -0,0 +1,43 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_missileguidance"}; + author = ECSTRING(common,ACETeam); + authors[] = {"xrufix"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + ammo[] = { + GVAR(L), + "ace_kh25ml" + }; + 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), + "ace_kh25ml_magazine_x1", + "ace_kh25ml_pylonmissile_x1", + "ace_kh25ml_pylonmissile_int_x1" + }; + weapons[] = { + GVAR(L_Launcher_Plane), + GVAR(L_Launcher), + "ace_kh25ml_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..32d00eabb7 --- /dev/null +++ b/addons/maverick/stringtable.xml @@ -0,0 +1,77 @@ + + + + + + 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, 레이저 유도 대지 미사일 + + + AGM-65 Maverick L [ACE] + AGM-65 Maverick L [ACE] + AGM-65 Maverick L [ACE] + AGM-65 マーベリック L [ACE] + AGM-65"小牛"飛彈L型 [ACE] + AGM-65"小牛"飞弹L型 [ACE] + AGM-65 Maverick L [ACE] + + + 2x AGM-65 Maverick L [ACE] + 2x AGM-65 Maverick L [ACE] + 2x AGM-65 Maverick L [ACE] + 2x AGM-65 マーベリック L [ACE] + 2x AGM-65"小牛"飛彈L型 [ACE] + 2x AGM-65"小牛"飞弹L型 [ACE] + 2x AGM-65 Maverick L [ACE] + + + 3x AGM-65 Maverick L [ACE] + 3x AGM-65 Maverick L [ACE] + 3x AGM-65 Maverick L [ACE] + 3x AGM-65 マーベリック L [ACE] + 3x AGM-65"小牛"飛彈L型 [ACE] + 3x AGM-65"小牛"飞弹L型 [ACE] + 3x AGM-65 Maverick L [ACE] + + + Laser Guided + Lasergelenkt + Guida Laser + レーザー誘導 + 雷射導引 + 雷射导引 + 레이저 유도 + + + Kh-25ML, Laser Guided Air-to-Ground-Missile + Ch-25ML, Lasergelenkte Luft-Boden-Rakete + + + 1x Kh-25ML [ACE] + 1x Ch-25ML [ACE] + 1x Х-25МЛ [ACE] + + + + + AGM-65 Maverick L + AGM-65 Maverick L + AGM-65 Maverick L + AGM-65 マーベリック L + AGM-65"小牛"飛彈L型 + AGM-65"小牛"飞弹L型 + AGM-65 Maverick L + + + Kh-25ML + Ch-25ML + Х-25МЛ + + + + diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index b5c1c80d1a..825827458d 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -30,6 +30,7 @@ class ACE_Settings { description = CSTRING(MedicalSettings_bleedingCoefficient_Description); typeName = "SCALAR"; value = 1; + sliderSettings[] = {0, 25, 1, 1}; }; class GVAR(painCoefficient) { category = CSTRING(Category_Medical); @@ -37,6 +38,7 @@ class ACE_Settings { description = CSTRING(MedicalSettings_painCoefficient_Description); typeName = "SCALAR"; value = 1; + sliderSettings[] = {0, 25, 1, 1}; }; class GVAR(advancedBandages) { category = CSTRING(Category_Medical); @@ -58,6 +60,7 @@ class ACE_Settings { description = CSTRING(MedicalSettings_advancedDiagnose_Description); typeName = "BOOL"; value = 1; + sliderSettings[] = {0, 25, 1, 1}; }; class GVAR(woundReopening) { category = CSTRING(Category_Medical); @@ -65,6 +68,7 @@ class ACE_Settings { description = CSTRING(MedicalSettings_enableAdvancedWounds_Description); typeName = "BOOL"; value = 1; + sliderSettings[] = {0, 25, 1, 1}; }; /* @todo class GVAR(enableVehicleCrashes) { @@ -94,14 +98,16 @@ class ACE_Settings { displayName = CSTRING(MedicalSettings_playerDamageThreshold_DisplayName); description = CSTRING(MedicalSettings_playerDamageThreshold_Description); typeName = "SCALAR"; - value = 1.05; + value = 120; + sliderSettings[] = {0, 1200, 120, 0}; }; class GVAR(AIDamageThreshold) { category = CSTRING(Category_Medical); displayName = CSTRING(MedicalSettings_AIDamageThreshold_DisplayName); description = CSTRING(MedicalSettings_AIDamageThreshold_Description); typeName = "SCALAR"; - value = 1.05; + value = -1; + sliderSettings[] = {-1, 25, -1, -1}; }; class GVAR(fatalInjuryCondition) { category = CSTRING(Category_Medical); @@ -111,6 +117,20 @@ class ACE_Settings { typeName = "SCALAR"; values[] = {"Always", "In Cardiac Arrest", "Never"}; }; + class GVAR(fatalInjuryConditionAI) { + category = CSTRING(Category_Medical); + displayName = CSTRING(MedicalSettings_fatalInjuryConditionAI_DisplayName); + description = CSTRING(MedicalSettings_fatalInjuryConditionAI_Description); + value = 1; + typeName = "BOOL"; + }; + class GVAR(unconsciousConditionAI) { + category = CSTRING(Category_Medical); + displayName = CSTRING(MedicalSettings_unconsciousConditionAI_DisplayName); + description = CSTRING(MedicalSettings_unconsciousConditionAI_Description); + value = 1; + typeName = "BOOL"; + }; class GVAR(cardiacArrestTime) { category = CSTRING(Category_Medical); displayName = CSTRING(MedicalSettings_cardiacArrestTime_DisplayName); @@ -133,6 +153,7 @@ class ACE_Settings { typeName = "SCALAR"; value = 0; values[] = {"Anyone", "Medics only", "Doctors only"}; + sliderSettings[] = {-1, 3600, 0, 0}; }; class GVAR(medicSetting_Medkit) { category = CSTRING(Category_Medical); @@ -251,4 +272,12 @@ class ACE_Settings { value = 0; values[] = {"No", "Yes"}; }; + class GVAR(spontaneousWakeUpChance) { + category = CSTRING(Category_Medical); + displayName = CSTRING(MedicalSettings_spontaneousWakeUpChance_DisplayName); + description = CSTRING(MedicalSettings_spontaneousWakeUpChance_Description); + typeName = "SCALAR"; + value = 3; + sliderSettings[] = {0, 30, 3, 0}; + }; }; diff --git a/addons/medical/CfgEventHandlers.hpp b/addons/medical/CfgEventHandlers.hpp index a6ea04545c..604cb0783a 100644 --- a/addons/medical/CfgEventHandlers.hpp +++ b/addons/medical/CfgEventHandlers.hpp @@ -23,3 +23,11 @@ class Extended_Init_EventHandlers { }; }; }; + +class Extended_Respawn_EventHandlers { + class CAManBase { + class ADDON { + respawn = QUOTE(call FUNC(handleRespawn)); + }; + }; +}; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index dbf1e2114e..033943ee87 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -1,6 +1,4 @@ -#define MEDICAL_ACTION_DISTANCE 1.75 - class CBA_Extended_EventHandlers; class CfgVehicles { @@ -11,7 +9,7 @@ class CfgVehicles { }; class ACE_Module; class ACE_moduleMedicalSettings: ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(MedicalSettings_Module_DisplayName); icon = QPATHTOF(UI\Icon_Module_Medical_ca.paa); category = "ACE_medical"; @@ -127,10 +125,22 @@ class CfgVehicles { }; class never { name = ECSTRING(common,Never); - value = 1; + value = 2; }; }; }; + class fatalInjuryConditionAI { + displayName = CSTRING(MedicalSettings_fatalInjuryConditionAI_DisplayName); + description = CSTRING(MedicalSettings_fatalInjuryConditionAI_Description); + typeName = "BOOL"; + defaultValue = 1; + }; + class unconsciousConditionAI { + displayName = CSTRING(MedicalSettings_unconsciousConditionAI_DisplayName); + description = CSTRING(MedicalSettings_unconsciousConditionAI_Description); + typeName = "BOOL"; + defaultValue = 1; + }; class cardiacArrestTime { displayName = CSTRING(MedicalSettings_cardiacArrestTime_DisplayName); description = CSTRING(MedicalSettings_cardiacArrestTime_Description); @@ -452,6 +462,12 @@ class CfgVehicles { }; }; }; + class spontaneousWakeUpChance { + displayName = CSTRING(MedicalSettings_spontaneousWakeUpChance_DisplayName); + description = CSTRING(MedicalSettings_spontaneousWakeUpChance_Description); + typeName = "SCALAR"; + defaultValue = 0; + }; }; }; class MapBoard_altis_F; @@ -690,7 +706,15 @@ 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; @@ -707,6 +731,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 3461596c95..072e2ef640 100644 --- a/addons/medical/CfgWeapons.hpp +++ b/addons/medical/CfgWeapons.hpp @@ -1,19 +1,21 @@ class CfgWeapons { class ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class InventoryFirstAidKitItem_Base_F; class MedikitItem; // ITEMS class FirstAidKit: ItemCore { type = 0; + ace_arsenal_hide = 1; class ItemInfo: InventoryFirstAidKitItem_Base_F { mass = 4; }; }; class Medikit: ItemCore { type = 0; + ace_arsenal_hide = 1; class ItemInfo: MedikitItem { mass = 60; }; @@ -22,95 +24,104 @@ class CfgWeapons { class ACE_ItemCore; class ACE_fieldDressing: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); model = QPATHTOF(data\bandage.p3d); picture = QPATHTOF(ui\items\fieldDressing_x_ca.paa); 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 = 2; }; }; class ACE_packingBandage: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(Packing_Bandage_Display); picture = QPATHTOF(ui\items\packingBandage_x_ca.paa); 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 = 2; }; }; class ACE_elasticBandage: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(Bandage_Elastic_Display); picture = QPATHTOF(ui\items\elasticBandage_x_ca.paa); 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 = 2; }; }; class ACE_tourniquet: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(Tourniquet_Display); picture = QPATHTOF(ui\items\tourniquet_x_ca.paa); 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 = 2; }; }; class ACE_morphine: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(Morphine_Display); picture = QPATHTOF(ui\items\morphine_x_ca.paa); 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 = 2; }; }; class ACE_adenosine: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(Adenosine_Display); picture = QPATHTOF(ui\items\adenosine_x_ca.paa); 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 = 2; }; }; class ACE_atropine: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(Atropine_Display); picture = QPATHTOF(ui\items\atropine_x_ca.paa); 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 = 2; }; }; class ACE_epinephrine: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(Epinephrine_Display); picture = QPATHTOF(ui\items\epinephrine_x_ca.paa); 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 = 2; }; }; class ACE_plasmaIV: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(Plasma_IV); model = QPATHTOF(data\IVBag_1000ml.p3d); hiddenSelections[] = {"camo"}; @@ -118,7 +129,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 +137,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,12 +145,13 @@ 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; }; }; class ACE_bloodIV: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); model = QPATHTOF(data\IVBag_1000ml.p3d); displayName = CSTRING(Blood_IV); picture = QPATHTOF(ui\items\bloodIV_x_ca.paa); @@ -147,7 +159,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 +167,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,12 +175,13 @@ 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; }; }; class ACE_salineIV: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(Saline_IV); model = QPATHTOF(data\IVBag_1000ml.p3d); hiddenSelections[] = {"camo"}; @@ -176,7 +189,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 +197,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,18 +205,19 @@ 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; }; }; class ACE_quikclot: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(QuikClot_Display); model = QPATHTOF(data\QuikClot.p3d); 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 = 2; }; }; @@ -213,39 +227,42 @@ class CfgWeapons { picture = QPATHTOF(ui\items\personal_aid_kit_x_ca.paa); // todo: new picture descriptionShort = CSTRING(Med_Kit_Desc_Short); descriptionUse = CSTRING(Med_Kit_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 10; }; }; class ACE_personalAidKit: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(Aid_Kit_Display); 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; }; }; class ACE_surgicalKit: ACE_ItemCore { scope=2; + author = ECSTRING(common,ACETeam); displayName= CSTRING(SurgicalKit_Display); model = QPATHTOF(data\surgical_kit.p3d); 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; }; }; class ACE_bodyBag: ACE_ItemCore { scope=2; + author = ECSTRING(common,ACETeam); displayName= CSTRING(Bodybag_Display); model = QPATHTOF(data\bodybagItem.p3d); 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 5d2f0aa195..980d46a467 100644 --- a/addons/medical/XEH_PREP.hpp +++ b/addons/medical/XEH_PREP.hpp @@ -1,27 +1,47 @@ - PREP(addDamageToUnit); PREP(addStateHandler); PREP(adjustPainLevel); PREP(bodyCleanupLoop); PREP(conditionCardiacArrestTimer); PREP(conditionExecutionDeath); +PREP(dev_watchMedicalStats); PREP(displayPatientInformation); PREP(displayTriageCard); -PREP(dev_watchMedicalStats); PREP(enteredStateCardiacArrest); PREP(enteredStateFatalInjury); PREP(getBloodLoss); PREP(getBloodPressure); PREP(getBloodVolumeChange); PREP(getCardiacOutput); +PREP(getHeartRateChange); PREP(getPainLevel); +PREP(getTriageStatus); +PREP(getTypeOfDamage); +PREP(getUnconsciousCondition); +PREP(getUnitState); +PREP(handleBandageOpening); +PREP(handleDamage); +PREP(handleDamage_advanced); +PREP(handleDamage_advancedSetDamage); +PREP(handleDamage_airway); +PREP(handleDamage_caching); +PREP(handleDamage_fractures); +PREP(handleDamage_internalInjuries); +PREP(handleDamage_wounds); +PREP(handleDamage_woundsOld); PREP(handleIncapacitation); +PREP(handleInit); PREP(handleKilled); PREP(handleLocal); +PREP(handleRespawn); PREP(handleStateDefault); PREP(handleStateInjured); PREP(handleStateUnconscious); PREP(handleUnitVitals); +PREP(handleUnitVitals); +PREP(hasItem); +PREP(hasItems); +PREP(hasMedicalEnabled); PREP(hasStableVitals); PREP(hasTourniquetAppliedTo); PREP(init); @@ -34,13 +54,14 @@ PREP(isInStableCondition); PREP(isMedic); PREP(isMedicalVehicle); PREP(leftStateCardiacArrest); -PREP(moduleMedicalSettings); PREP(moduleAssignMedicRoles); PREP(moduleAssignMedicalVehicle); +PREP(moduleMedicalSettings); PREP(serverRemoveBody); PREP(setCardiacArrest); PREP(setDead); PREP(setUnconscious); +PREP(setUnconsciousStatemachine); PREP(transitionSecondChance); PREP(updateHeartRate); PREP(updatePainSuppress); diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 98c1e6c45f..82f8321552 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -46,9 +46,9 @@ GVAR(STATE_MACHINE) = (configFile >> "ACE_Medical_StateMachine") call CBA_statem [ QGVAR(cardiacArrestTime), "SLIDER", - ["Cardiac Arrest Time", "Sets how long cardiac arrest will last for on average (in minutes)."], //@todo + ["Cardiac Arrest Time", "Sets how long cardiac arrest will last for on average (in seconds)."], //@todo "ACE Medical", // @todo - [0, 30, 2, 0], + [0, 300, 30, 0], true ] call CBA_Settings_fnc_init; */ diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index 6345e1fbd0..f04470b5be 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author = ECSTRING(common,ACETeam); - authors[] = {"Glowbal", "KoffeinFlummi"}; + authors[] = {"Glowbal", "KoffeinFlummi","Arcanum417"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; 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 4843dc3991..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 {}; - class IVBag_250ml: IVBagBase {}; - class IVBag_500ml: IVBagBase {}; - class IVBag_1000ml: IVBagBase {}; + 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_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_conditionCardiacArrestTimer.sqf b/addons/medical/functions/fnc_conditionCardiacArrestTimer.sqf index 58f5d4e47c..6e6354fd0c 100644 --- a/addons/medical/functions/fnc_conditionCardiacArrestTimer.sqf +++ b/addons/medical/functions/fnc_conditionCardiacArrestTimer.sqf @@ -16,4 +16,4 @@ params ["_unit"]; private _startTime = _unit getVariable [QGVAR(cardiacArrestStart), CBA_missionTime]; private _lifeTime = _unit getVariable [QGVAR(cardiacArrestTime), GVAR(cardiacArrestTime)]; -(CBA_missionTime - _startTime) > (_lifeTime * 60) +(CBA_missionTime - _startTime) > _lifeTime diff --git a/addons/medical/functions/fnc_dev_watchMedicalStats.sqf b/addons/medical/functions/fnc_dev_watchMedicalStats.sqf index b7de63c577..e5f1e483e1 100644 --- a/addons/medical/functions/fnc_dev_watchMedicalStats.sqf +++ b/addons/medical/functions/fnc_dev_watchMedicalStats.sqf @@ -22,20 +22,23 @@ private _unit = cursorTarget; if (!(_unit isKindOf "CAManBase")) then {_unit = cursorObject}; - if (!(_unit isKindOf "CAManBase")) then {_unit = player}; + if (!(_unit isKindOf "CAManBase")) then {_unit = ACE_player}; + if ((_unit != ACE_player) && {ACE_player getVariable ["ACE_isUnconscious", false]}) then {_unit = ACE_player}; if (!(_unit isKindOf "CAManBase")) exitWith {"No Unit?"}; private _return = []; // Header: - _return pushBack format ["%2 [%3]", (["00FF00", "0000FF"] select (_unit == player)), [_unit] call EFUNC(common,getName), typeOf _unit]; + _return pushBack format ["%2 [%3]", (["00FF00", "0000FF"] select (_unit == ACE_player)), [_unit] call EFUNC(common,getName), typeOf _unit]; _return pushBack ""; // State: private _hasStableVitals = [_unit] call EFUNC(medical,hasStableVitals); private _targetState = [_unit, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState; - private _color = switch (_targetState) do {case "Default": {"33FF33"}; case "Injured": {"FF3333"}; case "Unconscious": {"FF8833"}; case "CardiacArrest": {"FF33AA"}; default {"333333"}}; - _return pushBack format ["State: %2 [StableVitals: %3]", _color, _targetState, _hasStableVitals]; + if (!local _unit) then {_targetState = "NotLocal";}; + private _color = switch (_targetState) do {case "Default": {"33FF33"}; case "Injured": {"FF3333"}; case "Unconscious": {"FF8833"}; case "CardiacArrest": {"FF33AA"}; default {"555555"}}; + private _unconcFlag = if (_unit getVariable ["ACE_isUnconscious", false]) then {"[U]"} else {""}; + _return pushBack format ["State: %2 [StableVitals: %3] %4", _color, _targetState, _hasStableVitals, _unconcFlag]; // Blood: private _bloodVolume = _unit getVariable [QEGVAR(medical,bloodVolume), DEFAULT_BLOOD_VOLUME]; @@ -62,7 +65,7 @@ private _damage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; private _limping = if (_unit getVariable [QEGVAR(medical_engine,isLimping), false]) then {"[ Limping ]"} else {""}; _return pushBack format ["Damage: [H: %1] [B: %2] %3", (_damage select 0) toFixed 2, (_damage select 1) toFixed 2, _limping]; - _return pushBack format ["[LA:%1] [RA: %2] [LL:%1] [RL: %2]", (_damage select 2) toFixed 2, (_damage select 3) toFixed 2, (_damage select 4) toFixed 2, (_damage select 5) toFixed 2]; + _return pushBack format ["[LA:%1] [RA: %2] [LL:%3] [RL: %4]", (_damage select 2) toFixed 2, (_damage select 3) toFixed 2, (_damage select 4) toFixed 2, (_damage select 5) toFixed 2]; // Tourniquets: diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 79acfda96c..61c3e0d19d 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -7,9 +7,12 @@ * 1: Show (default: 0) * 2: Selection (default: 0) * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob, true, 2] call ACE_medical_fnc_displayPatientInformation + * * Public: No */ @@ -25,7 +28,6 @@ if (_show == 1) 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"]; diff --git a/addons/medical/functions/fnc_displayTriageCard.sqf b/addons/medical/functions/fnc_displayTriageCard.sqf index c9816bb8c8..1be467a5a6 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 */ @@ -16,7 +19,7 @@ params ["_target", ["_show", true]]; -GVAR(TriageCardTarget) = if (_show) then {_target} else {ObjNull}; +GVAR(TriageCardTarget) = [objNull, _target] select _show; if (_show) then { //("ACE_MedicalTriageCard" call BIS_fnc_rscLayer) cutRsc [QGVAR(triageCard),"PLAIN"]; @@ -29,7 +32,6 @@ if (_show) then { [_idPFH] call CBA_fnc_removePerFrameHandler; }; - disableSerialization; private _display = uiNamespace getVariable QGVAR(triageCard); if (isNil "_display") exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; @@ -55,7 +57,7 @@ if (_show) then { _triageCardTexts pushBack format["%1x - %2", _amount, _message]; } forEach _log; - if (count _triageCardTexts == 0) then { + if (_triageCardTexts isEqualTo []) then { _lbCtrl lbAdd (localize ELSTRING(medical,TriageCard_NoEntry)); }; { diff --git a/addons/medical/functions/fnc_getUnitState.sqf b/addons/medical/functions/fnc_getUnitState.sqf new file mode 100644 index 0000000000..6821124e32 --- /dev/null +++ b/addons/medical/functions/fnc_getUnitState.sqf @@ -0,0 +1,22 @@ +/* + * Author: Zakant + * Gets the name of the current medical state of an unit. Unit has to be local to the caller. + * + * Arguments: + * 0: The Unit + * + * Return Value: + * Name of the current medical state of the unit + * + * Example: + * [player] call ace_medical_fnc_getUnitState + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit"]; + +if (!local _unit) exitWith { ERROR("unit is not local"); }; + +[_unit, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState diff --git a/addons/medical/functions/fnc_handleInit.sqf b/addons/medical/functions/fnc_handleInit.sqf new file mode 100644 index 0000000000..3976525125 --- /dev/null +++ b/addons/medical/functions/fnc_handleInit.sqf @@ -0,0 +1,30 @@ +/* + * Author: KoffeinFlummi + * Called when a unit is initialized via XEH_init + * + * Arguments: + * 0: The Unit + * + * Return Value: + * None + * + * Example: + * [bob] call ACE_medical_fnc_handleInit + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +_unit setVariable [ + QGVAR(HandleDamageEHID), + _unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}] +]; + +if (local _unit) then { + if (!EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(init), [_unit]]; + }; + [_unit] call FUNC(init); +}; diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index 3e04ae7582..590cd7d2b3 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 7e1daf0423..4dab3a62da 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_handleRespawn.sqf b/addons/medical/functions/fnc_handleRespawn.sqf new file mode 100644 index 0000000000..45fddb7572 --- /dev/null +++ b/addons/medical/functions/fnc_handleRespawn.sqf @@ -0,0 +1,32 @@ +/* + * Author: KoffeinFlummi + * Called when a unit is Respawned + * + * Arguments: + * 0: The Unit + * + * Return Value: + * None + * + * Example: + * [bob] call ACE_medical_fnc_handleRespawn + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +// reset all variables. @todo GROUP respawn? +[_unit] call FUNC(init); + +// Reset captive status for respawning unit +if (!(_unit getVariable ["ACE_isUnconscious", false])) then { + [_unit, "setCaptive", "ace_unconscious", false] call EFUNC(common,statusEffect_set); +}; + +// Remove maximum unconsciousness time handler +_maxUnconHandle = _unit getVariable [QGVAR(maxUnconTimeHandle), -1]; +if (_maxUnconHandle > 0) then { + [_maxUnconHandle] call CBA_fnc_removePerFrameHandler; +}; diff --git a/addons/medical/functions/fnc_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_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_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf index 8c518ac37d..12d326ebfb 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 */ @@ -32,6 +35,8 @@ if !(_activated) exitWith {}; [_logic, QGVAR(playerDamageThreshold), "playerDamageThreshold"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(AIDamageThreshold), "AIDamageThreshold"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(fatalInjuryCondition), "fatalInjuryCondition"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(fatalInjuryConditionAI), "fatalInjuryConditionAI"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(unconsciousConditionAI), "unconsciousConditionAI"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(cardiacArrestTime), "cardiacArrestTime"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(medicSetting_PainVisualization), "painVisualization"] call EFUNC(common,readSettingFromModule); @@ -54,6 +59,8 @@ if !(_activated) exitWith {}; [_logic, QGVAR(ivFlowRate), "ivFlowRate"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowSelfIV), "allowSelfIV"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(spontaneousWakeUpChance), "spontaneousWakeUpChance"] call EFUNC(common,readSettingFromModule); + //[_logic, QGVAR(allowLitterCreation), "allowLitterCreation"] call EFUNC(common,readSettingFromModule); //[_logic, QGVAR(litterCleanUpDelay), "litterCleanUpDelay"] call EFUNC(common,readSettingFromModule); 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_setUnconsciousStatemachine.sqf b/addons/medical/functions/fnc_setUnconsciousStatemachine.sqf new file mode 100644 index 0000000000..0f2e367177 --- /dev/null +++ b/addons/medical/functions/fnc_setUnconsciousStatemachine.sqf @@ -0,0 +1,50 @@ +/* + * Author: Glowbal + * Sets a unit in the unconscious state. + * For Internal Use: Called from the state machine. + * + * Arguments: + * 0: The unit that will be put in an unconscious state + * 1: Set unconsciouns + * + * ReturnValue: + * Success? + * + * Example: + * [bob, true] call ace_medical_fnc_setUnconsciousStatemachine + * + * Public: No + */ +#define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["_unit", "_knockOut"]; +TRACE_2("setUnconsciousStatemachine",_unit,_knockOut); + +if (_knockOut isEqualTo (_unit getVariable ["ACE_isUnconscious", false])) exitWith {TRACE_1("No Change - Exiting",_knockOut);}; + +_unit setVariable ["ACE_isUnconscious", _knockOut, true]; +["ace_unconscious", [_unit, _knockOut]] call CBA_fnc_globalEvent; +[_unit, _knockOut] call EFUNC(medical_engine,setUnconsciousAnim); + + +if (_knockOut) then { + // --- knock out + if (GVAR(spontaneousWakeUpChance) > 0) then { // Don't bother setting this if not used + private _lastWakeUpCheck = CBA_missiontime max (_unit getVariable [QGVAR(lastWakeUpCheck), 0]); + TRACE_2("setting lastWakeUpCheck",_lastWakeUpCheck,(_lastWakeUpCheck - CBA_missiontime)); + _unit setVariable [QGVAR(lastWakeUpCheck), _lastWakeUpCheck]; + }; + + if (_unit == ACE_player) then { + if (visibleMap) then {openMap false}; + + while {dialog} do { + closeDialog 0; + }; + }; + [QGVAR(Unconscious), _unit] call CBA_fnc_localEvent; +} else { + // --- wake up + _unit setVariable [QGVAR(lastWakeUpCheck), nil]; // clear this now (min wait time could be set to a very high value) +}; diff --git a/addons/medical/functions/fnc_unconsciousPFH.sqf b/addons/medical/functions/fnc_unconsciousPFH.sqf new file mode 100644 index 0000000000..2f9d1a5522 --- /dev/null +++ b/addons/medical/functions/fnc_unconsciousPFH.sqf @@ -0,0 +1,146 @@ +/* + * Author: Glowbal + * PFH logic for unconscious state + * + * Arguments: + * 0: PFEH - + * 0: The unit that will be put in an unconscious state + * 1: unitPos (stance) + * 2: Starting Time + * 3: Minimum Waiting Time + * 4: Has Moved Out + * 5: Parachute Check + * 1: PFEH ID + * + * Return Value: + * None + * + * Example: + * [[unit,"pos", 5, 5, true, false], 5], "classname"] call ace_medical_fnc_unconsciousPFH + * + * Public: yes + */ + +#include "script_component.hpp" + +params ["_args", "_idPFH"]; +_args params ["_unit", "_originalPos", "_startingTime", "_minWaitingTime", "_hasMovedOut", "_parachuteCheck"]; + +TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _originalPos, _startingTime, _minWaitingTime, _hasMovedOut, _parachuteCheck); + +if (!alive _unit) exitWith { + if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then { + TRACE_1("Removing fake weapon [on death]",_unit); + _unit removeWeapon "ACE_FakePrimaryWeapon"; + }; + if (GVAR(moveUnitsFromGroupOnUnconscious)) then { + [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); + }; + [_unit, "setHidden", "ace_unconscious", false] call EFUNC(common,statusEffect_set); + [_unit, false] call EFUNC(common,disableAI); + //_unit setUnitPos _originalPos; + + [_unit, "isUnconscious"] call EFUNC(common,unmuteUnit); + ["ace_unconscious", [_unit, false]] call CBA_fnc_globalEvent; + + TRACE_3("ACE_DEBUG_Unconscious_Exit",_unit, (!alive _unit) , "ace_unconscious"); + + [_idPFH] call CBA_fnc_removePerFrameHandler; +}; + +// In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation +if !(_unit getVariable ["ACE_isUnconscious",false]) exitWith { + TRACE_7("ACE_DEBUG_Unconscious_PFH",_unit, _args, [_unit] call FUNC(isBeingCarried), [_unit] call FUNC(isBeingDragged), _idPFH, _unit getVariable QGVAR(unconsciousArguments),animationState _unit); + // TODO, handle this with carry instead, so we can remove the PFH here. + // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations + if !(([_unit] call FUNC(isBeingCarried)) || ([_unit] call FUNC(isBeingDragged))) then { + if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then { + TRACE_1("Removing fake weapon [on wakeup]",_unit); + _unit removeWeapon "ACE_FakePrimaryWeapon"; + }; + + if (vehicle _unit == _unit) then { + if (animationState _unit == "AinjPpneMstpSnonWrflDnon") then { + [_unit,"AinjPpneMstpSnonWrflDnon_rolltofront", 2] call EFUNC(common,doAnimation); + [_unit,"amovppnemstpsnonwnondnon", 1] call EFUNC(common,doAnimation); + } else { + [_unit,"amovppnemstpsnonwnondnon", 2] call EFUNC(common,doAnimation); + }; + } else { + 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; + }; + //Make sure we have a valid, non-terminal animation: + if ((_awakeInVehicleAnimation != "") && {(getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> _awakeInVehicleAnimation >> "terminal")) == 0}) then { + [_unit, _awakeInVehicleAnimation, 2] call EFUNC(common,doAnimation); + } else { + //Don't have a valid animation saved, reset the unit animation with a moveInXXX + TRACE_1("No Valid Animation, doing seat reset", _awakeInVehicleAnimation); + private _slotInfo = []; + {if ((_x select 0) == _unit) exitWith {_slotInfo = _x;};} forEach (fullCrew _vehicle); + if (_slotInfo isEqualTo []) exitWith {ERROR("No _slotInfo?");}; + //Move the unit out: + _unit setPosASL ((getPosASL _unit) vectorAdd [0,0,100]); + //Move the unit back into old seat: + if ((_slotInfo select 1) == "driver") then { + _unit moveInDriver _vehicle; + } else { + if ((_slotInfo select 1) == "cargo") then { + _unit moveInCargo [_vehicle, (_slotInfo select 2)]; + } else { + _unit moveInTurret [_vehicle, (_slotInfo select 3)]; + }; + }; + }; + }; + _unit setVariable [QGVAR(vehicleAwakeAnim), nil]; + + ["ace_unconscious", [_unit, false]] call CBA_fnc_globalEvent; + // EXIT PFH + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + if (!_hasMovedOut) then { + // Reset the unit back to the previous captive state. + [_unit, "setHidden", "ace_unconscious", false] call EFUNC(common,statusEffect_set); + + // Swhich the unit back to its original group + //Unconscious units shouldn't be put in another group #527: + if (GVAR(moveUnitsFromGroupOnUnconscious)) then { + [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); + }; + [_unit, false] call EFUNC(common,disableAI); + _unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP) + + _unit setUnconscious false; + + [_unit, "isUnconscious"] call EFUNC(common,unmuteUnit); + + // ensure this statement runs only once + _args set [4, true]; + }; +}; + +if (_parachuteCheck) then { + if !(vehicle _unit isKindOf "ParachuteBase") then { + [_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation); + _args set [5, false]; + }; +}; + +if (!local _unit) exitWith { + TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _args, _startingTime, _minWaitingTime, _idPFH, _unit getVariable QGVAR(unconsciousArguments)); + _args set [3, _minWaitingTime - (CBA_missionTime - _startingTime)]; + _unit setVariable [QGVAR(unconsciousArguments), _args, true]; + [_idPFH] call CBA_fnc_removePerFrameHandler; +}; + +// Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs +if ((CBA_missionTime - _startingTime) >= _minWaitingTime) exitWith { + TRACE_2("ACE_DEBUG_Unconscious_Temp knock outs",_unit, [_unit] call FUNC(getUnconsciousCondition)); + if (!([_unit] call FUNC(getUnconsciousCondition))) then { + _unit setVariable ["ACE_isUnconscious", false, true]; + }; +}; diff --git a/addons/medical/script_macros_medical.hpp b/addons/medical/script_macros_medical.hpp index 602b57b5a7..4c470077ba 100644 --- a/addons/medical/script_macros_medical.hpp +++ b/addons/medical/script_macros_medical.hpp @@ -1,6 +1,8 @@ #define ALL_BODY_PARTS ["head", "body", "leftarm", "rightarm", "leftleg", "rightleg"] +#define MEDICAL_ACTION_DISTANCE 1.75 + // scale received pain to 0-2 level to select type of scream // below 0.25: 0, from 0.25 to 0.5: 1, more than 0.5: 2 #define PAIN_TO_SCREAM(pain) (floor (4 * pain) min 2) @@ -45,7 +47,6 @@ #define PAIN_SUPPRESSION_FADE_TIME 1800 // Chance to wake up when vitals are stable (checked once every SPONTANEOUS_WAKE_UP_INTERVAL seconds) -#define SPONTANEOUS_WAKE_UP_CHANCE 0.2 #define SPONTANEOUS_WAKE_UP_INTERVAL 15 #define LETHAL_HEAD_DAMAGE_THRESHOLD 1.0 diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 3fbe015919..f359b24515 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -4,7 +4,7 @@ INJURIES VERLETZUNGEN - LESIONI + FERITE ТРАВМЫ BLESSURES OBRAŻENIA @@ -14,11 +14,13 @@ FERIMENTOS 負傷 부상 + 受伤 + 受傷 No injuries on this bodypart... Körperteil nicht verletzt... - Non ci sono lesioni in questa parte del corpo... + Non ci sono ferite in questa parte del corpo... Данная часть тела не повреждена... Aucune blessures sur cette partie du corps... Brak obrażeń na tej części ciała... @@ -26,8 +28,42 @@ 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 + Detale zużytych medykamentów + Detalle de simulación de basura + Количество мусора от медицины + Dettagli Simulazione Rifiuti + Niveau de simulation des détritus + Abfall-Detaillevel + Hulladékszimuláció részletessége + 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. + Opcja ta ustawia liczbę zużytych medykamentów, jakie pojawiają się lokalnie wokół gracza. Ich zbyt duża ilość może spowodować spadki FPS, dlatego jest to ustawienie tylko po stronie klienta. + Detalle simulación de basura establece el número de artículos de basura que se generan a nivel local en el cliente. Las cantidades excesivas en áreas locales podrían causar caída de rendimiento, así que esto es un ajuste de cliente únicamente. + Устанавливает количество мусора, который появляется после использования мед. препаратов. Большое количество мусора может уменьшить производительность, поэтому данная настройка локальна для клиента. + Il numero di rifiuti che verranno creati localmente. La creazione di troppi rifiuti in aree locali potrebbe causare lag e calo di FPS. Questo è un settaggio lato client. + Le niveau de simulation des détritus règle la quantité de déchets qui vont être créés localement chez le client. Des quantitées excessive chez certains clients peuvent causer des chutes de FPS, c'est donc une option client uniquement. + Die Einstellung für das Abfall-Detaillevel stellt die Menge des lokal angezeigten medizinischen Abfalls ein. Zuviel Abfall kann FPS-Einbrüche erzeugen, weswegen diese Einstellung nur clientseitig ist. + A hulladékszimuláció részletessége megszabja a kliens által megjelenített hulladékobjektumok mennyiségét. Súlyos mennyiségek izolált területeken alacsony FPS-t okozhatnak, így ez egy kliensoldali beállítás. + 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 @@ -41,6 +77,8 @@ Ввести аденозин アデノシンを投与 아데노신 주사 + 注射腺苷 + 注射腺苷 Inject Atropine @@ -55,6 +93,8 @@ Injetar Atropina アトロピンを投与 아트로핀 주사 + 注射阿托品 + 注射阿托品 Inject Epinephrine @@ -69,6 +109,8 @@ Inietta adrenalina アドレナリンを投与 에피네프린 주사 + 注射肾上腺素 + 注射腎上腺素 Inject Morphine @@ -83,6 +125,8 @@ Inietta morfina モルヒネを投与 모르핀 주사 + 注射吗啡 + 注射嗎啡 Transfuse Blood @@ -97,6 +141,8 @@ Trasfusione di sangue 輸血する 혈액 수혈 + 输血液 + 輸血液 Transfuse Plasma @@ -111,6 +157,8 @@ Transfundir Plasma 血しょうを投与 혈장 수혈 + 输血浆 + 輸血漿 Transfuse Saline @@ -125,6 +173,8 @@ Transfundir Soro 生理食塩水を投与 생리식염수 수혈 + 注射生理食盐水 + 注射生理食鹽水 Apply Tourniquet @@ -139,6 +189,8 @@ Érszorító alkalmazása 止血帯を巻く 지혈대 적용 + 使用军用止血带 + 使用軍用止血帶 Bandage @@ -153,6 +205,8 @@ Перевязать 包帯 붕대 + 绷带 + 繃帶 Bandage Head @@ -167,6 +221,8 @@ Benda la testa 包帯を頭へ 머리에 붕대감기 + 绷带包扎 头部 + 繃帶包紮 頭部 Bandage Torso @@ -181,6 +237,8 @@ Benda il torso 包帯を胴体へ 몸통에 붕대감기 + 绷带包扎 身体 + 繃帶包紮 身體 Bandage Left Arm @@ -195,6 +253,8 @@ Benda il braccio sinistro 包帯を左腕に 왼팔에 붕대감기 + 绷带包扎 左手 + 繃帶包紮 左手 Bandage Right Arm @@ -209,6 +269,8 @@ Benda il braccio destro 包帯を右腕に 오른팔에 붕대감기 + 绷带包扎 右手 + 繃帶包紮 右手 Bandage Left Leg @@ -223,6 +285,8 @@ Benda la gamba sinistra 包帯を左足へ 왼쪽 다리에 붕대감기 + 绷带包扎 左脚 + 繃帶包紮 左腳 Bandage Right Leg @@ -237,6 +301,8 @@ Benda la gamba destra 包帯を右足へ 오른쪽 다리에 붕대감기 + 绷带包扎 右脚 + 繃帶包紮 右腳 Injecting Morphine... @@ -249,8 +315,10 @@ Morfium beadása... Injetando Morfina... Inietto la morfina... - モルヒネを投与中・・・ + モルヒネを投与しています・・・ 모르핀 주사중... + 吗啡注射中... + 嗎啡注射中... Injecting Epinephrine... @@ -263,8 +331,10 @@ Epinefrin beadása... Injetando Epinefrina... Inietto l'adrenalina... - アドレナリンを投与中・・・ + アドレナリンを投与しています・・・ 에피네프린 주사중... + 肾上腺素注射中... + 腎上腺素注射中... Injecting Adenosine... @@ -276,8 +346,10 @@ Aplikuji adenosine... Injetando Adenosina... Введение аденозина... - アドネシンを投与中・・・ + アドネシンを投与しています・・・ 아데노신 주사중... + 腺苷注射中... + 腺苷注射中... Injecting Atropine... @@ -290,8 +362,10 @@ Atropin beadása... Inietto l'atropina... Injetando Atropina - アトロピンを投与中・・・ + アトロピンを投与しています・・・ 아트리핀 주사중... + 阿托品注射中 ... + 阿托品注射中 ... Transfusing Blood... @@ -304,8 +378,10 @@ Infúzió vérrel... Transfundindo Sangue... Effettuo la trasfusione di sangue... - 輸血中・・・ + 輸血しています・・・ 혈액 수혈중... + 输血液中 ... + 輸血液中 ... Transfusing Saline... @@ -318,8 +394,10 @@ Infúzió sós vizzel... Effettuo la rasfusione di soluzione salina Transfundindo Soro... - 血しょうを投与中・・・ + 生理食塩水を投与しています・・・ 생리식염수 수혈중... + 施打生理食盐水中 ... + 施打生理食鹽水中 ... Transfusing Plasma... @@ -332,8 +410,10 @@ Infúzió vérplazmával... Effettu la trasfusione di plasma... Transfundindo Plasma... - 生理食塩水を投与中・・・ + 血しょうを投与しています・・・ 혈장 수혈중... + 输血浆中 ... + 輸血漿中 ... Bandaging... @@ -348,6 +428,8 @@ Перевязывание... 包帯を巻いています・・・ 붕대감는중... + 绷带包扎中 ... + 繃帶包紮中 ... Applying Tourniquet... @@ -362,6 +444,8 @@ Applicando Torniquete 止血帯を巻いています・・・ 지혈대 적용중... + 使用军用止血带中 ... + 使用軍用止血帶中 ... Medical @@ -376,6 +460,8 @@ Orvosi 治療 치료 + 医疗 + 醫療 Field Dressing @@ -390,6 +476,8 @@ Curativo de Campo 緊急圧迫包帯 필드 드레싱 + 基础绷带 + 基礎繃帶 Packing Bandage @@ -404,6 +492,8 @@ Obvaz Tlakový 弾性包帯 거즈 붕대 + 包扎绷带 + 包紮繃帶 Elastic Bandage @@ -418,6 +508,8 @@ Bandagem Elástica 伸縮包帯 압박 붕대 + 弹性绷带 + 彈性繃帶 QuikClot @@ -432,6 +524,8 @@ QuikClot クイッククロット 퀵 클롯 + 止血粉 + 止血粉 Check Pulse @@ -446,6 +540,8 @@ Checar Pulso 心拍数をはかる 맥박 확인 + 检查脉搏 + 檢查脈搏 Check Blood Pressure @@ -460,6 +556,8 @@ Chegar Pressão Sanguínea 血圧をはかる 혈압 확인 + 检查血压 + 檢查血壓 Triage Card @@ -474,6 +572,8 @@ Cartão de Triagem トリアージ カード 부상자 분류 카드 + 检伤分类卡 + 檢傷分類卡 No entries on this triage card. @@ -486,8 +586,10 @@ Ez az orvosi lap nem tartalmaz bejegyzést. Žádné záznamy na tomto štítku Nenhuma entrada neste cartão de triagem - トリアージ カードには何も無い + トリアージ カードには何も無い。 부상자 분류 카드에 쓰여있는것이 없습니다. + 此检伤分类卡上没有任何资料 + 此檢傷分類卡上沒有任何資料 Tourniquet @@ -502,6 +604,8 @@ Torniquete 止血帯 지혈대 + 军用止血带 + 軍用止血帶 Remove Tourniquet @@ -516,6 +620,8 @@ Remover Torniquete 止血帯をはずす 지혈대 제거 + 移除军用止血带 + 移除軍用止血帶 Diagnose @@ -530,6 +636,8 @@ Diagnosticar 診断する 진단 + 诊断 + 診斷 Diagnosing... @@ -542,8 +650,10 @@ Diagnózis folyamatban... Diagnostika... Diagnosticando... - 診断中・・・ + 診断しています・・・ 진단중... + 诊断中... + 診斷中... CPR @@ -558,6 +668,8 @@ SBV 心肺蘇生 심폐소생술 + 心肺复苏术 + 心肺復甦術 Performing CPR... @@ -570,8 +682,10 @@ Újraélesztés folyamatban... Provádím CPR... Realizando o SBV... - 心肺蘇生を実行中・・・ + 心肺蘇生をしています・・・ 심폐소생중... + 进行心肺复苏术中... + 進行心肺復甦術中... Give Blood IV (1000ml) @@ -586,6 +700,8 @@ Administrar Sangue IV (1000ml) 血液 IV (1000ml) をあたえる IV 혈액 수혈 (1000ml) + 输血液 (1000ml) + 輸血液 (1000ml) Give Blood IV (500ml) @@ -600,6 +716,8 @@ Administrar Sangue IV (500ml) 血液 IV (500ml) をあたえる IV 혈액 수혈 (500ml) + 输血液 (500ml) + 輸血液 (500ml) Give Blood IV (250ml) @@ -614,6 +732,8 @@ Administrar Sangue IV (250ml) 血液 IV (250ml) をあたえる IV 혈액 수혈 (250ml) + 输血液 (250ml) + 輸血液 (250ml) Give Plasma IV (1000ml) @@ -628,6 +748,8 @@ Administrar Plasma IV (1000ml) 血しょう IV (1000ml) をあたえる IV 혈장 수혈 (1000ml) + 输血浆 (1000ml) + 輸血漿 (1000ml) Give Plasma IV (500ml) @@ -642,6 +764,8 @@ Administrar Plasma IV (500ml) 血しょう IV (500ml) をあたえる IV 혈장 수혈 (500ml) + 输血浆 (500ml) + 輸血漿 (500ml) Give Plasma IV (250ml) @@ -656,6 +780,8 @@ Administrar Plasma IV (250ml) 血しょう IV (250ml) をあたえる IV 혈장 수혈 (250ml) + 输血浆 (250ml) + 輸血漿 (250ml) Give Saline IV (1000ml) @@ -668,8 +794,10 @@ 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) @@ -682,8 +810,10 @@ 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) @@ -696,8 +826,10 @@ 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 @@ -712,6 +844,8 @@ Leve 保留群 경미 + 轻微 + 輕微 Delayed @@ -726,6 +860,8 @@ Atrasado 待機的治療群 늦어짐 + 延后 + 延後 Immediate @@ -740,6 +876,8 @@ Imediato 再優先治療群 긴급 + 紧急 + 緊急 Deceased @@ -754,6 +892,8 @@ Falecido 死亡群 사망 + 死亡 + 死亡 None @@ -768,6 +908,8 @@ Nenhum なし 없음 + 未分类 + 未分類 Normal breathing @@ -782,6 +924,8 @@ Respiração normal 通常の呼吸 정상 호흡 + 呼吸正常 + 呼吸正常 No breathing @@ -796,6 +940,8 @@ Não respira 息をしていない 호흡 불가 + 没有呼吸 + 沒有呼吸 Difficult breathing @@ -810,6 +956,8 @@ Dificuldade para respirar 呼吸が苦しそうだ 호흡 곤란 + 呼吸困难 + 呼吸困難 Almost no breathing @@ -824,6 +972,8 @@ Quase não respira ほとんど呼吸をしていない 호흡이 없음 + 快要没呼吸 + 快要沒呼吸 Bleeding @@ -838,6 +988,8 @@ Sangrando 出血している 출혈 + 流血中 + 流血中 In mild pain @@ -856,6 +1008,8 @@ Com dor 痛みがある 고통 + 疼痛中 + 疼痛中 In severe pain @@ -872,8 +1026,10 @@ Sok vért vesztett Ha perso parecchio sangue Perdeu muito sangue - 大量出血している + 大量失血している 많은 양의 혈액을 잃음 + 大量失血中 + 大量失血中 Tourniquet [CAT] @@ -888,6 +1044,8 @@ Torniquete [CAT] 止血帯 [CAT] 지혈대 [CAT] + 军用止血带 + 軍用止血帶 Receiving IV [%1ml] @@ -902,6 +1060,8 @@ Recebendo IV [%1ml] IV [%1ml] を投与されている IV로 [%1ml] 수혈중 + 接收静脉注射液中 [%1ml] + 接收靜脈注射液中 [%1ml] Bandage (Basic) @@ -916,6 +1076,8 @@ Bandagem(Básico) 包帯 (緊急圧迫) 붕대 (기본) + 基础绷带 + 基礎繃帶 Used to cover a wound @@ -930,6 +1092,8 @@ 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. @@ -942,8 +1106,10 @@ 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 @@ -958,6 +1124,8 @@ Obvaz (Tlakový) 弾性包帯 거즈 붕대 + 包扎绷带 + 包紮繃帶 Used to pack medium to large wounds and stem the bleeding @@ -972,6 +1140,8 @@ 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. @@ -986,6 +1156,8 @@ 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) @@ -1000,6 +1172,8 @@ Bandagem (Elástica) 包帯 (伸縮) 붕대 (압박) + 弹性绷带 + 彈性繃帶 Bandage kit, Elastic @@ -1014,6 +1188,8 @@ Sada obvazů, Elastická 包帯キット (伸縮) 붕대, 압박 + 弹性绷带 + 彈性繃帶 Allows an even compression and extra support to the injured area. @@ -1028,6 +1204,8 @@ Hodí se k fixačním účelům a to i v oblastech kloubů. 負傷部分へ最大の対応と止血を続けられます。 부상 부위를 골고루 압박해주면서 동시에 고정시켜 줍니다. + 可对伤口持续压迫并固定以防止伤口情况变严重 + 可對傷口持續壓迫並固定以防止傷口情況變嚴重 Tourniquet (CAT) @@ -1042,6 +1220,8 @@ Torniquete (CAT) 止血帯 (CAT) 지혈대 [CAT] + 军用止血带 + 軍用止血帶 Slows down blood loss when bleeding @@ -1056,6 +1236,8 @@ 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. @@ -1070,6 +1252,8 @@ 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 @@ -1082,8 +1266,10 @@ Morfium autoinjektor Autoiniettore di morfina Auto-injetor de morfina - モルヒネ + モルヒネ注射器 모르핀 자동주사기 + 吗啡自动注射器 + 嗎啡自動注射器 Used to combat moderate to severe pain experiences @@ -1098,6 +1284,8 @@ Slouží k tlumení středně těžkých a těžkých bolestí 戦闘が収まったとき、痛みにたいしてつかいます。 심한 통증을 완화하는데 쓰입니다 + 减低中度至重度的疼痛感 + 減低中度至重度的疼痛感 An analgesic used to combat moderate to severe pain experiences. @@ -1112,6 +1300,8 @@ Analgetikum slouží k tlumení středně těžkých a těžkých bolestí 戦闘が収まったとき、モルヒネを痛みにたいしてつかいます。 심한 통증을 완화하기 위해 쓰이는 진통제입니다. + 止痛药的一种, 用于减低中度至重度的疼痛感 + 止痛藥的一種, 用於減低中度至重度的疼痛感 Adenosine autoinjector @@ -1123,8 +1313,10 @@ Auto-adenosine Auto-injetor de Adenosina Аденозин в пневмошприце - アデノシン + アデノシン注射器 아데노신 자동주사기 + 腺苷自动注射器 + 腺苷自動注射器 Used to counter effects of Epinephrine @@ -1138,6 +1330,8 @@ Используется для купирования эффектов адреналина アドレナリンの反対の効果としてつかいます。 에피네프린 대응책으로 쓰입니다 + 用来对付肾上腺素的影响 + 用來對付腎上腺素的影響 A drug used to counter the effects of Epinephrine @@ -1151,6 +1345,8 @@ Препарат используется для купирования эффектов адреналина つかうと、アドレナリンと反対の効果がでます。 에피네프린에 대응용으로 쓰이는 약품 + 一种药物用于减低肾上腺素的效果 + 一種藥物用於減低腎上腺素的效果 Atropine autoinjector @@ -1163,8 +1359,10 @@ Atropin autoinjektor Autoiniettore di atropina Auto-injetor de Atropina - アトロピン + アトロピン注射器 아트로핀 자동주사기 + 阿托品自动注射器 + 阿托品自動注射器 Used in NBC scenarios @@ -1179,6 +1377,8 @@ Používá se v přítomnosti nervových plynů 核・生物・化学兵器がつかわれている条件下にてつかいます。 핵,생물,화학 상황에 쓰입니다 + 使用于核生化污染的情况 + 使用於核生化汙染的情況 A drug used by the Military in NBC scenarios. @@ -1193,6 +1393,8 @@ Atropin slouží jako protijed na otravu organofosfátovými insekticidy (diazinon) a nervovými plyny. 核・生物・化学兵器がつかわれている条件下にてつかいます。 핵,생물,화학 상황에 쓰이는 군용 약품 + 军用神经解毒针, 用来应付核生化污染的情况. + 軍用神經解毒針, 用來應付核生化汙染的情況. Epinephrine autoinjector @@ -1205,8 +1407,10 @@ Epinefrin autoinjektor Autoiniettore di adrenalina Auto-injetor de epinefrina - アドレナリン + アドレナリン注射器 에피네프린 자동주사기 + 肾上腺素自动注射器 + 腎上腺素自動注射器 Increase heart rate and counter effects given by allergic reactions @@ -1221,6 +1425,8 @@ 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. @@ -1235,6 +1441,8 @@ 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) @@ -1247,8 +1455,10 @@ Plasma EV (1000ml) Plasma IV (1000ml) Krevní plazma (1000ml) - 生理食塩水 IV (1000ml) + 血しょう IV (1000ml) 혈장 IV (250ml) + 血浆 (1000ml) + 血漿 (1000ml) A volume-expanding blood supplement. @@ -1263,6 +1473,8 @@ Intravenózně podávaný doplněk k zvětšení objemu krve 血液量を増加させる補助です。 혈액량을 늘리기위한 보조수단 입니다. + 可快速得到血液补充 + 可快速得到血液補充 A volume-expanding blood supplement. @@ -1277,6 +1489,8 @@ Intravenózně podávaný doplněk k zvětšení objemu krve 血液量を増加させる補助です。 혈액량을 늘리기위한 보조수단 입니다. + 可快速得到血液补充 + 可快速得到血液補充 Plasma IV (500ml) @@ -1289,8 +1503,10 @@ Plasma EV (500ml) Plasma IV (500ml) Krevní plazma (500ml) - 生理食塩水 IV (500ml) + 血しょう IV (500ml) 혈장 IV (500ml) + 血浆 (500ml) + 血漿 (500ml) Plasma IV (250ml) @@ -1303,8 +1519,10 @@ Plasma EV (250ml) Plasma IV (250ml) Krevní plazma (250ml) - 生理食塩水 IV (250ml) + 血しょう IV (250ml) 혈장 IV (250ml) + 血浆 (250ml) + 血漿 (250ml) Blood IV (1000ml) @@ -1319,6 +1537,8 @@ Krevní transfúze (1000ml) 血液 IV (1000ml) 혈액 IV (1000ml) + 血液 (1000ml) + 血液 (1000ml) Blood IV, for restoring a patients blood (keep cold) @@ -1333,6 +1553,8 @@ Krevní transfuze pro doplnění pacientovi krve (skladujte v chladu) 血液 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. @@ -1347,6 +1569,8 @@ 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) @@ -1361,6 +1585,8 @@ Krevní transfúze (500ml) 血液 IV (500ml) 혈액 IV (500ml) + 血液 (500ml) + 血液 (500ml) Blood IV (250ml) @@ -1375,6 +1601,8 @@ Krevní transfúze (250ml) 血液 IV (250ml) 혈액 IV (250ml) + 血液 (250ml) + 血液 (250ml) Saline IV (1000ml) @@ -1389,6 +1617,8 @@ Fyziologický roztok (1000ml) 生理食塩水 IV (1000ml) 생리식염수 IV (1000ml) + 生理食盐水 (1000ml) + 生理食鹽水 (1000ml) Saline IV, for restoring a patients blood @@ -1403,6 +1633,8 @@ 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. @@ -1417,6 +1649,8 @@ Fyziologický roztok se využívá nejčastěji jako infuze při dehydrataci organismu. 生理食塩水 IV を静脈へ投与し、血液量を増加させることができます。 혈류에 IV로 투여되는 의료 용적 대체 요법 + 利用静脉注射进入人体血液系统, 帮助伤者血液恢复 + 利用靜脈注射進入人體血液系統, 幫助傷者血液恢復 Saline IV (500ml) @@ -1431,6 +1665,8 @@ Fyziologický roztok (500ml) 生理食塩水 IV (500ml) 생리식염수 IV (500ml) + 生理食盐水 (500ml) + 生理食鹽水 (500ml) Saline IV (250ml) @@ -1445,6 +1681,8 @@ Fyziologický roztok (250ml) 生理食塩水 IV (250ml) 생리식염수 IV (250ml) + 生理食盐水 (250ml) + 生理食鹽水 (250ml) Basic Field Dressing (QuikClot) @@ -1459,6 +1697,8 @@ Hemostatický obvaz (QuikClot) 緊急圧迫止血包帯 (クイッククロット) 필드 드레싱 (퀵 클롯) + 基本战地包扎 (止血粉) + 基本戰地包紮 (止血粉) QuikClot bandage @@ -1473,6 +1713,8 @@ Hemostatický obvaz (QuikClot) クイッククロット 퀵 클롯 붕대 + 止血粉绷带 + 止血粉繃帶 Hemostatic bandage with coagulant that stops bleeding. @@ -1487,6 +1729,8 @@ Hemostatický obvaz určený k zástavě krvácení 血液凝固剤をふくむ包帯により、止血できます。 지혈시 사용하는 붕대로 혈액 응고제를 포함하고있습니다. + 包含止血粉成分的止血绷带, 可用于止血 + 包含止血粉成分的止血繃帶, 可用於止血 Medkit @@ -1513,6 +1757,8 @@ Osobní lékárnička (PAK) 応急処置キット 개인응급키트 + 个人急救包 + 個人急救包 Includes various treatment kit needed for stitching or advanced treatment @@ -1527,6 +1773,8 @@ 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 @@ -1541,6 +1789,8 @@ Pronto soccorso personale da campo per mettersi i punti o per trattamenti avanzati. 戦場で縫合や高度な処置に必要とされる、さまざまな治療器具が含まれています。 야전에서 봉합및 고급 조치를 위한 개인응급키트 + 个人急救包可用于战地缝合手术或进阶伤口系统使用 + 個人急救包可用於戰地縫合手術或進階傷口系統使用 Use Personal Aid Kit @@ -1555,6 +1805,8 @@ Usa il pronto soccorso personale 応急処置キットをつかう 개인 응급 키트사용하기 + 使用个人急救包 + 使用個人急救包 Surgical Kit @@ -1569,6 +1821,8 @@ Chirurgická sada 縫合キット 봉합 키트 + 手术包 + 手術包 Surgical Kit for in field advanced medical treatment @@ -1583,6 +1837,8 @@ Chirurgická sada určená k pokročilejším zdravotnickým zákrokům v poli 縫合キットは戦場で高度な処置をするためにつかわれます。 야전 상황에서 고급 의료 처치를 위해 사용되는 봉합 키트 + 用于在战场上为伤口进行缝合(需要开启进阶伤口系统) + 用於在戰場上為傷口進行縫合(需要開啟進階傷口系統) Surgical Kit for in field advanced medical treatment @@ -1597,6 +1853,8 @@ Chirurgická sada určená k pokročilejším zdravotnickým zákrokům v poli 縫合キットは戦場で高度な処置をするためにつかわれます。 야전 상황에서 고급 의료 처치를 위해 사용되는 봉합 키트 + 用于在战场上为伤口进行缝合(需要开启进阶伤口系统) + 用於在戰場上為傷口進行縫合(需要開啟進階傷口系統) Use Surgical Kit @@ -1611,6 +1869,8 @@ Usar kit cirúrgico 縫合キットをつかう 봉합키트 사용하기 + 使用手术包 + 使用手術包 Bodybag @@ -1625,6 +1885,8 @@ Pytel na mrtvoly 死体袋 시체 가방 + 尸袋 + 屍袋 A bodybag for dead bodies @@ -1639,6 +1901,8 @@ Pytel na mrtvoly 死体袋は死体を入れるためにつかいます 시체를 운반할때 쓰는 가방입니다 + 用来装尸体用 + 用來裝屍體用 A bodybag for dead bodies @@ -1653,6 +1917,8 @@ Pytel na mrtvoly 死体袋は死体を入れるためにつかいます 시체를 운반할때 쓰는 가방입니다 + 用来装尸体用 + 用來裝屍體用 Blood Pressure @@ -1667,6 +1933,8 @@ Krevní tlak 血圧を測る 혈압 + 血压 + 血壓 Checking Blood Pressure.. @@ -1679,8 +1947,10 @@ Controllando la pressione sanguigna.. Aferindo Pressão Arterial... Měřím krevní tlak... - 血圧を測定中・・・ + 血圧を測定しています・・・ 혈압 측정증... + 检查血压中... + 檢查血壓中... %1 checked Blood Pressure: %2 @@ -1695,6 +1965,8 @@ %1 verificou pressão arterial: %2 %1 が測った血圧は: %2 %1 (이)가 혈압을 측정했습니다: %2 + 已由%1确认血压: %2 + 已由%1確認血壓: %2 You checked %1 @@ -1709,6 +1981,8 @@ Zkontroloval jsi %1 自分の血圧は %1 나의 혈압은 %1 이다 + 你已经检查 %1 + 你已經檢查 %1 You find a blood pressure of %2/%3 @@ -1723,6 +1997,8 @@ Naměřil si krevní tlak u %2/%3 血圧は %2/%3 혈압이 %2/%3 이다 + 血压为%2/%3 + 血壓為%2/%3 You find a low blood pressure @@ -1737,6 +2013,8 @@ Naměřil si nízký krevní tlak 血圧はかなり低い 혈압이 매우 낮다 + 发现到低血压 + 發現到低血壓 You find a normal blood pressure @@ -1751,6 +2029,8 @@ Naměřil si normální krevní tlak 血圧は通常 혈압이 정상이다 + 发现到正常血压 + 發現到正常血壓 You find a high blood pressure @@ -1765,6 +2045,8 @@ Naměřil si vysoký krevní tlak 血圧はかなり高い 혈압이 매우 높다 + 发现到高血压 + 發現到高血壓 You find no blood pressure @@ -1779,6 +2061,8 @@ Nenaměřil si žádný krevní tlak 血圧は測れなかった 혈압이 잡히지 않는다 + 量不到血压 + 量不到血壓 You fail to find a blood pressure @@ -1793,6 +2077,8 @@ Nedokázal si změřit krevní tlak 血圧を測るのに失敗 혈압을 잡을 수 없었다 + 检查血压的动作失败 + 檢查血壓的動作失敗 Low @@ -1807,6 +2093,8 @@ Baixa 低い 낮음 + + Normal @@ -1821,6 +2109,8 @@ Normal 通常 보통 + 正常 + 正常 High @@ -1835,6 +2125,8 @@ Alta 高い 높음 + + No Blood Pressure @@ -1849,6 +2141,8 @@ Sem pressão arterial 血圧なし 혈압 없음 + 无血压 + 無血壓 Pulse @@ -1863,6 +2157,8 @@ Puls 心拍数 맥박 + 脉搏 + 脈搏 Checking Heart Rate... @@ -1875,8 +2171,10 @@ Controllando il battito cardiaco... Aferindo Pulso... Kontroluji srdeční tep... - 心拍数を測定中・・・ + 心拍数を測定しています・・・ 맥박 확인중... + 检查心跳中... + 檢查心跳中... You checked %1 @@ -1891,6 +2189,8 @@ Zkontroloval si %1 心拍数は %1 나의 맥박은 %1 이다 + 你已经检查 %1 + 你已經檢查 %1 %1 checked Heart Rate: %2 @@ -1905,6 +2205,8 @@ %1 verificou a frequência cardíaca: %2 %1 が測った心拍数は: %2 %1 (이)가 맥박을 측정했습니다: %2 + 已由%1确认心跳: %2 + 已由%1確認心跳: %2 None @@ -1919,6 +2221,8 @@ Niente なし 없음 + + Weak @@ -1933,6 +2237,8 @@ Fraca 弱い 약함 + 微弱 + 微弱 Normal @@ -1947,6 +2253,8 @@ Normal 通常 보통 + 正常 + 正常 Strong @@ -1961,6 +2269,8 @@ Forte 強い 강함 + 过快 + 過快 You find a Heart Rate of %2 @@ -1975,6 +2285,8 @@ Nahmatal jsi srdeční tep u %2 心拍数は %2 맥박이 %2 이다 + 心跳为%2 + 心跳為%2 You find a weak Heart Rate @@ -1989,6 +2301,8 @@ Nahmatal si slabý srdeční puls 自分の心拍数は低い 약한 맥박이다 + 心跳微弱 + 心跳微弱 You find a strong Heart Rate @@ -2003,6 +2317,8 @@ Nahmatal si silný srdeční puls 自分の心拍数は強い 강한 맥박이다 + 心跳过快 + 心跳過快 You find a normal Heart Rate @@ -2017,6 +2333,8 @@ Nahmatal si normální srdeční puls 自分の心拍数は通常 보통 맥박이다 + 心跳正常 + 心跳正常 You find no Heart Rate @@ -2031,6 +2349,8 @@ Žádný puls 心拍数を測れなかった 맥박을 찾을 수가 없다 + 量不到心跳 + 量不到心跳 Response @@ -2045,6 +2365,8 @@ Odezva 反応を見る 반응 + 反应 + 反應 You check response of patient @@ -2059,6 +2381,8 @@ Zkontroloval jsi reakci pacienta 患者からの反応をみる 대상의 반응 확인중 + 检查伤者的反应 + 檢查傷者的反應 %1 is responsive @@ -2073,6 +2397,8 @@ %1 odpovídá %1 は反応あり %1 은 반응이있다 + %1 有反应 + %1 有反應 %1 is not responsive @@ -2087,6 +2413,8 @@ %1 neodpovídá %1 の反応なし %1 은 반응이없다 + %1 没有反应 + %1 沒有反應 You checked %1 @@ -2101,6 +2429,8 @@ Zkontroloval jsi %1 %1 を見た %1 을 확인함 + 你已经检查 %1 + 你已經檢查 %1 Patient %1<br/>is %2.<br/>%3.<br/>%4 @@ -2113,8 +2443,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<br/>は %2.<br/>%3.<br/>%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 @@ -2129,6 +2461,8 @@ vivo 生存 생존 + 活着 + 活著 dead @@ -2143,6 +2477,8 @@ morto 死亡 사망 + 死亡 + 死亡 He's lost some blood @@ -2157,6 +2493,8 @@ Ele perdeu um pouco de sangue 彼は出血している 적은 양의 피를 잃었다 + 他流失一些血液 + 他流失一些血液 He's lost a lot of blood @@ -2169,8 +2507,10 @@ Ztratil hodně krve Ele perdeu muito sangue Ha perso molto sangue - 彼は大量出血している + 彼は大量失血している 많은 양의 피를 잃었다 + 他流失大量血液 + 他流失大量血液 He hasn't lost blood @@ -2183,8 +2523,10 @@ Nem vesztett vért Neztratil žádnou krev Ele não perdeu sangue - 彼は出血していない + 彼は失血していない 피를 잃지 않았다 + 他并没有失血 + 他並沒有失血 He is in pain @@ -2199,6 +2541,8 @@ Ele está com dor 彼には痛みがあるようだ 통증이 있다 + 他感到疼痛 + 他感到疼痛 He is not in pain @@ -2213,6 +2557,8 @@ Ele não está com dor 彼には痛みがないようだ 통증이 없다 + 他不会疼痛 + 他不會疼痛 Bandaged @@ -2227,6 +2573,8 @@ Obvázaný 包帯 붕대 감음 + 绷带 + 繃帶 You bandage %1 (%2) @@ -2241,6 +2589,8 @@ Obvazuješ %1 (%2) %1 (%2) 包帯をつかった %1 (%2) 붕대를 감았다 + 你正在对 %1 (%2) 包扎绷带中 + 你正在對 %1 (%2) 包紮繃帶中 %1 is bandaging you @@ -2253,8 +2603,10 @@ %1 verbindet dich %1 está aplicando uma bandagem em você %1 tě obvazuje - %1 は自分に包帯を巻いている + %1 はあなたに包帯を巻いている %1 (이)가 나에게 붕대를 감고있다 + %1 正在对你包扎绷带中 + %1 正在對你包紮繃帶中 You start stitching injuries from %1 (%2) @@ -2269,6 +2621,8 @@ Zašíváš rány %1 (%2) あなたは %1 (%2) の外傷へ縫合をはじめた 나는 %1(%2) 상처로부터 봉합을 시작했다 + 你正开始对 %1 (%2) 缝合伤口中 + 你正開始對 %1 (%2) 縫合傷口中 Stitching @@ -2281,8 +2635,10 @@ Suturando Suturando Šití - 縫合 + 縫合中 붕합중 + 缝合中 + 縫合中 You treat the airway of %1 @@ -2297,6 +2653,8 @@ Ošetřuješ dýchací cesty %1 %1 の気道を診断する %1의 기도를 확보했다 + 你治疗 %1 的呼吸道 + 你治療 %1 的呼吸道 Airway @@ -2311,6 +2669,8 @@ Dýchací cesty 気道 기도 + 呼吸道 + 呼吸道 %1 is treating your airway @@ -2325,6 +2685,8 @@ %1 ošetřuje tvoje dýchací cesty %1 はあなたの気道を見ている %1 (이)가 나의 기도를 확보중이다 + %1 正在治疗你的呼吸道 + %1 正在治療你的呼吸道 Drag @@ -2339,6 +2701,8 @@ Trascina 引きずる 끌다 + 拖拉 + 拖拉 Carry @@ -2353,6 +2717,8 @@ Trasporta 運ぶ 업다 + 背起 + 背起 Release @@ -2367,6 +2733,8 @@ Rrilascia 離す 내려놓기 + 放下 + 放下 Load Patient Into @@ -2381,6 +2749,8 @@ Carica paziente nel 患者を載せる 환자 싣기 + 将伤者放入 + 將傷者放入 Unload Patient @@ -2395,6 +2765,8 @@ Scarica il paziente 患者を降ろす 환자 내리기 + 将伤者背出 + 將傷者背出 Unload patient @@ -2409,6 +2781,8 @@ Vyložit pacienta 患者を降ろす 환자 내리기 + 将伤者背出 + 將傷者背出 Load patient @@ -2423,6 +2797,8 @@ Naložit pacienta 患者を載せる 환자 싣기 + 将伤者放入 + 將傷者放入 Place body in bodybag @@ -2437,6 +2813,8 @@ Umístni tělo do pytle na mrtvoly 死体袋に入れる 시체 가방에 담기 + 将尸体放入尸袋 + 將屍體放入屍袋 Placing body in bodybag... @@ -2449,8 +2827,10 @@ Stai mettendo il corpo nella sacca... Colocando corpo dentro do saco para cadáver... Umístňuji tělo do pytle na mrtvoly... - 死体袋へ梱包中・・・ + 死体袋へ入れています・・・ 시체 가방에 담는중... + 将尸体放入尸袋中... + 將屍體放入屍袋中... %1 has bandaged patient @@ -2465,6 +2845,8 @@ %1 již obvázal pacienta %1 は包帯を巻いた %1 (이)가 붕대를 감아줬다 + %1 已包扎伤者 + %1 已包紮傷者 %1 performed CPR @@ -2478,6 +2860,8 @@ %1 à fait une RCP %1 は心肺蘇生をした %1 (이)가 심폐소생술을 실시했다 + %1 已执行心肺复苏术 + %1 已執行心肺復甦術 %1 used %2 @@ -2492,6 +2876,8 @@ %1 použil %2 %1 は %2 をつかった %1 (이)가 %2 을 썼다 + %1 已使用 %2 + %1 已使用 %2 %1 has given an IV @@ -2506,6 +2892,8 @@ %1 již aplikoval IV %1 は IV を与えた %1 (이)가 IV를 실시했다 + %1 已经给予静脉注射液 + %1 已經給予靜脈注射液 %1 applied a tourniquet @@ -2520,6 +2908,8 @@ %1 použil škrtidlo %1 は止血帯を巻いた %1 (이)가 지혈대를 적용했다 + %1 已经绑上止血带 + %1 已經綁上止血帶 %1 used Medkit @@ -2536,6 +2926,8 @@ %1 a utilisé une trousse %1 は応急処置キットをつかった %1 (이)가 개인응급키트를 사용했다 + %1 已使用了个人急救包 + %1 已使用了個人急救包 Heavily wounded @@ -2550,6 +2942,8 @@ Gravemente ferido 重傷 중상 + 重伤 + 重傷 Lightly wounded @@ -2564,6 +2958,8 @@ Levemente ferido 軽傷 경상 + 轻伤 + 輕傷 Very lightly wounded @@ -2578,6 +2974,8 @@ Muito levemente ferido かなり浅い傷 매우 가벼운 부상 + 小伤 + 小傷 Head @@ -2592,6 +2990,8 @@ Cabeça 頭部 머리 + 头部 + 頭部 Torso @@ -2606,6 +3006,8 @@ Torso 胴体 몸통 + 身体 + 身體 Left Arm @@ -2620,6 +3022,8 @@ Braço Esquerdo 左腕 왼쪽 팔 + 左手 + 左手 Right Arm @@ -2634,6 +3038,8 @@ Braço Direito 右腕 오른쪽 팔 + 右手 + 右手 Left Leg @@ -2648,6 +3054,8 @@ Perna Esquerda 左足 왼쪽 다리 + 左脚 + 左腳 Right Leg @@ -2662,6 +3070,8 @@ Perna Direita 右足 오른쪽 다리 + 右脚 + 右腳 Heal fully bandaged hitpoints @@ -2675,6 +3085,8 @@ Heilt vollständig bandagierte Trefferpunkte 包帯は体力を完全に回復する 붕대를 감은후 체력을 회복함 + 完全医疗包扎的部位至痊愈 + 完全醫療包紮的部位至痊癒 Style of menu (Medical) @@ -2689,6 +3101,8 @@ Stile del menù (medico) メニューの表示形式 (治療) 메뉴의 스타일 (의료) + 选单样式 (医疗) + 選單樣式 (醫療) Select the type of menu you prefer; default 3d selections or radial. @@ -2703,6 +3117,8 @@ Seleziona il tipo di menù che preferisci: selezione (3D), radiale o disabilitata. 好みに応じてメニューの表示形式を選んでください。標準では 3D 選択か円状です。 선호하는 종류의 메뉴를 고르세요; 기본 3d 선택형 혹은 다이얼형 + 选择你喜欢的选单样式; 预设为3D选项或放射状 + 選擇你喜歡的選單樣式; 預設為3D選項或放射狀 Selections (3d) @@ -2717,6 +3133,8 @@ Selezione (3D) 選択 (3d) 선택 (3d) + 选择 (3D) + 選擇 (3D) Radial @@ -2731,6 +3149,8 @@ Radiale 円状 다이얼형 + 放射状 + 放射狀 Treating... @@ -2743,8 +3163,10 @@ Tratando... Ošetřuji... Curando... - 治療中・・・ + 治療しています・・・ 치료중... + 治疗中... + 治療中... Removing Tourniquet... @@ -2757,8 +3179,10 @@ Sundavám škrtidlo... Снятие жгута... Togliendo il laccio emostatico... - 止血帯を外している・・・ + 止血帯を外しています・・・ 지혈대 제거중... + 移除军用止血带中... + 移除軍用止血帶中... ACE Medical @@ -2773,6 +3197,8 @@ ACE Medical ACE 医療 ACE 의료 + ACE 医疗系统 + ACE 醫療系統 Medical Settings [ACE] @@ -2787,6 +3213,8 @@ Impostazioni Mediche [ACE] 医療設定 [ACE] 의료 설정 [ACE] + 医疗设定 [ACE] + 醫療設定 [ACE] Medical Level @@ -2801,6 +3229,8 @@ Livello Medico 医療レベル 의료 수준 + 医疗等级 + 醫療等級 What is the medical simulation level? @@ -2813,8 +3243,10 @@ Quel niveau de simulation médicale choisissez-vous? Milyen komplex legyen az orvosi szimuláció? Qual'è il livello di simulazione medica? - 治療の再現度は? + 治療の再現度は? 의료 시뮬레이션의 수준 + 选择需要的医疗模拟等级 + 選擇需要的醫療模擬等級 Medics setting @@ -2829,6 +3261,8 @@ Parametri Medici 治療の設定 의료 설정 + 医护兵等级 + 醫護兵等級 What is the level of detail prefered for medics? @@ -2841,8 +3275,10 @@ 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 @@ -2856,6 +3292,8 @@ Места ускоренного обучения 衛生兵としての能力を与える場所 교육 증가 지역 + 受所在位置影响提升医疗能力 + 受所在位置影響提升醫療能力 Boost medic rating in medical vehicles or near medical facilities [untrained becomes medic, medic becomes doctor] @@ -2867,8 +3305,10 @@ 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] 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 @@ -2883,6 +3323,72 @@ Disabilita medici 衛生兵を無効化 의무병 비활성화 + 关闭医护兵 + 關閉醫護兵 + + + Enable Litter + Включить мусор + Aktywuj odpadki + Activar restos médicos + Abfälle aktivieren + Povolit odpadky + Ativar lixo médico + Activer les détritus + Szemét engedélyezése + Abilita Barella + 医療廃棄物の表示を有効化 + 의료폐기물 활성화 + 启用医疗废弃物 + 啟用醫療廢棄物 + + + Enable litter being created upon treatment + Включить появление мусора после лечения + Twórz odpadki medyczne podczas leczenia + Activar los restos médicos que se crean en el tratamiento + Aktiviere Abfälle, wenn eine Behandlung durchgeführt wurde + Vytváří odpad zdravotnického materiálu pří léčení + Ativar lixo ser criado após tratamento + Activer la création de détrimus au début des traitements + Engedélyezi a szemét keletkezését ellátáskor + Abilita la creazione della barella dopo trattamento + 治療を始めると、医療廃棄物の作成を有効化する + 의료폐기물이 치료중 주변에 생성되는것을 활성화 합니다 + 本功能启用后,当每次医疗动作结束时,地上会产生相应的医疗废弃物 + 本功能啟用後,當每次醫療動作結束時,地上會產生相應的醫療廢棄物 + + + Life time of litter objects + Время удаления мусора + Długość życia odpadków + Tiempo de vida de los restos médicos + Dauer des angezeigten Abfalls + Životnost pro odpadky + Tempo de vida dos objetos do lixo + Durée d'affichage des détritus + Szemétobjektumok élettartama + Tempo di vita delle barelle + 医療廃棄物の作成限界数を設定 + 의료폐기물 시간제한 + 医疗废弃物存在时间 + 醫療廢棄物存在時間 + + + How long should litter objects stay? In seconds. -1 is forever. + Как долго мусор будет оставаться на земле? В секундах. -1 означает бесконечное время. + Ile czasu musi upłynąć, aby odpadki zaczęły znikać? W sekundach. -1 dla nieskończoności. + ¿Por cuánto tiempo deben permanecer los restos médicos? En segundos. -1 es para siempre. + Wie lange sollen Abfälle am Boden liegen (in Sekunden)? -1 ist für immer. + Za jak dlouho začnou odpadky mizet? V sekundách. -1 navždy. + Quanto tempo os objetos do lixo devem ficar? Em segundos. -1 é para sempre. + Combien de temps doivent rester affiché les détritus? En secondes. -1 pour tout le temps + 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 @@ -2897,6 +3403,8 @@ Abilita Grida 叫びを有効化 비명 활성화 + 启用尖叫 + 啟用尖叫 Enable screaming by injured units @@ -2911,6 +3419,8 @@ Abilita Grida da parte delle unità ferite 負傷したユニットが叫ぶように 부상당한 인원이 소리지르는것을 활성화합니다 + 启用伤者的尖叫声 + 啟用傷者的尖叫聲 Show pain @@ -2931,6 +3441,8 @@ Danno Giocatore プレイヤーへの損傷 플레이어 부상 + 玩家伤害 + 玩家傷害 What is the damage a player can take before being killed? @@ -2943,8 +3455,10 @@ 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 @@ -2959,6 +3473,8 @@ Danno AI AI への損傷 인공지능 부상 + AI伤害 + AI傷害 What is the damage an AI can take before being killed? @@ -2971,24 +3487,134 @@ 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 死亡前所能承受的傷害程度 - Fatal Injury + Fatal Injury Player - Defines when you can receive a fatal injury + Defines when Player can receive a fatal injury - + + Instant death AI + + + Defines if AI will be able to die instantly + + + Forbid unconscious AI + + + Defines if AI will be denied to go unconscious and will die instead + + In Cardiac Arrest - Cardiac Arrest time(s) + Cardiac Arrest time (seconds) Defines how long it takes to die from cardiac arrest? + + AI Unconsciousness + Потеря сознания ботами + Nieprzytomność AI + Inconsciencia IA + KI-Bewusstlosigkeit + Bezvědomí AI + Inconsciência da IA + Inconscience des IA + AI eszméletlenség + Incoscienza IA + AI の気絶 + 인공지능 기절 + AI无意识 + AI無意識 + + + Allow AI to go unconscious + Позволить ботам терять сознание + Czy AI może być nieprzytomne od odniesionych obrażeń? + Permita a la IA caer inconsciente + KI kann bewusstlos werden + Umožňuje AI upadnout do bezvědomí + Permite IA ficar inconsciente + Autoriser les IA à tomber inconscients + Engedélyezi az AI eszméletének elvesztését + Permetti alle IA di diventare incoscienti + AI が気絶をするように + 인공지능도 기절에 빠지게 합니다 + 允许AI进入无意识状态 + 允許AI進入無意識狀態 + + + Remote Controlled AI + Ferngesteuerte KI-Einheiten + IA controlada remotamente + IA controlada remotamente + Zdalnie sterowane AI + Vzdáleně ovládané AI + Contrôle à distance des IA + Távvezérelt AI + Зевса считать ботом + IA Controllate in Remoto + 遠隔操作された AI + 인공지능 원격조종 + 遥控AI + 遙控AI + + + Treat remote controlled units as AI not players? + Legt fest, ob ferngesteuerte Einheiten als KI anstatt als Spieler behandelt werden sollen. + ¿Tratar unidades remotamente controladas como IA? + Tratar unidades remotamente controladas como IA? + Traktuj jednostki zdalnie sterowane (przez Zeusa) jako AI, nie jako graczy? + Ošetřit vzdáleně ovládané jednotky jako AI, ne jako hráče? + Soigner les unitées controlées à distance comme des IA et non comme des joueurs? + Távvezérelt egységek AI-ként, nem játékosként való kezelése? + Обрабатывать дистанционно управляемых юнитов как ботов, а не как игроков? + Considera le unità controllate in remoto come IA e non come giocatori? + 遠隔操作された AI は、非プレイヤーとして扱いますか? + 원격 조작하는 AI는 비 플레이어로 취급합니까? + 以医疗AI的方式医疗被遥控的单位 + 以醫療AI的方式醫療被遙控的單位 + + + Prevent instant death + Откл. мгновенную смерть + Wyłącz natychmiastową śmierć + Prevenir muerte instantánea + Verhindere direkten Tod + Zabránit okamžité smrti + Previnir morte instantânea + Empêcher la mort instantanée + Azonnali halál kiiktatása + Previeni morte istantanea + 即死の防止 + 즉사 방지 + 防止当场死亡 + 防止當場死亡 + + + Have a unit move to unconscious instead of death + Бойцы теряют сознание вместо того, чтобы умирать + Spraw, aby jednostka została przeniesiona do stanu nieprzytomności zamiast ginąć na miejscu od śmiertelnych obrażeń + Mover una unidad a inconsciente en vez de a muerta + Lässt eine Einheit bewusstlos werden anstatt zu sterben + Jednotka upadne do bezvědomí namísto smrti + Fazer a unidade ficar inconsciente invés de morrer + Forcer l'inconscience au lieu de la mort instantanée + Egy egység kerüljön eszméletlen állapotba a halott helyett + Imposta un'unità come incosciente invece di morta + ユニットの即死を防止するために、気絶へ移行させます + 인원의 즉사를 방지코자 즉사 대신 기절시킵니다 + 伤者最严重只会立即进入昏迷,而非立即死亡 + 傷者最嚴重只會立即進入昏迷,而非立即死亡 + Bleeding coefficient Коэффициент кровопотери @@ -3002,6 +3628,8 @@ Coefficiente sanguinamento 出血の係数 출혈 계수 + 流血系数 + 流血係數 Coefficient to modify the bleeding speed @@ -3016,6 +3644,8 @@ Coefficiente che modifica la velocità di sanguinamento この係数では出血速度を変更できます 출혈의 속도를 계수만큼 변경합니다 + 修改流血速度 + 修改流血速度 Pain coefficient @@ -3030,6 +3660,8 @@ Coefficiente dolore 痛みの係数 고통 계수 + 疼痛系数 + 疼痛係數 Coefficient to modify the pain intensity @@ -3044,6 +3676,8 @@ Coefficiente che modifica l'intensità del dolore この係数では痛みの強さを変更できます 고통의 정도를 계수만큼 변경합니다 + 修改疼痛强度的系数 + 修改疼痛強度的係數 Advanced Bandages @@ -3076,6 +3710,8 @@ Fornisce un sistema medico sia per giocatori che IA. プレイヤーと AI の両方へ医療システムを提供します。 의료 시스템을 플레이어 및 인공지능에게 제공합니다. + 医疗系统将同时对玩家与AI发生作用 + 醫療系統將同時對玩家與AI發生作用 IV Transfusion Flow Rate @@ -3101,6 +3737,8 @@ Настройки базовой медицины [ACE] ベーシック医療設定 [ACE] 기본 의료 설정 [ACE] + 基本医疗设定 [ACE] + 基本醫療設定 [ACE] Advanced Medical Settings [ACE] @@ -3115,6 +3753,8 @@ Impostazioni Mediche Avanzate [ACE] アドバンスド医療設定 [ACE] 고급 의료 설정 [ACE] + 进阶医疗设定 [ACE] + 進階醫療設定 [ACE] Enabled for @@ -3129,6 +3769,8 @@ Abilitato per 次を有効化 활성 + 被启用给 + 被啟用給 Select what units the advanced medical system will be enabled for @@ -3143,6 +3785,8 @@ Seleziona per quali unità verrà abilitato i sistema medico avanzato 選択されたユニットが、アドバンスド医療が使えるようになります 어느 인원에게 고급 의료 시스템을 적용시킬지 선택하십시요. + 选择进阶医疗系统影响的对象 + 選擇進階醫療系統影響的對象 Players only @@ -3157,6 +3801,8 @@ Solo giocatori プレイヤーのみ 플레이어만 + 只限玩家 + 只限玩家 Players and AI @@ -3171,6 +3817,8 @@ Giocatori ed IA プレイヤーと AI 플레이어 및 인공지능 + 玩家与AI + 玩家與AI Enable Advanced wounds @@ -3185,6 +3833,8 @@ Abilita ferite Avanzate アドバンスドな傷を有効化 고급 부상 활성화 + 启用进阶伤口系统 + 啟用進階傷口系統 Allow reopening of bandaged wounds? @@ -3197,8 +3847,10 @@ Les plaies peuvent se rouvrir Visszanyílhatnak a bekötözött sebek? Permetti la riapertura di ferite bendate? - 包帯で巻かれた傷を再び開くようにしますか? + 包帯で巻かれた傷を再び開くようにしますか? 붕대가 풀리는것을 활성화합니까? + 启用进阶伤口系统会使已被包扎的伤口有机率裂开 + 啟用進階傷口系統會使已被包紮的傷口有機率裂開 Vehicle Crashes @@ -3213,6 +3865,8 @@ Schianto Veicoli 車両の衝突 차량 사고 + 载具碰撞 + 載具碰撞 Do units take damage from a vehicle crash? @@ -3225,8 +3879,10 @@ Les unités subissent des dégats lors d'accident Sérülnek-e az egységek autós ütközés során? Le unità sostengono danni da incidenti con veicoli? - ユニットは車両の衝突による損傷を受けるようにしますか? + ユニットは車両の衝突による損傷を受けるようにしますか? 차량 사고시 인원들이 부상을 입습니까? + 设定人员是否会因为载具冲撞别的物件而产生伤害? + 設定人員是否會因為載具衝撞別的物件而產生傷害? Allow Pain visualization @@ -3246,6 +3902,8 @@ Разрешить Адреналин アドレナリンの許可 에피네프린 활성화 + 允许使用肾上腺素 + 允許使用腎上腺素 Who can use Epinephrine? @@ -3257,6 +3915,24 @@ Who can use the Medkit for partial heal? + Who can use the Medkit for partial heal? + + + Who can use Epinephrine for full heal? (Basic medical only) + Wer darf Epiniphrin zur vollständigen Heilung benutzen? (Standard Sanitätseinstellungen) + Configura quienes pueden usar Epinefrina (Solo sistema médico básico) + Kto może skorzystać z adrenaliny w celu pełnego uleczenia? (Tylko podstawowy system medyczny) + Qui peut utiliser l'adrénaline pour les soins complets ? (Médical basique seulement) + Chi può usare l'epinefrina per la cura completa? (solo per sistema medico di base) + Kdo může použít adrenalin k úplnému vyléčení? (Pouze základní zdravotní systém) + Quem pode usar Epinefrina para cura completa? (Somente sistema médico básico) + Кому разрешено использовать адреналин для полного излечения? (Только для базовой медицины) + 完全に回復できるよう誰しもがアドレナリンを使えるようにしますか? (ベーシック医療のみ) + 완전한 체력회복을 위해 어느 인원이 에피네프린을 쓸 수 있습니까? (기본 의료 전용) + 谁可以使用肾上腺素完整医治? (仅适用于基本医疗) + 誰可以使用腎上腺素完整醫治? (僅適用於基本醫療) + + Allow PAK Использование аптечки Ustawienie apteczek osobistych @@ -3269,6 +3945,8 @@ Consenti Kit di Pronto Soccorso 応急処置キットの許可 개인응급키트 활성화 + 允许使用个人急救包 + 允許使用個人急救包 Who can use the PAK for full heal? @@ -3281,8 +3959,10 @@ 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 @@ -3297,6 +3977,8 @@ Chiunque だれでも 모두 + 任何人 + 任何人 Medics only @@ -3311,6 +3993,8 @@ Solo medici 衛生兵のみ 의무병만 + 只限医疗兵 + 只限醫療兵 Doctors only @@ -3325,6 +4009,8 @@ Solo dottori 医師のみ 오직 의사만 + 只限军医 + 只限軍醫 Remove Medkit on use @@ -3345,6 +4031,8 @@ Rimuovi Kit Pronto Soccorso dopo l'uso 応急処置キットの削除 개인응급키트 사용후 사라짐 + 在使用后删除个人急救包 + 在使用後刪除個人急救包 Should PAK be removed on usage? @@ -3357,8 +4045,10 @@ 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 @@ -3372,6 +4062,8 @@ Место использования адреналина アドレナリンをつかう場所 에피네프린 사용 장소 + 肾上腺素使用地点 + 腎上腺素使用地點 Where can the Epinephrine be used? @@ -3383,6 +4075,25 @@ Where can the Medkit be used? + Where can the Medkit be used? + + + + 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ù 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 Место использования аптечки Ograniczenie apteczek osobistych @@ -3395,6 +4106,8 @@ Locazioni Kit Pronto Soccorso 応急処置キットをつかう場所 개인응급키트 사용 장소 + 个人急救包使用地点 + 個人急救包使用地點 Where can the PAK be used? @@ -3407,8 +4120,10 @@ 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 @@ -3423,6 +4138,8 @@ Condizioni Kit Pronto Soccorso 応急処置キットの状態 개인응급키트 상태 + 个人急救包使用条件 + 個人急救包使用條件 When can the PAK be used? @@ -3435,8 +4152,10 @@ Onde o kit de primeiros socorros pode ser utilizado? Когда может использоваться аптечка? Quando può essere usato il Kit Pronto Soccorso? - どこでも応急処置キットをつかえるようにしますか? + どこでも応急処置キットをつかえるようにしますか? 언제 개인응급키트를 사용할 수 있습니까? + 何时可以使用个人急救包? + 何時可以使用個人急救包? Medical facility @@ -3451,6 +4170,8 @@ Strutture mediche 医療施設でのみ 의료시설 + 医疗设施 + 醫療設施 Vehicles & facility @@ -3465,6 +4186,8 @@ Veicoli e Strutture 車両 & 施設 차량 및 시설 + 医疗载具 & 医疗设施 + 醫療載具 & 醫療設施 Allow Surgical Kit (Adv) @@ -3479,6 +4202,8 @@ Permetti Kit Chirurgico (Avanzato) 縫合キットの許可 (アド) 봉합키트 활성화 (고급) + 允许使用手术包 (进阶伤口) + 允許使用手術包 (進階傷口) Who can use the Surgical Kit? @@ -3491,8 +4216,10 @@ Qui peut utiliser les trousses chirurgicales? Ki használhatja a sebészkészletet? Chi può usare il Kit Chirurgico? - だれでも縫合キットをつかえるようにしますか? + だれでも縫合キットをつかえるようにしますか? 어느 인원이 봉합키트를 사용할 수 있습니까? + 谁能够使用手术包? + 誰能夠使用手術包? Remove Surgical Kit (Adv) @@ -3507,6 +4234,8 @@ Rimuovi Kit Chirurgico (Avanzato) 縫合キットを削除 (アド) 봉합키트 제거 (고급) + 在使用后删除手术包 (进阶伤口) + 在使用後刪除手術包 (進階傷口) Should Surgical kit be removed on usage? @@ -3519,8 +4248,10 @@ 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) @@ -3535,6 +4266,8 @@ Località Kit Chirurgico (Avanzato) 縫合キットをつかう場所 (アド) 봉합키트 사용 장소 (고급) + 手术包使用地点 (进阶伤口) + 手術包使用地點 (進階傷口) Where can the Surgical Kit be used? @@ -3547,8 +4280,10 @@ Où peut être utilisé les trousses chirurgicales? Hol lehet a sebészkészletet használni? Dove può essere usato il Kit Chirurgico? - どこでも縫合キットをつかえるようにしますか? + どこでも縫合キットをつかえるようにしますか? 어디에서 봉합키트를 사용할 수 있게 합니까? + 定义手术包可被使用的地方? + 定義手術包可被使用的地方? Remaining Damage @@ -3569,6 +4304,8 @@ Condizioni Kit Chirurgico (Avanzato) 縫合キットの状態 (アド) 봉합키트 상태 (고급) + 使用手术包的条件 (进阶伤口) + 使用手術包的條件 (進階傷口) When can the Surgical Kit be used? @@ -3581,8 +4318,10 @@ Onde o kit cirúrgico pode ser utilizado? Когда может использоваться хирургический набор? Quando può essere usato il Kit Chirurgico? - いつでも縫合キットをつかえるようにしますか? + いつでも縫合キットをつかえるようにしますか? 언제 봉합키트를 사용할 수 있습니까? + 何时可以使用手术工具包? + 何時可以使用手術工具包? Heal hitpoints @@ -3596,6 +4335,8 @@ Soigner les blessures ヒットポイントの回復 체력 회복 + 完整治疗 + 完整治療 Heal fully bandaged hitpoints @@ -3608,6 +4349,7 @@ Cura Hitpoints completamente bendati Soigner les plaies entièrement bandées. 包帯によりヒットポイントを完全に回復する + 붕대를 감아서 체력을 회복 Configure the treatment settings from ACE Basic Medical @@ -3620,6 +4362,8 @@ Настройка лечения в базовой медицинской системе ACE ACE ベーシック医療による設定で、治療を設定する ACE 기본 의료에 대한 치료 설정 수정 + 设定ACE基本医疗的规则 + 設定ACE基本醫療的規則 Configure the treatment settings from ACE Advanced Medical @@ -3634,7 +4378,8 @@ Configura le impostazioni trattamenti per ACE Medical ACE アドバンスド医療による設定で、治療を設定する ACE 고급 의료에 대한 치료 설정 수정 - + 设定ACE进阶医疗的规则 + 設定ACE進階醫療的規則 Set Medic Class [ACE] Сделать медиком [ACE] @@ -3648,6 +4393,8 @@ Imposta Classe Medico [ACE] 衛生兵クラスとして設定 [ACE] 의무병 보직 설정 [ACE] + 设定医疗兵单位 [ACE] + 設定醫療兵單位 [ACE] List @@ -3662,6 +4409,8 @@ Lista 一覧 목록 + 列表 + 列表 List of unit names that will be classified as medic, separated by commas. @@ -3676,6 +4425,8 @@ Lista di nomi unità che verranno classificati come medici, separati da virgole. 衛生兵として設定されるユニット名を一覧で指定でき、コンマで区切りを付けられます。 보직 이름 목록으로 의무병이 구분됩니다, 쉼표로 구분. + 列出的单位名字将被指派为医疗兵, 记得用逗号隔开! + 列出的單位名字將被指派為醫療兵, 記得用逗號隔開! Is Medic @@ -3690,6 +4441,8 @@ E' Medico 衛生兵として 의무병 + 是医疗兵 + 是醫療兵 This module allows you to assign the medic class to selected units. @@ -3704,6 +4457,8 @@ Questo modulo ti permette di assegnare la classe Medico alle unità selezionate. 選択されたユニットを衛生兵として指定します。 이 모듈은 선택한 보직이 의무병을 할 수 있게 해줍니다. + 本模块可让被同步的单位成为医疗兵 + 本模塊可讓被同步的單位成為醫療兵 None @@ -3718,6 +4473,8 @@ Nessuno なし 없음 + + Regular medic @@ -3732,6 +4489,8 @@ Medico Regolare 通常の衛生兵 일반 의무병 + 普通医疗兵 + 普通醫療兵 Doctor (Only Advanced Medics) @@ -3746,6 +4505,8 @@ Dottore (Solo Medici Avanzati) 医師 (アドバンスド医療のみ) 의사 (오직 고급 의료에서만) + 军医 (只限进阶医疗系统) + 軍醫 (只限進階醫療系統) Doctor @@ -3760,6 +4521,8 @@ Dottore 医師 의사 + 军医 + 軍醫 Assigns the ACE medic class to a unit @@ -3774,6 +4537,8 @@ Assegna la classe medico ACE ad un'unità ユニットを ACE の衛生兵として割り当てる 인원에게 ACE 의무병 보직 선정 + 指派ACE医疗职位给该单位 + 指派ACE醫療職位給該單位 Set Medical Vehicle [ACE] @@ -3788,6 +4553,8 @@ Imposta Veicolo Medico [ACE] 医療車両を設定 [ACE] 의료 차랑 선정 [ACE] + 设定医疗载具 [ACE] + 設定醫療載具 [ACE] List @@ -3802,6 +4569,8 @@ Lista 一覧 목록 + 列表 + 列表 List of vehicles that will be classified as medical vehicle, separated by commas. @@ -3816,6 +4585,8 @@ Lista di veicoli che verranno classificati come veicoli medici, separati da virgole. 医療車両として設定されるクラス名を一覧で指定でき、コンマで区切りを付けられます 차량 명칭 목록으로 의료차량이 구분됩니다, 쉼표로 구분. + 列出的载具将被指定为医疗载具, 记得用逗号隔开! + 列出的載具將被指定為醫療載具, 記得用逗號隔開! Is Medical Vehicle @@ -3830,6 +4601,8 @@ E' Veicolo Medico 医療車両として 의료 차량 + 是医疗载具 + 是醫療載具 Whatever or not the objects in the list will be a medical vehicle. @@ -3844,6 +4617,8 @@ Gli oggetti nella lista verranno considerati veicoli medici o meno. どれでも、またはこの一覧にないオブジェクトを医療車両として割り当てる。 무엇이 되었던간에 이 목록에 있는 물체는 의료 차량이 됩니다. + 列表中的载具将会变成医疗载具 + 列表中的載具將會變成醫療載具 Assigns the ACE medic class to a unit @@ -3858,6 +4633,8 @@ Assegna la classe medico ACE ad un'unità ユニットを ACE の衛生兵として割り当てる 차량에 ACE 의무병 보직 선정 + 指派ACE医疗职位给该单位 + 指派ACE醫療職位給該單位 Set Medical Facility [ACE] @@ -3872,6 +4649,8 @@ Imposta Struttura Medica [ACE] 医療施設を設定 [ACE] 의료시설 선정 [ACE] + 设定医疗设施 [ACE] + 設定醫療設施 [ACE] Is Medical Facility @@ -3886,6 +4665,8 @@ E' Struttura Medica 医療施設として 의료시설 + 是医疗设施 + 是醫療設施 Registers an object as a medical facility @@ -3900,6 +4681,8 @@ 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. @@ -3914,6 +4697,8 @@ Definisce un oggetto come struttura medica. Questo permette cure più avanzate. Può essere usato su edifici e veicoli. オブジェクトを医療施設として割り当てます。建物と車両へ割り当てられた場合、より高度な治療が可能になります。 물체를 의료시설로 정의합니다. 건물 혹은 차량이 될 수 있습니다. 이는 고급 의료 조치를 할 수 있게해줍니다. + 定义一个物件作为医疗设施, 此医疗设施将被允许使用更进阶的医疗方法. 此功能可用于建筑物或是载具上! + 定義一個物件作為醫療設施, 此醫療設施將被允許使用更進階的醫療方法. 此功能可用於建築物或是載具上! [ACE] Medical Supply Crate (Basic) @@ -3928,6 +4713,8 @@ [ACE] Cassa Rifornimenti Medici (Basico) [ACE] 医療物資箱 (ベーシック) [ACE] 의료 물자 (기본) + [ACE] 医疗补给箱(基本) + [ACE] 醫療補給箱(基本) [ACE] Medical Supply Crate (Advanced) @@ -3942,6 +4729,8 @@ [ACE] Cassa Rifornimenti Medici (Avanzato) [ACE] 医療物資箱 (アドバンスド) [ACE] 의료 물자 (고급) + [ACE] 医疗补给箱(进阶) + [ACE] 醫療補給箱(進階) Anytime @@ -3956,6 +4745,8 @@ Sempre いつでも 언제나 + 任何时间 + 任何時間 Stable @@ -3968,8 +4759,10 @@ Estável После стабилизации Stabile - 安定 + 安静下 안정된 + 稳定状态下 + 穩定狀態下 Medical @@ -3984,6 +4777,8 @@ Orvosi 治療 의료 + 医疗设定 + 醫療設定 Distance to %1 has become too far for treatment @@ -3997,6 +4792,8 @@ %1 est trop loin pour être soigné %1 は治療をできない所まで離れた %1 부터의 거리가 너무 멀어 치료할 수 없습니다 + 设定当距离超过%1将不能使用治疗动作 + 設定當距離超過%1將不能使用治療動作 This person (%1) is awake and cannot be loaded @@ -4010,6 +4807,8 @@ %1 est conscient et ne peut être embarqué. 患者 (%1) は意識があり、積み込めない 이 사람 (%1) 은(는) 의식이 있어 태우지 못합니다 + 此人(%1)是清醒且不能被装载 + 此人(%1)是清醒且不能被裝載 There is no tourniquet on this body part! @@ -4021,8 +4820,10 @@ Žádné škrtidlo na této části těla! Non c'è nessun laccio emostatico su questa parte del corpo! Il n'y a pas de garrot sur ce membre ! - 身体には止血帯が無い! + 身体には止血帯が無い! 이 부위에는 지혈대가 없습니다! + 这部位没有止血带! + 這部位沒有止血帶! Medical training @@ -4036,6 +4837,8 @@ Медицинская подготовка 治療の訓練 의료 훈련 + 医疗训练 + 醫療訓練 Whether or not the object will be a medical vehicle. @@ -4048,6 +4851,8 @@ Будет ли объект считаться медицинским транспортом. どれでも、またはオブジェクトを医療車両として割り当てます。 무엇이 되었던간에 이 목록에 있는 물체는 의료 차량이 됩니다. + 是否使该载具为医疗载具? + 是否使該載具為醫療載具? Allow Unconscious Animation @@ -4055,5 +4860,29 @@ Allow Unconscious Animation on Treatment. + + Unconscious Wake Up Chance + + + Probablity that a unit with stable vitals will wake up from unconscious [Checked every 15 sec] + + + Open lid + Deckel aufklappen + フタをあける + Apri lid + 打開蓋子 + 打开盖子 + 뚜껑 열기 + + + Close lid + Deckel zuklappen + フタをしめる + Chiudi lid + 關閉蓋子 + 关闭盖子 + 뚜껑 닫기 + 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 f42ccabd1a..09b9312bfa 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 6145cb0a09..7cca5581e6 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 */ @@ -51,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: { @@ -82,4 +86,14 @@ switch (true) do { systemChat format ["%1 is giving %2 morphine", _this, _target]; #endif }; +//ToDo - Figure out how to connect to new medical + // 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 d989d621df..23135bb2e5 100644 --- a/addons/medical_ai/functions/fnc_isInjured.sqf +++ b/addons/medical_ai/functions/fnc_isInjured.sqf @@ -3,18 +3,22 @@ * Checks if a unit needs treatment. * * Arguments: - * None + * Unit * * Return Value: * Does unit need treatment * + * Example: + * player 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 _bloodLoss = [_this] call EFUNC(medical,getBloodLoss); private _pain = [_this] call EFUNC(medical,getPainLevel); +private _unconscious = _this getVariable ["ACE_isUnconscious", false]; -((_bloodLoss > 0) || {_pain > 0.2}) +(_bloodLoss > 0) || {_pain > 0.2} || _unconscious 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 e2eb733b2c..e6ba178138 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 */ 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 b2fdbbb773..b2bda42146 100644 --- a/addons/medical_ai/stringtable.xml +++ b/addons/medical_ai/stringtable.xml @@ -10,6 +10,9 @@ Tylko serwer i HC Seulement sur le server ou le HC Solo Server e HC + 只在伺服器或无头客户端 + 只在伺服器或無頭客戶端 + 서버와 헤드리스만 diff --git a/addons/medical_blood/stringtable.xml b/addons/medical_blood/stringtable.xml index 4bbd2c19a1..0464d661b7 100644 --- a/addons/medical_blood/stringtable.xml +++ b/addons/medical_blood/stringtable.xml @@ -9,6 +9,8 @@ Tylko gracze Joueurs seulement Solo Giocatori + 只有玩家 + 只有玩家 Enable Blood Drops @@ -18,6 +20,8 @@ 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 @@ -26,6 +30,9 @@ 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_damage/ACE_Medical_Injuries.hpp b/addons/medical_damage/ACE_Medical_Injuries.hpp index 07391d96dc..d167255f87 100644 --- a/addons/medical_damage/ACE_Medical_Injuries.hpp +++ b/addons/medical_damage/ACE_Medical_Injuries.hpp @@ -16,7 +16,7 @@ class ACE_Medical_Injuries { // Occur when an entire structure or part of it is forcibly pulled away, such as the loss of a permanent tooth or an ear lobe. Explosions, gunshots, and animal bites may cause avulsions. class Avulsion { causes[] = {"explosive", "vehiclecrash", "grenade", "shell", "bullet", "backblast", "bite"}; - bleeding = 0.5; + bleeding = 0.25; pain = 1.0; minDamage = 0.01; causeLimping = 1; @@ -32,7 +32,7 @@ class ACE_Medical_Injuries { // Occur when a heavy object falls onto a person, splitting the skin and shattering or tearing underlying structures. class Crush { causes[] = {"falling", "vehiclecrash", "punch", "unknown"}; - bleeding = 0.1; + bleeding = 0.05; pain = 0.8; minDamage = 0.1; causeLimping = 1; @@ -55,7 +55,7 @@ class ACE_Medical_Injuries { // Also called velocity wounds, they are caused by an object entering the body at a high speed, typically a bullet or small peices of shrapnel. class VelocityWound { causes[] = {"bullet", "grenade","explosive", "shell", "unknown"}; - bleeding = 1.0; + bleeding = 0.5; pain = 0.9; minDamage = 0.35; causeLimping = 1; @@ -63,7 +63,7 @@ class ACE_Medical_Injuries { // Deep, narrow wounds produced by sharp objects such as nails, knives, and broken glass. class PunctureWound { causes[] = {"stab", "grenade"}; - bleeding = 0.1; + bleeding = 0.05; pain = 0.4; minDamage = 0.02; causeLimping = 1; diff --git a/addons/medical_damage/functions/fnc_getTypeOfDamage.sqf b/addons/medical_damage/functions/fnc_getTypeOfDamage.sqf index 7f228fd562..af7e2c4560 100644 --- a/addons/medical_damage/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical_damage/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_damage/functions/fnc_woundsHandler.sqf b/addons/medical_damage/functions/fnc_woundsHandler.sqf index 07af9867db..688ff86fd7 100644 --- a/addons/medical_damage/functions/fnc_woundsHandler.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandler.sqf @@ -15,8 +15,6 @@ */ #include "script_component.hpp" -#define MATH_E 2.71828182846 - params ["_unit", "_bodyPart", "_damage", "_typeOfDamage"]; TRACE_5("start",_unit,_bodyPart,_damage,_typeOfDamage); @@ -39,45 +37,50 @@ private _woundsCreated = []; call compile _extensionOutput; // todo: Make the pain and bleeding calculations part of the extension again +private _woundDamage = _damage / ((count _woundsCreated) max 1); // If the damage creates multiple wounds private _painLevel = 0; private _critialDamage = false; private _bodyPartDamage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; +private _bodyPartVisParams = [_unit, false, false, false, false]; // params array for EFUNC(medical_engine,updateBodyPartVisuals); { _x params ["", "_woundClassIDToAdd", "_bodyPartNToAdd", "", "_bleeding"]; - _bodyPartDamage set [_bodyPartNToAdd, (_bodyPartDamage select _bodyPartNToAdd) + _damage]; + _bodyPartDamage set [_bodyPartNToAdd, (_bodyPartDamage select _bodyPartNToAdd) + _woundDamage]; + _bodyPartVisParams set [[1,2,3,3,4,4] select _bodyPartNToAdd, true]; // Mark the body part index needs updating // The higher the nastiness likelihood the higher the change to get a painful and bloody wound - private _nastinessLikelihood = linearConversion [0, 20, _damage, 0.5, 30, true]; - private _bloodiness = 0.01 + 0.99 * MATH_E ^ (-(random 30) / _nastinessLikelihood); - private _painfullness = 0.05 + 0.95 * MATH_E ^ (-(random 30) / _nastinessLikelihood); + private _nastinessLikelihood = linearConversion [0, 20, _woundDamage, 0.5, 30, true]; + private _bleedingModifier = 0.25 + 8 * exp ((random [-4.5, -5, -6]) / _nastinessLikelihood); + private _painModifier = 0.05 + 2 * exp (-2 / _nastinessLikelihood); - _bleeding = _bleeding * _bloodiness; - - // wound category (minor, medium, large) - private _category = floor ((0 max _bleeding min 0.1) / 0.05); + TRACE_3("",_nastinessLikelihood,_bleedingModifier,_painModifier); + + _bleeding = _bleeding * _bleedingModifier; + private _pain = (((GVAR(woundsData) select _woundClassIDToAdd) select 3) * _painModifier); + _painLevel = _painLevel + _pain; + + // wound category (minor [0..0.5], medium[0.5..1.0], large[1.0+]) + private _category = floor linearConversion [0, 1, _bleedingModifier, 0, 2, true]; _x set [4, _bleeding]; - _x set [5, _damage]; + _x set [5, _woundDamage]; _x set [6, _category]; - private _pain = ((GVAR(woundsData) select _woundClassIDToAdd) select 3) * _painfullness; - _painLevel = _painLevel max _pain; - if (_bodyPartNToAdd == 0 || {_bodyPartNToAdd == 1 && {_damage > PENETRATION_THRESHOLD}}) then { + if (_bodyPartNToAdd == 0 || {_bodyPartNToAdd == 1 && {_woundDamage > PENETRATION_THRESHOLD}}) then { _critialDamage = true; }; #ifdef DEBUG_MODE_FULL - systemChat format["%1, damage: %2, peneration: %3, bleeding: %4, pain: %5", _bodyPart, round(_damage * 100) / 100, _damage > PENETRATION_THRESHOLD, round(_bleeding * 1000) / 1000, round(_pain * 1000) / 1000]; + systemChat format["%1, damage: %2, peneration: %3, bleeding: %4, pain: %5", _bodyPart, round(_woundDamage * 100) / 100, _woundDamage > PENETRATION_THRESHOLD, round(_bleeding * 1000) / 1000, round(_pain * 1000) / 1000]; #endif - if (_bodyPartNToAdd == 0 && {_damage > LETHAL_HEAD_DAMAGE_THRESHOLD}) then { + if (_bodyPartNToAdd == 0 && {_woundDamage > LETHAL_HEAD_DAMAGE_THRESHOLD}) then { [QEGVAR(medical,FatalInjury), _unit] call CBA_fnc_localEvent; }; // todo `forceWalk` based on leg damage private _causeLimping = (GVAR(woundsData) select _woundClassIDToAdd) select 7; - if (_causeLimping == 1 && {_damage > LIMPING_DAMAGE_THRESHOLD} && {_bodyPartNToAdd > 3}) then { + if (_causeLimping == 1 && {_woundDamage > LIMPING_DAMAGE_THRESHOLD} && {_bodyPartNToAdd > 3}) then { [_unit, true] call EFUNC(medical_engine,setLimping); }; @@ -85,13 +88,13 @@ private _bodyPartDamage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0, private _createNewWound = true; { _x params ["", "_classID", "_bodyPartN", "_oldAmountOf", "_oldBleeding", "_oldDamage", "_oldCategory"]; - if (_woundClassIDToAdd == _classID && {_bodyPartNToAdd == _bodyPartN && {(_damage < PENETRATION_THRESHOLD) isEqualTo (_oldDamage < PENETRATION_THRESHOLD)}}) then { + if (_woundClassIDToAdd == _classID && {_bodyPartNToAdd == _bodyPartN && {(_woundDamage < PENETRATION_THRESHOLD) isEqualTo (_oldDamage < PENETRATION_THRESHOLD)}}) then { if (_oldCategory == _category) exitWith { private _newAmountOf = _oldAmountOf + 1; _x set [3, _newAmountOf]; private _newBleeding = (_oldAmountOf * _oldBleeding + _bleeding) / _newAmountOf; _x set [4, _newBleeding]; - private _newDamage = (_oldAmountOf * _oldDamage + _damage) / _newAmountOf; + private _newDamage = (_oldAmountOf * _oldDamage + _woundDamage) / _newAmountOf; _x set [5, _newDamage]; _createNewWound = false; }; @@ -106,13 +109,13 @@ private _bodyPartDamage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0, _unit setVariable [QEGVAR(medical,openWounds), _openWounds, true]; _unit setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true]; -[_unit, _bodyPart] call EFUNC(medical_engine,updateBodyPartVisuals); +_bodyPartVisParams call EFUNC(medical_engine,updateBodyPartVisuals); + +[_unit, _painLevel] call EFUNC(medical,adjustPainLevel); +[_unit, "hit", PAIN_TO_SCREAM(_painLevel)] call EFUNC(medical_engine,playInjuredSound); if (_critialDamage || {_painLevel > PAIN_UNCONSCIOUS}) then { [_unit] call EFUNC(medical,handleIncapacitation); }; -[_unit, _painLevel] call EFUNC(medical,adjustPainLevel); -[_unit, "hit", PAIN_TO_SCREAM(_painLevel)] call EFUNC(medical_engine,playInjuredSound); - TRACE_5("exit",_unit,_painLevel,_unit getVariable QEGVAR(medical,pain),_unit getVariable QEGVAR(medical,openWounds),_woundsCreated); diff --git a/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf b/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf index e5ccd02922..10af92bf17 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf @@ -74,10 +74,13 @@ private _woundID = _unit getVariable [QGVAR(lastUniqueWoundID), 1]; // Unique w private _painLevel = 0; private _critialDamage = false; private _bodyPartDamage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; +private _bodyPartVisParams = [_unit, false, false, false, false]; // params array for EFUNC(medical_engine,updateBodyPartVisuals); private _woundsCreated = []; { - if (_x select 0 <= _damage) exitWith { - for "_i" from 0 to ((_x select 1)-1) do { + _x params ["_thresholdMinDam", "_thresholdWoundCount"]; + if (_thresholdMinDam <= _damage) exitWith { + private _woundDamage = _damage / (_thresholdWoundCount max 1); // If the damage creates multiple wounds + for "_i" from 0 to (_thresholdWoundCount-1) do { // Find the injury we are going to add. Format [ classID, allowdSelections, bleedingRate, injuryPain] private _oldInjury = if (random 1 >= 0.85) then { _woundTypes select _highestPossibleSpot @@ -89,42 +92,45 @@ private _woundsCreated = []; private _bodyPartNToAdd = [floor random 6, _bodyPartN] select _isSelectionSpecific; // 6 == count ALL_BODY_PARTS - _bodyPartDamage set [_bodyPartNToAdd, (_bodyPartDamage select _bodyPartNToAdd) + _damage]; + _bodyPartDamage set [_bodyPartNToAdd, (_bodyPartDamage select _bodyPartNToAdd) + _woundDamage]; + _bodyPartVisParams set [[1,2,3,3,4,4] select _bodyPartNToAdd, true]; // Mark the body part index needs updating // Create a new injury. Format [ID, classID, bodypart, percentage treated, bleeding rate] _injury = [_woundID, _woundClassIDToAdd, _bodyPartNToAdd, 1, _injuryBleedingRate]; // The higher the nastiness likelihood the higher the change to get a painful and bloody wound - private _nastinessLikelihood = linearConversion [0, 20, _damage, 0.5, 30, true]; - private _bloodiness = 0.01 + 0.99 * MATH_E ^ (-(random 30) / _nastinessLikelihood); - private _painfullness = 0.05 + 0.95 * MATH_E ^ (-(random 30) / _nastinessLikelihood); + private _nastinessLikelihood = linearConversion [0, 20, (_woundDamage / _thresholdWoundCount), 0.5, 30, true]; + private _bleedingModifier = 0.25 + 8 * exp ((random [-4.5, -5, -6]) / _nastinessLikelihood); + private _painModifier = 0.05 + 2 * exp (-2 / _nastinessLikelihood); - _bleeding = _injuryBleedingRate * _bloodiness; + _bleeding = _injuryBleedingRate * _bleedingModifier; + private _pain = _injuryPain * _painModifier; + _painLevel = _painLevel + _pain; + + // wound category (minor [0..0.5], medium[0.5..1.0], large[1.0+]) + private _category = floor linearConversion [0, 1, _bleedingModifier, 0, 2, true]; // wound category (minor, medium, large) private _category = floor ((0 max _bleeding min 0.1) / 0.05); _injury set [4, _bleeding]; - _injury set [5, _damage]; + _injury set [5, _woundDamage]; _injury set [6, _category]; - private _pain = _injuryPain * _painfullness; - _painLevel = _painLevel max _pain; - - if (_bodyPartNToAdd == 0 || {_bodyPartNToAdd == 1 && {_damage > PENETRATION_THRESHOLD}}) then { + if (_bodyPartNToAdd == 0 || {_bodyPartNToAdd == 1 && {_woundDamage > PENETRATION_THRESHOLD}}) then { _critialDamage = true; }; #ifdef DEBUG_MODE_FULL - systemChat format["%1, damage: %2, peneration: %3, bleeding: %4, pain: %5", _bodyPart, round(_damage * 100) / 100, _damage > PENETRATION_THRESHOLD, round(_bleeding * 1000) / 1000, round(_pain * 1000) / 1000]; + systemChat format["%1, damage: %2, peneration: %3, bleeding: %4, pain: %5", _bodyPart, round(_woundDamage * 100) / 100, _woundDamage > PENETRATION_THRESHOLD, round(_bleeding * 1000) / 1000, round(_pain * 1000) / 1000]; #endif - if (_bodyPartNToAdd == 0 && {_damage > LETHAL_HEAD_DAMAGE_THRESHOLD}) then { + if (_bodyPartNToAdd == 0 && {_woundDamage > LETHAL_HEAD_DAMAGE_THRESHOLD}) then { [QEGVAR(medical,FatalInjury), _unit] call CBA_fnc_localEvent; }; // todo `forceWalk` based on leg damage private _causeLimping = (GVAR(woundsData) select _woundClassIDToAdd) select 7; - if (_causeLimping == 1 && {_damage > LIMPING_DAMAGE_THRESHOLD} && {_bodyPartNToAdd > 3}) then { + if (_causeLimping == 1 && {_woundDamage > LIMPING_DAMAGE_THRESHOLD} && {_bodyPartNToAdd > 3}) then { [_unit, true] call EFUNC(medical_engine,setLimping); }; @@ -132,13 +138,13 @@ private _woundsCreated = []; private _createNewWound = true; { _x params ["", "_classID", "_bodyPartN", "_oldAmountOf", "_oldBleeding", "_oldDamage", "_oldCategory"]; - if (_woundClassIDToAdd == _classID && {_bodyPartNToAdd == _bodyPartN && {(_damage < PENETRATION_THRESHOLD) isEqualTo (_oldDamage < PENETRATION_THRESHOLD)}}) then { + if (_woundClassIDToAdd == _classID && {_bodyPartNToAdd == _bodyPartN && {(_woundDamage < PENETRATION_THRESHOLD) isEqualTo (_oldDamage < PENETRATION_THRESHOLD)}}) then { if (_oldCategory == _category) exitWith { private _newAmountOf = _oldAmountOf + 1; _x set [3, _newAmountOf]; private _newBleeding = (_oldAmountOf * _oldBleeding + _bleeding) / _newAmountOf; _x set [4, _newBleeding]; - private _newDamage = (_oldAmountOf * _oldDamage + _damage) / _newAmountOf; + private _newDamage = (_oldAmountOf * _oldDamage + _woundDamage) / _newAmountOf; _x set [5, _newDamage]; _createNewWound = false; }; @@ -161,13 +167,13 @@ private _woundsCreated = []; _unit setVariable [QEGVAR(medical,openWounds), _openWounds, true]; _unit setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true]; -[_unit, _bodyPart] call EFUNC(medical_engine,updateBodyPartVisuals); +_bodyPartVisParams call EFUNC(medical_engine,updateBodyPartVisuals); + +[_unit, _painLevel] call EFUNC(medical,adjustPainLevel); +[_unit, "hit", PAIN_TO_SCREAM(_painLevel)] call EFUNC(medical_engine,playInjuredSound); if (_critialDamage || {_painLevel > PAIN_UNCONSCIOUS}) then { [_unit] call EFUNC(medical,handleIncapacitation); }; -[_unit, _painLevel] call EFUNC(medical,adjustPainLevel); -[_unit, "hit", PAIN_TO_SCREAM(_painLevel)] call EFUNC(medical_engine,playInjuredSound); - TRACE_5("exit",_unit,_painLevel,_unit getVariable QEGVAR(medical,pain),_unit getVariable QEGVAR(medical,openWounds),_woundsCreated); diff --git a/addons/medical_engine/XEH_postInit.sqf b/addons/medical_engine/XEH_postInit.sqf index f420474e68..7382eef0df 100644 --- a/addons/medical_engine/XEH_postInit.sqf +++ b/addons/medical_engine/XEH_postInit.sqf @@ -13,7 +13,10 @@ } else { // Calling this function inside curly brackets allows the usage of // "exitWith", which would be broken with "HandleDamage" otherwise. - _unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]; + _unit setVariable [ + QEGVAR(medical,HandleDamageEHID), + _unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}] + ]; }; }, nil, nil, true] call CBA_fnc_addClassEventHandler; @@ -48,6 +51,7 @@ // needed, because the vanilla INCAPACITATED state does not handle vehicles ["CAManBase", "GetInMan", { params ["_unit"]; + if (!local _unit) exitWith {}; if (lifeState _unit == "INCAPACITATED") then { [_unit, true] call FUNC(setUnconsciousAnim); diff --git a/addons/medical_engine/functions/fnc_damageBodyPart.sqf b/addons/medical_engine/functions/fnc_damageBodyPart.sqf index cac5266cad..a1d9b4ba30 100644 --- a/addons/medical_engine/functions/fnc_damageBodyPart.sqf +++ b/addons/medical_engine/functions/fnc_damageBodyPart.sqf @@ -5,13 +5,13 @@ * Arguments: * 0: Unit * 1: Selection, can be "Head", "Body", "Arms" or "Legs" - * 2: Damage + * 2: Damaged * * Return Value: * None * * Example: - * [player, "HEAD"] call ace_medical_engine_fnc_damageBodyPart + * [player, "HEAD", true] call ace_medical_engine_fnc_damageBodyPart * * Notes: * Head: Blood visuals @ 0.45 @@ -24,6 +24,7 @@ #include "script_component.hpp" params ["_unit", "_selection", "_damage"]; +TRACE_3("damageBodyPart",_unit,_selection,_damage); _damage = [0, DAMAGED_MIN_THRESHOLD] select _damage; diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index f9a7c30539..1e00d07fdf 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -113,10 +113,26 @@ if (_hitPoint isEqualTo "ace_hdbracket") exitWith { }; _ammo = "#falling"; } else { - // Assume collision damage. - // @todo, find a method for detecting burning damage. - _woundedHitPoint = "Body"; - _ammo = "#collision"; + if (_receivedDamage > 0.1) then { + // Assume collision damage. + _woundedHitPoint = "Body"; + _ammo = "#vehiclecrash"; + } else { + // Probably fire damage: + _woundedHitPoint = selectRandom ["LeftLeg", "RightLeg", "Body"]; + _ammo = "#unknown"; + private _combinedDamage = _receivedDamage + (_unit getVariable [QGVAR(trivialDamage), 0]); + if (_combinedDamage > 0.1) then { + // if the new sum is large enough, reset variable and continue with it added in + _unit setVariable [QGVAR(trivialDamage), 0]; + TRACE_2("Using sum of trivialDamage",_receivedDamage,_combinedDamage); + _receivedDamage = _combinedDamage; + } else { + // otherwise just save the new sum into the variable and exit + _unit setVariable [QGVAR(trivialDamage), _combinedDamage]; + _receivedDamage = 0; + }; + }; }; }; diff --git a/addons/medical_engine/functions/fnc_updateBodyPartVisuals.sqf b/addons/medical_engine/functions/fnc_updateBodyPartVisuals.sqf index d7479ae758..0b67449926 100644 --- a/addons/medical_engine/functions/fnc_updateBodyPartVisuals.sqf +++ b/addons/medical_engine/functions/fnc_updateBodyPartVisuals.sqf @@ -4,52 +4,35 @@ * * Arguments: * 0: Unit - * 1: Body part, can be "Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg" or "All" + * 1: Update Head + * 2: Update Body + * 3: Update Arms + * 4: Update Legs * * Return Value: * None * * Example: - * [player, "HEAD"] call ace_medical_engine_fnc_updateBodyPartVisuals + * [player, true, true, true, true] call ace_medical_engine_fnc_updateBodyPartVisuals * * Public: No */ #include "script_component.hpp" -params ["_unit", "_bodyPart"]; - -if (_bodyPart == "All") exitWith { - [_unit, "Head"] call FUNC(updateBodyPartVisuals); - [_unit, "Body"] call FUNC(updateBodyPartVisuals); - [_unit, "LeftArm"] call FUNC(updateBodyPartVisuals); - [_unit, "RightArm"] call FUNC(updateBodyPartVisuals); - [_unit, "LeftLeg"] call FUNC(updateBodyPartVisuals); - [_unit, "RightLeg"] call FUNC(updateBodyPartVisuals); -}; - -private _affectedBodyParts = [_bodyPart]; - -switch (toLower _bodyPart) do { - case "leftarm"; - case "rightarm": { - _bodyPart = "Arms"; - _affectedBodyParts = ["LeftArm", "RightArm"]; - }; - - case "leftleg"; - case "rightleg": { - _bodyPart = "Legs"; - _affectedBodyParts = ["LeftLeg", "RightLeg"]; - }; -}; +params ["_unit", "_updateHead", "_updateBody", "_updateArms", "_updateLegs"]; +TRACE_5("updateBodyPartVisuals",_unit,_updateHead,_updateBody,_updateArms,_updateLegs); private _bodyPartDamage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; -private _damageOnAffectedBodyParts = 0; -{ - private _partIndex = ALL_BODY_PARTS find toLower _x; - private _damageOnBodyPart = _bodyPartDamage select _partIndex; - // report maximum of both legs or arms - _damageOnAffectedBodyParts = _damageOnAffectedBodyParts max _damageOnBodyPart; -} forEach _affectedBodyParts; - -[_unit, _bodyPart, _damageOnAffectedBodyParts > VISUAL_BODY_DAMAGE_THRESHOLD] call FUNC(damageBodyPart); + +if (_updateHead) then { + [_unit, "head", (_bodyPartDamage select 0) > VISUAL_BODY_DAMAGE_THRESHOLD] call FUNC(damageBodyPart); +}; +if (_updateBody) then { + [_unit, "body", (_bodyPartDamage select 1) > VISUAL_BODY_DAMAGE_THRESHOLD] call FUNC(damageBodyPart); +}; +if (_updateArms) then { + [_unit, "arms", ((_bodyPartDamage select 2) max (_bodyPartDamage select 3)) > VISUAL_BODY_DAMAGE_THRESHOLD] call FUNC(damageBodyPart); +}; +if (_updateLegs) then { + [_unit, "legs", ((_bodyPartDamage select 4) max (_bodyPartDamage select 5)) > VISUAL_BODY_DAMAGE_THRESHOLD] call FUNC(damageBodyPart); +}; diff --git a/addons/medical_gui/ACE_Settings.hpp b/addons/medical_gui/ACE_Settings.hpp index f6ec9d3932..4c34d11865 100644 --- a/addons/medical_gui/ACE_Settings.hpp +++ b/addons/medical_gui/ACE_Settings.hpp @@ -29,5 +29,6 @@ class ACE_Settings { value = 3; typeName = "SCALAR"; category = ECSTRING(medical,Category_Medical); + sliderSettings[] = {0, 10, 3, 1}; }; }; diff --git a/addons/medical_gui/CfgVehicles.hpp b/addons/medical_gui/CfgVehicles.hpp index 30c09f958c..71dae5d720 100644 --- a/addons/medical_gui/CfgVehicles.hpp +++ b/addons/medical_gui/CfgVehicles.hpp @@ -3,13 +3,13 @@ class CfgVehicles { class ACE_Module; class ACE_moduleMedicalMenuSettings: ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(module_DisplayName); icon = QPATHTOEF(medical,UI\Icon_Module_Medical_ca.paa); category = "ACE_medical"; function = QUOTE(DFUNC(module)); functionPriority = 1; - isGlobal = 0; + isGlobal = 1; isSingular = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); @@ -51,12 +51,14 @@ class CfgVehicles { statement = QUOTE([ARR_3(_target,1,0)] call EFUNC(medical,displayPatientInformation)); condition = "true"; icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); + #define ACTION_CONDITION condition = "true"; #include "InteractionBodyParts.hpp" + #undef ACTION_CONDITION }; - class Medical_Menu { + class ACE_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); @@ -64,17 +66,45 @@ class CfgVehicles { }; class ACE_Actions { + #define ACTION_CONDITION condition = QUOTE((EGVAR(medical,menuTypeStyle) == 0)); #include "InteractionBodyParts.hpp" + #undef ACTION_CONDITION // Create a consolidates medical menu for treatment while boarded class ACE_MainActions { - class Medical_Menu { + class ACE_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); }; + class ACE_Medical_Radial { + displayName = ECSTRING(medical,Actions_Medical); + runOnHover = 1; + exceptions[] = {"isNotInside", "isNotSitting"}; + statement = QUOTE([ARR_3(_target,1,0)] call EFUNC(medical,displayPatientInformation)); + condition = QUOTE(((vehicle _target != _target && vehicle _target == vehicle _player) || {EGVAR(medical,menuTypeStyle) == 1})); + icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); + #define ACTION_CONDITION condition = "true"; + #include "InteractionBodyParts.hpp" + #undef ACTION_CONDITION + }; + class ACE_Medical_loadPatient { + displayName = ECSTRING(medical,LoadPatient); + condition = "(_target getVariable ['ACE_isUnconscious', false]) && {alive _target} && {vehicle _target == _target}"; + statement = QUOTE([ARR_2(_player, _target)] call EFUNC(medical_treatment,actionLoadUnit)); + icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); + exceptions[] = {"isNotDragging", "isNotCarrying"}; + insertChildren = QUOTE(call DEFUNC(medical_treatment,addLoadPatientActions)); + }; + class ACE_Medical_UnLoadPatient { + displayName = ECSTRING(medical,UnloadPatient); + condition = "(_target getVariable ['ACE_isUnconscious', false]) && {vehicle _target != _target} && {vehicle _player == _player}"; + statement = QUOTE([ARR_2(_player, _target)] call EFUNC(medical_treatment,actionUnloadUnit)); + icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); + exceptions[] = {"isNotDragging", "isNotCarrying", "isNotInside"}; + }; }; }; }; diff --git a/addons/medical_gui/InteractionBodyParts.hpp b/addons/medical_gui/InteractionBodyParts.hpp index c84a41af0c..0cee9281ff 100644 --- a/addons/medical_gui/InteractionBodyParts.hpp +++ b/addons/medical_gui/InteractionBodyParts.hpp @@ -1,57 +1,60 @@ class ACE_Head { displayName = ECSTRING(interaction,Head); + distance = MEDICAL_ACTION_DISTANCE; icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); exceptions[] = {"isNotInside", "isNotSitting"}; + ACTION_CONDITION statement = QUOTE([ARR_3(_target,1,0)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,0,_this select 3)] call FUNC(modifyAction)); - condition = "true"; runOnHover = 1; }; class ACE_Torso { displayName = ECSTRING(interaction,Torso); - distance = 5.0; - condition = "true"; - runOnHover = 1; + distance = MEDICAL_ACTION_DISTANCE; + icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); exceptions[] = {"isNotInside", "isNotSitting"}; + ACTION_CONDITION statement = QUOTE([ARR_3(_target,1,1)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,1,_this select 3)] call FUNC(modifyAction)); - showDisabled = 1; - priority = 2; - icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); + runOnHover = 1; }; class ACE_ArmLeft { displayName = ECSTRING(interaction,ArmLeft); - runOnHover = 1; + distance = MEDICAL_ACTION_DISTANCE; + icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); exceptions[] = {"isNotInside", "isNotSitting"}; + ACTION_CONDITION statement = QUOTE([ARR_3(_target,1,2)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,2,_this select 3)] call FUNC(modifyAction)); - condition = "true"; - icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); + runOnHover = 1; }; class ACE_ArmRight { displayName = ECSTRING(interaction,ArmRight); - runOnHover = 1; + distance = MEDICAL_ACTION_DISTANCE; + icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); exceptions[] = {"isNotInside", "isNotSitting"}; + ACTION_CONDITION statement = QUOTE([ARR_3(_target,1,3)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,3,_this select 3)] call FUNC(modifyAction)); - condition = "true"; - icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); + runOnHover = 1; }; class ACE_LegLeft { displayName = ECSTRING(interaction,LegLeft); - runOnHover = 1; + distance = MEDICAL_ACTION_DISTANCE; + icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); exceptions[] = {"isNotInside", "isNotSitting"}; + ACTION_CONDITION statement = QUOTE([ARR_3(_target,1,4)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,4,_this select 3)] call FUNC(modifyAction)); - condition = "true"; - icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); + runOnHover = 1; }; class ACE_LegRight { displayName = ECSTRING(interaction,LegRight); - runOnHover = 1; + distance = MEDICAL_ACTION_DISTANCE; + icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); exceptions[] = {"isNotInside", "isNotSitting"}; + ACTION_CONDITION statement = QUOTE([ARR_3(_target,1,5)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,5,_this select 3)] call FUNC(modifyAction)); - condition = "true"; - icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); + runOnHover = 1; }; diff --git a/addons/medical_gui/README.md b/addons/medical_gui/README.md index 86ae2039ea..a2129bb519 100644 --- a/addons/medical_gui/README.md +++ b/addons/medical_gui/README.md @@ -2,6 +2,7 @@ ace_medical_menu =============== Provides the CSE medical menu for the advanced medical system. +Also responsible for adding all interaction menu actions. ## Maintainers diff --git a/addons/medical_gui/XEH_postInit.sqf b/addons/medical_gui/XEH_postInit.sqf index 6206620c9f..413da0ca9e 100644 --- a/addons/medical_gui/XEH_postInit.sqf +++ b/addons/medical_gui/XEH_postInit.sqf @@ -6,11 +6,7 @@ GVAR(MenuPFHID) = -1; GVAR(lastOpenedOn) = -1; GVAR(pendingReopen) = false; -["ace_settingsInitialized", { - if (EGVAR(medical,menuTypeStyle) == 0) then { - [] call FUNC(collectActions3D); - }; -}] call CBA_fnc_addEventHandler; +[] call FUNC(collectActions3D); ["ace_treatmentSucceded", { if (GVAR(openAfterTreatment) && {GVAR(pendingReopen)}) then { @@ -26,7 +22,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_gui/functions/fnc_collectActions3D.sqf b/addons/medical_gui/functions/fnc_collectActions3D.sqf index 3525155c23..a310f4bc75 100644 --- a/addons/medical_gui/functions/fnc_collectActions3D.sqf +++ b/addons/medical_gui/functions/fnc_collectActions3D.sqf @@ -47,14 +47,20 @@ private _actionPathPositions = ["spine3", "pilot", "LeftForeArm", "RightForeArm" private _bodyPart = _x; private _actionPath = _actionPaths select (ALL_BODY_PARTS find toLower _bodyPart); - private _statement = {[_player, _target, _this select 2 select 0, _this select 2 select 1] call EFUNC(medical_treatment,treatment)}; - private _condition = {[_player, _target, _this select 2 select 0, _this select 2 select 1] call EFUNC(medical_treatment,canTreatCached)}; - + private _statement = { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; + [_player, _target, _this select 2 select 0, _this select 2 select 1] call EFUNC(medical_treatment,treatment) + }; + private _condition = { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; + [_player, _target, _this select 2 select 0, _this select 2 select 1] call EFUNC(medical_treatment,canTreatCached) + }; private _action = [ _actionName, _displayName, _icon, _statement, _condition, {}, [_bodyPart, configName _config], [0, 0, 0], 2, [false, true, false, false, false] ] call EFUNC(interact_menu,createAction); ["CAManBase", 0, [_actionPath], _action, true] call EFUNC(interact_menu,addActionToClass); + ["CAManBase", 0, ["ACE_MainActions", "ACE_Medical_Radial", _actionPath], _action, true] call EFUNC(interact_menu,addActionToClass); ["CAManBase", 1, ["ACE_SelfActions", "Medical", _actionPath], _action, true] call EFUNC(interact_menu,addActionToClass); } forEach _allowedBodyParts; } forEach configProperties [_actionsConfig, "isClass _x"]; diff --git a/addons/medical_gui/functions/fnc_getTreatmentOptions.sqf b/addons/medical_gui/functions/fnc_getTreatmentOptions.sqf index 9f1a58567c..aa7bdc52d0 100644 --- a/addons/medical_gui/functions/fnc_getTreatmentOptions.sqf +++ b/addons/medical_gui/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 _collectedActions = []; private _bodyPart = EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart); diff --git a/addons/medical_gui/functions/fnc_handleUI_DisplayOptions.sqf b/addons/medical_gui/functions/fnc_handleUI_DisplayOptions.sqf index 97e5c19519..8ab52bdb75 100644 --- a/addons/medical_gui/functions/fnc_handleUI_DisplayOptions.sqf +++ b/addons/medical_gui/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; //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_gui/functions/fnc_modifyAction.sqf b/addons/medical_gui/functions/fnc_modifyAction.sqf index 88eae7f1de..5cd5ab337e 100644 --- a/addons/medical_gui/functions/fnc_modifyAction.sqf +++ b/addons/medical_gui/functions/fnc_modifyAction.sqf @@ -22,10 +22,10 @@ private _bloodLossOnBodyPart = 0; // Add all bleeding from wounds on selection { - _x params ["", "", "_bodyPartN", "_amountOf", "_percentageOpen"]; + _x params ["", "", "_bodyPartN", "_amountOf", "_bleeding"]; if (_bodyPartN == _partIndex) then { - _bloodLossOnBodyPart = _bloodLossOnBodyPart + (_amountOf * _percentageOpen); + _bloodLossOnBodyPart = _bloodLossOnBodyPart + (20 * _amountOf * _bleeding); }; } forEach (_target getvariable [QEGVAR(medical,openWounds), []]); diff --git a/addons/medical_gui/functions/fnc_module.sqf b/addons/medical_gui/functions/fnc_module.sqf index 666440e208..f056082743 100644 --- a/addons/medical_gui/functions/fnc_module.sqf +++ b/addons/medical_gui/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_gui/functions/fnc_onMenuOpen.sqf b/addons/medical_gui/functions/fnc_onMenuOpen.sqf index 58cb9ff74e..3b933d1862 100644 --- a/addons/medical_gui/functions/fnc_onMenuOpen.sqf +++ b/addons/medical_gui/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_gui/functions/fnc_setTriageStatus.sqf b/addons/medical_gui/functions/fnc_setTriageStatus.sqf index 8a85eeb950..66efd6ac0c 100644 --- a/addons/medical_gui/functions/fnc_setTriageStatus.sqf +++ b/addons/medical_gui/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_gui/functions/fnc_updateInformationLists.sqf b/addons/medical_gui/functions/fnc_updateInformationLists.sqf index 28818465bc..d6ff631df8 100644 --- a/addons/medical_gui/functions/fnc_updateInformationLists.sqf +++ b/addons/medical_gui/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_gui/functions/fnc_updateUIInfo.sqf b/addons/medical_gui/functions/fnc_updateUIInfo.sqf index 8c58428ba1..a15ac38975 100644 --- a/addons/medical_gui/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_gui/functions/fnc_updateUIInfo.sqf @@ -72,7 +72,7 @@ private _allInjuryTexts = []; { _x params ["", "_woundClassID", "_bodyPartN", "_amountOf", "_bleeding", "_damage", "_category"]; - _selectionBloodLoss set [_bodyPartN, (_selectionBloodLoss select _bodyPartN) + (20 * (_bleeding * _amountOf))]; + _selectionBloodLoss set [_bodyPartN, (_selectionBloodLoss select _bodyPartN) + (20 * _bleeding * _amountOf)]; if (_selectionN == _bodyPartN) then { // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] if (_amountOf > 0) then { diff --git a/addons/medical_gui/stringtable.xml b/addons/medical_gui/stringtable.xml index 113f9b4bd3..96b765d174 100644 --- a/addons/medical_gui/stringtable.xml +++ b/addons/medical_gui/stringtable.xml @@ -13,6 +13,8 @@ Menu médical 治療メニュー 의료 메뉴 + 医疗选单 + 醫療選單 Allow Medical Menu @@ -26,6 +28,8 @@ Autoriser le menu médical 治療メニューを有効化 의료 메뉴 활성화 + 允许医疗选单 + 允許醫療選單 Allow clients to use the medical menu @@ -39,6 +43,8 @@ Autoriser les clients à utiliser le menu médical すべてのクライアントが治療メニューをつかえるようにする 클라이언트가 의료 메뉴를 쓰는것을 허락합니다 + 允许客户端使用医疗选单 + 允許客戶端使用醫療選單 Use Medical menu @@ -52,6 +58,8 @@ Utiliser le menu médical 治療メニューをつかう 의료 메뉴 사용 + 使用医疗选单 + 使用醫療選單 If allowed by server, enable the option to use the Medical Menu through keybinding and interaction menu @@ -65,6 +73,8 @@ 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 @@ -78,6 +88,8 @@ Ré-ouvrir le menu médical 治療メニューを再びひらく 의료 메뉴 다시 열기 + 重新开启医疗选单 + 重新開啟醫療選單 Re-open the medical menu after succesful treatment @@ -91,6 +103,8 @@ Ré-ouvrir le menu médical après un traitement réussi 治療が終わったあと、再び治療メニューをひらく 성공적으로 치료한후에 의료 메뉴를 다시 엽니다 + 当治疗成功后重新打开医疗选单 + 當治療成功後重新打開醫療選單 Open Medical Menu @@ -104,6 +118,8 @@ Ouvir le menu médical 治療メニューをひらく 의료 메뉴 열기 + 开起医疗选单 + 開起醫療選單 Medical Menu Settings @@ -117,6 +133,8 @@ Réglages du menu médical 治療メニューの設定 의료 메뉴 설정 + 医疗选单设定 + 醫療選單設定 Configure the usage of the Medical Menu @@ -130,6 +148,8 @@ Configurer l'utilisation du menu médical 治療メニューを使うための設定 의료 메뉴 사용의 설정 + 设置医疗选单的使用 + 設置醫療選單的使用 EXAMINE & TREATMENT @@ -143,6 +163,8 @@ ESAMINA & TRATTA 診断 & 治療 검사 / 치료 + 检查 & 治疗 + 檢查 & 治療 STATUS @@ -156,6 +178,8 @@ STATO 状態 상태 + 状态 + 狀態 OVERVIEW @@ -169,6 +193,8 @@ PANORAMICA オーバービュー 개요 + 概述 + 概述 ACTIVITY LOG @@ -182,6 +208,8 @@ LOG ATTIVITA' 治療履歴 활동 로그 + 医疗纪录 + 醫療紀錄 QUICK VIEW @@ -195,6 +223,8 @@ VISTA RAPIDA クイック ビュー 퀵 뷰 + 快速检查 + 快速檢查 View triage Card @@ -208,6 +238,8 @@ Guarda Triage Card トリアージ カードを見る 부상자 카드 보기 + 查看诊断卡 + 查看診斷卡 Examine Patient @@ -221,6 +253,8 @@ Esamina Paziente 患者を調べる 환자 검사하기 + 检查伤者 + 檢查傷者 Bandage / Fractures @@ -234,6 +268,8 @@ Bendaggi/Fratture 包帯 / 骨折 붕대 / 골절 + 绷带 / 骨折 + 繃帶 / 骨折 Medication @@ -247,6 +283,8 @@ Medicazione 薬物による治療 약물 치료 + 药物 + 藥物 Airway Management @@ -260,6 +298,8 @@ Atemwegssicherung 気道を確保 기도 관리 + 呼吸道管理 + 呼吸道管理 Advanced Treatments @@ -273,6 +313,8 @@ Trattamenti Avanzati 高度な治療 고급 치료 + 进阶治疗 + 進階治療 Drag/Carry @@ -286,6 +328,8 @@ Trascina/Trasporta 引きずる / 運ぶ 끌기 / 들기 + 拖 / 背 + 拖 / 背 Toggle (Self) @@ -297,8 +341,10 @@ Alternar (Si mesmo) Přepnout (na sebe) Attiva (Te Stesso) - トグル (自分) + 切り替え (自分) 토글 (자신) + 切换 (自己) + 切換 (自己) Select triage status @@ -312,6 +358,8 @@ Seleziona stato Triage トリアージによる状態を選択 부상 상태 고르기 + 选择分诊状态 + 選擇分診狀態 Select Head @@ -325,6 +373,8 @@ Seleziona Testa 頭部を選ぶ 머리 선택 + 选择头部 + 選擇頭部 Select Torso @@ -338,6 +388,8 @@ Seleziona Torso 胴体を選ぶ 몸통 선택 + 选择身体 + 選擇身體 Select Left Arm @@ -351,6 +403,8 @@ Seleziona Braccio Sinistro 左腕を選ぶ 왼쪽 팔 선택 + 选择左手 + 選擇左手 Select Right Arm @@ -364,6 +418,8 @@ Seleziona Braccio Destro 右腕を選ぶ 오른쪽 팔 선택 + 选择右手 + 選擇右手 Select Left Leg @@ -377,6 +433,8 @@ Seleziona Gamba Sinistra 左足を選ぶ 왼쪽 다리 선택 + 选择左脚 + 選擇左腳 Select Right Leg @@ -390,6 +448,8 @@ Seleziona Gamba Destra 右足を選ぶ 오른쪽 다리 선택 + 选择右脚 + 選擇右腳 Head @@ -403,6 +463,8 @@ Testa 頭部 머리 + 头部 + 頭部 Torso @@ -416,6 +478,8 @@ Torso 胴体 몸통 + 身体 + 身體 Left Arm @@ -429,6 +493,8 @@ Braccio Sinistro 左腕 왼쪽 팔 + 左手 + 左手 Right Arm @@ -442,6 +508,8 @@ Braccio Destro 右腕 오른쪽 팔 + 右手 + 右手 Left Leg @@ -455,6 +523,8 @@ Gamba Sinistra 左足 왼쪽 다리 + 左脚 + 左腳 Right Leg @@ -468,6 +538,8 @@ Gamba Destra 右足 오른쪽 다리 + 右脚 + 右腳 Body Part: %1 @@ -481,6 +553,8 @@ Parte del Corpo: %1 身体の一部: %1 신체 부위: %1 + 身体部位: %1 + 身體部位: %1 Small @@ -494,6 +568,8 @@ Piccolo 小さい + + Medium @@ -507,6 +583,8 @@ Medio 中くらい + + Large @@ -520,6 +598,8 @@ Grande 大きい + + There are %2 %1 Open Wounds @@ -533,6 +613,8 @@ Ci sono %2 %1 Ferite Aperte 開いている傷口が %2 %1 ほどあるようだ 여기 %2 %1 크기의 열린 상처가 있다 + 有 %2 %1 开放性伤口 + 有 %2 %1 開放性傷口 There is 1 %1 Open Wound @@ -546,6 +628,8 @@ C'è 1 %1 Ferita Aperta 1 つの空いている %1 傷口 여기 %1 크기의 열린 상처가 있다 + 有 1 %1 开放性伤口 + 有 1 %1 開放性傷口 There is a partial %1 Open wound @@ -559,6 +643,8 @@ C'è 1 parziale %1 Ferita Aperta 部分的に開いている %1 の傷口がある 여기 부분적으로 %1 크기의 상처가 있다 + 有部分 %1 开放性伤口 + 有部分 %1 開放性傷口 There are %2 %1 Bandaged Wounds @@ -572,6 +658,8 @@ Ci sono %2 %1 Ferite Bendate ここには %2 %1 の処置された傷がある 여기에 붕대를 감은 %2 %1 크기의 상처가 있다 + 有 %2 %1 包扎过伤口 + 有 %2 %1 包紮過傷口 There is 1 %1 Bandaged Wound @@ -585,6 +673,8 @@ C'è 1 %1 Ferita Bendata 1 つの包帯で巻かれている %1 傷 여기에 붕대를 감은 %1 크기의 상처가 있다 + 有 1 %1 包扎过伤口 + 有 1 %1 包紮過傷口 There is a partial %1 Bandaged wound @@ -598,6 +688,8 @@ C'è 1 parziale %1 Ferita Bendata 患者には %1 の包帯で処置された傷がある 여기 부분적으로 붕대질한 %1 크기의 상처가 있다 + 有部分 %1 包扎过伤口 + 有部分 %1 包紮過傷口 Normal breathing @@ -611,6 +703,8 @@ Respirazione Normale 通常の呼吸 정상 호흡 + 正常呼吸 + 正常呼吸 No breathing @@ -624,6 +718,8 @@ Nessuna Respirazione 息をしていない 호흡이 없음 + 没有呼吸 + 沒有呼吸 Difficult breathing @@ -637,6 +733,8 @@ Difficoltà Respiratorie 呼吸が難しそうだ 호흡 곤란 + 呼吸困难 + 呼吸困難 Almost no breathing @@ -650,6 +748,8 @@ Quasi nessuna Respirazione ほとんど呼吸していない 호흡이 거의 없음 + 几乎没有呼吸 + 幾乎沒有呼吸 Bleeding @@ -661,8 +761,10 @@ Sangrando Krvácí Sanguinamento - 出血 + 出血中 출혈 + 出血中 + 出血中 in Pain @@ -676,6 +778,8 @@ in Dolore 痛みがある 고통 + 疼痛中 + 疼痛中 Lost a lot of Blood @@ -687,8 +791,10 @@ Perdeu muito sangue Ztratil hodně krve Perso molto Sangue - 大量出血している + 大量失血している 많은 피를 흘림 + 大量失血 + 大量失血 Tourniquet [CAT] @@ -702,6 +808,8 @@ Laccio Emostatico [CAT] 止血帯 [CAT] 지혈대 [CAT] + 军用止血带 + 軍用止血帶 Nasopharyngeal Tube [NPA] @@ -715,6 +823,8 @@ Tubo Nasofaringeo [NPA] 鼻咽頭チューブ [NPA] 비-인두 기도기 [NPA] + 鼻咽管 + 鼻咽管 - \ No newline at end of file + diff --git a/addons/medical_statemachine/Statemachine.hpp b/addons/medical_statemachine/Statemachine.hpp index 6d551aad0f..3abe7d101e 100644 --- a/addons/medical_statemachine/Statemachine.hpp +++ b/addons/medical_statemachine/Statemachine.hpp @@ -1,3 +1,5 @@ +// Manual transitions applied to this statemachine +// - medical_fnc_handleRespawn:18 class ACE_Medical_StateMachine { list = "allUnits select {local _x}"; skipNull = 1; @@ -10,7 +12,11 @@ class ACE_Medical_StateMachine { }; class CriticalInjuryOrVitals { targetState = "Unconscious"; - events[] = {QGVAR(CriticalInjury), QGVAR(CriticalVitals)}; + events[] = {QGVAR(CriticalInjury), QGVAR(CriticalVitals), QGVAR(knockOut)}; + }; + class FatalVitals { + targetState = "CardiacArrest"; + events[] = {QGVAR(FatalVitals)}; }; class FatalInjury { targetState = "FatalInjury"; @@ -25,7 +31,7 @@ class ACE_Medical_StateMachine { }; class CriticalInjuryOrVitals { targetState = "Unconscious"; - events[] = {QGVAR(CriticalInjury), QGVAR(CriticalVitals)}; + events[] = {QGVAR(CriticalInjury), QGVAR(CriticalVitals), QGVAR(knockOut)}; }; class FatalVitals { targetState = "CardiacArrest"; @@ -38,12 +44,16 @@ class ACE_Medical_StateMachine { }; class Unconscious { onState = QUOTE(DFUNC(handleStateUnconscious)); - onStateEntered = QUOTE([ARR_2(_this,(true))] call FUNC(setUnconscious)); + onStateEntered = QUOTE([ARR_2(_this,(true))] call FUNC(setUnconsciousStatemachine)); + class DeathAI { + targetState = "Dead"; + condition = QUOTE(!isPlayer _this && {GVAR(unconsciousConditionAI)}); + }; class WakeUp { targetState = "Injured"; condition = QUOTE(_this call FUNC(hasStableVitals)); events[] = {QGVAR(WakeUp)}; - onTransition = QUOTE([ARR_2(_this,(false))] call FUNC(setUnconscious)); + onTransition = QUOTE([ARR_2(_this,(false))] call FUNC(setUnconsciousStatemachine)); }; class FatalTransitions { targetState = "CardiacArrest"; @@ -58,6 +68,11 @@ class ACE_Medical_StateMachine { // Transition state for handling instant death // This state raises the next transition in the same frame onStateEntered = QUOTE(DFUNC(enteredStateFatalInjury)); + class DeathAI { + events[] = {QGVAR(FatalInjuryInstantTransition)}; + targetState = "Dead"; + condition = QUOTE(!isPlayer _this && {GVAR(fatalInjuryConditionAI)}); + }; class SecondChance { events[] = {QGVAR(FatalInjuryInstantTransition)}; targetState = "CardiacArrest"; @@ -73,6 +88,10 @@ class ACE_Medical_StateMachine { class CardiacArrest { onStateEntered = QUOTE(DFUNC(enteredStateCardiacArrest)); onStateLeaving = QUOTE(DFUNC(leftStateCardiacArrest)); + class DeathAI { + targetState = "Dead"; + condition = QUOTE(!isPlayer _this && {GVAR(fatalInjuryConditionAI)}); + }; class Timeout { targetState = "Dead"; condition = QUOTE(DFUNC(conditionCardiacArrestTimer)); diff --git a/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf b/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf index 645f6794cc..b73d341c42 100644 --- a/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf +++ b/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf @@ -14,6 +14,7 @@ params ["_unit"]; +// 10% possible variance in cardiac arrest time private _time = GVAR(cardiacArrestTime); _time = _time + random [_time*-0.1, 0, _time*0.1]; diff --git a/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf b/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf index b22fac1ee3..123f8f9f1f 100644 --- a/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf +++ b/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf @@ -1,4 +1,5 @@ +#define DEBUG_MODE_FULL #include "script_component.hpp" params ["_unit", "_stateName"]; @@ -21,16 +22,19 @@ if (_painLevel > 0) then { }; // Handle spontaneous wakeup from unconsciousness -if (_unit call FUNC(hasStableVitals)) then { - private _lastWakeUpCheck = _unit getVariable [QGVAR(lastWakeUpCheck), CBA_missionTime]; - if (CBA_missionTime - _lastWakeUpCheck > SPONTANEOUS_WAKE_UP_INTERVAL) then { - _unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime]; - if ((random 1) < SPONTANEOUS_WAKE_UP_CHANCE) then { - TRACE_1("spontaneous wake up",_unit); - [QGVAR(WakeUp), _unit] call CBA_fnc_localEvent; +if (GVAR(spontaneousWakeUpChance) > 0) then { + if (_unit call FUNC(hasStableVitals)) then { + private _lastWakeUpCheck = _unit getVariable [QGVAR(lastWakeUpCheck), CBA_missionTime]; + if (CBA_missionTime - _lastWakeUpCheck > SPONTANEOUS_WAKE_UP_INTERVAL) then { + TRACE_2("Checking for wake up",_unit,GVAR(spontaneousWakeUpChance)); + _unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime]; + if ((random 1) < GVAR(spontaneousWakeUpChance)) then { + TRACE_1("Spontaneous wake up!",_unit); + [QGVAR(WakeUp), _unit] call CBA_fnc_localEvent; + }; }; + } else { + // Unstable vitals, procrastinate the next wakeup check + _unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime]; }; -} else { - // Unstable vitals, procrastinate the next wakeup check - _unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime]; }; diff --git a/addons/medical_status/functions/fnc_getBloodLoss.sqf b/addons/medical_status/functions/fnc_getBloodLoss.sqf index e70a536a73..21fd31bd49 100644 --- a/addons/medical_status/functions/fnc_getBloodLoss.sqf +++ b/addons/medical_status/functions/fnc_getBloodLoss.sqf @@ -5,11 +5,11 @@ * Arguments: * 0: The Unit * - * ReturnValue: - * Total blood loss of unit (liter per second) + * Return Value: + * Total blood loss of unit * * Example: - * [player] call ace_medical_fnc_getBloodLoss + * [bob] call ACE_medical_fnc_getBloodLoss * * Public: No */ diff --git a/addons/medical_status/functions/fnc_getBloodPressure.sqf b/addons/medical_status/functions/fnc_getBloodPressure.sqf index 118d5ca433..27bb6a0a6f 100644 --- a/addons/medical_status/functions/fnc_getBloodPressure.sqf +++ b/addons/medical_status/functions/fnc_getBloodPressure.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: The Unit * - * ReturnValue: + * Return Value: * 0: BloodPressure Low * 1: BloodPressure High * diff --git a/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf b/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf index bea0a8bba7..07f7ba5f9c 100644 --- a/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf @@ -7,9 +7,12 @@ * 1: Time since last update * 2: Global Sync Values (bloodbags) * - * ReturnValue: + * Return Value: * Blood volume change (liters per second) * + * Example: + * [player, 1, true] call ACE_medical_fnc_getBloodVolumeChange + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical_status/functions/fnc_getCardiacOutput.sqf b/addons/medical_status/functions/fnc_getCardiacOutput.sqf index 3198dd5936..8176a1fbe4 100644 --- a/addons/medical_status/functions/fnc_getCardiacOutput.sqf +++ b/addons/medical_status/functions/fnc_getCardiacOutput.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: The Unit * - * ReturnValue: + * Return Value: * Current cardiac output (liter per second) * * Example: @@ -26,8 +26,6 @@ params ["_unit"]; -if (_unit getVariable [QGVAR(inCardiacArrest), false]) exitWith { 0 }; - private _bloodVolume = ((_unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME]) / DEFAULT_BLOOD_VOLUME) * 100; private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE]; private _cardiacOutput = ((_bloodVolume / MODIFIER_CARDIAC_OUTPUT) + ((_heartRate / DEFAULT_HEART_RATE) - 1)) / 60; diff --git a/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf b/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf index 99fe97be94..fcceeec601 100644 --- a/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf +++ b/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf @@ -6,7 +6,7 @@ * 0: The Unit * 1: Body Part * - * ReturnValue: + * Return Value: * Has tourniquet applied * * Example: diff --git a/addons/medical_status/functions/fnc_initUnit.sqf b/addons/medical_status/functions/fnc_initUnit.sqf index 1a896bb50a..e18bb5bc17 100644 --- a/addons/medical_status/functions/fnc_initUnit.sqf +++ b/addons/medical_status/functions/fnc_initUnit.sqf @@ -5,8 +5,11 @@ * Arguments: * 0: The Unit * - * ReturnValue: - * nil + * Return Value: + * None + * + * Example: + * [bob] call ACE_medical_fnc_init * * Public: No */ @@ -39,6 +42,7 @@ _unit setVariable [QGVAR(painSuppressAdjustments), [], true]; _unit setVariable [QGVAR(openWounds), [], true]; _unit setVariable [QGVAR(bandagedWounds), [], true]; _unit setVariable [QGVAR(stitchedWounds), [], true]; +_unit setVariable [QEGVAR(medical_engine,isLimping), false, true]; // - Misc --------------------------------------------------------------------- _unit setVariable [QGVAR(isUnconscious), false, true]; @@ -59,18 +63,15 @@ _unit setVariable [QGVAR(bodyPartDamage), [0,0,0,0,0,0], true]; _unit setVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; #endif -// generic medical admin -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]; // TODO move to treatment -_logs = _unit getVariable [QGVAR(allLogs), []]; +private _logs = _unit getVariable [QGVAR(allLogs), []]; { _unit setVariable [_x, nil]; } forEach _logs; diff --git a/addons/medical_status/functions/fnc_isInMedicalFacility.sqf b/addons/medical_status/functions/fnc_isInMedicalFacility.sqf index 313ee8eca4..12e52ada19 100644 --- a/addons/medical_status/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical_status/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_status/functions/fnc_isInStableCondition.sqf b/addons/medical_status/functions/fnc_isInStableCondition.sqf index b9b6a31bff..e32b152e58 100644 --- a/addons/medical_status/functions/fnc_isInStableCondition.sqf +++ b/addons/medical_status/functions/fnc_isInStableCondition.sqf @@ -19,7 +19,7 @@ params ["_unit"]; if (!alive _unit) exitWith { false }; -if (_unit getVariable [QGVAR(isUnconscious), false]) exitWith { false }; +if (_unit getVariable ["ACE_isUnconscious", false]) exitWith { false }; if (_unit call FUNC(getBloodLoss) > 0) exitWith { false }; if (!(_unit call FUNC(hasStableVitals))) exitWith { false }; diff --git a/addons/medical_status/functions/fnc_isMedic.sqf b/addons/medical_status/functions/fnc_isMedic.sqf index ff5a1b24a9..f09fe88dbb 100644 --- a/addons/medical_status/functions/fnc_isMedic.sqf +++ b/addons/medical_status/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_status/functions/fnc_isMedicalVehicle.sqf b/addons/medical_status/functions/fnc_isMedicalVehicle.sqf index beef307301..3d21293248 100644 --- a/addons/medical_status/functions/fnc_isMedicalVehicle.sqf +++ b/addons/medical_status/functions/fnc_isMedicalVehicle.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: The Vehicle * - * ReturnValue: + * Return Value: * Is in of medic class * * Example: diff --git a/addons/medical_status/functions/fnc_setCardiacArrest.sqf b/addons/medical_status/functions/fnc_setCardiacArrest.sqf index 9354784662..2baba726d7 100644 --- a/addons/medical_status/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical_status/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 */ @@ -23,22 +26,4 @@ _unit setVariable [QGVAR(heartRate), 0, true]; ["ace_cardiacArrestEntered", [_unit]] call CBA_fnc_localEvent; -[_unit, true] call FUNC(setUnconscious); -[QEGVAR(medical,InjuryCritical), _unit] call CBA_fnc_localEvent; -private _timeInCardiacArrest = 120 + round(random(600)); - -[{ - params ["_args", "_idPFH"]; - _args params ["_unit", "_startTime", "_timeInCardiacArrest"]; - - private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE]; - if (_heartRate > 20 || !alive _unit) exitWith { - [_idPFH] call CBA_fnc_removePerFrameHandler; - _unit setVariable [QGVAR(inCardiacArrest), nil, true]; - }; - if (CBA_missionTime - _startTime >= _timeInCardiacArrest) exitWith { - [_idPFH] call CBA_fnc_removePerFrameHandler; - _unit setVariable [QGVAR(inCardiacArrest), nil, true]; - [_unit] call FUNC(setDead); - }; -}, 1, [_unit, CBA_missionTime, _timeInCardiacArrest] ] call CBA_fnc_addPerFrameHandler; +[_unit, true] call FUNC(setUnconsciousStatemachine); diff --git a/addons/medical_status/functions/fnc_setDead.sqf b/addons/medical_status/functions/fnc_setDead.sqf index 5abf76b6d5..c76fd9265d 100644 --- a/addons/medical_status/functions/fnc_setDead.sqf +++ b/addons/medical_status/functions/fnc_setDead.sqf @@ -6,7 +6,7 @@ * 0: The unit * 1: Reason for death * - * ReturnValue: + * Return Value: * None * * Example: diff --git a/addons/medical_status/functions/fnc_setUnconscious.sqf b/addons/medical_status/functions/fnc_setUnconscious.sqf index a4b4ed8f5d..8f42bd40a2 100644 --- a/addons/medical_status/functions/fnc_setUnconscious.sqf +++ b/addons/medical_status/functions/fnc_setUnconscious.sqf @@ -1,19 +1,24 @@ /* * Author: Glowbal * Sets a unit in the unconscious state. + * For Public Use * * Arguments: * 0: The unit that will be put in an unconscious state * 1: Set unconsciouns (default: true) + * 2: Minimum unconscious time (set to 0 to ignore) (default: 0) + * 3: Force wakeup at given time if vitals are stable (default: false) * - * ReturnValue: + * Return Value: * Success? * * Example: * [bob, true] call ace_medical_fnc_setUnconscious; + * [player, true, 5, true] call ace_medical_fnc_setUnconscious; * * Public: yes */ +#define DEBUG_MODE_FULL #include "script_component.hpp" // only run this after the settings are initialized @@ -21,41 +26,50 @@ if !(EGVAR(common,settingsInitFinished)) exitWith { EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setUnconscious), _this]; }; -params ["_unit", ["_knockOut", true]]; - -if (isNull _unit || {!(_unit isKindOf "CAManBase")}) exitWith {false}; +params ["_unit", ["_knockOut", true, [false]], ["_minWaitingTime", 0, [0]], ["_forcedWakup", false, [false]]]; +TRACE_4("setUnconscious",_unit,_knockOut,_minWaitingTime,_forcedWakup); +if ((isNull _unit) || {!alive _unit} || {!(_unit isKindOf "CAManBase")}) exitWith { + ERROR_3("Bad Unit %1 [Type: %2] [Alive: %3]",_unit,typeOf _unit,alive _unit); + false +}; if (!local _unit) exitWith { [QGVAR(setUnconscious), [_unit, _knockOut], _unit] call CBA_fnc_targetEvent; true }; - -if (_knockOut isEqualTo (_unit getVariable [QGVAR(isUnconscious), false])) exitWith {false}; - -// --- wake up -if !(_knockOut) exitWith { - _unit setVariable [QGVAR(isUnconscious), false, true]; - - [_unit, false] call EFUNC(medical_engine,setUnconsciousAnim); - ["ace_unconscious", [_unit, false]] call CBA_fnc_globalEvent; - - true +if (_knockOut isEqualTo (_unit getVariable ["ACE_isUnconscious", false])) exitWith { + WARNING_2("setUnconscious called with no change [Unit %1] [State [%2]", _unit, _knockOut); + false }; -// --- knock out -_unit setVariable [QGVAR(isUnconscious), true, true]; -_unit setVariable [QGVAR(lastWakeUpCheck), CBA_missiontime]; +private _beforeState = [_unit, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState; -if (_unit == ACE_player) then { - if (visibleMap) then {openMap false}; - while {dialog} do { - closeDialog 0; +if (_knockOut) then { + if (_minWaitingTime > 0) then { + if (_forcedWakup) then { + // If unit still has stable vitals at min waiting time, then force wake up + [{ + params [["_unit", objNull]]; + if ((alive _unit) && {_unit call FUNC(hasStableVitals)}) then { + TRACE_1("Doing delay wakeup",_unit); + [QGVAR(WakeUp), _unit] call CBA_fnc_localEvent; + } else { + TRACE_1("Skipping delay wakeup",_unit); + }; + }, [_unit], _minWaitingTime] call CBA_fnc_waitAndExecute; + }; + if (GVAR(spontaneousWakeUpChance) > 0) then { + _unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime + _minWaitingTime - SPONTANEOUS_WAKE_UP_INTERVAL]; + }; }; + + [QGVAR(knockOut), _unit] call CBA_fnc_localEvent; +} else { + [QGVAR(WakeUp), _unit] call CBA_fnc_localEvent; }; -[_unit, true] call EFUNC(medical_engine,setUnconsciousAnim); -[QGVAR(Unconscious), _unit] call CBA_fnc_localEvent; -["ace_unconscious", [_unit, true]] call CBA_fnc_globalEvent; +private _afterState = [_unit, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState; +TRACE_2("state change",_beforeState,_afterState); true diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index 45e01cbe4f..6d1335701b 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -248,10 +248,11 @@ class GVAR(Actions) { requiredMedic = 0; treatmentTime = 15; items[] = {}; - condition = QUOTE(!(_target call EFUNC(common,isAwake))); + condition = QUOTE(!(_target call EFUNC(common,isAwake)) && {!(_target getVariable [ARR_2('GVAR(receiveCPR)', false)])}); callbackSuccess = QFUNC(treatmentCPR); - callbackFailure = ""; - callbackProgress = QUOTE(!([(_this select 0) select 1] call EFUNC(common,isAwake))); + callbackFailure = QFUNC(treatmentCPR_failure); + callbackProgress = QFUNC(treatmentCPR_progress); + callbackStart = QFUNC(treatmentCPR_start); animationPatient = ""; animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medic"; @@ -305,6 +306,7 @@ class GVAR(Actions) { items[] = {"ACE_medKit"}; treatmentLocations[] = {QEGVAR(medical,useLocation_MedKit)}; requiredMedic = QEGVAR(medical,medicSetting_MedKit); + treatmentTime = QUOTE(_target call FUNC(HealTimeMedkit)); callbackSuccess = QFUNC(treatmentPartialHeal); itemConsumed = QEGVAR(medical,consumeItem_MedKit); }; diff --git a/addons/medical_treatment/ACE_Settings.hpp b/addons/medical_treatment/ACE_Settings.hpp index 0767cfb9d1..ef2baa1b6e 100644 --- a/addons/medical_treatment/ACE_Settings.hpp +++ b/addons/medical_treatment/ACE_Settings.hpp @@ -23,4 +23,25 @@ class ACE_Settings { typeName = "SCALAR"; value = 0; }; + class EGVAR(medical,CPRcreatesPulse) { + category = ECSTRING(medical,Category_Medical); + displayName = CSTRING(CPRcreatesPulse); + description = CSTRING(CPRcreatesPulse_Description); + typeName = "BOOL"; + value = 1; + }; + class EGVAR(medical,MedkitTime) { + category = ECSTRING(medical,Category_Medical); + displayName = CSTRING(MedkitTime); + description = CSTRING(MedkitTime_Description); + typeName = "SCALAR"; + value = 0; + }; + class EGVAR(medical,PAKTime) { + category = ECSTRING(medical,Category_Medical); + displayName = CSTRING(PAKTime); + description = CSTRING(PAKTime_Description); + typeName = "SCALAR"; + value = 0; + }; }; diff --git a/addons/medical_treatment/XEH_PREP.hpp b/addons/medical_treatment/XEH_PREP.hpp index cbbfda23cf..451ad2ead7 100644 --- a/addons/medical_treatment/XEH_PREP.hpp +++ b/addons/medical_treatment/XEH_PREP.hpp @@ -9,6 +9,7 @@ PREP(actionDiagnose); PREP(actionLoadUnit); PREP(actionPlaceInBodyBag); PREP(actionUnloadUnit); +PREP(addLoadPatientActions); // treaments PREP(canTreat); @@ -19,6 +20,9 @@ PREP(treatment_success); PREP(treatmentBandage); PREP(treatmentBandageLocal); +PREP(treatmentCPR_failure); +PREP(treatmentCPR_progress); +PREP(treatmentCPR_start); PREP(treatmentCPR); PREP(treatmentCPRLocal); PREP(treatmentFullHeal); @@ -37,15 +41,16 @@ PREP(treatmentTourniquetRemove); // misc PREP(addToLog); PREP(addToTriageCard); -PREP(addUnloadPatientActions); PREP(canAccessMedicalEquipment); PREP(dropDownTriageCard); PREP(getTriageStatus); PREP(handleBandageOpening); PREP(healTime); +PREP(HealTimeMedkit); PREP(isBeingCarried); PREP(isBeingDragged); PREP(onMedicationUsage); +PREP(calculateBlood); // items PREP(checkItems); diff --git a/addons/medical_treatment/config.cpp b/addons/medical_treatment/config.cpp index 9dad6833f9..0791254619 100644 --- a/addons/medical_treatment/config.cpp +++ b/addons/medical_treatment/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_medical"}; author = ECSTRING(common,ACETeam); - authors[] = {""}; + authors[] = {"Glowbal", "KoffeinFlummi", "Arcanum"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; diff --git a/addons/medical_treatment/functions/fnc_HealTimeMedkit.sqf b/addons/medical_treatment/functions/fnc_HealTimeMedkit.sqf new file mode 100644 index 0000000000..28e58c40b1 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_HealTimeMedkit.sqf @@ -0,0 +1,31 @@ +/* + * Author: Ruthberg, Arcanum + * Calculates the personal aid kit treatment time based on amount of damage to heal + * + * Arguments: + * unit + * + * Return Value: + * treatment time + * + * Example: + * [_target] call ace_medical_treatment_fnc_HealTimeMedkit + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +private _totalDamage = 0; +private _treatTime = 0; + +{ + _totalDamage = _totalDamage + _x; +} forEach (_unit getVariable [QEGVAR(medical,bodyPartDamage), []]); +if (EGVAR(medical,MedkitTime) > 0) then { + _treatTime = EGVAR(medical,MedkitTime); +} else { + _treatTime = 10 max (_totalDamage * 5) min 180; +}; +_treatTime diff --git a/addons/medical_treatment/functions/fnc_actionCheckResponse.sqf b/addons/medical_treatment/functions/fnc_actionCheckResponse.sqf index 58df8bcd3a..2353b9c9ee 100644 --- a/addons/medical_treatment/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical_treatment/functions/fnc_actionCheckResponse.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, kevin] call ACE_medical_treatment_fnc_actionCheckResponse + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf b/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf index 1a259d42c1..ec9f6cfb85 100644 --- a/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf @@ -1,32 +1,36 @@ /* * 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 + * Vehicle they are loaded into (objNull on failure) + * + * Example: + * [bob, kevin] call ACE_medical_treatment_treatment_fnc_actionLoadUnit * * Public: No */ #include "script_component.hpp" -params ["_caller", "_target"]; +params ["_caller", "_target", ["_vehicle", objNull]]; -if (_target call EFUNC(common,isAwake)) exitWith { +if ([_target] call EFUNC(common,isAwake)) exitWith { [QEGVAR(common,displayTextStructured), [[ELSTRING(medical,CanNotLoaded), _target call EFUNC(common,getName)], 1.5, _caller], _caller] call CBA_fnc_targetEvent; }; -if (_target call FUNC(isBeingCarried)) then { +if ([_target] call FUNC(isBeingCarried)) then { [_caller, _target] call EFUNC(dragging,dropObject_carry); }; -if (_target call FUNC(isBeingDragged)) then { +if ([_target] call FUNC(isBeingDragged)) then { [_caller, _target] call EFUNC(dragging,dropObject); }; -private _vehicle = [_caller, _target] call EFUNC(common,loadPerson); +private _vehicle = [_caller, _target, _vehicle] call EFUNC(common,loadPerson); _vehicle diff --git a/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf b/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf index 0842e412fb..e2329bd5fc 100644 --- a/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf +++ b/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf @@ -10,7 +10,7 @@ * body bag (will return objNull when run where target is not local) * * Example: - * [player, cursorTarget] call ace_medical_fnc_actionPlaceInBodyBag + * [player, cursorTarget] call ACE_medical_treatment_fnc_actionPlaceInBodyBag * * Public: Yes */ @@ -40,7 +40,7 @@ private _direction = _dirVect call CBA_fnc_vectDir; // move the body away now, so it won't physX the bodyBag object (this setPos seems to need to be called where object is local) _target setPosASL [-5000, -5000, 0]; -private _bodyBag = createVehicle ["ACE_bodyBagObject", _position, [], 0, ""]; +private _bodyBag = createVehicle ["ACE_bodyBagObject", _position, [], 0, "NONE"]; // prevent body bag from flipping _bodyBag setPosASL _position; diff --git a/addons/medical_treatment/functions/fnc_actionUnloadUnit.sqf b/addons/medical_treatment/functions/fnc_actionUnloadUnit.sqf index b4f71cf5bb..0833d8858e 100644 --- a/addons/medical_treatment/functions/fnc_actionUnloadUnit.sqf +++ b/addons/medical_treatment/functions/fnc_actionUnloadUnit.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, kevin, false] call ACE_medical_treatment_fnc_actionUnloadUnit + * * Public: No */ #include "script_component.hpp" @@ -17,7 +20,7 @@ params ["_caller", "_target", ["_drag", false]]; // cannot unload a unit not in a vehicle. -if (vehicle _target == _target) exitWith {}; -if (_target call EFUNC(common,isAwake)) exitWith {}; +if (vehicle _target == _target) exitWith {WARNING_1("Unit [%1] not in vehicle",_target);}; +if (_target call EFUNC(common,isAwake)) exitWith {WARNING_1("Unit [%1] is awake",_target);}; ["ace_unloadPersonEvent", [_target, vehicle _target, _caller], _target] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_addLoadPatientActions.sqf b/addons/medical_treatment/functions/fnc_addLoadPatientActions.sqf new file mode 100644 index 0000000000..887057a798 --- /dev/null +++ b/addons/medical_treatment/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_treatment_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_treatment/functions/fnc_addToLog.sqf b/addons/medical_treatment/functions/fnc_addToLog.sqf index 9308148b32..b805425673 100644 --- a/addons/medical_treatment/functions/fnc_addToLog.sqf +++ b/addons/medical_treatment/functions/fnc_addToLog.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [bob, "type", "message", [_args]] call ACE_medical_treatment_fnc_addToLog + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/medical_treatment/functions/fnc_addToTriageCard.sqf b/addons/medical_treatment/functions/fnc_addToTriageCard.sqf index dc4e4090b6..9f48b26304 100644 --- a/addons/medical_treatment/functions/fnc_addToTriageCard.sqf +++ b/addons/medical_treatment/functions/fnc_addToTriageCard.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, "bandage"] call ACE_medical_treatment_fnc_addToTriageCard + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/medical_treatment/functions/fnc_addUnloadPatientActions.sqf b/addons/medical_treatment/functions/fnc_addUnloadPatientActions.sqf deleted file mode 100644 index 2725365bc1..0000000000 --- a/addons/medical_treatment/functions/fnc_addUnloadPatientActions.sqf +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Author: esteldunedain - * Create one unload action per unconscious passenger - * - * Argument: - * 0: Vehicle - * 1: Player - * 3: Parameters - * - * Return value: - * Children actions - * - * Public: No - */ -#include "script_component.hpp" -params ["_vehicle", "_player", "_parameters"]; - -private _actions = []; - -{ - private _unit = _x; - if (_unit != _player && {(alive _unit) && {_unit getVariable ["ACE_isUnconscious", false]}}) then { - _actions pushBack - [ - [ - str(_unit), - [_unit, true] call EFUNC(common,getName), - "", - {[_player, (_this select 2) select 0] call FUNC(actionUnloadUnit);}, - {true}, - {}, - [_unit] - ] call EFUNC(interact_menu,createAction), - [], - _unit - ]; - }; -} forEach crew _vehicle; - -_actions diff --git a/addons/medical_treatment/functions/fnc_calculateBlood.sqf b/addons/medical_treatment/functions/fnc_calculateBlood.sqf new file mode 100644 index 0000000000..d805ee1ffa --- /dev/null +++ b/addons/medical_treatment/functions/fnc_calculateBlood.sqf @@ -0,0 +1,30 @@ +/* + * Author: Zakant + * Calculate the blood lost and blood volume for a unit. Used from CPR to simulate a heart rate while in cardiac arrest. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params["_unit"]; + +// We will just simulate blood flow for now! +private _lastTimeUpdated = _unit getVariable [QEGVAR(medical,lastTimeUpdated), CBA_missionTime]; +private _deltaT = CBA_missionTime - _lastTimeUpdated; + +private _lastTimeValuesSynced = _unit getVariable [QEGVAR(medical,lastMomentValuesSynced), 0]; +private _syncValues = (CBA_missionTime - _lastTimeValuesSynced) >= (10 + floor(random(10))); + +_unit setVariable [QEGVAR(medical,lastTimeUpdated), CBA_missionTime]; +if (_deltaT != 0) then { + private _change = ([_unit, _deltaT, _syncValues] call EFUNC(medical,getBloodVolumeChange)); + private _bloodVolume = (_unit getVariable [QEGVAR(medical,bloodVolume), DEFAULT_BLOOD_VOLUME]) + _change; + _bloodVolume = 0 max _bloodVolume min DEFAULT_BLOOD_VOLUME; + _unit setVariable [QEGVAR(medical,bloodVolume), _bloodVolume, _syncValues]; +}; diff --git a/addons/medical_treatment/functions/fnc_canAccessMedicalEquipment.sqf b/addons/medical_treatment/functions/fnc_canAccessMedicalEquipment.sqf index 53707ae65c..691197447e 100644 --- a/addons/medical_treatment/functions/fnc_canAccessMedicalEquipment.sqf +++ b/addons/medical_treatment/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_treatment_fnc_canAccessMedicalEquipment + * * Public: Yes */ diff --git a/addons/medical_treatment/functions/fnc_canTreatCached.sqf b/addons/medical_treatment/functions/fnc_canTreatCached.sqf index 1f83f194e6..d242a2c93b 100644 --- a/addons/medical_treatment/functions/fnc_canTreatCached.sqf +++ b/addons/medical_treatment/functions/fnc_canTreatCached.sqf @@ -8,9 +8,12 @@ * 2: Selection name * 3: ACE_Medical_Treatment Classname * - * ReturnValue: + * Return Value: * Can Treat * + * Example: + * [bob, kevin, "selection", "classname"] call ACE_medical_treatment_fnc_canTreatCached + * * Public: No */ diff --git a/addons/medical_treatment/functions/fnc_dropDownTriageCard.sqf b/addons/medical_treatment/functions/fnc_dropDownTriageCard.sqf index c499283446..6bc1358754 100644 --- a/addons/medical_treatment/functions/fnc_dropDownTriageCard.sqf +++ b/addons/medical_treatment/functions/fnc_dropDownTriageCard.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [true] call ACE_medical_treatment_fnc_dropDownTriageCard + * * Public: Yes */ diff --git a/addons/medical_treatment/functions/fnc_hasItem.sqf b/addons/medical_treatment/functions/fnc_hasItem.sqf index b57de5dcfa..6ed8f080f0 100644 --- a/addons/medical_treatment/functions/fnc_hasItem.sqf +++ b/addons/medical_treatment/functions/fnc_hasItem.sqf @@ -7,9 +7,12 @@ * 1: Patient * 2: Item * - * ReturnValue: + * Return Value: * Has the items * + * Example: + * [bob, patient, "bandage"] call ACE_medical_treatment_fnc_hasItem + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/medical_treatment/functions/fnc_hasItems.sqf b/addons/medical_treatment/functions/fnc_hasItems.sqf index 51fbd2a568..c06be03b10 100644 --- a/addons/medical_treatment/functions/fnc_hasItems.sqf +++ b/addons/medical_treatment/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_treatment_fnc_hasItems + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/medical_treatment/functions/fnc_healTime.sqf b/addons/medical_treatment/functions/fnc_healTime.sqf index 9f0c4adfbc..5178d50a1f 100644 --- a/addons/medical_treatment/functions/fnc_healTime.sqf +++ b/addons/medical_treatment/functions/fnc_healTime.sqf @@ -18,9 +18,14 @@ params ["_unit"]; private _totalDamage = 0; +private _treatTime = 0; { _totalDamage = _totalDamage + _x; } forEach (_unit getVariable [QEGVAR(medical,bodyPartDamage), []]); - -10 max (_totalDamage * 5) min 180 +if (EGVAR(medical,PAKTime) > 0) then { + _treatTime = EGVAR(medical,PAKTime); +} else { + _treatTime = 10 max (_totalDamage * 5) min 180; +}; +_treatTime diff --git a/addons/medical_treatment/functions/fnc_isBeingCarried.sqf b/addons/medical_treatment/functions/fnc_isBeingCarried.sqf index b47c5e475f..ee61637676 100644 --- a/addons/medical_treatment/functions/fnc_isBeingCarried.sqf +++ b/addons/medical_treatment/functions/fnc_isBeingCarried.sqf @@ -9,7 +9,7 @@ * Is being carried * * Example: - * [bob] call ace_medical_fnc_isBeingCarried + * [bob] call ACE_medical_treatment_fnc_isBeingCarried * * Public: No */ diff --git a/addons/medical_treatment/functions/fnc_isBeingDragged.sqf b/addons/medical_treatment/functions/fnc_isBeingDragged.sqf index 929b48ccb7..e0d320b495 100644 --- a/addons/medical_treatment/functions/fnc_isBeingDragged.sqf +++ b/addons/medical_treatment/functions/fnc_isBeingDragged.sqf @@ -9,7 +9,7 @@ * Is being dragged * * Example: - * [bob] call ace_medical_fnc_isBeingDragged + * [bob] call ACE_medical_treatment_fnc_isBeingDragged * * Public: No */ diff --git a/addons/medical_treatment/functions/fnc_litterCleanupLoop.sqf b/addons/medical_treatment/functions/fnc_litterCleanupLoop.sqf index ee3ff5d811..e63aaa82a4 100644 --- a/addons/medical_treatment/functions/fnc_litterCleanupLoop.sqf +++ b/addons/medical_treatment/functions/fnc_litterCleanupLoop.sqf @@ -5,9 +5,12 @@ * Arguments: * None * - * ReturnValue: + * Return Value: * None * + * Example: + * call ACE_medical_fnc_litterCleanupLoop + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical_treatment/functions/fnc_litterHandleCreate.sqf b/addons/medical_treatment/functions/fnc_litterHandleCreate.sqf index 0b37207daf..f491968e36 100644 --- a/addons/medical_treatment/functions/fnc_litterHandleCreate.sqf +++ b/addons/medical_treatment/functions/fnc_litterHandleCreate.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * ["litter", [2, 5, 6], bob] call ACE_medical_treatment_fnc_handleCreateLitter + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf index 803e1d8651..8c30da8d84 100644 --- a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf @@ -12,6 +12,9 @@ * Return Value: * None * + * Example: + * [bob, "classname", "varname", 5, 6, ["stuff"]] call ACE_medical_treatment_fnc_onMedicationUsage + * * Public: No */ diff --git a/addons/medical_treatment/functions/fnc_treatment.sqf b/addons/medical_treatment/functions/fnc_treatment.sqf index cdb170c7ad..fdefeed292 100644 --- a/addons/medical_treatment/functions/fnc_treatment.sqf +++ b/addons/medical_treatment/functions/fnc_treatment.sqf @@ -179,6 +179,19 @@ if (isArray (_config >> "sounds")) then { ]; }; +private _startCallback = getText (_config >> "callbackStart"); +if (isNil _startCallback) then { + _startCallback = compile _startCallback; +} else { + _startCallback = missionNamespace getVariable _startCallback; +}; + +if !(_startCallback isEqualType {}) then { + _startCallback = {TRACE_1("startCallback was NOT code",_startCallback)}; +}; + +[_caller, _target, _bodyPart, _className, _items, _usersOfItems] call _startCallback; + // start treatment [ _treatmentTime, diff --git a/addons/medical_treatment/functions/fnc_treatmentCPR.sqf b/addons/medical_treatment/functions/fnc_treatmentCPR.sqf index 0cfb3bddc8..570878c4f2 100644 --- a/addons/medical_treatment/functions/fnc_treatmentCPR.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentCPR.sqf @@ -18,6 +18,10 @@ params ["_caller", "_target", "_selectionName", "_className", "_items"]; +_target setVariable [QEGVAR(medical,heartRate), 0, true]; +_target setVariable [QGVAR(receiveCPR), false, true]; // CPR finished +[_target] call FUNC(calculateBlood); + if (alive _target && {_target getVariable [QEGVAR(medical,inCardiacArrest), false]}) then { [_target, "activity_view", ELSTRING(medical,Activity_cpr), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical_treatment/functions/fnc_treatmentCPR_failure.sqf b/addons/medical_treatment/functions/fnc_treatmentCPR_failure.sqf new file mode 100644 index 0000000000..bca59a1246 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_treatmentCPR_failure.sqf @@ -0,0 +1,22 @@ +/* + * Author: Zakant + * Handles the failure of the CPR treatment. + * + * Arguments: + * 0: The medic + * 1: The patient + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_caller", "_target"]; + +if (!(_target call EFUNC(common,isAwake)) || {_target getVariable [QEGVAR(medical,inCardiacArrest), false]}) then { + _target setVariable [QEGVAR(medical,heartRate), 0, true]; +}; +_target setVariable [QGVAR(receiveCPR), false, true]; +[_target] call FUNC(calculateBlood); diff --git a/addons/medical_treatment/functions/fnc_treatmentCPR_progress.sqf b/addons/medical_treatment/functions/fnc_treatmentCPR_progress.sqf new file mode 100644 index 0000000000..02504607d4 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_treatmentCPR_progress.sqf @@ -0,0 +1,28 @@ +/* + * Author: Zakant + * Handles the progress of the CPR treatment. + * + * Arguments: + * 0: Arguments + * 0: Caller + * 1: Target + * 1: Elapsed Time + * 2: Total Time + * + * Return Value: + * May Treatment continue + * + * Public: No + */ +#include "script_component.hpp" + +params ["_args", "_elapsedTime", "_totalTime"]; +_args params ["_caller", "_target"]; + +// If the patient awakes by mysterious force, no cpr is needed! +if (_target call EFUNC(common,isAwake)) exitWith {false}; +if (!(_target getVariable [QEGVAR(medical,inCardiacArrest), false])) exitWith {false}; + +[_target] call FUNC(calculateBlood); // Calculate blood volume. If their is no pulse, nothing happens! + +(alive _target) // CPR may only proceed if the patient is not dead diff --git a/addons/medical_treatment/functions/fnc_treatmentCPR_start.sqf b/addons/medical_treatment/functions/fnc_treatmentCPR_start.sqf new file mode 100644 index 0000000000..0012a01d2b --- /dev/null +++ b/addons/medical_treatment/functions/fnc_treatmentCPR_start.sqf @@ -0,0 +1,23 @@ +/* + * Author: Zakant + * Handles the start of the CPR treatment. + * + * Arguments: + * 0: The medic + * 1: The patient + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_caller", "_target"]; + +_target setVariable [QGVAR(receiveCPR), true, true]; // Target receives CPR +if (EGVAR(medical,CPRcreatesPulse) && {_target getVariable [QEGVAR(medical,heartRate), 80] == 0}) then { + _target setVariable [QEGVAR(medical,heartRate), round (30 + random [-5, 0, 5]) , true]; // And we have a (random) pulse +}; + +_target setVariable [QEGVAR(medical,lastTimeUpdated), CBA_missionTime, true]; diff --git a/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf b/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf index 48f9f6fc60..403e8179d3 100644 --- a/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf @@ -28,6 +28,7 @@ _target setVariable [QGVAR(occludedMedications), nil, true]; _target setVariable [QEGVAR(medical,openWounds), [], true]; _target setVariable [QEGVAR(medical,bandagedWounds), [], true]; _target setVariable [QEGVAR(medical,stitchedWounds), [], true]; +_target setVariable [QEGVAR(medical_engine,isLimping), false, true]; // vitals _target setVariable [QEGVAR(medical,heartRate), 80, true]; @@ -47,7 +48,7 @@ _target setVariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0], true]; // generic medical admin _target setVariable [QEGVAR(medical,inCardiacArrest), false, true]; -_target setVariable [QEGVAR(medical,isUnconscious), false, true]; +_target setVariable ["ACE_isUnconscious", false, true]; _target setVariable [QEGVAR(medical,hasLostBlood), 0, true]; _target setVariable [QEGVAR(medical,isBleeding), false, true]; _target setVariable [QEGVAR(medical,hasPain), false, true]; @@ -62,6 +63,9 @@ private _allUsedMedication = _target getVariable [QEGVAR(medical,allUsedMedicati _target setVariable [_x select 0, nil]; } forEach _allUsedMedication; +// Reset triage card since medication is all reset +_target setVariable [QEGVAR(medical,triageCard), [], true]; + [_target, false] call EFUNC(medical_engine,setLimping); // Resetting damage diff --git a/addons/medical_treatment/functions/fnc_treatmentSurgicalKit_onProgress.sqf b/addons/medical_treatment/functions/fnc_treatmentSurgicalKit_onProgress.sqf index bdda10d66c..88c74f8139 100644 --- a/addons/medical_treatment/functions/fnc_treatmentSurgicalKit_onProgress.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentSurgicalKit_onProgress.sqf @@ -12,6 +12,9 @@ * Return Value: * Succesful treatment started * + * Example: + * [[bob, kevin], 5, 5] call ACE_medical_treatment_fnc_treatmentAdvanced_surgicalKit_onProgress + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical_treatment/functions/fnc_useItems.sqf b/addons/medical_treatment/functions/fnc_useItems.sqf index e1372b247d..bf2c6f1d90 100644 --- a/addons/medical_treatment/functions/fnc_useItems.sqf +++ b/addons/medical_treatment/functions/fnc_useItems.sqf @@ -7,10 +7,13 @@ * 1: Patient * 2: Items > * - * ReturnValue: + * Return Value: * 0: success * 1: Unit * + * Example: + * [unit, patient, ["bandage"]] call ACE_medical_treatment_fnc_useItems + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 6c665e0ba6..72b3f308d7 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -27,6 +27,14 @@ Abilita la creazione della barella dopo trattamento 治療を始めると、医療廃棄物の作成を有効化する + + CPR creates pulse + HLW erzeugt einen Puls + + + CPR will create a pulse for the patient while performing + HLW erzeugt während der Behandlung beim Patienten einen Puls + Litter Simulation Detail Detale zużytych medykamentów @@ -78,6 +86,17 @@ 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 は永遠です。 + + How long should PAK take to apply ? + + + How long should PAK take to apply ? Use 0 for default (based on damage) + + + How long should Medkit take to apply ? + + + How long should Medkit take to apply ? Use 0 for default (based on damage) diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index c773d26693..cbf38ad364 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -5,8 +5,11 @@ * Arguments: * 0: The Unit * - * ReturnValue: - * + * Return Value: + * None + * + * Example: + * [bob] call ACE_medical_fnc_handleUnitVitals * * Example: * [player] call ace_medical_fnc_handleUnitVitals diff --git a/addons/microdagr/CfgVehicles.hpp b/addons/microdagr/CfgVehicles.hpp index cf596c9762..cc06db69f9 100644 --- a/addons/microdagr/CfgVehicles.hpp +++ b/addons/microdagr/CfgVehicles.hpp @@ -36,8 +36,8 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleMapFill); - scope = 2; - isGlobal = 0; + scope = 1; + isGlobal = 1; isSingular = 1; icon = QPATHTOF(UI\Icon_Module_microDAGR_ca.paa); functionPriority = 0; 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/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/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 b3b28775d9..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 getDir _targetPos) - (([ACE_player] call CBA_fnc_headDir) select 0); + 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_moduleMapFill.sqf b/addons/microdagr/functions/fnc_moduleMapFill.sqf index 03089a4ff4..46b071122a 100644 --- a/addons/microdagr/functions/fnc_moduleMapFill.sqf +++ b/addons/microdagr/functions/fnc_moduleMapFill.sqf @@ -15,7 +15,6 @@ */ #include "script_component.hpp" -if !(isServer) exitWith {}; params ["_logic"]; [_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule); 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..f60db3bb0f 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; - _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; - _numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude); + private _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; + _rangeText = format ["%1km", _2dDistanceKm toFixed 3]; + 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,18 +134,18 @@ 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; - _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; + private _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; + _rangeText = format ["%1km", _2dDistanceKm toFixed 3]; }; (_display displayCtrl IDC_MODECOMPASS_BEARING) ctrlSetText _bearingText; @@ -158,15 +155,15 @@ 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; - _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])]; + private _2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000; + _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", _2dDistanceKm toFixed 3])]; } forEach _waypoints; _currentIndex = (_currentIndex max 0) min (count _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/stringtable.xml b/addons/microdagr/stringtable.xml index 5be5d853c3..f9015c5512 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ GPS MicroDAGR MicroDAGR GPS MicroDAGR GPS + 微型军用GPS接收器 + 微型軍用GPS接收器 MicroDAGR advanced GPS receiver @@ -28,6 +30,8 @@ Recepitor GPS avançado MicroDAGR MicroDAGR は改良された GPS 受信機です MicroDAGR 고급 위성항법 수신기 + 微型军用高级防御GPS接收器 + 微型軍用高級防禦GPS接收器 Angular Unit: @@ -40,8 +44,10 @@ Szögmértékegység: Unità angolare: Unidade Angular: - 角度の種類: + 角度の種類: 각도의 단위: + 角密位: + 角密位: Mils @@ -54,8 +60,10 @@ Mil Mils Mils: - ミリ ラジアン + ミル + 密位 + 密位 Show Waypoints On Map: @@ -68,8 +76,10 @@ Útvonalpontok mutatása a térképen: Mostra waypoint sulla mappa: Mostrar Waypoints no mapa: - 地図へウェイポイントを表示: + 地図へウェイポイントを表示: 웨이포인트를 지도에 보이기: + 显示路径点在地图上: + 顯示路徑點在地圖上: Degrees @@ -84,6 +94,8 @@ Graus 角度 각도 + + On @@ -98,6 +110,8 @@ Be 有効 켜기 + 开启 + 開啟 Off @@ -112,6 +126,8 @@ Ki 無効 끄기 + 关闭 + 關閉 Enter Grid Cords: @@ -124,8 +140,10 @@ Add meg a rácskoordinátákat: Introduci griglia coordinate: Digite as Ccords. do Grid - 座標を入力: - 망 좌표 입력: + 座標を入力: + 输入网格座标: + 輸入網格座標: + 좌표 입력: Name of [%1] @@ -140,6 +158,8 @@ Nome do [%1] [%1] の名前 [%1] 의 이름 + 名称 [%1] + 名稱 [%1] MGRS-New @@ -153,7 +173,9 @@ Nuovo MGRS MGRS-Novo MGRS-New - MGRS-새 것 + 军事网格座标系统-新型 + 軍事網格座標系統-新型 + MGRS-New WGD @@ -168,6 +190,8 @@ WGD WGD WGD + 世界座标 + 世界座標 Range: @@ -180,8 +204,10 @@ Távolság: Distanza: Distância: - 距離: + 距離: 거리: + 范围: + 範圍: Compass Direction @@ -196,6 +222,8 @@ Direção na bússula 方位磁石での方位 방위 + 指北针方位 + 指北針方位 Mark @@ -210,6 +238,8 @@ Marca マーク 표시 + 标记 + 標記 Waypoints @@ -224,6 +254,8 @@ Waypoints ウェイポイント 웨이포인트 + 路径点 + 路徑點 Connect To @@ -238,6 +270,8 @@ Conectar à 次に接続 연결 + 连接到 + 連接到 Settings @@ -252,6 +286,8 @@ Opções 設定 설정 + 设定 + 設定 SetWP @@ -264,8 +300,10 @@ UP Beállítása Definisci WayPoints Definir WP - ウェイポイント設定 + ウェイポイント設定 웨이포인트 설정 + 设置路径点 + 設置路徑點 Add @@ -280,6 +318,8 @@ Adicionar 追加 더하기 + 新增 + 新增 Delete @@ -294,6 +334,8 @@ Törlés 削除 지우기 + 删除 + 刪除 Toggle MicroDAGR Display Mode @@ -308,6 +350,8 @@ Alternar Modo de Display do MicroDAGR MicroDAGR の表示モード MicroDAGR 화면 모드 토글 + 切换微型军用GPS接收器显示模式 + 切換微型軍用GPS接收器顯示模式 Show MicoDAGR @@ -322,6 +366,8 @@ Mostrar MicroDAGR MicoDAGR を表示 MicroDAGR 꺼내기 + 显示微型军用GPS接收器 + 顯示微型軍用GPS接收器 Configure MicroDAGR @@ -336,6 +382,8 @@ Configurar MicroDAGR MicroDAGR を設定 MicroDAGR 설정하기 + 设定微型军用GPS接收器 + 設定微型軍用GPS接收器 Close MicroDAGR @@ -350,6 +398,8 @@ Fechar MicroDAGR MicroDAGR を閉じる MicroDAGR 집어넣기 + 关闭微型军用GPS接收器 + 關閉微型軍用GPS接收器 MicroDAGR Map Fill @@ -364,6 +414,8 @@ Riempimento Mappa MicroDAGR MicroDAGR での地図情報 MicroDAGR - 지도채우기 + 微型军用GPS接收器地图资料 + 微型軍用GPS接收器地圖資料 MicroDAGR Map Fill @@ -378,6 +430,8 @@ Riempimento Mappa MicroDAGR MicroDAGR での地図情報 MicroDAGR - 지도채우기 + 微型军用GPS接收器地图资料 + 微型軍用GPS接收器地圖資料 How much map data is filled on MicroDAGR's @@ -392,6 +446,8 @@ Quanti dati sono trasferiti nella mappa del MicroDAGR MicroDAGR で表示する地図情報を決定します 얼마나 많은 데이터가 MicroDAGR에 있는지에 대한 정보 + 有多少地图数据会显示在微型军用GPS接收器 + 有多少地圖數據會顯示在微型軍用GPS接收器 Full Satellite + Buildings @@ -406,6 +462,8 @@ Satellite Completo + Edifici 完全な衛星画像と建物 위성 사진 + 건물 + 完整卫星画面 + 建筑物位置 + 完整衛星畫面 + 建築物位置 Topographical + Roads @@ -420,6 +478,8 @@ Topografico + Strade 地形と道路 지형학 도표 + 도로 + 地形 + 道路 + 地形 + 道路 None (Cannot use map view) @@ -434,6 +494,8 @@ 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. @@ -448,6 +510,8 @@ Controlla quanti dati sono presenti negli oggetti MicroDAGR. Meno dati costringono la vista mappa a mostrare meno informazioni nella minimappa. アイテム上で表示されるデータ量を決定します。設定を減らすと地図上での情報が少なくなります。 MicroDAGR에 얼마나 많은 데이터가 들어있는지 정합니다. 적을 수록 지도상에도 비춰지는게 적어집니다. + 设定有多少数据会显示在微型军用GPS接收器上。这些资料的多寡会反映在迷你地图的显示上。 + 設定有多少數據會顯示在微型軍用GPS接收器上。這些資料的多寡會反映在迷你地圖的顯示上。 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/stringtable.xml b/addons/minedetector/stringtable.xml index 456873d2c4..0e2e31e5a6 100644 --- a/addons/minedetector/stringtable.xml +++ b/addons/minedetector/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -11,6 +11,8 @@ Metalldetektor 지뢰탐지기 Metal detector + 金属探测器 + 金屬探測器 Metal detector @@ -22,6 +24,8 @@ Metalldetektor 지뢰탐지기 Metal detector + 金属探测器 + 金屬探測器 Activate @@ -33,6 +37,8 @@ Aktivieren 작동 Attiva + 启用探测器 + 啟用探測器 Deactivate @@ -44,6 +50,8 @@ Deaktivieren 끄기 Disattiva + 停用探测器 + 停用探測器 Connect Headphones @@ -55,6 +63,8 @@ 헤드폰에 연결 Connecter les écouteurs Connetti Auricolari + 连接耳机 + 連接耳機 Disconnect Headphones @@ -66,6 +76,8 @@ 헤드폰 연결끊기 Déconnecter les écouteurs Disconnetti Auricolari + 断开耳机 + 斷開耳機 Headphones Connected @@ -77,6 +89,8 @@ 헤드폰 연결됨 Écouteurs connectés Auricolari Connessi + 已连接耳机 + 已連接耳機 Headphones Disconnected @@ -88,6 +102,8 @@ 헤드폰 연결끊김 Écouteurs déconnectés Auricolari Disconnessi + 已断开耳机 + 已斷開耳機 diff --git a/addons/missileguidance/ACE_Settings.hpp b/addons/missileguidance/ACE_Settings.hpp deleted file mode 100644 index 6394e75390..0000000000 --- a/addons/missileguidance/ACE_Settings.hpp +++ /dev/null @@ -1,9 +0,0 @@ -class ACE_Settings { - class GVAR(enabled) { - value = 2; - typeName = "SCALAR"; - displayName = CSTRING(Title); - description = CSTRING(Desc); - values[] = {CSTRING(Off), CSTRING(PlayerOnly), CSTRING(PlayerAndAi)}; - }; -}; diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 49fa40331e..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,26 +45,6 @@ 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 {}; @@ -109,7 +89,7 @@ class CfgAmmo { 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_pre_init.sqf b/addons/missileguidance/XEH_pre_init.sqf index b47cf6628d..f377efddb6 100644 --- a/addons/missileguidance/XEH_pre_init.sqf +++ b/addons/missileguidance/XEH_pre_init.sqf @@ -6,4 +6,9 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +// Formally a ace_setting, users can still disable by `setting ace_missileguidance_enabled = x;` +// [0 - Off , 1 - PlayerOnly, 2 - PlayerAndAi] +// As weapons take config changes, there is little point in being able to disable guidance +if (isNil QGVAR(enabled)) then { GVAR(enabled) = 2; }; + ADDON = true; diff --git a/addons/missileguidance/config.cpp b/addons/missileguidance/config.cpp index c97a542a7f..0ce70a6026 100644 --- a/addons/missileguidance/config.cpp +++ b/addons/missileguidance/config.cpp @@ -14,10 +14,8 @@ class CfgPatches { }; #include "ACE_GuidanceConfig.hpp" -#include "ACE_Settings.hpp" #include "CfgEventhandlers.hpp" #include "CfgAmmo.hpp" #include "CfgMagazines.hpp" #include "CfgWeapons.hpp" -#include "CfgVehicles.hpp" diff --git a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf index 05db3748da..97531eb1e5 100644 --- a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf +++ b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf @@ -13,6 +13,7 @@ * * Public: No */ + // #define DEBUG_MODE_FULL #include "script_component.hpp" @@ -22,14 +23,23 @@ if (!alive ACE_player) exitWith {}; if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {}; -private ["_currentShooter", "_currentMagazine"]; -if (((vehicle ACE_player) == ACE_player) || {ACE_player call CBA_fnc_canUseWeapon}) then { - _currentShooter = ACE_player; - _currentMagazine = currentMagazine ACE_player; +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 = vehicle ACE_player; - _currentMagazine = _currentShooter currentMagazineTurret (ACE_player call CBA_fnc_turretPath); + _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"); diff --git a/addons/missileguidance/functions/fnc_doHandoff.sqf b/addons/missileguidance/functions/fnc_doHandoff.sqf index db722713e1..56abc8fbf0 100644 --- a/addons/missileguidance/functions/fnc_doHandoff.sqf +++ b/addons/missileguidance/functions/fnc_doHandoff.sqf @@ -1,5 +1,21 @@ -// Not currently used +/* + * Author: ACE + * Not currently used + * + * Arguments: + * 0: Target + * 1: Args + * + * Return Value: + * None + * + * Example: + * [target, [args]] call ace_missileguidance_fnc_doHandoff + * + * Public: No + */ + #include "script_component.hpp" -PARAMS_2(_target,_args); +params ["_target", "_args"]; [QGVAR(handoff), [_target, _args]] call CBA_fnc_globalEvent; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 45db7c536b..5ecb9c6dfe 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -7,7 +7,7 @@ * 1: PFID * * Return Value: - * Nothing + * None * * Example: * [[], 0] call ace_missileguidance_fnc_guidancePFH; @@ -54,7 +54,7 @@ private _seekerTargetPos = [[0,0,0], _args, _seekerStateParams, _lastKnownPosSta // 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 { @@ -111,4 +111,4 @@ _PS setDropInterval 3.0; _stateParams set [0, diag_tickTime]; END_COUNTER(guidancePFH); - + diff --git a/addons/missileguidance/functions/fnc_handleHandoff.sqf b/addons/missileguidance/functions/fnc_handleHandoff.sqf index 25c01694eb..e2122a56a4 100644 --- a/addons/missileguidance/functions/fnc_handleHandoff.sqf +++ b/addons/missileguidance/functions/fnc_handleHandoff.sqf @@ -1,6 +1,22 @@ -// Not currently used +/* + * 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 }; diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 224cfb14ec..bf256cbba0 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -8,7 +8,7 @@ * 6: Projectile * * Return Value: - * Nothing + * None * * Example: * [player, "", "", "", "ACE_Javelin_FGM148", "", theMissile] call ace_missileguidance_fnc_onFired; @@ -115,6 +115,15 @@ private _args = [_this, [ 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"]; diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index 54cc4e9757..7f03b695bc 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Продвинутое наведение ракет 高度なミサイルの誘導 고급 미사일 유도 + 进阶飞弹制导 + 進階飛彈制導 Advanced missile guidance, or AMG, provides multiple enhancements to missile locking and firing. It is also a framework required for missile weapon types. @@ -28,6 +30,8 @@ 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 @@ -40,8 +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 @@ -56,6 +62,8 @@ DAGR DAGR DAGR + 直接攻击导引飞弹 + 直接攻擊導引飛彈 Hydra-70 DAGR Laser Guided Missile @@ -68,8 +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 @@ -82,8 +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 @@ -98,6 +110,8 @@ AGM-114K AGM-114K AGM-114K + AGM-114K + AGM-114K Hellfire II AGM-114K Laser Guided Missile @@ -110,8 +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 @@ -126,6 +142,8 @@ Spento 無効 끄기 + 关闭 + 關閉 Player Only @@ -140,6 +158,8 @@ Solo Giocatore プレイヤーのみ 오직 플레이어만 + 只有玩家 + 只有玩家 Player and AI @@ -153,6 +173,9 @@ Игрок и боты Giocatore ed IA プレイヤーと AI + 玩家和AI + 玩家和AI + 플레이어와 AI Cycle Fire Mode @@ -167,6 +190,8 @@ Alterar Modo de Disparo 発射モード切り替え 발사 방식 순환 + 循环切换开火模式 + 循環切換開火模式 diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf index 300def5dc7..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 [_minimalDistance + random (_maximalDistance - _minimalDistance), random 360]); - } else { - 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); - }; - }; - }; - }, 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 2fe4264a37..55a754bf85 100644 --- a/addons/missionmodules/stringtable.xml +++ b/addons/missionmodules/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Moduli Missione ACE ACE ミッション モジュール ACE 미션 모듈 + ACE 任务模块 + ACE 任務模塊 Ambiance Sounds [ACE] @@ -28,6 +30,8 @@ Souni Ambientali [ACE] 環境音 [ACE] 환경 효과음 [ACE] + 环境声音 [ACE] + 環境聲音 [ACE] Sounds @@ -42,6 +46,8 @@ Suoni 効果音 효과음 + 声音 + 聲音 Class names of the ambiance sounds to be played. Seperated by ',' @@ -55,6 +61,8 @@ Nomi classi dei suoni ambientali da eseguire. Separati da ',' 再生する環境音のクラスネームを記載。','で複数指定できます。 재생되는 환경 효과음의 단위와 이름입니다. ','로 구분됩니다. + 输入想使用的环境声音classname。每个classname用','做区隔 + 輸入想使用的環境聲音classname。每個classname用','做區隔 Minimal Distance @@ -69,6 +77,8 @@ Distanza Minimale 最低距離 최소 거리 + 最小距离 + 最小距離 Used for calculating a random position and sets the minimal distance between the players and the played sound file(s) @@ -83,6 +93,8 @@ Usati per calcolare una posizione casuale ed impostare la distanza minima tra i giocatori ed il file suono eseguito 無作為な位置への計算や、プレイヤーと再生されるファイルの間へ最低距離を設定します 무작위 위치 계산에 사용되며 플레이어와 재생 된 사운드 파일 간의 최소 거리를 설정합니다. + 声音将随机产生在玩家附近,此选项定义该声音最近会距离玩家多少公尺 + 聲音將隨機產生在玩家附近,此選項定義該聲音最近會距離玩家多少公尺 Maximum Distance @@ -97,6 +109,8 @@ Distanza Massima 最大距離 최대 거리 + 最大距离 + 最大距離 Used for calculating a random position and sets the maximum distance between the players and the played sound file(s) @@ -111,6 +125,8 @@ Usato per calcolare una posizione casuale ed impostare la distanza massima tra giocatori e il file suono eseguito 無作為な位置への計算や、プレイヤーと再生されるファイルの間へ最大距離を設定します 무작위 위치 계산에 사용되며 플레이어와 재생 된 사운드 파일 간의 최대 거리를 설정합니다. + 声音将随机产生在玩家附近,此选项定义该声音最远会距离玩家多少公尺 + 聲音將隨機產生在玩家附近,此選項定義該聲音最遠會距離玩家多少公尺 Minimal Delay @@ -125,6 +141,8 @@ Pausa Minima 最低遅延 최소 지연 + 最小延迟 + 最小延遲 Minimal delay between sounds played @@ -139,6 +157,8 @@ Pausa Minima tra suoni eseguiti 再生されるまでの最低遅延 재생된 소리간 최소 지연시간 + 设定每个声音档案中间最少间隔多久再进行播放 + 設定每個聲音檔案中間最少間隔多久再進行播放 Maximum Delay @@ -153,6 +173,8 @@ Pausa Massima 最大遅延 최대 지연 + 最大延迟 + 最大延遲 Maximum delay between sounds played @@ -167,6 +189,8 @@ Pausa Massima tra suoni eseguiti 再生されるまでの最大遅延 재생된 소리간 최대 지연시간 + 设定每个声音档案中间最多间隔多久再进行播放 + 設定每個聲音檔案中間最多間隔多久再進行播放 Follow Players @@ -181,6 +205,8 @@ Segui Giocatori プレイヤーを追随 플레이어 따라가기 + 跟随玩家 + 跟隨玩家 Follow players. If set to false, loop will play sounds only nearby logic position. @@ -195,6 +221,8 @@ Segui Giocatori. Se impostato su falso, il ciclo eseguirà i suoni solo vicino ad una posizione logica. プレイヤーを追随します。False に設定するとロジックの近くで延々と再生します。 플레이어를 따라갑니다. 거짓으로 설정될경우 오직 한 자리에서만 반복해서 소리를 재생합니다. + 设定声音是否会在玩家的附近产生。假如关闭此功能,声音只会在模块的位置产生。 + 設定聲音是否會在玩家的附近產生。假如關閉此功能,聲音只會在模塊的位置產生。 Volume @@ -209,6 +237,8 @@ Volume 音量 볼륨 + 音量 + 音量 The volume of the sounds played @@ -223,6 +253,8 @@ Il volume dei suoni eseguiti 再生される音の大きさ 재생되는 소리의 볼륨 + 调整声音的音量 + 調整聲音的音量 Ambiance sounds loop (synced across MP) @@ -237,6 +269,8 @@ Ciclo Suoni Ambientali (sincronizzato in MP) 環境音の繰り返し (MP 間で同期させます) 환경 효과음 반복 (멀티플레이 전반적으로 동기화됨) + 循环的环境声音 (在多人游戏中会同步所有玩家的播放状态) + 循環的環境聲音 (在多人遊戲中會同步所有玩家的播放狀態) diff --git a/addons/mk6mortar/ACE_Settings.hpp b/addons/mk6mortar/ACE_Settings.hpp index cd7d4e64cb..5fb88aa23b 100644 --- a/addons/mk6mortar/ACE_Settings.hpp +++ b/addons/mk6mortar/ACE_Settings.hpp @@ -1,6 +1,7 @@ class ACE_Settings { //These settings effect gameplay difficutly: defaults will leave the mortar the same as vanilla class GVAR(airResistanceEnabled) { + category = CSTRING(DisplayName); displayName = CSTRING(airResistanceEnabled_DisplayName); description = CSTRING(airResistanceEnabled_Description); value = 0; @@ -8,6 +9,7 @@ class ACE_Settings { isClientSetable = 0; }; class GVAR(allowComputerRangefinder) { + category = CSTRING(DisplayName); displayName = CSTRING(allowComputerRangefinder_DisplayName); description = CSTRING(allowComputerRangefinder_Description); value = 1; @@ -15,6 +17,7 @@ class ACE_Settings { isClientSetable = 0; }; class GVAR(allowCompass) { + category = CSTRING(DisplayName); displayName = CSTRING(allowCompass_DisplayName); description = CSTRING(allowCompass_Description); value = 1; @@ -22,6 +25,7 @@ class ACE_Settings { isClientSetable = 0; }; class GVAR(useAmmoHandling) { + category = CSTRING(DisplayName); displayName = CSTRING(useAmmoHandling_DisplayName); description = CSTRING(useAmmoHandling_Description); value = 0; diff --git a/addons/mk6mortar/CfgVehicles.hpp b/addons/mk6mortar/CfgVehicles.hpp index 75b0277192..36315772d4 100644 --- a/addons/mk6mortar/CfgVehicles.hpp +++ b/addons/mk6mortar/CfgVehicles.hpp @@ -99,8 +99,8 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleInit); - scope = 2; - isGlobal = 0; + scope = 1; + isGlobal = 1; isSingular = 1; icon = QPATHTOF(UI\Icon_Module_mk6_ca.paa); functionPriority = 0; 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/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..b6cdac2b03 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 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 3f2a8c1f0d..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,18 +67,18 @@ 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 { @@ -94,15 +93,15 @@ if (_lastFireMode != -1) then { 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..4fef320117 100644 --- a/addons/mk6mortar/functions/fnc_moduleInit.sqf +++ b/addons/mk6mortar/functions/fnc_moduleInit.sqf @@ -17,10 +17,9 @@ */ #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 {}; [_logic, QGVAR(airResistanceEnabled), "airResistanceEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowComputerRangefinder), "allowComputerRangefinder"] call EFUNC(common,readSettingFromModule); 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 2b5e220753..b6dbbc2db5 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Tavola di tiro 82mm 82mm 射表 82mm 사거리표 + 82mm迫击炮射表 + 82mm迫擊炮射表 Range Table for the Mk6 82mm Mortar @@ -28,6 +30,8 @@ Tavola di tiro per il mortaio calibro 82mm Mk6 Mk6 82mm 迫撃砲の射表 Mk6 82mm 박격포 사격을 위한 사거리표 + MK6 82mm迫击炮射表 + MK6 82mm迫擊炮射表 Open 82mm Rangetable @@ -42,6 +46,8 @@ Apri la tavola di tiro 82mm 82mm 射表を開く 82mm 사거리표 열기 + 开启82mm迫击炮射表 + 開啟82mm迫擊炮射表 Charge @@ -56,6 +62,16 @@ Carica 装薬 장약 + 装药 + 裝藥 + + + Mk6 Mortar + Mk6 Mörser + Mortaio Mk6 + MK6迫擊炮 + MK6迫击炮 + Mk6 迫撃砲 Mk6 Settings @@ -70,6 +86,8 @@ Impostazioni Mk6 Mk6 設定 Mk6 설정 + MK6设定 + MK6設定 Air Resistance @@ -84,6 +102,8 @@ Resistenza dell'Aria 空気抵抗 공기저항 + 空气阻力 + 空氣阻力 For Player Shots, Model Air Resistance and Wind Effects @@ -98,6 +118,8 @@ Per Proiettili dei Giocatori, simula la Resistenza dell'Aria e gli Effetti del Vento プレイヤが射撃すると、空気抵抗モデルと風による影響をあたえます。 플레이어 사격시 공기저항과 바람에 영향을 받습니다 + 设定由玩家射击的迫击炮,将会受到空气阻力与风力的影响 + 設定由玩家射擊的迫擊砲,將會受到空氣阻力與風力的影響 Allow Mk6 Computer @@ -112,6 +134,8 @@ Consenti Computer Mk6 Mk6 コンピュータを許可 Mk6 탄도계산컴퓨터 허가 + 允许使用MK6射控电脑 + 允許使用MK6射控電腦 Show the Computer and Rangefinder (these NEED to be removed if you enable air resistance) @@ -126,6 +150,8 @@ Mostra il Computer e Distaziometro (questi DEVONO essere rimossi se vuoi abilitare la resistenza dell'aria) コンピュータと距離を表示します (空気抵抗を有効化している場合は必ず削除してください) 탄도계산컴퓨터와 거리측정기를 보여줍니다(공기저항을 활성화했을경우 이 항목은 비활성화 되어야만 합니다) + 显示射控电脑和测距仪 (如果有启用空气阻力功能时,须停用此项功能) + 顯示射控電腦和測距儀 (如果有啟用空氣阻力功能時,須停用此項功能) Allow Mk6 Compass @@ -140,6 +166,8 @@ Consenti Bussola Mk6 Mk6 への方位磁石を有効化 Mk6 나침반 허용 + 允许使用MK6指北针 + 允許使用MK6指北針 Show the Mk6 Digital Compass @@ -154,6 +182,8 @@ Mostra la Bussola Digitale Mk6 Mk6 のデジタル方位磁石を表示 Mk6 에서 전자 나침반을 보여줍니다 + 显示MK6的数位指北针 + 顯示MK6的數位指北針 This module allows you to setup Mk6 mortar settings. @@ -167,6 +197,8 @@ Este módulo permite configurar los parámetros del mortero Mk6. Mk6 迫撃砲への設定をできます。 이 모듈은 Mk6 설치 설정을 가능케 합니다. + 这个模块允许你设定MK6迫击炮的相关功能 + 這個模塊允許你設定MK6迫擊砲的相關功能 Use Ammunition handling @@ -179,6 +211,8 @@ Использовать манипуляции с боеприпасами 弾薬の取り扱い 탄약 관리 활성화 + 使用手动弹药装卸 + 使用手動彈藥裝卸 Removes mortar magazines, requiring individual rounds to be loaded by the gunner or loader. Does not affect AI mortars. @@ -191,6 +225,8 @@ Удаляет артиллерийские магазины, требует загрузку отдельных снарядов стрелком или заряжащим. Не влияет на артиллерию ИИ. 迫撃砲から弾薬を除去します。射手か装填手により予め装填されている必要があります。AI 迫撃砲へ影響を与えません。 박격포 탄창을 제거합니다, 사수나 장전수가 개별적으로 탄환을 넣어줘야만 합니다. 인공지능은 영향을 받지 않습니다. + 开启此功能时。迫击炮的弹药需由炮手与装填手共同合作来进行装填。此功能并不影响由AI射击的迫击炮 + 開啟此功能時。迫擊砲的彈藥需由砲手與裝填手共同合作來進行裝填。此功能並不影響由AI射擊的迫擊砲 Remove Round @@ -204,6 +240,8 @@ Извлечь снаряд 弾薬を除去 탄약 제거 + 卸除弹头 + 卸除彈頭 Load Mortar @@ -217,6 +255,8 @@ Зарядить миномет 弾薬を装填 탄약 장전 + 装载弹头 + 裝載彈頭 Unloading Round @@ -229,6 +269,8 @@ Извлечение снаряда 弾薬を除去しています 탄약 제거중 + 卸除弹头中 + 卸除彈頭中 Preparing Round @@ -242,6 +284,8 @@ Подготовка снаряда 事前に装填 탄약 준비중 + 准备弹头中 + 準備彈頭中 Load HE @@ -255,6 +299,8 @@ Зарядить фугасный りゅう弾を装填 고폭탄 장전 + 装载高爆弹 + 裝載高爆彈 Load Smoke @@ -268,6 +314,8 @@ Зарядить дымовой 煙幕弾を装填 연막탄 장전 + 装载烟雾弹 + 裝載煙霧彈 Load Illumination @@ -281,6 +329,8 @@ Зарядить осветительный 照明弾を装填 조명탄 장전 + 装载照明弹 + 裝載照明彈 Load Guided HE @@ -294,6 +344,8 @@ Зарядить фугасный управляемый 誘導りゅう弾を装填 유도 고폭탄 장전 + 装载导引高爆弹 + 裝載導引高爆彈 Load Laser Guided HE @@ -307,6 +359,8 @@ Зарядить фугасный управляемый по ЛЦУ レーザ誘導りゅう弾を装填 레이저 유도 고폭탄 장전 + 装载雷射导引高爆弹 + 裝載雷射導引高爆彈 82mm HE Round @@ -320,6 +374,8 @@ Фугасный снаряд 82мм 82mm りゅう弾 82mm 고폭탄 + 82mm高爆弹 + 82mm高爆彈 82mm Smoke Round @@ -333,6 +389,8 @@ Дымовой снаряд 82мм 82mm 煙幕弾 82mm 연막탄 + 82mm烟雾弹 + 82mm煙霧彈 82mm Illumination Round @@ -346,6 +404,8 @@ Осветительный снаряд 82мм 82mm 照明弾 82mm 조명탄 + 82mm照明弹 + 82mm照明彈 82mm Guided HE Round @@ -359,6 +419,8 @@ Фугасный снаряд управляемый 82мм 82mm 誘導りゅう弾 82mm 유도 고폭탄 + 82mm导引高爆弹 + 82mm導引高爆彈 82mm Laser Guided HE Round @@ -372,6 +434,8 @@ Фугасный снаряд управляемый по ЛЦУ 82мм 82mm レーザ誘導りゅう弾 82mm 레이저 유도 고폭탄 + 82mm雷射导引高爆弹 + 82mm雷射導引高爆彈 Used in Mk6 mortar @@ -385,6 +449,8 @@ Использовался в миномете Mk6 Mk6 mortar で使います Mk6 박격포에 사용됨 + 用于Mk6迫击炮 + 用於Mk6迫擊砲 [ACE] 82mm HE Rounds Box @@ -398,6 +464,8 @@ [ACE] Ящик фугасных снарядов 82мм [ACE] 82mm りゅう弾入り弾薬箱 [ACE] 82mm 고폭탄 상자 + [ACE] 82mm高爆弹药箱 + [ACE] 82mm高爆彈藥箱 [ACE] 82mm Smoke Rounds Box @@ -411,6 +479,8 @@ [ACE] Ящик дымовых снарядов 82мм [ACE] 82mm 煙幕弾入り弾薬箱 [ACE] 82mm 연막탄 상자 + [ACE] 82mm烟雾弹药箱 + [ACE] 82mm煙霧彈藥箱 [ACE] 82mm Illumination Rounds Box @@ -424,6 +494,8 @@ [ACE] Ящик осветительных снарядов 82мм [ACE] 82mm 照明弾入り弾薬箱 [ACE] 82mm 조명탄 상자 + [ACE] 82mm照明弹药箱 + [ACE] 82mm照明彈藥箱 [ACE] 82mm Default Loadout Box @@ -437,6 +509,8 @@ [ACE] Ящик снарядов 82мм (стандартный) [ACE] 82mm 梱包箱 [ACE] 82mm 기본 장비 상자 + [ACE] 82mm预设弹药箱 + [ACE] 82mm預設彈藥箱 diff --git a/addons/modules/XEH_postInit.sqf b/addons/modules/XEH_postInit.sqf index dcd6277aed..c6892046fe 100644 --- a/addons/modules/XEH_postInit.sqf +++ b/addons/modules/XEH_postInit.sqf @@ -39,6 +39,7 @@ }; if (_isDisposable) then { + if (_isGlobal) then {WARNING_1("Deleting Global Module??? [%1]",_logicType);}; deleteVehicle _logic; }; }; 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/ACE_Settings.hpp b/addons/movement/ACE_Settings.hpp deleted file mode 100644 index fdc0bd36b0..0000000000 --- a/addons/movement/ACE_Settings.hpp +++ /dev/null @@ -1,8 +0,0 @@ -class ACE_Settings { - class GVAR(useImperial) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(UseImperial); - }; -}; diff --git a/addons/movement/CfgEventHandlers.hpp b/addons/movement/CfgEventHandlers.hpp index 083c5bb089..6aee79933c 100644 --- a/addons/movement/CfgEventHandlers.hpp +++ b/addons/movement/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preStart)); @@ -19,6 +18,6 @@ class Extended_PostInit_EventHandlers { class Extended_DisplayLoad_EventHandlers { class RscDisplayInventory { - ADDON = QUOTE(_this call COMPILE_FILE(XEH_inventoryDisplayLoad)); + ADDON = QUOTE(_this call FUNC(inventoryDisplayLoad)); }; }; diff --git a/addons/movement/XEH_PREP.hpp b/addons/movement/XEH_PREP.hpp index 04913f7670..ceafa7f5dc 100644 --- a/addons/movement/XEH_PREP.hpp +++ b/addons/movement/XEH_PREP.hpp @@ -1,7 +1,6 @@ - PREP(addLoadToUnitContainer); -PREP(getWeight); PREP(canClimb); PREP(climb); PREP(handleClimb); PREP(handleVirtualMass); +PREP(inventoryDisplayLoad); diff --git a/addons/movement/XEH_inventoryDisplayLoad.sqf b/addons/movement/XEH_inventoryDisplayLoad.sqf deleted file mode 100644 index ae717e7b39..0000000000 --- a/addons/movement/XEH_inventoryDisplayLoad.sqf +++ /dev/null @@ -1,14 +0,0 @@ -#include "script_component.hpp" - -disableSerialization; - -[{ - disableSerialization; - params ["_dialog"]; - - if (isNull _dialog) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; - }; - - (_dialog displayCtrl 111) ctrlSetText format ["%1 - %2 %3", [ACE_player, false, true] call EFUNC(common,getName), localize LSTRING(Weight), [ACE_player] call FUNC(getWeight)]; -}, 0, _this select 0] call CBA_fnc_addPerFrameHandler; diff --git a/addons/movement/config.cpp b/addons/movement/config.cpp index 14a3b8f68d..4979faf819 100644 --- a/addons/movement/config.cpp +++ b/addons/movement/config.cpp @@ -18,4 +18,3 @@ class CfgPatches { #include "CfgFatigue.hpp" #include "CfgMoves.hpp" #include "CfgVehicles.hpp" -#include "ACE_Settings.hpp" 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..84f78cfcc0 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 @@ -24,4 +24,5 @@ private _pos = _unit modelToWorldVisual (_unit selectionPosition "camera"); _pos = _pos vectorDiff (_unit selectionPosition "camera"); -_unit setPos _pos; +_unit setPosASL (AGLtoASL _pos); +TRACE_2("",AGLtoASL _pos,getPosASL _unit); diff --git a/addons/movement/functions/fnc_handleVirtualMass.sqf b/addons/movement/functions/fnc_handleVirtualMass.sqf index 8dc1412c4a..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 */ diff --git a/addons/movement/functions/fnc_inventoryDisplayLoad.sqf b/addons/movement/functions/fnc_inventoryDisplayLoad.sqf new file mode 100644 index 0000000000..f7c240f332 --- /dev/null +++ b/addons/movement/functions/fnc_inventoryDisplayLoad.sqf @@ -0,0 +1,35 @@ +/* + * Author: commy2 + * Executed every time an inventory display is opened. + * + * Arguments: + * 0: Inventory display + * + * Return Value: + * None + * + * Example: + * [DISPLAY] call ACE_movement_fnc_inventoryDisplayLoad + * + * Public: No + */ +#include "script_component.hpp" + +params ["_display"]; + +private _fnc_update = { + params ["_display"]; + private _control = _display displayCtrl 111; + + _control ctrlSetText format ["%1 - %2 %3 (%4)", + [ACE_player, false, true] call EFUNC(common,getName), + localize ELSTRING(common,Weight), + [ACE_player] call EFUNC(common,getWeight), + [ACE_player, true] call EFUNC(common,getWeight) + ]; +}; + +_display displayAddEventHandler ["MouseMoving", _fnc_update]; +_display displayAddEventHandler ["MouseHolding", _fnc_update]; + +_display call _fnc_update; diff --git a/addons/movement/stringtable.xml b/addons/movement/stringtable.xml index 9d7c5d219d..2d587ce3d2 100644 --- a/addons/movement/stringtable.xml +++ b/addons/movement/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,20 +14,8 @@ Показывать вес в фунтах ポンドで重量を表示する 무게를 파운드(lb)로 보여줍니다 - - - Weight: - Gewicht: - Peso: - Poids : - Waga: - Váha: - Peso: - Peso: - Súly: - Вес: - 重量: - 무게: + 使用磅来显示重量 + 使用磅來顯示重量 Climb @@ -42,6 +30,8 @@ Subir 登る 오르기 + 攀爬 + 攀爬 Can't climb here @@ -55,6 +45,9 @@ Non puoi arrampicarti qui Não se pode subir aqui ここは登れない + 这里无法攀爬 + 這裡無法攀爬 + 여기는 올라갈 수 없다 - \ No newline at end of file + diff --git a/addons/mx2a/stringtable.xml b/addons/mx2a/stringtable.xml index cc2b8beb85..3239aef1ed 100644 --- a/addons/mx2a/stringtable.xml +++ b/addons/mx2a/stringtable.xml @@ -14,6 +14,8 @@ MX-2A MX-2A MX-2A + MX-2A + MX-2A Thermal imaging device @@ -28,6 +30,8 @@ Dispositivo di visione termica サーマル画像表示双眼鏡 열영상 장치 + 热成像装置 + 熱成像裝置 diff --git a/addons/nametags/ACE_Settings.hpp b/addons/nametags/ACE_Settings.hpp index ab6220f131..5f2956d03c 100644 --- a/addons/nametags/ACE_Settings.hpp +++ b/addons/nametags/ACE_Settings.hpp @@ -56,12 +56,14 @@ class ACE_Settings { typeName = "SCALAR"; isClientSettable = 0; category = CSTRING(Module_DisplayName); + sliderSettings[] = {0, 50, 5, 1}; }; class GVAR(playerNamesMaxAlpha) { value = 0.8; typeName = "SCALAR"; isClientSettable = 0; category = CSTRING(Module_DisplayName); + sliderSettings[] = {0, 1, 0.8, 2}; }; class GVAR(tagSize) { value = 2; diff --git a/addons/nametags/CfgVehicles.hpp b/addons/nametags/CfgVehicles.hpp index 47f530df68..e712459f68 100644 --- a/addons/nametags/CfgVehicles.hpp +++ b/addons/nametags/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleNameTags); - scope = 2; + scope = 1; isGlobal = 1; isSingular = 1; icon = QPATHTOF(UI\Icon_Module_NameTags_ca.paa); 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 index 27aaa7af7c..6e1223c8be 100644 --- a/addons/nametags/functions/fnc_getCachedFlags.sqf +++ b/addons/nametags/functions/fnc_getCachedFlags.sqf @@ -6,7 +6,7 @@ * None * * Return Value: - * [_drawName,_drawRank,_enabledTagsNearby,_enabledTagsCursor,_maxDistance] + * [_drawName,_drawRank,_enabledTagsNearby,_enabledTagsCursor,_maxDistance] * * Example: * call ace_nametags_fnc_getCachedFlags 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..c2d0cf8c79 100644 --- a/addons/nametags/functions/fnc_moduleNameTags.sqf +++ b/addons/nametags/functions/fnc_moduleNameTags.sqf @@ -7,12 +7,15 @@ * * Return Value: * None + * + * Example: + * [] call ace_nametags_fnc_moduleNameTags + * + * Public: No */ #include "script_component.hpp" -if !(isServer) exitWith {}; - params ["_logic", "", "_activated"]; if !(_activated) exitWith {}; 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 9a4acbe108..ef6f27fb16 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -14,6 +14,8 @@ Mostrar nomes 名前の表示 이름 표시 + 显示名称 + 顯示名稱 Show player names @@ -28,6 +30,8 @@ Показывать имена игроков (включить имена) プレイヤ名を表示 플레이어 이름 표시 + 显示玩家名称 + 顯示玩家名稱 Show player name only on cursor (requires player names) @@ -40,8 +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) @@ -56,6 +62,8 @@ Mostrar nomes somente ao pressionar teclar (requer nome de jogadores) キーを押した時だけプレイヤ名を表示 (プレイヤ名が必要) 키를 누를때만 플레이어 이름 표시(플레이어 이름 필요) + 仅在按按键后显示玩家名称 (玩家必须有设定名称) + 僅在按按鍵後顯示玩家名稱 (玩家必須有設定名稱) Show player ranks (requires player names) @@ -70,6 +78,8 @@ Показывать звания игроков (при вкл. именах) プレイヤの階級を表示 (プレイヤ名が必要) 플레이어 계급 표시 (플레이어 이름 필요) + 显示玩家军阶 (玩家必须有设定名称) + 顯示玩家軍階 (玩家必須有設定名稱) Show vehicle crew info @@ -84,6 +94,8 @@ Mostra l'elenco del personale a bordo 車両の乗員を表示 차량 승무원 정보 표시 + 显示载具成员信息 + 顯示載具成員信息 Show name tags for AI units @@ -98,6 +110,8 @@ Mostrar nomes para unidades de IA AI ユニットの名札を表示 인공지능 인원 이름 표시 + 显示AI单位名称 + 顯示AI單位名稱 Show SoundWaves (requires player names) @@ -112,6 +126,8 @@ Mostrar onda sonora (requer nome de jogadores) 音波形を表示 (プレイヤ名が必要) 음파 표시 (플레이어 이름 필요) + 当玩家讲话时,显示声波图案 (玩家必须有设定名称) + 當玩家講話時,顯示聲波圖案 (玩家必須有設定名稱) Default Nametag Color (Non Group Members) @@ -126,6 +142,8 @@ Cor padrão do nome (unidades fora do grupo) 標準の名札の色(グループ メンバ以外) 기본 이름표 색상 (비-그룹 멤버) + 预设名称颜色 (非同小队队友) + 預設名稱顏色 (非同小隊隊友) Name Tags @@ -140,6 +158,8 @@ Etichette Nomi 名札 이름표 + 玩家名称 + 玩家名稱 Player Names View Dist. @@ -154,6 +174,8 @@ Distanza Visiva Etichette Nomi プレイヤ名が見える範囲 플레이어 이름 표시 거리 + 玩家名称显示距离 + 玩家名稱顯示距離 Distance in meters at which player names are shown. Default: 5 @@ -166,8 +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? @@ -180,8 +204,10 @@ Névcímkék megjelenítése AI-nál? Показывать имена ботов? Mostra etichette nomi per IA? - AI の名札も表示しますか? + AI の名札も表示しますか? 인공지능의 이름도 표시합니까? + 显示AI名称? + 顯示AI名稱? Show the name and rank tags for friendly AI units? Default: Do not force @@ -194,8 +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 @@ -210,6 +238,8 @@ Forza Nascosto 強制で非表示 강제로 숨기기 + 强迫隐藏 + 強迫隱藏 Force Show @@ -224,6 +254,8 @@ Forza Mostra 強制で表示 강제로 표시 + 强迫显示 + 強迫顯示 Show crew info? @@ -238,6 +270,8 @@ Mostra informazioni equipaggio? 乗員の情報を表示 승무원 정보 표시? + 显示载具成员讯息? + 顯示載具成員訊息? Show vehicle crew info, or by default allows players to choose it on their own. Default: Do Not Force @@ -250,8 +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 @@ -266,6 +302,8 @@ Mostra per Veicoli 車両への表示 차량 표시 + 显示给载具指挥官 + 顯示給載具指揮官 Show cursor NameTag for vehicle commander (only if client has name tags enabled) Default: No @@ -277,8 +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. @@ -293,6 +333,8 @@ Questo modulo ti consente di personalizzare le impostazioni ed il raggio delle Etichette Nomi このモジュールは名札の表示範囲と設定を変更できます。 이 모듈은 당신이 이름표의 범위를 임의로 수정할 수 있게 해줍니다. + 这个模块允许您设定名称和显示范围等设定 + 這個模塊允許您設定名稱和顯示範圍等設定 Only on Cursor @@ -307,6 +349,8 @@ Solo su Cursore カーソルでのみ 커서만 해당 + 只有准心指到时 + 只有準心指到時 Only on Keypress @@ -321,6 +365,8 @@ Solo quando Premi Tasto キー押下のみ 키를 누를경우만 + 只有按按键时 + 只有按按鍵時 Only on Cursor and Keypress @@ -335,6 +381,8 @@ Solo su Cursore e quando Premi Tasto カーソルとキー押下のみ 커서와 키를 누를경우만 + 只有在准心指到和按按键时 + 只有在準心指到和按按鍵時 Force Show Only on Cursor @@ -349,6 +397,8 @@ Forza Mostra solo su Cursore カーソルでのみに強制する 커서만 강제로 해당 + 强制仅显示在准心指到时 + 強制僅顯示在準心指到時 Force Show Only on Keypress @@ -363,6 +413,8 @@ Forza Mostra solo quando Premi Tasto キー押下のみに強制する 키를 누를경우만 강제로 해당 + 强制仅显示在按按键时 + 強制僅顯示在按按鍵時 Force Show Only on Cursor and Keypress @@ -377,6 +429,8 @@ Forza Mostra solo su Cursore e quando Premi Tasto カーソルとキー押下のみに強制する 커서와 키를 누를경우만 강제로 해당 + 强制显示在准心指到和按按键时 + 強制顯示在準心指到和按按鍵時 Use Nametag settings @@ -391,6 +445,8 @@ Usa impostazioni Etichette Nomi 名札の設定 이름표 설정 사용 + 玩家名称设定 + 玩家名稱設定 Always Show All @@ -405,6 +461,8 @@ Mostra Sempre Tutto 常に表示する 항상 모두 표시 + 永远显示全部 + 永遠顯示全部 Show player names and set their activation. Default: Enabled @@ -417,8 +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. @@ -433,6 +493,8 @@ 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 @@ -447,6 +509,8 @@ Dimensione Etichette Nome 名札の大きさ 이름표 크기 + 玩家名称标记大小 + 玩家名稱標記大小 Text and Icon Size Scaling @@ -461,6 +525,8 @@ Proporzione Dimensioni Testo ed Icone 文字とアイコンの大きさ 글자와 아이콘 크기 비례 + 文字和图示大小设定 + 文字和圖示大小設定 Fade on screen border @@ -470,6 +536,8 @@ 화면 가장자리에서 사라짐 Estomper sur les bords de l'écran Sfocatura nei bordi dello schermo + 在荧幕边框旁淡出 + 在螢幕邊框旁淡出 diff --git a/addons/nightvision/ACE_Settings.hpp b/addons/nightvision/ACE_Settings.hpp index 32dbab7fff..2cf90a2c05 100644 --- a/addons/nightvision/ACE_Settings.hpp +++ b/addons/nightvision/ACE_Settings.hpp @@ -1,8 +1,32 @@ class ACE_Settings { class GVAR(disableNVGsWithSights) { + category = CSTRING(Category); displayName = CSTRING(DisableNVGsWithSights_DisplayName); description = CSTRING(DisableNVGsWithSights_description); typeName = "BOOL"; value = 0; }; + class GVAR(fogScaling) { + category = CSTRING(Category); + displayName = CSTRING(fogScaling_DisplayName); + description = CSTRING(fogScaling_Description); + typeName = "SCALAR"; + value = 1; + sliderSettings[] = {0, 2, 1, 1}; + }; + class GVAR(effectScaling) { + category = CSTRING(Category); + displayName = CSTRING(effectScaling_DisplayName); + description = CSTRING(effectScaling_Description); + typeName = "SCALAR"; + value = 1; + sliderSettings[] = {0, 2, 1, 1}; + }; + class GVAR(aimDownSightsBlur) { + category = CSTRING(Category); + displayName = CSTRING(aimDownSightsBlur_DisplayName); + typeName = "SCALAR"; + value = 1; + sliderSettings[] = {0, 2, 1, 1}; + }; }; diff --git a/addons/nightvision/CfgEventHandlers.hpp b/addons/nightvision/CfgEventHandlers.hpp index 152887a24a..e90bed419e 100644 --- a/addons/nightvision/CfgEventHandlers.hpp +++ b/addons/nightvision/CfgEventHandlers.hpp @@ -1,30 +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) ); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; - class Extended_PostInit_EventHandlers { class ADDON { - clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient)); - }; -}; - -class Extended_DisplayLoad_EventHandlers { - class RscDisplayCurator { - ADDON = QUOTE(_this call FUNC(updatePPEffects)); - }; -}; - -class Extended_DisplayUnload_EventHandlers { - class RscDisplayCurator { - ADDON = QUOTE(displayNull call FUNC(updatePPEffects)); // emulate zeus display being deleted + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; diff --git a/addons/nightvision/CfgVehicles.hpp b/addons/nightvision/CfgVehicles.hpp index c540251dbb..6b7b04f25d 100644 --- a/addons/nightvision/CfgVehicles.hpp +++ b/addons/nightvision/CfgVehicles.hpp @@ -1,9 +1,4 @@ class CfgVehicles { - class All { - ACE_NightVision_grain = 0.75; - ACE_NightVision_blur = 0.055; - }; - class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { @@ -17,7 +12,7 @@ class CfgVehicles { class ACE_Module; class GVAR(ModuleSettings): ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(Module_DisplayName); icon = QPATHTOF(UI\Icon_Module_ca.paa); category = "ACE"; diff --git a/addons/nightvision/CfgWeapons.hpp b/addons/nightvision/CfgWeapons.hpp index 72be31d8cf..5d87b0170c 100644 --- a/addons/nightvision/CfgWeapons.hpp +++ b/addons/nightvision/CfgWeapons.hpp @@ -2,55 +2,85 @@ class CfgWeapons { class Binocular; class NVGoggles: Binocular { displayName = CSTRING(NVG_Gen3_brown); - ACE_NightVision_grain = 0.75; - ACE_NightVision_blur = 0.055; - ACE_NightVision_radBlur = 0.001; + modelOptics = ""; + GVAR(border) = QPATHTOF(data\nvg_mask_binos_4096.paa); + GVAR(bluRadius) = 0.15; + }; + class O_NVGoggles_hex_F: NVGoggles { // APEX NVG with multiple lenses (spider eyes) + modelOptics = ""; + GVAR(border) = QPATHTOF(data\nvg_mask_quad_4096.paa); // Use quad tube mask + GVAR(bluRadius) = 0.26; + }; + class NVGogglesB_grn_F: NVGoggles { // APEX NVG/Thermal + modelOptics = "\A3\weapons_f\reticle\optics_night"; // use vanilla modelOptics so it will show in IR mode }; class NVGoggles_OPFOR: NVGoggles { + modelOptics = ""; displayName = CSTRING(NVG_Gen3_black); }; class NVGoggles_INDEP: NVGoggles { + modelOptics = ""; displayName = CSTRING(NVG_Gen3_green); }; - class ACE_NVG_Gen1: NVGoggles_OPFOR { author = ECSTRING(common,ACETeam); - modelOptics = "\A3\weapons_f\reticle\optics_night"; displayName = CSTRING(NVG_Gen1); - ACE_NightVision_grain = 2.25; - ACE_NightVision_blur = 0.22; - ACE_NightVision_radBlur = 0.004; + GVAR(generation) = 1; }; class ACE_NVG_Gen2: NVGoggles_INDEP { author = ECSTRING(common,ACETeam); - modelOptics = "\A3\weapons_f\reticle\optics_night"; displayName = CSTRING(NVG_Gen2); - ACE_NightVision_grain = 1.5; - ACE_NightVision_blur = 0.11; - ACE_NightVision_radBlur = 0.002; + GVAR(generation) = 2; }; - /*class ACE_NVG_Gen3: NVGoggles { - author = ECSTRING(common,ACETeam); - modelOptics = "\A3\weapons_f\reticle\optics_night"; - displayName = CSTRING(NVG_Gen3); - ACE_NightVision_grain = 0.75; - ACE_NightVision_blur = 0.055; - ACE_NightVision_radBlur = 0.001; -};*/ class ACE_NVG_Gen4: NVGoggles { author = ECSTRING(common,ACETeam); - modelOptics = "\A3\weapons_f\reticle\optics_night"; displayName = CSTRING(NVG_Gen4); - ACE_NightVision_grain = 0.0; - ACE_NightVision_blur = 0.0; - ACE_NightVision_radBlur = 0.0; + GVAR(generation) = 4; }; class ACE_NVG_Wide: NVGoggles { author = ECSTRING(common,ACETeam); modelOptics = QPATHTOF(models\ACE_nvg_wide_optics); displayName = CSTRING(NVG_FullScreen); - ACE_NightVision_grain = 0.75; - ACE_NightVision_blur = 0.055; - ACE_NightVision_radBlur = 0.001; + }; + + + // Examples of different goggle effect types (scope=1) + // These all function differently, but we have no models to go with them + class ACE_NVG_Biocular: NVGoggles { + scope = 1; + modelOptics = ""; + author = ECSTRING(common,ACETeam); + descriptionShort = "Biocular nightvision goggles"; + displayName = "NV Goggles (Bio)"; + GVAR(border) = QPATHTOF(data\nvg_mask_4096.paa); + GVAR(bluRadius) = 0.13; + GVAR(eyeCups) = 1; + }; + class ACE_NVG_Monocular: NVGoggles { + scope = 1; + modelOptics = ""; + author = ECSTRING(common,ACETeam); + descriptionShort = "Monocular nightvision goggles"; + displayName = "NV Goggles (Mono)"; + GVAR(border) = QPATHTOF(data\nvg_mask_4096.paa); + GVAR(bluRadius) = 0.13; + }; + class ACE_NVG_Binocular: NVGoggles { + scope = 1; + modelOptics = ""; + author = ECSTRING(common,ACETeam); + descriptionShort = "Binocular nightvision goggles"; + displayName = "NV Goggles (Bino)"; + GVAR(border) = QPATHTOF(data\nvg_mask_binos_4096.paa); + GVAR(bluRadius) = 0.15; + }; + class ACE_NVG_Quadocular: NVGoggles { + scope = 1; + modelOptics = ""; + author = ECSTRING(common,ACETeam); + descriptionShort = "Quadocular nightvision goggles"; + displayName = "NV Goggles (Quad)"; + GVAR(border) = QPATHTOF(data\nvg_mask_quad_4096.paa); + GVAR(bluRadius) = 0.26; }; }; diff --git a/addons/nightvision/RscTitles.hpp b/addons/nightvision/RscTitles.hpp new file mode 100644 index 0000000000..98c2b11cb3 --- /dev/null +++ b/addons/nightvision/RscTitles.hpp @@ -0,0 +1,41 @@ +class RscPicture; +class RscText; + +class RscTitles { + class GVAR(title) { + idd = 10777; + movingEnable = 1; + enableSimulation = 1; + enableDisplay = 1; + + onLoad = QUOTE(with uiNamespace do {GVAR(titleDisplay) = _this select 0};); + onunLoad = ""; + + duration = 999999; + fadein = 0; + fadeout = 0; + + class controls { + class Hexes: RscPicture { + idc = 1000; + }; + class Mask: RscPicture { + idc = 1001; + }; + + // Add blinders for side monitors for tripple monitors (mask won't cover them) + class trippleHeadLeft: RscPicture { + idc = 1002; + text = "#(argb,8,8,3)color(0,0,0,1)"; + x = "safeZoneXAbs"; + Y = "safezoneY"; + W = "(safezoneX - safeZoneXAbs) * ((getResolution select 4)/(16/3))"; + H = "safeZoneH"; + }; + class trippleHeadRight: trippleHeadLeft { + idc = 1003; + x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4)/(16/3))"; + }; + }; + }; +}; diff --git a/addons/nightvision/XEH_PREP.hpp b/addons/nightvision/XEH_PREP.hpp index 251c8cc5dd..c212d22b18 100644 --- a/addons/nightvision/XEH_PREP.hpp +++ b/addons/nightvision/XEH_PREP.hpp @@ -1,7 +1,12 @@ -PREP(blending); PREP(changeNVGBrightness); PREP(initModule); +PREP(nonDedicatedFix); PREP(onCameraViewChanged); +PREP(onFiredPlayer); +PREP(onLoadoutChanged); PREP(onVisionModeChanged); -PREP(updatePPEffects); +PREP(pfeh); +PREP(refreshGoggleType); +PREP(scaleCtrl); +PREP(setupDisplayEffects); diff --git a/addons/nightvision/XEH_postInit.sqf b/addons/nightvision/XEH_postInit.sqf new file mode 100644 index 0000000000..762fd70496 --- /dev/null +++ b/addons/nightvision/XEH_postInit.sqf @@ -0,0 +1,102 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +GVAR(PFID) = -1; +GVAR(running) = false; +GVAR(nextEffectsUpdate) = -1; + +GVAR(playerHMD) = "#"; + +GVAR(priorFog) = nil; +GVAR(nvgFog) = [0,0,0]; + +GVAR(nvgBlurRadius) = -1; +GVAR(nvgGeneration) = -1; +GVAR(defaultPositionBorder) = []; +GVAR(defaultPositionHex) = []; + +GVAR(ppeffectGrain) = -1; +GVAR(ppeffectRadialBlur) = -1; +GVAR(ppeffectColorCorrect) = -1; +GVAR(ppeffectBlur) = -1; +GVAR(ppEffectCCMuzzleFlash) = -1; + + +["ace_settingsInitialized", { + TRACE_3("settingsInitialized",GVAR(disableNVGsWithSights),GVAR(fogScaling),GVAR(effectScaling)); + + ["visionMode", LINKFUNC(onVisionModeChanged), false] call CBA_fnc_addPlayerEventHandler; + + // handle only brightness if effects are disabled + if (GVAR(effectScaling) == 0) exitWith { + GVAR(ppEffectNVGBrightness) = ppEffectCreate ["ColorCorrections", 1236]; + GVAR(ppEffectNVGBrightness) ppEffectForceInNVG true; + GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, (-3+3)/5 + 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; + GVAR(ppEffectNVGBrightness) ppEffectCommit 0; + }; + + ["loadout", LINKFUNC(onLoadoutChanged), true] call CBA_fnc_addPlayerEventHandler; + ["cameraView", LINKFUNC(onCameraViewChanged), true] call CBA_fnc_addPlayerEventHandler; + ["vehicle", LINKFUNC(refreshGoggleType), false] call CBA_fnc_addPlayerEventHandler; + ["turret", LINKFUNC(refreshGoggleType), true] call CBA_fnc_addPlayerEventHandler; + + ["ace_firedPlayer", LINKFUNC(onFiredPlayer)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerVehicle", LINKFUNC(onFiredPlayer)] call CBA_fnc_addEventHandler; + + + addMissionEventHandler ["Loaded", { // Restart UI vars on mission load + if (GVAR(running)) then { + TRACE_1("restarting effects",CBA_missionTime); + [false] call FUNC(setupDisplayEffects); + [true] call FUNC(setupDisplayEffects); + }; + }]; +}] call CBA_fnc_addEventHandler; + + +// Handle an edge case for non-dedicated servers were the server running the fog effect would sync fog to other clients +[QGVAR(nonDedicatedFix), LINKFUNC(nonDedicatedFix)] call CBA_fnc_addEventHandler; +if (!isNil QGVAR(serverPriorFog)) then {[] call FUNC(nonDedicatedFix);}; // If var is defined, run it now (we must be a jip) + + +// Add keybinds +["ACE3 Equipment", QGVAR(IncreaseNVGBrightness), localize LSTRING(IncreaseNVGBrightness), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting", "isNotRefueling"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if ((currentVisionMode ACE_player != 1)) exitWith {false}; + if (!(missionNamespace getVariable [QGVAR(allowBrightnessControl), true])) exitWith {false}; // just a mission setVar (not ace_setting) + + // Statement + [ACE_player, 1] call FUNC(changeNVGBrightness); + true +}, {false}, [201, [false, false, true]], false] call CBA_fnc_addKeybind; //PageUp + ALT + +["ACE3 Equipment", QGVAR(DecreaseNVGBrightness), localize LSTRING(DecreaseNVGBrightness), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting", "isNotRefueling"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if ((currentVisionMode ACE_player != 1)) exitWith {false}; + if (!(missionNamespace getVariable [QGVAR(allowBrightnessControl), true])) exitWith {false}; // just a mission setVar (not ace_setting) + + // Statement + [ACE_player, -1] call FUNC(changeNVGBrightness); + true +}, {false}, [209, [false, false, true]], false] call CBA_fnc_addKeybind; //PageDown + ALT + +#ifdef DEBUG_MODE_FULL +WARNING("Debug mouse wheel action enabled, this should NOT be in a final release"); +["MouseZChanged", { + GVAR(nextEffectsUpdate) = 0; + if (cba_events_shift) then { + GVAR(effectScaling) = ((GVAR(effectScaling) + ((_this select 1) / 20)) max 0) min 1; + systemChat format ["%1: %2", QGVAR(effectScaling), GVAR(effectScaling)]; + }; + if (cba_events_control) then { + GVAR(fogScaling) = ((GVAR(fogScaling) + ((_this select 1) / 20)) max 0) min 1; + systemChat format ["%1: %2", QGVAR(fogScaling), GVAR(fogScaling)]; + }; +}] call CBA_fnc_addDisplayHandler; +#endif + diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf deleted file mode 100644 index de0b629d76..0000000000 --- a/addons/nightvision/XEH_postInitClient.sqf +++ /dev/null @@ -1,65 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -if (!hasInterface) exitWith {}; - -GVAR(ppEffectBlur) = ppEffectCreate ["dynamicBlur", 1234]; -GVAR(ppEffectBlur) ppEffectForceInNVG true; -GVAR(ppEffectBlur) ppEffectAdjust [0]; -GVAR(ppEffectBlur) ppEffectCommit 0; - -GVAR(ppEffectRadialBlur) = ppEffectCreate ["radialBlur", 1238]; -GVAR(ppEffectRadialBlur) ppEffectForceInNVG true; -GVAR(ppEffectRadialBlur) ppEffectAdjust [0, 0, 0, 0]; -GVAR(ppEffectRadialBlur) ppEffectCommit 0; - -GVAR(ppEffectFilmGrain) = ppEffectCreate ["FilmGrain", 1235]; -GVAR(ppEffectFilmGrain) ppEffectAdjust [0.25, 2.5, 2.5, 2.5*0.3, 2.5*0.3, false]; -GVAR(ppEffectFilmGrain) ppEffectCommit 0; - -GVAR(ppEffectNVGBrightness) = ppEffectCreate ["ColorCorrections", 1236]; -GVAR(ppEffectNVGBrightness) ppEffectForceInNVG true; -GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; -GVAR(ppEffectNVGBrightness) ppEffectCommit 0; - -GVAR(ppEffectMuzzleFlash) = ppEffectCreate ["ColorCorrections", 1237]; -GVAR(ppEffectMuzzleFlash) ppEffectEnable true; -GVAR(ppEffectMuzzleFlash) ppEffectForceInNVG true; -GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; -GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; - -// Setup the event handlers -["loadout", FUNC(updatePPEffects)] call CBA_fnc_addPlayerEventHandler; -["visionMode", FUNC(updatePPEffects)] call CBA_fnc_addPlayerEventHandler; -["visionMode", FUNC(onVisionModeChanged)] call CBA_fnc_addPlayerEventHandler; -["cameraView", FUNC(updatePPEffects)] call CBA_fnc_addPlayerEventHandler; -["cameraView", FUNC(onCameraViewChanged)] call CBA_fnc_addPlayerEventHandler; -["vehicle", FUNC(updatePPEffects)] call CBA_fnc_addPlayerEventHandler; -["turret", FUNC(updatePPEffects)] call CBA_fnc_addPlayerEventHandler; - -// Add keybinds -["ACE3 Equipment", QGVAR(IncreaseNVGBrightness), localize LSTRING(IncreaseNVGBrightness), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if ((currentVisionMode ACE_player != 1)) exitWith {false}; - - // Statement - [ACE_player, 1] call FUNC(changeNVGBrightness); - true -}, {false}, [201, [false, false, true]], false] call CBA_fnc_addKeybind; //PageUp + ALT - -["ACE3 Equipment", QGVAR(DecreaseNVGBrightness), localize LSTRING(DecreaseNVGBrightness), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if ((currentVisionMode ACE_player != 1)) exitWith {false}; - - // Statement - [ACE_player, -1] call FUNC(changeNVGBrightness); - true -}, {false}, [209, [false, false, true]], false] call CBA_fnc_addKeybind; //PageDown + ALT - -// Register fire event handler -["ace_firedPlayer", DFUNC(blending)] call CBA_fnc_addEventHandler; -["ace_firedPlayerVehicle", DFUNC(blending)] call CBA_fnc_addEventHandler; diff --git a/addons/nightvision/config.cpp b/addons/nightvision/config.cpp index 673a7d31c0..8e33002c31 100644 --- a/addons/nightvision/config.cpp +++ b/addons/nightvision/config.cpp @@ -18,3 +18,4 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" #include "ACE_Settings.hpp" +#include "RscTitles.hpp" diff --git a/addons/nightvision/data/nvg_mask_2048.paa b/addons/nightvision/data/nvg_mask_2048.paa new file mode 100644 index 0000000000..93913fc08c Binary files /dev/null and b/addons/nightvision/data/nvg_mask_2048.paa differ diff --git a/addons/nightvision/data/nvg_mask_4096.paa b/addons/nightvision/data/nvg_mask_4096.paa new file mode 100644 index 0000000000..24d83ef648 Binary files /dev/null and b/addons/nightvision/data/nvg_mask_4096.paa differ diff --git a/addons/nightvision/data/nvg_mask_binos_2048.paa b/addons/nightvision/data/nvg_mask_binos_2048.paa new file mode 100644 index 0000000000..b3f6e2525f Binary files /dev/null and b/addons/nightvision/data/nvg_mask_binos_2048.paa differ diff --git a/addons/nightvision/data/nvg_mask_binos_4096.paa b/addons/nightvision/data/nvg_mask_binos_4096.paa new file mode 100644 index 0000000000..4a208090f4 Binary files /dev/null and b/addons/nightvision/data/nvg_mask_binos_4096.paa differ diff --git a/addons/nightvision/data/nvg_mask_hexes.paa b/addons/nightvision/data/nvg_mask_hexes.paa new file mode 100644 index 0000000000..f81514b074 Binary files /dev/null and b/addons/nightvision/data/nvg_mask_hexes.paa differ diff --git a/addons/nightvision/data/nvg_mask_hexes_thin.paa b/addons/nightvision/data/nvg_mask_hexes_thin.paa new file mode 100644 index 0000000000..57fed1ccb0 Binary files /dev/null and b/addons/nightvision/data/nvg_mask_hexes_thin.paa differ diff --git a/addons/nightvision/data/nvg_mask_quad_2048.paa b/addons/nightvision/data/nvg_mask_quad_2048.paa new file mode 100644 index 0000000000..43df98c333 Binary files /dev/null and b/addons/nightvision/data/nvg_mask_quad_2048.paa differ diff --git a/addons/nightvision/data/nvg_mask_quad_4096.paa b/addons/nightvision/data/nvg_mask_quad_4096.paa new file mode 100644 index 0000000000..3449bc8e7a Binary files /dev/null and b/addons/nightvision/data/nvg_mask_quad_4096.paa differ diff --git a/addons/nightvision/functions/fnc_blending.sqf b/addons/nightvision/functions/fnc_blending.sqf deleted file mode 100644 index 2616cb83f5..0000000000 --- a/addons/nightvision/functions/fnc_blending.sqf +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Author: commy2 - * Change the blending when the player fires??. Called from the unified fired EH only for the local player and his vehicle. - * - * Arguments: - * None. Parameters inherited from EFUNC(common,firedEH) - * - * Return Value: - * Nothing - * - * Example: - * [clientFiredBIS-XEH] call ace_nightvision_fnc_blending - * - * Public: No - */ -#include "script_component.hpp" - -//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 _player = ACE_player; - -//If we're not in NVG mode, or it's a grenade, exit -if (currentVisionMode _player != 1 || {toLower _weapon in ["throw", "put"]}) exitWith {}; - -private _silencer = _player weaponAccessories _weapon select 0; - -private _visibleFireCoef = 1; -private _visibleFireTimeCoef = 1; - -if (_silencer != "") then { - _visibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFire"); - _visibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFireTime"); -}; - -private _visibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFire"); -private _visibleFireTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFireTime"); - -private _fnc_isTracer = { - if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "nvgOnly") > 0) exitWith {false}; - - private _indexShot = (_player ammo _weapon) + 1; - - private _lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer"); - if (_indexShot <= _lastRoundsTracer) exitWith {true}; - - private _tracersEvery = getNumber (configFile >> "CfgMagazines" >> _magazine >> "tracersEvery"); - if (_tracersEvery == 0) exitWith {false}; - - (_indexShot - _lastRoundsTracer) % _tracersEvery == 0 -}; - -if (call _fnc_isTracer) then { - _visibleFire = _visibleFire + 2; - _visibleFireTime = _visibleFireTime + 2; -}; - -private _darkness = 1 - (call EFUNC(common,ambientBrightness)); -private _nvgBrightnessCoef = 1 + (_player getVariable [QGVAR(NVGBrightness), 0]) / 4; - -_visibleFire = _darkness * _visibleFireCoef * _visibleFire * _nvgBrightnessCoef / 10 min 1; -_visibleFireTime = _darkness * _visibleFireTimeCoef * _visibleFireTime * _nvgBrightnessCoef / 10 min 0.5; - -TRACE_2("Player Shot, Adjusting NVG Effect", _visibleFire, _visibleFireTime); - -GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, _visibleFire, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; -GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; - -GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; -GVAR(ppEffectMuzzleFlash) ppEffectCommit _visibleFireTime; diff --git a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf index 04cea0f214..b6ea640564 100644 --- a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf +++ b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf @@ -1,13 +1,13 @@ /* * Author: commy2 - * Change the brightness of the unit's NVG + * Change the brightness of the unit's NVG. * * Arguments: * 0: The Unit * 1: Change in brightness (1 or -1) * * Return Value: - * Nothing + * None * * Example: * [player, 1] call ace_nightvision_fnc_changeNVGBrightness @@ -17,18 +17,24 @@ #include "script_component.hpp" params ["_player", "_changeInBrightness"]; -TRACE_2("params",_player,_changeInBrightness); +TRACE_2("changeNVGBrightness",_player,_changeInBrightness); -if (!hasInterface) exitWith {}; +private _areEffectsDisabled = GVAR(effectScaling) == 0; +private _brightness = _player getVariable [QGVAR(NVGBrightness), [0, -3] select _areEffectsDisabled]; -private _brightness = _player getVariable [QGVAR(NVGBrightness), 0]; - -_brightness = ((round (10 * _brightness + _changeInBrightness) / 10) min 0.5) max -0.5; +_brightness = ((_brightness + _changeInBrightness) min 0) max -6; _player setVariable [QGVAR(NVGBrightness), _brightness, false]; -GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, (_brightness + 1), 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; -GVAR(ppEffectNVGBrightness) ppEffectCommit 0; - -[format [(localize LSTRING(NVGBrightness)), (_brightness * 10)]] call EFUNC(common,displayTextStructured); +[format [(localize LSTRING(NVGBrightness)), _brightness]] call EFUNC(common,displayTextStructured); playSound "ACE_Sound_Click"; + +// handle only brightness if effects are disabled +if (_areEffectsDisabled) exitWith { + // here we take (-6; 0) _brightness range and alter it to (0.4; 1.6) + GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, (_brightness+3)/5 + 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; + GVAR(ppEffectNVGBrightness) ppEffectCommit 0; +}; + +// Trigger full ppEffects update next time run in the PFEH: +GVAR(nextEffectsUpdate) = -1; diff --git a/addons/nightvision/functions/fnc_initModule.sqf b/addons/nightvision/functions/fnc_initModule.sqf index 6831a29edf..50f8785e91 100644 --- a/addons/nightvision/functions/fnc_initModule.sqf +++ b/addons/nightvision/functions/fnc_initModule.sqf @@ -17,5 +17,6 @@ #include "script_component.hpp" params ["_module"]; +TRACE_1("initModule",_module); [_module, QGVAR(disableNVGsWithSights), "disableNVGsWithSights"] call EFUNC(common,readSettingFromModule); diff --git a/addons/nightvision/functions/fnc_nonDedicatedFix.sqf b/addons/nightvision/functions/fnc_nonDedicatedFix.sqf new file mode 100644 index 0000000000..2a5178a595 --- /dev/null +++ b/addons/nightvision/functions/fnc_nonDedicatedFix.sqf @@ -0,0 +1,30 @@ +/* + * Author: PabstMirror + * Handles the client who is the non-dedicated server turning on the fog effects. + * + * Arguments: + * 0: Module + * + * Return Value: + * None + * + * Example: + * [] call ace_nightvision_fnc_nonDedicatedFix + * + * Public: No + */ +#include "script_component.hpp" + +TRACE_1("Starting PFEH to handling non-dedicated server running effect",GVAR(serverPriorFog)); + +if (isServer) exitWith {}; + +[{ + if (isNil QGVAR(serverPriorFog)) exitWith { + TRACE_1("Ending PFEH to handling non-dedicated server running effect",_this); + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + if (!GVAR(running)) then { // If we aren't running the effect ourselves, then use the server's old fog value + 0 setFog GVAR(serverPriorFog); + }; +}, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/nightvision/functions/fnc_onCameraViewChanged.sqf b/addons/nightvision/functions/fnc_onCameraViewChanged.sqf index 5384d6924c..08ec3afcec 100644 --- a/addons/nightvision/functions/fnc_onCameraViewChanged.sqf +++ b/addons/nightvision/functions/fnc_onCameraViewChanged.sqf @@ -14,10 +14,13 @@ * * Public: No */ - #include "script_component.hpp" params ["_unit", "_cameraView"]; +TRACE_2("onCameraViewChanged",_unit,_cameraView); + +// Refresh goggle effect (e.g. switching to vehicle's NVG) +[] call FUNC(refreshGoggleType); if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then { if ((vehicle _unit == _unit) diff --git a/addons/nightvision/functions/fnc_onFiredPlayer.sqf b/addons/nightvision/functions/fnc_onFiredPlayer.sqf new file mode 100644 index 0000000000..98dc8ab56d --- /dev/null +++ b/addons/nightvision/functions/fnc_onFiredPlayer.sqf @@ -0,0 +1,66 @@ +/* + * Author: commy2, Dslyecxi, PabstMirror + * Change the blending when the player fires. Called from the unified fired EH only for the local player and his vehicle. + * + * Arguments: + * None. Parameters inherited from EFUNC(common,firedEH) + * + * Return Value: + * None + * + * Example: + * [clientFiredBIS-XEH] call ace_nightvision_fnc_onFiredPlayer + * + * Public: No + */ +#include "script_component.hpp" + +//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"]; +TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile); + +if ((!GVAR(running)) || {_weapon == "throw"} || {_weapon == "put"}) exitWith {}; + +private _visibleFireCoef = 1; +if (_unit == ace_player) then { + private _silencer = (_unit weaponAccessories _weapon) select 0; + if (_silencer != "") then { + _visibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFire"); + TRACE_1("muzzle attachement",_visibleFireCoef); + }; +}; + +private _visibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFire"); + +private _isTracer = call { + if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "nvgOnly") > 0) exitWith {false}; + private _indexShot = (_unit ammo _weapon) + 1; + private _lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer"); + if (_indexShot <= _lastRoundsTracer) exitWith {true}; + private _tracersEvery = getNumber (configFile >> "CfgMagazines" >> _magazine >> "tracersEvery"); + if (_tracersEvery == 0) exitWith {false}; + (_indexShot - _lastRoundsTracer) % _tracersEvery == 0 +}; + +TRACE_3("",_ammo,_visibleFire,_isTracer); +if ( _isTracer) then { + _visibleFire = _visibleFire + 2; +}; + +_visibleFire = _visibleFireCoef * _visibleFire; +if (_ammo isKindOf "BulletBase") then { + _visibleFire = _visibleFire min 5; // Prevent every shot from triggering with HMG +}; +TRACE_1("final", _visibleFire); + +if (_visibleFire <= 1.5) exitWith {}; +if ((random (linearConversion [1, 4, GVAR(nvgGeneration), 10, 20])) > _visibleFire) exitWith {}; + +GVAR(ppEffectCCMuzzleFlash) = ppEffectCreate ["ColorCorrections", 1237]; +GVAR(ppEffectCCMuzzleFlash) ppEffectEnable true; +GVAR(ppEffectCCMuzzleFlash) ppEffectForceInNVG true; + +GVAR(ppEffectCCMuzzleFlash) ppEffectAdjust [1, 1, -1, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; +GVAR(ppEffectCCMuzzleFlash) ppEffectCommit 0; + +GVAR(ppEffectCCMuzzleFlash) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; +GVAR(ppEffectCCMuzzleFlash) ppEffectCommit 0.07; diff --git a/addons/nightvision/functions/fnc_onLoadoutChanged.sqf b/addons/nightvision/functions/fnc_onLoadoutChanged.sqf new file mode 100644 index 0000000000..32f1914bfa --- /dev/null +++ b/addons/nightvision/functions/fnc_onLoadoutChanged.sqf @@ -0,0 +1,25 @@ +/* + * Author: Dslyecxi, PabstMirror + * Refreshes nvg effect if switching NVG goggles. + * + * Arguments: + * 0: Player + * + * Return Value: + * None + * + * Example: + * [player] call ace_nightvision_fnc_onLoadoutChange + * + * Public: No + */ +#include "script_component.hpp" + +params ["_player"]; +TRACE_1("onLoadoutChange",_player); + +private _newHMD = hmd _player; +if (_newHMD != GVAR(playerHMD)) then { + GVAR(playerHMD) = _newHMD; + [] call FUNC(refreshGoggleType); +}; diff --git a/addons/nightvision/functions/fnc_onVisionModeChanged.sqf b/addons/nightvision/functions/fnc_onVisionModeChanged.sqf index 64f77a69bc..f28e39b964 100644 --- a/addons/nightvision/functions/fnc_onVisionModeChanged.sqf +++ b/addons/nightvision/functions/fnc_onVisionModeChanged.sqf @@ -1,5 +1,5 @@ /* - * Author: BaerMitUmlaut + * Author: BaerMitUmlaut, Dslyecxi, PabstMirror * Disables turning on NVGs while the player aims down his sight. * * Arguments: @@ -14,17 +14,36 @@ * * Public: No */ - #include "script_component.hpp" params ["_unit", "_visionMode"]; +TRACE_2("onVisionModeChanged",_unit,_visionMode); +// handle only brightness if effects are disabled +if (GVAR(effectScaling) == 0) exitWith { + GVAR(ppEffectNVGBrightness) ppEffectEnable (_visionMode == 1); +}; + +// Start PFEH when entering night vision mode: +if (_visionMode == 1) then { + if (GVAR(PFID) == -1) then { + GVAR(running) = true; + [true] call FUNC(setupDisplayEffects); + [] call FUNC(refreshGoggleType); + GVAR(PFID) = [LINKFUNC(pfeh), 0, []] call CBA_fnc_addPerFrameHandler; + + // Fade in from black when turning nvg on + QGVAR(turnOnEffect) cutText ["", "BLACK IN", 2.5]; + }; +}; + +// Handle disableNVGsWithSights setting: if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then { if ((vehicle _unit == _unit) - || {isTurnedOut _unit} - || {!([_unit] call EFUNC(common,hasHatch)) - && {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))} - }) then { + || {isTurnedOut _unit} + || {!([_unit] call EFUNC(common,hasHatch)) + && {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))} + }) then { if ((cameraView == "GUNNER") && {_visionMode > 0}) then { _unit action ["NVGogglesOff", _unit]; }; diff --git a/addons/nightvision/functions/fnc_pfeh.sqf b/addons/nightvision/functions/fnc_pfeh.sqf new file mode 100644 index 0000000000..5da34d2aac --- /dev/null +++ b/addons/nightvision/functions/fnc_pfeh.sqf @@ -0,0 +1,159 @@ +/* + * Author: Dslyecxi, PabstMirror + * PFEH to handle refreshing effects. + * Updates UI scale on every frame, effects are updated less often. + * + * Arguments: + * 1: PFEH ID + * + * Return Value: + * None + * + * Example: + * [[], 1] call ace_nightvision_fnc_pfeh + * + * Public: No + */ +#include "script_component.hpp" + +if ((currentVisionMode ACE_player) != 1) exitWith { + GVAR(running) = false; + [false] call FUNC(setupDisplayEffects); + [GVAR(PFID)] call CBA_fnc_removePerFrameHandler; + GVAR(PFID) = -1; +}; +if (EGVAR(common,OldIsCamera)) exitWith { + if (GVAR(running)) then { + TRACE_2("pausing NVG for scripted camera",alive ACE_player,EGVAR(common,OldIsCamera)); + GVAR(running) = false; + [false] call FUNC(setupDisplayEffects); + }; +}; +if (!GVAR(running)) then { + TRACE_1("Un-Pausing", GVAR(paused)); + GVAR(running) = true; + [true] call FUNC(setupDisplayEffects); + [] call FUNC(refreshGoggleType); +}; + +// Scale Border / Hex +BEGIN_COUNTER(borderScaling); +private _scale = (call EFUNC(common,getZoom)) * 1.12513; +if (!(GVAR(defaultPositionBorder) isEqualTo [])) then { + // Prevents issues when "zooming out" on ultra wide monitors - The square mask would be narrower than the screen + if (((GVAR(defaultPositionBorder) select 2) * _scale) < safeZoneW) then { + _scale = safeZoneW / (GVAR(defaultPositionBorder) select 2); + }; + [(uiNamespace getVariable QGVAR(titleDisplay)) displayCtrl 1000, GVAR(defaultPositionHex), _scale] call FUNC(scaleCtrl); + [(uiNamespace getVariable QGVAR(titleDisplay)) displayCtrl 1001, GVAR(defaultPositionBorder), _scale] call FUNC(scaleCtrl); + // Fade out hexes with high zoom (optics are doing the magnifying, not the player "focusing in") + ((uiNamespace getVariable QGVAR(titleDisplay)) displayCtrl 1000) ctrlSetFade (linearConversion [4, 6, _scale, 0.2, 1, true]); +}; +END_COUNTER(borderScaling); + +if (CBA_missionTime < GVAR(nextEffectsUpdate)) then { + // Update radial blur as it depends on zoom level, so should be changed each frame like the border/hex + if (GVAR(ppeffectRadialBlur) != -1) then { + GVAR(ppeffectRadialBlur) ppEffectAdjust [.005, .005, _scale * GVAR(nvgBlurRadius), _scale * .16]; + GVAR(ppeffectRadialBlur) ppEffectCommit 0; + }; + // Need to rapidly update fog or it will try to resync from the server + if (GVAR(fogScaling) > 0) then { + 0 setFog GVAR(nvgFog); + }; +} else { + // Redo full effects less often + BEGIN_COUNTER(updateAllEffects); + GVAR(nextEffectsUpdate) = CBA_missionTime + 5; + + // Detecting the efficiency of the nightvision. + private _lightFinal = 0 max (moonIntensity - ((overcast * .8) min .275) - (rain * .5)); + private _effectiveLight = _lightFinal * linearConversion [1, 3, GVAR(nvgGeneration), 0.25, 1]; + private _effectMod = linearConversion [1, 3, GVAR(nvgGeneration), 1.5, 1]; + // This has become a little weird. Basically means that lightfinal is unlikely to reach zero with any moon in the sky + // buuut it just so happens that setting it like this means that the lighting progression from clear -> cloudy -> rainy works particularly well. + + private _grainFinal = linearConversion [1, 0, _effectiveLight, ST_NVG_GRAIN_MIN, ST_NVG_GRAIN_MAX, true]; + private _blurFinal = _effectMod *_effectMod * linearConversion [1, 0, _effectiveLight, ST_NVG_BLUR_MIN, ST_NVG_BLUR_MAX, true]; + private _brightFinal = linearConversion [0, 1, _effectiveLight, ST_NVG_BRIGHT_MIN, ST_NVG_BRIGHT_MAX, true]; + private _contrastFinal = linearConversion [0, 1, _effectiveLight, ST_NVG_CONTRAST_MIN, ST_NVG_CONTRAST_MAX, true]; + private _grainIntensityFinal = _effectMod * linearConversion [1, 0, _effectiveLight, ST_NVG_NOISEINTENSITY_MIN, ST_NVG_NOISEINTENSITY_MAX, true]; + private _noiseSharpnessFinal = linearConversion [1, 0, _effectiveLight, ST_NVG_NOISESHARPNESS_MIN, ST_NVG_NOISESHARPNESS_MAX, true]; + + private _playerBrightSetting = ACE_player getVariable [QGVAR(NVGBrightness), 0]; + _brightFinal = _brightFinal + (_playerBrightSetting / 20); + + private _fogApply = linearConversion [0, 1, _effectiveLight, ST_NVG_MAXFOG, ST_NVG_MINFOG, true]; + + // Modify blur if looking down scope + if ((cameraView == "GUNNER") && {[ACE_player] call CBA_fnc_canUseWeapon}) then { + if (currentWeapon ACE_player == "") exitWith {}; + if (currentWeapon ACE_player == primaryWeapon ACE_player) exitWith {_blurFinal = _blurFinal * linearConversion [0, 1, GVAR(aimDownSightsBlur), 1, ST_NVG_CAMERA_BLUR_SIGHTS_RIFLE]}; // Rifles are bad + if (currentWeapon ACE_player == handgunWeapon ACE_player) exitWith {_blurFinal = _blurFinal * linearConversion [0, 1, GVAR(aimDownSightsBlur), 1, ST_NVG_CAMERA_BLUR_SIGHTS_PISTOL]}; // Pistols aren't so bad + }; + + // Scale effects based on ace_nightvision_effectScaling setting + _grainIntensityFinal = _grainIntensityFinal * GVAR(effectScaling); + _noiseSharpnessFinal = linearConversion [0, 1, GVAR(effectScaling), 2.5, _noiseSharpnessFinal]; + private _radialBlurPower = 0.0025 * GVAR(effectScaling); + _brightFinal = linearConversion [0, 1, GVAR(effectScaling), 1, _brightFinal]; + _contrastFinal = linearConversion [0, 1, GVAR(effectScaling), 1, _contrastFinal]; + + + // Setup all effects + // This is hacky but... works. This prevents the effects from being cancelled by various things - alt-tabbing, resizing, going into AT sights, etc. A nicer method would be welcome but I don't have time to spend on it. TODO. + + // FilmGrain - Electronic Noise + // Params: [intensity(0..1), sharpness(0..20), grainsize(1..8), intensityX0, intensityX1, monochromatic(bool)] + GVAR(ppeffectGrain) = ppEffectCreate ["FilmGrain", 200]; + GVAR(ppeffectGrain) ppEffectAdjust [_grainIntensityFinal, _noiseSharpnessFinal, _grainFinal, 0.3, 0.3]; + // OldNVG: [0.25, 2.5, 2.5, _grainSetting, _grainSetting, false] + GVAR(ppeffectGrain) ppEffectCommit 0; + GVAR(ppeffectGrain) ppEffectForceInNVG true; + GVAR(ppeffectGrain) ppEffectEnable true; + + // RadialBlur - Blurs closer to the edge nvg border (radius based on GVAR(bluRadius) config; e.g. larger for quadtube) + // Note: "Will not do anything if RADIAL BLUR is disabled in Video Options." - So should try to keep this effect to a minimum to prevent balance issues + // Params: [powerX, powerY, offsetX, offsetY] + if (GVAR(nvgBlurRadius) != -1) then { + GVAR(ppeffectRadialBlur) = ppEffectCreate ["RadialBlur", 451]; + GVAR(ppeffectRadialBlur) ppEffectAdjust [_radialBlurPower, _radialBlurPower, _scale * GVAR(nvgBlurRadius), _scale * .16]; + GVAR(ppeffectRadialBlur) ppEffectCommit 0; + GVAR(ppeffectRadialBlur) ppEffectForceInNVG true; + GVAR(ppeffectRadialBlur) ppEffectEnable true; + }; + + // ColorCorrections - Changes brightness, contrast and "green" color of nvg + // Params: [brightness(0..2), contrast(0..inf), offset(-x..+x), blendArray, colorizeArray, weightArray] + GVAR(ppeffectColorCorrect) = ppEffectCreate ["ColorCorrections", 2003]; + GVAR(ppeffectColorCorrect) ppEffectAdjust [_brightFinal, _contrastFinal, 0, [0.0, 0.0, 0.0, 0.0], [1.3, 1.2, 0.0, 0.9], [6, 1, 1, 0.0]]; + GVAR(ppeffectColorCorrect) ppEffectCommit 0; + GVAR(ppeffectColorCorrect) ppEffectForceInNVG true; + GVAR(ppeffectColorCorrect) ppEffectEnable true; + + // DynamicBlur - Increases overall screen blur when aiming down sights (which would be hard/impossible with NVG) + // Params: [value(0..inf)] + GVAR(ppeffectBlur) = ppEffectCreate ["DynamicBlur", 190]; + GVAR(ppeffectBlur) ppEffectAdjust [_blurFinal]; + GVAR(ppeffectBlur) ppEffectCommit 0; + GVAR(ppeffectBlur) ppEffectForceInNVG true; + GVAR(ppeffectBlur) ppEffectEnable true; + + + // Modify local fog: + if (GVAR(fogScaling) > 0) then { + if (((vehicle ACE_player) != ACE_player) && {(vehicle ACE_player) isKindOf "Air"}) then { // For flying in particular, can refine nicer later. + _fogApply = _fogApply * ST_NVG_AIR_FOG_MULTIPLIER; + }; + _fogApply = linearConversion [0, 1, GVAR(priorFog) select 0, (GVAR(fogScaling) * _fogApply), 1]; // mix in old fog if present + GVAR(nvgFog) = [_fogApply, 0, 0]; + 0 setFog GVAR(nvgFog) + }; + + #ifdef DEBUG_MODE_FULL + private _aceAmbient = [] call EFUNC(common,ambientBrightness); + hintSilent format ["EffectiveLight %1\nLight: %2\nACE Ambient: %3\nBrightness: %4\nContrast: %5\nGrain: %6\nBlur: %7\nFog: %8\nScaling %9", _effectiveLight, _lightFinal, _aceAmbient, _brightFinal, _contrastFinal, [_grainIntensityFinal, _noiseSharpnessFinal, _grainFinal], _blurFinal, _fogApply, [GVAR(effectScaling),GVAR(fogScaling)]]; + #endif + + END_COUNTER(updateAllEffects); +}; diff --git a/addons/nightvision/functions/fnc_refreshGoggleType.sqf b/addons/nightvision/functions/fnc_refreshGoggleType.sqf new file mode 100644 index 0000000000..1ebadf56ae --- /dev/null +++ b/addons/nightvision/functions/fnc_refreshGoggleType.sqf @@ -0,0 +1,129 @@ +/* + * Author: Dslyecxi, PabstMirror + * Determines night vision source (player/vehicle) - Updates UI based on type. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_nightvision_fnc_refreshGoggleType + * + * Public: No + */ +#include "script_component.hpp" + +TRACE_1("refreshGoggleType",_this); + +if (!GVAR(running)) exitWith {}; + +// Defaults (good for most vehicles/binoculars) +private _borderImage = ""; +private _eyeCups = false; +private _hideHex = true; +private _nvgGen = 3; +private _blurRadius = -1; + +if (alive ACE_player) then { + if (((vehicle ACE_player) == ACE_player) || { + // Test if we are using player's nvg or if sourced from vehicle: + + private _currentVehicle = vehicle ACE_player; + private _vehConfig = configFile >> "CfgVehicles" >> (typeOf _currentVehicle); + + if (cameraView != "GUNNER") exitWith {true}; // asume hmd usage outside of gunner view + + if (ACE_player == (driver _currentVehicle)) exitWith { + !("NVG" in getArray (_vehConfig >> "ViewOptics" >> "visionMode")); + }; + private _result = true; + private _turret = ACE_player call CBA_fnc_turretPath; + private _turretConfig = [_currentVehicle, _turret] call CBA_fnc_getTurret; + + // Seems to cover things like the offroad technical + if ((isNumber (_turretConfig >> "optics")) && {(getNumber (_turretConfig >> "optics")) == 0}) exitWith {true}; + + private _turretConfigOpticsIn = _turretConfig >> "OpticsIn"; + if (isClass _turretConfigOpticsIn) then { + for "_index" from 0 to (count _turretConfigOpticsIn - 1) do { + if ("NVG" in getArray (_turretConfigOpticsIn select _index >> "visionMode")) exitWith {_result = false}; + }; + } else { + // No OpticsIn usualy means RCWS, still need to test on more vehicles + _result = false; + }; + _result + }) then { + if ((cameraView == "GUNNER") && {currentWeapon ACE_player != ""} && {binocular ACE_player == currentWeapon ACE_player}) exitWith { + TRACE_1("souce: binocular",binocular ACE_player); // Source is from player's binocular (Rangefinder/Vector21bNite) + private _config = configFile >> "CfgWeapons" >> (binocular ACE_player); + if (isNumber (_config >> QGVAR(generation))) then {_nvgGen = getNumber (_config >> QGVAR(generation));}; + }; + + TRACE_1("source: hmd",GVAR(playerHMD)); // Source is player's HMD (or possibly a NVG scope, but no good way to detect that) + private _config = configFile >> "CfgWeapons" >> GVAR(playerHMD); + if (!isClass _config) exitWith {}; + + // Only use border if there is no modelOptics + if ((getText (_config >> "modelOptics")) == "") then { + _borderImage = getText (_config >> QGVAR(border)); + _eyeCups = ((getNumber (_config >> QGVAR(eyeCups))) == 1); + _hideHex = (getNumber (_config >> QGVAR(hideHex))) == 1; + if (isNumber (_config >> QGVAR(bluRadius))) then {_blurRadius = getNumber (_config >> QGVAR(bluRadius));}; + }; + if (isNumber (_config >> QGVAR(generation))) then {_nvgGen = getNumber (_config >> QGVAR(generation));}; + + } else { + TRACE_1("source: vehicle - defaults",typeOf vehicle ACE_player); + }; +}; + +#ifdef DEBUG_MODE_FULL +systemChat format ["NVG Refresh - Border: %1", _borderImage]; +systemChat format ["EyeCups: %1, HideHex %2, NVGen: %3, BluRadius: %4", _eyeCups, _hideHex, _nvgGen, _blurRadius]; +#endif + +GVAR(nvgBlurRadius) = _blurRadius; +GVAR(nvgGeneration) = _nvgGen; + +// Setup border and hex image based on NVG config: +private _scale = (call EFUNC(common,getZoom)) * 1.12513; + +private _borderImageCtrl = (uiNamespace getVariable QGVAR(titleDisplay)) displayCtrl 1001; +private _trippleHeadLeft = (uiNamespace getVariable QGVAR(titleDisplay)) displayCtrl 1002; +private _trippleHeadRight = (uiNamespace getVariable QGVAR(titleDisplay)) displayCtrl 1003; +if (_borderImage == "") then { + _borderImageCtrl ctrlShow false; + _trippleHeadLeft ctrlShow false; + _trippleHeadRight ctrlShow false; + GVAR(defaultPositionBorder) = []; +} else { + _borderImageCtrl ctrlShow true; + _trippleHeadLeft ctrlShow true; + _trippleHeadRight ctrlShow true; + + _borderImageCtrl ctrlSetText _borderImage; + _borderImageCtrl ctrlSetFade ([.15, 0] select _eyeCups); + + #define BORDER_SIZE 3 + GVAR(defaultPositionBorder) = [safezoneX - (((BORDER_SIZE * 0.75) * safezoneH) - safezoneW) / 2, safezoneY - ((BORDER_SIZE - 1) / 2) * safezoneH, (BORDER_SIZE * 0.75) * safezoneH, BORDER_SIZE * safezoneH]; + [_borderImageCtrl, GVAR(defaultPositionBorder), _scale] call FUNC(scaleCtrl); +}; + +private _hexCtrl = (uiNamespace getVariable QGVAR(titleDisplay)) displayCtrl 1000; +if (_hideHex) then { + _hexCtrl ctrlShow false; +} else { + _hexCtrl ctrlShow true; + // _hexCtrl ctrlSetText QPATHTOF(data\nvg_mask_hexes.paa); + _hexCtrl ctrlSetText QPATHTOF(data\nvg_mask_hexes_thin.paa); + + #define HEX_SIZE 1.5 + GVAR(defaultPositionHex) = [safezoneX - (((HEX_SIZE * 0.75) * safezoneH) - safezoneW) / 2, safezoneY - ((HEX_SIZE - 1) / 2) * safezoneH, (HEX_SIZE * 0.75) * safezoneH, HEX_SIZE * safezoneH]; + [_hexCtrl, GVAR(defaultPositionHex), _scale] call FUNC(scaleCtrl); +}; + +// Trigger full ppEffects update next time run in the PFEH: +GVAR(nextEffectsUpdate) = -1; diff --git a/addons/nightvision/functions/fnc_scaleCtrl.sqf b/addons/nightvision/functions/fnc_scaleCtrl.sqf new file mode 100644 index 0000000000..b5bb80715d --- /dev/null +++ b/addons/nightvision/functions/fnc_scaleCtrl.sqf @@ -0,0 +1,31 @@ +/* + * Author: Dslyecxi, PabstMirror + * Determines night vision source (player/vehicle) - Updates UI based on type. + * + * Arguments: + * 0: Control + * 1: Default position [x,y,w,h] + * 2: Zoom Level + * + * Return Value: + * None + * + * Example: + * [] call ace_nightvision_fnc_scaleCtrl + * + * Public: No + */ +#include "script_component.hpp" + +params ["_ctrl", "_default_pos", "_scale"]; + +if (!ctrlShown _ctrl) exitWith {}; + +_ctrl ctrlSetPosition +[(((_default_pos select 0) - 0.5) * _scale) + 0.5, +(((_default_pos select 1) - 0.5) * _scale) + 0.5, +(_default_pos select 2) * _scale, +(_default_pos select 3) * _scale]; + + +_ctrl ctrlCommit 0; diff --git a/addons/nightvision/functions/fnc_setupDisplayEffects.sqf b/addons/nightvision/functions/fnc_setupDisplayEffects.sqf new file mode 100644 index 0000000000..004d186998 --- /dev/null +++ b/addons/nightvision/functions/fnc_setupDisplayEffects.sqf @@ -0,0 +1,77 @@ +/* + * Author: Dslyecxi, PabstMirror + * Handles setting up the effects: fog, ppEffects and the RscTittle. + * + * Arguments: + * 0: Activated + * + * Return Value: + * None + * + * Example: + * [true] call ace_nightvision_fnc_setupDisplayEffects + * + * Public: No + */ +#include "script_component.hpp" + +params ["_activated"]; +TRACE_1("setupDisplayEffects",_activated); + +// Backup and restore changes to fog: +if (GVAR(fogScaling) > 0) then { + if (_activated) then { + if (isNil QGVAR(priorFog)) then { + TRACE_1("Backing up fog",fogParams); + GVAR(priorFog) = fogParams; + } else { + ERROR("fog already backed up"); + }; + + // Handle non-dedicated: + if (isServer && hasInterface) then { + missionNamespace setVariable [QGVAR(serverPriorFog), fogParams, true]; + [QGVAR(nonDedicatedFix), []] call CBA_fnc_remoteEvent; + }; + } else { + if (!isNil QGVAR(priorFog)) then { + 0 setFog GVAR(priorFog); + GVAR(priorFog) = nil; + } else { + ERROR("no fog backed up"); + }; + + // Handle non-dedicated: + if (isServer && hasInterface) then { + missionNamespace setVariable [QGVAR(serverPriorFog), nil, true]; + }; + }; +}; + +// Note: Using BIS_fnc_rscLayer because of bug with string syntax - https://feedback.bistudio.com/T120768 +(QGVAR(display) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; // Cleanup Old Display +if (_activated) then { // Create New Display + (QGVAR(display) call BIS_fnc_rscLayer) cutRsc [QGVAR(title), "PLAIN", 0, false]; +}; + +// Cleanup Old PP Effects +if (GVAR(ppeffectGrain) != -1) then { + ppEffectDestroy GVAR(ppeffectGrain); + GVAR(ppeffectGrain) = -1; +}; +if (GVAR(ppeffectBlur) != -1) then { + ppEffectDestroy GVAR(ppeffectBlur); + GVAR(ppeffectBlur) = -1; +}; +if (GVAR(ppeffectRadialBlur) != -1) then { + ppEffectDestroy GVAR(ppeffectRadialBlur); + GVAR(ppeffectRadialBlur) = -1; +}; +if (GVAR(ppeffectColorCorrect) != -1) then { + ppEffectDestroy GVAR(ppeffectColorCorrect); + GVAR(ppeffectColorCorrect) = -1; +}; +if (GVAR(ppEffectCCMuzzleFlash) != -1) then { + ppEffectDestroy GVAR(ppEffectCCMuzzleFlash); + GVAR(ppEffectCCMuzzleFlash) = -1; +}; diff --git a/addons/nightvision/functions/fnc_updatePPEffects.sqf b/addons/nightvision/functions/fnc_updatePPEffects.sqf deleted file mode 100644 index 9bf8321353..0000000000 --- a/addons/nightvision/functions/fnc_updatePPEffects.sqf +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Author: commy2, PabstMirror and esteldunedain - * Update the ppEffects everytime something changes - * - * Arguments: - * Nothing - * - * Return Value: - * Nothing - * - * Example: - * [someEvent] call ace_nightvision_fnc_updatePPEffects - * - * Public: No - */ -#include "script_component.hpp" - -if (!hasInterface) exitWith {}; - -disableSerialization; - -params [["_display", displayNull]]; - -if !(_display isEqualType displayNull) then { - _display = displayNull; -}; - -private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config", "_hmd", "_cameraView", "_turret"]; - -_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 { - GVAR(ppEffectFilmGrain) ppEffectEnable false; - GVAR(ppEffectBlur) ppEffectEnable false; - GVAR(ppEffectRadialBlur) ppEffectEnable false; - GVAR(ppEffectNVGBrightness) ppEffectEnable false; -}; - -// The unit has nightvision -_config = configFile >> "CfgVehicles" >> typeOf _currentVehicle; -_hmd = hmd ACE_player; -_cameraView = cameraView; -_turret = [ACE_player] call EFUNC(common,getTurretIndex); - - -_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"; - - if (isClass _turretConfigOpticsIn) then { - for "_index" from 0 to (count _turretConfigOpticsIn - 1) do { - if ("NVG" in getArray (_turretConfigOpticsIn select _index >> "visionMode")) exitWith {_result = false}; - }; - } else { - //No OpticsIn usualy means RCWS, still need to test on more vehicles - _result = false; - }; - _result -}; - -if ((_currentVehicle == ACE_player) || _fnc_isUsingHMD) then { - _grainSetting = getNumber (configFile >> "CfgWeapons" >> _hmd >> "ACE_NightVision_grain"); - _blurSetting = getNumber (configFile >> "CfgWeapons" >> _hmd >> "ACE_NightVision_blur"); - _radBlurSetting = getNumber (configFile >> "CfgWeapons" >> _hmd >> "ACE_NightVision_radBlur"); - TRACE_3("New NVG Settings From Player NVG",_grainSetting,_blurSetting,_radBlurSetting) -} else { - _grainSetting = _currentVehicle getVariable ["ACE_NightVision_grain", getNumber (_config >> "ACE_NightVision_grain")]; - _blurSetting = _currentVehicle getVariable ["ACE_NightVision_blur", getNumber (_config >> "ACE_NightVision_blur")]; - _radBlurSetting = _currentVehicle getVariable ["ACE_NightVision_radBlur", getNumber (_config >> "ACE_NightVision_radBlur")]; - TRACE_3("New NVG Settings From Vehicle",_grainSetting,_blurSetting,_radBlurSetting) -}; - - -// Enable the effects -GVAR(ppEffectFilmGrain) ppEffectEnable true; -GVAR(ppEffectBlur) ppEffectEnable true; -GVAR(ppEffectRadialBlur) ppEffectEnable true; -GVAR(ppEffectNVGBrightness) ppEffectEnable true; - -// Configure effects parameters -GVAR(ppEffectFilmGrain) ppEffectAdjust [0.25, 2.5, 2.5, _grainSetting, _grainSetting, false]; -GVAR(ppEffectFilmGrain) ppEffectCommit 0; -GVAR(ppEffectBlur) ppEffectAdjust [_blurSetting]; -GVAR(ppEffectBlur) ppEffectCommit 0; -GVAR(ppEffectRadialBlur) ppEffectAdjust [_radBlurSetting, _radBlurSetting, 0.2, 0.2]; -GVAR(ppEffectRadialBlur) ppEffectCommit 0; diff --git a/addons/nightvision/script_component.hpp b/addons/nightvision/script_component.hpp index 142983ebdc..0fd46d1fa3 100644 --- a/addons/nightvision/script_component.hpp +++ b/addons/nightvision/script_component.hpp @@ -15,3 +15,34 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + + +// Effect Settings / Magic values to tweak: + +// Decreases fog when in air vehicles +#define ST_NVG_AIR_FOG_MULTIPLIER 0.5 + +// Increase blur when looking down sights +#define ST_NVG_CAMERA_BLUR_SIGHTS_RIFLE 6 +#define ST_NVG_CAMERA_BLUR_SIGHTS_PISTOL 2 + +#define ST_NVG_MINFOG 0.2 +#define ST_NVG_MAXFOG 0.3 + +#define ST_NVG_GRAIN_MIN 2.25 +#define ST_NVG_GRAIN_MAX 2.7 + +#define ST_NVG_BLUR_MIN 0.05 +#define ST_NVG_BLUR_MAX 0.11 + +#define ST_NVG_BRIGHT_MIN 0.65 +#define ST_NVG_BRIGHT_MAX 0.75 + +#define ST_NVG_CONTRAST_MIN 0.4 +#define ST_NVG_CONTRAST_MAX 0.8 + +#define ST_NVG_NOISEINTENSITY_MIN 0.4 +#define ST_NVG_NOISEINTENSITY_MAX 0.55 + +#define ST_NVG_NOISESHARPNESS_MIN 1.2 +#define ST_NVG_NOISESHARPNESS_MAX 1 diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index 16f59aafdf..18d3b7684c 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -1,6 +1,11 @@ - + + + ACE Nightvision + ACE 暗視装置 + Visione notturna ACE + NV Goggles (Gen1) Noktovizor (Gen1) @@ -12,8 +17,10 @@ ПНВ (Gen1) Gafas de visión nocturna (Gen1) Éjjellátó szemüveg (1. Gen.) - 夜間暗視装置つきゴーグル (第1世代) + 暗視装置 (第1世代) 야투경 (1세대) + 夜视镜 (初代) + 夜視鏡 (初代) NV Goggles (Gen2) @@ -26,8 +33,10 @@ ПНВ (Gen2) Gafas de visión nocturna (Gen2) Éjjellátó szemüveg (2. Gen.) - 夜間暗視装置つきゴーグル (第2世代) + 暗視装置 (第2世代) 야투경 (2세대) + 夜视镜 (二代) + 夜視鏡 (二代) NV Goggles (Gen3) @@ -40,50 +49,58 @@ ПНВ (Gen3) Gafas de visión nocturna (Gen3) Éjjellátó szemüveg (3. Gen.) - 夜間暗視装置つきゴーグル (第3世代) + 暗視装置 (第3世代) 야투경 (3세대) + 夜视镜 (三代) + 夜視鏡 (三代) NV Goggles (Gen3, Brown) Noktovizor (Gen3, hnědý) JVN (Gen3, marron) NS-Brille (3. Gen., braun) - Occhiali notturni (Gen3, marroni) + Occhiali notturni (Gen3, Marroni) Gogle noktowizyjne (Gen3, brązowe) Óculos de visão noturna (Gen3, marrons) ПНВ (Gen3, Коричневый) Gafas de visión nocturna (Gen3, marrón) Éjjellátó szemüveg (3. Gen., barna) - 夜間暗視装置つきゴーグル (第3世代、ブラウン) + 暗視装置 (第3世代、ブラウン) 야투경 (3세대, 갈색) + 夜视镜 (三代, 棕色) + 夜視鏡 (三代, 棕色) NV Goggles (Gen3, Green) Noktovizor (Gen3, zelený) JVN (Gen3, vertes) NS-Brille (3. Gen., grün) - Occhiali notturni (Gen3, verdi) + Occhiali notturni (Gen3, Verdi) Gogle noktowizyjne (Gen3, zielone) Óculos de visão noturna (Gen3, verdes) ПНВ (Gen3, Зелёный) Gafas de visión nocturna (Gen3, verde) Éjjellátó szemüveg (3. Gen., zöld) - 夜間暗視装置つきゴーグル (第3世代、グリーン) + 暗視装置 (第3世代、グリーン) 야투경 (3세대, 녹색) + 夜视镜 (三代, 绿色) + 夜視鏡 (三代, 綠色) NV Goggles (Gen3, Black) Noktovizor (Gen3, černý) JVN (Gen3, noires) NS-Brille (3. Gen., schwarz) - Occhiali notturni (Gen3, neri) + Occhiali notturni (Gen3, Neri) Gogle noktowizyjne (Gen3, czarne) Óculos de visão noturna (Gen3, pretos) ПНВ (Gen3, Чёрный) Gafas de visión nocturna (Gen3, negro) Éjjellátó szemüveg (3. Gen., fekete) - 夜間暗視装置つきゴーグル (第3世代、ブラック) + 暗視装置 (第3世代、ブラック) 야투경 (3세대, 검정색) + 夜视镜 (三代, 黑色) + 夜視鏡 (三代, 黑色) NV Goggles (Gen4) @@ -96,8 +113,10 @@ ПНВ (Gen4) Gafas de visión nocturna (Gen4) Éjjellátó szemüveg (4. Gen.) - 夜間暗視装置つきゴーグル (第4世代) + 暗視装置 (第4世代) 야투경 (4세대) + 夜视镜 (四代) + 夜視鏡 (四代) NV Goggles (Wide) @@ -110,8 +129,10 @@ Éjjellátó szemüveg (széles látószögű) Óculos de visão noturna (Panorâmico) Occhiali notturni (Larghi) - 夜間暗視装置つきゴーグル (ワイド) + 暗視装置 (ワイド) 야투경 (넓음) + 夜视镜 (宽版) + 夜視鏡 (寬版) Brightness: %1 @@ -124,8 +145,10 @@ Fényerő: %1 Luminosidade: %1 Luminosità: %1 - 光度:%1 + 明度: %1 밝기: %1 + 亮度: %1 + 亮度: %1 Increase NVG Brightness @@ -138,8 +161,10 @@ Éjjellátó fényerejének növelése Aumentar Luminosidade do EVN Aumenta la luminosità dell'NVG - 夜間暗視装置の光度を上げる + 暗視装置の明度を上げる 야투경 밝기 높이기 + 增加夜视镜亮度 + 增加夜視鏡亮度 Decrease NVG Brightness @@ -152,8 +177,10 @@ Éjjellátó fényerejének csökkentése Diminuir Luminosidade do EVN Riduci la luminosità dell'NVG - 夜間暗視装置の光度を下げる + 暗視装置の明度を下げる 야투경 밝기 줄이기 + 减少夜视镜亮度 + 減少夜視鏡亮度 Nightvision @@ -165,8 +192,10 @@ Visione Notturna Visión Nocturna Vision nocturne - 夜間暗視装置 + 暗視装置 야간투시경 + 夜视 + 夜視 Settings for night vision. @@ -178,8 +207,10 @@ Impostazioni per visione notturna. Parámetros para visión nocturna Réglage pour la vision nocturne - 夜間暗視装置の設定。 + 暗視装置の設定。 야간투시경 설정 + 设定夜视选项. + 設定夜視選項. Disable NVGs in scope @@ -191,8 +222,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. @@ -204,8 +237,34 @@ 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. - スコープを使い狙いを付けると、夜間暗視装置を無効化します。 + スコープを使い狙いを付けると、暗視装置を無効化します。 조준시 야투경의 사용을 제한합니다. + 此功能开启后,当要使用瞄准镜时,为避免夜视镜镜头碰撞到瞄准镜,会先拿开夜视镜后再进行瞄准镜瞄准。 + 此功能開啟後,當要使用瞄準鏡時,為避免夜視鏡鏡頭碰撞到瞄準鏡,會先拿開夜視鏡後再進行瞄準鏡瞄準。 + + + NVG Fog Scale + 暗視装置の霧の規模 + Livello Nebbia NVG + + + Fog is used to limit visibility. + 霧は視界制限のために使われます。 + La nebbia viene utilizzata per limitare la visibilità. + + + NVG Effect Scale + 暗視装置の効果規模 + Effetto livello NVG + + + Blur, grain and brightness effects [Setting to 0 will disable ALL nightvision effects] + ぼかしと粒子、明度効果 [0 に設定で全効果を無効化します] + Effetti di sfocatura, sgranatura e luminosità [Importare a 0 disabiliterà TUTTI gli effetti della visione notturna] + + + Aim Down Sights Blur + 照準器を使用時にぼかし 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..8292cba0b9 --- /dev/null +++ b/addons/nlaw/stringtable.xml @@ -0,0 +1,35 @@ + + + + + NLAW Track Target (Hold) + NLAW Zielverfolgung + NLAW Traccia Bersaglio (Mantieni) + NALW 目標の追跡 (押しっぱ) + 次世代轻型反坦克导弹发射器追踪目标 (按住) + 次世代輕型反坦克導彈發射器追蹤目標 (按住) + Śledzenie Celu NLAW (Przytrzymaj) + NLAW 목표 추적 (누름유지) + + + 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..b928bc2de6 100644 --- a/addons/noradio/CfgEventhandlers.hpp +++ b/addons/noradio/CfgEventhandlers.hpp @@ -1,6 +1,5 @@ - -class Extended_PostInit_EventHandlers { +class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; diff --git a/addons/noradio/XEH_postInit.sqf b/addons/noradio/XEH_postInit.sqf deleted file mode 100644 index 722a1d358c..0000000000 --- a/addons/noradio/XEH_postInit.sqf +++ /dev/null @@ -1,29 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -// unmute unit if that player disconnects -if (isServer) then { - addMissionEventHandler ["HandleDisconnect", { - [_this select 0, "isPlayer"] call EFUNC(common,unmuteUnit); - }]; -}; - -if (!hasInterface) exitWith {}; - -// Handle early CBA_fnc_addPlayerEventHandler -if (!isNull ace_player) then { - [ace_player, "isPlayer"] call EFUNC(common,muteUnit); -}; - -// mutes/unmutes units when the player changes -["unit", { - params ["_newPlayer", "_oldPlayer"]; - - // mute the new player - [_newPlayer, "isPlayer"] call EFUNC(common,muteUnit); - - // unmute the old player - if (alive _oldPlayer) then { - [_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit); - }; -}] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/noradio/XEH_preInit.sqf b/addons/noradio/XEH_preInit.sqf new file mode 100644 index 0000000000..5be74ddf1b --- /dev/null +++ b/addons/noradio/XEH_preInit.sqf @@ -0,0 +1,38 @@ +// By commy2 +#include "script_component.hpp" + +if (isServer) then { + // Unmute unit if that player disconnects + addMissionEventHandler ["HandleDisconnect", { + TRACE_1("re-enabling voice",_this); + [_this select 0, "isPlayer"] call EFUNC(common,unmuteUnit); + }]; +}; + +if (hasInterface) then { + // Mutes/unmutes units when the player changes + ["unit", { + if (!GVAR(enabled)) exitWith {}; + + params ["_newPlayer", "_oldPlayer"]; + TRACE_2("player change",_newPlayer,_oldPlayer); + + // Mute the new player + [_newPlayer, "isPlayer"] call EFUNC(common,muteUnit); + + // Unmute the old player + if (alive _oldPlayer) then { + [_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit); + }; + }, true] call CBA_fnc_addPlayerEventHandler; +}; + +[QGVAR(enabled), "CHECKBOX", [LSTRING(setting), LSTRING(setting_tooltip)], format ["ACE %1", localize ELSTRING(common,DisplayName)], true, true, { + params ["_enabled"]; + + if (_enabled) then { + [ACE_player, "isPlayer"] call EFUNC(common,muteUnit); + } else { + [ACE_player, "isPlayer"] call EFUNC(common,unmuteUnit); + }; +}] call CBA_settings_fnc_init; diff --git a/addons/noradio/stringtable.xml b/addons/noradio/stringtable.xml new file mode 100644 index 0000000000..3ac0d075bf --- /dev/null +++ b/addons/noradio/stringtable.xml @@ -0,0 +1,21 @@ + + + + + Mute Player + Spieler stummschalten + Muta Giocatore + 玩家靜音 + 玩家静音 + プレイヤーをミュート + + + Mutes the controlled player avatar. + Schaltet eigenen Spieleravatar stumm. + Muta l'avatar del giocatore controllato. + 靜音玩家所控制的角色。 + 静音玩家所控制的角色。 + プレイヤーに操作されているこのキャラをミュートします。 + + + 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/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 465bfa6aec..377cca28bc 100644 --- a/addons/optics/stringtable.xml +++ b/addons/optics/stringtable.xml @@ -14,6 +14,8 @@ RCO (2D) RCO (2D) RCO (2D) + 步枪战斗光学瞄准镜(2D) + 步槍戰鬥光學瞄準鏡(2D) RCO (PIP) @@ -28,6 +30,8 @@ RCO (PIP) RCO (PIP) RCO (PIP) + 步枪战斗光学瞄准镜(拟真版) + 步槍戰鬥光學瞄準鏡(擬真版) ARCO (2D) @@ -42,6 +46,8 @@ ARCO (2D) ARCO (2D) ARCO (2D) + 先进步枪战斗光学瞄准镜(2D) + 先進步槍戰鬥光學瞄準鏡(2D) ARCO (PIP) @@ -56,6 +62,8 @@ ARCO (PIP) ARCO (PIP) ARCO (PIP) + 先进步枪战斗光学瞄准镜(拟真版) + 先進步槍戰鬥光學瞄準鏡(擬真版) MRCO (2D) @@ -70,6 +78,8 @@ MRCO (2D) MRCO (2D) MRCO (2D) + 多距离战斗瞄准镜(2D) + 多距離戰鬥瞄準鏡(2D) MRCO (PIP) @@ -84,6 +94,8 @@ MRCO (PIP) MRCO (PIP) MRCO (PIP) + 多距离战斗瞄准镜(拟真版) + 多距離戰鬥瞄準鏡(擬真版) MOS (2D) @@ -98,6 +110,8 @@ MOS (2D) MOS (2D) MOS (2D) + 精准光学瞄准镜(2D) + 精準光學瞄準鏡(2D) MOS (PIP) @@ -112,6 +126,8 @@ MOS (PIP) MOS (PIP) MOS (PIP) + 精准光学瞄准镜(拟真版) + 精準光學瞄準鏡(擬真版) LRPS (2D) @@ -126,6 +142,8 @@ LRPS (2D) LRPS (2D) LRPS (2D) + 长距离精确瞄准镜(2D) + 長距離精確瞄準鏡(2D) LRPS (PIP) @@ -140,6 +158,8 @@ LRPS (PIP) LRPS (PIP) LRPS (PIP) + 长距离精确瞄准镜(拟真版) + 長距離精確瞄準鏡(擬真版) diff --git a/addons/optionsmenu/ACE_Settings.hpp b/addons/optionsmenu/ACE_Settings.hpp index 0badbad660..bab67cd37f 100644 --- a/addons/optionsmenu/ACE_Settings.hpp +++ b/addons/optionsmenu/ACE_Settings.hpp @@ -1,11 +1,4 @@ class ACE_Settings { - class GVAR(optionMenuDisplaySize) { - value = 0; - typeName = "SCALAR"; - isClientSettable = 1; - displayName = CSTRING(uiScaing); - values[] = {"$str_medium", "$str_large", "$str_very_large"}; - }; class GVAR(showNewsOnMainMenu) { value = 1; typeName = "BOOL"; diff --git a/addons/optionsmenu/CfgEventHandlers.hpp b/addons/optionsmenu/CfgEventHandlers.hpp index dc5816df05..4f50c9613f 100644 --- a/addons/optionsmenu/CfgEventHandlers.hpp +++ b/addons/optionsmenu/CfgEventHandlers.hpp @@ -11,12 +11,6 @@ class Extended_PreInit_EventHandlers { }; }; -class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); - }; -}; - class Extended_DisplayLoad_EventHandlers { class RscDisplayMain { GVAR(loadMainMenuBox) = QUOTE(_this call COMPILE_FILE(init_loadMainMenuBox)); diff --git a/addons/optionsmenu/CfgVehicles.hpp b/addons/optionsmenu/CfgVehicles.hpp index cbe03a4cfb..a00d8abc3e 100644 --- a/addons/optionsmenu/CfgVehicles.hpp +++ b/addons/optionsmenu/CfgVehicles.hpp @@ -1,27 +1,7 @@ class CfgVehicles { class ACE_Module; class ACE_moduleAllowConfigExport: ACE_Module { - scope = 2; - displayName = CSTRING(AllowConfigExport_Module_DisplayName); - //icon = ""; - category = "ACE"; - function = QUOTE(DFUNC(moduleAllowConfigExport)); - functionPriority = 1; - isGlobal = 1; - isSingular = 1; - isTriggerActivated = 0; - author = ECSTRING(common,ACETeam); - class Arguments { - class allowconfigurationExport { - displayName = CSTRING(AllowConfigExport_allowconfigurationExport_DisplayName); - description = CSTRING(AllowConfigExport_allowconfigurationExport_Description); - typeName = "BOOL"; - defaultValue = 1; - }; - }; - class ModuleDescription { - description = CSTRING(AllowConfigExport_Module_Description); - sync[] = {}; - }; + scope = 1; + displayName = "Deprecated ACE Module"; }; }; diff --git a/addons/optionsmenu/README.md b/addons/optionsmenu/README.md index f8d8c54d09..e274229053 100644 --- a/addons/optionsmenu/README.md +++ b/addons/optionsmenu/README.md @@ -1,7 +1,8 @@ ace_optionsmenu =============== -Adds the options menu used by other components. +Previously held the options menu. +Now just handles version display on main menu and debug/headbug on options menu. ## Maintainers diff --git a/addons/optionsmenu/XEH_PREP.hpp b/addons/optionsmenu/XEH_PREP.hpp index f1ffe1ed98..becbe9904f 100644 --- a/addons/optionsmenu/XEH_PREP.hpp +++ b/addons/optionsmenu/XEH_PREP.hpp @@ -1,22 +1,2 @@ PREP(debugDumpToClipboard); -PREP(onListBoxSettingsChanged); -PREP(onListBoxShowSelectionChanged); -PREP(onSettingsMenuOpen); -PREP(onSliderPosChanged); -PREP(onServerSaveInputField); -PREP(onServerSettingsMenuOpen); -PREP(onServerListBoxShowSelectionChanged); -PREP(onCategorySelectChanged); -PREP(resetSettings); -PREP(serverResetSettings); -PREP(settingsMenuUpdateKeyView); -PREP(settingsMenuUpdateList); -PREP(serverSettingsMenuUpdateKeyView); -PREP(serverSettingsMenuUpdateList); -PREP(onServerCategorySelectChanged); -PREP(updateSetting); -PREP(exportSettings); -PREP(toggleIncludeClientSettings); -PREP(moduleAllowConfigExport); -PREP(stringEscape); diff --git a/addons/optionsmenu/XEH_postInit.sqf b/addons/optionsmenu/XEH_postInit.sqf deleted file mode 100644 index 2ef332446a..0000000000 --- a/addons/optionsmenu/XEH_postInit.sqf +++ /dev/null @@ -1,11 +0,0 @@ - -#include "script_component.hpp" - -["ace_settingsInitialized", { - GVAR(categories) pushBack ""; //Ensure All Catagories is at top - { - if !(_x select 8 in GVAR(categories)) then { - GVAR(categories) pushBack (_x select 8); - }; - }forEach EGVAR(common,settings); -}] call CBA_fnc_addEventHandler; diff --git a/addons/optionsmenu/XEH_preInit.sqf b/addons/optionsmenu/XEH_preInit.sqf index 57e017e054..46d58b5a8a 100644 --- a/addons/optionsmenu/XEH_preInit.sqf +++ b/addons/optionsmenu/XEH_preInit.sqf @@ -6,15 +6,9 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; -GVAR(clientSideOptions) = []; -GVAR(clientSideColors) = []; - -GVAR(serverConfigGeneration) = 0; -GVAR(ClientSettingsExportIncluded) = false; -GVAR(serverSideOptions) = []; -GVAR(serverSideColors) = []; -GVAR(serverSideValues) = []; -GVAR(categories) = []; -GVAR(currentCategorySelection) = 0; +if (hasInterface) then { + [[format ["ACE %1", localize LSTRING(DumpDebug)], localize LSTRING(DumpDebugTooltip)], QGVAR(MainMenuHelperDumpDebug)] call CBA_fnc_addPauseMenuOption; + [[format ["ACE %1", localize LSTRING(headBugFix)], localize LSTRING(headBugFixTooltip)], QGVAR(MainMenuHelperHeadBugFix)] call CBA_fnc_addPauseMenuOption; +}; ADDON = true; diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 650f9eb74a..b17fe12cc3 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { name = COMPONENT_NAME; - units[] = {"ACE_moduleAllowConfigExport"}; + units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; @@ -23,13 +23,12 @@ class CfgAddons { }; #include "CfgEventHandlers.hpp" -#include "gui\define.hpp" -#include "gui\settingsMenu.hpp" -#include "gui\pauseMenu.hpp" - #include "CfgVehicles.hpp" #include "ACE_Settings.hpp" +#include "gui\mainMenu.hpp" +#include "gui\pauseMenu.hpp" + class ACE_Extensions { extensions[] += {"ace_clipboard"}; }; diff --git a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf index dd2c187bf7..a502934f50 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------ @@ -57,15 +55,16 @@ if (isNull ace_player) then {"null"} else {animationState ace_player}]; _text = format [" -------ACE Settings------"]; +------ACE's CBA Settings------"]; [_text] call _outputText; - +private _aceSettings = cba_settings_allSettings select {((_x select [0,4]) == "ace_") || {(_x select [0,5]) == "acex_"}}; +_aceSettings sort true; { - _var = missionNamespace getVariable [(_x select 0), "ERROR: Not Defined"]; - _text = format ["%1 - %2", (_x select 0), _var]; + _var = missionNamespace getVariable [_x, "ERROR: Not Defined"]; + _text = format ["%1 - %2", _x, _var]; [_text] call _outputText; -} forEach EGVAR(common,settings); +} forEach _aceSettings; _text = format [" @@ -82,9 +81,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 deleted file mode 100644 index e798784871..0000000000 --- a/addons/optionsmenu/functions/fnc_exportSettings.sqf +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Author: Glowbal - * Export all config settings with their current values. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ACE_optionsmenu_fnc_exportSettings - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_value", "_compiledConfigEntry", "_formatedValue"]; - -{ - /*_settingData = [ - _name, - _typeName, - _isClientSetable, - _localizedName, - _localizedDescription, - _possibleValues, - _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; - - if (GVAR(ClientSettingsExportIncluded) || !_isClientSetable) then { - _value = missionNamespace getVariable [_name, _defaultValue]; - _formatedValue = switch (toLower _typeName) do { - case ("scalar"): { - format['value = %1;', _value]; - }; - case ("string"): { - format['value = "%1";', _value]; - }; - case ("bool"): { - if (!(_value isEqualType false)) then {ERROR("weird bool typename??");}; - _value = if ((_value isEqualType false) && {_value}) then {1} else {0}; - format ['value = %1;', _value]; - }; - case ("color"): { - _value params [["_r",1], ["_b",0], ["_g",1], ["_a",1]]; - format ["value[] = {%1, %2, %3, %4};", _r, _b, _g, _a]; - }; - default { - ERROR("unknown typeName"); - "" - }; - - }; - _compiledConfigEntry = format [" -class %1 { - %2 - typeName = %3; - force = 1; -};", _name, _formatedValue, format['"%1"', _typeName]]; - - "ace_clipboard" callExtension _compiledConfigEntry; - }; -} forEach EGVAR(common,settings); - -"ace_clipboard" callExtension "--COMPLETE--"; - -[LSTRING(settingsExported)] call EFUNC(common,displayTextStructured); diff --git a/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf b/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf deleted file mode 100644 index 633a9aa162..0000000000 --- a/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Author: Glowbal - * - * - * Arguments: - * none - * - * Return Value: - * None - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_logic"]; - -if (isMultiplayer) exitWith {}; - -if (_logic getVariable ["allowconfigurationExport", false]) then { - GVAR(serverConfigGeneration) = 1; -} else { - GVAR(serverConfigGeneration) = 0; -}; diff --git a/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf b/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf deleted file mode 100644 index 2824c2e2fa..0000000000 --- a/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Author: Glowbal - * Changes which category is selected - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ACE_optionsmenu_fnc_onCategorySelectChanged - * - * Public: No - */ - -#include "script_component.hpp" - -disableSerialization; -private _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; - -private _ctrlComboBox = (_settingsMenu displayCtrl 14); -GVAR(currentCategorySelection) = _ctrlComboBox lbValue (lbCurSel _ctrlComboBox); - -[true] call FUNC(settingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf deleted file mode 100644 index 6486a5e39b..0000000000 --- a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Author: Glowbal - * Called when the listbox selection is changed for an options (eg: chaning a setting from false to true) - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ACE_optionsmenu_fnc_onListBoxSettingsChanged - * - * Public: No - */ - -#include "script_component.hpp" - -private _rightDropDownIndex = lbCurSel 400; //Index of right drop down -if (_rightDropDownIndex < 0) then {_rightDropDownIndex = 0;}; - -private _settingIndex = -1; -if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { - _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; -}; -if (_settingIndex == -1) exitWith {}; - -switch (GVAR(optionMenu_openTab)) do { - case (MENU_TAB_OPTIONS): { - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideOptions)))) then { - _settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0; - [MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); - }; - [false] call FUNC(settingsMenuUpdateList); - }; - case (MENU_TAB_SERVER_OPTIONS): { - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideOptions)))) then { - _settingIndex = (GVAR(serverSideOptions) select _settingIndex) select 0; - [MENU_TAB_SERVER_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); - }; - [false] call FUNC(serverSettingsMenuUpdateList); - }; -}; diff --git a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf deleted file mode 100644 index 0ddcc8d2a9..0000000000 --- a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Author: Glowbal - * Changes which tab is open (options or colors) - * - * Arguments: - * The tab to open (defined in script_component) - * - * Return Value: - * None - * - * Example: - * [MENU_TAB_COLORS] call ACE_optionsmenu_fnc_onListBoxShowSelectionChanged - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_settingsMenu", "_localizedHeader"]; - -PARAMS_1(_openTab); -GVAR(optionMenu_openTab) = _openTab; - -disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; - -switch (GVAR(optionMenu_openTab)) do { -case (MENU_TAB_OPTIONS): { - _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabOptions))]; - ctrlSetText [13, _localizedHeader]; - lbClear 400; - - (_settingsMenu displayCtrl 301) ctrlShow true; - - (_settingsMenu displayCtrl 400) ctrlShow true; - (_settingsMenu displayCtrl 410) ctrlShow false; - (_settingsMenu displayCtrl 411) ctrlShow false; - (_settingsMenu displayCtrl 412) ctrlShow false; - (_settingsMenu displayCtrl 413) ctrlShow false; - }; -case (MENU_TAB_COLORS): { - _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabColors))]; - ctrlSetText [13, _localizedHeader]; - - lbClear 400; - - (_settingsMenu displayCtrl 301) ctrlShow false; - - (_settingsMenu displayCtrl 400) ctrlShow false; - (_settingsMenu displayCtrl 410) ctrlShow true; - (_settingsMenu displayCtrl 411) ctrlShow true; - (_settingsMenu displayCtrl 412) ctrlShow true; - (_settingsMenu displayCtrl 413) ctrlShow true; - - (_settingsMenu displayCtrl 410) sliderSetRange [0, 255]; - (_settingsMenu displayCtrl 411) sliderSetRange [0, 255]; - (_settingsMenu displayCtrl 412) sliderSetRange [0, 255]; - (_settingsMenu displayCtrl 413) sliderSetRange [0, 255]; - }; -}; - -[true] call FUNC(settingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf b/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf deleted file mode 100644 index d134cda993..0000000000 --- a/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Author: Glowbal - * Changes which category is selected - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ACE_optionsmenu_fnc_onCategorySelectChanged - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_settingsMenu", "_ctrlComboBox"]; -disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; - -_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 deleted file mode 100644 index 669faf74ed..0000000000 --- a/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Author: Glowbal - * Changes which tab is open (options or colors) - * - * Arguments: - * The tab to open (defined in script_component) - * - * Return Value: - * None - * - * Example: - * [MENU_TAB_COLORS] call ACE_optionsmenu_fnc_onListBoxShowSelectionChanged - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_settingsMenu", "_localizedHeader"]; - -PARAMS_1(_openTab); -GVAR(optionMenu_openTab) = _openTab; - -disableSerialization; -_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))]; - ctrlSetText [13, _localizedHeader]; - lbClear 400; - - (_settingsMenu displayCtrl 301) ctrlShow true; - - (_settingsMenu displayCtrl 400) ctrlShow true; - (_settingsMenu displayCtrl 410) ctrlShow false; - (_settingsMenu displayCtrl 411) ctrlShow false; - (_settingsMenu displayCtrl 412) ctrlShow false; - (_settingsMenu displayCtrl 413) ctrlShow false; - (_settingsMenu displayCtrl 414) ctrlShow false; - (_settingsMenu displayCtrl 415) ctrlShow false; - (_settingsMenu displayCtrl 416) ctrlShow false; - (_settingsMenu displayCtrl 416) ctrlEnable false; - }; -case (MENU_TAB_SERVER_COLORS): { - _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabColors))]; - ctrlSetText [13, _localizedHeader]; - - lbClear 400; - - (_settingsMenu displayCtrl 301) ctrlShow false; - - (_settingsMenu displayCtrl 400) ctrlShow false; - (_settingsMenu displayCtrl 410) ctrlShow true; - (_settingsMenu displayCtrl 411) ctrlShow true; - (_settingsMenu displayCtrl 412) ctrlShow true; - (_settingsMenu displayCtrl 413) ctrlShow true; - - (_settingsMenu displayCtrl 410) sliderSetRange [0, 255]; - (_settingsMenu displayCtrl 411) sliderSetRange [0, 255]; - (_settingsMenu displayCtrl 412) sliderSetRange [0, 255]; - (_settingsMenu displayCtrl 413) sliderSetRange [0, 255]; - - (_settingsMenu displayCtrl 414) ctrlShow false; - (_settingsMenu displayCtrl 415) ctrlShow false; - (_settingsMenu displayCtrl 416) ctrlShow false; - (_settingsMenu displayCtrl 416) ctrlEnable false; - }; -case (MENU_TAB_SERVER_VALUES): { - _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabValues))]; - ctrlSetText [13, _localizedHeader]; - - lbClear 400; - (_settingsMenu displayCtrl 301) ctrlShow false; - (_settingsMenu displayCtrl 400) ctrlShow false; - (_settingsMenu displayCtrl 410) ctrlShow false; - (_settingsMenu displayCtrl 411) ctrlShow false; - (_settingsMenu displayCtrl 412) ctrlShow false; - (_settingsMenu displayCtrl 413) ctrlShow false; - - (_settingsMenu displayCtrl 414) ctrlShow true; - (_settingsMenu displayCtrl 415) ctrlShow true; - (_settingsMenu displayCtrl 416) ctrlShow true; - (_settingsMenu displayCtrl 416) ctrlEnable true; - }; -}; - -[true] call FUNC(serverSettingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf deleted file mode 100644 index fde370426f..0000000000 --- a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Author: Glowbal - * Called when the listbox selection is changed for an options (eg: chaning a setting from false to true) - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ACE_optionsmenu_fnc_onListBoxSettingsChanged - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_settingIndex", "_inputText", "_setting", "_settingName", "_convertedValue"]; - -_inputText = ctrlText 414; //Index of right drop down - -_settingIndex = -1; -if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { - _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; -}; - -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; - - _convertedValue = switch (toUpper (_setting select 1)) do { - case "STRING": { - ctrlSetText [414, _inputText call FUNC(stringEscape)]; - format ['%1', _inputText call FUNC(stringEscape)]; - }; - case "ARRAY": {format [call compile "[%1]", _inputText]}; - case "SCALAR": {parseNumber _inputText;}; - default {throw "Error"}; - }; - [MENU_TAB_SERVER_VALUES, _settingName, _convertedValue] call FUNC(updateSetting); - } catch { - }; - }; - [false] call FUNC(serverSettingsMenuUpdateList); - }; -}; diff --git a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf deleted file mode 100644 index 6a9e5c9fb8..0000000000 --- a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Author: Glowbal - * Called from the onLoad of ACE_settingsMenu dialog. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [onLoadEvent] call ACE_optionsmenu_fnc_onSettingsMenuOpen - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_setting", "_settingsMenu"]; - -if (GVAR(serverConfigGeneration) == 0 || isMultiplayer) exitWith {closeDialog 145246;}; - -// Filter only user setable setting -GVAR(serverSideOptions) = []; -GVAR(serverSideColors) = []; -GVAR(serverSideValues) = []; -{ - _x params ["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue"]; - - // 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; - _setting pushBack (missionNamespace getVariable (_x select 0)); - - // Categorize the setting according to types - // @todo: allow the user to modify other types of parameters? - if ((_typeName == "SCALAR" && count _possibleValues > 0) || (_x select 1) == "BOOL") then { - GVAR(serverSideOptions) pushBack _setting; - }; - if (_typeName == "COLOR") then { - GVAR(serverSideColors) pushBack _setting; - }; - if ((_typeName == "SCALAR" && count _possibleValues == 0) || _typeName == "ARRAY" || _typeName == "STRING") then { - GVAR(serverSideValues) pushBack _setting; - }; - }; -} forEach EGVAR(common,settings); - -//Delay a frame -[{ [MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged) }, []] call CBA_fnc_execNextFrame; - -disableSerialization; -private _menu = uiNamespace getVariable "ACE_serverSettingsMenu"; -(_menu displayCtrl 1003) ctrlEnable false; - -if (GVAR(ClientSettingsExportIncluded)) then { - (_settingsMenu displayCtrl 1102) ctrlSetText localize (LSTRING(exClientSettings)); -} else { - (_settingsMenu displayCtrl 1102) ctrlSetText localize (LSTRING(inClientSettings)); -}; - - -lbClear (_menu displayCtrl 14); -{ - if (_x == "") then { - _x = localize (LSTRING(category_all)); - }; - (_menu displayCtrl 14) lbAdd _x; -} forEach GVAR(categories); - -(_menu displayCtrl 14) lbSetCurSel GVAR(currentCategorySelection); //All Catagoies diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf deleted file mode 100644 index 42157f230f..0000000000 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Author: Glowbal - * Called from the onLoad of ACE_settingsMenu dialog. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [onLoadEvent] call ACE_optionsmenu_fnc_onSettingsMenuOpen - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_setting", "_menu"]; - -// Filter only user setable setting -GVAR(clientSideOptions) = []; -GVAR(clientSideColors) = []; -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; - _setting pushBack (missionNamespace getVariable (_x select 0)); - - // Categorize the setting according to types - // @todo: allow the user to modify other types of parameters? - if ((_x select 1) == "SCALAR" || (_x select 1) == "BOOL") then { - GVAR(clientSideOptions) pushBack _setting; - }; - if ((_x select 1) == "COLOR") then { - GVAR(clientSideColors) pushBack _setting; - }; - _clientSettableCategories pushBackUnique (_x select 8); //Add to list of user-settable categories - }; -} forEach EGVAR(common,settings); - -//Delay a frame -[{ [MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged) }, []] call CBA_fnc_execNextFrame; - -disableSerialization; -_menu = uiNamespace getVariable "ACE_settingsMenu"; -(_menu displayCtrl 1002) ctrlEnable false; -(_menu displayCtrl 1003) ctrlEnable false; - -if (GVAR(serverConfigGeneration) == 0) then { - (_menu displayCtrl 1102) ctrlEnable false; - (_menu displayCtrl 1102) ctrlShow false; -}; - -lbClear (_menu displayCtrl 14); -{ - if (_x in _clientSettableCategories) then { //only show category if it has user-settable options - if (_x == "") then { - _x = localize LSTRING(category_all); - }; - private _Index = (_menu displayCtrl 14) lbAdd _x; - (_menu displayCtrl 14) lbSetValue [_Index, _forEachIndex]; - }; -} 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 deleted file mode 100644 index 7df198cc5f..0000000000 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Author: PabstMirror - * Called when one of the color sliders is moved. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ACE_optionsmenu_fnc_onSliderPosChanged - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_newColor", "_settingIndex"]; - -_settingIndex = -1; -if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { - _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; -}; -if (_settingIndex == -1) exitWith {}; - -switch (GVAR(optionMenu_openTab)) do { - case (MENU_TAB_COLORS): { - - _newColor = []; - { - _newColor pushBack ((sliderPosition _x) / 255); - } forEach [410, 411, 412, 413]; - - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { - _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; - [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); - }; - [false] call FUNC(settingsMenuUpdateList); - }; - case (MENU_TAB_SERVER_COLORS): { - - _newColor = []; - { - _newColor pushBack ((sliderPosition _x) / 255); - } forEach [410, 411, 412, 413]; - - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { - _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; - [MENU_TAB_SERVER_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); - }; - [false] call FUNC(serverSettingsMenuUpdateList); - }; - default {}; -}; diff --git a/addons/optionsmenu/functions/fnc_resetSettings.sqf b/addons/optionsmenu/functions/fnc_resetSettings.sqf deleted file mode 100644 index 8d6c3958c6..0000000000 --- a/addons/optionsmenu/functions/fnc_resetSettings.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Author: Glowbal - * Resets all settings to default. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ACE_optionsmenu_fnc_onListBoxSettingsChanged - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_name", "_default", "_lastSelected"]; - -{ - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); -} forEach GVAR(clientSideOptions); - -{ - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); -} forEach GVAR(clientSideColors); - -_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 deleted file mode 100644 index d9f6a4ad96..0000000000 --- a/addons/optionsmenu/functions/fnc_serverResetSettings.sqf +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Author: Glowbal - * Resets all server settings to default. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ACE_optionsmenu_fnc_onListBoxSettingsChanged - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_name", "_default", "_lastSelected"]; - -{ - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_SERVER_OPTIONS, _name, _default] call FUNC(updateSetting); -} forEach GVAR(serverSideOptions); - -{ - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_SERVER_COLORS, _name, _default] call FUNC(updateSetting); -} forEach GVAR(serverSideColors); - -{ - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_SERVER_VALUES, _name, _default] call FUNC(updateSetting); -} forEach GVAR(serverSideVakyes); - -_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 deleted file mode 100644 index dfffbca6a6..0000000000 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Author: Glowbal - * Updates the right half of the option menu for the currently selected option. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ACE_optionsmenu_fnc_settingsMenuUpdateKeyView - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_settingsMenu", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType"]; -disableSerialization; - -_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; - -_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; -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; - - _entryName = _setting select 0; - _localizedName = _setting select 3; - _localizedDescription = _setting select 4; - - if (_localizedName == "") then {_localizedName = _entryName;}; - (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; - (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; - (_settingsMenu displayCtrl 300) ctrlSetText _entryName; - - switch (GVAR(optionMenu_openTab)) do { - case (MENU_TAB_SERVER_OPTIONS): { - _possibleValues = _setting select 5; - _settingsValue = _setting select 9; - // Created disable/enable options for bools - if ((_setting select 1) == "BOOL") then { - lbClear 400; - lbAdd [400, (localize ELSTRING(common,No))]; - lbAdd [400, (localize ELSTRING(common,Yes))]; - _settingsValue = [0, 1] select _settingsValue; - } else { - lbClear 400; - { lbAdd [400, _x]; } forEach _possibleValues; - }; - (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; - }; - case (MENU_TAB_SERVER_COLORS): { - _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; - - // Created disable/enable options for bools - _expectedType = switch (_setting select 1) do { - case "STRING": {LSTRING(stringType)}; - case "ARRAY": {LSTRING(arrayType)}; - case "SCALAR": {LSTRING(scalarType)}; - default {LSTRING(unknownType)}; - }; - (_settingsMenu displayCtrl 414) ctrlSetText format["%1", _settingsValue]; - (_settingsMenu displayCtrl 415) ctrlSetText format[localize _expectedType]; - }; - }; -} else { //no settings in list: - lbClear 400; - (_settingsMenu displayCtrl 250) ctrlSetText "No settings available"; - (_settingsMenu displayCtrl 251) ctrlSetText "No settings available"; - (_settingsMenu displayCtrl 300) ctrlSetText "No settings available"; -}; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf deleted file mode 100644 index 9718da3988..0000000000 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Author: Glowbal - * Updates the setting when the client has selected a new value. Saves to profilenamespace. - * - * Arguments: - * 0: Update the keylist as well - * - * Return Value: - * None - * - * Example: - * [false] call ACE_optionsmenu_fnc_settingsMenuUpdateList - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_settingName", "_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; -DEFAULT_PARAM(0,_updateKeyView,true); - -disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; -_ctrlList = _settingsMenu displayCtrl 200; - -lnbClear _ctrlList; - -_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 { - (_x select 3); - } else { - (_x select 0); - }; - - _settingsValue = _x select 9; - - // Created disable/enable options for bools - _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]; - _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; - }; - }forEach GVAR(serverSideOptions); - }; - case (MENU_TAB_SERVER_COLORS): { - { - if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - _color = +(_x select 9); - { - _color set [_forEachIndex, ((round (_x * 100))/100)]; - } forEach _color; - _settingsColor = str _color; - _settingName = if ((_x select 3) != "") then { - (_x select 3); - } else { - (_x select 0); - }; - - _added = _ctrlList lnbAddRow [_settingName, _settingsColor]; - _ctrlList lnbSetColor [[_added, 1], (_x select 9)]; - _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; - }; - }forEach GVAR(serverSideColors); - }; - case (MENU_TAB_SERVER_VALUES): { - { - if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - _settingName = if ((_x select 3) != "") then { - (_x select 3); - } else { - (_x select 0); - }; - _settingsValue = _x select 9; - if (!(_settingsValue isEqualType "")) then { - _settingsValue = format["%1", _settingsValue]; - }; - _added = _ctrlList lnbAddRow [_settingName, _settingsValue]; - _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; - }; - }forEach GVAR(serverSideValues); - }; -}; -if (_updateKeyView) then { - [] call FUNC(serverSettingsMenuUpdateKeyView); -}; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf deleted file mode 100644 index defef99395..0000000000 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Author: Glowbal - * Updates the right half of the option menu for the currently selected option. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ACE_optionsmenu_fnc_settingsMenuUpdateKeyView - * - * Public: No - */ - -#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; - -_collection = switch (GVAR(optionMenu_openTab)) do { - case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)}; - case MENU_TAB_COLORS: {GVAR(clientSideColors)}; - default {[]}; -}; - -_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; - - _entryName = _setting select 0; - _localizedName = _setting select 3; - _localizedDescription = _setting select 4; - - if (_localizedName == "") then {_localizedName = _entryName;}; - (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; - (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; - (_settingsMenu displayCtrl 300) ctrlSetText _entryName; - - switch (GVAR(optionMenu_openTab)) do { - case (MENU_TAB_OPTIONS): { - _possibleValues = _setting select 5; - _settingsValue = _setting select 9; - - // Created disable/enable options for bools - if ((_setting select 1) == "BOOL") then { - lbClear 400; - lbAdd [400, (localize ELSTRING(common,No))]; - lbAdd [400, (localize ELSTRING(common,Yes))]; - _settingsValue = [0, 1] select _settingsValue; - } else { - lbClear 400; - { lbAdd [400, _x]; } forEach _possibleValues; - }; - (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; - }; - case (MENU_TAB_COLORS): { - _currentColor = _setting select 9; - { - sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; - } forEach [410, 411, 412, 413]; - }; - }; -} else { //no settings in list: - lbClear 400; - (_settingsMenu displayCtrl 250) ctrlSetText "No settings available"; - (_settingsMenu displayCtrl 251) ctrlSetText "No settings available"; - (_settingsMenu displayCtrl 300) ctrlSetText "No settings available"; -}; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf deleted file mode 100644 index ed64ebde69..0000000000 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Author: Glowbal - * Updates the setting when the client has selected a new value. Saves to profilenamespace. - * - * Arguments: - * 0: Update the keylist as well - * - * Return Value: - * None - * - * Example: - * [false] call ACE_optionsmenu_fnc_settingsMenuUpdateList - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_settingName", "_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; -DEFAULT_PARAM(0,_updateKeyView,true); - -disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; -_ctrlList = _settingsMenu displayCtrl 200; - -lnbClear _ctrlList; - -_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; - - // Created disable/enable options for bools - _settingsText = if ((_x select 1) == "BOOL") then { - [(localize ELSTRING(common,No)), (localize ELSTRING(common,Yes))] select _settingsValue; - } else { - private _values = _x select 5; - if !((!isNil "_values") && {_values isEqualType []} && {_settingsValue >= 0} && {_settingsValue < (count _values)}) exitWith { - ERROR_3("Setting (%1) has bad values (%2) for index (%3)", _settingName, _values, _settingsValue); - "ERROR" - }; - _values select _settingsValue; - }; - _added = _ctrlList lnbAddRow [_settingName, _settingsText]; - _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; - }; - } forEach GVAR(clientSideOptions); - }; - case (MENU_TAB_COLORS): { - { - if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - _color = +(_x select 9); - { - _color set [_forEachIndex, ((round (_x * 100))/100)]; - } forEach _color; - _settingsColor = str _color; - _settingName = (_x select 3); - - _added = _ctrlList lnbAddRow [_settingName, _settingsColor]; - _ctrlList lnbSetColor [[_added, 1], (_x select 9)]; - _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; - }; - }forEach GVAR(clientSideColors); - }; -}; -if (_updateKeyView) then { - [] call FUNC(settingsMenuUpdateKeyView); -}; diff --git a/addons/optionsmenu/functions/fnc_stringEscape.sqf b/addons/optionsmenu/functions/fnc_stringEscape.sqf deleted file mode 100644 index 09e1357a31..0000000000 --- a/addons/optionsmenu/functions/fnc_stringEscape.sqf +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Author: Glowbal - * Parse the string for quotation marks, so it can be used for config export. - * - * Arguments: - * 0: string - * - * Return Value: - * parsed string - * - * Example: - * [] call ACE_optionsmenu_fnc_stringEscape - * - * Public: No - */ - -private ["_str", "_array", "_maxIndex", "_isEven"]; -_str = _this; - -_isEven = { - params ["_array", "_index"]; - private [ "_count"]; - _count = 0; - { - if (_forEachIndex <= _index && {_x == 39}) then { - _count = _count + 1; - }; - }forEach _array; - - _count %2 == 0; -}; - -// reg: 34 -// single: 39 -_array = toArray _str; -{ - if (_x == 34) then { - _array set [_forEachIndex, 39]; - }; -}forEach _array; - -_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 { - _array deleteAt _i; - _i = _i - 1; - _maxIndex = _maxIndex - 1; - }; - }; -}; - -{ - if (_x == 34) then { - _array set [_forEachIndex, 39]; - }; -}forEach _array; - -toString _array; diff --git a/addons/optionsmenu/functions/fnc_toggleIncludeClientSettings.sqf b/addons/optionsmenu/functions/fnc_toggleIncludeClientSettings.sqf deleted file mode 100644 index 8fd52d8d72..0000000000 --- a/addons/optionsmenu/functions/fnc_toggleIncludeClientSettings.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Author: Glowbal - * - * - * Arguments: - * none - * - * Return Value: - * None - * - * Public: No - */ - -#include "script_component.hpp" - -GVAR(ClientSettingsExportIncluded) = !(GVAR(ClientSettingsExportIncluded)); - -[] call FUNC(onServerSettingsMenuOpen); diff --git a/addons/optionsmenu/functions/fnc_updateSetting.sqf b/addons/optionsmenu/functions/fnc_updateSetting.sqf deleted file mode 100644 index 7374d1f2c1..0000000000 --- a/addons/optionsmenu/functions/fnc_updateSetting.sqf +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Author: Glowbal - * Updates the setting when the client has selected a new value. Saves to profilenamespace and calls setSetting. - * - * Arguments: - * 0: The Tab Open - * 1: The setting's name - * 2: The new value either an index or a color OR - * - * Return Value: - * None - * - * Example: - * [MENU_TAB_COLORS, "ace_fireTruckColor", [1,0,0,1]] call ACE_optionsmenu_fnc_updateSetting - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_changed"]; -PARAMS_3(_type,_name,_newValue); - -_changed = false; - -switch (_type) do { - case (MENU_TAB_OPTIONS): { - { - if ((_x select 0) == _name) then { - - if ((_x select 1) == "BOOL") then { - _newValue = [false, true] select _newValue; - }; - - if !((_x select 9) isEqualTo _newValue) then { - _changed = true; - _x set [9, _newValue]; - } ; - - }; - } forEach GVAR(clientSideOptions); - }; - case (MENU_TAB_COLORS): { - { - if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then { - _changed = true; - _x set [9, _newValue]; - }; - } forEach GVAR(clientSideColors); - }; - case (MENU_TAB_SERVER_OPTIONS): { - { - if ((_x select 0) == _name) then { - - if ((_x select 1) == "BOOL") then { - _newValue = [false, true] select _newValue; - }; - - if !((_x select 9) isEqualTo _newValue) then { - _changed = true; - _x set [9, _newValue]; - } ; - - }; - } forEach GVAR(serverSideOptions); - }; - case (MENU_TAB_SERVER_COLORS): { - { - if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then { - _changed = true; - _x set [9, _newValue]; - }; - } forEach GVAR(serverSideColors); - }; - case (MENU_TAB_SERVER_VALUES): { - { - if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then { - _changed = true; - _x set [9, _newValue]; - }; - } forEach GVAR(serverSideValues); - }; -}; - -if (_changed) then { - if (GVAR(serverConfigGeneration) > 0) then { - if !(isMultiplayer) then { - missionNamespace setVariable [_name, _newValue]; - }; - } else { - profileNamespace setVariable [_name, _newValue]; - [_name, _newValue] call EFUNC(common,setSetting); - }; -}; diff --git a/addons/optionsmenu/gui/define.hpp b/addons/optionsmenu/gui/define.hpp deleted file mode 100644 index 9620bdd7e6..0000000000 --- a/addons/optionsmenu/gui/define.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// define.hpp - -class ACE_gui_backgroundBase; -class ACE_gui_editBase; -class ACE_gui_buttonBase; -class ACE_gui_staticBase; -class ACE_gui_listNBox; -class ACE_gui_comboBoxBase; -class RscXSliderH; -class RscControlsGroupNoScrollbars; -class RscHTML; -class RscText; - - -class RscControlsGroupNoHScrollbars; -class RscPicture; -class RscButtonMenu; - - -#ifndef ACE_DEFINE_H -#define ACE_DEFINE_H - -#define true 1 -#define false 0 - -#define CT_STATIC 0 -#define CT_BUTTON 1 -#define CT_EDIT 2 -#define CT_SLIDER 3 -#define CT_COMBO 4 -#define CT_LISTBOX 5 -#define CT_TOOLBOX 6 -#define CT_CHECKBOXES 7 -#define CT_PROGRESS 8 -#define CT_HTML 9 -#define CT_STATIC_SKEW 10 -#define CT_ACTIVETEXT 11 -#define CT_TREE 12 -#define CT_STRUCTURED_TEXT 13 -#define CT_CONTEXT_MENU 14 -#define CT_CONTROLS_GROUP 15 -#define CT_SHORTCUTBUTTON 16 -#define CT_XKEYDESC 40 -#define CT_XBUTTON 41 -#define CT_XLISTBOX 42 -#define CT_XSLIDER 43 -#define CT_XCOMBO 44 -#define CT_ANIMATED_TEXTURE 45 -#define CT_OBJECT 80 -#define CT_OBJECT_ZOOM 81 -#define CT_OBJECT_CONTAINER 82 -#define CT_OBJECT_CONT_ANIM 83 -#define CT_LINEBREAK 98 -#define CT_ANIMATED_USER 99 -#define CT_MAP 100 -#define CT_MAP_MAIN 101 -#define CT_LISTNBOX 102 - -// Static styles -#define ST_POS 0x0F -#define ST_HPOS 0x03 -#define ST_VPOS 0x0C -#define ST_LEFT 0x00 -#define ST_RIGHT 0x01 -#define ST_CENTER 0x02 -#define ST_DOWN 0x04 -#define ST_UP 0x08 -#define ST_VCENTER 0x0c - -#define ST_TYPE 0xF0 -#define ST_SINGLE 0 -#define ST_MULTI 16 -#define ST_TITLE_BAR 32 -#define ST_PICTURE 48 -#define ST_FRAME 64 -#define ST_BACKGROUND 80 -#define ST_GROUP_BOX 96 -#define ST_GROUP_BOX2 112 -#define ST_HUD_BACKGROUND 128 -#define ST_TILE_PICTURE 144 -#define ST_WITH_RECT 160 -#define ST_LINE 176 - -#define ST_SHADOW 0x100 -#define ST_NO_RECT 0x200 // this style works for CT_STATIC in conjunction with ST_MULTI -#define ST_KEEP_ASPECT_RATIO 0x800 - -#define ST_TITLE ST_TITLE_BAR + ST_CENTER - -// Slider styles -#define SL_DIR 0x400 -#define SL_VERT 0 -#define SL_HORZ 0x400 - -#define SL_TEXTURES 0x10 - -// Listbox styles -#define LB_TEXTURES 0x10 -#define LB_MULTI 0x20 - -#endif diff --git a/addons/optionsmenu/gui/mainMenu.hpp b/addons/optionsmenu/gui/mainMenu.hpp new file mode 100644 index 0000000000..0b26df7017 --- /dev/null +++ b/addons/optionsmenu/gui/mainMenu.hpp @@ -0,0 +1,77 @@ +class RscControlsGroupNoHScrollbars; +class RscHTML; +class RscText; + +class RscStandardDisplay; +class RscDisplayMain: RscStandardDisplay { + class controls { + 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); + }; + class CurrentVersionInfo: RscText { + idc = IDC_MAIN_INFO_CURRENT_VERSION_INFO; + style = 1; + text = ""; + sizeEx = "(pixelH * pixelGrid * 1.5)"; + font = "RobotoCondensedLight"; + shadow = 1; + colorBackground[] = {0,0,0,0}; + x = 0; + y = 0; + w = "(10 - 1.25 * 2) * (pixelW * pixelGrid * 2)"; + h = "1 * (pixelH * pixelGrid * 2)"; + onLoad = "(_this select 0) ctrlenable false;"; + }; + class HTTPVersionInfo: RscHTML { + idc = IDC_MAIN_INFO_NEWEST_VERSION_INFO; + shadow = 0; + + class H1 { + sizeEx = "(pixelH * pixelGrid * 1.5)"; + font = "RobotoCondensedLight"; + fontBold = "RobotoCondensedLight"; + align = "right"; + }; + class H2: H1 { + sizeEx = "(pixelH * pixelGrid * 1.5)"; + }; + class P: H1 { + sizeEx = "(pixelH * pixelGrid * 1.5)"; + }; + + x = 0; + y = "1 * (pixelH * pixelGrid * 2)"; + w = "(10 - 1.25 * 2) * (pixelW * pixelGrid * 2)"; + h = "1 * (pixelH * pixelGrid * 2)"; + onLoad = "(_this select 0) ctrlenable false;"; + }; + class Button: Button { + tooltip = "Download latest and report issues:"; + url = "https://github.com/acemod/ACE3/releases"; + }; + }; + }; + }; +}; diff --git a/addons/optionsmenu/gui/pauseMenu.hpp b/addons/optionsmenu/gui/pauseMenu.hpp index 304cd7e8d1..f48cecfd0f 100644 --- a/addons/optionsmenu/gui/pauseMenu.hpp +++ b/addons/optionsmenu/gui/pauseMenu.hpp @@ -1,179 +1,13 @@ - -class ACE_Open_SettingsMenu_BtnBase : ACE_gui_buttonBase { - class Attributes { - font = "RobotoCondensed"; - color = "#E5E5E5"; - align = "left"; - shadow = "true"; - }; - class AttributesImage { - font = "RobotoCondensed"; - color = "#E5E5E5"; - align = "left"; - }; - class HitZone { - left = 0.0; - top = 0.0; - right = 0.0; - bottom = 0.0; - }; - class ShortcutPos { - left = 0; - top = 0; - w = 0; - h = 0; - }; - class TextPos { - left = 0.01; - top = 0; - right = 0; - bottom = 0; - }; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - color2[] = {0,0,0,1}; - color[] = {1,1,1,1}; - //colorBackground2[] = {0.75,0.75,0.75,1}; - //colorBackground[] = {0,0,0,0.8}; - colorBackground[] = {1, 0.647, 0, 0.5}; - colorBackground2[] = {1, 0.647, 0, 0.5}; - colorBackgroundFocused[] = {1, 1, 1, 0}; - colorDisabled[] = {1,1,1,0.25}; - colorFocused[] = {0,0,0,1}; - colorText[] = {1,1,1,1}; - //default = 0; - font = "RobotoCondensed"; - idc = -1; - period = 1.2; - periodFocus = 1.2; - periodOver = 1.2; - shadow = 0; - shortcuts[] = {}; - size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - soundClick[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundClick",0.09,1}; - soundEnter[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEnter",0.09,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundPush",0.09,1}; - style = "0x02 + 0xC0"; - text = CSTRING(OpenConfigMenu); - textureNoShortcut = "#(argb,8,8,3)color(0,0,0,0)"; - tooltip = ""; - tooltipColorBox[] = {1,1,1,1}; - tooltipColorShade[] = {0,0,0,0.65}; - tooltipColorText[] = {1,1,1,1}; - type = 16; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY"; - w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - action = "(findDisplay 49) closeDisplay 0; createDialog 'ACE_settingsMenu';"; +class RscDisplayEmpty; +class GVAR(MainMenuHelperDumpDebug): RscDisplayEmpty { + onLoad = QUOTE(\ + [] call FUNC(debugDumpToClipboard);\ + (_this select 0) closeDisplay 0;\ + ); }; - -class RscStandardDisplay; -class RscDisplayMPInterrupt: RscStandardDisplay { - class controls { - class ACE_Open_settingsMenu_Btn: ACE_Open_SettingsMenu_BtnBase {}; - }; -}; - -class RscDisplayInterruptEditorPreview: RscStandardDisplay { - class controls { - class ACE_Open_settingsMenu_Btn: ACE_Open_SettingsMenu_BtnBase {}; - }; -}; - -class RscDisplayInterrupt: RscStandardDisplay { - class controls { - class ACE_Open_settingsMenu_Btn: ACE_Open_SettingsMenu_BtnBase {}; - }; -}; - -class RscDisplayInterruptEditor3D: RscStandardDisplay { - class controls { - class ACE_Open_settingsMenu_Btn: ACE_Open_SettingsMenu_BtnBase {}; - }; -}; - -class RscDisplayMovieInterrupt: RscStandardDisplay { - class controls { - class ACE_Open_settingsMenu_Btn: ACE_Open_SettingsMenu_BtnBase {}; - }; -}; - -class RscDisplayMain: RscStandardDisplay { - class controls { - 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); - }; - class CurrentVersionInfo: RscText { - idc = IDC_MAIN_INFO_CURRENT_VERSION_INFO; - style = 1; - text = ""; - sizeEx = "(pixelH * pixelGrid * 1.5)"; - font = "RobotoCondensedLight"; - shadow = 1; - colorBackground[] = {0,0,0,0}; - x = 0; - y = 0; - w = "(10 - 1.25 * 2) * (pixelW * pixelGrid * 2)"; - h = "1 * (pixelH * pixelGrid * 2)"; - onLoad = "(_this select 0) ctrlenable false;"; - }; - class HTTPVersionInfo: RscHTML { - idc = IDC_MAIN_INFO_NEWEST_VERSION_INFO; - shadow = 0; - - class H1 { - sizeEx = "(pixelH * pixelGrid * 1.5)"; - font = "RobotoCondensedLight"; - fontBold = "RobotoCondensedLight"; - align = "right"; - }; - class H2: H1 { - sizeEx = "(pixelH * pixelGrid * 1.5)"; - }; - class P: H1 { - sizeEx = "(pixelH * pixelGrid * 1.5)"; - }; - - x = 0; - y = "1 * (pixelH * pixelGrid * 2)"; - w = "(10 - 1.25 * 2) * (pixelW * pixelGrid * 2)"; - h = "1 * (pixelH * pixelGrid * 2)"; - onLoad = "(_this select 0) ctrlenable false;"; - }; - class Button: Button { - tooltip = "Download latest and report issues:"; - url = "https://github.com/acemod/ACE3/releases"; - }; - }; - }; - }; +class GVAR(MainMenuHelperHeadBugFix): RscDisplayEmpty { + onLoad = QUOTE(\ + 0 spawn EFUNC(common,headBugFix);\ + (_this select 0) closeDisplay 0;\ + ); }; diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp deleted file mode 100644 index e9265e59fd..0000000000 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ /dev/null @@ -1,487 +0,0 @@ -#define SIZEX (((safezoneW / safezoneH) min 1.2)) -#define SIZEY (SIZEX / 1.2) -#define X_ORIGINAL(num) (num * (SIZEX / 40) + (safezoneX + (safezoneW - SIZEX)/2)) -#define Y_ORIGINAL(num) (num * (SIZEY / 25) + (safezoneY + (safezoneH - (SIZEX / 1.2))/2)) -#define W_ORIGINAL(num) (num * (SIZEX / 40)) -#define H_ORIGINAL(num) (num * (SIZEY / 25)) - -#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)) -#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) -#define W_MAKEITBIGGA(num) (num * (safeZoneH / 40)) -#define H_MAKEITBIGGA(num) (num * (safeZoneH / 30)) - -#define X_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), X_ORIGINAL(num), X_MAKEITBIGGA(num))]) -#define Y_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), Y_ORIGINAL(num), Y_MAKEITBIGGA(num))]) -#define W_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), W_ORIGINAL(num), W_MAKEITBIGGA(num))]) -#define H_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), H_ORIGINAL(num), H_MAKEITBIGGA(num))]) - -class ACE_settingsMenu { - idd = 145246; - movingEnable = false; - onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', _this select 0)]; [] call FUNC(onSettingsMenuOpen);); - onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', nil)]; saveProfileNamespace;); - - class controlsBackground { - class HeaderBackground: ACE_gui_backgroundBase { - idc = -1; - type = CT_STATIC; - x = X_PART(1); - y = Y_PART(1); - w = W_PART(38); - h = H_PART(1); - style = ST_LEFT + ST_SHADOW; - font = "RobotoCondensed"; - SizeEx = H_PART(1); - colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; - text = ""; - }; - class CenterBackground: HeaderBackground { - y = Y_PART(2.1); - h = H_PART(2.5); - text = ""; - colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; - colorBackground[] = {0,0,0,"(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; - }; - class LeftBackground: CenterBackground { - y = Y_PART(4.8); - h = H_PART(17.4); - w = W_PART(25); - }; - class RightBackground: LeftBackground { - x = X_PART(26.1); - w = W_PART(12.9); - }; - class RightBackgroundHeader: RightBackground { - h = H_PART(1.4); - colorBackground[] = {0,0,0,1}; - }; - }; - - class controls { - class HeaderName { - idc = 1; - type = CT_STATIC; - x = X_PART(1); - y = Y_PART(1); - w = W_PART(38); - h = H_PART(1); - style = ST_LEFT + ST_SHADOW; - font = "RobotoCondensed"; - SizeEx = H_PART(1); - colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {0,0,0,0}; - text = CSTRING(OpenConfigMenu); - }; - class labelSubHeader: ACE_gui_staticBase { - idc = 13; - x = X_PART(2); - y = Y_PART(3.4); - w = W_PART(15); - h = H_PART(1); - text = ""; - }; - class categorySelection: ACE_gui_comboBoxBase { - idc = 14; - x = X_PART(14); - y = Y_PART(3.4); - w = W_PART(9); - h = H_PART(1); - text = ""; - onLBSelChanged = QUOTE( call FUNC(onCategorySelectChanged)); - SizeEx = H_PART(0.9); - }; - class selectionAction_1: ACE_gui_buttonBase { - idc = 1000; - text = CSTRING(TabOptions); - x = X_PART(1); - y = Y_PART(2.1); - w = W_PART(9.5); - h = H_PART(1); - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,1}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = QUOTE([MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged);); - SizeEx = H_PART(1); - Size = H_PART(1); - }; - class selectionAction_2: selectionAction_1 { - idc = 1001; - text = CSTRING(TabColors); - x = X_PART(10.5); - action = QUOTE([MENU_TAB_COLORS] call FUNC(onListBoxShowSelectionChanged);); - }; - class selectionAction_3: selectionAction_1 { - idc = 1002; - text = ""; - x = X_PART(20); - action = ""; - }; - class selectionAction_4: selectionAction_1 { - idc = 1003; - text = ""; - x = X_PART(29.5); - action = ""; - }; - class listBoxSettingsList: ACE_gui_listNBox { - idc = 200; - x = X_PART(2); - y = Y_PART(5.5); - w = W_PART(23); - h = H_PART(15); - SizeEx = H_ORIGINAL(0.8); - colorBackground[] = {0, 0, 0, 0.9}; - colorSelectBackground[] = {0, 0, 0, 0.9}; - columns[] = {0.0, 0.6}; - onLBSelChanged = QUOTE(_this call FUNC(settingsMenuUpdateKeyView)); - }; - class labelTitle: ACE_gui_staticBase { - idc = 250; - x = X_PART(27.1); - y = Y_PART(5.1); - w = W_PART(11); - h = H_PART(1); - text = ""; - SizeEx = H_PART(1); - }; - class labelKey: ACE_gui_staticBase { //Variable Name - idc = 300; - x = X_PART(27.1); - y = Y_PART(6.2); - w = W_PART(11); - h = H_PART(1); - text = ""; - SizeEx = H_PART(0.65); - }; - class Label2: labelKey { - idc = 301; - y = Y_PART(7.3); - text = CSTRING(Setting); - SizeEx = H_PART(1); - }; - class comboBox1: ACE_gui_comboBoxBase { - idc = 400; - x = X_PART(31.1); - y = Y_PART(7.3); - w = W_PART(7); - h = H_PART(1); - onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); - SizeEx = H_PART(0.9); - }; - class sliderBar1: RscXSliderH { - idc = 410; - x = X_PART(27.1); - y = Y_PART(7.3); - w = W_PART(11); - h = H_PART(0.75); - onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); - color[] = {1,0,0,0.4}; - colorActive[] = {1,0,0,1}; - }; - class sliderBar2: sliderBar1 { - idc = 411; - y = Y_PART(8.2); - color[] = {0,1,0,0.4}; - colorActive[] = {0,1,0,1}; - }; - class sliderBar3: sliderBar1 { - idc = 412; - y = Y_PART(9.1); - color[] = {0,0,1,0.4}; - colorActive[] = {0,0,1,1}; - }; - class sliderBar4: sliderBar1 { - idc = 413; - y = Y_PART(10); - color[] = {1,1,1,0.4}; - colorActive[] = {1,1,1,1}; - }; - class labelDesc: ACE_gui_staticBase { - idc = 251; - x = X_PART(27.1); - y = Y_PART(11); - w = W_PART(11); - h = H_PART(11); - text = ""; - style = ST_LEFT + ST_MULTI; - lineSpacing = 1; - SizeEx = H_PART(0.8); - }; - class actionClose: ACE_gui_buttonBase { - idc = 10; - text = "$STR_DISP_CLOSE"; - x = X_PART(1); - y = Y_PART(22.3); - w = W_PART(7.5); - h = H_PART(1); - style = ST_LEFT; - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,0.8}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = "closedialog 0;"; - SizeEx = H_PART(1); - Size = H_PART(1); - }; - class action_reset: actionClose { - idc = 1100; - text = CSTRING(ResetAll); - x = X_PART(9.5); - action = QUOTE([] call FUNC(resetSettings)); - }; - class action_exportServerConfig: actionClose { - idc = 1102; - text = CSTRING(OpenExport); - x = X_PART(18); - action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {closeDialog 0; createDialog 'ACE_serverSettingsMenu';}); - }; - class action_debug: actionClose { - idc = 1102; - text = CSTRING(DumpDebug); - x = X_PART(26.1); - action = QUOTE([] call FUNC(debugDumpToClipboard)); - tooltip = CSTRING(DumpDebugTooltip); - }; - class action_headBugFix: actionClose { - idc = 1102; - text = CSTRING(headBugFix); - x = X_PART(34); - w = W_PART(5); - action = QUOTE(0 spawn EFUNC(common,headBugFix); closedialog 0;); - tooltip = CSTRING(headBugFixTooltip); - }; - }; -}; -class ACE_serverSettingsMenu: ACE_settingsMenu { - onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', _this select 0)]; [] call FUNC(onServerSettingsMenuOpen);); - onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', nil)];); - class controls: controls { - class HeaderName { - idc = 1; - type = CT_STATIC; - x = X_PART(1); - y = Y_PART(1); - w = W_PART(38); - h = H_PART(1); - style = ST_LEFT + ST_SHADOW; - font = "RobotoCondensed"; - SizeEx = H_PART(1); - colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {0,0,0,0}; - text = CSTRING(OpenConfigMenu); - }; - class labelSubHeader: ACE_gui_staticBase { - idc = 13; - x = X_PART(2); - y = Y_PART(3.4); - w = W_PART(30); - h = H_PART(1); - text = ""; - }; - class categorySelection: ACE_gui_comboBoxBase { - idc = 14; - x = X_PART(14); - y = Y_PART(3.4); - w = W_PART(9); - h = H_PART(1); - text = ""; - onLBSelChanged = QUOTE( call FUNC(onServerCategorySelectChanged)); - SizeEx = H_PART(0.9); - }; - class selectionAction_1: ACE_gui_buttonBase { - idc = 1000; - text = CSTRING(TabOptions); - x = X_PART(1); - y = Y_PART(2.1); - w = W_PART(9.5); - h = H_PART(1); - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,1}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = QUOTE([MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged);); - }; - class selectionAction_2: selectionAction_1 { - idc = 1001; - text = CSTRING(TabColors); - x = X_PART(10.5); - action = QUOTE([MENU_TAB_SERVER_COLORS] call FUNC(onServerListBoxShowSelectionChanged);); - }; - class selectionAction_3: selectionAction_1 { - idc = 1002; - text = CSTRING(TabValues); - x = X_PART(20); - action = QUOTE([MENU_TAB_SERVER_VALUES] call FUNC(onServerListBoxShowSelectionChanged);); - }; - class selectionAction_4: selectionAction_1 { - idc = 1003; - text = ""; - x = X_PART(29.5); - action = ""; - }; - class listBoxSettingsList: ACE_gui_listNBox { - idc = 200; - x = X_PART(2); - y = Y_PART(5.5); - w = W_PART(23); - h = H_PART(15); - SizeEx = H_ORIGINAL(0.8); - colorBackground[] = {0, 0, 0, 0.9}; - colorSelectBackground[] = {0, 0, 0, 0.9}; - columns[] = {0.0, 0.6}; - onLBSelChanged = QUOTE(_this call FUNC(serverSettingsMenuUpdateKeyView)); - }; - class labelTitle: ACE_gui_staticBase { - idc = 250; - x = X_PART(27.1); - y = Y_PART(5.1); - w = W_PART(11); - h = H_PART(1); - text = ""; - SizeEx = H_PART(1); - }; - class labelKey: ACE_gui_staticBase { //Variable Name - idc = 300; - x = X_PART(27.1); - y = Y_PART(6.2); - w = W_PART(11); - h = H_PART(1); - text = ""; - SizeEx = H_PART(0.65); - }; - class Label2: labelKey { - idc = 301; - y = Y_PART(7.3); - text = CSTRING(Setting); - SizeEx = H_PART(1); - }; - class comboBox1: ACE_gui_comboBoxBase { - idc = 400; - x = X_PART(31.1); - y = Y_PART(7.3); - w = W_PART(7); - h = H_PART(1); - onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); - SizeEx = H_PART(0.9); - }; - class sliderBar1: RscXSliderH { - idc = 410; - x = X_PART(27.1); - y = Y_PART(7.3); - w = W_PART(11); - h = H_PART(0.75); - onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); - color[] = {1,0,0,0.4}; - colorActive[] = {1,0,0,1}; - }; - class sliderBar2: sliderBar1 { - idc = 411; - y = Y_PART(8.2); - color[] = {0,1,0,0.4}; - colorActive[] = {0,1,0,1}; - }; - class sliderBar3: sliderBar1 { - idc = 412; - y = Y_PART(9.1); - color[] = {0,0,1,0.4}; - colorActive[] = {0,0,1,1}; - }; - class sliderBar4: sliderBar1 { - idc = 413; - y = Y_PART(10); - color[] = {1,1,1,0.4}; - colorActive[] = {1,1,1,1}; - }; - class inputField1: ACE_gui_editBase { - idc = 414; - x = X_PART(27.1); - y = Y_PART(7.3); - w = W_PART(11); - h = H_PART(0.75); - }; - class inputFieldTypeLabel: ACE_gui_staticBase { - idc = 415; - x = X_PART(27.1); - y = Y_PART(8.2); - w = W_PART(11); - h = H_PART(0.75); - text = ""; - style = ST_LEFT + ST_MULTI; - lineSpacing = 1; - SizeEx = H_PART(0.8); - }; - class saveInputButton: selectionAction_1 { - idc = 416; - text = CSTRING(SaveInput); - x = X_PART(27.1); - y = Y_PART(9.1); - w = W_PART(11); - h = H_PART(1); - action = QUOTE([] call FUNC(onServerSaveInputField);); - }; - class labelDesc: ACE_gui_staticBase { - idc = 251; - x = X_PART(27.1); - y = Y_PART(11); - w = W_PART(11); - h = H_PART(11); - text = ""; - style = ST_LEFT + ST_MULTI; - lineSpacing = 1; - SizeEx = H_PART(0.8); - }; - class actionClose; - class action_reset: actionClose { - idc = 1100; - text = CSTRING(ResetAll); - x = X_PART(26.1); - action = QUOTE([] call FUNC(serverResetSettings)); - }; - class action_exportServerConfig: actionClose { - idc = 1101; - text = CSTRING(Export); - x = X_PART(1); - action = QUOTE([] call FUNC(exportSettings)); - }; - class action_toggleIncludeClientSettings: actionClose { - idc = 1102; - text = CSTRING(inClientSettings); - x = X_PART(9); - action = QUOTE([] call FUNC(toggleIncludeClientSettings)); - }; - }; -}; diff --git a/addons/optionsmenu/script_component.hpp b/addons/optionsmenu/script_component.hpp index c13e915702..7ae6409e6c 100644 --- a/addons/optionsmenu/script_component.hpp +++ b/addons/optionsmenu/script_component.hpp @@ -20,10 +20,3 @@ #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 - -#define MENU_TAB_SERVER_OPTIONS 10 -#define MENU_TAB_SERVER_COLORS 11 -#define MENU_TAB_SERVER_VALUES 12 diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 58929567af..6ebc553748 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -1,412 +1,6 @@  - - ACE Options - ACE-Optionen - Opciones ACE - Ustawienia ACE - ACE Nastavení - Options ACE - ACE Настройки - Opções do ACE - ACE Beállítások - Opzioni ACE - ACE オプション - ACE 옵션 - - - Fix Animation - Behebe Animation - Arreglar animación - Фикс анимации - Opravit animace - Napraw animację - Corriger animation - Animációk kijavítása - Sistema l'animazione - Arrumar Animação - アニメーションを修正 - 동작 고정 - - - Reset All - Alles zurücksetzen - Reiniciar todo - Полный сброс - Vyresetovat vše - Resetuj wszystko - Défaut - Minden visszaállítása - Resetta tutto - Resetar Tudo - すべて初期化 - 모두 초기화 - - - Colors - Couleurs - Farben - Colores - Цвета - Barvy - Kolory - Színek - Colori - Cores - - 색상 - - - Options - Optionen - Opciones - Opcje - Nastavení - Options - Настройки - Opções - Beállítások - Opzioni - オプション - 옵션 - - - Values - Valores - Значения - Hodnoty - Wartości - Valeurs - Werte - Értékek - Valori - Valores - - - - - Setting: - Nastavení: - Einstellung: - Установки: - Ajuste: - Ustaw: - Paramètres - Opció: - Parametri: - Opção: - 設定: - 설정: - - - Export - Exportieren - Exportar - Экспорт - Exportovat - Eksport - Exporter - Exportálás - Esporta - Exportar - 出力 - 내보내기 - - - Open Export Menu - Öffne Exportmenü - Abrir menú de exportación - Открыть меню экспорта - Otevřít exportovací menu - Eksport ustawień - Ouvrir le menu d'exportation - Exportálási menü megnyitása - Apri menù esportazione - Abrir menu de exportação - 出力メニューを開く - 내보내기 메뉴 열기 - - - String input. - Zeichenketteneingabe - Introducir cadena de texto. - Строчный ввод. - Wpisywanie tekstu. - Vkládání textu. - Entrée - String bevitel. - Stringa di unput. - Input de String - 文字列の入力 - 문자열 입력 - - - Array. Seperate elements by using ,. - Array. Teile unterschiedliche Elemente mit ,. - Matriz. Separa elementos usando ,. - Массив. Разделяйте элемены, используя запятую. - Tablica. Oddziel elementy używając ,. - Tableau. Séparation par ,. - Tabulka. Odděl elementy použitím ,. - Array. Válasszad el az elemeket vesszővel. - Vettor. Separa gli elementi usando ,. - Vetor. Separe elementos usando *,*. - アライ。,を使うことで区別できます。 - 배열. 요소를 ,. 로 나눔 - - - Number - Zahl - Número - Число - Číslo - Cyfra - Nombre - Szám - Numero - Número - - 숫자 - - - Uknown input type - Unbekannter Eingabetyp - Tipo de entrada desconocida - Неизвестный тип ввода - Neznámý vstup - Nieznany rodzaj danych - Type d'entrée inconnue - Ismeretlen beviteli típus - Input inserito sconosciuto - Tipo desonhecido de input - 不明な入力です - 불분명한 입력입니다 - - - Save input - Speichere Eingabe - Guardar entrada - Сохранить ввод - Uložit vstup - Zapisz dane - Sauvegarder - Bevitel elmentése - Salva input - Salvar input - 入力を保存 - 입력 저장 - - - Include Client Settings - Schließe Client-Einstellungen ein - Incluir configuración de cliente - Включить настройки клиента - Zahrnout nastavení klienta - Zaw. ustaw. klienta - Inclure paramètres client - Kliens-beállítások melléklése - Includi i parametri del client - Incluir opções do cliente - クライアント設定を含む - 클라이언트 설정 포함 - - - Exclude Client Settings - Schließe Client-Einstellungen aus - Excluir configuración de cliente - Исключить настройки клиента - Nezahrnout nastavení klienta - Wyklucz ustawienia klienta - Exclure paramètres client - Kliens-beállítások elhagyása - Escludi i parametri del client - Excluir opções do cliente - クライアント設定を実行する - 클라이언트 설정 제외 - - - Settings exported to clipboard - Einstellungen in die Zwischenablage exportiert - Configuración exportada al portapapeles - Настройки экспортированы в буфер обмена - Nastevení exportována do schránky - Ustawienia wyeksportowano do schowka - Paramètres exportés dans le presse papier - Beállítások exportálva a vágólapba - Parametri esportati alla clipboard - Opções exportadas para o clipboard. - クリップボードに設定を出力する - 클립보드로 설정 내보내기 - - - Option Menu UI Scaling - Menu option: taille de l'UI - Skalowanie UI menu ustawień - Měřítko UI v menu nastavení - Размер интерфейса меню настройки - Opción de escalado del menú IU - Nutzeroberflächen-Skalierung - Beállításmenü kezelőfelületének skálázása - Escalar o menu de opções - Proporzioni della interfaccia utente - オプション メニューにあるユーザ インタフェイスの大きさ - 옵션메뉴 UI 비례도 - - - Allow Config Export [ACE] - Pozwól na eksport ustawień - [ACE] Permitir exportar configuración - Erlaube Config-Export [ACE] - Povolit export natavení [ACE] - [ACE] Permitir exportação de configurações - Autoriser l'exportation de la configuration [ACE] - Konfiguráció-exportálás engedélyezése [ACE] - Разрешить экспорт настроек [ACE] - Consenti Esportazione del Config [ACE] - 設定の出力を許可 [ACE] - 설정 내보내기 허가 [ACE] - - - Allow - Zezwól - Permitir - Erlaube - Povolit - Permitir - Autoriser - Engedélyezés - Разрешить - Consenti - 許可 - 허가 - - - Allow export of all settings to a server config formatted. - Zezwól na eksport wszystkich ustawień do formatu konfiguracji serwera. - Permitir la exportación de todos los ajustes de configuración a un servidor con formato. - Erlaube alle Einstellungen in einer Server-Config zu exportieren. - Povolit exportovat všechna nastavení do formátu server configu. - Permitir exportação de todas as configurações para uma configuração formatada de servidor. - Autorise l'exportation des toutes les options vers un fichier de configuration - Az összes beállítás szerver-konfigurációba való exportálásának engedélyezése. - Разрешить экспорт всех настроек в формате серверного конфига. - 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. - Jeżeli ustawione na zezwól, wtedy będziesz mieć dostęp do ekranu modyfikacji wszystich ustawień i zmiennych ACE, a także będziesz mieć możliwość eksportu tychże ustawień do formatu rozpoznawalnego przez userconfig serwera. Kliknięcie opcji Eksportuj skopiuje wszystkie ustawienia do schowka. Działa tylko w trybie SP. - Cuando esta permitido, se tiene acceso a los ajustes de modificación y exportación en SP. Pulsar en exportar copiara la configuración al portapapeles. - Wenn erlaubt, können die Einstellungsmodifikationen angezeigt und im SP exportiert werden. Wenn auf "Exportieren" geklickt wird, wird eine formatierte Config-Datei in der Zwischenablage abgespeichert. - Pokud je povoleno, budete mít přístup k modifikaci nastavení a exportování v SP. Kliknutím na export umístníte formátovaný config do vaší schránky. - Quando permitido, você tem acesso à modificação de definições e exportação em SP. Clicando em exportação colocará a configuração formatada em sua área de transferência. - Quand autorisé, vous pouvez accéder aux modifications et à l'exporation en solo. Cliquer sur exporter placera la configuration dans le presse-papier - Engedélyezéskor hozzáférést kapsz a beállítások módosításához és exportálásához egyjátékos módban. Exportáláskor a formázott konfiguráció a vágólapra kerül. - Когда разршен, у вас появляется доступ к модификации настроек и экспорту их в одинночном режиме. Нажатие на кнопку Экспорт поместит форматированные настройки в буфер обмена. - Quando consentito, hai accesso alle modifiche delle impostazioni ed esportazione in SP. Cliccando Esporta piazzera il config formattato sul tuo Blocco Note. - 許可の場合、あなたは設定の変更と出力をシングルプレイで可能です。出力をクリックすると、サーバ用設定の形式となっている設定がクリップボードに保存されます。 - 허락하는 경우 싱글플레이에서 설정의 변경과 내보내기가 가능해집니다. 내보내기를 눌러서 서버 형성의 설정을 클립보드로 보냅니다. - - - Hide - Ukryj - Ocultar - Verstecken - Skrýt - Ocultar - Cacher - Elrejtés - Скрыть - Nascondi - 非表示 - 숨기기 - - - Top right, downwards - Po prawej u góry, w dół - Arriba a la derecha, hacia abajo - Oben rechts, nach unten - Vpravo nahoře, dolů - Superior direito, para baixo - Haut droit, vers le bas - Jobb felül, lefele - Справа — сверху вниз - In Alto a Destra, verso il Basso - 右上、下側 - 오른쪽 위에서 아래로 - - - Top right, to the left - Po prawej u góry, do lewej - Arriba a la derecha, hacia la izquierda - Von rechts nach links - Vpravo nahoře, do leva - Superior direito, à esquerda - Haut droit, vers la gauche - Jobb felül, balra - Сверху — справа налево - In Alto a Destra, verso Sinistra - 右上、左詰 - 오른쪽 위에서 왼쪽으로 - - - Top left, downwards - Po lewej u góry, w dół - Arriba a la izquierda, hacia abajo - Von links, nach unten - Vlevo nahoře, dolů - Superior esquerdo, para baixo - Haut gauche, vers le bas - Bal felül, lefele - Слева - сверху вниз - In Alto a Sinistra, verso il Basso - 左上、下側 - 왼쪽 위에서 아래로 - - - Top left, to the right - Po lewej u góry, do prawej - Arriba a la izquierda, hacia la derecha - Oben links nach rechts - Vlevo nahoře, do prava - Superior esquerdo, para a direita - Haut gauche, vers la droite - Bal felül, jobbra - Сверху — слева направо - In Alto a Sinistra, verso Destra - 右上、右詰 - 왼쪽 위에서 오른쪽으로 - - - Top - Góra - Arriba - Oben - Nahoře - Acima - Haut - Fent - Сверху - Alto - 上側 - 상단 - - - Bottom - Dół - Abajo - Unten - Dole - Abaixo - Bas - Alul - Снизу - Basso - 下側 - 하단 - Debug To Clipboard Debug do schowka @@ -418,8 +12,10 @@ Debug a vágólapra Отладка в буфер обмена Debug su Blocco Note - クリップボードへデバッグ + クリップボードにデバッグ 디버그를 클립보드로 + 复制除错讯息至剪贴簿 + 複製除錯訊息至剪貼簿 Sends debug information to RPT and clipboard. @@ -432,8 +28,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 @@ -448,6 +46,8 @@ Sistema Bug della Testa ヘッドバグ修正 헤드버그 수정 + 修复动作BUG + 修復動作BUG Resets your animation state. @@ -462,6 +62,8 @@ Resetta il tuo stato animazione 現在のアニメーションの状況を初期化します。 자신의 동작 상태 초기화 + 当ACE发生动作BUG时,点此修复。 + 當ACE發生動作BUG時,點此修復。 ACE News @@ -474,8 +76,10 @@ ACE hírek Новости ACE Novità ACE - ACE からのお知らせ + ACE ニュース ACE 새소식 + ACE新闻 + ACE新聞 Show News on Main Menu @@ -488,21 +92,10 @@ Показывать новости в Главном Меню Zobrazit zprávy v hlavním menu Mostra News nel Menù Princinpale - メイン メニュにお知らせを表示します + メイン画面にニュースを表示します 메인메뉴에 새소식을 표시합니다 - - - All Categories - Alle Kategorien - Wszystkie kategorie - Todas categorias - Все категории - Všechny Kategorie - Todas las categorías - Tutte le Categorie - Toutes les catégories - 全カテゴリ - 모든 카테고리 + 显示新闻消息于主选单 + 顯示新聞消息於主選單 Logistics @@ -516,6 +109,120 @@ Logistique ロジスティクス 보급 + 后勤设定 + 後勤設定 + + + Hide + Ukryj + Ocultar + Verstecken + Skrýt + Ocultar + Cacher + Elrejtés + Скрыть + Nascondi + 非表示 + 숨기기 + 隐藏 + 隱藏 + + + Top right, downwards + Po prawej u góry, w dół + Arriba a la derecha, hacia abajo + Oben rechts, nach unten + Vpravo nahoře, dolů + Superior direito, para baixo + Haut droit, vers le bas + Jobb felül, lefele + Справа — сверху вниз + In Alto a Destra, verso il Basso + 右上、下側 + 오른쪽 위에서 아래로 + 右上角,向下 + 右上角,向下 + + + Top right, to the left + Po prawej u góry, do lewej + Arriba a la derecha, hacia la izquierda + Von rechts nach links + Vpravo nahoře, do leva + Superior direito, à esquerda + Haut droit, vers la gauche + Jobb felül, balra + Сверху — справа налево + In Alto a Destra, verso Sinistra + 右上、左詰 + 오른쪽 위에서 왼쪽으로 + 右上角,向左 + 右上角,向左 + + + Top left, downwards + Po lewej u góry, w dół + Arriba a la izquierda, hacia abajo + Von links, nach unten + Vlevo nahoře, dolů + Superior esquerdo, para baixo + Haut gauche, vers le bas + Bal felül, lefele + Слева - сверху вниз + In Alto a Sinistra, verso il Basso + 左上、下側 + 왼쪽 위에서 아래로 + 左上角,向下 + 左上角,向下 + + + Top left, to the right + Po lewej u góry, do prawej + Arriba a la izquierda, hacia la derecha + Oben links nach rechts + Vlevo nahoře, do prava + Superior esquerdo, para a direita + Haut gauche, vers la droite + Bal felül, jobbra + Сверху — слева направо + In Alto a Sinistra, verso Destra + 右上、右詰 + 왼쪽 위에서 오른쪽으로 + 左上角,向右 + 左上角,向右 + + + Top + Góra + Arriba + Oben + Nahoře + Acima + Haut + Fent + Сверху + Alto + 上側 + 상단 + 上方 + 上方 + + + Bottom + Dół + Abajo + Unten + Dole + Abaixo + Bas + Alul + Снизу + Basso + 下側 + 하단 + 下方 + 下方 diff --git a/addons/overheating/ACE_Settings.hpp b/addons/overheating/ACE_Settings.hpp index fc3237da0f..5a4b8941e9 100644 --- a/addons/overheating/ACE_Settings.hpp +++ b/addons/overheating/ACE_Settings.hpp @@ -1,5 +1,6 @@ class ACE_Settings { class GVAR(displayTextOnJam) { + category = CSTRING(DisplayName); typeName = "BOOL"; isClientSettable = 1; value = 1; @@ -7,6 +8,7 @@ class ACE_Settings { description = CSTRING(DisplayTextOnJam_description); }; class GVAR(showParticleEffects) { + category = CSTRING(DisplayName); typeName = "BOOL"; isClientSettable = 1; value = 1; @@ -14,6 +16,7 @@ class ACE_Settings { description = CSTRING(showParticleEffects_description); }; class GVAR(showParticleEffectsForEveryone) { + category = CSTRING(DisplayName); typeName = "BOOL"; isClientSettable = 1; value = 0; @@ -21,24 +24,29 @@ class ACE_Settings { description = CSTRING(showParticleEffectsForEveryone_description); }; class GVAR(overheatingDispersion) { + category = CSTRING(DisplayName); typeName = "BOOL"; value = 1; displayName = CSTRING(overheatingDispersion_displayName); description = CSTRING(overheatingDispersion_description); }; class GVAR(unJamOnreload) { + category = CSTRING(DisplayName); typeName = "BOOL"; value = 0; displayName = CSTRING(unJamOnreload_displayName); description = CSTRING(unJamOnreload_description); }; class GVAR(unJamFailChance) { + category = CSTRING(DisplayName); typeName = "SCALAR"; value = 0.1; displayName = CSTRING(unJamFailChance_displayName); description = CSTRING(unJamFailChance_description); + sliderSettings[] = {0, 1, 0.1, 2}; }; class GVAR(enabled) { + category = CSTRING(DisplayName); typeName = "BOOL"; value = 1; displayName = CSTRING(enabled_displayName); diff --git a/addons/overheating/CfgVehicles.hpp b/addons/overheating/CfgVehicles.hpp index 2d6a48b7b3..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)); }; 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/functions/fnc_calculateCooling.sqf b/addons/overheating/functions/fnc_calculateCooling.sqf index ced682d6d7..2986bcb9c7 100644 --- a/addons/overheating/functions/fnc_calculateCooling.sqf +++ b/addons/overheating/functions/fnc_calculateCooling.sqf @@ -19,6 +19,7 @@ params ["_temperature", "_barrelMass", "_totalTime"]; +if (_temperature < 1) exitWith {0}; // If a long time passed since the last shot, there's no need to calculate anything; the weapon should be cool if (_totalTime > 1800) exitWith {0}; 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 f46af66358..e9bf89eef7 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" @@ -17,76 +20,68 @@ TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectil BEGIN_COUNTER(firedEH); -if ((_unit distance ACE_player) > 3000 //Ignore far away shots +if ((_unit distance ACE_player) > 3000 || {(_muzzle != (primaryWeapon _unit)) && {_muzzle != (handgunWeapon _unit)}}) exitWith { // Only rifle or pistol muzzles (ignore grenades / GLs) END_COUNTER(firedEH); }; -// Compute new temperature if the unit is the local player -if (_unit == ACE_player) then { - _this call FUNC(overheat); -}; - // Get current temperature from the unit variable private _temperature = _unit getVariable [format [QGVAR(%1_temp), _weapon], 0]; private _scaledTemperature = linearConversion [0, 1000, _temperature, 0, 1, true]; TRACE_2("Unit fired with temp:",_unit,_temperature); -//Get weapon data from cache: +// Get weapon data from cache: ([_weapon] call FUNC(getWeaponData)) params ["_dispersion", "_slowdownFactor", "_jamChance"]; TRACE_4("weapon data from cache",_weapon,_dispersion,_slowdownFactor,_jamChance); -// Dispersion and bullet slow down -if (GVAR(overheatingDispersion)) then { - // Exit if GVAR(pseudoRandomList) isn't synced yet - if (isNil QGVAR(pseudoRandomList)) exitWith {ERROR("No pseudoRandomList sync");}; +if (_scaledTemperature > 0.1) then { + // Dispersion and bullet slow down + if (GVAR(overheatingDispersion)) then { + if (isNil QGVAR(pseudoRandomList)) exitWith {ERROR("No pseudoRandomList sync");}; - //Dispersion: 0 mils @ 0°C, 0.5 mils @ 333°C, 2.2 mils @ 666°C, 5 mils at 1000°C - _dispersion = _dispersion * 0.28125 * (_scaledTemperature^2); + //Dispersion: 0 mils @ 0°C, 0.5 mils @ 333°C, 2.2 mils @ 666°C, 5 mils at 1000°C + _dispersion = _dispersion * 0.28125 * (_scaledTemperature^2); - _slowdownFactor = _slowdownFactor * linearConversion [0.666, 1, _scaledTemperature, 0, -0.1, true]; + _slowdownFactor = _slowdownFactor * linearConversion [0.666, 1, _scaledTemperature, 0, -0.1, true]; - // Get the pseudo random values for dispersion from the remaining ammo count - (GVAR(pseudoRandomList) select ((_unit ammo _weapon) mod (count GVAR(pseudoRandomList)))) params ["_dispersionX", "_dispersionY"]; + // Get the pseudo random values for dispersion from the remaining ammo count + (GVAR(pseudoRandomList) select ((_unit ammo _weapon) mod (count GVAR(pseudoRandomList)))) params ["_dispersionX", "_dispersionY"]; - TRACE_4("change",_dispersion,_slowdownFactor,_dispersionX,_dispersionY); + TRACE_4("change",_dispersion,_slowdownFactor,_dispersionX,_dispersionY); - TRACE_PROJECTILE_INFO(_projectile); - [_projectile, _dispersionX * _dispersion, _dispersionY * _dispersion, _slowdownFactor * vectorMagnitude (velocity _projectile)] call EFUNC(common,changeProjectileDirection); - TRACE_PROJECTILE_INFO(_projectile); -}; - - -// ------ LOCAL AND NEARBY PLAYERS DEPENDING ON SETTINGS ------------ -// Particle effects only apply to the local player and, depending on settings, to other nearby players -if (_unit != ACE_player && (!GVAR(showParticleEffectsForEveryone) || {_unit distance ACE_player > 20})) exitWith { - END_COUNTER(firedEH); -}; - -//Particle Effects: -if (GVAR(showParticleEffects) && {(CBA_missionTime > ((_unit getVariable [QGVAR(lastDrop), -1000]) + 0.40)) && {_scaledTemperature > 0.1}}) then { - _unit setVariable [QGVAR(lastDrop), CBA_missionTime]; - - private _direction = (_unit weaponDirection _weapon) vectorMultiply 0.25; - private _position = (position _projectile) vectorAdd (_direction vectorMultiply (4*(random 0.30))); - - // Refract SFX, beginning at temp 100°C and maxs out at 500°C - private _intensity = linearConversion [0.1, 0.5, _scaledTemperature, 0, 1, true]; - TRACE_3("refract",_direction,_position,_intensity); - if (_intensity > 0) then { - drop [ - "\A3\data_f\ParticleEffects\Universal\Refract", "", "Billboard", 10, 2, _position, _direction, 0, 1.2, 1.0, - 0.1, [0.10,0.25], [[0.6,0.6,0.6,0.3 * _intensity],[0.2,0.2,0.2,0.05 * _intensity]], [0,1], 0.1, 0.05, "", "", ""]; + TRACE_PROJECTILE_INFO(_projectile); + [_projectile, _dispersionX * _dispersion, _dispersionY * _dispersion, _slowdownFactor * vectorMagnitude (velocity _projectile)] call EFUNC(common,changeProjectileDirection); + TRACE_PROJECTILE_INFO(_projectile); }; - // Smoke SFX, beginning at temp 150°C - private _intensity = linearConversion [0.15, 1, _scaledTemperature, 0, 1, true]; - TRACE_3("smoke",_direction,_position,_intensity); - if (_intensity > 0) then { - drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 12, 1, 16], "", "Billboard", 10, 1.2, _position, - [0,0,0.15], 100 + random 80, 1.275, 1, 0.025, [0.15,0.43], [[0.6,0.6,0.6,0.5 * _intensity],[0.2,0.2,0.2,0.15 * _intensity]], - [0,1], 1, 0.04, "", "", ""]; + + // Particle Effects + if (GVAR(showParticleEffects) + && {GVAR(showParticleEffectsForEveryone) || {_unit == ACE_player} || {_unit distance ACE_player <= 20}} + && {CBA_missionTime > (_unit getVariable [QGVAR(lastDrop), -1000]) + 0.40}) then { + + _unit setVariable [QGVAR(lastDrop), CBA_missionTime]; + + private _direction = (_unit weaponDirection _weapon) vectorMultiply 0.25; + private _position = (position _projectile) vectorAdd (_direction vectorMultiply (4*(random 0.30))); + + // Refract SFX, beginning at temp 100°C and maxs out at 500°C + private _intensity = linearConversion [0.1, 0.5, _scaledTemperature, 0, 1, true]; + TRACE_3("refract",_direction,_position,_intensity); + if (_intensity > 0) then { + drop [ + "\A3\data_f\ParticleEffects\Universal\Refract", "", "Billboard", 10, 2, _position, _direction, 0, 1.2, 1.0, + 0.1, [0.10,0.25], [[0.6,0.6,0.6,0.3 * _intensity],[0.2,0.2,0.2,0.05 * _intensity]], [0,1], 0.1, 0.05, "", "", ""]; + }; + // Smoke SFX, beginning at temp 150°C + private _intensity = linearConversion [0.15, 1, _scaledTemperature, 0, 1, true]; + TRACE_3("smoke",_direction,_position,_intensity); + if (_intensity > 0) then { + drop [ + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 12, 1, 16], "", "Billboard", 10, 1.2, _position, + [0,0,0.15], 100 + random 80, 1.275, 1, 0.025, [0.15,0.43], [[0.6,0.6,0.6,0.5 * _intensity],[0.2,0.2,0.2,0.15 * _intensity]], + [0,1], 1, 0.04, "", "", ""]; + }; }; }; @@ -94,20 +89,34 @@ 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, 2, 8, 20, 150], 5 * _scaledTemperature] call EFUNC(common,interpolateFromArray)); +// Compute new temperature once every 3 bullets +if ((_unit ammo _weapon) % 3 == 0) then { + _this call FUNC(overheat); +}; -// increase jam chance on dusty grounds if prone (and at ground level) -if ((stance _unit == "PRONE") && {((getPosATL _unit) select 2) < 1}) then { - private _surface = configFile >> "CfgSurfaces" >> ((surfaceType getPosASL _unit) select [1]); - if (isClass _surface) then { - TRACE_1("dust",getNumber (_surface >> "dust")); - _jamChance = _jamChance + (getNumber (_surface >> "dust")) * _jamChance; +private _value = 5 * _scaledTemperature; +private _array = [0.5, 1, 2, 8, 20, 150]; +_jamChance = _jamChance * linearConversion [0, 1, _value % 1, _array select floor _value, _array select ceil _value]; + +TRACE_3("check for random jam",_unit,_weapon,_jamChance); + +private _randomNumber = random 1; + +// Fail early if we know that we won't have a malfunction regardless of the ground type. +if (_randomNumber < _jamChance * 2) then { + if (_randomNumber > _jamChance) then { + // Increase jam chance on dusty grounds if prone (and at ground level) + if ((stance _unit == "PRONE") && {((getPosATL _unit) select 2) < 1}) then { + private _surface = configFile >> "CfgSurfaces" >> ((surfaceType getPosASL _unit) select [1]); + if (isClass _surface) then { + TRACE_1("dust",getNumber (_surface >> "dust")); + _jamChance = _jamChance + (getNumber (_surface >> "dust")) * _jamChance; + }; + }; + }; + if (_randomNumber < _jamChance) then { + [_unit, _weapon] call FUNC(jamWeapon); }; }; -TRACE_3("check for random jam",_unit,_weapon,_jamChance); -if ((random 1) < _jamChance) then { - [_unit, _weapon] call FUNC(jamWeapon); -}; - END_COUNTER(firedEH); 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..cc30e2ad22 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" @@ -20,27 +23,25 @@ params ["_unit", "_weapon", "", "", "_ammo", "", "_projectile"]; TRACE_4("params",_unit,_weapon,_ammo,_projectile); -// Only do heat calculations every 3 bullets -if (((_unit ammo _weapon) % 3) != 0) exitWith {}; - BEGIN_COUNTER(overheat); // Get bullet parameters -private _bulletMass = GVAR(cacheAmmoData) getVariable _ammo; -if (isNil "_bulletMass") then { +private _energyIncrement = GVAR(cacheAmmoData) getVariable _ammo; +if (isNil "_energyIncrement") then { _bulletMass = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ACE_BulletMass"); if (_bulletMass == 0) then { // If the bullet mass is not configured, estimate it _bulletMass = 3.4334 + 0.5171 * (getNumber (configFile >> "CfgAmmo" >> _ammo >> "hit") + getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber")); }; - GVAR(cacheAmmoData) setVariable [_ammo, _bulletMass]; -}; + + // Projectile motion is roughly equal to Barrel heat + // Ref: https://en.wikipedia.org/wiki/Physics_of_firearms + // Muzzle Engergy = 1/2 * m * v^2 = (1/2 * 0.001 g/kg * bulletMass (grams) * v^2) + // Multiple by 3 becase we only calc every 3rd bullet: (3 * 1/2 * 0.001) = 0.0015 + private _energyIncrement = 0.0015 * _bulletMass * (vectorMagnitudeSqr velocity _projectile); -// Projectile motion is roughly equal to Barrel heat -// Ref: https://en.wikipedia.org/wiki/Physics_of_firearms -// Muzzle Engergy = 1/2 * m * v^2 = (1/2 * 0.001 g/kg * bulletMass (grams) * v^2) -// Multiple by 3 becase we only calc every 3rd bullet: (3 * 1/2 * 0.001) = 0.0015 -private _energyIncrement = 0.0015 * _bulletMass * (vectorMagnitudeSqr velocity _projectile); + GVAR(cacheAmmoData) setVariable [_ammo, _energyIncrement]; +}; // Increase overheating depending on how obstrusive is the current supressor, // if any. Typical arma supressors have visibleFire=0.5 and audibleFire=0.3, @@ -61,7 +62,7 @@ if (_silencer != "") then { _energyIncrement = _energyIncrement * _silencerCoef; }; -TRACE_2("heat",_bulletMass,_energyIncrement); +TRACE_1("heat",_energyIncrement); [_unit, _weapon, _energyIncrement] call FUNC(updateTemperature); 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_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/stringtable.xml b/addons/overheating/stringtable.xml index faa0462893..57e14a50e2 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -1,6 +1,14 @@  + + Overheating + Heißlaufen + Surriscaldamento + 過熱 + 过热 + 過熱 + Display text on jam Zeige Text bei Ladehemmung @@ -14,6 +22,8 @@ Visualizza testo in caso di inceppamento 弾詰りを文章で表示 탄걸림의 경우 화면에 표시 + 在卡弹时显示提示讯息 + 在卡彈時顯示提示訊息 Display a notification whenever your weapon gets jammed @@ -28,6 +38,8 @@ Visualizza una notifica in caso la tua arma si inceppasse 持っている武器が弾詰りをすると、通知を表示します 총알이 무기에 걸릴경우 화면에 알림을 띄웁니다 + 当武器卡弹时显示提示讯息 + 當武器卡彈時顯示提示訊息 Overheating Particle Effects @@ -41,6 +53,8 @@ Эффект частиц при перегреве 過熱の視覚効果 과열 입자 효과 + 枪管过热特效 + 槍管過熱特效 Show particle effects when weapon overheats @@ -54,6 +68,8 @@ Zobrazit částicové efekty když se zbraň přehřije 武器を過熱すると視覚表現を表示します 무기가 과열되면 입자 효과를 보여줍니다 + 显示枪管过热特效 + 顯示槍管過熱特效 Overheating Particle Effects for everyone @@ -67,6 +83,8 @@ Эффект частиц при перегреве для всех 過熱の視覚表現を全体に与えます 모두에게 과열 입자 효과 적용 + 显示其他玩家的枪管过热特效 + 顯示其他玩家的槍管過熱特效 Show particle effects when other players weapon overheats @@ -80,6 +98,8 @@ Zobrazit částicové efekty když se zbraň přehřije jinému hráči 他のプレイヤの過熱の視覚表現を表示します 모든 인원이 무기가 과열될시 입자 효과가 나타납니다. + 当其他玩家的武器过热时显示特效 + 當其他玩家的武器過熱時顯示特效 Overheating Dispersion @@ -93,6 +113,8 @@ Důsledky přehřátí zbraně 過熱による精度の低下 과열 명중률 저하 + 过热散射 + 過熱散射 Overheated weapons will be less accurate and have decreased muzzle velocity. Applys for all players. @@ -106,6 +128,8 @@ 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 @@ -119,6 +143,8 @@ Исправлять клин при перезарядке 再装填による弾詰りの解消 재장전시 탄걸림 해결 + 重装弹匣以解决卡弹 + 重裝彈匣以解決卡彈 Reloading clears a weapon jam. @@ -132,6 +158,8 @@ Перезарядка устраняет заклинивание оружия. 再装填により、弾詰りを除去します。 탄걸림이 재장전시 해결됩니다. + 利用重装弹匣来解决卡弹 + 利用重裝彈匣來解決卡彈 Chance of unjam failing @@ -145,6 +173,8 @@ Шанс неудачи при устранении клина 弾詰りの除去を失敗する可能性 탄걸림 해결 시도 실패확률 + 解决卡弹失败机率 + 解決卡彈失敗機率 Probability that an unjam action might fail, requiring to be repeated. @@ -158,6 +188,8 @@ Pravděpodobnost, že uvolnění zbraně selže, je proto nutné tuto akci opakovat. 弾詰りの除去を失敗する可能性が生まれ、もう一度動作を行う必要があります。 탄걸림 해결 시도시 실패할 확률이 있습니다. 이는 다시 탄걸림 해결을 시도해야함을 의미합니다. + 清除卡弹时有可能会失败,需要反覆进行清枪。 + 清除卡彈時有可能會失敗,需要反覆進行清槍。 Spare barrel @@ -172,6 +204,8 @@ Canna di ricambio 予備銃身 예비 총열 + 备用枪管 + 備用槍管 Use to swap barrel. @@ -186,6 +220,8 @@ Usata per cambiare la canna. 予備銃身に交換する。 총열을 바꿀때 사용합니다. + 用来更换枪管 + 用來更換槍管 Weapon jammed! @@ -198,8 +234,10 @@ Megakadt a fegyver! Arma travada! Arma inceppata! - 武器が詰まった! + 武器が詰まった! 탄걸림! + 武器卡弹! + 武器卡彈! Clear jam @@ -214,6 +252,8 @@ Ripulisci l'arma 弾詰りを除去する 탄걸림 해결 + 清除卡弹 + 清除卡彈 Jam cleared @@ -228,6 +268,8 @@ Arma pronta al fuoco 弾詰りが除去された 탄걸림 해결됨 + 卡弹已清除 + 卡彈已清除 Jam failed to clear @@ -241,6 +283,8 @@ Не удалось исправить клин 弾詰りの除去に失敗した 탄걸림 해결 실패 + 卡弹未能清除 + 卡彈未能清除 Swap barrel @@ -255,6 +299,8 @@ Sostiuisci la canna 銃身を交換 총열 교체 + 换枪管 + 換槍管 Swapping barrel... @@ -267,8 +313,10 @@ Cső kicserélése folyamatban... Substituindo cano... Sostituendo la canna... - 銃身を交換中・・・ + 銃身を交換しています・・・ 총열 교체중... + 换枪管中... + 換槍管中... Swapped barrel @@ -283,6 +331,8 @@ Canna sostituita 銃身を交換した 교체된 총열 + 完成换枪管 + 完成換槍管 Check weapon temperature @@ -297,6 +347,8 @@ Проверить температуру оружия 武器の温度を測る 무기 온도 확인 + 检查枪管温度 + 檢查槍管溫度 Check weapon temperature @@ -311,6 +363,8 @@ Controlla la temperatura della canna 武器の温度を測る 무기 온도 확인 + 检查枪管温度 + 檢查槍管溫度 Checking temperature... @@ -323,8 +377,10 @@ Conferindo temperatura... Controllando la temperatura... Проверка температуры... - 温度を測っている・・・ + 温度を測っています・・・ 무기 온도 확인중... + 检查枪管温度中... + 檢查槍管溫度中... Check spare barrels temperatures @@ -337,6 +393,8 @@ Temperatur der Wechselläufe prüfen 총열 온도 확인 Controlla la temperatura della canna di ricambio + 检查备用枪管温度 + 檢查備用槍管溫度 Checking spare barrels temperatures... @@ -344,11 +402,13 @@ Vérification de la température des canons de rechange... Проверка температуры запасных стволов... Kontroluji teplotu náhradní hlavně... - 予備銃身の温度を測っている・・・ + 予備銃身の温度を測っています・・・ Sprawdzanie temperatury zapasowych luf... Prüfe Temperatur der Wechselläufe ... 총열 온도 확인중... Controllando la temperatura della canna di ricambio... + 检查枪管温度中... + 檢查槍管溫度中... Temperature @@ -363,6 +423,8 @@ Температура 温度 온도 + 温度 + 溫度 Cool Spare Barrel/s @@ -375,6 +437,8 @@ Kalte Wechselläufe 차가운 예비 총열 Canna/e di Ricambio Fredda + 备用枪管温度正常 + 備用槍管溫度正常 Warm Spare Barrel/s @@ -387,6 +451,8 @@ Warme Wechselläufe 따뜻한 예비 총열 Canna/e di Ricambio Calda + 备用枪管温度偏温 + 備用槍管溫度偏溫 Hot Spare Barrel/s @@ -399,6 +465,8 @@ Heiße Wechselläufe 뜨거운 예비 총열 Canna/e di Ricambio Molto Calda + 备用枪管温度偏热 + 備用槍管溫度偏熱 Very Hot Spare Barrel/s @@ -411,6 +479,8 @@ Sehr heiße Wechselläufe 매우 뜨거운 예비 총열 Canna/e di Ricambio Estremamente Calda + 备用枪管温度过热 + 備用槍管溫度過熱 Extremely Hot Spare Barrel/s @@ -423,6 +493,8 @@ Extrem heiße Wechselläufe 엄청나게 뜨거운 예비 총열 Canna/e di Ricambio Rovente + 备用枪管温度超级热 + 備用槍管溫度超級熱 Overheating Enabled @@ -436,6 +508,8 @@ Przegrzewanie włączone 과열 활성화 Surriscaldamento Abilitato + 启用过热 + 啟用過熱 Master enable for the overheating/jamming module @@ -447,6 +521,8 @@ 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 index f2ddb5e302..58e0d3d8ac 100644 --- a/addons/overpressure/ACE_Settings.hpp +++ b/addons/overpressure/ACE_Settings.hpp @@ -4,5 +4,6 @@ class ACE_Settings { description = CSTRING(distanceCoefficient_toolTip); typeName = "SCALAR"; value = 1; + sliderSettings[] = {-1, 10, 5, 1}; }; }; diff --git a/addons/overpressure/functions/fnc_firedEHBB.sqf b/addons/overpressure/functions/fnc_firedEHBB.sqf index 101d5f0281..e501034ef7 100644 --- a/addons/overpressure/functions/fnc_firedEHBB.sqf +++ b/addons/overpressure/functions/fnc_firedEHBB.sqf @@ -54,6 +54,8 @@ if (_distance < _backblastRange) then { if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then { [_unit, _damage, "body", "backblast"] call EFUNC(medical,addDamageToUnit); } else { + TRACE_1("",isDamageAllowed _x); + if (!isDamageAllowed _x) exitWith {}; // Skip damage if not allowed _unit setDamage (damage _unit + _damage); }; }; diff --git a/addons/overpressure/functions/fnc_getDistance.sqf b/addons/overpressure/functions/fnc_getDistance.sqf index 29105c2e7c..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: diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index ec970efd2e..ccb9a4014c 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -59,6 +59,8 @@ TRACE_3("cache",_overpressureAngle,_overpressureRange,_overpressureDamage); if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then { [_x, _damage, "body", "backblast"] call EFUNC(medical,addDamageToUnit); } else { + TRACE_1("",isDamageAllowed _x); + if (!isDamageAllowed _x) exitWith {}; // Skip damage if not allowed _x setDamage (damage _x + _damage); }; diff --git a/addons/overpressure/stringtable.xml b/addons/overpressure/stringtable.xml index a982ec488c..9d909f918e 100644 --- a/addons/overpressure/stringtable.xml +++ b/addons/overpressure/stringtable.xml @@ -1,21 +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/CfgEventHandlers.hpp b/addons/parachute/CfgEventHandlers.hpp index f972afc2ca..8fa46b49f3 100644 --- a/addons/parachute/CfgEventHandlers.hpp +++ b/addons/parachute/CfgEventHandlers.hpp @@ -16,11 +16,3 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; - -class Extended_Respawn_EventHandlers { - class CAManBase { - class ADDON { - respawn = QUOTE(call COMPILE_FILE(XEH_respawn)); - }; - }; -}; diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index e734962a0e..402ff9497e 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -9,23 +9,18 @@ class CfgVehicles { }; }; - class Man; - class CAManBase: Man { - class ACE_SelfActions { - class ACE_CutParachute { - displayName = CSTRING(CutParachute); - exceptions[] = {"isNotInside"}; - condition = QUOTE([_player] call FUNC(checkCutParachute)); - statement = QUOTE([_player] call FUNC(cutParachute)); - showDisabled = 0; - priority = 2.9; - icon = QPATHTOF(UI\cut_ca.paa); - }; - }; - }; - class Helicopter; class ParachuteBase: Helicopter { + class ACE_SelfActions { + class ACE_CutParachute { + displayName = CSTRING(CutParachute); + condition = QUOTE(_target getVariable [ARR_2(QQGVAR(canCut),false)]); + statement = QUOTE([ARR_2(_player,_target)] call FUNC(cutParachute)); + showDisabled = 0; + priority = 2.9; + icon = QPATHTOF(UI\cut_ca.paa); + }; + }; MACRO_HASRESERVE }; class ParachuteWest: ParachuteBase { @@ -43,13 +38,13 @@ class CfgVehicles { class NonSteerable_Parachute_F: Parachute { MACRO_HASRESERVE }; - class Paraglide: ParachuteWest{ + class Paraglide: ParachuteWest { MACRO_HASRESERVE }; - class Steerable_Parachute_F: Paraglide{ + class Steerable_Parachute_F: Paraglide { MACRO_HASRESERVE }; - class Parachute_02_base_F: parachuteBase { + class Parachute_02_base_F: ParachuteBase { MACRO_HASRESERVE }; class B_Parachute_02_F: Parachute_02_base_F { @@ -98,7 +93,7 @@ class CfgVehicles { ace_reserveParachute = ""; ace_hasReserveParachute = 0; }; - + class ACE_NonSteerableReserveParachute: ACE_ReserveParachute { ParachuteClass = "NonSteerable_Parachute_F"; }; diff --git a/addons/parachute/XEH_PREP.hpp b/addons/parachute/XEH_PREP.hpp index c2567b8468..6edd22c260 100644 --- a/addons/parachute/XEH_PREP.hpp +++ b/addons/parachute/XEH_PREP.hpp @@ -1,9 +1,5 @@ - -PREP(doLanding); -PREP(handleInfoDisplayChanged); -PREP(hideAltimeter); -PREP(onEachFrame); -PREP(showAltimeter); PREP(cutParachute); -PREP(checkCutParachute); -PREP(storeParachute); +PREP(handleInfoDisplayChanged); +PREP(handleReserve); +PREP(hideAltimeter); +PREP(showAltimeter); diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index 1570d3cd98..73ea9276a1 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -19,25 +19,22 @@ if (!hasInterface) exitWith {}; ["ACE3 Equipment", QGVAR(showAltimeter), localize LSTRING(showAltimeter), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false}; - if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then { + if ( + !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) || + {!('ACE_Altimeter' in assignedItems ACE_player)} + ) exitWith { false }; + + if !(GETMVAR(GVAR(AltimeterActive),false)) then { [ACE_player] call FUNC(showAltimeter); } else { call FUNC(hideAltimeter); }; + true }, {false}, [24, [false, false, false]], false] call CBA_fnc_addKeybind; -GVAR(PFH) = false; -["vehicle",{ - if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then { - GVAR(PFH) = true; - [FUNC(onEachFrame), 0.1, []] call CALLSTACK(CBA_fnc_addPerFrameHandler); - }; -}] call CBA_fnc_addPlayerEventHandler; +// Handle reserve chute based on current backpack (fires when parachute opens too) +["loadout", FUNC(handleReserve), true] call CBA_fnc_addPlayerEventHandler; -// don't show speed and height when in expert mode +// Don't show vanilla speed and height when in expert mode ["ace_infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call CBA_fnc_addEventHandler; - -["loadout", FUNC(storeParachute)] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/parachute/XEH_preInit.sqf b/addons/parachute/XEH_preInit.sqf index 227fa9e38c..e5fa52644b 100644 --- a/addons/parachute/XEH_preInit.sqf +++ b/addons/parachute/XEH_preInit.sqf @@ -21,4 +21,14 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +[ + QGVAR(hideAltimeter), + "CHECKBOX", + [LSTRING(HideAltimeter), LSTRING(HideAltimeter_tooltip)], + format ["ACE %1", localize ELSTRING(common,DisplayName)], + true, + false, + {[QGVAR(hideAltimeter), _this, false] call EFUNC(common,cbaSettings_settingChanged)} +] call cba_settings_fnc_init; + ADDON = true; diff --git a/addons/parachute/XEH_respawn.sqf b/addons/parachute/XEH_respawn.sqf deleted file mode 100644 index 31e3ff2ae2..0000000000 --- a/addons/parachute/XEH_respawn.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Author: joko // Jonas - * Reset the parachute system. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * None - * - * Public: No - */ -#include "script_component.hpp" -ACE_player setVariable [QGVAR(chuteIsCut), false]; \ No newline at end of file diff --git a/addons/parachute/functions/fnc_checkCutParachute.sqf b/addons/parachute/functions/fnc_checkCutParachute.sqf deleted file mode 100644 index 94137ed67c..0000000000 --- a/addons/parachute/functions/fnc_checkCutParachute.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Author: joko // Jonas - * Reset the parachute system. - * - * Arguments: - * 0: Object - * - * Return Value: - * Boolean - * - * Example: - * [player] call FUNC(checkCutParachute); - * - * Public: No - */ -#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 diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index f7aa86991b..af56235ba0 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -1,21 +1,19 @@ /* - * Author: joko // Jonas - * Cut Parachute and delete Old + * Author: joko, Jonas, SilentSpike + * Perform the cut parachute action (move unit out and delete) * * Arguments: - * 0: Object + * 0: Object * * Return Value: - * Nothing + * None * * Example: - * [player] call FUNC(cutParachute); + * [player, vehicle player] call FUNC(cutParachute); * * Public: No */ #include "script_component.hpp" -params ["_unit"]; -private _vehicle = vehicle _unit; -_unit action ["GetOut", _vehicle]; -deleteVehicle _vehicle; -_unit setVariable [QGVAR(chuteIsCut), true, true]; +params ["_unit", "_parachute"]; +_unit action ["GetOut", _parachute]; +deleteVehicle _parachute; diff --git a/addons/parachute/functions/fnc_doLanding.sqf b/addons/parachute/functions/fnc_doLanding.sqf deleted file mode 100644 index b80bc44d00..0000000000 --- a/addons/parachute/functions/fnc_doLanding.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Performs the landing animation fix - * - * Arguments: - * 0: unit - * - * Return Value: - * None - * - * Example: - * [player] call ACE_Parachute_fnc_doLanding; - * - * Public: No - */ -#include "script_component.hpp" - -params ["_unit"]; - -GVAR(PFH) = false; - -[_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call EFUNC(common,doAnimation); - -_unit setVariable [QGVAR(chuteIsCut), false, true]; - -[{ - (_this select 0) params ["_time", "_unit"]; - - if (CBA_missionTime > _time + 1) then { - [_unit, "Crouch"] call EFUNC(common,doGesture); - [_this select 1] call CALLSTACK(CBA_fnc_removePerFrameHandler); - }; -}, 1, [CBA_missionTime, _unit]] call CALLSTACK(CBA_fnc_addPerFrameHandler); diff --git a/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf b/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf index b27849a0c8..644bd29c94 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" @@ -15,7 +18,7 @@ params ["_dialog", "_type"]; // don't do anything in noob mode -if (cadetMode) exitWith {}; +if (!GVAR(hideAltimeter)) exitWith {}; switch (_type) do { case ("Parachute"): { diff --git a/addons/parachute/functions/fnc_handleReserve.sqf b/addons/parachute/functions/fnc_handleReserve.sqf new file mode 100644 index 0000000000..7b92d8e9f4 --- /dev/null +++ b/addons/parachute/functions/fnc_handleReserve.sqf @@ -0,0 +1,42 @@ +/* + * Author: joko, Jonas, SilentSpike + * Cache reserve parachute on player unit when their inventory changes and add it when they open their parachute + * + * Arguments: + * None + * + * Return Value: + * 0: Unit + * + * Example: + * [player] call ace_parachute_fnc_handleReserve + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_unit"]; +private _backpack = backpack _unit; + +if ( + _backpack == "" && + {(vehicle _unit) isKindOf "ParachuteBase"} && + {GETVAR(_unit,GVAR(hasReserve),false)} +) then { + // Case where unit has just opened parachute and reserve should be added + _unit addBackpackGlobal GETVAR(_unit,GVAR(backpackClass),"ACE_NonSteerableReserveParachute"); + SETVAR(vehicle _unit,GVAR(canCut),true); // Mark the parachute cuttable since reserve is present +} else { + // Case where inventory has changed otherwise (including when reserve is added) + private _backpackCfg = configFile >> "CfgVehicles" >> _backpack; + private _hasReserve = getNumber (_backpackCfg >> "ace_hasReserveParachute") == 1; + + // Cache reserve parachute state and class when backpack changes + SETVAR(_unit,GVAR(hasReserve),_hasReserve); + if (_hasReserve) then { + SETVAR(_unit,GVAR(backpackClass),getText (_backpackCfg >> "ace_reserveParachute")); + } else { + SETVAR(_unit,GVAR(backpackClass),""); + }; +}; diff --git a/addons/parachute/functions/fnc_hideAltimeter.sqf b/addons/parachute/functions/fnc_hideAltimeter.sqf index dd7d29fce4..50f1eac503 100644 --- a/addons/parachute/functions/fnc_hideAltimeter.sqf +++ b/addons/parachute/functions/fnc_hideAltimeter.sqf @@ -15,4 +15,4 @@ */ #include "script_component.hpp" GVAR(AltimeterActive) = false; -(["ACE_Altimeter"] call BIS_fnc_rscLayer) cutText ["","PLAIN",0,true]; +"ACE_Altimeter" cutText ["","PLAIN",0,true]; diff --git a/addons/parachute/functions/fnc_onEachFrame.sqf b/addons/parachute/functions/fnc_onEachFrame.sqf deleted file mode 100644 index 0c6809b648..0000000000 --- a/addons/parachute/functions/fnc_onEachFrame.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Checks whether the unit should preform landing. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ACE_Parachute_fnc_onEachFrame; - * - * Public: No - */ -#include "script_component.hpp" -private _player = ACE_player; -if (!GVAR(PFH)) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);}; -if (isNull _player) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);GVAR(PFH) = false;}; -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); - -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); - GVAR(PFH) = false; -// I believe this will not work for Zeus units. - deleteVehicle (vehicle _player); - [_player] call FUNC(doLanding); -}; diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index b8ee8add6d..ed3367ddd8 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -17,34 +17,33 @@ params ["_unit"]; -(["ACE_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["ACE_Altimeter", "PLAIN", 0, true]; +"ACE_Altimeter" cutRsc ["ACE_Altimeter", "PLAIN", 0, true]; if (isNull (uiNamespace getVariable ["ACE_Altimeter", displayNull])) exitWith {}; GVAR(AltimeterActive) = true; [{ - if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(CBA_fnc_removePerFrameEventHandler)}; + if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CBA_fnc_removePerFrameEventHandler}; disableSerialization; (_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)}; + if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call 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; - _HeightText = _display displayCtrl 1100; - _DecendRate = _display displayCtrl 1000; - _TimeText = _display displayCtrl 1001; - _hour = floor daytime; - _minute = floor ((daytime - _hour) * 60); + private _hour = floor daytime; + private _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)]); + _HeightText ctrlSetText (format ["%1", floor _height]); _DecendRate ctrlSetText (format ["%1", _descentRate max 0]); (_this select 0) set [2, _height]; (_this select 0) set [3, _curTime]; -}, 0.2, [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit,floor ((getPosASL _unit) select 2), CBA_missionTime]] call CALLSTACK(CBA_fnc_addPerFrameHandler); +}, 0.2, [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit, floor ((getPosASL _unit) select 2), CBA_missionTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf deleted file mode 100644 index 8980a8ff82..0000000000 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 - */ -#include "script_component.hpp" - -params ["_unit"]; -private _backpack = backpack _unit; - -if ((vehicle _unit) isKindOf "ParachuteBase" && {backpack _unit == ""} && {!(_unit getVariable [QGVAR(chuteIsCut),false])} && {_unit getVariable [QGVAR(hasReserve),false]}) then { - _unit addBackpackGlobal (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); -} else { - if ((getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute")) == 1) then { - _unit setVariable[QGVAR(backpackClass),getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute"),true]; - }; - if (!(_unit getVariable [QGVAR(chuteIsCut),false]) && {!(animationState _unit == 'para_pilot')}) then { - _unit setVariable [QGVAR(hasReserve),[false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute")),true]; - }; -}; diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index c8482eeda7..820aa822d1 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Altímetro 高度計 고도계 + 高度计 + 高度計 Altimeter Watch @@ -28,6 +30,8 @@ Relógio Altímetro 時計型高度計 고도계 시계 + 高度计手表 + 高度計手錶 Used to show height, descent rate and the time. @@ -42,6 +46,8 @@ Usado para mostrar altura, taxa de descida e o tempo. 高度や降下率、時間を見るのに使います。 높이와, 하강속도 그리고 시간을 보여줍니다. + 用于显示高度,下降率和时间。 + 用於顯示高度,下降率和時間。 Non-Steerable Parachute @@ -56,6 +62,8 @@ Para-querdas não controlável 非操作型パラシュート 비-조종 낙하산 + 非可操控降落伞 + 非可操控降落傘 Cut Parachute @@ -70,6 +78,8 @@ Taglia Paracadute パラシュートを切断 낙하산 자르기 + 剪断降落伞 + 剪斷降落傘 Reserve Parachute @@ -84,6 +94,20 @@ Paracadute di Riserva 予備パラシュート 예비 낙하산 + 备用降落伞 + 備用降落傘 + + + Hide Freefall Altimeter + Freifall-Höhenmesser verstecken + 降下時に高度計を非表示 + Nascondi Altimetro in Caduta Libera + + + Hides the altitude and speed shown while free falling or parachuting. + Blendet den Höhen- und Geschwindigkeitsmesser während des Fallschirmspringens aus. + 自由降下時かパラシュート中に高度と速度を非表示にします。 + Nasconde l'altitudine e la velocità mostrate durante la caduta libera o paracadutandosi. 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..242b5c472d --- /dev/null +++ b/addons/pylons/ACE_Settings.hpp @@ -0,0 +1,46 @@ +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"; + sliderSettings[] = {0, 50, 15, 1}; + }; + class GVAR(timePerPylon) { + category = CSTRING(Category_Pylons); + displayName = CSTRING(TimePerPylon); + description = CSTRING(TimePerPylon_description); + value = 5; + typeName = "SCALAR"; + sliderSettings[] = {0, 10, 5, 1}; + }; + 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..cfbb2cab37 --- /dev/null +++ b/addons/pylons/stringtable.xml @@ -0,0 +1,181 @@ + + + + + AIRCRAFT LOADOUT + 航空機の兵装 + LOADOUT AEREO + 飛機武裝配置 + 飞机武装配置 + 항공기 무장 + + + Loadouts for %1 + %1の兵装 + Loadouts per %1 + %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已经正在定义此飞机的武装配置! + 이미 이 항공기에 장착되어 있음 (%1) + + + Replacing pylon %1 out of %2... + パイロン%1を作業し残り%2・・・ + Sostituendo pilone %1 al posto di %2... + 共有%2個派龍架,正在整補%1號派龍架中... + 共有%2个派龙架,正在整补%1号派龙架中... + 교체중 (%2 -> %1) + + + Stopped at pylon %1! + パイロン%1で停止しました! + Fermato al pilone %1! + 已停止在%1號派龍架! + 已停止在%1号派龙架! + %1 파일런이 멈춤 + + + Vehicle too far + Veicolo troppo lontano + 차량이 너무 멈 + 載具過遠 + 载具过远 + 車両が遠すぎます + + + 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..702f7cab4e --- /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 = 1; + 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/optionals/server/config.cpp b/addons/quickmount/config.cpp similarity index 68% rename from optionals/server/config.cpp rename to addons/quickmount/config.cpp index c27ed4a341..063897aebc 100644 --- a/optionals/server/config.cpp +++ b/addons/quickmount/config.cpp @@ -2,18 +2,17 @@ class CfgPatches { class ADDON { - name = COMPONENT_NAME; units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author = ECSTRING(common,ACETeam); - authors[] = {"Glowbal"}; + authors[] = {"Kingsley"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; }; -class ACE_ServerSettings { - #include "\userconfig\ace\serverconfig.hpp" -}; +#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..4b5debc2aa --- /dev/null +++ b/addons/quickmount/functions/fnc_getInNearest.sqf @@ -0,0 +1,117 @@ +/* + * 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 { + // GetInCargo expects the index of the seat in the "cargo" array from fullCrew + // See description: https://community.bistudio.com/wiki/fullCrew + private _cargoActionIndex = -1; + { + if ((_x select 2) == _cargoIndex) exitWith {_cargoActionIndex = _forEachIndex}; + } forEach (fullCrew [_target, "cargo", true]); + + ACE_player action ["GetInCargo", _target, _cargoActionIndex]; + TRACE_4("Geting In Cargo",_x,_role,_cargoActionIndex,_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..2032af7a44 --- /dev/null +++ b/addons/quickmount/stringtable.xml @@ -0,0 +1,115 @@ + + + + + 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) + 최대 속도 (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/CfgWeapons.hpp b/addons/rangecard/CfgWeapons.hpp index dfc643fa47..659b0ecfcb 100644 --- a/addons/rangecard/CfgWeapons.hpp +++ b/addons/rangecard/CfgWeapons.hpp @@ -1,10 +1,10 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_RangeCard: ACE_ItemCore { - author[] = {"Ruthberg"}; + author = "Ruthberg"; scope = 2; displayName = CSTRING(Name); descriptionShort = CSTRING(Description); @@ -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/functions/fnc_calculateRangeCard.sqf b/addons/rangecard/functions/fnc_calculateRangeCard.sqf index 2cdcb391f5..5bb12e220a 100644 --- a/addons/rangecard/functions/fnc_calculateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_calculateRangeCard.sqf @@ -22,10 +22,10 @@ * 16: Use advanced ballistics config? * * Return Value: - * Nothing + * None * * Example: - * call ace_rangecard_fnc_calculateRangeCard + * [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ,14, 15, 16, true] call ace_rangecard_fnc_calculateRangeCard * * Public: No */ @@ -39,48 +39,43 @@ params [ GVAR(rangeCardDataMVs) set [_rangeCardSlot, format[" %1", round(_muzzleVelocity)]]; -private ["_tx", "_tz", "_lastBulletPos", "_bulletPos", "_bulletVelocity", "_bulletAccel", "_bulletSpeed", "_gravity", "_deltaT", "_speedOfSound"]; -_tx = 0; -_tz = 0; -_lastBulletPos = [0, 0, 0]; -_bulletPos = [0, 0, 0]; -_bulletVelocity = [0, 0, 0]; -_bulletAccel = [0, 0, 0]; -_bulletSpeed = 0; -_gravity = [0, sin(_scopeBaseAngle) * -9.80665, cos(_scopeBaseAngle) * -9.80665]; -_deltaT = 1 / _simSteps; -_speedOfSound = 0; +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) * -GRAVITY, cos(_scopeBaseAngle) * -GRAVITY]; +private _deltaT = 1 / _simSteps; +private _speedOfSound = 0; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _speedOfSound = _temperature call EFUNC(weather,calculateSpeedOfSound); }; -private ["_elevation", "_windage", "_lead", "_TOF", "_trueVelocity", "_trueSpeed"]; -_elevation = 0; -_windage = 0; -_lead = 0; -_TOF = 0; -_trueVelocity = [0, 0, 0]; -_trueSpeed = 0; +private _elevation = 0; +private _windage = 0; +private _lead = 0; +private _TOF = 0; +private _trueVelocity = [0, 0, 0]; +private _trueSpeed = 0; -private ["_n", "_range"]; -_n = 0; -_range = 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", "_airDensity"]; -_airFrictionCoef = 1; +private _airFrictionCoef = 1; if (!_useABConfig && (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) then { - _airDensity = [_temperature, _barometricPressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); + private _airDensity = [_temperature, _barometricPressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); _airFrictionCoef = _airDensity / 1.22498; }; -private ["_speedTotal", "_stepsTotal", "_speedAverage"]; -_speedTotal = 0; -_stepsTotal = 0; -_speedAverage = 0; +private _speedTotal = 0; +private _stepsTotal = 0; +private _speedAverage = 0; _bulletPos set [0, 0]; _bulletPos set [1, 0]; @@ -103,7 +98,7 @@ while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { _trueSpeed = vectorMagnitude _trueVelocity; if (_useABConfig) then { - private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed])); + 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); @@ -115,7 +110,7 @@ while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { _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; @@ -127,21 +122,21 @@ while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { _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(3.38 / 60) * _range); + _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _range); }; - private ["_elevationString", "_windageString", "_leadString"]; - _elevationString = Str(round(-_elevation * 60 / 3.38 * 10) / 10); + + 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"; }; - _windageString = Str(round(_windage * 60 / 3.38 * 10) / 10); + private _windageString = Str(round(DEG_TO_MRAD(_windage) * 10) / 10); if (_windageString find "." == -1) then { _windageString = _windageString + ".0"; }; - _leadString = Str(round(_lead * 10) / 10); + private _leadString = Str(round(_lead * 10) / 10); if (_leadString find "." == -1) then { _leadString = _leadString + ".0"; }; 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 4a9945e513..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 */ diff --git a/addons/rangecard/functions/fnc_updateClassNames.sqf b/addons/rangecard/functions/fnc_updateClassNames.sqf index 12f9c5c2e8..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; diff --git a/addons/rangecard/functions/fnc_updateRangeCard.sqf b/addons/rangecard/functions/fnc_updateRangeCard.sqf index 42863e2911..9ab6fc6341 100644 --- a/addons/rangecard/functions/fnc_updateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_updateRangeCard.sqf @@ -10,10 +10,10 @@ * 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 */ @@ -22,7 +22,6 @@ disableSerialization; #define __dsp (uiNamespace getVariable "RangleCard_Display") -private ["_airFriction", "_ammoConfig", "_atmosphereModel", "_transonicStabilityCoef", "_barrelLength", "_barrelTwist", "_bc", "_cacheEntry", "_column", "_control", "_dragModel", "_i", "_muzzleVelocity", "_offset", "_row", "_weaponConfig", "_initSpeed", "_initSpeedCoef"]; params ["_zeroRange", "_boreHeight", "_ammoClass", "_magazineClass", "_weaponClass"]; @@ -34,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]; @@ -48,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"; @@ -58,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"; @@ -68,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"; @@ -93,20 +92,20 @@ 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; }; -_transonicStabilityCoef = _ammoConfig select 4; -_dragModel = _ammoConfig select 5; -_atmosphereModel = _ammoConfig select 8; +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 { @@ -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)"]]; @@ -157,13 +153,13 @@ if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) t ctrlSetText [77004 , ""]; }; -_cacheEntry = missionNamespace getVariable format[QGVAR(%1_%2_%3_%4_%5), _zeroRange, _boreHeight, _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 { private _scopeBaseAngle = if (!_useABConfig) then { - private _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngleVanilla:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight]; + private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%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]; + private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZeroAB:%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 { @@ -171,10 +167,10 @@ if (isNil {_cacheEntry}) then { private _mvShift = [_ammoConfig select 9, _x] call EFUNC(advanced_ballistics,calculateAmmoTemperatureVelocityShift); private _mv = _muzzleVelocity + _mvShift; - [_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); + [_scopeBaseAngle,_boreHeight,_airFriction,_mv,_x,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),200,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,_boreHeight,_airFriction,_muzzleVelocity,15,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),100,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,3,_useABConfig] call FUNC(calculateRangeCard); + [_scopeBaseAngle,_boreHeight,_airFriction,_muzzleVelocity,15,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),200,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,3,_useABConfig] call FUNC(calculateRangeCard); }; for "_i" from 0 to 9 do { @@ -205,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]; @@ -217,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]; @@ -230,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]; @@ -241,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, format["and load with optic mounted %1'' above line of bore.", round((_boreHeight / 2.54) * 10) / 10]]; -} 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/functions/script_component.hpp b/addons/rangecard/functions/script_component.hpp index fdc4a3d486..d4a493206b 100644 --- a/addons/rangecard/functions/script_component.hpp +++ b/addons/rangecard/functions/script_component.hpp @@ -1 +1 @@ -#include "\z\ace\addons\rangecard\script_component.hpp" \ No newline at end of file +#include "\z\ace\addons\rangecard\script_component.hpp" diff --git a/addons/rangecard/stringtable.xml b/addons/rangecard/stringtable.xml index 33b0994567..5862981e16 100644 --- a/addons/rangecard/stringtable.xml +++ b/addons/rangecard/stringtable.xml @@ -14,6 +14,8 @@ Tavola Balistica 射表 사거리표 + 弹道射表 + 彈道射表 50 METER increments -- MRAD/MRAD (reticle/turrets) @@ -28,6 +30,8 @@ Incrementi per 50 METRI - MRAD/MRAD (reticolo/torrette) 50 メートル増やす -- MRAD/MRAD (照準線/砲塔) 50 미터 늘리기 -- MRAD/MRAD (조준선/포탑) + 50公尺增量 -- 毫弧度/毫弧度 (瞄镜分划线/调整纽) + 50公尺增量 -- 毫弧度/毫弧度 (瞄鏡分劃線/調整紐) Open Range Card @@ -42,6 +46,8 @@ Apri Tavola Balistica 射表を開く 사거리표 열기 + 开启弹道射表 + 開啟彈道射表 Open Range Card Copy @@ -56,6 +62,8 @@ Apri Copia Tavola Balistica 複製された射表を開く 복제 사거리표 열기 + 开启弹道射表副本 + 開啟彈道射表副本 Open Range Card @@ -70,6 +78,8 @@ Apri Tavola Balistica 射表を開く 사거리표 열기 + 开启弹道射表 + 開啟彈道射表 Open Range Card Copy @@ -84,6 +94,8 @@ Apri Copia Tavola Balistica 複製された射表を開く 복제 사거리표 열기 + 开启弹道射表副本 + 開啟彈道射表副本 Copy Range Card @@ -98,6 +110,8 @@ Copia Tavola Balistica 射表を複製する 사거리표 복제 + 复制弹道射表 + 複製彈道射表 diff --git a/addons/realisticnames/CfgMagazines.hpp b/addons/realisticnames/CfgMagazines.hpp index d32ee3ec2c..ad6746df06 100644 --- a/addons/realisticnames/CfgMagazines.hpp +++ b/addons/realisticnames/CfgMagazines.hpp @@ -434,10 +434,25 @@ class CfgMagazines { }; class 6Rnd_Missile_AGM_02_F; class PylonRack_1Rnd_Missile_AGM_02_F: 6Rnd_Missile_AGM_02_F { - displayName = "AGM-65 Maverick"; // [vanilla: Macer - Missile_AGM_02_Plane_CAS_01_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 3x"; // [vanilla: Macer 3x - Missile_AGM_02_Plane_CAS_01_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 { @@ -457,7 +472,7 @@ class CfgMagazines { }; class 12Rnd_missiles; class PylonRack_12Rnd_missiles: 12Rnd_missiles { - displayName = "Hydra 70"; // [vanilla: DAR - missiles_DAR] + displayName = "Hydra 70 12x HE"; // [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] diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index f31b7ffeac..708bf1c53f 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -66,16 +66,25 @@ class CfgVehicles { class O_MRAP_02_F: MRAP_02_base_F { displayName = CSTRING(MRAP_02_Name); }; + class O_T_MRAP_02_ghex_F: MRAP_02_base_F { + displayName = CSTRING(MRAP_02_Name); + }; class MRAP_02_hmg_base_F: MRAP_02_base_F {}; class O_MRAP_02_hmg_F: MRAP_02_hmg_base_F { displayName = CSTRING(MRAP_02_hmg_Name); }; + class O_T_MRAP_02_hmg_ghex_F: MRAP_02_hmg_base_F { + displayName = CSTRING(MRAP_02_hmg_Name); + }; class MRAP_02_gmg_base_F: MRAP_02_hmg_base_F {}; class O_MRAP_02_gmg_F: MRAP_02_gmg_base_F { displayName = CSTRING(MRAP_02_gmg_Name); }; + class O_T_MRAP_02_gmg_ghex_F: MRAP_02_gmg_base_F { + displayName = CSTRING(MRAP_02_gmg_Name); + }; // strider class MRAP_03_base_F; @@ -173,8 +182,8 @@ class CfgVehicles { displayName = CSTRING(APC_Wheeled_01_cannon_Name); }; - class O_APC_Wheeled_02_base_F; - class O_APC_Wheeled_02_rcws_F: O_APC_Wheeled_02_base_F { + class APC_Wheeled_02_base_F; + class O_APC_Wheeled_02_base_F : APC_Wheeled_02_base_F { displayName = CSTRING(APC_Wheeled_02_rcws_Name); }; @@ -293,18 +302,30 @@ 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 I_C_Heli_Light_01_civil_F: Heli_Light_01_civil_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; @@ -328,6 +349,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); @@ -338,6 +364,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); @@ -349,11 +380,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); @@ -363,6 +404,16 @@ 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); + }; + + class Plane_Fighter_04_Base_F; + class I_Plane_Fighter_04_F : Plane_Fighter_04_Base_F { + displayName = CSTRING(Plane_Fighter_04_Name); + }; + // uavs class UAV_02_base_F; class B_UAV_02_F: UAV_02_base_F { @@ -375,7 +426,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); }; @@ -386,6 +437,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 { @@ -525,11 +587,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); }; @@ -668,6 +730,9 @@ class CfgVehicles { class C_Offroad_02_unarmed_F: Offroad_02_unarmed_base_F { displayName = CSTRING(C_Offroad_02_unarmed); }; + class I_C_Offroad_02_unarmed_F: Offroad_02_unarmed_base_F { + displayName = CSTRING(C_Offroad_02_unarmed); + }; class C_Offroad_02_unarmed_F_black: C_Offroad_02_unarmed_F { displayName = CSTRING(C_Offroad_02_unarmed_black); }; @@ -689,10 +754,35 @@ class CfgVehicles { class C_Plane_Civil_01_racing_F: Plane_Civil_01_base_F { displayName = CSTRING(C_Plane_Civil_01_racing); }; + class I_C_Plane_Civil_01_F: Plane_Civil_01_base_F { + displayName = CSTRING(C_Plane_Civil_01); + }; // Burraq class UAV_04_base_F; class O_T_UAV_04_CAS_F: UAV_04_base_F { displayName = CSTRING(O_T_UAV_04_CAS); }; + + // Polaris DAGOR (Prowler) + class LSV_01_base_F; + class LSV_01_armed_base_F : LSV_01_base_F { + displayName = CSTRING(lsv_01_armed); + }; + class LSV_01_unarmed_base_F : LSV_01_base_F { + displayName = CSTRING(lsv_01_unarmed); + }; + class LSV_01_light_base_F : LSV_01_base_F { + displayName = CSTRING(lsv_01_light); + }; + + // Light Strike Vehicle Mk. II (Qilin) + class LSV_02_base_F; + class LSV_02_armed_base_F : LSV_02_base_F { + displayName = CSTRING(lsv_02_armed); + }; + class LSV_02_unarmed_base_F : LSV_02_base_F { + displayName = CSTRING(lsv_02_unarmed); + }; + }; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 6aa3c7c3c8..fc873ccf10 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; }; @@ -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"; @@ -549,6 +546,16 @@ class CfgWeapons { }; }; + class autocannon_40mm_VTOL_01: autocannon_40mm_CTWS { + displayName = "L/60 Bofors Autocannon"; + class AP: AP { + displayName = "L/60 Bofors Autocannon"; + }; + class HE: HE { + displayName = "L/60 Bofors Autocannon"; + }; + }; + class autocannon_30mm_CTWS: autocannon_Base_F { displayName = "Mk44 Bushmaster II"; class AP: autocannon_Base_F { diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index a490a78ab5..d7dcb94f5d 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -14,6 +14,8 @@ XM312A XM312 XM312 + XM312重機槍 + XM312重机枪 XM312A @@ -28,6 +30,8 @@ XM312A XM312A XM312A + XM312A重機槍 + XM312A重机枪 XM312 (High) @@ -42,6 +46,8 @@ XM312 (Alta) XM312 (高) XM312 (높음) + XM312重機槍 (高射腳架) + XM312重机枪 (高射脚架) XM307 @@ -56,6 +62,8 @@ XM307 XM307 XM307 + XM307榴彈機槍 + XM307榴弹机枪 XM307A @@ -70,6 +78,8 @@ XM307A XM307A XM307A + XM307A榴彈機槍 + XM307A榴弹机枪 XM307 (High) @@ -84,6 +94,8 @@ XM307 (Alta) XM307 (高) XM307 (높음) + XM307榴彈機槍 (高射腳架) + XM307榴弹机枪 (高射脚架) Mini-Spike Launcher (AT) @@ -98,6 +110,8 @@ Lanciatore Mini-Spike (AC) ミニスパイク ランチャー (対戦) Mini-Spike Launcher (대전차) + "迷你長釘"導彈發射器 (反坦克) + "迷你长钉"导弹发射器 (反坦克) Mini-Spike Launcher (AA) @@ -112,6 +126,8 @@ Lanciatore Mini-Spike (AA) ミニスパイク ランチャー (対空) Mini-Spike Launcher (대공) + "迷你長釘"導彈發射器 (防空) + "迷你长钉"导弹发射器 (防空) YABHON-R3 @@ -126,6 +142,8 @@ YABHON-R3 YABHON-R3 YABHON-R3 + "亞伯罕-R3型"空中無人載具 + "亚伯罕-R3型"空中无人载具 YABHON-R3 (CAS) @@ -140,6 +158,8 @@ YABHON-R3 (CAS) YABHON-R3 (対地) YABHON-R3 (근접지원) + "亞伯罕-R3型"空中無人載具 (近空支援) + "亚伯罕-R3型"空中无人载具 (近空支援) M-ATV @@ -154,10 +174,12 @@ M-ATV M-ATV M-ATV + 防地雷反伏擊全地形車 + 防地雷反伏击全地形车 M-ATV (HMG) - M-ATV (SMG) + M-ATV (sMG) M-ATV (HMG) M-ATV (CKM) M-ATV (HMG) @@ -168,6 +190,8 @@ M-ATV (HMG) M-ATV (HMG) M-ATV (HMG) + 防地雷反伏擊全地形車 (重機槍) + 防地雷反伏击全地形车 (重机枪) M-ATV (GMG) @@ -182,6 +206,8 @@ M-ATV (GMG) M-ATV (GMG) M-ATV (GMG) + 防地雷反伏擊全地形車 (榴彈機槍) + 防地雷反伏击全地形车 (榴弹机枪) Merkava Mk IV M @@ -196,6 +222,8 @@ Merkava Mk IV M メルカバ Mk IV M Merkava Mk IV M + "梅卡瓦4代"主戰坦克 + "梅卡瓦4代"主战坦克 Merkava Mk IV LIC @@ -210,6 +238,8 @@ Merkava Mk IV LIC メルカバ Mk IV LIC Merkava Mk IV LIC + "梅卡瓦4代"主戰坦克 城市版 + "梅卡瓦4代"主战坦克 城市版 Sholef @@ -224,6 +254,8 @@ Sholef ショルフ Sholef + "神槍"自走炮 + "神枪"自走炮 Seara @@ -238,6 +270,8 @@ Seara シアラ Seara + "希拉"多管火箭車 + "希拉"多管火箭车 Namer @@ -252,6 +286,8 @@ Namer ネイマー Namer + "花豹"裝甲運兵車 + "花豹"装甲运兵车 Bardelas @@ -266,6 +302,8 @@ Bardelas バーラデラス Bardelas + "布萊德斯"防空車 + "布莱德斯"防空车 Badger IFV @@ -280,6 +318,8 @@ Badger IFV バッジ IFV Badger IFV + "蜜獾"步兵戰車 + "蜜獾"步兵战车 Nemmera @@ -294,6 +334,8 @@ Nemmera ネマラ Nemmera + "雌豹"戰鬥工程車 + "雌豹"战斗工程车 HEMTT Transport @@ -308,6 +350,8 @@ HEMTT da trasporto HEMTT 輸送型 HEMTT 수송 + 重型增程機動戰術卡車 (運輸) + 重型增程机动战术卡车 (运输) HEMTT Transport (covered) @@ -322,6 +366,8 @@ HEMTT da trasporto (coperto) HEMTT 輸送型 (幌) HEMTT 수송 (덮개) + 重型增程機動戰術卡車 (運輸, 棚布) + 重型增程机动战术卡车 (运输, 棚布) HEMTT @@ -336,6 +382,8 @@ HEMTT HEMTT HEMTT + 重型增程機動戰術卡車 + 重型增程机动战术卡车 HEMTT Container @@ -350,6 +398,8 @@ HEMTT portacontainer HEMTT コンテナ型 HEMTT 컨테이너 + 重型增程機動戰術卡車 (貨櫃) + 重型增程机动战术卡车 (货柜) HEMTT Medical @@ -364,6 +414,8 @@ HEMTT Medico HEMTT 救急車 HEMTT 의료 + 重型增程機動戰術卡車 (醫療) + 重型增程机动战术卡车 (医疗) HEMTT Ammo @@ -378,6 +430,8 @@ HEMTT di rifornimento munizioni HEMTT 弾薬給弾型 HEMTT 탄약 + 重型增程機動戰術卡車 (彈藥) + 重型增程机动战术卡车 (弹药) HEMTT Fuel @@ -392,6 +446,8 @@ HEMTT di rifornimento carburante HEMTT 燃料給油車 HEMTT 연료 + 重型增程機動戰術卡車 (燃油) + 重型增程机动战术卡车 (燃油) HEMTT Repair @@ -406,6 +462,8 @@ HEMTT Riparatore HEMTT 修理型 HEMTT 수리 + 重型增程機動戰術卡車 (維修) + 重型增程机动战术卡车 (维修) Fennek @@ -420,10 +478,12 @@ Fennek フェネック Fennek + "非洲小狐"防地雷反伏擊車 + "非洲小狐"防地雷反伏击车 Fennek (HMG) - Fennek (SMG) + Fennek (sMG) Fennek (HMG) Fennek (CKM) Fennek (HMG) @@ -434,6 +494,8 @@ Fennek (HMG) フェネック (HMG) Fennek (HMG) + "非洲小狐"防地雷反伏擊車 (重機槍) + "非洲小狐"防地雷反伏击车 (重机枪) Fennek (GMG) @@ -448,6 +510,8 @@ Fennek (GMG) フェネック (GMG) Fennek (GMG) + "非洲小狐"防地雷反伏擊車 (榴彈機槍) + "非洲小狐"防地雷反伏击车 (榴弹机枪) Leopard 2SG @@ -462,6 +526,8 @@ Leopard 2SG レオパルド 2SG Leopard 2SG + "豹2型新加坡版"主戰坦克 + "豹2型新加坡版"主战坦克 FV510 Warrior @@ -476,6 +542,8 @@ FV510 Warrior FV510 ウォーリアー FV510 Warrior + FV510"戰士"步兵戰車 + FV510"战士"步兵战车 Pandur II @@ -490,10 +558,12 @@ Pandur II パンデュール II Pandur II + "潘德2型"裝甲運兵車 + "潘德2型"装甲运兵车 KamAZ Transport - KamAZ Transport + KamAS Transport KamAZ de transporte KamAZ transportowy KamAZ (valník) @@ -504,10 +574,12 @@ KamAZ da trasporto KamAZ 輸送型 KamAZ 수송 + "卡瑪斯"卡車 (運輸) + "卡玛斯"卡车 (运输) KamAZ Transport (covered) - KamAZ Transport (bedeckt) + KamAS Transport (bedeckt) KamAZ de transporte (cubierto) KamAZ Transportowy (zakryty) KamAZ (valník-krytý) @@ -518,10 +590,12 @@ KamAZ da trasporto (coperto) KamAZ 輸送型 (幌) KamAZ 수송 (덮개) + "卡瑪斯"卡車 (運輸, 棚布) + "卡玛斯"卡车 (运输, 棚布) KamAZ Ammo - KamAZ Munition + KamAS Munition KamAZ de munición KamAZ Amunicyjny KamAZ (muniční) @@ -532,10 +606,12 @@ KamAZ di rifornimento munizioni KamAZ 弾薬給弾型 KamAZ 탄약 + "卡瑪斯"卡車 (彈藥) + "卡玛斯"卡车 (弹药) KamAZ Fuel - KamAZ Treibstoff + KamAS Treibstoff KamAZ de combustible KamAZ cysterna KamAZ (cisterna) @@ -546,10 +622,12 @@ KamAZ di rifornimento carburante KamzAZ 燃料給油車 KamAZ 연료 + "卡瑪斯"卡車 (燃油) + "卡玛斯"卡车 (燃油) KamAZ Repair - KamAZ Instandsetzung + KamAS Instandsetzung KamAZ de reparación KamAZ Naprawczy KamAZ (opravárenský) @@ -560,10 +638,12 @@ KamAZ riparatore KamzAZ 修理型 KamAZ 수리 + "卡瑪斯"卡車 (維修) + "卡玛斯"卡车 (维修) KamAZ Medical - KamAZ Sanitäter + KamAS Sanitäter KamAZ médico KamAZ Medyczny KamAZ (zdravotnický) @@ -574,48 +654,56 @@ KamAZ Medico KamAZ 救急車 KamAZ 의료 + "卡瑪斯"卡車 (醫療) + "卡玛斯"卡车 (医疗) - Punisher - Punisher - Punisher - Punisher - Punisher - Punisher + Karatel + Karatel + Karatel + Karatel + Karatel + Karatel Kаратель - Punisher - Punisher - Punisher + Karatel + Karatel + Karatel パニッシャー - Punisher + Karatel + "懲罰者"防地雷反伏擊車 + "惩罚者"防地雷反伏击车 - Punisher (HMG) - Punisher (SMG) - Punisher (HMG) - Punisher (CKM) - Punisher (HMG) - Punisher (HMG) + Karatel (HMG) + Karatel (sMG) + Karatel (HMG) + Karatel (CKM) + Karatel (HMG) + Karatel (HMG) Kаратель (Пулемёт) - Punisher (HMG) - Punisher (nehézgéppuska) - Punisher (HMG) + Karatel (HMG) + Karatel (nehézgéppuska) + Karatel (HMG) パニッシャー (HMG) - Punisher (HMG) + Karatel (HMG) + "懲罰者"防地雷反伏擊車 (重機槍) + "惩罚者"防地雷反伏击车 (重机枪) - Punisher (GMG) - Punisher (GMW) - Punisher (GMG) - Punisher (GMG) - Punisher (GMG) - Punisher (GMG) + Karatel (GMG) + Karatel (GMW) + Karatel (GMG) + Karatel (GMG) + Karatel (GMG) + Karatel (GMG) Kаратель (Гранатомёт) - Punisher (GMG) - Punisher (gránátgéppuska) - Punisher (GMG) + Karatel (GMG) + Karatel (gránátgéppuska) + Karatel (GMG) パニッシャー (GMG) - Punisher (GMG) + Karatel (GMG) + "懲罰者"防地雷反伏擊車 (榴彈機槍) + "惩罚者"防地雷反伏击车 (榴弹机枪) T100 Black Eagle @@ -630,6 +718,8 @@ T100 Black Eagle T100 ブラック イーグル T100 Black Eagle + T100"黑鷹"主戰坦克 + T100"黑鹰"主战坦克 2S9 Sochor @@ -644,6 +734,8 @@ 2S9 Sochor 2S9 ソーカー 2S9 Sochor + 2S9"薩克爾"自走砲 + 2S9"萨克尔"自走炮 BM-2T Stalker @@ -658,6 +750,8 @@ BM-2T Stalker BM-2T ストーカー BM-2T Stalker + BM-2T"潛行者"步兵戰車 + BM-2T"潜行者"步兵战车 ZSU-35 Tigris @@ -670,8 +764,10 @@ ZSU-35 Tigris ZSU-35 Tigris ZSU-35 Tigris - ZSU-35 + ZSU-35 ティグリス ZSU-35 Tigris + ZSU-35"虎式"防空車 + ZSU-35"虎式"防空车 Otokar ARMA @@ -684,8 +780,10 @@ Otokar ARMA Otokar ARMA Otokar ARMA - ティグリスOtokar アルマ + オトカ アルマ Otokar ARMA + "奧托卡-阿爾默"裝甲運兵車 + "奥托卡-阿尔默"装甲运兵车 Typhoon Transport @@ -698,8 +796,10 @@ Typhoon Transporte Typhoon szállítójármű Typhoon da trasporto - Typhoon 輸送型 + タイフーン 輸送型 Typhoon 수송 + "颱風"卡車 (運輸) + "台风"卡车 (运输) Typhoon Transport (covered) @@ -712,8 +812,10 @@ Typhoon Transporte (coberto) Typhoon szállítójármű (ponyvás) Typhoon da trasporto (coperto) - Typhoon 輸送型 (幌) + タイフーン 輸送型 (幌) Typhoon 수송 (덮개) + "颱風"卡車 (運輸, 棚布) + "台风"卡车 (运输, 棚布) Typhoon Device @@ -726,8 +828,10 @@ Typhoon Dispositivo Typhoon (eszköz) Typhoon per dispositivo - Typhoon デバイス型 + タイフーン デバイス型 Typhoon 장치 + "颱風"卡車 (精密設備) + "台风"卡车 (精密设备) Typhoon Ammo @@ -740,8 +844,10 @@ Typhoon Munições Typhoon (lőszerszállító) Typhoon di rifornimento munizioni - Typhoon 弾薬給弾型 + タイフーン 弾薬給弾型 Typhoon 탄약 + "颱風"卡車 (彈藥) + "台风"卡车 (弹药) Typhoon Fuel @@ -754,8 +860,10 @@ Typhoon Combustível Typhoon (üzemanyag-szállító) Typhoon di rifornimento carburante - Typhoon 燃料給油車 + タイフーン 燃料給油車 Typhoon 연료 + "颱風"卡車 (燃油) + "台风"卡车 (燃油) Typhoon Repair @@ -768,8 +876,10 @@ Typhoon Reparador Typhoon (szerelő-jármű) Typhoon riparatore - Typhoon 修理型 + タイフーン 修理型 Typhoon 수리 + "颱風"卡車 (維修) + "台风"卡车 (维修) Typhoon Medical @@ -782,8 +892,10 @@ Typhoon Médico Typhoon (egészségügyi) Typhoon medico - Typhoon 救急車 + タイフーン 救急車 Typhoon 의료 + "颱風"卡車 (醫療) + "台风"卡车 (医疗) RAH-66 Comanche @@ -798,6 +910,8 @@ RAH-66 Comanche RAH-66 コマンチ RAH-66 Comanche + RAH-66"卡曼契"攻擊直升機 + RAH-66"卡曼契"攻击直升机 MH-6 Little Bird @@ -812,6 +926,8 @@ MH-6 Little Bird MH-6 リトル バード MH-6 Little Bird + MH-6"小鳥"運輸直升機 + MH-6"小鸟"运输直升机 AH-6 Little Bird @@ -826,6 +942,8 @@ AH-6 Little Bird AH-6 リトル バード AH-6 Little Bird + AH-6"小鳥"武裝直升機 + AH-6"小鸟"武装直升机 CH-47I Chinook @@ -840,6 +958,8 @@ CH-47I Chinook CH-47I チヌーク CH-47I Chinook + CH-47I"契努克"運輸直升機 + CH-47I"契努克"运输直升机 CH-47I Chinook (unarmed) @@ -854,6 +974,8 @@ CH-47I Chinook (desarmado) CH-47I チヌーク (非武装) CH-47I Chinook (비무장) + CH-47I"契努克"運輸直升機 (無武裝) + CH-47I"契努克"运输直升机 (无武装) A-10D Thunderbolt II @@ -868,6 +990,8 @@ A-10D Thunderbolt II A-10D サンダーボルト II A-10D Thunderbolt II + A-10D"雷霆二式"攻擊機 + A-10D"雷霆二式"攻击机 AW159 Wildcat @@ -882,6 +1006,8 @@ AW159 Wildcat AW159 ワイルドキャット AW159 Wildcat + AW159"野貓"直升機 + AW159"野猫"直升机 AW159 Wildcat (unarmed) @@ -896,6 +1022,8 @@ AW159 Wildcat (disarmato) AW159 ワイルドキャット (非武装) AW159 Wildcat (비무장) + AW159"野貓"直升機 (無武裝) + AW159"野猫"直升机 (无武装) AW101 Merlin @@ -910,6 +1038,24 @@ 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) @@ -924,6 +1070,8 @@ L-159 ALCA (CAS) L-159 アルカ (対地) L-159 ALCA (근접지원) + L-159先進輕型戰鬥機 (近空支援) + L-159先进轻型战斗机 (近空支援) L-159 ALCA (AA) @@ -938,6 +1086,22 @@ L-159 ALCA (AA) L-159 アルカ (対空) L-159 ALCA (대공) + L-159先進輕型戰鬥機 (空對空) + L-159先进轻型战斗机 (空对空) + + + JAS 39 Gripen + JAS 39 Gripen + JAS 39 Gripen + JAS 39 Gripen + JAS 39 Gripen + JAS 39 Gripen + JAS 39 Грипен + JAS 39 Gripen + JAS 39 Gripen + サーブ 39 グリペン + JAS 39 그리펜 + JAS 39 獅鷲戰鬥機 Ka-60 Kasatka @@ -952,6 +1116,8 @@ Ka-60 Kasatka Ka-60 カサートカ Ka-60 Kasatka + Ka-60"逆戟鯨"直升機 + Ka-60"逆戟鲸"直升机 Ka-60 Kasatka (Black & White) @@ -963,8 +1129,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) @@ -979,6 +1147,8 @@ Ka-60 Kasatka (disarmato) Ka-60 カサートカ (非武装) Ka-60 Kasatka (비무장) + Ka-60"逆戟鯨"直升機 (無武裝) + Ka-60"逆戟鲸"直升机 (无武装) Yak-130 @@ -991,8 +1161,10 @@ Yak-130 Jak-130 Yak-130 - Yak-130 ミトン + Yak-130 Yak-130 + Yak-130"手套"攻擊機 + Yak-130"手套"攻击机 MD 500 @@ -1007,6 +1179,8 @@ MD 500 MD 500 MD 500 + MD 500"防衛者"直升機 + MD 500"防卫者"直升机 M4A1 SLAM @@ -1021,6 +1195,8 @@ M4A1 SLAM M4A1 SLAM M4A1 SLAM + M4A1指向性反裝甲地雷 + M4A1指向性反装甲地雷 M18A1 Claymore @@ -1035,6 +1211,8 @@ M18A1 Claymore Mina antiuomo M18A1 クレイモア M18A1 클레이모어 + M18A1"闊刀"地雷 + M18A1"阔刀"地雷 M183 Demolition Charge Assembly @@ -1049,6 +1227,8 @@ M183 Demolition Charge Assembly M183 梱包爆薬 M183 폭파 장약 조립 + M183炸藥包 + M183炸药包 M112 Demolition Block @@ -1061,8 +1241,10 @@ M112 Carga de Demolição M112 romboló tömb M112 Demolition Block - M113 爆薬ブロック + M112 爆薬ブロック M112 폭파 블럭 + M112塑性炸藥 + M112塑性炸药 M67 Fragmentation Grenade @@ -1077,10 +1259,12 @@ M67 Granata a frammentazione M67 破片手榴弾 M67 세열 수류탄 + M67破片手榴彈 + M67破片手榴弹 M83 Smoke Grenade (White) - M83 Rauchgranate (Weiss) + M83 Rauchgranate (Weiß) Granada de humo M83 (Blanco) Granat dymny M83 (Biały) M83 Kouřový Granát (Bílý) @@ -1091,6 +1275,8 @@ M83 Granata fumogena (Bianco) M18 煙幕手榴弾 (白) M83 연막탄 (하양) + M83煙霧彈 (白色) + M83烟雾弹 (白色) M18 Smoke Grenade (Blue) @@ -1105,6 +1291,8 @@ M18 Granata fumogena (Blu) M18 煙幕手榴弾 (青) M18 연막탄 (파랑) + M18煙霧彈 (藍色) + M18烟雾弹 (蓝色) M18 Smoke Grenade (Green) @@ -1119,6 +1307,8 @@ M18 Granata fumogena (Verde) M18 煙幕手榴弾 (緑) M18 연막탄 (초록) + M18煙霧彈 (綠色) + M18烟雾弹 (绿色) M18 Smoke Grenade (Orange) @@ -1133,6 +1323,8 @@ M18 Granata fumogena (Arancione) M18 煙幕手榴弾 (橙) M18 연막탄 (주황) + M18煙霧彈 (橘色) + M18烟雾弹 (橘色) M18 Smoke Grenade (Purple) @@ -1147,6 +1339,8 @@ M18 Granata fumogena (Viola) M18 煙幕手榴弾 (紫) M18 연막탄 (보라) + M18煙霧彈 (紫色) + M18烟雾弹 (紫色) M18 Smoke Grenade (Red) @@ -1161,6 +1355,8 @@ M18 Granata fumogena (Rosso) M18 煙幕手榴弾 (赤) M18 연막탄 (빨강) + M18煙霧彈 (紅色) + M18烟雾弹 (红色) M18 Smoke Grenade (Yellow) @@ -1175,6 +1371,8 @@ M18 Granata fumogena (Giallo) M18 煙幕手榴弾 (黄) M18 연막탄 (노랑) + M18煙霧彈 (黃色) + M18烟雾弹 (黄色) M15 Anti-Tank Mine @@ -1189,6 +1387,8 @@ M15 Mine anticarro M15 対戦車地雷 M15 대전차지뢰 + M15反坦克地雷 + M15反坦克地雷 VS-50 Anti-Personnel Mine @@ -1203,6 +1403,8 @@ VS-50 Mine antiuomo VS-50 対人地雷 VS-50 대인지뢰 + VS-50反人員地雷 + VS-50反人员地雷 M26 Anti-Personnel Bounding Mine @@ -1217,6 +1419,8 @@ M26 Mine saltanti antiuomo M26 対人跳躍地雷 M26 대인도약지뢰 + M26反人員彈跳雷 + M26反人员弹跳雷 PMR-3 Anti-Personnel Tripwire Mine @@ -1231,6 +1435,8 @@ PMR-3 Mine antiuomo PMR-3 仕掛け型対人地雷 PMR-3 대인인계철선지뢰 + PMR-3反人員絆線雷 + PMR-3反人员绊线雷 P99 @@ -1245,6 +1451,8 @@ P99 P99 P99 + P99手槍 + P99手枪 MP-443 Grach @@ -1259,6 +1467,8 @@ MP-443 Grach MP-433 グラッチ MP-443 Grach + MP-443"烏鴉"手槍 + MP-443"乌鸦"手枪 Custom Covert II @@ -1273,6 +1483,8 @@ ACP-C2 カスタム コンバート II Custom Covert II + 特裝隱蔽Ⅱ型手槍 + 特装隐蔽Ⅱ型手枪 FNX-45 Tactical @@ -1287,6 +1499,8 @@ FNX-45 Tactical FNX-45 タクティカル FNX-45 Tactical + FNX-45戰術型手槍 + FNX-45战术型手枪 Chiappa Rhino 60DS @@ -1301,6 +1515,8 @@ Chiappa Rhino 6DS チアッパ ライノ 60DS Chiappa Rhino 60DS + 齊亞帕"犀牛"60DS左輪手槍 + 齐亚帕"犀牛"60DS左轮手枪 Taurus Judge @@ -1315,6 +1531,8 @@ Taurus Judge タウルス ジャッジ Taurus Judge + 金牛座"法官"信號槍 + 金牛座"法官"信号枪 NLAW @@ -1329,6 +1547,8 @@ NLAW NLAW NLAW + 次世代輕型反坦克導彈發射器 + 次世代轻型反坦克导弹发射器 RPG-32 @@ -1343,6 +1563,8 @@ RPG-32 RPG-32 RPG-32 + RPG-32"哈希姆"火箭發射器 + RPG-32"哈希姆"火箭发射器 Mini-Spike (AA) @@ -1357,6 +1579,8 @@ Mini-Spike (AA) ミニスパイク (対空) Mini-Spike (대공) + "迷你長釘"導彈發射器 (防空) + "迷你长钉"导弹发射器 (防空) Mini-Spike (AT) @@ -1371,6 +1595,8 @@ Mini-Spike (AT) ミニスパイク (対地) Mini-Spike (대전차) + "迷你長釘"導彈發射器 (反坦克) + "迷你长钉"导弹发射器 (反坦克) MX @@ -1385,6 +1611,8 @@ MX MX MX + MX突擊步槍 + MX突击步枪 MX (Black) @@ -1399,6 +1627,8 @@ MX (Nero) MX (黒) MX (검정) + MX突擊步槍 (黑色) + MX突击步枪 (黑色) MXC @@ -1413,6 +1643,8 @@ MXC MXC MXC + MXC卡賓步槍 + MXC卡宾步枪 MXC (Black) @@ -1427,6 +1659,8 @@ MXC (Nero) MXC (黒) MXC (검정) + MXC卡賓步槍 (黑色) + MXC卡宾步枪 (黑色) MX 3GL @@ -1441,6 +1675,8 @@ MX 3GL MX 3GL MX 3GL + MX突擊步槍 (3連裝榴彈) + MX突击步枪 (3连装榴弹) MX 3GL (Black) @@ -1455,6 +1691,8 @@ MX 3GL (Nero) MX 3GL (黒) MX 3GL (검정) + MX突擊步槍 (3連裝榴彈-黑色) + MX突击步枪 (3连装榴弹-黑色) MX LSW @@ -1469,6 +1707,8 @@ MX LSW MX LSW MX LSW + MX輕型機槍 + MX轻型机枪 MX LSW (Black) @@ -1483,6 +1723,8 @@ MX LSW (Nero) MX LSW (黒) MX LSW (검정) + MX輕型機槍 (黑色) + MX轻型机枪 (黑色) MXM @@ -1497,6 +1739,8 @@ MXM MXM MXM + MXM精準步槍 + MXM精准步枪 MXM (Black) @@ -1511,6 +1755,8 @@ MXM (Nero) MXM (黒) MXM (검정) + MXM精準步槍 (黑色) + MXM精准步枪 (黑色) KH2002 Sama @@ -1525,6 +1771,8 @@ KT2002 Katiba KH2002 サマ KH2002 Sama + KH2002"海白爾"突擊步槍 + KH2002"海白尔"突击步枪 KH2002C Sama @@ -1539,6 +1787,8 @@ KT2002C Katiba KH2002C サマ KH2002C Sama + KH2002C"海白爾"卡賓步槍 + KH2002C"海白尔"卡宾步枪 KH2002 Sama KGL @@ -1553,6 +1803,8 @@ KT2002 Katiba KGL KH2002 サマ KGL KH2002 Sama KGL + KH2002"海白爾"突擊步槍 (榴彈) + KH2002"海白尔"突击步枪 (榴弹) F2000 (Camo) @@ -1567,6 +1819,8 @@ F2000 (Camo) F2000 (迷彩) F2000 (위장) + F2000突擊步槍 (迷彩) + F2000突击步枪 (迷彩) F2000 @@ -1581,6 +1835,8 @@ F2000 F2000 F2000 + F2000突擊步槍 + F2000突击步枪 F2000 Tactical (Camo) @@ -1595,6 +1851,8 @@ F2000 Tactical (Camo) F2000 タクティカル (迷彩) F2000 Tactical (위장) + F2000戰術型突擊步槍 (迷彩) + F2000战术型突击步枪 (迷彩) F2000 Tactical @@ -1609,6 +1867,8 @@ F2000 Tactical F2000 タクティカル F2000 Tactical + F2000戰術型突擊步槍 + F2000战术型突击步枪 F2000 EGLM (Camo) @@ -1623,6 +1883,8 @@ F2000 EGLM (Camo) F2000 EGLM (迷彩) F2000 EGLM (위장) + F2000突擊步槍 (榴彈-迷彩) + F2000突击步枪 (榴弹-迷彩) F2000 EGLM @@ -1637,6 +1899,8 @@ F2000 EGLM F2000 EGLM F2000 EGLM + F2000突擊步槍 (榴彈) + F2000突击步枪 (榴弹) TAR-21 @@ -1651,6 +1915,8 @@ TAR-21 TAR-21 TAR-21 + TAR-21突擊步槍 + TAR-21突击步枪 CTAR-21 @@ -1665,20 +1931,24 @@ CTAR-21 CTAR-21 CTAR-21 + CTAR-21卡賓步槍 + CTAR-21卡宾步枪 - TAR-21 EGLM - TAR-21 EGLM - TAR-21 EGLM - TAR-21 EGLM - TAR-21 EGLM - TAR-21 EGLM - TAR-21 EGLM - TAR-21 EGLM - TAR-21 EGLM - TAR-21 EGLM - TAR-21 EGLM - TAR-21 EGLM + GTAR-21 EGLM + GTAR-21 EGLM + GTAR-21 EGLM + GTAR-21 EGLM + GTAR-21 EGLM + GTAR-21 EGLM + GTAR-21 EGLM + GTAR-21 EGLM + GTAR-21 EGLM + GTAR-21 EGLM + GTAR-21 EGLM + GTAR-21 EGLM + GTAR-21突擊步槍 (榴彈) + GTAR-21突击步枪 (榴弹) Vector SMG @@ -1693,6 +1963,8 @@ Vector SMG ベクター SMG Vector SMG + "維克特"衝鋒槍 + "维克特"冲锋枪 Scorpion Evo 3 A1 @@ -1707,6 +1979,8 @@ Scorpion Evo 3 A1 スコーピオン エボ 3 A1 Scorpion Evo 3 A1 + "蠍式"Evo 3 A1衝鋒槍 + "蝎式"Evo 3 A1冲锋枪 CPW @@ -1721,6 +1995,8 @@ CPW CPW CPW + 緊湊型個人衝鋒槍 + 紧凑型个人冲锋枪 RFB SDAR @@ -1735,6 +2011,8 @@ RFB SDAR RFB SDAR RFB SDAR + 犢牛式水陸兩用步槍 + 犊牛式水陆两用步枪 Stoner 99 LMG @@ -1749,6 +2027,8 @@ Stoner 99 LMG ストーナー 99 LMG Stoner 99 LMG + 斯通納99輕機槍 + 斯通纳99轻机枪 Negev NG7 @@ -1763,6 +2043,8 @@ Negev NG7 ネゲフ NG7 Negev NG7 + 內蓋夫NG7機槍 + 内盖夫NG7机枪 Mk14 Mod 1 EBR @@ -1777,6 +2059,8 @@ Mk14 Mod 1 EBR Mk14 Mod 1 EBR Mk14 Mod 1 EBR + Mk14一型增強型戰鬥步槍 + Mk14一型增强型战斗步枪 GM6 Lynx @@ -1791,6 +2075,8 @@ GM6 Lynx GM6 リンクス GM6 Lynx + GM6"天貓"反器材狙擊步槍 + GM6"天猫"反器材狙击步枪 GM6 Lynx (Camo) @@ -1805,6 +2091,8 @@ GM6 Lynx (Camo) GM6 リンクス (迷彩) GM6 Lynx (위장) + GM6"天貓"反器材狙擊步槍 (迷彩) + GM6"天猫"反器材狙击步枪 (迷彩) M200 Intervention @@ -1819,6 +2107,8 @@ M200 Intervention M200 インターベンション M200 Intervention + M200干預型狙擊步槍 + M200干预型狙击步枪 M200 Intervention (Camo) @@ -1833,6 +2123,8 @@ M200 Intervention (Camo) M200 インターベンション (迷彩) M200 Intervention (위장) + M200干預型狙擊步槍 (迷彩) + M200干预型狙击步枪 (迷彩) VS-121 @@ -1847,6 +2139,8 @@ VS-121 VS-121 VS-121 + VS-121狙擊步槍 + VS-121狙击步枪 Noreen "Bad News" ULR @@ -1861,6 +2155,8 @@ Noreen "Bad News" ULR ノレーン "バッド ニュース" ULR Noreen "Bad News" ULR + 諾琳"壞消息"極距狙擊步槍 + 诺琳"坏消息"极距狙击步枪 Noreen "Bad News" ULR (Black) @@ -1875,6 +2171,8 @@ Noreen "Bad News" ULR (Preto) ノレーン "バッド ニュース" ULR (黒) Noreen "Bad News" ULR (검정) + 諾琳"壞消息"極距狙擊步槍 (黑色) + 诺琳"坏消息"极距狙击步枪 (黑色) Noreen "Bad News" ULR (Camo) @@ -1882,13 +2180,15 @@ Noreen "Bad News" ULR (Camo) Noreen "Bad News" ULR (Camuflaje) Noreen "Bad News" ULR (Камо) - Noreen "Bad News" ULR (Camo) + Noreen "Bad News" ULR (Tarnmuster) Noreen "Bad News" ULR (kamuflaż) Noreen "Bad News" ULR (Camo) Noreen "Bad News"ULR (Terepmintás) Noreen "Bad News" ULR (Camuflagem) ノレーン "バッド ニュース" ULR (迷彩) Noreen "Bad News" ULR (위장) + 諾琳"壞消息"極距狙擊步槍 (迷彩) + 诺琳"坏消息"极距狙击步枪 (迷彩) Noreen "Bad News" ULR (Sand) @@ -1896,13 +2196,15 @@ Noreen "Bad News" ULR (Beige) Noreen "Bad News" ULR (Arena) Noreen "Bad News" ULR (Песочный) - Noreen "Bad News" ULR (Sand) + Noreen "Bad News" ULR (sandfarben) Noreen "Bad News" ULR (piaskowy) Noreen "Bad News" ULR (Sabbia) Noreen "Bad News"ULR (Homok) Noreen "Bad News" ULR (Deserto) ノレーン "バッド ニュース" ULR (砂地) Noreen "Bad News" ULR (모래) + 諾琳"壞消息"極距狙擊步槍 (沙色) + 诺琳"坏消息"极距狙击步枪 (沙色) SIG 556 @@ -1917,6 +2219,8 @@ SIG 556 SIG 556 SIG 556 + SIG 556精準步槍 + SIG 556精准步枪 SIG 556 (Black) @@ -1931,6 +2235,8 @@ SIG 556 (Preto) SIG 556 (黒) SIG 556 (검정) + SIG 556精準步槍 (黑色) + SIG 556精准步枪 (黑色) SIG 556 (Khaki) @@ -1945,6 +2251,8 @@ SIG 556 (Caqui) SIG 556 (土埃) SIG 556 (카키) + SIG 556精準步槍 (卡其色) + SIG 556精准步枪 (卡其色) SIG 556 (Sand) @@ -1953,12 +2261,14 @@ SIG 556 (Arena) SIG 556 (Песочный) SIG 556 (piaskowy) - SIG 556 (Sand) + SIG 556 (sandfarben) SIG 556 (Sabbia) SIG 556 (Homok) SIG 556 (Deserto) SIG 556 (砂地) SIG 556 (모래) + SIG 556精準步槍 (沙色) + SIG 556精准步枪 (沙色) SIG 556 (Camo) @@ -1967,12 +2277,14 @@ SIG 556 (Camuflaje) SIG 556 (Камо) SIG 556 (kamuflaż) - SIG 556 (Camo) + SIG 556 (Tarnmuster) SIG 556 (Camo) SIG 556 (Terepmintás) SIG 556 (Camuflagem) SIG 556 (迷彩) SIG 556 (위장) + SIG 556精準步槍 (迷彩) + SIG 556精准步枪 (迷彩) SIG 556 (Woodland) @@ -1981,26 +2293,14 @@ SIG 556 (Bosque) SIG 556 (Лесной) SIG 556 (leśny) - SIG 556 (Woodland) + SIG 556 (Grünes Tarnmuster) SIG 556 (Woodland) SIG 556 (Erdőmintás) SIG 556 (Floresta) SIG 556 (森林) 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 (임시) spotter + SIG 556精準步槍 (森林迷彩) + SIG 556精准步枪 (森林迷彩) ASP-1 Kir @@ -2014,7 +2314,9 @@ ASP-1 Kir ASP-1 Kir ASP-1 Kir - ASP-1 Kir + ASP-1 キール + ASP-1"基爾"消音狙擊步槍 + ASP-1"基尔"消音狙击步枪 ASP-1 Kir (Black) @@ -2027,8 +2329,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) @@ -2041,8 +2345,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 @@ -2057,6 +2363,8 @@ Cyrus サイラス Cyrus + "居鲁士"狙擊步槍 + "居鲁士"狙击步枪 Cyrus (Black) @@ -2071,6 +2379,8 @@ Cyrus (Preto) サイラス (黒) Cyrus (검정) + "居鲁士"狙擊步槍 (黑色) + "居鲁士"狙击步枪 (黑色) Cyrus (Hex) @@ -2085,6 +2395,8 @@ Cyrus (Hex) サイラス (蜂巣) Cyrus (육각) + "居鲁士"狙擊步槍 (數位蜂巢迷彩) + "居鲁士"狙击步枪 (数位蜂巢迷彩) Cyrus (Tan) @@ -2099,6 +2411,8 @@ Cyrus (Deserto) サイラス (黄褐) Cyrus (황갈) + "居鲁士"狙擊步槍 (黃褐色) + "居鲁士"狙击步枪 (黄褐色) M14 @@ -2113,6 +2427,8 @@ M14 M14 M14 + M14精準步槍 + M14精准步枪 M14 (Camo) @@ -2121,12 +2437,14 @@ M14 (Camuflaje) M14 (Камо) M14 (kamuflaż) - M14 (Camo) + M14 (Tarnmuster) M14 (Camo) M14 (Terepmintás) M14 (Camuflagem) M14 (迷彩) M14 (위장) + M14精準步槍 (迷彩) + M14精准步枪 (迷彩) M14 (Olive) @@ -2135,12 +2453,14 @@ M14 (Oliva) M14 (Олива) M14 (oliwkowy) - M14 (Olive) + M14 (Olivgrün) M14 (Olive) M14 (Olíva) M14 (Oliva) M14 (オリーブド ラブ) M14 (올리브) + M14精準步槍 (橄欖色) + M14精准步枪 (橄榄色) HK121 @@ -2155,6 +2475,8 @@ HK121 HK 121 HK121 + HK121中型機槍 + HK121中型机枪 HK121 (Hex) @@ -2169,6 +2491,8 @@ HK121 (Hex) HK 121 (蜂巣) HK121 (육각) + HK121中型機槍 (數位蜂巢迷彩) + HK121中型机枪 (数位蜂巢迷彩) HK121 (Tan) @@ -2183,6 +2507,8 @@ HK121 (Deserto) HK 121 (黄褐) HK121 (황갈) + HK121機槍 (黃褐色) + HK121机枪 (黄褐色) LWMMG @@ -2197,6 +2523,8 @@ LWMMG LWMMG LWMMG + 輕量化中型機槍 + 轻量化中型机枪 LWMMG (MTP) @@ -2211,6 +2539,8 @@ LWMMG (MTP) LWMMG (マルチカモ) LWMMG (MTP) + 輕量化中型機槍 (多地形迷彩) + 轻量化中型机枪 (多地形迷彩) LWMMG (Black) @@ -2225,6 +2555,8 @@ LWMMG (Preto) LWMMG (黒) LWMMG (검정) + 輕量化中型機槍 (黑色) + 轻量化中型机枪 (黑色) LWMMG (Sand) @@ -2233,12 +2565,14 @@ LWMMG (Arena) LWMMG (Песочный) LWMMG (piaskowy) - LWMMG (Sand) + LWMMG (sandfarben) LWMMG (Sabbia) LWMMG (Homok) LWMMG (Deserto) LWMMG (砂地) LWMMG (모래) + 輕量化中型機槍 (沙色) + 轻量化中型机枪 (沙色) Jeep Wrangler @@ -2253,6 +2587,8 @@ Jeep Wrangler ジープ ラングラー Jeep Wrangler + "牧馬人"吉普車 + "牧马人"吉普车 Jeep Wrangler (Black) @@ -2267,6 +2603,8 @@ Jeep Wrangler (Preto) ジープ ラングラー (黒) Jeep Wrangler (검정) + "牧馬人"吉普車 (黑色) + "牧马人"吉普车 (黑色) Jeep Wrangler (Blue) @@ -2281,6 +2619,8 @@ Jeep Wrangler (Blu) ジープ ラングラー (青) Jeep Wrangler (파랑) + "牧馬人"吉普車 (藍色) + "牧马人"吉普车 (蓝色) Jeep Wrangler (Green) @@ -2295,6 +2635,8 @@ Jeep Wrangler (Verde) ジープ ラングラー (緑) Jeep Wrangler (초록) + "牧馬人"吉普車 (綠色) + "牧马人"吉普车 (绿色) Jeep Wrangler (Orange) @@ -2309,6 +2651,8 @@ Jeep Wrangler (Arancione) ジープ ラングラー (橙) Jeep Wrangler (주황) + "牧馬人"吉普車 (橘色) + "牧马人"吉普车 (橘色) Jeep Wrangler (Red) @@ -2323,6 +2667,8 @@ Jeep Wrangler (Rosso) ジープ ラングラー (赤) Jeep Wrangler (빨강) + "牧馬人"吉普車 (紅色) + "牧马人"吉普车 (红色) Jeep Wrangler (White) @@ -2337,6 +2683,8 @@ Jeep Wrangler (Bianco) ジープ ラングラー (白) Jeep Wrangler (하양) + "牧馬人"吉普車 (白色) + "牧马人"吉普车 (白色) Cessna TTx @@ -2351,6 +2699,8 @@ Cessna TTx セスナ TTx Cessna TTx + "賽斯納"TTx單引擎飛機 + "赛斯纳"TTx单引擎飞机 Cessna TTx (Racing) @@ -2365,6 +2715,8 @@ Cessna TTx (Racing) セスナ TTx (レース仕様) Cessna TTx (경주용) + "賽斯納"TTx單引擎飛機 (競速) + "赛斯纳"TTx单引擎飞机 (竞速) Burraq UCAV @@ -2379,6 +2731,8 @@ Burraq UCAV ブラーク UCAV Burraq UCAV + "柏拉格"空中無人戰鬥載具 + "柏拉格"空中无人战斗载具 QBZ-95-1 (Black) @@ -2393,6 +2747,8 @@ QBZ-95-1 (Preto) QBZ-95-1 (黒) QBZ-95-1 (검정) + QBZ-95-1式自動步槍 (黑色) + QBZ-95-1式自动步枪 (黑色) QBZ-95-1 (Green Hex) @@ -2407,6 +2763,8 @@ QBZ-95-1 (Hex Verde) QBZ-95-1 (緑蜂巣) QBZ-95-1 (초록육각) + QBZ-95-1式自動步槍 (綠色數位蜂巢迷彩) + QBZ-95-1式自动步枪 (绿色数位蜂巢迷彩) QBZ-95-1 (Hex) @@ -2421,6 +2779,8 @@ QBZ-95-1 (Hex) QBZ-95-1 (蜂巣) QBZ-95-1 (육각) + QBZ-95-1式自動步槍 (數位蜂巢迷彩) + QBZ-95-1式自动步枪 (数位蜂巢迷彩) QBZ-95-1 GL (Black) @@ -2435,6 +2795,8 @@ 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) @@ -2449,6 +2811,8 @@ 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) @@ -2463,6 +2827,8 @@ QBZ-95-1 GL (Hex) QBZ-95-1 GL (蜂巣) QBZ-95-1 GL (육각) + QBZ-95-1式自動步槍 (榴彈-數位蜂巢迷彩) + QBZ-95-1式自动步枪 (榴弹-数位蜂巢迷彩) QBZ-95-1 LSW (Black) @@ -2477,6 +2843,8 @@ 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) @@ -2491,6 +2859,8 @@ 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) @@ -2505,6 +2875,8 @@ QBZ-95-1 LSW (Hex) QBZ-95-1 LSW (蜂巣) QBZ-95-1 LSW (육각) + QBZ-95-1式輕機槍 (數位蜂巢迷彩) + QBZ-95-1式轻机枪 (数位蜂巢迷彩) QBU-88 (Black) @@ -2519,6 +2891,8 @@ QBU-88 (Preto) QBU-88 (黒) QBU-88 (검정) + QBU-88式狙擊步槍 (黑色) + QBU-88式狙击步枪 (黑色) QBU-88 (Green Hex) @@ -2533,6 +2907,8 @@ QBU-88 (Hex Verde) QBU-88 (緑蜂巣) QBU-88 (초록육각) + QBU-88式狙擊步槍 (綠色數位蜂巢迷彩) + QBU-88式狙击步枪 (绿色数位蜂巢迷彩) QBU-88 (Hex) @@ -2547,6 +2923,8 @@ QBU-88 (Hex) QBU-88 (蜂巣) QBU-88 (육각) + QBU-88式狙擊步槍 (數位蜂巢迷彩) + QBU-88式狙击步枪 (数位蜂巢迷彩) GM6 Lynx (Green Hex) @@ -2561,20 +2939,24 @@ GM6 Lynx (Hex Verde) GM6 リンクス (緑蜂巣) GM6 Lynx (초록육각) + GM6"天貓"反器材狙擊步槍 (綠色數位蜂巢迷彩) + GM6"天猫"反器材狙击步枪 (绿色数位蜂巢迷彩) - M249 SPW - M249 SPW - M249 SPW - M249 SPW - M249 SPW - M249 SPW - M249 SPW - M249 SPW - M249 SPW - M249 SPW - M249 SPW - M249 SPW + FN Minimi SPW + FN Minimi SPW + FN Minimi SPW + FN Minimi SPW + FN Minimi SPW + FN Minimi SPW + FN Minimi SPW + FN Minimi SPW + FN Minimi SPW + FN Minimi SPW + FN Minimi SPW + FN Minimi SPW + FN Minimi班用自動機槍 + FN Minimi班用自动机枪 M200 Intervention (Tropic) @@ -2589,6 +2971,8 @@ M200 Intervention (Tropico) M200 インターベンション (熱帯) M200 Intervention (열대) + M200干預型狙擊步槍 (熱帶迷彩) + M200干预型狙击步枪 (热带迷彩) MP5K @@ -2603,6 +2987,8 @@ MP5K MP5K MP5K + MP5K衝鋒槍 + MP5K冲锋枪 HK416A5 11" (Black) @@ -2617,6 +3003,8 @@ HK416A5 11" (Preto) HK416A5 11" (黒) HK416A5 11" (검정) + HK416A5 11"突擊步槍 (黑色) + HK416A5 11"突击步枪 (黑色) HK416A5 11" (Khaki) @@ -2631,6 +3019,8 @@ HK416A5 11" (Caqui) HK416A5 11" (土埃) HK416A5 11" (카키) + HK416A5 11"突擊步槍 (卡其色) + HK416A5 11"突击步枪 (卡其色) HK416A5 11" (Sand) @@ -2638,13 +3028,15 @@ HK416A5 11" (Beige) HK416A5 11" (Arena) HK416A5 11" (Песочный) - HK416A5 11" (Sand) + HK416A5 11" (sandfarben) HK416A5 11" (piaskowy) HK416A5 11" (Sabbia) HK416A5 11" (Homok) HK416A5 11" (Deserto) HK416A5 11" (砂地) HK416A5 11" (모래) + HK416A5 11"突擊步槍 (沙色) + HK416A5 11"突击步枪 (沙色) HK416A5 11" GL (Black) @@ -2659,6 +3051,8 @@ HK416A5 11" GL (Preto) HK416A5 11" GL (黒) HK416A5 11" GL (검정) + HK416A5 11"突擊步槍 (榴彈-黑色) + HK416A5 11"突击步枪 (榴弹-黑色) HK416A5 11" GL (Khaki) @@ -2673,6 +3067,8 @@ HK416A5 11" GL (Caqui) HK416A5 11" GL (土埃) HK416A5 11" GL (카키) + HK416A5 11"突擊步槍 (榴彈-卡其色) + HK416A5 11"突击步枪 (榴弹-卡其色) HK416A5 11" GL (Sand) @@ -2680,13 +3076,15 @@ HK416A5 11" GL (Beige) HK416A5 11" GL (Arena) HK416A5 11" GL (Песочный) - HK416A5 11" GL (Sand) + HK416A5 11" GL (sandfarben) 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) @@ -2701,6 +3099,8 @@ HK416A5 14.5" (Preto) HK416A5 14.5" (黒) HK416A5 14.5" (검정) + HK416A5 14.5"突擊步槍 (黑色) + HK416A5 14.5"突击步枪 (黑色) HK416A5 14.5" (Khaki) @@ -2715,6 +3115,8 @@ HK416A5 14.5" (Caqui) HK416A5 14.5" (土埃) HK416A5 14.5" (카키) + HK416A5 14.5"突擊步槍 (卡其色) + HK416A5 14.5"突击步枪 (卡其色) HK416A5 14.5" (Sand) @@ -2722,13 +3124,15 @@ HK416A5 14.5" (Beige) HK416A5 14.5" (Arena) HK416A5 14.5" (Песочный) - HK416A5 14.5" (Sand) + HK416A5 14.5" (sandfarben) HK416A5 14.5" (piaskowy) HK416A5 14.5" (Sabbia) HK416A5 14.5" (Homok) HK416A5 14.5" (Deserto) HK416A5 14.5" (砂地) HK416A5 14.5" (모래) + HK416A5 14.5"突擊步槍 (沙色) + HK416A5 14.5"突击步枪 (沙色) HK417A2 20" (Black) @@ -2743,6 +3147,8 @@ HK417A2 20" (Preto) HK417A2 20" (黒) HK417A2 20" (검정) + HK417A2 20"突擊步槍 (黑色) + HK417A2 20"突击步枪 (黑色) HK417A2 20" (Khaki) @@ -2757,6 +3163,8 @@ HK417A2 20" (Caqui) HK417A2 20" (土埃) HK417A2 20" (카키) + HK417A2 20"突擊步槍 (卡其色) + HK417A2 20"突击步枪 (卡其色) HK417A2 20" (Sand) @@ -2764,13 +3172,15 @@ HK417A2 20" (Beige) HK417A2 20" (Arena) HK417A2 20" (Песочный) - HK417A2 20" (Sand) + HK417A2 20" (sandfarben) HK417A2 20" (piaskowy) HK417A2 20" (Sabbia) HK417A2 20" (Homok) HK417A2 20" (Deserto) HK417A2 20" (砂地) HK417A2 20" (모래) + HK417A2 20"突擊步槍 (沙色) + HK417A2 20"突击步枪 (沙色) RPG-32 (Green Hex) @@ -2785,6 +3195,8 @@ RPG-32 (Hex Verde) RPG-32 (緑蜂巣) RPG-32 (초록육각) + RPG-32火箭發射器 (綠色數位蜂巢迷彩) + RPG-32火箭发射器 (绿色数位蜂巢迷彩) P99 (Khaki) @@ -2797,8 +3209,10 @@ P99 (Khaki) P99 (Khaki) P99 (Caqui) - P99 (カーキ) + P99 (土埃) P99 (카키) + P99半自動手槍 (卡其色) + P99半自动手枪 (卡其色) Makarov PM @@ -2813,6 +3227,28 @@ Makarov PM マカロフ PM Makarov PM + "馬卡洛夫"手槍 + "马卡洛夫"手枪 + + + Polaris DAGOR (XM312) + Polaris DAGOR (XM312) + + + Polaris DAGOR + Polaris DAGOR + + + Polaris DAGOR (light) + Polaris DAGOR (leicht) + + + LSV Mk. II (M134) + LSV Mk. II (M134) + + + LSV Mk. II + LSV Mk. II diff --git a/addons/rearm/ACE_Settings.hpp b/addons/rearm/ACE_Settings.hpp index 798bbd7650..2bd4eec450 100644 --- a/addons/rearm/ACE_Settings.hpp +++ b/addons/rearm/ACE_Settings.hpp @@ -1,10 +1,18 @@ class ACE_Settings { class GVAR(level) { - category = ECSTRING(OptionsMenu,CategoryLogistics); + category = CSTRING(DisplayName); displayName = CSTRING(RearmSettings_level_DisplayName); description = CSTRING(RearmSettings_level_Description); value = 0; typeName = "SCALAR"; values[] = {CSTRING(RearmSettings_vehicle), CSTRING(RearmSettings_magazine), CSTRING(RearmSettings_caliber)}; }; + class GVAR(supply) { + category = CSTRING(DisplayName); + 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/CfgEventHandlers.hpp b/addons/rearm/CfgEventHandlers.hpp index 17edc1dc30..077779a642 100644 --- a/addons/rearm/CfgEventHandlers.hpp +++ b/addons/rearm/CfgEventHandlers.hpp @@ -28,7 +28,7 @@ class Extended_PostInit_EventHandlers { class Extended_Respawn_EventHandlers { class CAManBase { class ADDON { - respawn = QUOTE(call COMPILE_FILE(XEH_respawn)); + respawn = QUOTE(call FUNC(handleRespawn)); }; }; }; diff --git a/addons/rearm/CfgVehicles.hpp b/addons/rearm/CfgVehicles.hpp index ef006b61be..7c442e4df9 100644 --- a/addons/rearm/CfgVehicles.hpp +++ b/addons/rearm/CfgVehicles.hpp @@ -1,54 +1,29 @@ - #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; class CfgVehicles { class ACE_Module; class ACE_moduleRearmSettings: ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(RearmSettings_Module_DisplayName); icon = QPATHTOF(ui\icon_module_rearm.paa); category = "ACE_Logistics"; function = QFUNC(moduleRearmSettings); functionPriority = 1; - isGlobal = 0; + isGlobal = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); class Arguments { @@ -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,89 +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 Tank_F: Tank {}; - - 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 APC_Tracked_01_base_F: Tank_F {}; - class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {}; + class B_APC_Tracked_01_base_F; class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_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 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; - MACRO_REARM_TRUCK_ACTIONS + GVAR(defaultSupply) = 1200; }; class EAST_Box_Base: ReammoBox_F{}; class Box_East_AmmoVeh_F: EAST_Box_Base { transportAmmo = 0; - MACRO_REARM_TRUCK_ACTIONS + GVAR(defaultSupply) = 1200; }; class IND_Box_Base: ReammoBox_F{}; class Box_IND_AmmoVeh_F: IND_Box_Base { transportAmmo = 0; - MACRO_REARM_TRUCK_ACTIONS + 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..dc34fbd9e9 100644 --- a/addons/rearm/XEH_PREP.hpp +++ b/addons/rearm/XEH_PREP.hpp @@ -1,26 +1,39 @@ - +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(getMaxMagazines); PREP(getNeedRearmMagazines); +PREP(getSupplyCount); +PREP(getTurretConfigMagazines); +PREP(getTurretMagazineAmmo); PREP(grabAmmo); PREP(handleKilled); +PREP(handleRespawn); 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 296728807f..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,14 +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; - -#ifdef DEBUG_MODE_FULL -INFO("Showing CfgVehicles with vanilla transportAmmo"); -{ - WARNING_2("Type [%1] needs config [transportAmmo: %2]", configName _x, getNumber (_x >> 'transportAmmo')); -} forEach (configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(getNumber (_x >> 'transportAmmo')) > 0}", true]); -#endif 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 357eaac8eb..236f23e233 100644 --- a/addons/rearm/functions/fnc_canRearm.sqf +++ b/addons/rearm/functions/fnc_canRearm.sqf @@ -3,29 +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 (!alive _target) 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}; -if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {([_unit, _target] call EFUNC(interaction,getInteractionDistance)) > REARM_ACTION_DISTANCE} || {_target 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 29c15559a0..4c4989b1d7 100644 --- a/addons/rearm/functions/fnc_canStoreAmmo.sqf +++ b/addons/rearm/functions/fnc_canStoreAmmo.sqf @@ -10,17 +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 || - {!alive _target} || - {!(_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 242ff81222..c508df378d 100644 --- a/addons/rearm/functions/fnc_canTakeAmmo.sqf +++ b/addons/rearm/functions/fnc_canTakeAmmo.sqf @@ -10,17 +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 || - {!alive _target} || - {!(_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..30b8b9d67d 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,14 +32,14 @@ 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]; }; -[_unit, "forceWalk", QGVAR(vehRearm), false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", "ACE_rearm", false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_rearm", false] call EFUNC(common,statusEffect_set); if (_unholster) then { REARM_UNHOLSTER_WEAPON 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_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..13159987f2 100644 --- a/addons/rearm/functions/fnc_grabAmmo.sqf +++ b/addons/rearm/functions/fnc_grabAmmo.sqf @@ -16,13 +16,14 @@ */ #include "script_component.hpp" -params [["_dummy", objNull, [objNull]], ["_unit", objNull, [objNull]]]; +params ["_dummy", "_unit"]; -REARM_HOLSTER_WEAPON -[_unit, "forceWalk", QGVAR(vehRearm), true] call EFUNC(common,statusEffect_set); +REARM_HOLSTER_WEAPON; +[_unit, "forceWalk", "ACE_rearm", true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_rearm", 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/XEH_respawn.sqf b/addons/rearm/functions/fnc_handleRespawn.sqf similarity index 56% rename from addons/rearm/XEH_respawn.sqf rename to addons/rearm/functions/fnc_handleRespawn.sqf index 33ac042e7c..26cb918c0e 100644 --- a/addons/rearm/XEH_respawn.sqf +++ b/addons/rearm/functions/fnc_handleRespawn.sqf @@ -1,3 +1,18 @@ +/* + * Author: unknown + * Called when a unit is Respawned + * + * Arguments: + * 0: The Unit + * + * Return Value: + * None + * + * Example: + * [bob] call ACE_rearm_fnc_handleRespawn + * + * Public: No + */ #include "script_component.hpp" params ["_unit"]; @@ -10,4 +25,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/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..a388b80c32 100644 --- a/addons/rearm/functions/fnc_rearmEntireVehicle.sqf +++ b/addons/rearm/functions/fnc_rearmEntireVehicle.sqf @@ -16,14 +16,19 @@ * 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"]; +TRACE_3("rearmEntireVehicle",_truck,_player,_vehicle); [ - 10, - _vehicle, + TIME_PROGRESSBAR(10), + [_truck, _vehicle, _player], FUNC(rearmEntireVehicleSuccess), "", format [localize LSTRING(BasicRearmAction), getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], - {true}, + { + param [0] params ["", "_vehicle", "_player"]; + (_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..9e6be0fe1c 100644 --- a/addons/rearm/functions/fnc_takeSuccess.sqf +++ b/addons/rearm/functions/fnc_takeSuccess.sqf @@ -18,15 +18,22 @@ */ #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); -[_unit, "forceWalk", QGVAR(vehRearm), true] call EFUNC(common,statusEffect_set); -_dummy = [_unit, _magazineClass] call FUNC(createDummy); +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", "ACE_rearm", true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_rearm", true] call EFUNC(common,statusEffect_set); +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 7659faef64..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]; \ + 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 c7b545c481..ef7c2e3662 100644 --- a/addons/rearm/stringtable.xml +++ b/addons/rearm/stringtable.xml @@ -1,6 +1,14 @@ - + + + Rearm + Aufmunitionierung + Riarmo + 整裝 + 整装 + 再武装 + Rearm Settings Aufmunitioniereinstellungen @@ -11,8 +19,10 @@ Impostazioni Riarmo Parámetros de rearme Options de réarmement - 再武装設定 재보급 설정 + 整装设定 + 整裝設定 + 再武装設定 This module allows you to tweak rearm system settings. @@ -26,6 +36,8 @@ Ce module autorise l'amélioration du système de réarmement. 再武装システムの設定を微調整します。 이 모듈은 재보급시의 설정을 바꿀수 있게해줍니다. + 此模块允许你调整整装系统设定 + 此模塊允許你調整整裝系統設定 Rearm Amount @@ -37,8 +49,10 @@ Ammontare Riarmo Velocidad de rearme Quantité à réarmer - 再武装の度合い + 再武装できる量 재보급 양 + 整装所需时间 + 整裝所需時間 How fast should a vehicle be rearmed? @@ -52,6 +66,8 @@ A quelle vitesse devrait être réarmé un véhicule ? 車両を再武装する速さを設定しますか? 차량을 얼마나 빨리 재보급 시킵니까? + 载具多快会整装完毕? + 載具多快會整裝完畢? Entire Vehicle @@ -65,6 +81,8 @@ Véhicule entier 対象の車両 모든 차량 + 整个载具 + 整個載具 Entire Magazine @@ -78,6 +96,8 @@ Chargeur entier 対象の弾薬 모든 탄창 + 整个弹匣 + 整個彈匣 Amount based on caliber @@ -89,8 +109,110 @@ 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. + 여기에는 최소 %1 포인트의 탄약이 남았습니다. + + + The following ammunition is left:%1 + Folgende Munition ist übrig:%1 + Mancano le seguenti:%1 + この弾薬の残りは:%1 + 以下剩余的弹药:%1 + 以下剩餘的彈藥:%1 + Pozostała amunicja: %1 + 다음의 탄약이 남음 : %1 + + + There is no ammunition left. + Es ist keine Munition übrig. + Non ci sono munizioni rimanenti. + 弾薬は残っていません。 + 已经没有剩余的弹药了. + 已經沒有剩餘的彈藥了. + Brak amunicji w zapasie. + 여기에는 탄약이 남지 않았습니다. Rearm @@ -104,6 +226,8 @@ Réarmer 再武装 재보급 + 整装 + 整裝 Rearming %1 with %2... @@ -112,11 +236,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... %1を%2により再武装する。 %2을 %1에 재보급중... + %2正整装到%1中... + %2正整裝到%1中... Rearming %1... @@ -130,6 +256,8 @@ Réarmement de %1... %1を再武装中・・・ %1 재보급중... + 整装%1中... + 整裝%1中... Taking %1 for %2... @@ -143,6 +271,8 @@ Prend %1 pour %2... %1を%2のために取得しています・・・ %2를 위해 %1 가져오는중... + 拿取%1给%2中... + 拿取%1給%2中... Take ammo @@ -156,6 +286,8 @@ Prendre la munition 弾薬をとる 탄약 가지기 + 取得弹药 + 取得彈藥 Pick up ammo @@ -169,6 +301,8 @@ Ramasser la munition 弾薬を拾う 탄약 줍기 + 捡起弹药 + 撿起彈藥 Store ammo @@ -182,6 +316,8 @@ Stocker la munition 弾薬を戻す 탄약 보관하기 + 储存弹药 + 儲存彈藥 Storing %1 in %2... @@ -195,6 +331,8 @@ Stocke %1 dans %2... %1を%2へ戻しています・・・ %2에 %1 보관중... + 储存%1到%2中... + 儲存%1到%2中... Picking up ammo... @@ -207,6 +345,8 @@ Ramassage des munitions... 弾薬を拾っている・・・ 탄약 줍는중... + 捡起弹药中... + 撿起彈藥中... Rearmed %1 rounds of %2 on %3 @@ -220,6 +360,8 @@ %1 balles réarmées de %2 dans %3 %1発の%2を%3から装填した %3에 2%의 %1 탄약 재보급 + 整装了%1发%2到%3上 + 整裝了%1發%2到%3上 Smoke Screen @@ -233,6 +375,8 @@ Pantalla de humo 煙幕弾 연막 차장 + 烟幕弹 + 煙幕彈 Flares @@ -246,6 +390,8 @@ Bengalas フレア 기만체 + 热焰弹 + 熱焰彈 30mm HEI @@ -259,6 +405,8 @@ 30mm HEI 30mm 焼夷りゅう弾 30mm 고폭소이탄 + 30mm 高爆燃烧弹 + 30mm 高爆燃燒彈 30mm HEI-T @@ -272,6 +420,8 @@ 30mm HEI-T 30mm 焼夷曳光りゅう弾 30mm 고폭소이예광탄 + 30mm 高爆燃烧曳光弹 + 30mm 高爆燃燒曳光彈 AIM-9 Sidewinder @@ -285,6 +435,8 @@ AIM-9 Sidewinder AIM-9 サイドワインダー AIM-9 Sidewinder + AIM-9 响尾蛇 + AIM-9 響尾蛇 Wympel R-73 @@ -298,6 +450,8 @@ Wympel R-73 ヴィンペル R-73 Vympel R-73 + Wympel R-73 + Wympel R-73 AGM-65 Maverick @@ -311,6 +465,8 @@ AGM-65 Maverick AGM-65 マーベリック AGM-65 Maverick + AGM-65 小牛 + AGM-65 小牛 Kh-25MTP @@ -324,6 +480,8 @@ Kh-25MTP Kh-25MTP Kh-25MTP + Kh-25MTP + Kh-25MTP Hydra 70 HE @@ -335,8 +493,10 @@ Hydra 70 HE Hydra 70 HE Hydra 70 HE - ハイドラ 70 りゅう弾 + ハイドラ 70 HE Hydra 70 고폭탄 + 九头蛇 70 高爆弹 + 九頭蛇 70 高爆彈 S-8 HE @@ -348,8 +508,10 @@ S-8 HE S-8 HE S-8 HE - S-8 りゅう弾 + S-8 HE S-8 고폭탄 + S-8 高爆弹 + S-8 高爆彈 Hydra 70 AP @@ -361,8 +523,10 @@ Hydra 70 AP Hydra 70 AP Hydra 70 AP - ハイドラ 70 徹甲弾 + ハイドラ 70 AP Hydra 70 철갑탄 + 九头蛇 70 反人员弹 + 九頭蛇 70 反人員彈 S-8 AP @@ -374,8 +538,10 @@ S-8 AP S-8 AP S-8 AP - S-8 徹甲弾 + S-8 AP S-8 철갑탄 + S-8 反人员弹 + S-8 反人員彈 GBU-12 @@ -389,6 +555,8 @@ GBU-12 GBU-12 GBU-12 + GBU-12 + GBU-12 FAB-250M-54 @@ -402,6 +570,8 @@ FAB-250M-54 FAB-250M-54 FAB-250M-54 + FAB-250M-54 + FAB-250M-54 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..6904d33431 100644 --- a/addons/refuel/ACE_Settings.hpp +++ b/addons/refuel/ACE_Settings.hpp @@ -5,5 +5,13 @@ class ACE_Settings { description = CSTRING(RefuelSettings_speed_Description); value = 1; typeName = "SCALAR"; + sliderSettings[] = {0, 25, 1, 1}; + }; + class GVAR(hoseLength) { + category = ECSTRING(OptionsMenu,CategoryLogistics); + displayName = CSTRING(RefuelSettings_hoseLength_DisplayName); + value = 12; + typeName = "SCALAR"; + sliderSettings[] = {0, 50, 12, 1}; }; }; 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 104da38f71..cf4d590df8 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 = "alive _target"; \ - 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); \ }; \ }; \ @@ -103,13 +46,13 @@ class CBA_Extended_EventHandlers; class CfgVehicles { class ACE_Module; class ACE_moduleRefuelSettings: ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(RefuelSettings_Module_DisplayName); icon = QPATHTOF(ui\icon_module_refuel.paa); category = "ACE_Logistics"; function = QFUNC(moduleRefuelSettings); functionPriority = 1; - isGlobal = 0; + isGlobal = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); class Arguments { @@ -119,6 +62,11 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 10; }; + class hoseLength { + displayName = CSTRING(RefuelSettings_hoseLength_DisplayName); + typeName = "NUMBER"; + defaultValue = 12; + }; }; }; @@ -141,9 +89,7 @@ class CfgVehicles { class NonStrategic: Building {}; class HouseBase: NonStrategic {}; class House: HouseBase {}; - class House_F: House {}; - - class House_Small_F: House_F { + class House_F: House { class ACE_Actions { class ACE_MainActions { displayName = ECSTRING(interaction,MainAction); @@ -153,6 +99,7 @@ class CfgVehicles { }; }; }; + class House_Small_F: House_F {}; class AllVehicles: All { GVAR(flowRate) = 1; @@ -160,31 +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(canReceive) = 1; }; class Helicopter_Base_F: Helicopter {}; class Helicopter_Base_H: Helicopter_Base_F {}; class Plane: Air { - MACRO_CONNECT_ACTIONS + GVAR(canReceive) = 1; GVAR(flowRate) = 16; }; @@ -193,7 +136,7 @@ class CfgVehicles { class Ship: AllVehicles {}; class Ship_F: Ship { - MACRO_CONNECT_ACTIONS + GVAR(canReceive) = 1; GVAR(flowRate) = 4; }; @@ -211,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; @@ -297,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; }; @@ -322,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; }; @@ -408,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 {}; @@ -426,21 +374,21 @@ 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 Truck_02_water_base_F: Truck_02_fuel_base_F { + GVAR(fuelCargo) = REFUEL_DISABLED_FUEL; + }; 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; }; @@ -455,7 +403,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; }; @@ -463,19 +410,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 { @@ -491,27 +436,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 { 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 { 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 282b008fca..e4c5298036 100644 --- a/addons/refuel/XEH_PREP.hpp +++ b/addons/refuel/XEH_PREP.hpp @@ -1,30 +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(handlePlayerWeaponChanged); -PREP(handleUnconscious); +PREP(handleRespawn); +PREP(initSource); PREP(makeJerryCan); -PREP(maxDistanceDropNozzle); +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 3f20e5d30d..b2d55e1f7f 100644 --- a/addons/refuel/XEH_postInit.sqf +++ b/addons/refuel/XEH_postInit.sqf @@ -1,39 +1,110 @@ #include "script_component.hpp" -["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; -["weapon", FUNC(handlePlayerWeaponChanged)] call CBA_fnc_addPlayerEventHandler; - 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; -// workaround for static fuel stations -if (hasInterface) then { +if (!hasInterface) exitWith {}; + +["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), + {}, { - if ( - configName _x isKindOf "Building" && - {isClass (_x >> "ACE_Actions" >> "ACE_MainActions" >> QGVAR(Refuel))} && - {getNumber (_x >> "scope") == 2} - ) then { - TRACE_1("Compiling menu",configName _x); - [configName _x] call EFUNC(interact_menu,compileMenu); - }; - } count ('true' configClasses (configFile >> "CfgVehicles")); -}; + 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) +]; -#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]; +// 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_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 57514e4b8f..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} || - {([_unit, _target] call EFUNC(interaction,getInteractionDistance)) > 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 03cd79d3c6..0000000000 --- a/addons/refuel/functions/fnc_canConnectNozzle.sqf +++ /dev/null @@ -1,32 +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 || - {!alive _target} || - {_engine} || - {([_unit, _target] call EFUNC(interaction,getInteractionDistance)) > 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 04849c5ca0..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) && -{([_unit, _target] call EFUNC(interaction,getInteractionDistance)) < 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 b7ed8f0cb1..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])} || - {([_unit, _target] call EFUNC(interaction,getInteractionDistance)) > 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 21b700a757..fac88d6591 100644 --- a/addons/refuel/functions/fnc_dropNozzle.sqf +++ b/addons/refuel/functions/fnc_dropNozzle.sqf @@ -41,5 +41,5 @@ _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_handlePlayerWeaponChanged.sqf b/addons/refuel/functions/fnc_handlePlayerWeaponChanged.sqf deleted file mode 100644 index 57897aef89..0000000000 --- a/addons/refuel/functions/fnc_handlePlayerWeaponChanged.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: Jonpas - * Drops nozzle or jerry can when selecting a weapon. - * - * Arguments: - * 0: Unit - * 1: Weapon (unused) - * - * Return Value: - * None - * - * Example: - * [_unit, "gun"] call ace_refuel_fnc_handlePlayerWeaponChanged; - * - * Public: No -*/ -#include "script_component.hpp" - -params ["_unit"]; - -// Drop nozzle/jerry can when selecting a non-primary weapon -if (_unit getVariable [QGVAR(isRefueling), false]) then { - private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; - if !(isNull _nozzle) then { - [_unit, _nozzle] call FUNC(dropNozzle); - _unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; - [_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); - }; -}; 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 f42808d40a..96fc30adce 100644 --- a/addons/refuel/functions/fnc_makeJerryCan.sqf +++ b/addons/refuel/functions/fnc_makeJerryCan.sqf @@ -44,7 +44,7 @@ private _action = [QGVAR(Refuel), _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)}, {}, [], 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_maxDistanceDropNozzle.sqf b/addons/refuel/functions/fnc_maxDistanceDropNozzle.sqf deleted file mode 100644 index 2a23b5eb99..0000000000 --- a/addons/refuel/functions/fnc_maxDistanceDropNozzle.sqf +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Author: GitHawk, Jonpas - * Drops the nozzle at maximum hose distance. - * - * Arguments: - * 0: Unit - * 1: Fuel Truck - * 2: End Pos Offset - * 3: Nozzle (optional) - * - * Return Value: - * None - * - * Example: - * [player, fuelTruck, [0, 0, 0], nozzle] call ace_refuel_fnc_maxDistanceDropNozzle - * - * Public: No - */ -#include "script_component.hpp" - -params ["_unit", "_source", "_endPosOffset", "_nozzle"]; - -// Exit if jerry can (no maximum distance there as it's not connected to anything) -if (_nozzle getVariable [QGVAR(jerryCan), false]) exitWith {}; - -// Check distance periodically to drop it at maximum hose length -[{ - params ["_args", "_pfID"]; - _args params [ - ["_unit", player, [objNull]], - ["_source", objNull, [objNull]], - ["_endPosOffset", [0, 0, 0], [[]], 3], - ["_nozzle", (_args select 0) getVariable [QGVAR(nozzle), objNull], [objNull]] - ]; - - if (!(_unit getVariable [QGVAR(isRefueling), false])) exitWith { - TRACE_1("player not isRefueling",_unit); - [_pfID] call CBA_fnc_removePerFrameHandler; - }; - - 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; - } else { - [LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured); - }; - }; - [_pfID] call CBA_fnc_removePerFrameHandler; - }; -}, 0, [_unit, _target, _endPosOffset, _nozzle]] call CBA_fnc_addPerFrameHandler; 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 773d85e08d..f23e0aae5b 100644 --- a/addons/refuel/functions/fnc_refuel.sqf +++ b/addons/refuel/functions/fnc_refuel.sqf @@ -4,21 +4,24 @@ * * 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 _config = configFile >> "CfgVehicles" >> typeOf _target; +private _config = configFile >> "CfgVehicles" >> typeOf _sink; private _rate = getNumber (_config >> QGVAR(flowRate)) * GVAR(rate); private _maxFuel = getNumber (_config >> QGVAR(fuelCapacity)); @@ -40,28 +43,27 @@ if (_maxFuel == 0) then { 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); @@ -104,11 +106,11 @@ if (_maxFuel == 0) then { }; }, 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..95c853a217 --- /dev/null +++ b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf @@ -0,0 +1,114 @@ +/* + * 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); \ + [_unit, "blockThrow", "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 006c5e0942..5049adfee6 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,121 +18,82 @@ 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]; - - // Drop nozzle at maximum hose distance - [_unit, _target, _endPosOffset, _nozzle] call FUNC(maxDistanceDropNozzle); - }, - "", - 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; + 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 { + _helper setPosWorld (getPosWorld _source); + _helper setDir (getDir _source); + _helper setVectorUp (vectorUp _source); + }; + _nozzle setVariable [QGVAR(helper), _helper, true]; + _ropeTarget = _helper; }; - _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]; + 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]; - // Drop nozzle at maximum hose distance - private _target = _nozzle getVariable QGVAR(source); - private _endPosOffset = _nozzle getVariable QGVAR(attachPos); - [_unit, _target, _endPosOffset, _nozzle] call FUNC(maxDistanceDropNozzle); - }, - "", - localize LSTRING(TakeNozzleAction), - {true}, - ["isnotinside"] - ] call EFUNC(common,progressBar); -}; + [_source, "blockEngine", "ACE_Refuel", true] call EFUNC(common,statusEffect_set); + _source setVariable [QGVAR(isConnected), true, true]; + _source setVariable [QGVAR(ownedNozzle), _nozzle, true]; + }; + + _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, "blockThrow", "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 96006a2822..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, 299]; +#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 0bc50bb63d..00cdb7e308 100644 --- a/addons/refuel/stringtable.xml +++ b/addons/refuel/stringtable.xml @@ -13,6 +13,8 @@ Réglages de ravitaillement 給油設定 재급유 설정 + 加油设定 + 加油設定 Flow Rate @@ -26,6 +28,8 @@ Vitesse du ravitaillement 流量 주유량 + 油料流量 + 油料流量 How fast should a vehicle be refueled? @@ -37,8 +41,10 @@ Quanto velocemente dovrebbe essere rifornito un veicolo? Cuán rápido se reabastecen los vehículos? A quelle vitesse devrait être ravitaillé un véhicule ? - どのくらいの速さで車両へ給油しますか? + どのくらいの速さで車両へ給油しますか? 차량이 얼마나 빨리 재급유될 수 있습니까? + 载具多快会加油完毕? + 載具多快會加油完畢? Refuel @@ -52,6 +58,8 @@ Ravitaillement 給油 재급유 + 加油 + 加油 Take fuel nozzle @@ -65,6 +73,8 @@ Prendre la pompe 給油ノズルを取る 주유기 획득 + 拿取燃料喷嘴 + 拿取燃料噴嘴 Taking fuel nozzle... @@ -76,8 +86,10 @@ Prendendo manicotto benzina... Tomando surtidor... Prise de la pompe... - 給油ノズルを取っている・・・ + 給油ノズルを取っています・・・ 주유기 획득중... + 拿取燃料喷嘴中... + 拿取燃料噴嘴中... Connect fuel nozzle @@ -91,6 +103,8 @@ Connecter la pompe 給油ノズルを接続する 주유기 꼽기 + 连接燃料喷嘴 + 連接燃料噴嘴 Connecting fuel nozzle... @@ -102,8 +116,10 @@ Collegando manicotto benzina... Conectando surtidor... Connection de la pompe... - 給油ノズルを接続している・・・ + 給油ノズルを接続しています・・・ 주유기 꼽는중... + 连结燃料喷嘴中... + 連結燃料噴嘴中... Disconnect fuel nozzle @@ -117,6 +133,8 @@ Déconnecter la pompe 給油ノズルを外した 주유기 뽑기 + 断开燃料喷嘴 + 斷開燃料噴嘴 Connect @@ -130,6 +148,8 @@ Connecter 接続 꼽기 + 连结 + 連結 Check remaining fuel @@ -143,6 +163,8 @@ Vérifier le carburant restant 残燃料を見る 남은 연료 확인 + 检查剩余燃料 + 檢查剩餘燃料 Checking remaining fuel... @@ -154,8 +176,10 @@ Controllando la benzina rimanente... Verificando combustible remanente,,, Vérifie le carburant restant... - 残燃料を見ている・・・ + 残燃料を見ています・・・ 남은 연료 확인중... + 检查剩余燃料中... + 檢查剩餘燃料中... There are %1 liters left. @@ -169,6 +193,8 @@ Il reste %1 litres. 後 %1 リットル残っている。 %1 리터 남음 + 剩下%1公升的燃料。 + 剩下%1公升的燃料。 There is no fuel left. @@ -182,6 +208,8 @@ Il n'y a plus de carburant. もう燃料は残っていない。 연료 없음. + 没有剩余的燃料 + 沒有剩餘的燃料 Cancel @@ -195,6 +223,8 @@ Annuler 中止 취소 + 取消 + 取消 Failed @@ -208,6 +238,8 @@ Echoué 失敗 실패 + 失败 + 失敗 Stop fueling @@ -221,19 +253,8 @@ Arrêter le ravitaillement 給油をやめる 그만 재급유하기 - - - Stopping fueling... - Stoppe Betankung... - Zatrzymywanie tankowania... - Останавливаем заправку... - Parando reabastecimento... - Zastavuji tankování... - Fermando il rifornimento... - Deteniendo reabastecimiento... - Arrête le ravitaillement... - 給油をやめている・・・ - 재급유 그만하는중... + 停止加油 + 停止加油 Start fueling @@ -247,19 +268,17 @@ Débute le ravitaillement 給油を始める 재급유 시작 + 开始加油 + 開始加油 - - Starting fueling... - Beginne Betankung... - Rozpoczynanie tankowania... - Начинаем заправку... - Começando reabastecimento... - Spouštím tankování... - 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 @@ -273,6 +292,8 @@ %1 litres ravitaillés %1 リッターを給油した %1 리터 재급유됨 + 已加入%1公升的燃料 + 已加入%1公升的燃料 The fuel source is empty. @@ -285,7 +306,9 @@ La fuente de combustible está vacía. La source de carburant est vide. 給油元は空です。 - 재급유처가 비었음. + 燃料来源已空. + 燃料來源已空. + 연료공급처가 비었음. Maximum fuel hose length reached. @@ -299,6 +322,8 @@ Tuyau tendu au maximum 給油ホースはもうこれ以上届かない。 주유기 호스 최대 거리에 도달함. + 已加满至最大油量。 + 已加滿至最大油量。 Fueling completed @@ -312,6 +337,8 @@ Ravitaillement terminé 給油完了 재급유 완료함 + 加油完毕 + 加油完畢 Fueling stopped @@ -325,6 +352,8 @@ Ravitaillement stoppé 給油を止めた 재급유 멈춤 + 已停止加油 + 已停止加油 Fueling started @@ -338,6 +367,8 @@ Ravitaillement débuté 給油を始めた 재급유 시작함 + 已开始加油 + 已開始加油 Return fuel nozzle @@ -351,6 +382,8 @@ Retourner la pompe 給油ノズルを戻す 주유기 반환 + 放回燃料喷嘴 + 放回燃料噴嘴 Returning fuel nozzle... @@ -362,8 +395,10 @@ Riponendo la manica della benzina... Devolviendo el surtidor... Retourne la pompe - 給油ノズルを戻している・・・ + 給油ノズルを戻しています・・・ 주유기 반환중 + 放回燃料喷嘴中... + 放回燃料噴嘴中... Check fuel counter @@ -377,19 +412,8 @@ Vérifier le compteur 燃料計を見る 연로카운터 확인 - - - Checking fuel counter... - Betrachte Tankuhr... - Sprawdzanie wskaźnika paliwa... - Проверяем счетчик топлива... - Verificando contador de combustível... - Konroluji palivoměr... - Controllando l'indicatore del livello benzina... - Verificando el contador de combustible - Vérification du compteur... - 燃料計を見ている・・・ - 연료카운터 확인중... + 检查燃料表 + 檢查燃料表 %1 liters have been fueled. @@ -401,8 +425,62 @@ %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为无限油量) + 재급유에 사용 할 수 있는 연료량 (-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 + 設定加油軟管會安裝到模型的哪個位置上 + 设定加油软管会安装到模型的哪个位置上 + 재급유기 부착에 쓰이는 모델 좌표 diff --git a/addons/reload/ACE_Settings.hpp b/addons/reload/ACE_Settings.hpp index 72d26b46cf..82e9f32637 100644 --- a/addons/reload/ACE_Settings.hpp +++ b/addons/reload/ACE_Settings.hpp @@ -1,5 +1,6 @@ class ACE_Settings { class GVAR(displayText) { + category = ECSTRING(common,ACEKeybindCategoryWeapons); typeName = "BOOL"; isClientSettable = 1; value = 1; 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/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 4454bd3f9a..2a7764dc04 100644 --- a/addons/reload/stringtable.xml +++ b/addons/reload/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Conferir munição ao recarregar a arma 再装填された武器の弾薬を確認 재장전시 장탄수 확인 + 在重新装填时检查弹药 + 在重新裝填時檢查彈藥 Check the ammo in your new magazine on magazine reload. @@ -26,8 +28,10 @@ A lőszer ellenőrzése az új tárad behelyezésekor újratöltés közben. 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 @@ -42,6 +46,8 @@ Проверить боеприпасы 弾薬を確認 장탄수 확인 + 检查弹药 + 檢查彈藥 Ammo @@ -56,6 +62,8 @@ Боеприпасы 弾薬 장탄수 + 弹药 + 彈藥 Link belt @@ -68,8 +76,10 @@ Töltényheveder összekötése Attacca la tracolla Ligar cintos de munição - ベルト リンク + ベルトをつなげる 벨트 연결 + 连接弹链 + 連接彈鏈 Linking belt... @@ -82,8 +92,10 @@ Töltényheveder összekötése folyamatban... Attaccando la tracolla... Ligando cintos... - ベルトをつなげている・・・ + ベルトをつなげています・・・ 벨트 연결중... + 连接弹链中... + 連接彈鏈中... 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/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 c9ffa3cef8..eef4c9e50a 100644 --- a/addons/reloadlaunchers/stringtable.xml +++ b/addons/reloadlaunchers/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -12,8 +12,10 @@ Kilövö betöltése Carica lanciamissili Recarregar lançador - ランチャーを装填 + ランチャーに装填 무기 재장전 + 装载发射器 + 裝載發射器 Loading launcher... @@ -26,8 +28,10 @@ Kilövő betöltés alatt... Caricando il lanciamissili... Recarregando lançador... - ランチャーを装填している・・・ + ランチャーに装填中・・・ 무기 재장전중... + 装载发射器中... + 裝載發射器中... Launcher loaded @@ -40,8 +44,10 @@ Kilövő betöltve Lanciamissili caricato Lançador Carregado - ランチャーの装填完了 + ランチャーに装填完了 무기 재장전됨 + 发射器装载完毕 + 發射器裝載完畢 Load %1 @@ -54,8 +60,10 @@ %1 betöltése Caricato %1 Recarregar %1 - %1 へ装填 + %1 を装填 %1 장전 + 装载%1 + 裝載%1 diff --git a/addons/repair/ACE_Settings.hpp b/addons/repair/ACE_Settings.hpp index 46228e2e44..ea3994caec 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) { @@ -29,6 +29,7 @@ class ACE_Settings { typeName = "SCALAR"; value = 0.6; category = ECSTRING(OptionsMenu,CategoryLogistics); + sliderSettings[] = {0, 1, 0.6, 2}; }; class GVAR(repairDamageThreshold_engineer) { displayName = CSTRING(repairDamageThreshold_Engineer_name); @@ -36,6 +37,7 @@ class ACE_Settings { typeName = "SCALAR"; value = 0.4; category = ECSTRING(OptionsMenu,CategoryLogistics); + sliderSettings[] = {0, 1, 0.4, 2}; }; class GVAR(consumeItem_toolKit) { displayName = CSTRING(consumeItem_ToolKit_name); @@ -58,7 +60,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 c11f0b96b8..be92ec6689 100644 --- a/addons/repair/CfgEden.hpp +++ b/addons/repair/CfgEden.hpp @@ -21,7 +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)}; + strings[] = {"$STR_3DEN_Attributes_Lock_Default_text", CSTRING(AssignEngineerRole_role_none), CSTRING(AssignEngineerRole_role_engineer), CSTRING(AssignEngineerRole_role_advanced)}; }; }; }; @@ -63,6 +63,28 @@ class Cfg3DEN { condition = "(1 - objectBrain) * (1 - objectVehicle)"; defaultValue = 0; }; + class GVAR(editorLoadedTracks) { + displayName = CSTRING(editorLoadedTracks); + tooltip = CSTRING(editorLoadedTracks_tooltip); + property = QGVAR(editorLoadedTracks); + control = "Edit"; + expression = "_this setVariable ['%s',_value];"; + defaultValue = "[0,1] select (_this isKindOf 'Tank')"; // must match pre init script + validate = "number"; + condition = "objectHasInventoryCargo"; + typeName = "NUMBER"; + }; + class GVAR(editorLoadedWheels) { + displayName = CSTRING(editorLoadedWheels); + tooltip = CSTRING(editorLoadedWheels_tooltip); + property = QGVAR(editorLoadedWheels); + control = "Edit"; + expression = "_this setVariable ['%s',_value];"; + defaultValue = "[0,1] select (_this isKindOf 'Car')"; // must match pre init script + validate = "number"; + condition = "objectHasInventoryCargo"; + typeName = "NUMBER"; + }; }; }; }; diff --git a/addons/repair/CfgEditorSubcategories.hpp b/addons/repair/CfgEditorSubcategories.hpp new file mode 100644 index 0000000000..3010929ec5 --- /dev/null +++ b/addons/repair/CfgEditorSubcategories.hpp @@ -0,0 +1,5 @@ +class CfgEditorSubcategories { + class GVAR(subcategory) { + displayName = ECSTRING(main,Category_Logistics); + }; +}; 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/CfgMoves.hpp b/addons/repair/CfgMoves.hpp new file mode 100644 index 0000000000..4e42310851 --- /dev/null +++ b/addons/repair/CfgMoves.hpp @@ -0,0 +1,9 @@ +class CfgMovesBasic; +class CfgMovesMaleSdr: CfgMovesBasic { + class States { + class Campaign_Base; + class Acts_carFixingWheel: Campaign_Base { + soundOverride = ""; + }; + }; +}; diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index 178e8ecb12..a67b3035fc 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"}; \ }; \ }; \ }; @@ -20,7 +20,7 @@ class CBA_Extended_EventHandlers_base; class CfgVehicles { class ACE_Module; class ACE_moduleRepairSettings: ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(moduleName); icon = QPATHTOF(ui\Icon_Module_Repair_ca.paa); category = "ACE_Logistics"; @@ -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 { @@ -118,7 +118,7 @@ class CfgVehicles { class Module_F; class ACE_moduleAssignEngineerRoles: Module_F { - scope = 2; + scope = 1; displayName = CSTRING(AssignEngineerRole_Module_DisplayName); icon = QPATHTOF(ui\Icon_Module_Repair_ca.paa); category = "ACE_Logistics"; @@ -150,7 +150,7 @@ class CfgVehicles { default = 1; }; class doctor { - name = CSTRING(AssignEngineerRole_role_specialist); + name = CSTRING(AssignEngineerRole_role_advanced); value = 2; }; }; @@ -162,7 +162,7 @@ class CfgVehicles { }; }; class ACE_moduleAssignRepairVehicle: Module_F { - scope = 2; + scope = 1; displayName = CSTRING(AssignRepairVehicle_Module_DisplayName); icon = QPATHTOF(ui\Icon_Module_Repair_ca.paa); category = "ACE_Logistics"; @@ -234,7 +234,7 @@ class CfgVehicles { }; }; class ACE_moduleAddSpareParts: Module_F { - scope = 2; + scope = 1; displayName = CSTRING(AddSpareParts_Module_DisplayName); icon = QPATHTOF(ui\Icon_Module_Repair_ca.paa); category = "ACE_Logistics"; @@ -321,7 +321,8 @@ class CfgVehicles { accuracy = 0.2; vehicleClass = "ACE_Logistics_Items"; - destrType = "DesturctNo"; // scripted delayed destruction + editorCategory = "EdCat_Supplies"; + editorSubcategory = QGVAR(subcategory); }; class ACE_Track: ACE_RepairItem_Base { @@ -335,7 +336,7 @@ class CfgVehicles { mapSize = 0.5; // damage handling - armor = 0.6; + armor = 1000; armorStructural = 1; minTotalDamageThreshold = 0.01; explosionShielding = 1; @@ -350,6 +351,8 @@ class CfgVehicles { QPATHTO_R(data\trailObjects_steel_destruct.rvmat) }; }; + + editorPreview = QPATHTOF(data\preview_track.jpg); }; class ACE_Wheel: ACE_RepairItem_Base { @@ -364,7 +367,7 @@ class CfgVehicles { mapSize = 0.7; // damage handling - armor = 0.05; + armor = 120; armorStructural = 1; minTotalDamageThreshold = 0.01; explosionShielding = 1; @@ -396,6 +399,8 @@ class CfgVehicles { QPATHTO_R(data\trailObjects_steel_destruct.rvmat) }; }; + + editorPreview = QPATHTOF(data\preview_wheel.jpg); }; // disable vanilla repair 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_postInit.sqf b/addons/repair/XEH_postInit.sqf index 5c94924a5c..2f0bbe7869 100644 --- a/addons/repair/XEH_postInit.sqf +++ b/addons/repair/XEH_postInit.sqf @@ -5,14 +5,3 @@ // wheels [QGVAR(setWheelHitPointDamage), {(_this select 0) setHitPointDamage [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler; - -if (isServer) then { - ["ace_settingsInitialized", { - TRACE_1("ace_settingsInitialized eh", GVAR(addSpareParts)); - if (!GVAR(addSpareParts)) exitWith {}; - if (!(["ace_cargo"] call EFUNC(common,isModLoaded))) exitWith {}; - - ["Car", "Init", {[_this select 0, 1, "ACE_Wheel"] call FUNC(addSpareParts)}, true, [], true] call CBA_fnc_addClassEventHandler; - ["Tank", "Init", {[_this select 0, 1, "ACE_Track"] call FUNC(addSpareParts)}, true, [], true] call CBA_fnc_addClassEventHandler; - }] call CBA_fnc_addEventHandler; -}; diff --git a/addons/repair/XEH_preInit.sqf b/addons/repair/XEH_preInit.sqf index 8e6a606f0f..ca76ce5758 100644 --- a/addons/repair/XEH_preInit.sqf +++ b/addons/repair/XEH_preInit.sqf @@ -12,4 +12,27 @@ PREP_RECOMPILE_END; [{deleteVehicle _this}, _object, 5] call CBA_fnc_waitAndExecute; }] call CBA_fnc_addClassEventHandler; +// load tracks and wheels +if (isServer) then { + private _fnc_addSpareItems = { + if (!GVAR(addSpareParts)) exitWith {}; + params ["_vehicle"]; + + private _spareTracks = _vehicle getVariable QGVAR(editorLoadedTracks); + if (isNil "_spareTracks") then { + _spareTracks = [0, 1] select (_vehicle isKindOf "Tank"); // must match eden attribute default + }; + [_vehicle, _spareTracks, "ACE_Track"] call FUNC(addSpareParts); + + private _spareWheels = _vehicle getVariable QGVAR(editorLoadedWheels); + if (isNil "_spareWheels") then { + _spareWheels = [0, 1] select (_vehicle isKindOf "Car"); // must match eden attribute default + }; + [_vehicle, _spareWheels, "ACE_Wheel"] call FUNC(addSpareParts); + }; + + ["Tank", "initPost", _fnc_addSpareItems] call CBA_fnc_addClassEventHandler; + ["Car", "initPost", _fnc_addSpareItems] call CBA_fnc_addClassEventHandler; +}; + ADDON = true; diff --git a/addons/repair/config.cpp b/addons/repair/config.cpp index a8904a0a0a..8e71005eb2 100644 --- a/addons/repair/config.cpp +++ b/addons/repair/config.cpp @@ -16,7 +16,9 @@ class CfgPatches { #include "ACE_Repair.hpp" #include "ACE_Settings.hpp" -#include "CfgEventHandlers.hpp" #include "CfgActions.hpp" -#include "CfgVehicles.hpp" #include "CfgEden.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgMoves.hpp" +#include "CfgVehicles.hpp" +#include "CfgEditorSubcategories.hpp" diff --git a/addons/repair/data/ace_track.p3d b/addons/repair/data/ace_track.p3d index 53ac8971a7..83ffb9e675 100644 Binary files a/addons/repair/data/ace_track.p3d and b/addons/repair/data/ace_track.p3d differ diff --git a/addons/repair/data/preview_track.jpg b/addons/repair/data/preview_track.jpg new file mode 100644 index 0000000000..9ccae6e5f3 Binary files /dev/null and b/addons/repair/data/preview_track.jpg differ diff --git a/addons/repair/data/preview_wheel.jpg b/addons/repair/data/preview_wheel.jpg new file mode 100644 index 0000000000..fc290ed92e Binary files /dev/null and b/addons/repair/data/preview_wheel.jpg differ diff --git a/addons/repair/data/trailObjects_steel_damage.rvmat b/addons/repair/data/trailObjects_steel_damage.rvmat index 1850a7396c..f797f4ac61 100644 --- a/addons/repair/data/trailObjects_steel_damage.rvmat +++ b/addons/repair/data/trailObjects_steel_damage.rvmat @@ -38,10 +38,10 @@ class Stage3 { texture = "a3\data_f\destruct\damage_metal_mc.paa"; uvSource = "tex"; class uvTransform { - aside[] = {3,0,0}; - up[] = {0,3,0}; - dir[] = {0,0,0}; - pos[] = {0.1,0.23,0}; + aside[] = {3,0,0}; + up[] = {0,3,0}; + dir[] = {0,0,0}; + pos[] = {0.1,0.23,0}; }; }; 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 d2bb3adfee..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]; + private _name = format ["Remove_%1_%2", _forEachIndex, _hitpoint]; private _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 _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 6214b00df7..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); 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_moduleRepairSettings.sqf b/addons/repair/functions/fnc_moduleRepairSettings.sqf index cfd363e99f..4bbd505006 100644 --- a/addons/repair/functions/fnc_moduleRepairSettings.sqf +++ b/addons/repair/functions/fnc_moduleRepairSettings.sqf @@ -17,8 +17,6 @@ params ["_logic"]; -if (!isServer) exitWith {}; - [_logic, QGVAR(engineerSetting_Repair), "engineerSetting_Repair"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(engineerSetting_Wheel), "engineerSetting_Wheel"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(consumeItem_ToolKit), "consumeItem_ToolKit"] call EFUNC(common,readSettingFromModule); 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..aeaafb4f97 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,48 @@ 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; +private _soundPosition = AGLToASL (_caller modelToWorldVisual (_caller selectionPosition "RightHand")); +["Acts_carFixingWheel", _soundPosition, nil, 50] call EFUNC(common,playConfigSound3D); + +// 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 +227,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 db58c94448..c433b29f92 100644 --- a/addons/repair/functions/fnc_repair_failure.sqf +++ b/addons/repair/functions/fnc_repair_failure.sqf @@ -26,17 +26,15 @@ 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 { @@ -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 5196075735..c2fa40bfbb 100644 --- a/addons/repair/functions/fnc_repair_success.sqf +++ b/addons/repair/functions/fnc_repair_success.sqf @@ -26,17 +26,15 @@ 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 { @@ -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 d1926a47eb..bf19678a41 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -14,6 +14,8 @@ Запасная гусеница 予備履帯 예비 궤도 + 备用履带 + 備用履帶 Spare Wheel @@ -28,6 +30,8 @@ Запасное колесо 予備タイヤ 예비 바퀴 + 备用轮胎 + 備用輪胎 Change Wheel @@ -42,6 +46,8 @@ Vyměnit kolo タイヤを変える 바퀴 교체 + 更换轮胎 + 更換輪胎 Replacing Wheel... @@ -53,8 +59,10 @@ Cambiando rueda... Sostituendo la ruota... Remplacement de la roue... - タイヤを交換中・・・ + タイヤを交換しています・・・ 바퀴 교체중... + 更换轮胎中... + 更換輪胎中... Wheel replaced @@ -66,8 +74,10 @@ Rueda cambiada Ruota sostituita Roue remplacée - タイヤを履き替え + タイヤを交換した 바퀴 교체됨 + 轮胎更换完毕 + 輪胎更換完畢 Remove Wheel @@ -82,6 +92,8 @@ Снять колесо タイヤを外す 바퀴 제거 + 卸下轮胎 + 卸下輪胎 Removing Wheel... @@ -93,8 +105,10 @@ Quitando rueda... Rimuovendo la ruota... Démontage de la roue... - タイヤを外している・・ + タイヤを外しています・・・ 바퀴 제거중... + 卸下轮胎中... + 卸下輪胎中... Wheel removed @@ -108,6 +122,8 @@ Roue démontée タイヤを外した 바퀴 제거됨 + 轮胎卸下完毕 + 輪胎卸下完畢 Change Track @@ -121,6 +137,8 @@ Changer la chenille 履帯を変える 궤도 교체 + 更换履带 + 更換履帶 Replacing Track... @@ -132,8 +150,10 @@ Cambiando oruga... Sostituendo il cingolo... Remplacement de la chenille... - 履帯を交換中・・・ + 履帯を交換しています・・・ 궤도 교체중... + 更换履带中... + 更換履帶中... Track replaced @@ -147,6 +167,8 @@ Chenille remplacée 履帯を交換した 궤도 교체됨 + 履带更换完毕 + 履帶更換完畢 Remove Track @@ -160,6 +182,8 @@ Enlever la chenille 履帯を外す 궤도 제거 + 卸下履带 + 卸下履帶 Removing Track... @@ -171,8 +195,10 @@ Quitando oruga... Rimuovendo il cingolo... Enlèvement de la chenille... - 履帯を外している・・・ + 履帯を外しています・・・ 궤도 제거중... + 卸下履带中... + 卸下履帶中... Track removed @@ -186,6 +212,8 @@ Chenille enlevée 履帯を外した 궤도 제거됨 + 履带卸下完毕 + 履帶卸下完畢 Full Repair @@ -199,6 +227,8 @@ Réparations complètes 完全に修理 완전수리 + 完整维修 + 完整維修 Repairing Vehicle... @@ -210,8 +240,10 @@ Reparando vehículo... Riparando il veicolo... Réparation du véhicule... - 車両を修理中・・・ + 車両を修理しています・・・ 차량 수리중... + 维修载具中... + 維修載具中... Full Repair Locations @@ -223,8 +255,10 @@ Lugares de reparación completa Luoghi Riparazione Completa Lieu de réparation complète - 完全修理をできる場所 + 完全修理できる場所 완전수리 구역 + 完整维修地点 + 完整維修地點 At what locations can a vehicle be fully repaired? @@ -236,8 +270,10 @@ V které oblasti může být vozidlo plně opraveno? In quali luoghi è possibile riparare completamente un veicolo? Où peuvent être réparés complètement les véhicules ? - どのような場所で車両の完全な修理を出来るようにしますか? + どのような場所で車両の完全な修理を出来るようにしますか? 어느 구역에서 차량을 완전히 수리할 수 있게 합니까? + 什么位置可以完整维修载具? + 什麼位置可以完整維修載具? Allow Full Repair @@ -249,8 +285,10 @@ Permitir reparación completa Consenti Riparazione Completa Autoriser les réparations complètes. - 完全な修理をさせる + 完全修理を許可 완전 수리 활성화 + 允许完整维修 + 允許完整維修 Who can perform a full repair on a vehicle? @@ -262,8 +300,10 @@ Kdo může provést úplné opravy na vozidle? Chi può eseguire una riparazione completa su un veicolo? Qui peut faire une réparation complète ? - 誰が車両の完全な修理を出来るようにしますか? + 誰が車両の完全な修理を出来るようにしますか? 누가 완전 수리를 할 수 있습니까? + 谁可以完整维修载具? + 誰可以完整維修載具? Add Spare Parts @@ -277,6 +317,8 @@ Ajouter des pièces de rechange 予備部品を追加 예비 부품 더하기 + 添加备件 + 添加備件 Add spare parts to vehicles (requires Cargo component)? @@ -288,8 +330,10 @@ Přidat náhradní díly do vozidla (vyžaduje úložný prostor)? 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 @@ -304,6 +348,8 @@ Ремонт 修理 수리 + 维修 + 維修 Display text on repair @@ -317,6 +363,8 @@ Afficher du texte pendant la réparation 修理時に文章で通知する 수리시 화면에 글자 표시 + 显示维修文本 + 顯示維修文本 Display a notification whenever you repair a vehicle @@ -330,6 +378,8 @@ Afficher une notification lorsque l'on répare un véhicule あなたが車両の修理を始めると、画面に通知を出します 수리시 화면에 글자로 알림이 뜹니다 + 每当维修载具时显示通知 + 每當維修載具時顯示通知 Repairing... @@ -342,8 +392,10 @@ Riparando... javítása... Ремонтируем... - 修理中・・・ + 修理しています・・・ 수리중... + 维修中... + 維修中... Repairing %1... @@ -356,8 +408,10 @@ Riparando %1... %1 javítása... Ремонтируем %1... - %1 を修理中・・・ + %1 を修理しています・・・ %1 수리중... + 维修%1中... + 維修%1中... Repaired %1 @@ -372,6 +426,8 @@ %1 отремонтирован %1 を修理した %1 수리됨 + 已维修%1 + 已維修%1 Fully repaired part @@ -383,8 +439,10 @@ Parte totalmente reparado Parte riparata completamente Pièce entièrement réparée - 部分的な完全な修理 + 完全に修理された部品 부분 완벽히 수리됨 + 完整维修部分 + 完整維修部分 Partially repaired %1 @@ -398,6 +456,8 @@ %1 pratiquement réparée %1 を部分的に修理した %1 부분적으로 수리됨 + %1已完成部分维修 + %1已完成部分維修 Fully repaired %1 @@ -411,6 +471,8 @@ %1 entièrement réparée %1 を完全に修理した %1 완전히 수리됨 + %1已完整维修 + %1已完整維修 Partially repaired %1 @@ -424,6 +486,8 @@ %1 pratiquement réparée %1 を部分的に修理した %1 부분적으로 수리됨 + %1已完成部分维修 + %1已完成部分維修 Body @@ -438,6 +502,8 @@ Кузов 車体 몸체 + 车身 + 車身 Hull @@ -452,6 +518,8 @@ Корпус 機体 선체 + 车壳 + 車殼 Engine @@ -466,6 +534,8 @@ Двигатель エンジン 엔진 + 引擎 + 引擎 Left Horizontal Stabilizer @@ -479,6 +549,8 @@ Linkes Höhenleitwerk 左側の水平安定機 왼쪽 수평안정판 + 左侧悬挂稳定 + 左側懸掛穩定 Right Horizontal Stabilizer @@ -492,6 +564,8 @@ Rechtes Höhenleitwerk 右側の水平安定機 오른쪽 수평안정판 + 右侧悬挂稳定 + 右側懸掛穩定 Vertical Stabilizer @@ -503,8 +577,10 @@ Stabilizzatore Verticale Stabilisateur vertical Seitenleitwerk - 車両安定器 + 車両スタビライザ 수직 안정판 + 垂直稳定 + 垂直穩定 Fuel Tank @@ -519,6 +595,8 @@ Топливный бак 燃料タンク 연료 탱크 + 油箱 + 油箱 Transmission @@ -532,6 +610,8 @@ Instruments 変速機 변속기 + 变速箱 + 變速箱 Gear @@ -545,6 +625,8 @@ Trains d'attérissage ギア 기어 + 齿轮 + 齒輪 Starter @@ -558,6 +640,8 @@ Démarreur スターター 점화기 + 发动机 + 發動機 Tail @@ -571,6 +655,8 @@ Queue 尾翼 꼬리 + 尾翼 + 尾翼 Pitot Tube @@ -584,6 +670,8 @@ Sonde pitot ピトー管 동압관 + 空速管 + 空速管 Static Port @@ -597,6 +685,8 @@ Port statique スタティック ポート 정압공 + 静态端口 + 靜態端口 Ammo @@ -610,6 +700,8 @@ Munitions 弾薬 탄약 + 弹药 + 彈藥 Turret @@ -624,6 +716,8 @@ Башню 砲塔 포탑 + 炮塔 + 砲塔 Gun @@ -638,6 +732,8 @@ Пушку + + Missiles @@ -651,6 +747,8 @@ Missiles ミサイル 미사일 + 导弹 + 導彈 Left Track @@ -665,6 +763,8 @@ Левую гусеницу 左の履帯 왼쪽 궤도 + 左履带 + 左履帶 Right Track @@ -679,6 +779,8 @@ Правую гусеницу 右の履帯 오른쪽 궤도 + 右履带 + 右履帶 Left Front Wheel @@ -693,6 +795,8 @@ Левое переднее колесо 左の前輪 왼쪽 앞바퀴 + 左前轮 + 左前輪 Right Front Wheel @@ -707,6 +811,8 @@ Правое переднее колесо 右の前輪 오른쪽 앞바퀴 + 右前轮 + 右前輪 Second Left Front Wheel @@ -721,6 +827,8 @@ Второе переднее левое колесо 左の 2 つめの前輪 왼쪽 두번째 바퀴 + 第二左前轮 + 第二左前輪 Second Right Front Wheel @@ -735,6 +843,8 @@ Второе правое переднее колесо 右の 2 つめの前輪 오른쪽 두번째 바퀴 + 第二右前轮 + 第二右前輪 Left Middle Wheel @@ -749,6 +859,8 @@ Левое среднее колесо 左の中央の前輪 왼쪽 가운데 바퀴 + 左中轮 + 左中輪 Right Middle Wheel @@ -763,6 +875,8 @@ Правое среднее колесо 右の中央の前輪 오른족 가운데 바퀴 + 右中轮 + 右中輪 Left Rear Wheel @@ -777,6 +891,8 @@ Левое заднее колесо 左の後輪 왼쪽 뒤쪽 바퀴 + 左后轮 + 左後輪 Right Rear Wheel @@ -789,8 +905,10 @@ Ruota posteriore destra Jobb hátsó kerék Правое заднее колесо - 右の後 + 右の後輪 오른쪽 뒤쪽 바퀴 + 右后轮 + 右後輪 Avionics @@ -805,6 +923,8 @@ Авионику アビオニクス 항공 전자 + 航电系统 + 航電系統 Main Rotor @@ -819,6 +939,8 @@ Несущий винт 主翼 주 로터 + 主旋翼 + 主旋翼 Tail Rotor @@ -833,6 +955,8 @@ Рулевой винт 尾翼ローター 꼬리 로터 + 尾桨 + 尾槳 Winch @@ -846,6 +970,8 @@ Treuil ウィンチ 윈치 + 绞盘 + 絞盤 Glass (right) @@ -860,6 +986,8 @@ Стекло (справа) ガラス (右) 유리 (오른쪽) + 玻璃 (右) + 玻璃 (右) Glass (left) @@ -874,6 +1002,8 @@ Стекло (слава) ガラス (左) 유리 (왼쪽) + 玻璃 (左) + 玻璃 (左) Glass @@ -888,6 +1018,8 @@ Стекло ガラス 유리 + 玻璃 + 玻璃 ERA @@ -899,8 +1031,10 @@ ERA ERA ДЗ - 爆発反応装甲 + ERA 폭발반응장갑 + 爆炸式反应装甲 + 爆炸式反應裝甲 Repair Settings @@ -914,6 +1048,8 @@ Réglages de réparation 修理設定 수리 설정 + 修复设定 + 修復設定 Provides a repair system for all types of vehicles. @@ -925,8 +1061,10 @@ Poskytuje rozsáhlý systém oprav pro všechny typy vozidel. 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 @@ -940,6 +1078,8 @@ Tout le monde だれでも 모두 + 任何人 + 任何人 Engineer only @@ -953,21 +1093,20 @@ 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ół @@ -979,8 +1118,10 @@ Autoriser les roues タイヤを許可 바퀴 허가 + 允许轮胎 + 允許輪胎 - + Who can remove and replace wheels? Wer kann Radwechsel durchführern? Kto może zdejmować i zmieniać koła? @@ -990,10 +1131,12 @@ ¿Quién puede quitar y cambiar las ruedas? Chi può rimuovere e sostituire le ruote? Qui peut enlever et remplacer les roues ? - 誰がタイヤの除去と交換を出来るようにしますか? + 誰がタイヤの除去と交換を出来るようにしますか? 누가 바퀴를 제거 및 교체할 수 있습니까? + 谁可维修轮胎? + 誰可維修輪胎? - + Allow Repair Erlaube Reperatur Możliwość naprawy @@ -1005,8 +1148,10 @@ 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? @@ -1016,12 +1161,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 Лимит ремкомплекта @@ -1031,10 +1178,12 @@ 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? Какой максимальный урон можно починить с помощью ремкомплекта? @@ -1042,12 +1191,14 @@ Jaké maximální poškození může být opraveno pomocí opravárenské sady? 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) Лимит инженера @@ -1057,10 +1208,12 @@ 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? Какой максимальный урон может починить инженер? @@ -1068,8 +1221,10 @@ Jaké maximální poškození může být opraveno pomoci inženýra? 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 @@ -1083,6 +1238,8 @@ Enlever la trousse à outils après usage ツールキットを使うと削除 툴킷 사용후 제거 + 使用后删除工具包 + 使用後刪除工具包 Should the toolkit be removed on usage? @@ -1094,8 +1251,10 @@ Má být odstraněna sada nástroju po použití? Il Toolkit dev'essere rimosso dopo l'uso? La trousse à outils devrait-elle être enlevée après usage ? - ツールキットを使うと削除しますか? + ツールキットを使うと削除しますか? 툴킷을 사용하면 제거를 합니까? + 要在使用后删除工具包吗? + 要在使用後刪除工具包嗎? Anywhere @@ -1107,8 +1266,10 @@ En cualquier sitio Ovunque N'importe où - だれでも + どこでも 어디서나 + 任何地点 + 任何地點 Repair Vehicle only @@ -1122,6 +1283,8 @@ Véhicule de réparation seulement 修理車両のみ 오직 수리 차량만 + 维修载具旁 + 維修載具旁 Repair Facility only @@ -1135,6 +1298,8 @@ Installation de réparation seulement 修理施設のみ 오직 수리 시설만 + 维修设施旁 + 維修設施旁 Repair Facility or Vehicle @@ -1148,6 +1313,8 @@ Installations ou véhicule de réparation 修理施設または車両のみ 수리 시설혹은 차량 + 维修设施或载具旁 + 維修設施或載具旁 Assign Engineer @@ -1161,6 +1328,8 @@ Assigner le rôle d'ingénieur 工兵にする 정비공 등록 + 指派工兵 + 指派工兵 List @@ -1174,6 +1343,8 @@ Liste 一覧 목록 + 名单 + 名單 List of unit names that will be classified as engineer, separated by commas. @@ -1187,6 +1358,8 @@ Liste des noms d'unités qui seront considérées ingénieurs. Séparé par des virgules 一覧に記載されたユニット名を、工兵として指定します。コンマで複数を指定できます。 목록내 보직이름은 정비공으로 분류됩니다. 쉼표로 구분합니다. + 工兵名单,把单位名称输入在这边即可定义其为工兵。每个单位使用逗号以做区隔。 + 工兵名單,把單位名稱輸入在這邊即可定義其為工兵。每個單位使用逗號以做區隔。 Is Engineer @@ -1200,6 +1373,8 @@ Est ingénieur 工兵とする 은 정비공이다 + 是工兵 + 是工兵 Select the engineering skill level of the unit @@ -1213,6 +1388,8 @@ Sélectionner le niveau d'habilité en réparation de l'unité ユニットへの工兵スキルを選択 선택한 인원의 정비 실력을 고르십시요 + 选择工兵的技术水平 + 選擇工兵的技術水平 None @@ -1224,8 +1401,10 @@ Ningún Nessuna Aucun - 工兵 + なし 없음 + + Engineer @@ -1237,21 +1416,21 @@ 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 @@ -1265,6 +1444,8 @@ Assigner un ou plusieurs unités comme ingénieur 修理車両として指定 하나 혹은 여러 인원을 정비공으로 등록합니다 + 指定一个或多个单位为工兵 + 指定一個或多個單位為工兵 Assign Repair Vehicle @@ -1278,6 +1459,8 @@ Assigner en tant que véhicule de réparation 修理車両として指定 정비 차량 등록 + 指定维修载具 + 指定維修載具 List @@ -1291,6 +1474,8 @@ Liste 一覧 목록 + 名单 + 名單 List of vehicles that will be classified as repair vehicle, separated by commas. @@ -1304,6 +1489,8 @@ Liste de véhicules qui seront considérés comme véhicules de réparation. Séparé par des virgules. 一覧に記載されたユニット名を、修理車両として指定します。コンマで複数を指定できます。 목록내 차량은 정비 차량으로 분류됩니다. 쉼표로 구분합니다. + 载具名单,把载具名称输入在这边即可定义其为维修载具。每个载具使用逗号以做区隔。 + 載具名單,把載具名稱輸入在這邊即可定義其為維修載具。每個載具使用逗號以做區隔。 Is Repair Vehicle @@ -1317,6 +1504,8 @@ Est un véhicule de réparation 修理車両とする 은 정비 차량이다 + 是维修载具 + 是維修載具 Is the vehicle classified as a repair vehicle? @@ -1328,8 +1517,10 @@ Je vozidlo klasifikováno jako opravárenské? 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 @@ -1343,6 +1534,8 @@ Assigner un ou plusieurs véhicules en tant que véhicule de réparation 単体、または複数の車両を修理車両とします 하나 혹은 여러 차량을 정비 차량으로 등록합니다 + 指定一个或多个载具作为维修载具 + 指定一個或多個載具作為維修載具 Assign Repair Facility @@ -1356,6 +1549,8 @@ Assigner en tant qu'installation de réparation 修理施設とする 정비 시설 등록 + 指定维修设施 + 指定維修設施 List @@ -1369,6 +1564,8 @@ Liste 一覧 목록 + 名单 + 名單 List of objects that will be classified as repair Facility, separated by commas. @@ -1382,6 +1579,8 @@ Liste des objets considérés comme installations de réparation. Séparé par des virgules 一覧に記載されたユニット名を、修理施設として指定します。コンマで複数を指定できます。 목록내 시설은 정비 시설으로 분류됩니다. 쉼표로 구분합니다. + 设施名单,把设施名称输入在这边即可定义其为维修设施。每个设施使用逗号以做区隔。 + 設施名單,把設施名稱輸入在這邊即可定義其為維修設施。每個設施使用逗號以做區隔。 Is Repair Facility @@ -1395,6 +1594,8 @@ Est une installation de réparation 修理施設とする 은 정비 시설이다 + 是维修设施 + 是維修設施 Is the object classified as a repair Facility? @@ -1406,8 +1607,10 @@ Je objekt klasifikován jako opravárenské zařízení? 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 @@ -1421,6 +1624,8 @@ Assigner un ou plusieurs objets en tant que véhicule de réparation ひとつ、または複数オブジェクトに予備部品を追加 하나 혹은 여러 시설을 정비 시설로 등록합니다 + 指定一个或多个对象作为维修设施 + 指定一個或多個對象作為維修設施 Add Spare Parts @@ -1434,6 +1639,8 @@ Ajouter des pièces de rechange 予備部品を追加 예비 부품 더하기 + 添加备件 + 添加備件 Add spare parts to one or multiple objects @@ -1447,6 +1654,8 @@ Ajouter des pièces de rechange à un ou plusieurs objets 一覧に追加されたオブジェクトへ予備部品を与えます。コンマで複数を指定できます。 하나 혹은 여러 물체가 예비 부품을 더합니다 + 添加备件到一个或多个对象上 + 添加備件到一個或多個對象上 List @@ -1460,6 +1669,8 @@ Liste 一覧 목록 + 名单 + 名單 List of objects that will get spare parts added, separated by commas. @@ -1473,6 +1684,8 @@ Liste des objets qui recevront des pièces de réparation en plus. Séparé par des virgules 一覧に追加されたオブジェクトへ予備部品を与えます。コンマで複数を指定できます。 목록내 물체는 예비 부품을 받습니다, 쉼표로 구분합니다. + 添加备件到名单的载具上。每个载具使用逗号以做区隔。 + 添加備件到名單的載具上。每個載具使用逗號以做區隔。 Part @@ -1486,6 +1699,8 @@ Pièce 部品 부품 + 零件 + 零件 Spare part. @@ -1499,6 +1714,8 @@ Pièce de rechange 予備部品 예비 부품 + 备用零件 + 備用零件 Amount @@ -1512,6 +1729,8 @@ Quantité 수량 + 数量 + 數量 Number of selected spare parts. @@ -1525,6 +1744,8 @@ Nombre de pièces de rechange séléctionnées 選択された予備部品の数を選択します。 선택한 부품의 수 + 选择的备件数量 + 選擇的備件數量 Wheel repair requirements @@ -1538,6 +1759,8 @@ Exigences de réparation de roue タイヤの修理を必要 바퀴 교체 요구사항 + 维修轮胎限制 + 維修輪胎限制 Items required to remove/replace wheels @@ -1549,8 +1772,10 @@ Položka vyžaduje odstraněná/vyměněná kola Oggetti richiesti per riparare/rimuovere ruote Items exigés pour enlever/remplacer les roues - タイヤの除去と交換にアイテムを必要としますか? + タイヤの除去と交換にアイテムを必要としますか? 바퀴를 제거/교체하는데 필요한 물건 + 需要特定物品来移除/更换车轮 + 需要特定物品來移除/更換車輪 Engine must be off to repair @@ -1564,6 +1789,32 @@ Silnik musi być wyłączony w celu naprawy 수리를 위해서는 엔진을 꺼야만 합니다 Il motore deve essere spento per poter riparare + 引擎必须先关闭才能开始进行维修 + 引擎必須先關閉才能開始進行維修 + + + Spare Tracks + Ersatzketten + 予備履帯 + Cingoli di Scorta + + + Number of spare tracks in cargo. + Anzahl der Ersatzketten im Laderaum. + カーゴ内にある予備履帯の数を指定します。 + Numero dei cingoli di scorta nel cargo. + + + Spare Wheels + Ersatzreifen + 予備タイヤ + Ruote di Scorta + + + Number of spare wheels in cargo. + Anzahl der Ersatzreifen im Laderaum. + カーゴ内にある予備タイヤの数を指定します。 + Numero delle ruote di scorta nel cargo. 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/ACE_Settings.hpp b/addons/respawn/ACE_Settings.hpp index 7f0c4f9d96..d9dd41134e 100644 --- a/addons/respawn/ACE_Settings.hpp +++ b/addons/respawn/ACE_Settings.hpp @@ -1,19 +1,24 @@ class ACE_Settings { class GVAR(savePreDeathGear) { + category = CSTRING(DisplayName); displayName = CSTRING(SavePreDeathGear_DisplayName); description = CSTRING(SavePreDeathGear_Description); value = 0; typeName = "BOOL"; }; class GVAR(removeDeadBodiesDisconnected) { + category = CSTRING(DisplayName); displayName = CSTRING(RemoveDeadBodiesDisconnected_DisplayName); description = CSTRING(RemoveDeadBodiesDisconnected_Description); value = 1; typeName = "BOOL"; }; - class GVAR(bodyRemoveTimer) { - value = 0; - typeName = "SCALAR"; - }; + // Not used anywhere??? + // class GVAR(bodyRemoveTimer) { + // category = CSTRING(DisplayName); + // displayName = CSTRING(DeadBodyRemoveTimer); + // value = 0; + // typeName = "SCALAR"; + // }; }; diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index 103fab0537..847b32fe84 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -1,4 +1,3 @@ - class CBA_Extended_EventHandlers; class CfgVehicles { @@ -8,8 +7,8 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(Module_DisplayName); function = QFUNC(module); - scope = 2; - isGlobal = 0; + scope = 1; + isGlobal = 1; icon = QPATHTOF(UI\Icon_Module_Respawn_ca.paa); class Arguments { @@ -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/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 1d234f16be..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; }; 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 a2d90acce4..47a9f7b756 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -1,6 +1,13 @@  + + Respawn + Riapparizione + 重生 + 重生 + リスポン + Deploy in 5 seconds... Déploiement dans 5 secondes... @@ -14,6 +21,8 @@ Será posicionado em 5 segundos... 設置まであと 5 秒・・・ 5초 후 재배치... + 5秒后完成布署... + 5秒後完成佈署... Rallypoint deployed @@ -28,6 +37,8 @@ Rallypoints posicionado ラリーポイントを設置した 집결지 배치됨 + 集合点布署完成 + 集合點佈署完成 Teleport to Base @@ -42,6 +53,8 @@ Teleporta alla base ベースへ移動 기지로 순간이동 + 传送至基地 + 傳送至基地 Teleport to Rallypoint @@ -56,6 +69,8 @@ Teleporta al rallypoint ラリーポイントへ移動 집결지로 순간이동 + 传送至集合点 + 傳送至集合點 Teleported to Base @@ -70,6 +85,8 @@ Teletransportado para a Base ベースへ移動した 기지로 순간이동함 + 已传送至基地 + 已傳送至基地 Teleported to Rallypoint @@ -84,6 +101,8 @@ Teletransportado para o Rallypoints ラリーポイントへ移動した 집결지로 순간이동함 + 已传送至集合点 + 已傳送至集合點 Rallypoint West (Base) @@ -96,8 +115,10 @@ Gyülekezőpont, Nyugat (Bázis) Rallypoint Západ (Základna) Ponto de encontro Oeste (Base) - ラリーポイント ウエスト (ベース) - 서쪽 집결지 (기지) + ラリーポイント 同盟軍 (ベース) + 蓝方集合点 (基地) + 藍方集合點 (基地) + 청군 집결지 (기지) Rallypoint East (Base) @@ -110,8 +131,10 @@ Gyülekezőpont, Kelet (Bázis) Ralllypoint Východ (Základna) Ponto de encontro Lest (Base) - ラリーポイント イースト (ベース) - 동쪽 집결지 (기지) + ラリーポイント OPFOR軍 (ベース) + 红方集合点 (基地) + 紅方集合點 (基地) + 대항군 집결지 (기지) Rallypoint Independent (Base) @@ -124,8 +147,10 @@ Gyülekezőpont, Független (Bázis) Rallypoint Nezávislý (Základna) Ponto de encontro Independente (Base) - ラリーポイント インデペンデント (ベース) - 독립 집결지 (기지) + ラリーポイント 独立軍 (ベース) + 独立方集合点 (基地) + 獨立方集合點 (基地) + 독립군 집결지 (기지) Rallypoint West @@ -138,8 +163,10 @@ Gyülekezőpont, Nyugat Rallypoint Západ Ponto de encontro Oeste - ラリーポイント ウエスト - 서쪽 집결지 + ラリーポイント 同盟軍 + 蓝方集合点 + 藍方集合點 + 청군 집결지 Rallypoint East @@ -152,8 +179,10 @@ Gyülekezőpont, Kelet Rallypoint Východ Ponto de encontro Leste - ラリーポイント イースト - 동쪽 집결지 + ラリーポイント OPFOR軍 + 红方集合点 + 紅方集合點 + 대항군 집결지 Rallypoint Independent @@ -166,8 +195,10 @@ Gyülekezőpont, Független Rallypoint Nezávislý Ponto de encontro Independente - ラリーポイント インデペンデント - 독립 집결지 + ラリーポイント 独立軍 + 独立方集合点 + 獨立方集合點 + 독립군 집결지 Respawn System @@ -182,6 +213,8 @@ Sistema Respawn リスポン システム 재배치 시스템 + 重生系统 + 重生系統 Save Gear? @@ -194,8 +227,10 @@ Felszerelés elmentése? Сохранять снаряжение? Salva Equipaggiamento? - 装備を保存? + 装備を保存? 장비를 저장합니까? + 储存装备? + 儲存裝備? Respawn with the gear a soldier had just before his death? @@ -208,8 +243,10 @@ Az egység halála előtti felszerelésével való respawnolása? Возрождать солдата с тем же снаряжением, которое было на нем при смерти? Respawna con l'equipaggiamento che il soldato aveva appena prima di morire? - ユニットが死ぬ前に持っていた装備でリスポンしますか? + ユニットが死ぬ前に持っていた装備でリスポンしますか? 죽기 전에 가지고 있던 장비로 재배치합니까? + 是否在重生时载入死亡前的装备? + 是否在重生時載入死亡前的裝備? Remove bodies? @@ -222,8 +259,10 @@ Holttestek eltávolítása? Удалять трупы? Rimuovi corpi? - 死体を削除? + 死体を削除? 시체를 제거합니까? + 删除尸体? + 刪除屍體? Remove player bodies after disconnect? @@ -236,8 +275,17 @@ Játékosi testek eltávolítása távozás után? Удалять трупы игроков после дисконнекта? Rimuovi i corpi dei giocatori quando si disconnettono? - 切断後はプレイヤーの死体を削除しますか? + 切断後はプレイヤーの死体を削除しますか? 접속이 끊긴 플레이어의 시체를 제거합니까? + 要删除已离线的玩家尸体吗? + 要刪除已離線的玩家屍體嗎? + + + Body remove timer + Timer rimozione corpo + 屍體移除計時器 + 尸体移除计时器 + 死体削除タイマー This module enables you to configure ACE functionality specific to respawns. @@ -249,8 +297,10 @@ Ce module permet de régler les options de Respawn 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的重生功能 + 該模塊使您可以設定ACE的重生功能 Friendly Fire Messages @@ -265,6 +315,8 @@ 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. @@ -278,6 +330,8 @@ El usar este módulo, todas las muertes por fuego amigo serán indicadas en el chat. もし友軍誤射による死者が出た場合は、チャットにてその旨を表示します。 이 모듈은 미션 중 아군사격으로 인한 사망자 발생시 채팅창에 메세지를 표시해줍니다. + 摆放此模块后,当有发生友军误击致死的事件,会显示提示讯息在聊天视窗中。 + 擺放此模塊後,當有發生友軍誤擊致死的事件,會顯示提示訊息在聊天視窗中。 Rallypoint System @@ -292,6 +346,8 @@ 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. @@ -305,6 +361,8 @@ 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 @@ -319,6 +377,8 @@ Sposta Punto di Raccolta ラリーポイントを移動 집결지 이동 + 移动集合点 + 移動集合點 ACE Respawn @@ -333,6 +393,8 @@ Rigenerazione ACE ACE リスポン ACE 재배치 + ACE 重生 + ACE 重生 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/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 da93bfa671..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,10 +47,10 @@ 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 < 299 && {currentMuzzle _unit != _weapon || {currentWeaponMode _unit != _mode}} } do { @@ -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 d2c7ff3fd6..2e259bc9d3 100644 --- a/addons/safemode/stringtable.xml +++ b/addons/safemode/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Modo de segurança 安全装置 안전 모드 + 保险模式 + 保險模式 Take off Safety @@ -28,6 +30,8 @@ Tirar segurança 安全装置を外す 안전장치 해제 + 开保险 + 開保險 Put on Safety @@ -36,12 +40,14 @@ Zabezpieczono broń Zbraň zajistěna Biztonsági kapcsoló helyretolása - Поставить на предохранитель + Поставлено на предохранитель Sécurité mise Sicura inserita Colocar Segurança 安全装置を掛けた 안전장치 적용 + 关保险 + 關保險 Took off Safety @@ -50,12 +56,14 @@ Odbezpieczono broń Zbraň odjištěna Biztonságos mód megszüntetve - Снят с предохранителя + Снято с предохранителя Sécurité enlevée Sicura tolta Tirou Segurança 安全装置を外した 안전장치 해제됨 + 已开保险 + 已開保險 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/functions/fnc_deploy.sqf b/addons/sandbag/functions/fnc_deploy.sqf index af7d5c0a2f..da22483835 100644 --- a/addons/sandbag/functions/fnc_deploy.sqf +++ b/addons/sandbag/functions/fnc_deploy.sqf @@ -19,6 +19,7 @@ params ["_unit"]; // prevent the placing unit from running [_unit, "forceWalk", "ACE_Sandbag", true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_Sandbag", true] call EFUNC(common,statusEffect_set); // create the sandbag private _sandBag = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; diff --git a/addons/sandbag/functions/fnc_deployCancel.sqf b/addons/sandbag/functions/fnc_deployCancel.sqf index 6cb38e4f73..bd5e1a0d86 100644 --- a/addons/sandbag/functions/fnc_deployCancel.sqf +++ b/addons/sandbag/functions/fnc_deployCancel.sqf @@ -22,6 +22,7 @@ if (_key != 1 || {GVAR(deployPFH) == -1}) exitWith {}; // enable running again [_unit, "forceWalk", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); // delete placement dummy deleteVehicle GVAR(sandBag); diff --git a/addons/sandbag/functions/fnc_deployConfirm.sqf b/addons/sandbag/functions/fnc_deployConfirm.sqf index 68328cca67..29fca46f54 100644 --- a/addons/sandbag/functions/fnc_deployConfirm.sqf +++ b/addons/sandbag/functions/fnc_deployConfirm.sqf @@ -19,6 +19,7 @@ params ["_unit"]; // enable running again [_unit, "forceWalk", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); // remove sandbag from inventory _unit removeItem "ACE_Sandbag_empty"; 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 9a2b36e417..4559e43b00 100644 --- a/addons/sandbag/stringtable.xml +++ b/addons/sandbag/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Saco de Areia 土のう 모래주머니 + 沙包 + 沙包 Sandbag (empty) @@ -23,11 +25,13 @@ Saco de arena (vacio) Sac de sable (vide) Pytel na písek (prázdný) - Sacco di Sabbia (Vuoto) + Sacco di Sabbia (vuoto) Homokzsák (üres) Saco de Areia (vazio) 土のう (空) 모래주머니(비어있음) + 沙包 (空) + 沙包 (空) Cannot build here @@ -42,6 +46,8 @@ Não pode contruir aqui ここでは作れない 여기에 지을 수 없습니다 + 无法放置在此 + 無法放置在此 Pick up Sandbag @@ -56,6 +62,8 @@ Pegar saco de areia 土のうを拾う 모래주머니 줍기 + 捡起沙包 + 撿起沙包 Carry Sandbag @@ -70,6 +78,8 @@ Carregar saco de areia 土のうを運ぶ 모래주머니 옮기기 + 搬运沙包 + 搬運沙包 End Carrying @@ -84,6 +94,8 @@ Parar de carregar 下ろす 그만 옮기기 + 停止搬运 + 停止搬運 Drop Sandbag @@ -98,6 +110,8 @@ Derrubar saco de areia 土のうを落とす 여기에 놓기 + 放下沙包 + 放下沙包 Confirm Deployment @@ -112,6 +126,8 @@ Confirmar implantação ここで作る 설치 확인 + 确认布署 + 確認佈署 Cancel Deployment @@ -126,6 +142,8 @@ Cancelar implantação 作るのをやめる 설치 취소 + 取消布署 + 取消佈署 Deploy Sandbag @@ -140,6 +158,8 @@ Implantar saco de areia 土のうを設置 모래주머니 설치 + 布署沙包 + 佈署沙包 Sandbag Box @@ -154,6 +174,8 @@ Caixa de saco de areia 土のう入れ 모래주머니 상자 + 沙包箱 + 沙包箱 Here is no sand @@ -168,6 +190,8 @@ Aqui não tem areia ここに土は無い 흙이 없습니다 + 这里没有沙 + 這裡沒有沙 Rotate @@ -182,6 +206,8 @@ Bращать 回転 돌리기 + 旋转 + 旋轉 diff --git a/addons/scopes/ACE_Settings.hpp b/addons/scopes/ACE_Settings.hpp index 6ff483cb50..04e0e92ffb 100644 --- a/addons/scopes/ACE_Settings.hpp +++ b/addons/scopes/ACE_Settings.hpp @@ -1,5 +1,6 @@ class ACE_Settings { class GVAR(enabled) { + category = CSTRING(DisplayName); typeName = "BOOL"; value = 1; displayName = CSTRING(enabled_displayName); @@ -7,6 +8,7 @@ class ACE_Settings { }; // ACE_ScopeAdjust_Vertical and ACE_ScopeAdjust_Horizontal will be populated with default values instead of [0,0] class GVAR(forceUseOfAdjustmentTurrets) { + category = CSTRING(DisplayName); typeName = "BOOL"; value = 0; displayName = CSTRING(forceUseOfAdjustmentTurrets_displayName); @@ -15,6 +17,7 @@ class ACE_Settings { // Auto corrects the zeroing in both vanilla- and advanced ballistics class GVAR(correctZeroing) { + category = CSTRING(DisplayName); typeName = "BOOL"; value = 1; displayName = CSTRING(correctZeroing_displayName); @@ -22,6 +25,7 @@ class ACE_Settings { }; // Enables the use of the 'defaultZeroRange' setting to overwrite the discreteDistance[] config class GVAR(overwriteZeroRange) { + category = CSTRING(DisplayName); typeName = "BOOL"; value = 0; displayName = CSTRING(overwriteZeroRange_displayName); @@ -29,35 +33,61 @@ class ACE_Settings { }; // Only affects scopes with elevation adjustment turrets (ACE_ScopeAdjust_Vertical != [0,0]) class GVAR(defaultZeroRange) { + category = CSTRING(DisplayName); typeName = "SCALAR"; value = 100; displayName = CSTRING(defaultZeroRange_displayName); description = CSTRING(defaultZeroRange_description); + sliderSettings[] = {0, 1000, 100, 0}; }; // Only relevant when advanced ballistics is enabled class GVAR(zeroReferenceTemperature) { + category = CSTRING(DisplayName); typeName = "SCALAR"; value = 15; displayName = CSTRING(zeroReferenceTemperature_displayName); description = CSTRING(zeroReferenceTemperature_description); + sliderSettings[] = {-55, 55, 15, 0}; }; class GVAR(zeroReferenceBarometricPressure) { + category = CSTRING(DisplayName); typeName = "SCALAR"; value = 1013.25; displayName = CSTRING(zeroReferenceBarometricPressure_displayName); description = CSTRING(zeroReferenceBarometricPressure_description); + sliderSettings[] = {0, 1013.25, 1013.25, 2}; }; class GVAR(zeroReferenceHumidity) { + category = CSTRING(DisplayName); typeName = "SCALAR"; - value = 0.5; + value = 0.0; displayName = CSTRING(zeroReferenceHumidity_displayName); description = CSTRING(zeroReferenceHumidity_description); + sliderSettings[] = {0, 1, 0, 2}; }; class GVAR(deduceBarometricPressureFromTerrainAltitude) { + category = CSTRING(DisplayName); typeName = "BOOL"; value = 0; displayName = CSTRING(deduceBarometricPressureFromTerrainAltitude_displayName); description = CSTRING(deduceBarometricPressureFromTerrainAltitude_description); }; + + class GVAR(useLegacyUI) { + category = CSTRING(DisplayName); + typeName = "BOOL"; + value = 0; + isClientSettable = 1; + displayName = CSTRING(useLegacyUI_displayName); + description = CSTRING(useLegacyUI_description); + }; + + class GVAR(simplifiedZeroing) { + category = CSTRING(DisplayName); + typeName = "BOOL"; + value = 0; + displayName = CSTRING(simplifiedZeroing_displayName); + description = CSTRING(simplifiedZeroing_description); + }; }; diff --git a/addons/scopes/CfgVehicles.hpp b/addons/scopes/CfgVehicles.hpp index fd2a7d01c6..b1e76d4401 100644 --- a/addons/scopes/CfgVehicles.hpp +++ b/addons/scopes/CfgVehicles.hpp @@ -11,14 +11,24 @@ class CfgVehicles { showDisabled = 0; priority = 0.2; //icon = QPATHTOF(UI\...); // TODO - exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; + exceptions[] = {"notOnMap", "isNotInside", "isNotSwimming", "isNotSitting"}; + }; + class GVAR(resetZero) { + // Updates the zero reference + displayName = CSTRING(ResetZero); + condition = QUOTE([ACE_player] call FUNC(canResetZero)); + statement = QUOTE([ACE_player] call FUNC(resetZero)); + showDisabled = 0; + priority = 0.2; + //icon = QPATHTOF(UI\...); // TODO + exceptions[] = {"notOnMap", "isNotInside", "isNotSwimming", "isNotSitting"}; }; }; }; }; class ACE_Module; class GVAR(ModuleSettings): ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(DisplayName); //icon = ""; // needs an icon category = "ACE"; @@ -74,7 +84,7 @@ class CfgVehicles { displayName = CSTRING(zeroReferenceHumidity_DisplayName); description = CSTRING(zeroReferenceHumidity_Description); typeName = "NUMBER"; - defaultValue = 0.5; + defaultValue = 0.0; }; class deduceBarometricPressureFromTerrainAltitude { displayName = CSTRING(deduceBarometricPressureFromTerrainAltitude_DisplayName); @@ -82,6 +92,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 0; }; + class simplifiedZeroing { + displayName = CSTRING(simplifiedZeroing_displayName); + description = CSTRING(simplifiedZeroing_description); + typeName = "BOOL"; + defaultValue = 0; + }; }; class ModuleDescription { description = CSTRING(Description); diff --git a/addons/scopes/CfgWeapons.hpp b/addons/scopes/CfgWeapons.hpp index 43a4b24639..2a5be51ee0 100644 --- a/addons/scopes/CfgWeapons.hpp +++ b/addons/scopes/CfgWeapons.hpp @@ -1,57 +1,61 @@ +class Mode_SemiAuto; +class Mode_Burst; +class Mode_FullAuto; + class CfgWeapons { class ItemCore; class InventoryOpticsItem_Base_F; class optic_Yorris : ItemCore { - ACE_ScopeHeightAboveRail = 0.4; + ACE_ScopeHeightAboveRail = 2.77224; }; class optic_MRD : ItemCore { - ACE_ScopeHeightAboveRail = 0.6; + ACE_ScopeHeightAboveRail = 2.8; }; class optic_Aco : ItemCore { - ACE_ScopeHeightAboveRail = 1.8; + ACE_ScopeHeightAboveRail = 3.69248; }; class optic_ACO_grn : ItemCore { - ACE_ScopeHeightAboveRail = 1.8; + ACE_ScopeHeightAboveRail = 3.69248; }; class optic_ACO_grn_smg : ItemCore { - ACE_ScopeHeightAboveRail = 1.8; + ACE_ScopeHeightAboveRail = 3.69248; }; class optic_ACO_smg : ItemCore { - ACE_ScopeHeightAboveRail = 1.8; + ACE_ScopeHeightAboveRail = 3.69248; }; class optic_Holosight : ItemCore { - ACE_ScopeHeightAboveRail = 2.4; + ACE_ScopeHeightAboveRail = 4.66933; }; class optic_Holosight_smg : ItemCore { - ACE_ScopeHeightAboveRail = 2.4; + ACE_ScopeHeightAboveRail = 4.66933; }; class optic_Arco : ItemCore { - ACE_ScopeHeightAboveRail = 3.0; + ACE_ScopeHeightAboveRail = 4.89287; }; class optic_ERCO_blk_F : optic_Arco { - ACE_ScopeHeightAboveRail = 2.6; + ACE_ScopeHeightAboveRail = 3.48836; }; class optic_Hamr : ItemCore { - ACE_ScopeHeightAboveRail = 3.2; + ACE_ScopeHeightAboveRail = 4.48584; }; class optic_MRCO : ItemCore { - ACE_ScopeHeightAboveRail = 2.5; + ACE_ScopeHeightAboveRail = 3.88405; }; class optic_Nightstalker : ItemCore { - ACE_ScopeHeightAboveRail = 4.2; + ACE_ScopeHeightAboveRail = 5.54325; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -67,7 +71,7 @@ class CfgWeapons { }; class optic_NVS : ItemCore { - ACE_ScopeHeightAboveRail = 4.2; + ACE_ScopeHeightAboveRail = 5.54325; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -83,7 +87,7 @@ class CfgWeapons { }; class optic_TWS : ItemCore { - ACE_ScopeHeightAboveRail = 4.2; + ACE_ScopeHeightAboveRail = 5.52874; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -99,7 +103,7 @@ class CfgWeapons { }; class optic_LRPS : ItemCore { - ACE_ScopeHeightAboveRail = 4.0; + ACE_ScopeHeightAboveRail = 4.2098; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -119,7 +123,7 @@ class CfgWeapons { }; class optic_SOS : ItemCore { - ACE_ScopeHeightAboveRail = 3.8; + ACE_ScopeHeightAboveRail = 4.41328; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -135,7 +139,7 @@ class CfgWeapons { }; class optic_DMS : ItemCore { - ACE_ScopeHeightAboveRail = 3.6; + ACE_ScopeHeightAboveRail = 3.86253; ACE_ScopeAdjust_Vertical[] = {-4, 20}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -151,7 +155,7 @@ class CfgWeapons { }; class optic_AMS_base : ItemCore { - ACE_ScopeHeightAboveRail = 3.6; + ACE_ScopeHeightAboveRail = 3.8933; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -171,7 +175,7 @@ class CfgWeapons { }; class optic_KHS_base : ItemCore { - ACE_ScopeHeightAboveRail = 4.0; + ACE_ScopeHeightAboveRail = 4.30723; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -191,7 +195,7 @@ class CfgWeapons { }; class optic_KHS_old : ItemCore { - ACE_ScopeHeightAboveRail = 4.0; + ACE_ScopeHeightAboveRail = 4.30723; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -209,4 +213,224 @@ 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; + ACE_IronSightBaseAngle = -0.00160721; + }; + + 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; + ACE_IronSightBaseAngle = 0.216372; + }; + class arifle_MXM_F: arifle_MX_Base_F { + ACE_RailHeightAboveBore = 2.40323; + ACE_IronSightBaseAngle = 0.157545; + }; + + class arifle_SPAR_01_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 3.20768; + ACE_IronSightBaseAngle = -0.166678; + }; + class arifle_SPAR_02_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 3.22175; + ACE_IronSightBaseAngle = -0.184641; + }; + class arifle_SPAR_03_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 3.71491; + ACE_IronSightBaseAngle = -0.134908; + }; + + class LMG_Mk200_F: Rifle_Long_Base_F { + ACE_RailHeightAboveBore = 2.68925; + ACE_IronSightBaseAngle = 0.0182228; + }; + class LMG_Zafir_F: Rifle_Long_Base_F { + ACE_RailHeightAboveBore = 0.996651; + ACE_IronSightBaseAngle = 0.19812212; + }; + class LMG_03_base_F: Rifle_Long_Base_F { + ACE_RailHeightAboveBore = 4.24282; + ACE_IronSightBaseAngle = 0.00181939; + }; + + class pdw2000_base_F: Rifle_Short_Base_F { + ACE_RailHeightAboveBore = 3.08883; + ACE_RailBaseAngle = 0.019366; + ACE_IronSightBaseAngle = 0.0399664; + }; + + class arifle_AKS_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 0; + ACE_IronSightBaseAngle = 0.00574991; + }; + class arifle_AKM_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 0; + ACE_IronSightBaseAngle = 0.006273; + }; + class arifle_AK12_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 3.82508; + ACE_IronSightBaseAngle = 0.0276926; + }; + class arifle_CTAR_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 6.07588; + ACE_IronSightBaseAngle = 0.0151815; + }; + class arifle_CTARS_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 6.0787; + ACE_IronSightBaseAngle = 0.0125245; + }; + class arifle_ARX_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 2.81635; + ACE_IronSightBaseAngle = 0.113024; + }; + + class arifle_katiba_Base_F: Rifle_Base_F {}; + + class arifle_Katiba_F: arifle_katiba_Base_F { + ACE_RailHeightAboveBore = 5.75468; + ACE_IronSightBaseAngle = 0.0863227; + }; + class arifle_Katiba_C_F: arifle_katiba_Base_F { + ACE_RailHeightAboveBore = 5.75468; + ACE_IronSightBaseAngle = 0.083419; + }; + class arifle_Katiba_GL_F: arifle_katiba_Base_F { + ACE_RailHeightAboveBore = 5.75468; + ACE_IronSightBaseAngle = 0.0863227; + }; + + class arifle_MX_F: arifle_MX_Base_F { + ACE_RailHeightAboveBore = 2.80201; + ACE_IronSightBaseAngle = 0.19502; + }; + class arifle_MX_GL_F: arifle_MX_Base_F { + ACE_RailHeightAboveBore = 2.80201; + ACE_IronSightBaseAngle = 0.17142857; + }; + + class arifle_MXC_F: arifle_MX_Base_F { + ACE_RailHeightAboveBore = 2.40874; + ACE_IronSightBaseAngle = 0.0154129; + }; + + class SDAR_base_F: Rifle_Base_F {}; + + class arifle_SDAR_F: SDAR_base_F { + ACE_RailHeightAboveBore = 0; + ACE_IronSightBaseAngle = -0.0237516; + }; + + class SMG_01_Base: Rifle_Short_Base_F { + ACE_RailHeightAboveBore = 4.85355; + ACE_RailBaseAngle = 0.0250956; + ACE_IronSightBaseAngle = -0.159239; + }; + class SMG_02_base_F: Rifle_Short_Base_F { + ACE_RailHeightAboveBore = 4.41831; + ACE_RailBaseAngle = 0.0217724; + ACE_IronSightBaseAngle = 0.434847; + }; + class SMG_05_base_F: Rifle_Short_Base_F { + ACE_RailHeightAboveBore = 4.05169; + ACE_RailBaseAngle = 0.019366; + ACE_IronSightBaseAngle = -0.122823; + }; + + class Tavor_base_F: Rifle_Base_F {}; + + class arifle_TRG20_F: Tavor_base_F { + ACE_RailHeightAboveBore = 4.30954; + ACE_IronSightBaseAngle = 0.0338428; + }; + class arifle_TRG21_F: Tavor_base_F { + ACE_RailHeightAboveBore = 4.30954; + ACE_IronSightBaseAngle = 0.0317759; + }; + class arifle_TRG21_GL_F: arifle_TRG21_F { + ACE_RailHeightAboveBore = 4.30954; + ACE_IronSightBaseAngle = -0.03428571; + }; + + class mk20_base_F: Rifle_Base_F {}; + + class arifle_Mk20_F: mk20_base_F { + ACE_RailHeightAboveBore = 4.57255; + ACE_IronSightBaseAngle = -0.153292; + }; + class arifle_Mk20C_F: mk20_base_F { + ACE_RailHeightAboveBore = 4.41539; + ACE_IronSightBaseAngle = -0.137835; + }; + class arifle_Mk20_GL_F: mk20_base_F { + ACE_RailHeightAboveBore = 4.41539; + ACE_IronSightBaseAngle = -0.1532926; + }; + + 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; + ACE_IronSightBaseAngle = -0.00601782; + }; + class srifle_LRR_F: LRR_base_F { + ACE_RailHeightAboveBore = 3.20864; + ACE_IronSightBaseAngle = -0.0302847; + }; + class srifle_GM6_F: GM6_base_F { + ACE_RailHeightAboveBore = 4.75572; + ACE_IronSightBaseAngle = -0.165062; + }; + class srifle_DMR_01_F: DMR_01_base_F { + ACE_RailHeightAboveBore = 2.83284; + ACE_IronSightBaseAngle = 0.234393; + }; + class srifle_DMR_02_F: DMR_02_base_F { + ACE_RailHeightAboveBore = 3.43913; + ACE_IronSightBaseAngle = 0.013878; + }; + class srifle_DMR_03_F: DMR_03_base_F { + ACE_RailHeightAboveBore = 4.0795; + ACE_IronSightBaseAngle = 0.0138099; + }; + class srifle_DMR_04_F: DMR_04_base_F { + ACE_RailHeightAboveBore = 2.38022; + ACE_RailBaseAngle = 0.0171842; + }; + class srifle_DMR_05_blk_F: DMR_05_base_F { + ACE_RailHeightAboveBore = 3.91334; + ACE_IronSightBaseAngle = 0.0123425; + }; + class srifle_DMR_06_camo_F: DMR_06_base_F { + ACE_RailHeightAboveBore = 3.27488; + ACE_IronSightBaseAngle = 0.018227; + }; + + class MMG_01_base_F; + class MMG_02_base_F; + + class MMG_01_hex_F: MMG_01_base_F { + ACE_RailHeightAboveBore = 4.73961; + ACE_IronSightBaseAngle = -0.0101613; + }; + class MMG_02_camo_F: MMG_02_base_F { + ACE_RailHeightAboveBore = 5.01913; + ACE_IronSightBaseAngle = 0.0136377; + }; }; diff --git a/addons/scopes/RscTitles.hpp b/addons/scopes/RscTitles.hpp index 1a4bcc99c3..a15cbbed67 100644 --- a/addons/scopes/RscTitles.hpp +++ b/addons/scopes/RscTitles.hpp @@ -51,7 +51,7 @@ class RscTitles { class ACE_Scopes_Zeroing_Horizontal : RscText { idc = 13; type = 0; - style = 0; + style = 2; sizeEx = 0.04; lineSpacing = 1; font = "RobotoCondensed"; @@ -62,7 +62,7 @@ class RscTitles { x = (0.5 - 0.4 / 2 + 0.6*0.4) * safezoneW + safezoneX; y = (0 + 0.47*0.3) * safezoneH + safezoneY; - w = 0.04 * safezoneW; + w = 0.019 * safezoneW; h = 0.025 * safezoneH; }; }; diff --git a/addons/scopes/XEH_PREP.hpp b/addons/scopes/XEH_PREP.hpp index a8489fe585..58b4e494f2 100644 --- a/addons/scopes/XEH_PREP.hpp +++ b/addons/scopes/XEH_PREP.hpp @@ -4,10 +4,13 @@ PREP(adjustZero); PREP(applyScopeAdjustment); PREP(calculateZeroAngleCorrection); PREP(canAdjustZero); +PREP(canResetZero); PREP(firedEH); +PREP(getBaseAngle); PREP(getBoreHeight); PREP(getCurrentZeroRange); PREP(getOptics); PREP(initModuleSettings); PREP(inventoryCheck); +PREP(resetZero); PREP(showZeroing); diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 0145bfcb66..075ea48a76 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -13,13 +13,12 @@ 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]]; ["ace_settingsInitialized", { if (!GVAR(enabled)) exitWith {}; - + if (GVAR(deduceBarometricPressureFromTerrainAltitude)) then { GVAR(zeroReferenceBarometricPressure) = 1013.25 * (1 - (0.0065 * EGVAR(common,mapAltitude)) / 288.15) ^ 5.255754495; }; @@ -45,7 +44,7 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; // Add keybinds ["ACE3 Scope Adjustment", QGVAR(AdjustUpMinor), localize LSTRING(AdjustUpMinor), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; @@ -57,7 +56,7 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; ["ACE3 Scope Adjustment", QGVAR(AdjustDownMinor), localize LSTRING(AdjustDownMinor), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; @@ -69,7 +68,7 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; ["ACE3 Scope Adjustment", QGVAR(AdjustLeftMinor), localize LSTRING(AdjustLeftMinor), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; @@ -81,7 +80,7 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; ["ACE3 Scope Adjustment", QGVAR(AdjustRightMinor), localize LSTRING(AdjustRightMinor), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; @@ -93,7 +92,7 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; ["ACE3 Scope Adjustment", QGVAR(AdjustUpMajor), localize LSTRING(AdjustUpMajor), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; @@ -105,7 +104,7 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; ["ACE3 Scope Adjustment", QGVAR(AdjustDownMajor), localize LSTRING(AdjustDownMajor), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; @@ -117,7 +116,7 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; ["ACE3 Scope Adjustment", QGVAR(AdjustLeftMajor), localize LSTRING(AdjustLeftMajor), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; @@ -129,7 +128,7 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; ["ACE3 Scope Adjustment", QGVAR(AdjustRightMajor), localize LSTRING(AdjustRightMajor), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; @@ -143,5 +142,5 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; // 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/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index a16568b0d9..8c48ee654b 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -17,26 +17,26 @@ */ #include "script_component.hpp" -private ["_weaponIndex", "_zeroing", "_optic", "_opticConfig", "_verticalIncrement", "_horizontalIncrement", "_maxVertical", "_maxHorizontal", "_adjustment"]; - params ["_unit", "_turretAndDirection", "_majorStep"]; +TRACE_3("adjustScope",_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), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; - +TRACE_2("",GVAR(canAdjustElevation),GVAR(canAdjustWindage)); 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}; +if (!(GVAR(canAdjustWindage) select _weaponIndex) && (_turretAndDirection in [WINDAGE_LEFT, WINDAGE_RIGHT])) exitWith {false}; -_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"]; (GVAR(scopeAdjust) select _weaponIndex) params ["_maxVertical", "_verticalIncrement", "_maxHorizontal", "_horizontalIncrement"]; +TRACE_4("",_maxVertical,_verticalIncrement,_maxHorizontal,_horizontalIncrement); switch (_turretAndDirection) do { case ELEVATION_UP: { _elevation = _elevation + _verticalIncrement }; @@ -54,8 +54,8 @@ if (_majorStep) then { }; }; -_elevation = round(_elevation * 10) / 10; -_windage = round(_windage * 10) / 10; +_elevation = round(_elevation / MIN_INCREMENT) * MIN_INCREMENT; +_windage = round(_windage / MIN_INCREMENT) * MIN_INCREMENT; if ((_elevation + _zero) < _maxVertical select 0 or (_elevation + _zero) > _maxVertical select 1) exitWith {false}; if (_windage < _maxHorizontal select 0 or _windage > _maxHorizontal select 1) exitWith {false}; diff --git a/addons/scopes/functions/fnc_adjustZero.sqf b/addons/scopes/functions/fnc_adjustZero.sqf index bc702a8c5f..b551d6b2c7 100644 --- a/addons/scopes/functions/fnc_adjustZero.sqf +++ b/addons/scopes/functions/fnc_adjustZero.sqf @@ -1,6 +1,6 @@ /* * Author: KoffeinFlummi, Ruthberg - * Updates the zero reference for the current scope + * Updates the zero adjustment of the current scope * * Arguments: * 0: Unit @@ -15,22 +15,28 @@ */ #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 _weaponClass = currentWeapon _unit; +private _weaponIndex = [_unit, _weaponClass] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; -_adjustment = _unit getVariable [QGVAR(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; +_zero = round((_zero + _elevation) / MIN_INCREMENT) * MIN_INCREMENT; _elevation = 0; +private _opticsClass = ([_unit] call FUNC(getOptics)) select _weaponIndex; +if (_zero != 0) then { + profileNamespace setVariable [format[QGVAR(PersistentZero_%1_%2), _weaponClass, _opticsClass], _zero]; +} else { + profileNamespace setVariable [format[QGVAR(PersistentZero_%1_%2), _weaponClass, _opticsClass], nil]; +}; + [_unit, _elevation, _windage, _zero] call FUNC(applyScopeAdjustment); true diff --git a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf index 2777df65b5..f4d6959754 100644 --- a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf +++ b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf @@ -18,14 +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), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; -_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]]; @@ -35,14 +33,16 @@ 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 params ["_elevationDifference", "_windageDifference"]; - _pitchBankYaw = [_unit] call EFUNC(common,getPitchBankYaw); - _pitchBankYaw params ["_pitch", "_bank", "_yaw"]; - _pitch = _pitch + _elevationDifference; - _yaw = _yaw + _windageDifference; - [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw); + if (!GVAR(simplifiedZeroing)) then { + // Convert adjustmentDifference from mils to degrees + _adjustmentDifference = _adjustmentDifference apply {MRAD_TO_DEG(_x)}; + _adjustmentDifference params ["_elevationDifference", "_windageDifference"]; + private _pitchBankYaw = [_unit] call EFUNC(common,getPitchBankYaw); + _pitchBankYaw params ["_pitch", "_bank", "_yaw"]; + _pitch = _pitch + _elevationDifference; + _yaw = _yaw + _windageDifference; + [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw); + }; } else { [] call FUNC(showZeroing); }; diff --git a/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf index bcf1779f84..4573a1c97a 100644 --- a/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf +++ b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf @@ -11,7 +11,10 @@ * 5: Advanced Ballistics enabled? * * Return Value: - * zeroAngleCorrection + * zeroAngleCorrection + * + * Example: + * [5, 6, gun, ammo, magazine, true] call ace_scopes_fnc_calculateZeroAngleCorrection * * Public: No */ @@ -29,11 +32,15 @@ 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 _zeroAngle = "ace_advanced_ballistics" callExtension format ["replicateVanillaZero:%1:%2:%3", _oldZeroRange, _initSpeed, _airFriction]; private _vanillaZero = parseNumber _zeroAngle; +#ifdef DISABLE_DISPERSION + _vanillaZero = 0; +#endif + private _trueZero = if (!_advancedBallistics) then { - _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngleVanilla:%1:%2:%3:%4", _newZeroRange, _initSpeed, _airFriction, _boreHeight]; + _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _newZeroRange, _initSpeed, _airFriction, _boreHeight]; (parseNumber _zeroAngle) } else { // Get Weapon and Ammo Configurations @@ -46,7 +53,7 @@ private _trueZero = if (!_advancedBallistics) then { _WeaponCacheEntry = _weapon call EFUNC(advanced_ballistics,readWeaponDataFromConfig); }; - _AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable"]; + _AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocityVariationSD"]; _WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"]; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,barrelLengthInfluenceEnabled), false]) then { @@ -54,7 +61,12 @@ private _trueZero = if (!_advancedBallistics) then { _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]; + if (missionNamespace getVariable [QEGVAR(advanced_ballistics,ammoTemperatureEnabled), false]) then { + private _ammoTemperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, GVAR(zeroReferenceTemperature)] call EFUNC(advanced_ballistics,calculateAmmoTemperatureVelocityShift)); + _initSpeed = _initSpeed + _ammoTemperatureVelocityShift; + }; + + _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZeroAB:%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) }; diff --git a/addons/scopes/functions/fnc_canAdjustZero.sqf b/addons/scopes/functions/fnc_canAdjustZero.sqf index 30e2918805..996e6ae7fc 100644 --- a/addons/scopes/functions/fnc_canAdjustZero.sqf +++ b/addons/scopes/functions/fnc_canAdjustZero.sqf @@ -1,6 +1,6 @@ /* * Author: KoffeinFlummi, Ruthberg - * Changes the adjustment for the current scope + * Checks if the unit can change the zero adjustment of the current scope * * Arguments: * 0: Unit @@ -15,19 +15,18 @@ */ #include "script_component.hpp" -private ["_weaponIndex", "_adjustment", "_elevation"]; - params ["_unit"]; if (cameraView == "GUNNER") exitWith {false}; if (vehicle _unit != _unit) exitWith {false}; +if (GVAR(simplifiedZeroing)) 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), [[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_canResetZero.sqf b/addons/scopes/functions/fnc_canResetZero.sqf new file mode 100644 index 0000000000..fe9def4a19 --- /dev/null +++ b/addons/scopes/functions/fnc_canResetZero.sqf @@ -0,0 +1,31 @@ +/* + * Author: KoffeinFlummi, Ruthberg + * Checks if the unit can reset the zero adjustment of the current scope + * + * Arguments: + * 0: Unit + * + * Return Value: + * Can we reset the zero reference? + * + * Example: + * [player] call ace_scopes_fnc_canResetZero + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +if (cameraView == "GUNNER") exitWith {false}; +if (vehicle _unit != _unit) exitWith {false}; +if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false}; + +private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); +if (_weaponIndex < 0) exitWith {false}; + +private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; +private _zero = (_adjustment select _weaponIndex) select 2; + +// You can only reset your zero reference, if it is not 0 already +_zero != 0 diff --git a/addons/scopes/functions/fnc_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf index ebadb2f715..6d63f9107a 100644 --- a/addons/scopes/functions/fnc_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_scopes_fnc_firedEH + * * Public: No */ #include "script_component.hpp" @@ -20,23 +23,31 @@ if (!(_ammo isKindOf "BulletBase")) exitWith {}; private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {}; -private _adjustment = ACE_player getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; +private _adjustment = _unit 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 0.05625; +_zeroing = _zeroing vectorMultiply MRAD_TO_DEG(1); -if (GVAR(correctZeroing)) then { +if (GVAR(correctZeroing) || GVAR(simplifiedZeroing)) then { private _advancedBallistics = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]; - private _boreHeight = GVAR(boreHeight) select _weaponIndex; + private _baseAngle = (_unit getVariable [QGVAR(baseAngle), [0,0,0]]) select _weaponIndex; + private _boreHeight = (_unit getVariable [QGVAR(boreHeight), [0,0,0]]) 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 (GVAR(simplifiedZeroing)) then { + _zeroing = [0, 0, _zeroCorrection - _baseAngle]; + } else { + _zeroing = _zeroing vectorAdd [0, 0, _zeroCorrection - _baseAngle]; + }; +#ifdef DISABLE_DISPERSION + _projectile setVelocity (_unit weaponDirection currentWeapon _unit) vectorMultiply (vectorMagnitude (velocity _projectile)); +#endif }; if (_zeroing isEqualTo [0, 0, 0]) exitWith {}; diff --git a/addons/scopes/functions/fnc_getBaseAngle.sqf b/addons/scopes/functions/fnc_getBaseAngle.sqf new file mode 100644 index 0000000000..d529fef2f4 --- /dev/null +++ b/addons/scopes/functions/fnc_getBaseAngle.sqf @@ -0,0 +1,37 @@ +/* + * Author: Ruthberg + * Gets the base angle of the weapon & optic combination with the given weapon index + * + * Arguments: + * 0: Unit + * 1: Weapon index + * + * Return Value: + * base angle + * + * Example: + * [player, 0] call ace_scopes_fnc_getBaseAngle + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit", "_weaponIndex"]; + +if (_weaponIndex < 0 || {_weaponIndex > 2}) exitWith { 0 }; + +private _weaponClass = [primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit] select _weaponIndex; +private _opticsClass = ([_unit] call FUNC(getOptics)) select _weaponIndex; + +private _weaponConfig = configFile >> "CfgWeapons" >> _weaponClass; +private _baseAngle = getNumber(_weaponConfig >> "ACE_IronSightBaseAngle"); + +if (_opticsClass != "") then { + if (isNumber (_weaponConfig >> "ACE_RailBaseAngle")) then { + _baseAngle = getNumber(_weaponConfig >> "ACE_RailBaseAngle"); + } else { + _baseAngle = DEFAULT_RAIL_BASE_ANGLE; + }; +}; + +_baseAngle diff --git a/addons/scopes/functions/fnc_getBoreHeight.sqf b/addons/scopes/functions/fnc_getBoreHeight.sqf index fb061e5d46..b76a9c7f9e 100644 --- a/addons/scopes/functions/fnc_getBoreHeight.sqf +++ b/addons/scopes/functions/fnc_getBoreHeight.sqf @@ -10,18 +10,18 @@ * bore height * * Example: - * [player] call ace_scopes_fnc_getBoreHeight + * [player, 0] call ace_scopes_fnc_getBoreHeight * * Public: Yes */ #include "script_component.hpp" -params ["_player", "_weaponIndex"]; +params ["_unit", "_weaponIndex"]; -if (_weaponIndex < 0 || {_weaponIndex > 2}) exitWith { 0 }; +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; +private _weaponClass = [primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit] select _weaponIndex; +private _opticsClass = ([_unit] call FUNC(getOptics)) select _weaponIndex; if (_opticsClass == "") then { _opticsClass = _weaponClass; }; @@ -32,7 +32,7 @@ if (isNumber (_weaponConfig >> "ACE_RailHeightAboveBore")) then { _railHeightAboveBore = getNumber(_weaponConfig >> "ACE_RailHeightAboveBore"); } else { switch (_weaponIndex) do { - case 0: { _railHeightAboveBore = 2.0; }; // Rifle + case 0: { _railHeightAboveBore = 3.0; }; // Rifle case 2: { _railHeightAboveBore = 0.7; }; // Pistol }; }; @@ -43,12 +43,12 @@ if (isNumber (_opticConfig >> "ACE_ScopeHeightAboveRail")) then { _scopeHeightAboveRail = getNumber(_opticConfig >> "ACE_ScopeHeightAboveRail"); } else { switch (getNumber(_opticConfig >> "ItemInfo" >> "opticType")) do { - case 1: { _scopeHeightAboveRail = 3.0; }; // RCO or similar + 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 + case 0: { _scopeHeightAboveRail = 2.0; }; // Rifle iron sights + case 2: { _scopeHeightAboveRail = 1.0; }; // Pistol iron sights }; }; }; diff --git a/addons/scopes/functions/fnc_getCurrentZeroRange.sqf b/addons/scopes/functions/fnc_getCurrentZeroRange.sqf index 7af8d2e3e9..2da5f32eb0 100644 --- a/addons/scopes/functions/fnc_getCurrentZeroRange.sqf +++ b/addons/scopes/functions/fnc_getCurrentZeroRange.sqf @@ -21,6 +21,10 @@ if (!GVAR(enabled)) exitWith { currentZeroing _unit }; private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith { currentZeroing _unit }; +if (GVAR(simplifiedZeroing)) exitWith { + private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; + ((_adjustment select _weaponIndex) select 0) +}; private _optic = GVAR(Optics) select _weaponIndex; private _opticConfig = if (_optic != "") then { diff --git a/addons/scopes/functions/fnc_initModuleSettings.sqf b/addons/scopes/functions/fnc_initModuleSettings.sqf index a04433f11e..db5d5cd8a5 100644 --- a/addons/scopes/functions/fnc_initModuleSettings.sqf +++ b/addons/scopes/functions/fnc_initModuleSettings.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_scopes_fnc_initModuleSettings + * * Public: No */ #include "script_component.hpp" @@ -17,7 +20,7 @@ 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); @@ -27,8 +30,7 @@ if !(_activated) exitWith {}; [_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(zeroReferenceTemperature) = -55 max GVAR(zeroReferenceTemperature) min 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 817d301221..fa0fa426c6 100644 --- a/addons/scopes/functions/fnc_inventoryCheck.sqf +++ b/addons/scopes/functions/fnc_inventoryCheck.sqf @@ -25,32 +25,50 @@ private _newOptics = [_player] call FUNC(getOptics); if (_newOptics select _forEachIndex != _x) then { 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 _verticalIncrement = -1; 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; }; + private _horizontalIncrement = -1; + if (GVAR(simplifiedZeroing)) then { + private _maxDistanceZoomMax = 300; + private _maxDiscreteDistanceSize = 0; + { + _maxDistanceZoomMax = _maxDistanceZoomMax max (getNumber ( _x >> "distanceZoomMax")); + _maxDiscreteDistanceSize = _maxDiscreteDistanceSize max (count getArray (_x >> "discreteDistance")); + } forEach ("isArray (_x >> 'discreteDistance')" configClasses (_opticConfig >> "ItemInfo" >> "OpticsModes")); + if (_maxDiscreteDistanceSize < 2 && {getNumber (_opticConfig >> "ACE_ScopeAdjust_VerticalIncrement") != 0}) then { + _maxVertical = [50, _maxDistanceZoomMax]; + _verticalIncrement = 50; + } else { + _maxVertical = [0, 0]; + _verticalIncrement = 0; + }; + _maxHorizontal = [0, 0]; + _horizontalIncrement = 0; } 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; }; + if (isNumber (_opticConfig >> "ACE_ScopeAdjust_VerticalIncrement")) then { + _verticalIncrement = getNumber (_opticConfig >> "ACE_ScopeAdjust_VerticalIncrement"); + }; + if (isNumber (_opticConfig >> "ACE_ScopeAdjust_HorizontalIncrement")) then { + _horizontalIncrement = getNumber (_opticConfig >> "ACE_ScopeAdjust_HorizontalIncrement"); + }; + if (isArray (_opticConfig >> "ACE_ScopeAdjust_Vertical")) then { + _maxVertical = getArray (_opticConfig >> "ACE_ScopeAdjust_Vertical"); + }; + 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]; @@ -61,34 +79,32 @@ private _newOptics = [_player] call FUNC(getOptics); }; } forEach GVAR(Optics); +private _unitBaseAngle = +(_player getVariable [QGVAR(baseAngle), [0,0,0]]); +private _unitBoreHeight = +(_player getVariable [QGVAR(boreHeight), [0,0,0]]); + 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)]; - + _unitBaseAngle set [_x, [_player, _x] call FUNC(getBaseAngle)]; + _unitBoreHeight 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"); - }; + // Check if the weapon comes with an integrated optic + private _weaponConfig = configFile >> "CfgWeapons" >> (_newGuns select _x); private _maxVertical = [0, 0]; - if (isArray (_weaponConfig >> "ACE_ScopeAdjust_Vertical")) then { - _maxVertical = getArray (_weaponConfig >> "ACE_ScopeAdjust_Vertical"); - }; + private _verticalIncrement = 0; private _maxHorizontal = [0, 0]; - if (isArray (_weaponConfig >> "ACE_ScopeAdjust_Horizontal")) then { + private _horizontalIncrement = 0; + if (GVAR(simplifiedZeroing)) then { + private _maxZeroing = 300 max (getNumber (_weaponConfig >> "maxZeroing")); + private _maxDiscreteDistanceSize = count getArray (configFile >> "CfgWeapons" >> (_newGuns select _x) >> "discreteDistance"); + if (_maxDiscreteDistanceSize < 2 && {getNumber (_weaponConfig >> "ACE_ScopeAdjust_VerticalIncrement") != 0}) then { + _maxVertical = [50, _maxZeroing]; + _verticalIncrement = 50; + }; + } else { + _verticalIncrement = getNumber (_weaponConfig >> "ACE_ScopeAdjust_VerticalIncrement"); + _horizontalIncrement = getNumber (_weaponConfig >> "ACE_ScopeAdjust_HorizontalIncrement"); + _maxVertical = getArray (_weaponConfig >> "ACE_ScopeAdjust_Vertical"); _maxHorizontal = getArray (_weaponConfig >> "ACE_ScopeAdjust_Horizontal"); }; TRACE_5("",_newGuns select _x,_verticalIncrement,_horizontalIncrement,_maxVertical,_maxHorizontal); @@ -99,9 +115,32 @@ private _newGuns = [primaryWeapon _player, secondaryWeapon _player, handgunWeapo GVAR(canAdjustElevation) set [_x, (_verticalIncrement > 0) && !(_maxVertical isEqualTo [0, 0])]; GVAR(canAdjustWindage) set [_x, (_horizontalIncrement > 0) && !(_maxHorizontal isEqualTo [0, 0])]; }; + + // The optic or the weapon changed, reset the adjustment + private _persistentZero = profileNamespace getVariable [format[QGVAR(PersistentZero_%1_%2), _newGuns select _x, _newOptics select _x], 0]; + ((GVAR(scopeAdjust) select _x) select 0) params ["_minElevation", "_maxElevation"]; + if (!(_persistentZero isEqualType 0) || {_persistentZero < _minElevation || _persistentZero > _maxElevation}) then { + _persistentZero = 0; + }; + private _defaultElevation = [0, 300] select GVAR(simplifiedZeroing); + if (!((_adjustment select _forEachIndex) isEqualTo [_defaultElevation, 0, _persistentZero])) then { + _adjustment set [_forEachIndex, [_defaultElevation, 0, _persistentZero]]; + _updateAdjustment = true; + }; } } forEach [0, 1, 2]; +if (GVAR(correctZeroing) || GVAR(simplifiedZeroing)) then { + if (!(_unitBaseAngle isEqualTo (_player getVariable [QGVAR(baseAngle), [0,0,0]]))) then { + TRACE_2("syncing",_unitBaseAngle,_player getVariable QGVAR(baseAngle)); + _player setVariable [QGVAR(baseAngle), _unitBaseAngle, true]; + }; + if (!(_unitBoreHeight isEqualTo (_player getVariable [QGVAR(boreHeight), [0,0,0]]))) then { + TRACE_2("syncing",_unitBoreHeight,_player getVariable QGVAR(boreHeight)); + _player setVariable [QGVAR(boreHeight), _unitBoreHeight, true]; + }; +}; + if (_updateAdjustment) then { [ACE_player, QGVAR(Adjustment), _adjustment, 0.5] call EFUNC(common,setVariablePublic); }; diff --git a/addons/scopes/functions/fnc_resetZero.sqf b/addons/scopes/functions/fnc_resetZero.sqf new file mode 100644 index 0000000000..8d083cf2ee --- /dev/null +++ b/addons/scopes/functions/fnc_resetZero.sqf @@ -0,0 +1,38 @@ +/* + * Author: KoffeinFlummi, Ruthberg + * Resets the zero adjustment of the current scope + * + * Arguments: + * 0: Unit + * + * Return Value: + * true + * + * Example: + * [player] call ace_scopes_fnc_resetZero + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +if (vehicle _unit != _unit) exitWith {false}; + +private _weaponClass = currentWeapon _unit; +private _weaponIndex = [_unit, _weaponClass] call EFUNC(common,getWeaponIndex); +if (_weaponIndex < 0) exitWith {false}; + +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"]; + +_elevation = round((_zero + _elevation) / MIN_INCREMENT) * MIN_INCREMENT; +_zero = 0; + +private _opticsClass = ([_unit] call FUNC(getOptics)) select _weaponIndex; +profileNamespace setVariable [format[QGVAR(PersistentZero_%1_%2), _weaponClass, _opticsClass], nil]; + +[_unit, _elevation, _windage, _zero] call FUNC(applyScopeAdjustment); + +true diff --git a/addons/scopes/functions/fnc_showZeroing.sqf b/addons/scopes/functions/fnc_showZeroing.sqf index cf74e38842..533d68f7e1 100644 --- a/addons/scopes/functions/fnc_showZeroing.sqf +++ b/addons/scopes/functions/fnc_showZeroing.sqf @@ -35,8 +35,34 @@ private _zeroing = _adjustment select _weaponIndex; _zeroing params ["_elevation", "_windage"]; private _vertical = _display displayCtrl 12; private _horizontal = _display displayCtrl 13; -_vertical ctrlSetText (str _elevation); -_horizontal ctrlSetText (str _windage); +if (GVAR(simplifiedZeroing)) then { + _vertical ctrlSetText format["%1 m", round(_elevation)]; + _horizontal ctrlSetText ""; +} else { + if (GVAR(useLegacyUI)) then { + _vertical ctrlSetText (str _elevation); + _horizontal ctrlSetText (str _windage); + } else { + if (_elevation == 0) then { + _vertical ctrlSetText "0"; + } else { + if (_elevation > 0) then { + _vertical ctrlSetText (str _elevation); + } else { + _vertical ctrlSetText format[localize LSTRING(DisplayAdjustmentDown), abs(_elevation)]; + }; + }; + if (_windage == 0) then { + _horizontal ctrlSetText "0"; + } else { + if (_windage > 0) then { + _horizontal ctrlSetText format[localize LSTRING(DisplayAdjustmentRight), abs(_windage)]; + } else { + _horizontal ctrlSetText format[localize LSTRING(DisplayAdjustmentLeft), abs(_windage)]; + }; + }; + }; +}; // Set the time when to hide the knobs GVAR(timeToHide) = diag_tickTime + 3.0; diff --git a/addons/scopes/script_component.hpp b/addons/scopes/script_component.hpp index a797b36191..9e867a9bd2 100644 --- a/addons/scopes/script_component.hpp +++ b/addons/scopes/script_component.hpp @@ -14,6 +14,12 @@ #define MINOR_INCREMENT false #define MAJOR_INCREMENT true +#define MIN_INCREMENT 0.05 // mrad + +#define DEFAULT_RAIL_BASE_ANGLE 0.0086 // deg + +// #define DISABLE_DISPERSION + #ifdef DEBUG_ENABLED_SCOPES #define DEBUG_MODE_FULL #endif diff --git a/addons/scopes/stringtable.xml b/addons/scopes/stringtable.xml index d36161e99d..855b364ee5 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -3,289 +3,428 @@ 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 adjustmet turrets on high powered scopes + 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 power scopes will be zeroed at this distance + 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 + 在不同高度上会有不同的大气压力 + 在不同高度上會有不同的大氣壓力 + + + Use legacy UI + Vorheriges UI verwenden + Usa UI precedente + 使用舊版介面 + 使用旧版介面 + 昔の UI を使用 + + + Displays elevation and windage with signed numbers + Anzeige der Absehenverstellungen mit vorzeichenbehafteten Zahlen + Visualizza l'elevazione e la derivazione con i numeri firmati + 使用帶著標籤的數字顯示歸零遠近與風偏程度 + 使用带着标签的数字显示归零远近与风偏程度 + 印付きの数字で仰角と横風を表示 + + + Simplified zeroing + Vereinfachte Nullung + 簡略なゼロイン + Azzeramento semplificato + + + Replicates the vanilla zeroing system for riflescopes. + Repliziert das Vanilla-Zeroing-System für Zielfernrohre. + 標準で使われるライフルスコープ用のゼロイン システムを複製します。 + Replica il sistema di azzeramento vanilla per le ottiche. 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 + Imposta i valori dell'azzeramento RAZ corrections - Auf 0 justieren Állítások nullázása Zerar ajuste Vynulovat korekci ゼロインを調節 영점 초기화 + 设定归零 + 設定歸零 + + + Reset zero adjustment + Nullung zurücksetzen + ゼロイン調節を初期化 + Resetta i valori dell'azzeramento 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 + 此模块可为高倍率瞄准镜新增归零风偏,距离用的调整纽。 + 此模塊可為高倍率瞄準鏡新增歸零風偏,距離用的調整紐。 + + + %1D + %1T + %1B + %1D + %1D + %1D + %1D + + + %1L + %1L + %1G + %1L + %1L + %1L + %1L + + + %1R + %1R + %1D + %1R + %1R + %1R + %1R diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf index c54aec7d2f..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" diff --git a/addons/slideshow/stringtable.xml b/addons/slideshow/stringtable.xml index 213834841d..3abaa07592 100644 --- a/addons/slideshow/stringtable.xml +++ b/addons/slideshow/stringtable.xml @@ -14,6 +14,8 @@ 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. @@ -28,6 +30,8 @@ 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 @@ -42,6 +46,8 @@ Oggetti オブジェクト 물체 + 物件 + 物件 Object names (can also be synchronized objects) slide-show will be displayed on, separated by commas if multiple. @@ -56,6 +62,8 @@ Nomi di oggetti (possono anche essere oggetti sincronizzati) che verranno usati per la presentazione di diapositive, separato da virgole se più di uno. スライドショーを表示するオブジェクト名 (オブジェクトとの同期も可)。複数ある場合はコンマで区切れます 슬라이드 쇼가 보여질 물체(동기화 되는 물체도 가능합니다) 명칭, 다수의 경우 쉼표로 구분합니다. + 物件名稱 (也可使用同步線來設定),幻燈片將會顯示在該物件上,如有多個物件,請以逗號作區隔 + 物件名称 (也可使用同步线来设定),幻灯片将会显示在该物件上,如有多个物件,请以逗号作区隔 Controllers @@ -70,6 +78,8 @@ Controllori コントローラ 조종 장치 + 控制器 + 控制器 Controller object names, separated by commas if multiple. @@ -83,6 +93,8 @@ Nomi di oggetti controllori, separati da virgole se multipli. コントローラに指定するオブジェクト名を記入し、複数ある場合はコンマで区切れます。 조종 장치 물체 명칭, 다수의 경우 쉼표로 구분됩니다. + 指定是控制器的物件名稱,如有多個物件,請以逗號作區隔 + 指定是控制器的物件名称,如有多个物件,请以逗号作区隔 Images @@ -97,6 +109,8 @@ Immagini 画像 사진 + 圖片 + 图片 List of images that will be used for the slide-show, separated by commas, with full path correctly formatted (eg. images\image.paa). @@ -111,6 +125,8 @@ 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 @@ -125,6 +141,8 @@ Interaktionsnamen インタラクション名 상호작용 명칭 + 互動鍵名稱 + 互动键名称 List of names that will be used for interaction entries, separated by commas, in order of images. @@ -138,20 +156,30 @@ 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" + 設定該幻燈片的標題名稱 (用來區分多個不同標題的幻燈片) 預設名稱: "幻燈片" + 设定该幻灯片的标题名称 (用来区分多个不同标题的幻灯片) 预设名称: "幻灯片" + 상위 상호작용 이름 (여러개의 슬라이드 쇼를 구분하기 위해 사용됨) 기본: "Slides" Slide Duration @@ -166,6 +194,8 @@ Länge der Diavorführung pro Bild スライドの持続時間 슬라이드 지속시간 + 幻燈片顯示時間 + 幻灯片显示时间 Duration of each slide. Default: 0 (Automatic Transitions Disabled) @@ -180,6 +210,8 @@ Länge der Diavorführung pro Bild. Standard: 0 (Automatischer Wechsel deaktiviert) 各スライドの持続時間。標準:0 (自動的な切り替えは無効) 매 슬라이드의 지속시간. 기본설정: 0 (자동 전환 비활성화) + 每張幻燈片顯示的時間。 預設:0 (自動換圖已禁用) + 每张幻灯片显示的时间。 预设:0 (自动换图已禁用) Slides @@ -194,6 +226,8 @@ Dias スライド 슬라이드 + 幻燈片 + 幻灯片 diff --git a/addons/smallarms/CfgMagazines.hpp b/addons/smallarms/CfgMagazines.hpp index a9cc718258..ac55a86f6b 100644 --- a/addons/smallarms/CfgMagazines.hpp +++ b/addons/smallarms/CfgMagazines.hpp @@ -6,36 +6,6 @@ class CfgMagazines { // 2. Remove tracers at bottom of magazine. // 3. Do string updates. - // 5.56mm //////////////////////////////////// - - class 30Rnd_556x45_Stanag : CA_Magazine { - displayname = "5.56mm 30Rnd Mag"; - displaynameshort = "5.56mm"; - - tracersEvery = 0; - lastRoundsTracer = 0; - }; - - class 30Rnd_556x45_Stanag_Tracer_Red: 30Rnd_556x45_Stanag { - displayname = "5.56mm 30Rnd Tracer Mag"; - displaynameshort = "5.56mm"; - }; - - class 30Rnd_556x45_Stanag_Tracer_Green: 30Rnd_556x45_Stanag { - displayname = "5.56mm 30Rnd Tracer Mag"; - displaynameshort = "5.56mm"; - }; - - class 30Rnd_556x45_Stanag_Tracer_Yellow: 30Rnd_556x45_Stanag { - displayname = "5.56mm 30Rnd Tracer Mag"; - displaynameshort = "5.56mm"; - }; - - class 20Rnd_556x45_UW_mag: 30Rnd_556x45_Stanag { - displayname = "5.56mm 20Rnd MEA Mag"; - displaynameshort = "5.56mm MEA"; - }; - // 6.5mm ////////////////////////////////////////// class 30Rnd_65x39_caseless_mag : CA_Magazine { // MX!! diff --git a/addons/spectator/ACE_Settings.hpp b/addons/spectator/ACE_Settings.hpp index 31e4ea3fd0..ef74580428 100644 --- a/addons/spectator/ACE_Settings.hpp +++ b/addons/spectator/ACE_Settings.hpp @@ -1,26 +1,21 @@ 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) { + category = CSTRING(Module_DisplayName); + 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) { + category = CSTRING(Module_DisplayName); 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) { + category = CSTRING(Module_DisplayName); displayName = CSTRING(visions_DisplayName); description = CSTRING(visions_Description); typeName = "SCALAR"; 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..772c0fec5f 100644 --- a/addons/spectator/CfgVehicles.hpp +++ b/addons/spectator/CfgVehicles.hpp @@ -1,61 +1,19 @@ class CfgVehicles { class ACE_Module; class GVAR(moduleSettings): ACE_Module { - scope = 2; + scope = 1; 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(Settings_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 8c566844ee..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; - disableKeyboardSearch = 1; - 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..ddca0c226c 100644 --- a/addons/spectator/XEH_PREP.hpp +++ b/addons/spectator/XEH_PREP.hpp @@ -1,23 +1,56 @@ +// 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_handleLoad); +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(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); diff --git a/addons/spectator/XEH_postInit.sqf b/addons/spectator/XEH_postInit.sqf index 72c53a2af0..715dbe1c3d 100644 --- a/addons/spectator/XEH_postInit.sqf +++ b/addons/spectator/XEH_postInit.sqf @@ -1,31 +1,36 @@ #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); + + // Used by the template to transfer zeus to virtual unit + // Commands must be ran on server + [QGVAR(transferZeus),{ + unassignCurator (_this select 1); + + // 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; }; -// Should prevent unending spectator on mission end -if (isServer) then { - addMissionEventHandler ["Ended", { - [QGVAR(endMission), []] call CBA_fnc_globalEvent; - }]; +// 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; }; - -[QGVAR(endMission), { - if (GVAR(isSet)) then { - [false] call FUNC(setSpectator); - }; -}] call CBA_fnc_addEventHandler; - -[QGVAR(stageSpectator), FUNC(stageSpectator)] call CBA_fnc_addEventHandler; diff --git a/addons/spectator/XEH_preInit.sqf b/addons/spectator/XEH_preInit.sqf index 4bdf07b3a1..8220b21520 100644 --- a/addons/spectator/XEH_preInit.sqf +++ b/addons/spectator/XEH_preInit.sqf @@ -6,39 +6,15 @@ 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 aee0eaaa76..359b96135b 100644 --- a/addons/spectator/config.cpp +++ b/addons/spectator/config.cpp @@ -17,13 +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); + displayName = CSTRING(Settings_DisplayName); onPlayerKilled = QFUNC(respawnTemplate); onPlayerRespawn = QFUNC(respawnTemplate); - respawnTypes[] = {2,3}; + 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..992476d53f --- /dev/null +++ b/addons/spectator/functions/fnc_cam.sqf @@ -0,0 +1,150 @@ +/* + * 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"]; +TRACE_1("cam",_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(camDistanceTrue) = 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 agent used to fix draw3D in free camera for case where player is perma-dead + GVAR(camAgentFree) = createAgent [QGVAR(virtual), [0,0,0], [], 0, "NONE"]; + GVAR(camAgentFree) enableSimulation false; // Prevent falling into water + + // 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 free camera agent + deleteVehicle GVAR(camAgentFree); + GVAR(camAgentFree) = 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(camDistanceTrue) = 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..81bec1504e --- /dev/null +++ b/addons/spectator/functions/fnc_cam_prepareTarget.sqf @@ -0,0 +1,55 @@ +/* + * 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]]); +TRACE_1("cam_prepareTarget",_focus); + +if !(isNull _focus) then { + // Zooming takes place smoothly over multiple frames + // _zoom is target set by user, _zoomTrue is actual value each frame + private _zoom = [0, GVAR(camDistance)] select (GVAR(camMode) == MODE_FOLLOW); + private _zoomTrue = GVAR(camDistanceTrue); + + // Interpolate zoom each frame until desired zoom is reached + if (_zoomTrue != _zoom) then { + _zoomTrue = (_zoomTrue * (1 - GVAR(camDeltaTime) * 10)) + (_zoom * GVAR(camDeltaTime) * 10); + GVAR(camDistanceTrue) = _zoomTrue; + TRACE_2("new zoom",GVAR(camDeltaTime),_zoomTrue); + }; + + // The distance at which to place camera from the focus pivot + private _bbd = [_focus] call BIS_fnc_getObjectBBD; + private _distance = (_bbd select 1) + _zoomTrue; + + // 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..02238ed91e --- /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"]; + switchCamera GVAR(camAgentFree); // Fix draw3D while in free camera for case where player is perma-dead + _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..0024664c88 --- /dev/null +++ b/addons/spectator/functions/fnc_compat_spectatorBI.sqf @@ -0,0 +1,56 @@ +/* + * 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,"NONE"]; + +// Prevent unit falling into water (compatibility for some addons) +_virtual enableSimulation false; + +// 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 6f0f94b0ee..0000000000 --- a/addons/spectator/functions/fnc_handleCompass.sqf +++ /dev/null @@ -1,60 +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 = [ - [_SW, _WN, _NE, _ES], - [_WN, _NE, _ES, _SW], - [_NE, _ES, _SW, _WN], - [_ES, _SW, _WN, _NE] -] select floor(_heading/90); - - -{ - _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 9ba64ec0f0..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", {call 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 deleted file mode 100644 index 0826949b30..0000000000 --- a/addons/spectator/functions/fnc_interrupt.sqf +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - */ -#include "script_component.hpp" - -params [["_reason", "", [""]], ["_interrupt", true, [true]]]; - -// Nothing to do when spectator is closed -if !(GVAR(isSet)) exitWith {}; - -if (_reason == "") exitWith { ERROR("Invalid Reason"); }; -if (_interrupt) then { - GVAR(interrupts) pushBack _reason; -} else { - GVAR(interrupts) = GVAR(interrupts) - [_reason]; -}; - -if (GVAR(interrupts) isEqualTo []) then { - if (isNull (GETUVAR(GVAR(interface),displayNull))) then { - (findDisplay 46) createDisplay QGVAR(interface); - [] call FUNC(transitionCamera); - }; -} else { - if !(isNull (GETUVAR(GVAR(interface),displayNull))) then { - while {dialog} do { - closeDialog 0; - }; - - (GETUVAR(GVAR(interface),displayNull)) closeDisplay 0; - }; -}; 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..14cd6c053d 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,30 @@ * 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]]]; +TRACE_4("respawnTemplate",_newCorpse,_oldKiller,_respawn,_respawnDelay); -// 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..c9a272407b 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,64 @@ #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 !(_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..ca829559e7 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,33 @@ if (_set) then { }; }; +// Hide/Unhide the player if enabled and alive +if (alive player) then { + private _hidden = (_hide && _set); + TRACE_1("",_hidden); + + // 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 deleted file mode 100644 index a7cc926d33..0000000000 --- a/addons/spectator/functions/fnc_stageSpectator.sqf +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Author: SilentSpike - * Sets target unit to the given spectator state (physically) - * To virtually handle a spectator see ace_spectator_fnc_setSpectator - * - * 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 - * - * Arguments: - * 0: Unit to put into spectator stage (default: player) - * 1: Unit should be staged (default: true) - * - * Return Value: - * None - * - * Example: - * [player, false] call ace_spectator_fnc_stageSpectator - * - * Public: Yes - */ - -#include "script_component.hpp" - -params [["_unit",player,[objNull]], ["_set",true,[true]]]; - -// No change, no service (but allow spectators to be reset) -if !(_set || (GETVAR(_unit,GVAR(isStaged),false))) exitWith {}; - -if !(local _unit) exitWith { - [QGVAR(stageSpectator), [_unit, _set], _unit] call CBA_fnc_targetEvent; -}; - -// Prevent unit falling into water -_unit enableSimulation !_set; - -// Move to/from group as appropriate -[_unit, _set, QGVAR(isStaged), side group _unit] call EFUNC(common,switchToGroupSide); - -if (_set) then { - // Position should only be saved on first entry - if !(GETVAR(_unit,GVAR(isStaged),false)) then { - GVAR(oldPos) = getPosATL _unit; - }; - - // Ghosts can't talk - [_unit, QGVAR(isStaged)] call EFUNC(common,hideUnit); - [_unit, QGVAR(isStaged)] call EFUNC(common,muteUnit); - - _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); -}; - -// Spectators ignore damage (vanilla and ace_medical) -_unit allowDamage !_set; -_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; -}; - -//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; - }; -}; 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..8fe9339153 --- /dev/null +++ b/addons/spectator/functions/fnc_ui.sqf @@ -0,0 +1,146 @@ +/* + * 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"]; +TRACE_1("ui",_init); + +// No change +if (_init isEqualTo !isNull SPEC_DISPLAY) exitWith {}; + +// Close map +openMap [false,false]; + +// Close any open dialogs +while {dialog} do { + closeDialog 0; +}; + +// Controls some PP effects, but a little unclear which +BIS_fnc_feedback_allowPP = !_init; + +// Removes death blur if present +if !(isNil "BIS_DeathBlur") then { + BIS_DeathBlur ppEffectAdjust [0]; + BIS_DeathBlur ppEffectCommit 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..36ec3d0098 --- /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 = missionNamespace getVariable [QGVAR(camFocus), objNull]; +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..2ac7a049b7 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleKeyDown.sqf @@ -0,0 +1,200 @@ +/* + * 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 +}; + +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_handleLoad.sqf b/addons/spectator/functions/fnc_ui_handleLoad.sqf new file mode 100644 index 0000000000..1afa5ce123 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleLoad.sqf @@ -0,0 +1,25 @@ +/* + * Author: SilentSpike, Jonpas + * Function used to handle load event. + * + * Arguments: + * 0: Spectator display + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_ui_handleLoad + * + * Public: No + */ +#include "script_component.hpp" + +params ["_display"]; + +uiNamespace setVariable [QGVAR(display), _display]; + +// Handle ACRE2 Toggle Spectator (if present) +if (!isNil "acre_api_fnc_addDisplayPassthroughKeys") then { + [_display] call acre_api_fnc_addDisplayPassthroughKeys; +}; 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 819636ee22..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 @@ -26,12 +28,11 @@ if !(EGVAR(common,settingsInitFinished)) exitWith { }; params [["_addModes",[],[[]]], ["_removeModes",[],[[]]]]; -private ["_newModes","_currentModes"]; -_currentModes = GVAR(availableModes); +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; @@ -39,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 418643be38..6df7cad8ad 100644 --- a/addons/spectator/functions/fnc_updateUnits.sqf +++ b/addons/spectator/functions/fnc_updateUnits.sqf @@ -1,69 +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 = []; }; }; -// Unit setting filter -private _newUnits = [[],allPlayers,playableUnits,allUnits] select GVAR(filterUnits); +// Add to the whitelist and prevent list overlap +GVAR(unitBlacklist) = GVAR(unitBlacklist) - _addUnits; +GVAR(unitWhitelist) append _addUnits; -// Side setting filter -private _sideFilter = [ - {_x == (side group player)}, - {(_x getFriend (side group player)) >= 0.6}, - {(_x getFriend (side group player)) < 0.6}, - {true} -] select GVAR(filterSides); - -private _filteredSides = GVAR(availableSides) select _sideFilter; - -// Filter units and append to list -private _filteredUnits = (_newUnits - GVAR(unitBlacklist)) select { - (alive _x) && - {(_x isKindOf "CAManBase")} && - {(side group _x) in _filteredSides} && // Side filter - {simulationEnabled _x} && - {!(_x getVariable [QGVAR(isStaged), false])} // Who watches the watchmen? -}; -_filteredUnits append GVAR(unitWhitelist); - -// Cache icons and colour for drawing -private _filteredGroups = []; -{ - // Intentionally re-applied to units in case their status changes - [_x] call FUNC(cacheUnitInfo); - _filteredGroups pushBackUnique (group _x); -} forEach _filteredUnits; - -// Replace previous lists entirely (removes any no longer valid) -GVAR(groupList) = _filteredGroups; -GVAR(unitList) = _filteredUnits arrayIntersect _filteredUnits; +// 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 6db965af3e..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 @@ -34,12 +36,11 @@ if !(EGVAR(common,settingsInitFinished)) exitWith { }; params [["_addModes",[],[[]]], ["_removeModes",[],[[]]]]; -private ["_newModes","_currentModes"]; -_currentModes = GVAR(availableVisions); +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; @@ -47,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 29262d06b5..6efe569ec8 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -1,23 +1,24 @@  - - ACE Spectator - ACE スペクテイター - Spettatore ACE + + Spectator + Zuschauer + Spettatore + 旁觀者 + 旁观者 + スペクテイター - Spectator Settings - Zuschauer Einstellungen - Ustawienia obserwatora - Preferências de Espectador - Настройки спектатора - Nastavení pozorovatele - Ajustes de espectador - Impostazioni Spettatore - Réglages de spectateur - スペクテイター設定 - 관전자 설정 + ACE Spectator + ACE Zuschauer + ACE スペクテイター + Spettatore ACE + Spectateur ACE + ACE 旁观者 + ACE 旁觀者 + Obserwator ACE + ACE 관전자 Configure how the spectator system will operate by default. @@ -31,162 +32,26 @@ 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 + 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单位。 + 관전자가 AI를 관전 할 수 있습니다. Camera modes @@ -200,9 +65,11 @@ 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 @@ -211,8 +78,10 @@ Módy kamery které mohou být použity. Modalità che la camera può utilizzare. Modes de caméra qui peuvent être utilisés - カメラ モードを使えます。 + カメラ モードを設定できます。 사용할 수 있는 카메라 모드들 입니다 + 设定可使用的摄影机模式 + 設定可使用的攝影機模式 All @@ -226,40 +95,23 @@ 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 @@ -273,9 +125,11 @@ 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 @@ -284,8 +138,10 @@ Módy zobrazení které mohou být použity. Modalità visuali che possono essere usate. Modes de visions qui peuvent être utilisés - ビジョン モードを使えます。 + ビジョン モードを設定できます。 사용할 수 있는 시야 모드들 입니다 + 设定可使用的视觉模式 + 設定可使用的視覺模式 Night vision @@ -299,6 +155,8 @@ Vision nocturne 夜間暗視 야간투시경 + 夜视 + 夜視 Thermal imaging @@ -312,33 +170,24 @@ 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 @@ -352,15 +201,9 @@ 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 @@ -373,6 +216,8 @@ Normale 通常 정상 + 正常 + 正常 Night @@ -386,6 +231,8 @@ Nuit 暗視装置 야간 + 夜视 + 夜視 Thermal @@ -399,293 +246,27 @@ 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 @@ -695,10 +276,12 @@ Следующий юнит Následující jednotka Siguiente unidad - Prossima Unità + Unità Successiva Unité suivante 次のユニット 다음 인원 + 下个单位 + 下個單位 Previous Unit @@ -708,114 +291,30 @@ Предыдущий юнит 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à + 慢速度 + 慢速度 + 느린 속도 diff --git a/addons/spectator/ui.hpp b/addons/spectator/ui.hpp new file mode 100644 index 0000000000..7a49c72a86 --- /dev/null +++ b/addons/spectator/ui.hpp @@ -0,0 +1,460 @@ +class RscButton; +class RscControlsGroup; +class RscControlsGroupNoScrollbars; +class RscListNBox { + class ScrollBar; +}; +class RscMapControl; +class RscPicture; +class RscPictureKeepAspect; +class RscText; +class RscToolbox; +class RscTree; +class EGVAR(common,CompassControl); + +// 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(_this call FUNC(ui_handleLoad)); + + 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); + }; + }; + }; + class compass: EGVAR(common,CompassControl) {}; + }; +}; diff --git a/addons/spottingscope/CfgVehicles.hpp b/addons/spottingscope/CfgVehicles.hpp index fa2574cb8d..f360be45c9 100644 --- a/addons/spottingscope/CfgVehicles.hpp +++ b/addons/spottingscope/CfgVehicles.hpp @@ -18,6 +18,14 @@ class CfgVehicles { }; }; + class ThingX; + class ACE_SpottingScope_Tube: ThingX { + author = ECSTRING(common,ACETeam); + scope = 1; + displayName = CSTRING(DisplayName); + model = QPATHTOF(data\ace_spottingscope_tube.p3d); + }; + class LandVehicle; class StaticWeapon: LandVehicle { class Turrets; @@ -74,6 +82,21 @@ class CfgVehicles { getOutAction = "PlayerProne"; editorSubcategory = "EdSubcat_Turrets"; + threat[] = {0.7, 0.3, 0}; + accuracy = 0.12; + cost = 10000; + icon = "\A3\Static_F_Gamma\data\UI\map_StaticTurret_AT_CA.paa"; + + class SpeechVariants { + class Default { + speechSingular[] = {"veh_infantry_SF_s"}; + speechPlural[] = {"veh_infantry_SF_p"}; + }; + }; + textSingular = "$STR_A3_nameSound_veh_infantry_SF_s"; + textPlural = "$STR_A3_nameSound_veh_infantry_SF_p"; + nameSound = "veh_infantry_SF_s"; + class Turrets: Turrets { class MainTurret: MainTurret { minTurn = -45; @@ -123,6 +146,26 @@ class CfgVehicles { opticsDisablePeripherialVision = 1; }; }; + + // damage handling + armor = 80; + + class Damage { + tex[] = {}; + mat[] = { + QPATHTO_R(data\ace_spottingscope_metal.rvmat), + QPATHTO_R(data\ace_spottingscope_metal_damage.rvmat), + QPATHTO_R(data\ace_spottingscope_metal_destruct.rvmat), + QPATHTO_R(data\ace_spottingscope_glass.rvmat), + QPATHTO_R(data\ace_spottingscope_glass_damage.rvmat), + QPATHTO_R(data\ace_spottingscope_glass_destruct.rvmat), + QPATHTO_R(data\ace_spottingscope_rubber.rvmat), + QPATHTO_R(data\ace_spottingscope_rubber_damage.rvmat), + QPATHTO_R(data\ace_spottingscope_rubber_damage.rvmat) + }; + }; + + editorPreview = QPATHTOF(data\preview_spottingscope.jpg); }; class ACE_B_SpottingScope: ACE_SpottingScopeObject { @@ -152,6 +195,24 @@ class CfgVehicles { crew = "I_spotter_F"; }; + class ACE_B_T_SpottingScope: ACE_SpottingScopeObject { + author = ECSTRING(common,ACETeam); + _generalMacro = "ACE_B_T_SpottingScope"; + scope = 2; + side = 1; + faction = "BLU_T_F"; + crew = "B_T_Spotter_F"; + }; + + class ACE_O_T_SpottingScope: ACE_SpottingScopeObject { + author = ECSTRING(common,ACETeam); + _generalMacro = "ACE_O_T_SpottingScope"; + scope = 2; + side = 0; + faction = "OPF_T_F"; + crew = "O_T_Spotter_F"; + }; + class Item_Base_F; class ACE_Item_SpottingScope: Item_Base_F { author[] = {"Rocko", "Scubaman3D"}; @@ -159,6 +220,9 @@ class CfgVehicles { scopeCurator = 2; displayName = CSTRING(DisplayName); vehicleClass = "Items"; + editorCategory = "EdCat_Equipment"; + editorSubcategory = "EdSubcat_InventoryItems"; + editorPreview = QPATHTOF(data\preview_spottingscope.jpg); class TransportItems { MACRO_ADDITEM(ACE_SpottingScope,1); }; diff --git a/addons/spottingscope/CfgWeapons.hpp b/addons/spottingscope/CfgWeapons.hpp index acdf7c910f..9548b30aee 100644 --- a/addons/spottingscope/CfgWeapons.hpp +++ b/addons/spottingscope/CfgWeapons.hpp @@ -1,16 +1,17 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_SpottingScope: ACE_ItemCore { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(DisplayName); descriptionShort = ""; 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 b47cf6628d..e80d5e4ef9 100644 --- a/addons/spottingscope/XEH_preInit.sqf +++ b/addons/spottingscope/XEH_preInit.sqf @@ -6,4 +6,14 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +["ACE_SpottingScopeObject", "killed", { + params ["_wreck"]; + + private _tube = "ACE_SpottingScope_tube" createVehicle [0,0,0]; + _tube setDir (getDir _wreck - 180); + _tube setPosASL AGLToASL (_wreck modelToWorld (_wreck selectionPosition "destructionEffect")); + _tube setVelocity [1 - random 2, 1 - random 2, 4]; + _tube addTorque (vectorNormalized [1 - random 2, 1 - random 2, 1 - random 2] vectorMultiply 4); +}] call CBA_fnc_addClassEventHandler; + ADDON = true; diff --git a/addons/spottingscope/config.cpp b/addons/spottingscope/config.cpp index 4fa5bd4d58..5e8576eb59 100644 --- a/addons/spottingscope/config.cpp +++ b/addons/spottingscope/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { name = COMPONENT_NAME; - units[] = {"ACE_B_SpottingScope", "ACE_O_SpottingScope", "ACE_I_SpottingScope", "ACE_Item_SpottingScope"}; + units[] = {"ACE_B_SpottingScope", "ACE_O_SpottingScope", "ACE_I_SpottingScope", "ACE_B_T_SpottingScope", "ACE_O_T_SpottingScope", "ACE_Item_SpottingScope"}; weapons[] = {"ACE_SpottingScope"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_apl", "ace_interaction"}; diff --git a/addons/spottingscope/data/ace_spottingscope.p3d b/addons/spottingscope/data/ace_spottingscope.p3d index 969d0b37f5..74ded32045 100644 Binary files a/addons/spottingscope/data/ace_spottingscope.p3d and b/addons/spottingscope/data/ace_spottingscope.p3d differ diff --git a/addons/spottingscope/data/ace_spottingscope_glass.rvmat b/addons/spottingscope/data/ace_spottingscope_glass.rvmat index bce3c40b59..c23549f1c8 100644 --- a/addons/spottingscope/data/ace_spottingscope_glass.rvmat +++ b/addons/spottingscope/data/ace_spottingscope_glass.rvmat @@ -1,96 +1,89 @@ -class StageTI -{ - texture="a3\data_f\Default_ti_ca.paa"; +class StageTI { + texture = "a3\data_f\Default_ti_ca.paa"; }; -ambient[]={0.301,0.63999999,0.68000001,1}; -diffuse[]={0.301,0.63999999,0.68000001,1}; -forcedDiffuse[]={0.2,0.34999999,0.2,0}; -emmisive[]={0,0,0,1}; -specular[]={0.67450982,0.64313728,0.50196081,1}; -specularPower=550; -PixelShaderID="Super"; -VertexShaderID="Super"; -class Stage1 -{ - texture="z\ace\addons\spottingscope\data\ace_spottingscope_nohq.paa"; - uvSource="tex"; - class uvTransform - { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; + +ambient[] = {0.301,0.63999999,0.68000001,1}; +diffuse[] = {0.301,0.63999999,0.68000001,1}; +forcedDiffuse[] = {0.2,0.34999999,0.2,0}; +emmisive[] = {0,0,0,1}; +specular[] = {0.67450982,0.64313728,0.50196081,1}; +specularPower = 550; +PixelShaderID = "Super"; +VertexShaderID = "Super"; + +class Stage1 { + texture = "z\ace\addons\spottingscope\data\ace_spottingscope_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[]={6,0,0}; - up[]={0,6,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[] = {6,0,0}; + up[] = {0,6,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 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\spottingscope\data\ace_spottingscope_as.paa"; - 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\spottingscope\data\ace_spottingscope_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\spottingscope\data\ace_spottingscope_smdi.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\spottingscope\data\ace_spottingscope_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,32,128,1)fresnel(4.01,2.86)"; - uvSource="tex"; - class uvTransform - { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; + +class Stage6 { + texture = "#(ai,32,128,1)fresnel(4.01,2.86)"; + 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}; - }; + +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/spottingscope/data/ace_spottingscope_glass_damage.rvmat b/addons/spottingscope/data/ace_spottingscope_glass_damage.rvmat new file mode 100644 index 0000000000..18105269f8 --- /dev/null +++ b/addons/spottingscope/data/ace_spottingscope_glass_damage.rvmat @@ -0,0 +1,84 @@ +class StageTI { + texture = "a3\data_f\default_ti_ca.paa"; +}; + +ambient[] = {1,1,1,1}; +diffuse[] = {1,1,1,1}; +forcedDiffuse[] = {0,0,0,0}; +emmisive[] = {0,0,0,1}; +specular[] = {0.1,0.1,0.1,1}; +specularPower = 1000; +PixelShaderID = "Super"; +VertexShaderID = "Super"; + +class Stage1 { + texture = "a3\data_f\destruct\damage_glass_laminated_nohq.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {2,2,0}; + up[] = {-2,2,0}; + dir[] = {0,0,0}; + pos[] = {-0.05,0.7,0}; + }; +}; + +class Stage2 { + texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)"; + uvSource = "tex"; + class uvTransform { + aside[] = {2,2,0}; + up[] = {-2,2,0}; + dir[] = {0,0,0}; + pos[] = {-0.05,0.7,0}; + }; +}; + +class Stage3 { + texture = "a3\data_f\destruct\damage_glass_laminated_ca.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {2,0,0}; + up[] = {0,2,0}; + dir[] = {0,0,0}; + pos[] = {-0.05,0.7,0}; + }; +}; + +class Stage4 { + texture = "#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource = "tex"; + class uvTransform { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,1}; + pos[] = {0,0,1}; + }; +}; + +class Stage5 { + texture = "a3\data_f\destruct\damage_glass_laminated_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(1.1,0.4)"; + uvSource = "none"; +}; + +class Stage7 { + useWorldEnvMap = "true"; + texture = "a3\data_f\env_land_ca.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,1}; + pos[] = {0,0,0}; + }; +}; diff --git a/addons/spottingscope/data/ace_spottingscope_glass_destruct.rvmat b/addons/spottingscope/data/ace_spottingscope_glass_destruct.rvmat new file mode 100644 index 0000000000..6b0e949b00 --- /dev/null +++ b/addons/spottingscope/data/ace_spottingscope_glass_destruct.rvmat @@ -0,0 +1,78 @@ +class StageTI { + texture = "a3\data_f\default_ti_ca.paa"; +}; + +ambient[] = {1,1,1,1}; +diffuse[] = {1,1,1,1}; +forcedDiffuse[] = {0,0,0,0}; +emmisive[] = {0,0,0,1}; +specular[] = {0.1,0.1,0.1,1}; +specularPower = 1000; +PixelShaderID = "Super"; +VertexShaderID = "Super"; + +class Stage1 { + texture = "a3\data_f\destruct\damage_glass_tempered_nohq.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {2,2,0}; + up[] = {-2,2,0}; + dir[] = {0,0,0}; + pos[] = {-0.05,0.7,0}; + }; +}; + +class Stage2 { + texture = "a3\data_f\destruct\damage_glass_tempered_ca.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {2,0,0}; + up[] = {0,2,0}; + dir[] = {0,0,0}; + pos[] = {-0.05,0.7,0}; + }; +}; + +class Stage3 { + texture = "a3\data_f\destruct\damage_glass_tempered_ca.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {2,0,0}; + up[] = {0,2,0}; + dir[] = {0,0,0}; + pos[] = {-0.05,0.7,0}; + }; +}; + +class Stage4 { + texture = "#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource = "tex"; + class uvTransform { + aside[] = {2,0,0}; + up[] = {0,2,0}; + dir[] = {0,0,1}; + pos[] = {0,0,1}; + }; +}; + +class Stage5 { + texture = "a3\data_f\destruct\damage_glass_tempered_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(1.1,0.4)"; + uvSource = "none"; +}; + +class Stage7 { + useWorldEnvMap = "true"; + texture = "a3\data_f\env_land_ca.paa"; + uvSource="none"; +}; diff --git a/addons/spottingscope/data/ace_spottingscope_item.p3d b/addons/spottingscope/data/ace_spottingscope_item.p3d deleted file mode 100644 index d2de0edf1c..0000000000 Binary files a/addons/spottingscope/data/ace_spottingscope_item.p3d and /dev/null differ diff --git a/addons/spottingscope/data/ace_spottingscope_metal.rvmat b/addons/spottingscope/data/ace_spottingscope_metal.rvmat index 54cfcafeb8..cc610359b0 100644 --- a/addons/spottingscope/data/ace_spottingscope_metal.rvmat +++ b/addons/spottingscope/data/ace_spottingscope_metal.rvmat @@ -1,92 +1,85 @@ -ambient[]={1,1,1,1}; -diffuse[]={1,1,1,1}; -forcedDiffuse[]={0,0,0,0}; -emmisive[]={0,0,0,1}; -specular[]={0.2,0.2,0.2,0}; -specularPower=100; -PixelShaderID="Super"; -VertexShaderID="Super"; -class Stage1 -{ - texture="z\ace\addons\spottingscope\data\ace_spottingscope_nohq.paa"; - uvSource="tex"; - class uvTransform - { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; +ambient[] = {1,1,1,1}; +diffuse[] = {1,1,1,1}; +forcedDiffuse[] = {0,0,0,0}; +emmisive[] = {0,0,0,1}; +specular[] = {0.2,0.2,0.2,0}; +specularPower = 100; +PixelShaderID = "Super"; +VertexShaderID = "Super"; + +class Stage1 { + texture = "z\ace\addons\spottingscope\data\ace_spottingscope_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[]={6,0,0}; - up[]={0,6,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[] = {6,0,0}; + up[] = {0,6,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 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\spottingscope\data\ace_spottingscope_as.paa"; - 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\spottingscope\data\ace_spottingscope_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\spottingscope\data\ace_spottingscope_smdi.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\spottingscope\data\ace_spottingscope_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,32,128,1)fresnel(4.01,2.86)"; - uvSource="tex"; - class uvTransform - { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; + +class Stage6 { + texture = "#(ai,32,128,1)fresnel(4.01,2.86)"; + 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}; - }; + +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/spottingscope/data/ace_spottingscope_metal_damage.rvmat b/addons/spottingscope/data/ace_spottingscope_metal_damage.rvmat new file mode 100644 index 0000000000..e5f86e3252 --- /dev/null +++ b/addons/spottingscope/data/ace_spottingscope_metal_damage.rvmat @@ -0,0 +1,85 @@ +ambient[] = {1,1,1,1}; +diffuse[] = {1,1,1,1}; +forcedDiffuse[] = {0,0,0,0}; +emmisive[] = {0,0,0,1}; +specular[] = {0.2,0.2,0.2,0}; +specularPower = 100; +PixelShaderID = "Super"; +VertexShaderID = "Super"; + +class Stage1 { + texture = "z\ace\addons\spottingscope\data\ace_spottingscope_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 = "a3\data_f\destruct\damage_metal_cdt.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {5,0,0}; + up[] = {0,5,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; +}; + +class Stage3 { + texture = "a3\data_f\destruct\damage_metal_mc.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {3,0,0}; + up[] = {0,3,0}; + dir[] = {0,0,0}; + pos[] = {0.1,0.23,0}; + }; +}; + +class Stage4 { + texture = "z\ace\addons\spottingscope\data\ace_spottingscope_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\spottingscope\data\ace_spottingscope_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,32,128,1)fresnel(4.01,2.86)"; + 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/spottingscope/data/ace_spottingscope_metal_destruct.rvmat b/addons/spottingscope/data/ace_spottingscope_metal_destruct.rvmat new file mode 100644 index 0000000000..cb20b42b6e --- /dev/null +++ b/addons/spottingscope/data/ace_spottingscope_metal_destruct.rvmat @@ -0,0 +1,85 @@ +ambient[] = {1,1,1,1}; +diffuse[] = {1,1,1,1}; +forcedDiffuse[] = {0,0,0,0}; +emmisive[] = {0,0,0,1}; +specular[] = {0.2,0.2,0.2,0}; +specularPower = 100; +PixelShaderID = "Super"; +VertexShaderID = "Super"; + +class Stage1 { + texture = "z\ace\addons\spottingscope\data\ace_spottingscope_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 = "a3\data_f\destruct\destruct_rust_cdt.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {8,8,0}; + up[] = {-8,8,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; +}; + +class Stage3 { + texture = "a3\data_f\destruct\destruct_rust_mca.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {2,0,0}; + up[] = {0,2,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; +}; + +class Stage4 { + texture = "z\ace\addons\spottingscope\data\ace_spottingscope_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\spottingscope\data\ace_spottingscope_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,32,128,1)fresnel(4.01,2.86)"; + 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/spottingscope/data/ace_spottingscope_rubber.rvmat b/addons/spottingscope/data/ace_spottingscope_rubber.rvmat index c31f850e7d..cce570415e 100644 --- a/addons/spottingscope/data/ace_spottingscope_rubber.rvmat +++ b/addons/spottingscope/data/ace_spottingscope_rubber.rvmat @@ -1,85 +1,79 @@ -ambient[]={1,1,1,1}; -diffuse[]={1,1,1,1}; -forcedDiffuse[]={0,0,0,0}; -emmisive[]={0,0,0,1}; -specular[]={0.25,0.25,0.25,1}; -specularPower=90; -PixelShaderID="Super"; -VertexShaderID="Super"; -class Stage1 -{ - texture="z\ace\addons\spottingscope\data\ace_spottingscope_nohq.paa"; - uvSource="tex"; - class uvTransform - { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; +ambient[] = {1,1,1,1}; +diffuse[] = {1,1,1,1}; +forcedDiffuse[] = {0,0,0,0}; +emmisive[] = {0,0,0,1}; +specular[] = {0.25,0.25,0.25,1}; +specularPower = 90; +PixelShaderID = "Super"; +VertexShaderID = "Super"; + +class Stage1 { + texture = "z\ace\addons\spottingscope\data\ace_spottingscope_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[]={6,0,0}; - up[]={0,6,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[] = {6,0,0}; + up[] = {0,6,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 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\spottingscope\data\ace_spottingscope_as.paa"; - 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\spottingscope\data\ace_spottingscope_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\spottingscope\data\ace_spottingscope_smdi.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\spottingscope\data\ace_spottingscope_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(1.5,1.22)"; - uvSource="none"; + +class Stage6 { + texture = "#(ai,64,64,1)fresnel(1.5,1.22)"; + uvSource = "none"; }; -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}; - }; + +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/spottingscope/data/ace_spottingscope_rubber_damage.rvmat b/addons/spottingscope/data/ace_spottingscope_rubber_damage.rvmat new file mode 100644 index 0000000000..b79659c7d7 --- /dev/null +++ b/addons/spottingscope/data/ace_spottingscope_rubber_damage.rvmat @@ -0,0 +1,79 @@ +ambient[] = {1,1,1,1}; +diffuse[] = {1,1,1,1}; +forcedDiffuse[] = {0,0,0,0}; +emmisive[] = {0,0,0,1}; +specular[] = {0.25,0.25,0.25,1}; +specularPower = 90; +PixelShaderID = "Super"; +VertexShaderID = "Super"; + +class Stage1 { + texture = "z\ace\addons\spottingscope\data\ace_spottingscope_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 = "a3\data_f\destruct\destr_rubber_half_dt.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {5,0,0}; + up[] = {0,5,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[] = {3,0,0}; + up[] = {0,3,0}; + dir[] = {0,0,0}; + pos[] = {0.1,0.23,0}; + }; +}; + +class Stage4 { + texture = "z\ace\addons\spottingscope\data\ace_spottingscope_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\spottingscope\data\ace_spottingscope_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(1.5,1.22)"; + uvSource = "none"; +}; + +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/spottingscope/data/ace_spottingscope_tube.p3d b/addons/spottingscope/data/ace_spottingscope_tube.p3d new file mode 100644 index 0000000000..c83199d50b Binary files /dev/null and b/addons/spottingscope/data/ace_spottingscope_tube.p3d differ diff --git a/addons/spottingscope/data/material_dummy.p3d b/addons/spottingscope/data/material_dummy.p3d new file mode 100644 index 0000000000..ef8cd713ab Binary files /dev/null and b/addons/spottingscope/data/material_dummy.p3d differ diff --git a/addons/spottingscope/data/model.cfg b/addons/spottingscope/data/model.cfg index 71eb918bf7..86d50db6ca 100644 --- a/addons/spottingscope/data/model.cfg +++ b/addons/spottingscope/data/model.cfg @@ -1,10 +1,10 @@ -class CfgSkeletons -{ +class CfgSkeletons { class Default { isDiscrete = 1; skeletonInherit = ""; skeletonBones[] = {}; }; + class ace_spottingscope_skeleton: Default { isDiscrete = 1; skeletonInherit = "Default"; @@ -13,19 +13,23 @@ class CfgSkeletons "main_gun","main_turret", "leg_01","", "leg_02","", - "leg_03","" + "leg_03","", + "hideTurret","" }; }; }; + class CfgModels { class Default { sectionsInherit = ""; sections[] = {}; skeletonName = ""; }; + class ace_spottingscope: Default { skeletonName = "ace_spottingscope_skeleton"; sectionsInherit = "Default"; + class animations { class mainTurret { type = "rotationY"; @@ -51,20 +55,35 @@ class CfgModels { type = "rotation"; source = "fold_legs"; selection = "leg_01"; - axis="leg_01_axis"; + axis = "leg_01_axis"; minValue = 0; maxValue = 1; - angle0="rad +00"; - angle1="rad +55"; + angle0 = "rad +00"; + angle1 = "rad +55"; }; class leg_02: leg_01 { selection = "leg_02"; - axis="leg_02_axis"; + axis = "leg_02_axis"; }; class leg_03: leg_01 { selection = "leg_03"; - axis="leg_03_axis"; + axis = "leg_03_axis"; + }; + class hideTube { + type = "hide"; + source = "damage"; + selection = "main_gun"; + minValue = 0.0; + maxValue = 1.0; + hideValue = 1.0; + animPeriod = 0.0; + initPhase = 0.0; }; }; }; + + class ace_spottingscope_tube: Default { + skeletonName = "ace_spottingscope_skeleton"; + sectionsInherit = "Default"; + }; }; diff --git a/addons/spottingscope/data/preview_spottingscope.jpg b/addons/spottingscope/data/preview_spottingscope.jpg new file mode 100644 index 0000000000..ebd7a9d522 Binary files /dev/null and b/addons/spottingscope/data/preview_spottingscope.jpg 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 00ba2e2eb9..fdf621a29e 100644 --- a/addons/spottingscope/stringtable.xml +++ b/addons/spottingscope/stringtable.xml @@ -14,6 +14,8 @@ Luneta de observador 観測用スコープ 감적 망원경 + 观测镜 + 觀測鏡 Pick up Spotting Scope @@ -28,6 +30,8 @@ Pegar luneta de observador 観測用スコープを拾う 감적 망원경 줍기 + 捡起观测镜 + 撿起觀測鏡 Place Spotting Scope @@ -42,6 +46,8 @@ Colocar luneta de observador 観測用スコープを置く 감적 망원경 배치 + 放置观测镜 + 放置觀測鏡 diff --git a/addons/switchunits/ACE_Settings.hpp b/addons/switchunits/ACE_Settings.hpp index e3fc653cb2..31c74f2889 100644 --- a/addons/switchunits/ACE_Settings.hpp +++ b/addons/switchunits/ACE_Settings.hpp @@ -1,42 +1,50 @@ class ACE_Settings { class GVAR(enableSwitchUnits) { + category = CSTRING(DisplayName); value = 0; typeName = "BOOL"; }; class GVAR(switchToWest) { + category = CSTRING(DisplayName); displayName = CSTRING(SwitchToWest_DisplayName); description = CSTRING(SwitchToWest_Description); value = 0; typeName = "BOOL"; }; class GVAR(switchToEast) { + category = CSTRING(DisplayName); displayName = CSTRING(SwitchToEast_DisplayName); description = CSTRING(SwitchToEast_Description); value = 0; typeName = "BOOL"; }; class GVAR(switchToIndependent) { + category = CSTRING(DisplayName); displayName = CSTRING(SwitchToIndependent_DisplayName); description = CSTRING(SwitchToIndependent_Description); value = 0; typeName = "BOOL"; }; class GVAR(switchToCivilian) { + category = CSTRING(DisplayName); displayName = CSTRING(SwitchToCivilian_DisplayName); description = CSTRING(SwitchToCivilian_Description); value = 0; typeName = "BOOL"; }; class GVAR(enableSafeZone) { + category = CSTRING(DisplayName); displayName = CSTRING(EnableSafeZone_DisplayName); description = CSTRING(EnableSafeZone_Description); value = 1; typeName = "BOOL"; }; class GVAR(safeZoneRadius) { + category = CSTRING(DisplayName); displayName = CSTRING(SafeZoneRadius_DisplayName); description = CSTRING(SafeZoneRadius_Description); value = 100; typeName = "SCALAR"; + sliderSettings[] = {0, 1000, 100, 0}; }; }; diff --git a/addons/switchunits/CfgVehicles.hpp b/addons/switchunits/CfgVehicles.hpp index 1e12cc03d6..bb07eb541c 100644 --- a/addons/switchunits/CfgVehicles.hpp +++ b/addons/switchunits/CfgVehicles.hpp @@ -3,9 +3,9 @@ class CfgVehicles { class ACE_ModuleSwitchUnits: ACE_Module { author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = CSTRING(Module_DisplayName); + displayName = CSTRING(DisplayName); function = FUNC(module); - scope = 2; + scope = 1; isGlobal = 1; icon = QPATHTOF(UI\Icon_Module_SwitchUnits_ca.paa); class Arguments { 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/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/functions/fnc_module.sqf b/addons/switchunits/functions/fnc_module.sqf index 5170cebfb9..c7762855a4 100644 --- a/addons/switchunits/functions/fnc_module.sqf +++ b/addons/switchunits/functions/fnc_module.sqf @@ -17,8 +17,6 @@ */ #include "script_component.hpp" -if !(isServer) exitWith {}; - params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; @@ -33,6 +31,6 @@ GVAR(Module) = true; [_logic, QGVAR(EnableSafeZone), "EnableSafeZone"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(SafeZoneRadius), "SafeZoneRadius"] call EFUNC(common,readSettingFromModule); -[QGVAR(EnableSwitchUnits), true, false, true] call EFUNC(common,setSetting); +["CBA_settings_setSettingMission", [QGVAR(EnableSwitchUnits), true, true]] call CBA_fnc_localEvent; INFO("SwitchUnits Module Initialized."); diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index c86142c877..cf222f5804 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -1,6 +1,13 @@  + + Switch Units + Cambio Unità + 切換單位 + 切换单位 + ユニット切り替え + Switched unit Einheit gewechselt @@ -10,10 +17,12 @@ Cambiado de unidad Unité changée Egység átváltva - Cambia unità + Unità cambiata Trocado de unidade ユニットを切り替え - 인원으로 전환 + 切换单位 + 切換單位 + 인원 전환 Trying to switch @@ -27,6 +36,8 @@ Попытка переключения 切り替えを試す 전환 시도중 + 尝试切换中 + 嘗試切換中 This unit is too close to the enemy. @@ -41,20 +52,8 @@ Essa unidade está muito perto do inimigo. このユニットは敵に近すぎます。 그 인원은 적과 너무 가깝습니다. - - - SwitchUnits System - System zmiany stron - Sistema de cambio de unidad - Einheiten-Wechsel-System - Systém výměny stran - Sistema de troca de unidades - Système de changement d'unité - Egységváltó-rendszer - Переключение между юнитами - Sistema Cambio Unità - SwitchUnits システム - 인원전환 시스템 + 这单位太接近敌人了 + 這單位太接近敵人了 Switch to West? @@ -67,8 +66,10 @@ Átváltás BLUFOR-ra? На синих? Cambia per BLUFOR? - ウエストへ切り替えますか? - 서방으로 전환합니까? + 同盟軍へ切り替えますか? + 切换至蓝方? + 切換至藍方? + 청군으로 전환합니까? Allow switching to west units? @@ -81,8 +82,10 @@ Nyugat-fakciós egységekre való váltás engedélyezése? Разрешить переключаться на синих юнитов? Consenti passaggio ad unità BLUFOR? - ウエスト側ユニットへ切り替えられるようにしますか? - 서방 인원으로 전환합니까? + 同盟軍側ユニットへ切り替えられるようにしますか? + 允许切换至蓝方? + 允許切換至藍方? + 청군 인원으로 전환합니까? Switch to East? @@ -95,8 +98,10 @@ Átváltás OPFOR-ra? На красных? Cambia per OPFOR? - イースト側へ切り替えますか? - 동방으로 전환합니까? + OPFOR軍側へ切り替えますか? + 切换至红方? + 切換至紅方? + 대항군으로 전환합니까? Allow switching to east units? @@ -109,8 +114,10 @@ Kelet-fakciós egységekre való váltás engedélyezése? Разрешить переключаться на красных юнитов? Consenti passaggio ad unità OPFOR? - イースト側ユニットへ切り替えられるようにしますか? - 동방인원으로 전환합니까? + OPFOR軍側ユニットへ切り替えられるようにしますか? + 允许切换至红方? + 允許切換至紅方? + 대항군 인원으로 전환합니까? Switch to Independent? @@ -123,8 +130,10 @@ Átváltás INDFOR-ra? На независимых? Cambia per INDFOR? - インデペンデントへ切り替えますか? - 중립으로 전환합니까? + 独立軍へ切り替えますか? + 切换至独立方? + 切換至獨立方? + 독립군 으로 전환합니까? Allow switching to independent units? @@ -137,8 +146,10 @@ Független egységekre való váltás engedélyezése? Разрешить переключаться на независимых юнитов? Consenti passaggio ad unità INDFOR? - インデペンデント側ユニットへ切り替えられるようにしますか? - 중립 인원으로 전환합니까? + 独立軍側ユニットへ切り替えられるようにしますか? + 允许切换至独立方? + 允許切換至獨立方? + 독립군 인원으로 전환합니까? Switch to Civilian? @@ -151,8 +162,10 @@ Átváltás civilre? На гражданских? Cambia per Civili? - シビリアンへ切り替えますか? + 市民へ切り替えますか? 민간인으로 전환합니까? + 切换至平民方? + 切換至平民方? Allow switching to civilian units? @@ -165,8 +178,10 @@ Civil egységekre való váltás engedélyezése? Разрешить переключаться на гражданских юнитов? Consenti passaggio ad unità civili? - シビリアン側ユニットへ切り替えられるようにしますか? + 市民側ユニットへ切り替えられるようにしますか? 민간인으로 전환하는걸 허가합니까? + 允许切换至平民方? + 允許切換至平民方? Enable Safe Zone? @@ -179,8 +194,10 @@ Biztonságos zóna engedélyezése? Безопасная зона Abilita Zona Sicura? - 安全地帯を有効にしますか? + 安全地帯を有効にしますか? 안전 지대 활성화? + 启用安全区? + 啟用安全區? Enable a safe zone around enemy units? Players can't switch to units inside of the safe zone. @@ -193,8 +210,10 @@ Engedélyezve legyen-e egy biztonságos zóna az ellenségek körül? A játékosok nem tudnak a biztonságos zónán belüli egységekre váltani. Включить безопасную зону вокруг вражеских юнитов? Игроки не могут переключаться на юнитов, находящихся в безопасной зоне. Abilita una zona sicura attorno ad unità nemiche? I giocatori non possono cambiare ad unità dentro la zona sicura. - 敵ユニットから逃れる安全地帯を有効にしますか?プレイヤーは安全地帯内のユニットへ切り替えできません。 + 敵ユニットから逃れる安全地帯を有効にしますか?プレイヤーは安全地帯内のユニットへ切り替えできません。 적 주위로 안전 지대를 활성화합니까? 안전 지대 내에서는 플레이어가 인원 전환을 할 수 없습니다. + 启用敌方周围安全地带? 玩家不能切换到安全区内的单位 + 啟用敵方周圍安全地帶? 玩家不能切換到安全區內的單位 Safe Zone Radius @@ -209,6 +228,8 @@ Raggio Zona Sicura 安全地帯の半径 안전 지대 반경 + 安全区半径 + 安全區半徑 The safe zone around players from a different team. Default: 200 @@ -221,8 +242,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. @@ -236,6 +259,8 @@ El módulo permite a las unidades cambiar de bando durante el juego. モジュールはゲームにおいて、陣営の切り替えを有効にします。 이 모듈은 당신을 게임 중에 진영을 바꿀 수 있게 해줍니다. + 此模块允许你在游戏中切换至另一方 + 此模塊允許你在遊戲中切換至另一方 diff --git a/addons/tacticalladder/CfgVehicles.hpp b/addons/tacticalladder/CfgVehicles.hpp index 564a034614..591f2c86af 100644 --- a/addons/tacticalladder/CfgVehicles.hpp +++ b/addons/tacticalladder/CfgVehicles.hpp @@ -21,6 +21,7 @@ class CfgVehicles { class Bag_Base; class ACE_TacticalLadder_Pack: Bag_Base { scope = 2; + author = ECSTRING(common,ACETeam); displayName = CSTRING(DisplayName); descriptionShort = ""; model = QPATHTOF(data\ace_tacticalladder_pack.p3d); diff --git a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf index f66dd79a25..098429bcec 100644 --- a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -24,6 +24,7 @@ if (_key != 1 || {isNull GVAR(ladder)}) exitWith {}; // enable running again [_unit, "forceWalk", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); detach GVAR(ladder); diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf index 3703fe1f47..9f1c5c14bb 100644 --- a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -20,11 +20,10 @@ params ["_unit", "_ladder"]; // enable running again [_unit, "forceWalk", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "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..1e023b22b0 100644 --- a/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf +++ b/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf @@ -8,12 +8,15 @@ * Return Value: * None * + * Example: + * [bob] call ace_tacticalladder_fnc_handleInteractMenuOpened + * * Public: No */ #include "script_component.hpp" params ["_unit"]; -if (!isNull (GETMVAR(GVAR(ladder),objNull)) && {GVAR(ladder) in attachedObjects _unit}) then { +if (!isNull GETMVAR(GVAR(ladder),objNull) && {GVAR(ladder) in attachedObjects _unit}) then { [_unit, GVAR(ladder)] call FUNC(cancelTLdeploy); }; diff --git a/addons/tacticalladder/functions/fnc_handleKilled.sqf b/addons/tacticalladder/functions/fnc_handleKilled.sqf index c5d6aa1314..0983901010 100644 --- a/addons/tacticalladder/functions/fnc_handleKilled.sqf +++ b/addons/tacticalladder/functions/fnc_handleKilled.sqf @@ -8,12 +8,15 @@ * Return Value: * None * + * Example: + * [bob] call ace_tacticalladder_fnc_handleKilled + * * Public: No */ #include "script_component.hpp" params ["_unit"]; -if (!isNull (GETMVAR(ladder,objNull)) && {GVAR(ladder) in attachedObjects _unit}) then { +if (!isNull GETMVAR(ladder,objNull) && {GVAR(ladder) in attachedObjects _unit}) then { [_unit, GVAR(ladder)] call FUNC(cancelTLdeploy); }; diff --git a/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf b/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf index 07118acbaf..f2bac289d1 100644 --- a/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf +++ b/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf @@ -9,11 +9,14 @@ * Return Value: * None * + * Example: + * [bob, kevin] call ace_tacticalladder_fnc_handlePlayerChanged + * * Public: No */ #include "script_component.hpp" -if (isNull (GETGVAR(ladder,objNull))) exitWith {}; +if (isNull GETGVAR(ladder,objNull)) exitWith {}; params ["_newPlayer", "_oldPlayer"]; 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..9d6f8ad23e 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 (!isNull (GETMVAR(ladder,objNull)) && {GVAR(ladder) in attachedObjects _unit}) then { +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/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf index c47733dd5a..a52211884c 100644 --- a/addons/tacticalladder/functions/fnc_positionTL.sqf +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -22,6 +22,7 @@ params ["_unit", "_ladder"]; // prevent the placing unit from running [_unit, "forceWalk", "ACE_Ladder", true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_Ladder", true] call EFUNC(common,statusEffect_set); { _ladder animate [_x, 0]; diff --git a/addons/tacticalladder/stringtable.xml b/addons/tacticalladder/stringtable.xml index 18c817c7f2..e94a292bc1 100644 --- a/addons/tacticalladder/stringtable.xml +++ b/addons/tacticalladder/stringtable.xml @@ -14,6 +14,8 @@ Escada telescópica タクティカル ラダー 로프 사다리 + 伸缩梯子 + 伸縮梯子 Deploy ladder @@ -28,6 +30,8 @@ Implantar escada ラダーを設置 사다리 배치 + 布署梯子 + 佈署梯子 Drop ladder @@ -42,6 +46,8 @@ Derrubar escada ラダーを落とす 사다리 놓기 + 降下梯子 + 降下梯子 Extend @@ -55,6 +61,8 @@ Déployer 伸ばす 늘리기 + 伸长梯子 + 伸長梯子 +Ctrl tilt @@ -68,6 +76,8 @@ +Ctrl per inclinare +Ctrl で傾ける +컨트롤키 기울이기 + +Ctrl 倾斜 + +Ctrl 傾斜 Position ladder @@ -82,6 +92,8 @@ Posicionar escada ラダーの位置 사다리 위치 + 梯子位置 + 梯子位置 Pickup ladder @@ -96,6 +108,8 @@ Pegar escada ラダーを拾う 사다리 줍기 + 捡起梯子 + 撿起梯子 diff --git a/addons/tagging/CfgVehicles.hpp b/addons/tagging/CfgVehicles.hpp index 1ba838aab6..204e902641 100644 --- a/addons/tagging/CfgVehicles.hpp +++ b/addons/tagging/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(Tagging); function = QFUNC(moduleInit); - scope = 2; + scope = 1; isGlobal = 1; icon = QPATHTOF(UI\Icon_Module_Tagging_ca.paa); class Arguments { 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/functions/fnc_moduleInit.sqf b/addons/tagging/functions/fnc_moduleInit.sqf index 235bd3a046..7430ce4981 100644 --- a/addons/tagging/functions/fnc_moduleInit.sqf +++ b/addons/tagging/functions/fnc_moduleInit.sqf @@ -10,12 +10,13 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_tagging_fnc_moduleInit + * * Public: No */ #include "script_component.hpp" -if (!isServer) exitWith {}; - params ["_logic", "", "_activated"]; if (!_activated) exitWith {}; diff --git a/addons/tagging/functions/fnc_quickTag.sqf b/addons/tagging/functions/fnc_quickTag.sqf index 7f0a1d706e..63a93e9946 100644 --- a/addons/tagging/functions/fnc_quickTag.sqf +++ b/addons/tagging/functions/fnc_quickTag.sqf @@ -22,19 +22,22 @@ if (GVAR(quickTag) == 0) exitWith {}; params ["_unit"]; private _possibleTags = []; +private _useRandom = false; // Last Used if (GVAR(quickTag) == 1) then { private _lastUsedTagClass = _unit getVariable [QGVAR(lastUsedTag), nil]; - if (!isNil "_lastUsedTagClass") then { + if (isNil "_lastUsedTagClass") then { + _useRandom = true; + } else { private _lastUsedTag = GVAR(cachedTags) select {(_x select 0) == _lastUsedTagClass}; _possibleTags = _lastUsedTag; }; }; // Random X -if (GVAR(quickTag == 2)) then { +if ((GVAR(quickTag) == 2) || _useRandom) then { private _xTags = GVAR(cachedTags) select {(_x select 0) in ["ACE_XBlack", "ACE_XRed", "ACE_XGreen", "ACE_XBlue"]}; _possibleTags = _xTags; }; diff --git a/addons/tagging/stringtable.xml b/addons/tagging/stringtable.xml index ab5866dbfa..ec79c4960a 100644 --- a/addons/tagging/stringtable.xml +++ b/addons/tagging/stringtable.xml @@ -10,6 +10,8 @@ 뿌리기 Marquage Marcamento + 喷漆 + 噴漆 Configure how the tagging system will operate by default. @@ -20,9 +22,11 @@ 뿌리기 시스템의 기본사항을 설정합니다. Configure le fonctionnement par défaut du système de marquage. Configura quanto il sistema di marcamento agirà da se. + 定义喷漆系统预设设定 + 定義噴漆系統預設設定 - Quick Tag + Spray Paint - Quick Tag Быстрый маркер クイック タグ Szybkie tagowanie @@ -30,36 +34,44 @@ 빠른 뿌리기 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印 + 無作為なX印 Losowy X Zufällig X 무작위 X Aléatoire X Random X + 随机X标记 + 隨機X標記 Random @@ -70,6 +82,8 @@ 무작위 Aléatoire Random + 随机 + 隨機 Tag @@ -83,6 +97,8 @@ タグ 뿌리기 Tag + 喷漆 + 噴漆 X black @@ -94,8 +110,10 @@ X černě X em preto Черный Х - 黒の X印 + 黒のX印 검정 X + 黑色X标记 + 黑色X標記 X red @@ -107,8 +125,10 @@ X červeně X em vermelho Красный Х - 赤の X印 + 赤のX印 빨간 X + 红色X标记 + 紅色X標記 X green @@ -120,8 +140,10 @@ X zeleně X em verde Зеленый Х - 緑の X印 + 緑のX印 초록 X + 绿色X标记 + 綠色X標記 X blue @@ -133,8 +155,10 @@ X modře X em azul Синий Х - 青の X印 + 青のX印 파랑 X + 蓝色X标记 + 藍色X標記 Black spray paint @@ -148,6 +172,8 @@ Черный спрей 黒のスプレー缶 검정 스프레이 + 黑色喷漆 + 黑色噴漆 Red spray paint @@ -161,6 +187,8 @@ Красный спрей 赤のスプレー缶 빨강 스프레이 + 红色喷漆 + 紅色噴漆 Green spray paint @@ -174,6 +202,8 @@ Зеленый спрей 緑のスプレー缶 초록 스프레이 + 绿色喷漆 + 綠色噴漆 Blue spray paint @@ -187,6 +217,8 @@ Синий спрей 青のスプレー缶 파랑 스프레이 + 蓝色喷漆 + 藍色噴漆 A can of spray paint for tagging walls. @@ -200,6 +232,8 @@ Балончик спрея для рисования маркеров на стенах. スプレー缶は壁にタグ付できます。 벽에 뿌릴 수 있는 스프레이캔 입니다. + 喷漆可喷涂在墙壁上 + 噴漆可噴塗在牆壁上 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/README.md b/addons/trenches/README.md index 7ebfbe238b..8b4a0d7a36 100644 --- a/addons/trenches/README.md +++ b/addons/trenches/README.md @@ -4,6 +4,16 @@ ace_trenches Adds item 'ACE_entrenchingtool' Adds 2 trenches; Envelope - Small & Envelop - Big +### Whitelist surfaces for digging +Single surfaces can be whitelisted by adding `ACE_canDig = 1` into `CfgSurfaces`. +Example: +```cpp +class CfgSurfaces { + class myAwesomeSurface { + ACE_canDig = 1; + }; +}; +``` ## Maintainers 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_placeCancel.sqf b/addons/trenches/functions/fnc_placeCancel.sqf index b3d6bf78da..1eaf7298a1 100644 --- a/addons/trenches/functions/fnc_placeCancel.sqf +++ b/addons/trenches/functions/fnc_placeCancel.sqf @@ -22,6 +22,7 @@ if (_key != 1 || {GVAR(digPFH) == -1}) exitWith {}; // enable running again [_unit, "forceWalk", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); // delete placement dummy deleteVehicle GVAR(trench); diff --git a/addons/trenches/functions/fnc_placeConfirm.sqf b/addons/trenches/functions/fnc_placeConfirm.sqf index 7c3be2d901..08c774d8c9 100644 --- a/addons/trenches/functions/fnc_placeConfirm.sqf +++ b/addons/trenches/functions/fnc_placeConfirm.sqf @@ -19,6 +19,7 @@ params ["_unit"]; // enable running again [_unit, "forceWalk", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); // remove dig pfh [GVAR(digPFH)] call CBA_fnc_removePerFrameHandler; @@ -50,9 +51,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..94826fb346 100644 --- a/addons/trenches/functions/fnc_placeTrench.sqf +++ b/addons/trenches/functions/fnc_placeTrench.sqf @@ -28,6 +28,7 @@ TRACE_1("",GVAR(trenchPlacementData)); // prevent the placing unit from running [_unit, "forceWalk", "ACE_Trenches", true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", "ACE_Trenches", true] call EFUNC(common,statusEffect_set); // create the trench private _trench = createVehicle [_noGeoModel, [0, 0, 0], [], 0, "NONE"]; @@ -67,9 +68,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 1fee5489df..a0413a3346 100644 --- a/addons/trenches/stringtable.xml +++ b/addons/trenches/stringtable.xml @@ -5,7 +5,7 @@ Entrenching Tool Klappspaten Saperka - Pala + Pala da Trincea Pala para trincheras Outil de tranchée Polní lopatka @@ -13,12 +13,14 @@ Саперная лопата シャベル 야전삽 + 战备锹 + 戰備鍬 Entrenching Tool Saperka, używana do budowy wnęk Mit dem Klappspaten können Erdwälle oder Gräben ausgehoben werden. - Pala + Pala da Trincea Pala para trincheras Outil de tranchée Polní lopatky se používají k zákopovým a jiným pracem. @@ -26,6 +28,8 @@ Саперная лопата シャベル 야전용 삽. 군인들의 영원한 친구 + 战备锹 + 戰備鍬 Envelope - Small @@ -38,6 +42,8 @@ Окоп - Малый 塹壕 - 小型 참호 - 소형 + 掩体 - 小 + 掩體 - 小 Small Personal Trench @@ -51,6 +57,8 @@ Малый персональный окоп 小型の個人用塹壕 소형 개인참호 + 小型个人掩体 + 小型個人掩體 Dig Small Trench @@ -64,6 +72,8 @@ Вырыть малый окоп 小型塹壕を掘る 소형참호 파기 + 盖小掩体 + 蓋小掩體 Envelope - Big @@ -76,6 +86,8 @@ Окоп - Большой 塹壕 - 大型 참호 - 대형 + 掩体 - 大 + 掩體 - 大 Large Personal Trench @@ -89,6 +101,8 @@ Большой персональный окоп 大型の塹壕を掘る 대형 참호 + 大型个人掩体 + 大型個人掩體 Dig Big Trench @@ -102,12 +116,14 @@ Вырыть большой окоп 大型の塹壕を掘る 대형참호 파기 + 盖大掩体 + 蓋大掩體 Confirm Dig Graben bestätigen Potwierdź kopanie - Conferma Scava + Conferma Scavo Confirmar cavado Confirmer la creusée Potvrdit kopání @@ -115,12 +131,14 @@ Копать ここに掘る 여기에 파기 + 确认开工 + 確認開工 Cancel Dig Graben abbrechen Anuluj kopanie - Cancella Scava + Annulla Scavo Cancelar cavado Annuler la creusée Zrušit kopání @@ -128,6 +146,8 @@ Отменить копание 掘るのを中止 취소하기 + 取消动作 + 取消動作 Rotate @@ -142,6 +162,8 @@ Bращать 回転 돌리기 + 旋转 + 旋轉 Digging Trench @@ -155,6 +177,8 @@ Копание окопа 塹壕を掘っている 참호 파는중 + 正在盖掩体中 + 正在蓋掩體中 Continue Digging Trench @@ -166,7 +190,9 @@ 塹壕を掘りつづける Graben fortsetzen 계속해서 참호파기 - Continua a Scavare la Trincea + Continuando a Scavare la Trincea + 继续盖掩体 + 繼續蓋掩體 Remove Trench @@ -178,7 +204,9 @@ 塹壕を消す Schützengraben entfernen 참호 제거 - Rimuove Trincea + Rimuovi Trincea + 移除掩体 + 移除掩體 Removing Trench @@ -187,10 +215,12 @@ Retirement de la tranchée Убирание окопа Odstraňuji zákop - 塹壕を消している + 塹壕を消しています Entferne Schützengraben 참호 제거중... Rimuovendo la Trincea + 移除掩体中 + 移除掩體中 diff --git a/addons/tripod/CfgWeapons.hpp b/addons/tripod/CfgWeapons.hpp index 3c5ca6d2b1..4e609f4f3d 100644 --- a/addons/tripod/CfgWeapons.hpp +++ b/addons/tripod/CfgWeapons.hpp @@ -1,16 +1,16 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_Tripod: ACE_ItemCore { - author[] = {"Rocko", "Scubaman3D"}; + author = "Rocko, Scubaman3D"; scope = 2; displayName = CSTRING(DisplayName); descriptionShort = ""; 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/functions/fnc_adjust.sqf b/addons/tripod/functions/fnc_adjust.sqf index b12f713ace..b81f9fa961 100644 --- a/addons/tripod/functions/fnc_adjust.sqf +++ b/addons/tripod/functions/fnc_adjust.sqf @@ -25,6 +25,7 @@ GVAR(adjustPFH) = [{ if (!(_unit getVariable [QGVAR(adjusting), false]) || {isNull _tripod} || {_unit distance _tripod > 5}) exitWith { call EFUNC(interaction,hideMouseHint); + [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); [_unit, "DefaultAction", _unit getVariable [QGVAR(Adjust), -1]] call EFUNC(common,removeActionEventHandler); @@ -37,6 +38,7 @@ GVAR(adjustPFH) = [{ }, 0, [_unit, _tripod]] call CBA_fnc_addPerFrameHandler; +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); // add mouse button action and hint [localize "STR_ACE_Tripod_Done", "", localize "STR_ACE_Tripod_ScrollAction"] call EFUNC(interaction,showMouseHint); 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 557900ee96..a63bda06b0 100644 --- a/addons/tripod/stringtable.xml +++ b/addons/tripod/stringtable.xml @@ -14,6 +14,8 @@ Kit SSWT SSWT キット SSWT 키트 + 狙击手专用三脚架 + 狙擊手專用三腳架 Place SSWT Kit @@ -28,6 +30,8 @@ Colocar kit SSWT SSWT キットを置く SSWT 키트 배치 + 放置狙击手专用三脚架 + 放置狙擊手專用三腳架 Pick up SSWT Kit @@ -42,6 +46,8 @@ Prendi Kit SSWT SSWT キットを拾う SSWT 키트 줍기 + 捡起狙击手专用三脚架 + 撿起狙擊手專用三腳架 Adjust SSWT Kit @@ -56,6 +62,8 @@ Aggiusta Kit SSWT SSWT キットを調節 SSWT 키트 조절 + 调整狙击手专用三脚架 + 調整狙擊手專用三腳架 Done @@ -70,6 +78,8 @@ Fatto 完了 완료 + 完成 + 完成 adjust @@ -84,6 +94,8 @@ aggiusta 調節 조절 + 调整 + 調整 diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index 563cf22ce1..4cafe37429 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(ModuleName); function = QFUNC(moduleInit); - scope = 2; + scope = 1; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); class Arguments { diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf index 79a9ef2d93..a8328c653d 100644 --- a/addons/ui/functions/fnc_moduleInit.sqf +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -9,11 +9,14 @@ * * Return Value: * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_ui_fnc_moduleInit + * + * Public: No */ #include "script_component.hpp" -if (!isServer) exitWith {}; - params ["_logic", "_units", "_activated"]; if (!_activated) exitWith {}; diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 1bc2f8d888..11013cf28b 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -12,6 +12,8 @@ Benutzeroberfläche 사용자 인터페이스 Interfaccia Utente + 使用者介面 + 使用者介面 User Interface @@ -24,17 +26,21 @@ 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 @@ -42,11 +48,13 @@ Permitir IU Selecionável Permettre l'IU selective Включить настраиваемый интерфейс - 選択できるユーザ インタフェイスを有効化します + UI 選択性を許可 Zezwól na selektywne UI Erlaube selektives UI 선택적 사용자 인터페이스 허가 Permette l'UI Selettiva + 允许调整使用者介面 + 允許調整使用者介面 Allow client to modify their UI. @@ -59,6 +67,8 @@ Erlaube Clients, ihr UI zu modifizieren. 클라이언트가 선택적 사용자 인터페이스 사용하는것을 허가합니다 Permette al client di modificare la propria UI. + 允许客户端自行调整使用者介面 + 允許客戶端自行調整使用者介面 Soldier/Vehicle/Weapon Information @@ -71,6 +81,8 @@ Soldat/Fahrzeug/Waffe Information 병사/차량/무기 정보 Informazioni Soldato/Veicolo/Arma + 士兵/载具/武器资讯栏 + 士兵/載具/武器資訊欄 Vehicle Radar @@ -83,6 +95,8 @@ Fahrzeugradar 차량 레이더 Rada Veicolo + 载具雷达 + 載具雷達 Vehicle Compass @@ -95,6 +109,8 @@ Fahrzeugkompass 차량 나침반 Bussola Veicolo + 载具指北针 + 載具指北針 Command Menu @@ -107,6 +123,8 @@ Kommandomenü 지휘 메뉴 Menù di Comando + 指挥选单 + 指揮選單 Group Bar @@ -119,6 +137,8 @@ Gruppenleiste 그룹 막대 Barra del Gruppo + 小队状态栏 + 小隊狀態欄 Weapon Name @@ -131,6 +151,8 @@ Waffenname 무기 이름 Nome Arma + 武器名称 + 武器名稱 Weapon Name Background @@ -143,6 +165,8 @@ Waffenname Hintergrund 무기 이름 배경 Nome Sfondo Arma + 武器名称背景 + 武器名稱背景 Firing Mode @@ -155,6 +179,8 @@ Feuermodus 사격 모드 Modalità di Fuoco + 射击模式 + 射擊模式 Ammo Type @@ -167,6 +193,8 @@ Munitionstyp 탄종 Tipo Munizioni + 弹药类型 + 彈藥類型 Ammo Count @@ -179,6 +207,8 @@ Munitionsanzahl 탄약수 Contatore Munizioni + 弹药数量 + 彈藥數量 Magazine Count @@ -191,6 +221,8 @@ Magazinanzahl 탄창수 Contatore Caricatore + 弹匣数量 + 彈匣數量 Throwable Type @@ -203,6 +235,8 @@ Wurfobjekt-Typ 투척물 종류 Tipo Lanciabile + 投掷物类型 + 投擲物類型 Throwable Count @@ -215,6 +249,8 @@ Wurfobjekt-Anzahl 투척물 개수 Contatore Lanciabili + 投掷物数量 + 投擲物數量 Zeroing @@ -227,6 +263,8 @@ Nullung 영점 Azzeramento + 归零距离 + 歸零距離 Weapon Lower Info Background @@ -238,6 +276,8 @@ Hintergrund der unteren Waffen-Info-Leiste 무기 상세 정보 배경 Informazioni Sfondo Arma Bassa + 武器底部资讯栏背景 + 武器底部資訊欄背景 Stance @@ -250,6 +290,8 @@ Haltung 자세 Postura + 姿态 + 姿態 Stamina Bar @@ -262,6 +304,8 @@ Ausdaueranzeige 체력 막대 Barra Stamina + 体力栏 + 體力欄 Gunner Weapon Name @@ -273,6 +317,8 @@ Richtschütze Waffenname 사수 무기 명칭 Nome Arma Artigliere + 炮手武器名称 + 砲手武器名稱 Gunner Weapon Name Background @@ -284,6 +330,8 @@ Richtschütze Waffenname Hintergrund 사수 무기 명칭 배경 Nome Sfondo Arma Artigliere + 炮手武器名称背景 + 砲手武器名稱背景 Gunner Firing Mode @@ -295,6 +343,8 @@ Richtschütze Feuermodus 사수 사격 모드 Modalità di Fuoco Artigliere + 炮手射击模式 + 砲手射擊模式 Gunner Ammo Type @@ -306,6 +356,8 @@ Richtschütze Munitionstyp 사수 탄종 Tipo Munizioni Artigliere + 炮手弹药类型 + 砲手彈藥類型 Gunner Ammo Count @@ -317,6 +369,8 @@ Richtschütze Munitionsanzahl 사수 탄약 수량 Contatore Munizioni Artigliere + 炮手弹药数量 + 砲手彈藥數量 Gunner Magazine Count @@ -328,6 +382,8 @@ Richtschütze Magazinanzahl 사수 탄창 수량 Contatore Caricatore Artigliere + 炮手弹匣数量 + 砲手彈匣數量 Gunner Launchable Type @@ -339,6 +395,8 @@ Richtschütze Raketentyp 사수 발사체 종류 Tipo Lanciabile Artigliere + 炮手发射物类型 + 砲手發射物類型 Gunner Launchable Count @@ -350,6 +408,8 @@ Richtschütze Raketenanzahl 사수 발사체 수량 Contatore Lanciabili Artigliere + 炮手发射物数量 + 砲手發射物數量 Gunner Zeroing @@ -361,6 +421,8 @@ Richtschütze Nullung 사수 영점 Azzeramento Artigliere + 炮手归零距离 + 砲手歸零距離 Gunner Weapon Lower Info Background @@ -372,6 +434,8 @@ Hintergrund der unteren Waffen-Info-Leiste (Richtschütze) 사수 무기 상세 정보 배경 Informazioni Sfondo Arma Artigliere Bassa + 炮手武器底部资讯栏背景 + 砲手武器底部資訊欄背景 Vehicle Name @@ -384,6 +448,8 @@ Fahrzeugname 차량 명칭 Nome Veicolo + 载具名称 + 載具名稱 Vehicle Name Background @@ -396,6 +462,8 @@ Fahrzeugname Hintergrund 차량 명칭 배경 Nome Sfondo Veicolo + 载具名称背景 + 載具名稱背景 Vehicle Fuel Bar @@ -403,11 +471,13 @@ Barra de Combustível do Veículo Barre d'éssence du véhicule Полоса топлива - 車両の給油計 + 車両の燃料計 Pasek paliwa Fahrzeug-Treibstoffleiste 차량 연료 막대 Barra Carburante Veicolo + 载具燃料栏 + 載具燃料欄 Vehicle Speed @@ -420,6 +490,8 @@ Fahrzeuggeschwindigkeit 차량 속도 Velocità Veicolo + 载具速度 + 載具速度 Vehicle Altitude @@ -432,6 +504,8 @@ Fahrzeughöhe 차량 고도 Altitudine Veicolo + 载具高度 + 載具高度 Vehicle Damage @@ -444,6 +518,8 @@ Fahrzeugschaden 차량 피해 Danno Veicolo + 载具伤害 + 載具傷害 Vehicle Info Background @@ -456,6 +532,8 @@ Fahrzeug Info Hintergrund 차량 정보 배경 Informazioni Sfondo Veicolo + 载具资讯栏背景 + 載具資訊欄背景 Requires Soldier/Vehicle/Weapon Information. @@ -468,6 +546,8 @@ Benötigt Soldat/Fahrzeug/Waffe Information. 병사/차량/무기의 정보가 필요합니다. Richiede informazione Soldato/Veicolo/Arma. + 需要士兵/载具/武器的资讯. + 需要士兵/載具/武器的資訊. Modifying User Interface is disabled. @@ -475,22 +555,26 @@ A modificação da interface do usuário está desabilitada. Modifications de l'interface utilisateur désactivé. Изменение пользовательского интерфейса запрещено. - 変更されたユーザ インタフェイスを無効化します。 + ユーザ インタフェイスの変更は無効化されています。 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é. Невозможно изменить зафиксированный элемент пользовательского интерфейса. - ユーザー インタフェイス要素は変更できません。 + ユーザー インタフェイス要素の強制はできません。 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/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 9fbed7c6bf..76feaa2b5c 100644 --- a/addons/vector/stringtable.xml +++ b/addons/vector/stringtable.xml @@ -14,6 +14,8 @@ Vector 21 Nite ベクター 21 ナイト Vector 21 Nite + Vector 21 Nite + Vector 21 Nite Vector 21 @@ -28,6 +30,8 @@ Vector 21 ベクター 21 Vector 21 + Vector 21 + Vector 21 Rangefinder @@ -42,6 +46,8 @@ Дальномер 測距機器 거리측정기 + 测距仪 + 測距儀 Vector - Azimuth Key @@ -56,6 +62,8 @@ Vector – Азимут ベクター - 方位角キー Vector - 방위각 키 + Vector - 方位按键 + Vector - 方位按鍵 Vector - Distance Key @@ -70,6 +78,8 @@ Vector – Расстояние ベクター - 距離キー Vector - 거리 키 + Vector - 距离按键 + Vector - 距離按鍵 diff --git a/addons/vehiclelock/ACE_Settings.hpp b/addons/vehiclelock/ACE_Settings.hpp index f8a431410f..75073f4f8f 100644 --- a/addons/vehiclelock/ACE_Settings.hpp +++ b/addons/vehiclelock/ACE_Settings.hpp @@ -1,20 +1,25 @@ class ACE_Settings { class GVAR(defaultLockpickStrength) { + category = CSTRING(DisplayName); displayName = CSTRING(DefaultLockpickStrength_DisplayName); description = CSTRING(DefaultLockpickStrength_Description); value = 10; typeName = "SCALAR"; + sliderSettings[] = {-1, 60, 5, 1}; }; class GVAR(lockVehicleInventory) { + category = CSTRING(DisplayName); displayName = CSTRING(LockVehicleInventory_DisplayName); description = CSTRING(LockVehicleInventory_Description); value = 0; typeName = "BOOL"; }; class GVAR(vehicleStartingLockState) { + category = CSTRING(DisplayName); displayName = CSTRING(VehicleStartingLockState_DisplayName); description = CSTRING(VehicleStartingLockState_Description); value = -1; typeName = "SCALAR"; + sliderSettings[] = {-1, 2, -1, -1}; // ToDo: Make this a list? }; }; diff --git a/addons/vehiclelock/CfgVehicles.hpp b/addons/vehiclelock/CfgVehicles.hpp index bf4231f426..3038e3f99c 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 { @@ -72,8 +82,8 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleInit); - scope = 2; - isGlobal = 0; + scope = 1; + isGlobal = 1; isSingular = 1; icon = QPATHTOF(UI\Icon_Module_VehicleLock_ca.paa); functionPriority = 0; 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/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 2ce856dd37..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,13 +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, ["isNotInside"]] 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_moduleInit.sqf b/addons/vehiclelock/functions/fnc_moduleInit.sqf index b6c3f38426..cf9d1eb79c 100644 --- a/addons/vehiclelock/functions/fnc_moduleInit.sqf +++ b/addons/vehiclelock/functions/fnc_moduleInit.sqf @@ -17,8 +17,6 @@ */ #include "script_component.hpp" -if (!isServer) exitWith {}; - params ["_logic", "_syncedUnits", "_activated"]; TRACE_3("params",_logic,_syncedUnits,_activated); 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 3fe5958533..60563b8935 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -1,6 +1,13 @@ - + + + Vehicle Lock + Blocco Veicolo + 載具上鎖 + 载具上锁 + 車両の施錠 + Unlock Vehicle Fahrzeug aufschließen @@ -10,10 +17,12 @@ Odemknout vozidlo Jármű nyitása Открыть машину - Sblocca il veicolo + Sblocca il Veicolo Destravar veículo 車両の鍵を開ける 차량 잠금열기 + 载具解锁 + 載具解鎖 Lock Vehicle @@ -24,10 +33,12 @@ Zamknout vozidlo Jármű zárása Закрыть машину - Chiudi il veicolo a chiave + Chiudi il Veicolo a chiave Travar Veículo 車両を施錠 차량 잠그기 + 载具上锁 + 載具上鎖 Lockpick Vehicle @@ -42,6 +53,8 @@ Usar mixa no Veículo 鍵をこじ開ける 차량 문따기 + 解锁载具 + 解鎖載具 Picking Lock... @@ -56,6 +69,8 @@ Usando Mixa... 鍵をこじ開けている・・・ 문따는중... + 解锁中... + 解鎖中... A custom key that will open a specific vehicle. @@ -70,6 +85,8 @@ Uma chave específica que abre um veículo específico. カスタム キーは特定車両を開けられます。 특정 차량을 여는 특수 열쇠 + 使用指定的钥匙来开启特定的载具 + 使用指定的鑰匙來開啟特定的載具 A Master Key will open any lock, no matter what! @@ -84,6 +101,8 @@ Uma chave mestre irá abrir qualquer fechadura, não importa qual! マスター キーは全ての鍵を開けられます。 어떤 차량도 열 수 있는 마스터키 입니다! + 万用解锁钥匙,能解锁任何载具 + 萬用解鎖鑰匙,能解鎖任何載具 A lockpick set that can pick the locks of most vehicles. @@ -98,6 +117,8 @@ Um set de chave mixas que pode abrir a maioria dos veículos. ピッキング ツールでは多くの車両をこじ開けられます。 거의 모든 차량을 열 수 있게 해주는 해정도구 모음입니다. + 一组解锁钥匙 (可解锁大部份载具) + 一組解鎖鑰匙 (可解鎖大部份載具) A key that should open most WEST vehicles. @@ -110,8 +131,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. @@ -124,8 +147,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. @@ -138,8 +163,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. @@ -152,8 +179,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 @@ -166,8 +195,10 @@ Jármű-zár beállítás Запирание транспорта Impostazioni Blocco Veicolo - 車両の施錠の設定 + 車両の施錠設定 차량 잠금 설정 + 载具上锁设置 + 載具上鎖設置 Lock Vehicle Inventory @@ -182,6 +213,8 @@ Blocca Inventario Veicolo 施錠されている車両のインベントリ 차량 소지품 잠금 + 上锁载具的车箱 + 上鎖載具的車箱 Locks the inventory of locked vehicles @@ -194,8 +227,10 @@ Bezárja a zárt járművek rakterét is Закрывать инвентарь транспорта, если транспорт закрыт Blocca l'inventario di un veicolo bloccato - 施錠されている車両の、開けないインベントリ + 施錠されている車両の開けないインベントリ 잠긴 차량의 소지품을 뒤지지못하게 합니다. + 上锁载具的车箱,使玩家不能拿取/查看载具内的装备 + 上鎖載具的車箱,使玩家不能拿取/查看載具內的裝備 Vehicle Starting Lock State @@ -210,6 +245,8 @@ Stato Iniziale del Blocco per Veicoli 開始時における車両の鍵の状態 시작시 차량 잠금 상태 + 载具初始上锁状态 + 載具初始上鎖狀態 Set lock state for all vehicles (removes ambiguous lock states) @@ -222,8 +259,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 @@ -238,6 +277,8 @@ Com'è そのまま 그대로 + 无变化 + 無變化 Locked @@ -252,6 +293,8 @@ Bloccato 施錠ずみ 잠김 + 上锁 + 上鎖 Unlocked @@ -266,6 +309,8 @@ Sbloccato 開錠ずみ 열림 + 解锁 + 解鎖 Default Lockpick Strength @@ -278,8 +323,10 @@ Alapértelmezett zártörő-erősség Сила отмычки по-умолчанию Durabilità Default del Grimaldello - ピッキング ツールの標準の有効度 + ピッキング ツールの能力設定 기본 해정도구 설정 + 预设开锁能力 + 預設開鎖能力 Default Time to lockpick (in seconds). Default: 10 @@ -292,8 +339,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. @@ -306,8 +355,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 @@ -322,6 +373,8 @@ 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. @@ -336,6 +389,8 @@ Sincronizza con veicoli e giocatori. Distribuirà chiavi ai giocatori per ogni veicolo sincronizzato. Valido solo per oggetti presenti ad inizio missione. 車両とプレイヤへ同期します。プレイヤへ同期された車両のカスタム キーを作ります。これはミッション開始時に作成されたオブジェクトでのみ有効です。 차량과 플레이어에게 동기화됩니다. 동기화된 차량은 플레이어에게 열쇠를 지급합니다. 오직 미션 시작시에 생긴 물체들만 유효합니다. + 可同步在载具与玩家身上。将使被同步的玩家掌握其他被同步载具的钥匙。此模块只会在任务刚开始时触发。 + 可同步在載具與玩家身上。將使被同步的玩家掌握其他被同步載具的鑰匙。此模塊只會在任務剛開始時觸發。 diff --git a/addons/vehicles/CfgAmmo.hpp b/addons/vehicles/CfgAmmo.hpp index 96dd290625..8706a56570 100644 --- a/addons/vehicles/CfgAmmo.hpp +++ b/addons/vehicles/CfgAmmo.hpp @@ -1,25 +1,7 @@ class CfgAmmo { - - class Missile_AGM_02_F; - class M_Mo_120mm_AT: Missile_AGM_02_F { - cost = 400000; // Stop it from aiming at FUCKING RABBITS. - weaponLockSystem = 2; - }; - - class M_Mo_120mm_AT_LG: M_Mo_120mm_AT { - cost = 400000; - weaponLockSystem = 4; - }; - class MissileBase; class M_Mo_82mm_AT: MissileBase { - cost = 400000; - weaponLockSystem = 2; - }; - - class M_Mo_82mm_AT_LG: M_Mo_82mm_AT { - cost = 400000; - weaponLockSystem = 4; + cost = 400000; // Stop it from aiming at FUCKING RABBITS. }; }; diff --git a/addons/vehicles/CfgWeapons.hpp b/addons/vehicles/CfgWeapons.hpp index c4d28c3e31..530a6913c7 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 { @@ -46,24 +46,6 @@ class CfgWeapons { class far: close {}; }; - class autocannon_Base_F; - class autocannon_30mm_CTWS: autocannon_Base_F { - class AP: autocannon_Base_F { - magazines[] = {"60Rnd_30mm_APFSDS_shells","60Rnd_30mm_APFSDS_shells_Tracer_Red","60Rnd_30mm_APFSDS_shells_Tracer_Green","60Rnd_30mm_APFSDS_shells_Tracer_Yellow","140Rnd_30mm_MP_shells","140Rnd_30mm_MP_shells_Tracer_Red","140Rnd_30mm_MP_shells_Tracer_Green","140Rnd_30mm_MP_shells_Tracer_Yellow"}; - magazineReloadTime = 0; - }; - - muzzles[] = {"AP"}; - }; - class autocannon_40mm_CTWS: autocannon_Base_F { - class AP: autocannon_Base_F { - magazines[] = {"40Rnd_40mm_APFSDS_shells","40Rnd_40mm_APFSDS_Tracer_Red_shells","40Rnd_40mm_APFSDS_Tracer_Green_shells","40Rnd_40mm_APFSDS_Tracer_Yellow_shells","60Rnd_40mm_GPR_shells","60Rnd_40mm_GPR_Tracer_Red_shells","60Rnd_40mm_GPR_Tracer_Green_shells","60Rnd_40mm_GPR_Tracer_Yellow_shells"}; - magazineReloadTime = 0; - }; - - muzzles[] = {"AP"}; - }; - // make static weapons compatible with 100rnd mag variants class HMG_static: HMG_01 { magazines[] = {"500Rnd_127x99_mag","500Rnd_127x99_mag_Tracer_Red","500Rnd_127x99_mag_Tracer_Green","500Rnd_127x99_mag_Tracer_Yellow","200Rnd_127x99_mag","200Rnd_127x99_mag_Tracer_Red","200Rnd_127x99_mag_Tracer_Green","200Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Yellow"}; 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/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 77eb0f4fc5..36ff7f99e6 100644 --- a/addons/vehicles/stringtable.xml +++ b/addons/vehicles/stringtable.xml @@ -14,6 +14,8 @@ Limitatore Attivo 速度制限を有効化 속도 제한기 켜짐 + 启用速度限制 + 啟用速度限制 Speed Limiter off @@ -28,6 +30,8 @@ Limitatore Non Attivo 速度制限を無効化 속도 제한기 꺼짐 + 停用速度限制 + 停用速度限制 Speed Limiter @@ -42,6 +46,8 @@ Limitatore di Velocità 速度制限 속도 제한기 + 速度限制器 + 速度限制器 diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index 356c7d86f2..63c2a5d19a 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -39,6 +39,7 @@ class ACE_Settings { value = 10000; // Value, NOT index. 10000 is the maximum in A3 displayName = CSTRING(limit_DisplayName); description = CSTRING(limit_setting); + sliderSettings[] = {500, 12000, 10000, 0}; }; class GVAR(objectViewDistanceCoeff) { category = CSTRING(Module_DisplayName); diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index 4c6639370c..db82b7bd92 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { category = "ACE"; function = QUOTE(DFUNC(initModule)); displayName = CSTRING(Module_DisplayName); - scope = 2; + scope = 1; isGlobal = 1; isSingular = 1; //icon = ""; // needs an icon 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/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..ad6b3852b4 100644 --- a/addons/viewdistance/functions/fnc_initModule.sqf +++ b/addons/viewdistance/functions/fnc_initModule.sqf @@ -9,12 +9,15 @@ * * Return Value: * None + * + * Example: + * [LOGIC; [bob, kevin], true] call ace_viewdistance_fnc_initModule + * + * Public: No */ #include "script_component.hpp" -if (!isServer) exitWith {}; - params ["_logic", "_units", "_activated"]; if (!_activated) exitWith { diff --git a/addons/viewdistance/stringtable.xml b/addons/viewdistance/stringtable.xml index 0102653f24..7ea9bb1cce 100644 --- a/addons/viewdistance/stringtable.xml +++ b/addons/viewdistance/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Limitatore Distanza Visiva 視界距離の制限 시야 제한기 + 视野距离限制器 + 視野距離限制器 Allows limiting maximum view distance that can be set by players. @@ -28,6 +30,8 @@ Consente di limitare la distanza visiva massima che può essere impostata dai giocatori. プレイヤーへ最大の視界距離を制限できます。 플레이어가 볼 수 있는 최대 시야를 제한합니다. + 允许玩家最大的可视距离 + 允許玩家最大的可視距離 Enable ACE viewdistance @@ -42,6 +46,8 @@ Abilita distanza visiva ACE ACE 視界距離を有効化 ACE 시야 활성화 + 启用ACE视距 + 啟用ACE視距 Enables ACE viewdistance @@ -56,6 +62,8 @@ Abilita distanza visiva ACE ACE 視界距離を有効化 ACE 시야 활성화 + 启用ACE视距 + 啟用ACE視距 View Distance Limit @@ -70,6 +78,8 @@ Limite Distanza Visiva 視界距離の制限 시야 제한기 + 视野距离限制 + 視野距離限制 Sets the limit for how high clients can raise their view distance (up to 10000) @@ -84,6 +94,8 @@ 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 @@ -98,6 +110,8 @@ Limite per la distanza visiva del client impostato qui e può essere scavalcato dal modulo クライアントへの視界距離の設定や、それをモジュールにより上書きできます 클라이언트의 시야를 이 모듈로 치환할 수 있습니다. + 玩家的视距限制可在此设定,也可透过模块改写 + 玩家的視距限制可在此設定,也可透過模塊改寫 Client View Distance (On Foot) @@ -112,6 +126,8 @@ Distanza Visiva Client (a Piedi) クライアント側視界距離 (地上) 클라이언트 시야 (보병) + 客户端视野距离 (步行) + 客戶端視野距離 (步行) Changes in game view distance when the player is on foot. @@ -126,6 +142,8 @@ Cambia la distanza visiva in gioco quando il giocatore è a piedi. プレイヤーが地上にいる時の視界距離を変更します。 플레이어가 보병일 경우의 시야를 바꿀 수 있습니다. + 改变玩家步行时的视野距离. + 改變玩家步行時的視野距離. Client View Distance (Land Vehicle) @@ -140,6 +158,8 @@ Distanza Visiva Client (Veicolo Terrestre) クライアント側視界距離 (車両) 클라이언트 시야 (차량) + 客户端视野距离 (地面载具) + 客戶端視野距離 (地面載具) Changes in game view distance when the player is in a land vehicle. @@ -154,6 +174,8 @@ Cambia la distanza visiva in gioco quando il giocatore è in un veicolo terrestre. プレイヤーが車両の時の視界距離を変更します。 플레이어가 차량 내부일 경우의 시야를 바꿀 수 있습니다. + 改变玩家于地面载具内时的视野距离 + 改變玩家於地面載具內時的視野距離 Client View Distance (Air Vehicle) @@ -168,6 +190,8 @@ Distanza Visiva Client (Veicoli d'Aria) クライアント側視界距離 (航空機) 클라이언트 시야 (항공기) + 客户端视野距离 (空中载具) + 客戶端視野距離 (空中載具) Changes in game view distance when the player is in an air vehicle. @@ -182,6 +206,8 @@ Cambia la distanza visiva in gioco quando il giocatore è in un mezzo aereo. プレイヤーが航空機に乗っている時の視界距離を変更します。 플레이어가 항공기 내부일 경우의 시야를 바꿀 수 있습니다. + 改变玩家于空中载具内时的视野距离 + 改變玩家於空中載具內時的視野距離 Dynamic Object View Distance @@ -196,6 +222,8 @@ 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. @@ -210,6 +238,8 @@ Imposta la distanza visiva degli oggetti come un coefficiente basato sulla distanza visiva oppure basato sul campo visivo. 視野角を元にするか、視界距離によるオブジェクト描画距離を決定します。視野角を元にするオプションを有効化した場合、視野角により最低と最高値が変動します。 설정된 시야 혹은 시계(FoV)에 계수를 적용해 물체 시야를 적용합니다. 시계를 바탕으로 하는 옵션을 활성화할 경우 시계에 의한 최저와 최고치가 변동됩니다. + 设定物件可被观察的距离,透过视野距离或是视野角度来决定。 + 設定物件可被觀察的距離,透過視野距離或是視野角度來決定。 Off @@ -224,6 +254,8 @@ Disabilitato 無効 끄기 + 关闭 + 關閉 Very Low @@ -238,6 +270,8 @@ Molto Basso 最低 매우 낮음 + 非常低 + 非常低 Low @@ -252,6 +286,8 @@ Basso 낮음 + + Medium @@ -266,6 +302,8 @@ Medio 通常 중간 + + High @@ -280,6 +318,8 @@ Alto 높음 + + Very High @@ -294,6 +334,8 @@ Molto Alto 最高 매우 높음 + 非常高 + 非常高 FoV Based @@ -307,6 +349,8 @@ Champ de vision basé 視野角を元にする 시계(FoV) + 由视野角度决定 + 由視野角度決定 View Distance: @@ -321,6 +365,8 @@ Distanza Visiva: 視界距離: 시야: + 视野距离: + 視野距離: Object View Distance is @@ -335,6 +381,8 @@ Distanza Visiva Oggetti è オブジェクト描画距離は 동적 물체 시야는 + 物件视野距离为 + 物件視野距離為 That option is invalid! The limit is @@ -349,6 +397,8 @@ Questa opzione è invalida! Il limite è このオプションは無効です!制限は 이 옵션은 불가능합니다! 제한은 + 该选项是无效的! 限制是 + 該選項是無效的! 限制是 Video Settings @@ -363,6 +413,8 @@ Impostazioni Video 映像設定 영상 설정 + 影像设定 + 影像設定 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/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 a98ae5922c..d2f17dfe35 100644 --- a/addons/weaponselect/stringtable.xml +++ b/addons/weaponselect/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Mostrat texto ao lançar granada 手榴弾を投げるときに通知 수류탄 투척시 화면에 문자 표시 + 投掷手榴弹时显示提示讯息 + 投擲手榴彈時顯示提示訊息 Display a hint or text on grenade throw. @@ -28,6 +30,8 @@ Mostra um hint ou texto ao lançar uma granada 手榴弾を投げるときに、ヒントか文で通知します。 수류탄 투척시 화면에 문자나 힌트를 표시합니다. + 投掷手榴弹时显示提示讯息。 + 投擲手榴彈時顯示提示訊息。 Select Pistol @@ -42,6 +46,8 @@ Seleziona la Pistola 拳銃を選択 권총 선택 + 选择手枪 + 選擇手槍 Select Rifle @@ -56,6 +62,8 @@ Seleziona il fucile 小銃を選択 소총 선택 + 选择步枪 + 選擇步槍 Select Launcher @@ -70,6 +78,8 @@ Seleziona il lanciamissili ランチャーを選択 발사기 선택 + 选择发射器 + 選擇發射器 Select Grenade Launcher @@ -84,6 +94,8 @@ Seleziona il lanciagranate グレネード ランチャーを選択 유탄발사기 선택 + 选择榴弹发射器 + 選擇榴彈發射器 Select Binoculars @@ -98,6 +110,8 @@ Seleziona il Binocolo 双眼鏡を選択 망원경 선택 + 选择望远镜 + 選擇望遠鏡 Holster Weapon @@ -112,6 +126,8 @@ Nascondi l'arma 武器をしまう 무기 집어넣기 + 武器套 + 武器套 Engine on @@ -126,6 +142,8 @@ Включить двигатель エンジン始動 엔진 켜기 + 引擎发动 + 引擎發動 Engine off @@ -140,6 +158,8 @@ Выключить двигатель エンジン停止 엔진 끄기 + 引擎熄火 + 引擎熄火 Select Main Gun @@ -154,6 +174,8 @@ Выбрать основное оружие 主砲を選択 주포 선택 + 选择主武器 + 選擇主武器 Select Machine Gun @@ -168,6 +190,8 @@ Выбрать пулемёт 機関砲を選択 기관총 선택 + 选择机枪 + 選擇機槍 Select Missiles @@ -182,6 +206,8 @@ Выбрать ракеты ミサイルを選択 미사일 선택 + 选择导弹 + 選擇導彈 Grenade %1 @@ -196,6 +222,8 @@ Granada %1 %1 手榴弾 %1 수류탄 + 手榴弹 %1 + 手榴彈 %1 Ready Grenade @@ -210,6 +238,8 @@ Granada pronta 投てきよし 투척물 준비 + 准备手榴弹 + 準備手榴彈 Select Frag Grenade @@ -224,6 +254,8 @@ Выбрать осколочную гранату 破片手榴弾を選択 살상 투척물 선택 + 选择破片手榴弹 + 選擇破片手榴彈 Select Non-Frag Grenade @@ -238,6 +270,8 @@ Выбрать гранату その他の手榴弾を選択 비살상 투척물 선택 + 选择非破片手榴弹 + 選擇非破片手榴彈 Throw Selected Grenade @@ -252,6 +286,8 @@ Бросить выбранную гранату 選択された手榴弾を投げる 선택된 투척물 투척 + 投掷选择的手榴弹 + 投擲選擇的手榴彈 No grenades left @@ -266,6 +302,8 @@ Sem mais granadas もう手榴弾は無い 투척물 없음 + 已无手榴弹 + 已無手榴彈 No frags left @@ -280,6 +318,8 @@ Осколочных гранат нет もう破片手榴弾は無い 세열 수류탄 없음 + 已无破片手榴弹 + 已無破片手榴彈 No misc. grenades left @@ -294,6 +334,8 @@ Нелетальные гранаты закончились もうその他の手榴弾は無い 기타 투척물 없음 + 已无其他手榴弹 + 已無其他手榴彈 No grenade selected @@ -308,6 +350,8 @@ Нет выбранной гранаты 手榴弾は選択されていない 선택된 수류탄 없음 + 未选择手榴弹 + 未選擇手榴彈 Fire Smoke Launcher @@ -320,8 +364,18 @@ Пустить дымовую завесу Lancia fumogeno Lançador de fumaça - 煙幕発射機を発射 + 発煙弾発射機を発射 연막발사기 박사 + 发射烟雾发射器 + 發射煙霧發射器 + + + Toggle Collision Lights + Attiva Luci di Collisione + 충돌 표시등 토글 + 切換碰撞燈 + 切换碰撞灯 + 衝突防止灯を切り替え diff --git a/addons/weather/ACE_Settings.hpp b/addons/weather/ACE_Settings.hpp index d3b9b1fd2e..e2eb4590b7 100644 --- a/addons/weather/ACE_Settings.hpp +++ b/addons/weather/ACE_Settings.hpp @@ -1,38 +1,24 @@ class ACE_Settings { - class GVAR(enableServerController) { - displayName = CSTRING(enableServerController_DisplayName); - description = CSTRING(enableServerController_Description); + class GVAR(enabled) { + category = CSTRING(Module_DisplayName); + displayName = CSTRING(enabled_DisplayName); + description = CSTRING(enabled_Description); typeName = "BOOL"; value = 1; }; - class GVAR(useACEWeather) { - displayName = CSTRING(useACEWeather_DisplayName); - description = CSTRING(useACEWeather_Description); - 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); - typeName = "BOOL"; - value = 1; - }; - class GVAR(syncMisc) { - displayName = CSTRING(syncMisc_DisplayName); - description = CSTRING(syncMisc_Description); - typeName = "BOOL"; - value = 1; - }; - class GVAR(serverUpdateInterval) { - displayName = CSTRING(serverUpdateInterval_DisplayName); - description = CSTRING(serverUpdateInterval_Description); + class GVAR(updateInterval) { + category = CSTRING(Module_DisplayName); + displayName = CSTRING(updateInterval_DisplayName); + description = CSTRING(updateInterval_Description); typeName = "SCALAR"; value = 60; + sliderSettings[] = {0, 300, 0, 0}; + }; + class GVAR(windSimulation) { + category = CSTRING(Module_DisplayName); + displayName = CSTRING(windSimulation_DisplayName); + description = CSTRING(windSimulation_Description); + typeName = "BOOL"; + value = 1; }; }; diff --git a/addons/weather/CfgVehicles.hpp b/addons/weather/CfgVehicles.hpp index ab3d408fdc..cab16183a8 100644 --- a/addons/weather/CfgVehicles.hpp +++ b/addons/weather/CfgVehicles.hpp @@ -1,7 +1,7 @@ class CfgVehicles { class ACE_Module; class GVAR(ModuleSettings): ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(Module_DisplayName); icon = QPATHTOF(UI\Icon_Module_Wind_ca.paa); category = "ACE"; @@ -12,42 +12,24 @@ class CfgVehicles { isTriggerActivated = 0; author = ECSTRING(common,ACETeam); class Arguments { - class enableServerController { - displayName = CSTRING(enableServerController_DisplayName); - description = CSTRING(enableServerController_Description); + class enabled { + displayName = CSTRING(enabled_DisplayName); + description = CSTRING(enabled_Description); typeName = "BOOL"; defaultValue = 1; }; - class useACEWeather { - displayName = CSTRING(useACEWeather_DisplayName); - description = CSTRING(useACEWeather_Description); - 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); - typeName = "BOOL"; - defaultValue = 1; - }; - class syncMisc { - displayName = CSTRING(syncMisc_DisplayName); - description = CSTRING(syncMisc_Description); - typeName = "BOOL"; - defaultValue = 1; - }; - class serverUpdateInterval { - displayName = CSTRING(serverUpdateInterval_DisplayName); - description = CSTRING(serverUpdateInterval_Description); + class updateInterval { + displayName = CSTRING(updateInterval_DisplayName); + description = CSTRING(updateInterval_Description); typeName = "NUMBER"; defaultValue = 60; }; + class windSimulation { + displayName = CSTRING(windSimulation_DisplayName); + description = CSTRING(windSimulation_Description); + typeName = "BOOL"; + defaultValue = 1; + }; }; class ModuleDescription { description = CSTRING(Module_Description); diff --git a/addons/weather/XEH_PREP.hpp b/addons/weather/XEH_PREP.hpp index b13b938892..48788c0546 100644 --- a/addons/weather/XEH_PREP.hpp +++ b/addons/weather/XEH_PREP.hpp @@ -12,12 +12,9 @@ PREP(calculateWindChill); PREP(calculateWindSpeed); PREP(displayWindInfo); PREP(getMapData); -PREP(getWind); PREP(initModuleSettings); PREP(initWind); -PREP(serverController); -PREP(updateAceWeather); PREP(updateHumidity); -PREP(updateRain); PREP(updateTemperature); +PREP(updateWeather); PREP(updateWind); diff --git a/addons/weather/XEH_postInit.sqf b/addons/weather/XEH_postInit.sqf index d2c6f3b7df..51350226e1 100644 --- a/addons/weather/XEH_postInit.sqf +++ b/addons/weather/XEH_postInit.sqf @@ -1,33 +1,5 @@ #include "script_component.hpp" -// Randomization -GVAR(temperatureShift) = 3 - random 6; -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 { - TRACE_1("MISC PARAMS PVEH",ACE_MISC_PARAMS); - 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); - }; - GVAR(temperatureShift) = (ACE_MISC_PARAMS select 3); - GVAR(badWeatherShift) = (ACE_MISC_PARAMS select 4); - GVAR(humidityShift) = (ACE_MISC_PARAMS select 5); - call FUNC(updateTemperature); - call FUNC(updateHumidity); - }; -}; - GVAR(WindInfo) = false; ["ACE3 Common", QGVAR(WindInfoKey), localize LSTRING(WindInfoKeyToggle), { @@ -53,41 +25,3 @@ GVAR(WindInfo) = false; (["RscWindIntuitive"] call BIS_fnc_rscLayer) cutText ["", "PLAIN", 2]; }, [0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) - -simulWeatherSync; - - - - -["ace_settingsInitialized",{ - TRACE_1("ace_settingsInitialized eh",GVAR(syncRain)); - - // update rain every frame: - if (GVAR(syncRain)) then { - addMissionEventHandler ["EachFrame", {0 setRain GVAR(ACE_rain)}]; - }; - - //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}; - 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 - GVAR(nextUpdateTempAndHumidity) = 20 + CBA_missionTime; - }; - - END_COUNTER(weatherPFEH); - }, 1, []] call CBA_fnc_addPerFrameHandler; - -}] call CBA_fnc_addEventHandler; diff --git a/addons/weather/XEH_postServerInit.sqf b/addons/weather/XEH_postServerInit.sqf index cd1fca2c4c..433c161979 100644 --- a/addons/weather/XEH_postServerInit.sqf +++ b/addons/weather/XEH_postServerInit.sqf @@ -1,18 +1,16 @@ #include "script_component.hpp" -// Rain -GVAR(rain_next_period) = -1; -GVAR(rain_period_count) = 0; -GVAR(current_rain) = 0; -GVAR(rain_current_range) = -1+(random 2); - -// Wind -call FUNC(initWind); - ["ace_settingsInitialized", { - TRACE_2("ace_settingsInitialized eh",GVAR(enableServerController),GVAR(serverUpdateInterval)); + if (!GVAR(enabled)) exitWith {}; - if (GVAR(enableServerController)) then { - [FUNC(serverController), GVAR(serverUpdateInterval)] call CBA_fnc_addPerFrameHandler; + GVAR(temperatureShift) = random [-SD_TO_MIN_MAX(4), 0, SD_TO_MIN_MAX(4)]; // Gauss(0, 4) + GVAR(badWeatherShift) = random [-SD_TO_MIN_MAX(2) + 4, 4, 4 + SD_TO_MIN_MAX(2)]; // Gauss(4, 2) + GVAR(humidityShift) = random [-SD_TO_MIN_MAX(0.065), 0, SD_TO_MIN_MAX(0.065)]; // Gauss(0, 0.065) + + if (GVAR(windSimulation)) then { + call FUNC(initWind); + [FUNC(updateWind), 1] call CBA_fnc_addPerFrameHandler; }; + [FUNC(updateWeather), GVAR(updateInterval)] call CBA_fnc_addPerFrameHandler; + }] call CBA_fnc_addEventHandler; 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_calculateRoughnessLength.sqf b/addons/weather/functions/fnc_calculateRoughnessLength.sqf index 423f3fc3d6..5112cf4ef5 100644 --- a/addons/weather/functions/fnc_calculateRoughnessLength.sqf +++ b/addons/weather/functions/fnc_calculateRoughnessLength.sqf @@ -18,7 +18,7 @@ // Source: http://es.ucsc.edu/~jnoble/wind/extrap/index.html #define ROUGHNESS_LENGTHS [0.0002, 0.0005, 0.0024, 0.03, 0.055, 0.1, 0.2, 0.4, 0.8, 1.6] -private _windSource = _this vectorDiff ((vectorNormalized ACE_wind) vectorMultiply 25); +private _windSource = _this vectorDiff ((vectorNormalized wind) vectorMultiply 25); private _nearBuildings = count (_windSource nearObjects ["Building", 50]); private _isWater = surfaceIsWater _windSource; 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_calculateWindSpeed.sqf b/addons/weather/functions/fnc_calculateWindSpeed.sqf index 206bc1d298..2f02c12852 100644 --- a/addons/weather/functions/fnc_calculateWindSpeed.sqf +++ b/addons/weather/functions/fnc_calculateWindSpeed.sqf @@ -26,18 +26,17 @@ private _fnc_polar2vect = { [_mag2D * sin(_dir), _mag2D * cos(_dir), _mag * sin(_elev)]; }; -private _windSpeed = vectorMagnitude ACE_wind; -private _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); +private _windSpeed = vectorMagnitude wind; +private _windDir = (wind select 0) atan2 (wind select 1); private _windDirAdjusted = _windDir + 180; // Wind gradient if (_windGradientEnabled) then { if (_windSpeed > 0.05) then { private _height = (ASLToATL _position) select 2; - _height = 0 max _height min 20; - if (_height < 20) then { + if (_height > 0 && _height < 20) then { private _roughnessLength = _position call FUNC(calculateRoughnessLength); - _windSpeed = _windSpeed * abs(ln(_height / _roughnessLength) / ln(20 / _roughnessLength)); + _windSpeed = _windSpeed * (0 max (ln(_height / _roughnessLength) / ln(20 / _roughnessLength))); }; }; }; diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index 10a1e45861..a8409cb68a 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -55,7 +55,7 @@ TRACE_1("Starting Wind Info PFEH", GVAR(WindInfo)); private _playerDir = (ACE_player call CBA_fnc_headDir) select 0; - private _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); + private _windDir = (wind select 0) atan2 (wind select 1); _windDir = 30 * (round(((_windDir - _playerDir + 360) % 360) / 30)); // Color Codes from https://en.wikipedia.org/wiki/Beaufort_scale#Modern_scale diff --git a/addons/weather/functions/fnc_getMapData.sqf b/addons/weather/functions/fnc_getMapData.sqf index 2b222c2d8b..dd086b8414 100644 --- a/addons/weather/functions/fnc_getMapData.sqf +++ b/addons/weather/functions/fnc_getMapData.sqf @@ -43,8 +43,9 @@ GVAR(TempDay) = [1, 3, 9, 14, 19, 23, 25, 24, 21, 13, 7, 2]; GVAR(TempNight) = [-4, -3, 0, 4, 9, 12, 14, 14, 10, 6, 2, -2]; GVAR(Humidity) = [82, 80, 78, 70, 71, 72, 70, 73, 78, 80, 83, 82]; -GVAR(currentTemperature) = 20; -GVAR(currentHumidity) = 0.5; +GVAR(currentTemperature) = 15; +GVAR(currentHumidity) = 0; +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_getWind.sqf b/addons/weather/functions/fnc_getWind.sqf deleted file mode 100644 index 2d29335026..0000000000 --- a/addons/weather/functions/fnc_getWind.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Author: ACE2 Team, Ruthberg - * Calculate current wind locally from the data broadcasted by the server - * - * Arguments: - * None - * - * Return Value: - * Wind - * - * Example: - * [] call ace_weather_fnc_getWind - * - * Public: No - */ -#include "script_component.hpp" - -if (isNil "ACE_WIND_PARAMS") exitWith { [0, 0, 0] }; - -ACE_WIND_PARAMS params ["_dir", "_dirChange", "_spd", "_spdChange", "_period"]; -//Wind _dir is the "source" of the wind [eg: "northerly wind": _dir = 0 -> wind = [0,-1,0];] - -private _periodPosition = (CBA_missionTime - GVAR(wind_period_start_time)) min _period; -private _periodPercent = _periodPosition / _period; - -_spd = _spd + _spdChange * _periodPercent; -_dir = _dir + _dirChange * _periodPercent; - -_dir = (360 + _dir) % 360; - -TRACE_1("PeriodStartTime",Round(GVAR(wind_period_start_time))); -TRACE_2("Dir: Current/Change",Round(_dir),Round(_dirChange)); -TRACE_2("Spd: Current/Change",Round(_spd * 10) / 10,Round(_spdChange * 10) / 10); -TRACE_3("Period/Position/Percent",Round(_period),Round(_periodPosition),Round(_periodPercent * 100) / 100); - -// TODO: Add some deterministic noise - -[-_spd * sin(_dir), -_spd * cos(_dir), 0] diff --git a/addons/weather/functions/fnc_initModuleSettings.sqf b/addons/weather/functions/fnc_initModuleSettings.sqf index f1e9c1d6fc..3334392156 100644 --- a/addons/weather/functions/fnc_initModuleSettings.sqf +++ b/addons/weather/functions/fnc_initModuleSettings.sqf @@ -22,18 +22,13 @@ params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; -// Control server side weather propagation -[_logic, QGVAR(enableServerController), "enableServerController"] call EFUNC(common,readSettingFromModule); - -// Overrides the default weather (editor, mission settings) with ACE weather (map based) -[_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 +// Turns the weather module on / off +[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); // Server weather update interval -[_logic, QGVAR(serverUpdateInterval), "serverUpdateInterval"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(updateInterval), "updateInterval"] call EFUNC(common,readSettingFromModule); -GVAR(serverUpdateInterval) = 1 max GVAR(serverUpdateInterval) min 600; +// Turns the (map based) wind simulation on / off +[_logic, QGVAR(windSimulation), "windSimulation"] call EFUNC(common,readSettingFromModule); + +GVAR(updateInterval) = 1 max GVAR(updateInterval) min 600; diff --git a/addons/weather/functions/fnc_initWind.sqf b/addons/weather/functions/fnc_initWind.sqf index 634542c1e4..c40a6b4113 100644 --- a/addons/weather/functions/fnc_initWind.sqf +++ b/addons/weather/functions/fnc_initWind.sqf @@ -1,6 +1,6 @@ /* * Author: Ruthberg - * Inits the wind variables on mission start + * Inits the wind variables on the server (on mission start) * * Arguments: * None @@ -18,8 +18,6 @@ private _month = date select 1; private _windDirectionProbabilities = GVAR(WindDirectionProbabilities) select (_month - 1); -ACE_wind = [0, 0, 0]; - GVAR(wind_direction_reference) = random 360; private _sum = 0; for "_i" from 0 to 7 do { @@ -52,10 +50,14 @@ GVAR(max_wind_speed) = GVAR(WindSpeedMax) select (_month - 1); GVAR(max_wind_speed) = (GVAR(max_wind_speed) select 0) + (random (GVAR(max_wind_speed) select 1)) - (random (GVAR(max_wind_speed) select 1)); GVAR(max_wind_speed) = 0 max GVAR(max_wind_speed); +GVAR(wind_upper_span) = GVAR(max_wind_speed) - GVAR(mean_wind_speed); +GVAR(wind_lower_span) = GVAR(min_wind_speed) - GVAR(mean_wind_speed); + GVAR(current_wind_direction) = GVAR(wind_direction_reference); +GVAR(next_wind_direction) = GVAR(current_wind_direction); + GVAR(current_wind_speed) = GVAR(min_wind_speed) + (GVAR(max_wind_speed) - GVAR(min_wind_speed)) * (random 1); +GVAR(next_wind_speed) = GVAR(current_wind_speed); -GVAR(wind_period_count) = 0; -GVAR(wind_next_period) = -1; - -GVAR(wind_speed_debug_output) = []; +GVAR(last_wind_update) = 0; +GVAR(next_wind_udpate) = 0; diff --git a/addons/weather/functions/fnc_serverController.sqf b/addons/weather/functions/fnc_serverController.sqf deleted file mode 100644 index 79d2aab93e..0000000000 --- a/addons/weather/functions/fnc_serverController.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Author: Ruthberg - * Gather weather parameters and broadcast them to the clients - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ace_weather_fnc_serverController - * - * Public: No - */ -#include "script_component.hpp" - -if (GVAR(useACEWeather)) then { - // Use location based real world weather data - [] 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); - ACE_WIND_PARAMS = [_windDir, 0, vectorMagnitude wind, 0, GVAR(serverUpdateInterval)]; - publicVariable "ACE_WIND_PARAMS"; - }; - if (GVAR(syncMisc)) then { - ACE_MISC_PARAMS = [lightnings, 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 deleted file mode 100644 index db8783cd83..0000000000 --- a/addons/weather/functions/fnc_updateAceWeather.sqf +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Author: ACE2 Team, esteldunedain, ruthberg - * Updates the wind and rain evolution on the server. Broadcasts the current and next values to the clients - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ace_weather_fnc_updateAceWeather - * - * Public: No - */ -#include "script_component.hpp" - -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 { - - GVAR(rain_next_period) = ceil((1 + (random 10)) / _overcastMultiplier); - GVAR(rain_period_count) = 0; - - private _lastRain = GVAR(current_rain); - private _rainOverCast = 0; - - if (overcast >= 0.7) then { - _rainOverCast = (overcast - 0.7) / 0.3; - if (GVAR(current_rain) == 0) then { - // Initialize rain with a random strength depending on the current overcast value - GVAR(current_rain) = -0.25 + (random 0.75) + (random 0.5) * _rainOverCast; - }; - - GVAR(current_rain) = GVAR(current_rain) + GVAR(current_rain) * ((_rainOverCast * _overcastMultiplier) / 8) * GVAR(rain_current_range); - GVAR(current_rain) = 0 max GVAR(current_rain) min 1; - - GVAR(rain_current_range) = -1 + (random 2); - } else { - _rainOverCast = 1; - - GVAR(current_rain) = 0; - }; - - private _transitionTime = 1 + (_rainOverCast * 5) + (random (_rainOverCast * 20)); - - ACE_RAIN_PARAMS = [_lastRain, GVAR(current_rain), _transitionTime]; - TRACE_4("",_lastRain,_rainOverCast,_transitionTime,overcast); - - GVAR(rain_period_start_time) = CBA_missionTime; - publicVariable "ACE_RAIN_PARAMS"; -}; - -// Wind simulation -if (GVAR(syncWind) && {GVAR(wind_period_count) > GVAR(wind_next_period)}) then { - - GVAR(wind_next_period) = ceil((2 + (random 5)) / _overcastMultiplier); - GVAR(wind_period_count) = 0; - - private _windDirectionVariance = (90 - (random 180)) * (overcast ^ 2); - private _windDirection = (360 + GVAR(wind_direction_reference) + _windDirectionVariance) % 360; - private _windDirectionChange = _windDirection - GVAR(current_wind_direction); - if (_windDirectionChange > 180) then { - _windDirectionChange = _windDirectionChange - 360; - }; - if (_windDirectionChange < -180) then { - _windDirectionChange = 360 + _windDirectionChange; - }; - - private _windMaxDiff = GVAR(mean_wind_speed) - GVAR(max_wind_speed); - private _windMinDiff = GVAR(min_wind_speed) - GVAR(mean_wind_speed); - - private _ratioMax = (random 1) ^ 2; - private _ratioMin = (random 1) ^ 2; - - private _windSpeed = GVAR(current_wind_speed); - private _windSpeedChange = 0; - if ((random 1) < (0.3 max overcast)) then { - _windSpeed = GVAR(mean_wind_speed) + _windMaxDiff * _ratioMax + _windMinDiff * _ratioMin; - _windSpeedChange = _windSpeed - GVAR(current_wind_speed); - }; - - private _transitionTime = GVAR(wind_next_period) * GVAR(serverUpdateInterval); - - TRACE_5("dirCur/dirNew/spdCur/spdNew/period",GVAR(current_wind_direction),_windDirection,GVAR(current_wind_speed),_windSpeed,_transitionTime); - - ACE_WIND_PARAMS = [GVAR(current_wind_direction), - _windDirectionChange, - GVAR(current_wind_speed), - _windSpeedChange, - _transitionTime]; - - GVAR(current_wind_direction) = _windDirection; - GVAR(current_wind_speed) = _windSpeed; - - GVAR(wind_period_start_time) = CBA_missionTime; - publicVariable "ACE_WIND_PARAMS"; -}; - - -if (GVAR(syncMisc)) then { - ACE_MISC_PARAMS = [lightnings, rainbow, fogParams, GVAR(temperatureShift), GVAR(badWeatherShift), GVAR(humidityShift)]; - publicVariable "ACE_MISC_PARAMS"; -}; - -GVAR(rain_period_count) = GVAR(rain_period_count) + 1; -GVAR(wind_period_count) = GVAR(wind_period_count) + 1; diff --git a/addons/weather/functions/fnc_updateHumidity.sqf b/addons/weather/functions/fnc_updateHumidity.sqf index acd103615b..24e0211ec8 100644 --- a/addons/weather/functions/fnc_updateHumidity.sqf +++ b/addons/weather/functions/fnc_updateHumidity.sqf @@ -1,12 +1,12 @@ /* * Author: ACE2 Team - * Updates GVAR(currentHumidity) + * Smoothly updates GVAR(currentHumidity) on the server (based on time of day and map data) * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_weather_fnc_updateHumidity @@ -15,20 +15,18 @@ */ #include "script_component.hpp" -private _month = date select 1; - -GVAR(currentHumidity) = (GVAR(Humidity) select (_month - 1)) / 100; - -if ((rain > 0) && {overcast > 0.7}) then { +if (rain > 0 && overcast > 0.7) then { GVAR(currentHumidity) = 1; } else { + private _month = date select 1; + GVAR(currentHumidity) = (GVAR(Humidity) select (_month - 1)) / 100; + GVAR(currentHumidity) = GVAR(currentHumidity) + GVAR(humidityShift); private _avgTemperature = ((GVAR(TempDay) select (_month - 1)) + (GVAR(TempNight) select (_month - 1))) / 2; private _pS1 = 6.112 * exp((17.62 * _avgTemperature) / (243.12 + _avgTemperature)); private _PS2 = 6.112 * exp((17.62 * GVAR(currentTemperature)) / (243.12 + GVAR(currentTemperature))); GVAR(currentHumidity) = GVAR(currentHumidity) * _PS1 / _PS2; - GVAR(currentHumidity) = GVAR(currentHumidity) + GVAR(humidityShift); - - TRACE_1("humidityShift",GVAR(humidityShift)); }; GVAR(currentHumidity) = 0 max GVAR(currentHumidity) min 1; + +publicVariable QGVAR(currentHumidity); diff --git a/addons/weather/functions/fnc_updateRain.sqf b/addons/weather/functions/fnc_updateRain.sqf deleted file mode 100644 index b073a6a24c..0000000000 --- a/addons/weather/functions/fnc_updateRain.sqf +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Author: ACE2 Team, Ruthberg - * Updates rain based on ACE_RAIN_PARAMS - * - * Arguments: - * Nothing - * - * Return Value: - * Nothing - * - * Example: - * [] call ace_weather_fnc_updateRain - * - * Public: No - */ -#include "script_component.hpp" - -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..7e597b1733 100644 --- a/addons/weather/functions/fnc_updateTemperature.sqf +++ b/addons/weather/functions/fnc_updateTemperature.sqf @@ -1,12 +1,12 @@ /* * Author: ACE2 Team - * Updates GVAR(currentTemperature) based on the map data + * Smoothly updates GVAR(currentTemperature) on the server (based on time of day and map data) * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_weather_fnc_updateTemperature @@ -15,13 +15,11 @@ */ #include "script_component.hpp" -private _time = daytime; private _month = date select 1; - -private _timeRatio = abs(_time - 12) / 12; +private _timeRatio = abs(daytime - 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)); +publicVariable QGVAR(currentTemperature); diff --git a/addons/weather/functions/fnc_updateWeather.sqf b/addons/weather/functions/fnc_updateWeather.sqf new file mode 100644 index 0000000000..8cb4633ef1 --- /dev/null +++ b/addons/weather/functions/fnc_updateWeather.sqf @@ -0,0 +1,43 @@ +/* + * Author: ACE2 Team, esteldunedain, Ruthberg + * Updates the weather evolution on the server. Broadcasts relevant weather information to the clients. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_weather_fnc_updateWeather + * + * Public: No + */ +#include "script_component.hpp" + +missionNamespace setVariable [QGVAR(currentOvercast), overcast, true]; + +[] call FUNC(updateTemperature); +[] call FUNC(updateHumidity); + +// Wind simulation +if (GVAR(windSimulation) && CBA_missionTime > GVAR(next_wind_udpate)) then { + + GVAR(current_wind_direction) = GVAR(next_wind_direction); + GVAR(current_wind_speed) = GVAR(next_wind_speed); + + private _transitionPeriod = GVAR(updateInterval) * (2 + (random 4)) / (1 + overcast); + GVAR(next_wind_udpate) = CBA_missionTime + _transitionPeriod; + + private _windDirectionVariance = (90 - (random 180)) * (overcast ^ 2); + GVAR(next_wind_direction) = (360 + GVAR(wind_direction_reference) + _windDirectionVariance) % 360; + + if ((random 1) < (0.3 max overcast)) then { + private _speedVariance = GVAR(wind_upper_span) * (random 1) ^ 2 + GVAR(wind_lower_span) * (random 1) ^ 2; + GVAR(next_wind_speed) = GVAR(mean_wind_speed) + _speedVariance; + }; + + GVAR(last_wind_update) = CBA_missionTime; + + TRACE_5("dirCur/dirNew/spdCur/spdNew/period",GVAR(current_wind_direction),GVAR(next_wind_direction),GVAR(current_wind_speed),GVAR(next_wind_speed),_transitionPeriod); +}; diff --git a/addons/weather/functions/fnc_updateWind.sqf b/addons/weather/functions/fnc_updateWind.sqf index 72ae0470ba..e4c3bbb033 100644 --- a/addons/weather/functions/fnc_updateWind.sqf +++ b/addons/weather/functions/fnc_updateWind.sqf @@ -1,12 +1,12 @@ /* * Author: ACE2 Team, Ruthberg - * Updates wind, gusts and waves based on ACE_wind + * Smoothly updates wind on the server (based on time of year and map data) * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_weather_fnc_updateWind @@ -15,16 +15,7 @@ */ #include "script_component.hpp" -if (!GVAR(syncWind)) exitWith { ACE_wind = wind }; +private _speed = linearConversion [GVAR(last_wind_update), GVAR(next_wind_udpate), CBA_missionTime, GVAR(current_wind_speed), GVAR(next_wind_speed), true]; +private _direction = linearConversion [GVAR(last_wind_update), GVAR(next_wind_udpate), CBA_missionTime, GVAR(current_wind_direction), GVAR(next_wind_direction), true]; -ACE_wind = [] call FUNC(getWind); -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 -private _newWaves = ((vectorMagnitude ACE_wind) / 16.0) min 1.0; -if (abs(_newWaves - waves) > 0.1) then { - 1 setWaves _newWaves; -}; - -TRACE_3("Wind/ACE_wind/Deviation(m/s)",wind,ACE_wind,Round((vectorMagnitude (ACE_wind vectorDiff wind)) * 1000) / 1000); +setWind [-_speed * sin(_direction), -_speed * cos(_direction), true]; 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 9c91d2ed8c..58ef756d64 100644 --- a/addons/weather/stringtable.xml +++ b/addons/weather/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Mostrar informação do vento 風速を表示 바람 정보 표시 + 显示风力资讯 + 顯示風力資訊 Show Wind Info (Toggle) @@ -26,8 +28,10 @@ Széladatok mutatása (pecek) Zobrazit údaje o větru (přep.) Mostrar informação do vento (alternar) - 風速を表示 (トグル) + 風速を表示 (切り替え) 바람 정보 표시 (토글) + 显示风力资讯(切换) + 顯示風力資訊(切換) Weather @@ -42,6 +46,8 @@ Meteo 天候 기후 + 天气 + 天氣 Multiplayer synchronized ACE weather module @@ -56,36 +62,10 @@ Modulo Sincronizzazione Meteo ACE Multiplayer ACE 天候モジュールではマルチプレイで同期します。 ACE 기후 모듈과 멀티플레이가 동기화됩니다. + 使用ACE天气模块来同步所有客户端的天气状态(多人游戏) + 使用ACE天氣模塊來同步所有客戶端的天氣狀態(多人遊戲) - - Weather propagation - Zmiany pogody - Propagación del clima - Wetterübertragung - Změny počasí - Propagação do clima - Propagation de la météo - Időjárás-változás - Единая погода для всех - Propagazione Meteo - 天候の統一 - 기후 전파 - - - Enables server side weather propagation - Aktywuje zmiany pogody po stronie serwera - Permite al servidor controlar la propagación del clima - Aktiviere serverseitige Wetterübertragung - Aktivuje změny počasí na straně serveru - Ativa propagação de clima via server - Active la propagation météo par le serveur - Engedélyezi a szerveroldali időjárás-változást - Включает управление погодой на серверной стороне - Abilita propagazione meteo lato server - サーバ側による天候の統一を有効化 - 서버의 기후를 전파합니다 - - + ACE Weather Pogoda ACE Clima ACE @@ -98,106 +78,18 @@ Meteo ACE ACE 天候 ACE 기후 + ACE 天气 + ACE 天氣 - - Overrides the default weather (editor, mission settings) with ACE weather (map based) - Nadpisuje domyślne ustawienia pogody (edytor, wywiad) przy użyciu pogody ACE (zależna od mapy) - Sobreescribe el sistema climático por defecto (editor, ajustes de mision) con clima del ACE (basado en el mapa) - Überschreibt das Standardwetter (Editor, Missionseinstellungen) mit dem ACE-Wetter (kartenbasiert) - Přepíše výchozí počasí (editor, nastavení mise) s ACE počasím (podle mapy) - Sobreescreve o clima padrão (editor, ajustes de missão) pelo sistema de clima ACE (baseado por mapa) - Force la métao par défaut (éditeur, paramètres de mission) avec la météo ACE (basé sur la carte) - Felülbírálja az alapértelmezett időjárást (editor, küldetésbeállítások) az ACE időjárással (térkép-alapú) - Заменяет погоду по-умолчанию (из редактора, настроек миссии) погодой ACE (на основе карты) - Scavalca il meteo default (editor, parametri missione) con il meteo ACE (basato su mappa) - ACE 天候 (マップを元) による標準の天候 (エディタやミッション設定) を上書きします。 - 기존의 기후(에디터, 임무 설정)를 ACE 기후로 치환합니다. (지도에 따라) + + Expands the existing weather by temperature, humidity and air pressure. + Erweitert das vorhandene Wetter um Temperatur, Luftfeuchtigkeit und Luftdruck. + Espande il tempo esistente per temperatura, umidità e pressione dell'aria. + 透過增加濕度、溫度與氣壓來增強天氣模擬的表現。 + 透过增加湿度、温度与气压来增强天气模拟的表现。 + 気温や湿度、大気圧によって既存の天候を拡張します。 - - 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 - 降雨の同期 - 비를 동기화 합니다 - - - Sync Wind - Synchronizuj wiatr - Sincronizar viento - Wind synchronisieren - Synchronizuj vítr - Sincronizar vento - Synchronisation du vent - Szél szinkronizálása - Синхрониз. ветер - Sincronizza Vento - 風を同期 - 바람 동기화 - - - Synchronizes wind - Synchronizuje wiatr - Sincroniza el viento - Synchronisiert den Wind - Synchronizace větru - Sincroniza o vento - Synchronise le vent - Szinkronizálja a szelet - Синхронизирует ветер - Sincronizza Vento - 風を同期 - 바람을 동기화 합니다 - - - Sync Misc - Synchronizuj różne - Sincronizar otros - Sonstiges synchronisieren - Synchronizuj různé - Sincronizar outros - Synchronisation autres - Egyéb szinkronizálása - Синхрониз. прочее - 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,... - ライティングや虹、霧などを同期 - 번개라던가, 무지개, 안개등을 동기화 합니다 - - + Update Interval Interwał aktualizacji Intervalo de actualización @@ -207,11 +99,13 @@ Intervalle de synchronisation Frissítési intervallum Интервал обновления - Intervallo Aggiornamenti + Intervallo Aggiornamento 更新間隔 갱신 간격 + 更新间隔 + 更新間隔 - + Defines the interval (seconds) between weather updates Określa interwał (sekundy) pomiędzy aktualizacjami pogody Defina el intervalo (en segundos) entre actualizacions de clima @@ -221,9 +115,27 @@ Défini un intervalle (secondes) entre deux synchronisations Megadja az intervallumot (másodpercben) az időjárás-frissítések között Определяет интервал (в секундах) между обновлениями погоды - Definisce l'intervallo (in secondi) tra aggiornamenti del meteo + Definisce l'intervallo(in secondi) tra aggiornamenti del meteo 天候を更新する間隔を定義します。(秒) 기후를 갱신 하는 간격을 초 단위로 정합니다. + 设定天气更新的时间间隔(秒) + 設定天氣更新的時間間隔(秒) + + + Wind Simulation (map based) + Wind Simulation (kartenbasiert) + Simulazione del Vento (basato sulla mappa) + 風力模擬(基於地圖) + 风力模拟(基于地图) + 風シミュレーション (マップを基に) + + + Enables the map based wind simulation (overwrites vanilla wind) + Aktiviert die kartenbasierte Windsimulation (überschreibt Vanilla Wind) + Abilita la simulazione del vento basato sulla mappa (sovrascrive il vento vanilla) + 啟用後將遵照地圖特色進行風力模擬(覆蓋掉官方原版的風力模擬) + 启用后将遵照地图特色进行风力模拟(覆盖掉官方原版的风力模拟) + マップを基にした風シミュレーションを有効化 (標準の風を上書き) diff --git a/addons/winddeflection/ACE_Settings.hpp b/addons/winddeflection/ACE_Settings.hpp index 2d6d7dfb3f..73c333479f 100644 --- a/addons/winddeflection/ACE_Settings.hpp +++ b/addons/winddeflection/ACE_Settings.hpp @@ -1,26 +1,24 @@ class ACE_Settings { class GVAR(enabled) { + category = CSTRING(windDeflection_DisplayName); displayName = CSTRING(deflectionModule_DisplayName); description = CSTRING(deflectionModule_Description); typeName = "BOOL"; value = 1; }; class GVAR(vehicleEnabled) { + category = CSTRING(windDeflection_DisplayName); displayName = CSTRING(vehicleEnabled_DisplayName); description = CSTRING(vehicleEnabled_Description); typeName = "BOOL"; value = 1; }; class GVAR(simulationInterval) { + category = CSTRING(windDeflection_DisplayName); displayName = CSTRING(simulationInterval_DisplayName); description = CSTRING(simulationInterval_Description); typeName = "SCALAR"; value = 0.05; - }; - class GVAR(simulationRadius) { - displayName = CSTRING(simulationRadius_DisplayName); - description = CSTRING(simulationRadius_Description); - typeName = "SCALAR"; - value = 3000; + sliderSettings[] = {0, 0.2, 0.05, 2}; }; }; diff --git a/addons/winddeflection/CfgVehicles.hpp b/addons/winddeflection/CfgVehicles.hpp index 866a00d9c1..e40d3eccbd 100644 --- a/addons/winddeflection/CfgVehicles.hpp +++ b/addons/winddeflection/CfgVehicles.hpp @@ -1,7 +1,7 @@ class CfgVehicles { class ACE_Module; class GVAR(ModuleSettings): ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(windDeflection_DisplayName); icon = QPATHTOF(UI\Icon_Module_Wind_ca.paa); category = "ACE"; @@ -30,15 +30,9 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 0.05; }; - class simulationRadius { - displayName = CSTRING(simulationRadius_DisplayName); - description = CSTRING(simulationRadius_Description); - typeName = "NUMBER"; - defaultValue = 3000; - }; }; class ModuleDescription { description = CSTRING(windDeflection_Description); }; }; -}; \ No newline at end of file +}; diff --git a/addons/winddeflection/functions/fnc_handleFired.sqf b/addons/winddeflection/functions/fnc_handleFired.sqf index e78620471d..2ee6735053 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 @@ -18,9 +18,18 @@ //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); -if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && {_projectile isKindOf "BulletBase"} && {_unit isKindOf "Man"}) exitWith {false}; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && {_projectile isKindOf "BulletBase" && {_unit isKindOf "Man"}}) exitWith {false}; if (!((_projectile isKindOf "BulletBase") || {_projectile isKindOf "GrenadeBase"})) exitWith {false}; -if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {false}; +if (_unit distance ACE_player > 2000) exitWith {false}; + +private _abort = false; +if (!local _unit && {_projectile isKindOf "BulletBase"}) then { + private _ammoCount = (_unit ammo _muzzle) + 1; + private _tracersEvery = getNumber(configFile >> "CfgMagazines" >> _magazine >> "tracersEvery"); + private _lastRoundsTracer = getNumber(configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer"); + _abort = _ammoCount > _lastRoundsTracer && {_tracersEvery == 0 || {(_ammoCount - _lastRoundsTracer) % _tracersEvery != 0}}; +}; +if (_abort) exitWith {false}; GVAR(trackedBullets) pushBack [_projectile, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")]; diff --git a/addons/winddeflection/functions/fnc_initModuleSettings.sqf b/addons/winddeflection/functions/fnc_initModuleSettings.sqf index 037ce15c47..f74ed869c6 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 */ @@ -22,6 +25,5 @@ if !(_activated) exitWith {}; [_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleEnabled), "vehicleEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(simulationInterval), "simulationInterval"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(simulationRadius), "simulationRadius"] call EFUNC(common,readSettingFromModule); GVAR(simulationInterval) = 0 max GVAR(simulationInterval) min 0.2; diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index 358a434dfa..8c55f6785f 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 */ @@ -23,7 +24,7 @@ _args params ["_lastTime"]; private _deltaT = CBA_missionTime - _lastTime; _args set [0, CBA_missionTime]; - private _isWind = (vectorMagnitude ACE_wind > 0); + private _isWind = (vectorMagnitude wind > 0); { _x params ["_bullet", "_airFriction"]; @@ -35,7 +36,7 @@ GVAR(trackedBullets) deleteAt (GVAR(trackedBullets) find _x); } else { if (_isWind) then { - private _trueVelocity = _bulletVelocity vectorDiff ACE_wind; + private _trueVelocity = _bulletVelocity vectorDiff wind; private _trueSpeed = vectorMagnitude _trueVelocity; private _dragRef = _deltaT * _airFriction * _bulletSpeedSqr; diff --git a/addons/winddeflection/stringtable.xml b/addons/winddeflection/stringtable.xml index 86622d0558..932a4c76a1 100644 --- a/addons/winddeflection/stringtable.xml +++ b/addons/winddeflection/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,8 @@ Informação do vento 風の情報 바람 정보 + 风力资讯 + 風力資訊 Direction: %1 @@ -28,6 +30,8 @@ Direção: %1 風向: %1 방향: %1 + 风向: %1 + 風向: %1 Speed: %1 m/s @@ -42,6 +46,8 @@ Velocidade: %1 m/s 風速: %1 m/s 풍속: %1 m/s + 风速: %1 m/s + 風速: %1 m/s Weather Information @@ -56,6 +62,8 @@ Informação Meteorológica 天候の情報 기상 정보 + 天气资讯 + 天氣資訊 Humidity: %1% @@ -70,6 +78,8 @@ Humidade: %1% 湿度: %1% 습도: %1% + 湿度: %1% + 濕度: %1% Wind Deflection @@ -82,8 +92,10 @@ Szél-hárítás Отклонение ветром Deviazione del Vento - 風向による変化 + 風向の変化 풍향 변화 + 风偏 + 風偏 Wind Deflection @@ -96,8 +108,10 @@ Szél-hárítás Отклонение ветром Deviazione del Vento - 風向による変化 + 風向の変化 풍향 변화 + 风偏 + 風偏 Enables wind deflection @@ -110,8 +124,10 @@ Engedélyezi a szél-hárítást Включает отклонение ветром Abilita deviazione del vento - 風向による変化を有効化 + 風向の変化を有効化 풍향 변화를 적용합니다 + 开启风偏效果 + 開啟風偏效果 Vehicle Enabled @@ -126,6 +142,8 @@ Abilita per Veicoli 車両へ有効化 차량 적용 + 启用风偏给载具 + 啟用風偏給載具 Enables wind deflection for static/vehicle gunners @@ -138,8 +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 @@ -153,7 +173,9 @@ Интервал симуляции Intervallo Simulazione シミュレーションの間隔 - 재현 간격 + 模拟间隔 + 模擬間隔 + 시뮬레이션 간격 Defines the interval between every calculation step @@ -168,34 +190,8 @@ Definisce l'intervallo tra ogni passaggio di calcolo 各計算に適用させる間隔を定義します 매 계산마다의 간격을 정의합니다 - - - Simulation Radius - Zasięg symulacji - Radio de simulación - Simulationsradius - Oblast simulace - Radio da Simulação - Rayon de simulation - Szimulációs hatókör - Радиус симуляции - Raggio Simulazione - シミュレーション半径 - 재현 범위 - - - Defines the radius around the player (in meters) at which projectiles are wind deflected - Określa obszar naokoło gracza (w metrach), na którym pociski są znoszone przez wiatr - Define el radio alrededor del jugador (en metros) en el cual los proyectiles son desviados por el viento - Gibt den Radius (in Metern) um den Spieler an, in dem Projektile vom Wind beeinflusst werden - Definuje oblast kolem hráče (v metrech) v které je projektil ovlivněn větrem - Define o raio ao redor do jogador (em metros) em qual os projéteis são desviados pelo vento - Défini un rayon autour du joueur (en mètres) autour duquel les projectiles sont influencés par le vent - 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 @@ -208,8 +204,10 @@ Szél hatása a lövedékek röppályájára Влияние втера на траекторию снарядов Influenza del vento sulla traiettoria dei proiettili - 風が弾道へ影響させます + 風を弾道へ影響させます 발사체의 궤도에 풍향 변화를 줍니다. + 风力的大小会引响到弹道的轨迹 + 風力的大小會引響到彈道的軌跡 diff --git a/addons/yardage450/functions/fnc_acquireTarget.sqf b/addons/yardage450/functions/fnc_acquireTarget.sqf index 2b04900171..7aa5994f78 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,24 +32,17 @@ 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; - - _distance = _distance - 1 + (random 2); + ([eyePos ACE_player, ACE_player weaponDirection (currentWeapon ACE_player), ACE_player] call EFUNC(laser,shootRay)) params ["", "_distance"]; GVAR(distanceIndex) = (GVAR(distanceIndex) + 1) % METERING_POINT_NUMBER; - GVAR(distances) set [GVAR(distanceIndex), _distance]; + GVAR(distances) set [GVAR(distanceIndex), _distance - 1 + (random 2)]; if (count GVAR(distances) == METERING_POINT_NUMBER) then { - _min = MAX_DISTANCE; - _max = MIN_DISTANCE; - { - _min = _x min _min; - _max = _max max _x; - } forEach GVAR(distances); + private _min = selectMin GVAR(distances); + private _max = selectMax GVAR(distances); - if (abs(_max - _min) < 5) then { - _range = (_min + _max) / 2; + if (_max - _min < 5) then { + 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..59ed5c2ec8 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_turnOn * * Public: No */ diff --git a/addons/yardage450/stringtable.xml b/addons/yardage450/stringtable.xml index 9b364d212d..6ab95aff7f 100644 --- a/addons/yardage450/stringtable.xml +++ b/addons/yardage450/stringtable.xml @@ -14,6 +14,8 @@ Yardage 450 ヤードエイジ 450 Yardage 450 + Yardage 450 + Yardage 450 Laser Rangefinder @@ -28,6 +30,8 @@ Télémètre laser レーザー測距機 레이저 거리측정기 + 雷射测距仪 + 雷射測距儀 Yardage 450 - Power Button @@ -42,6 +46,8 @@ Yardage 450 - bouton d'alimentation ヤードエイジ 450 - 起動ボタン Yardage 450 - 전원 버튼 + Yardage 450 - 电源按钮 + Yardage 450 - 電源按鈕 diff --git a/addons/zeus/ACE_Settings.hpp b/addons/zeus/ACE_Settings.hpp index b520b7a31a..0955fb135a 100644 --- a/addons/zeus/ACE_Settings.hpp +++ b/addons/zeus/ACE_Settings.hpp @@ -1,29 +1,34 @@ class ACE_Settings { class GVAR(zeusAscension) { + category = CSTRING(DisplayName); displayName = CSTRING(ascension_DisplayName); description = CSTRING(ascension_Description); typeName = "BOOL"; value = 0; }; class GVAR(zeusBird) { + category = CSTRING(DisplayName); displayName = CSTRING(bird_DisplayName); description = CSTRING(bird_Description); typeName = "BOOL"; value = 0; }; class GVAR(remoteWind) { + category = CSTRING(DisplayName); displayName = CSTRING(remoteWind_DisplayName); description = CSTRING(remoteWind_Description); typeName = "BOOL"; value = 0; }; class GVAR(radioOrdnance) { + category = CSTRING(DisplayName); displayName = CSTRING(radioOrdnance_DisplayName); description = CSTRING(radioOrdnance_Description); typeName = "BOOL"; value = 0; }; class GVAR(revealMines) { + category = CSTRING(DisplayName); displayName = CSTRING(revealMines_DisplayName); description = CSTRING(revealMines_Description); typeName = "SCALAR"; @@ -31,6 +36,7 @@ class ACE_Settings { values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(revealMines_partial), CSTRING(revealMines_full)}; }; class GVAR(autoAddObjects) { + category = CSTRING(DisplayName); typeName = "BOOL"; value = 0; displayName = CSTRING(AddObjectsToCurator); diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 42dc6d4289..49fcb9532a 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -16,7 +16,7 @@ class CfgVehicles { function = QFUNC(bi_moduleRemoteControl); }; class GVAR(moduleSettings): ACE_Module { - scope = 2; + scope = 1; displayName = CSTRING(Settings_DisplayName); icon = QPATHTOF(UI\Icon_Module_Zeus_Settings_ca.paa); category = "ACE"; @@ -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; @@ -97,14 +98,14 @@ class CfgVehicles { 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; @@ -119,6 +120,13 @@ class CfgVehicles { 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); @@ -142,6 +150,13 @@ class CfgVehicles { 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); @@ -213,4 +228,45 @@ class CfgVehicles { 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); + }; + class ModuleArsenal_F: Module_F { + function=QFUNC(bi_moduleArsenal); + }; }; diff --git a/addons/zeus/XEH_PREP.hpp b/addons/zeus/XEH_PREP.hpp index 0090d04015..aba07e7114 100644 --- a/addons/zeus/XEH_PREP.hpp +++ b/addons/zeus/XEH_PREP.hpp @@ -1,17 +1,23 @@ PREP(addObjectToCurator); +PREP(bi_moduleArsenal); 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); @@ -21,17 +27,23 @@ 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 0c3ff85cdf..5929e8664e 100644 --- a/addons/zeus/XEH_postInit.sqf +++ b/addons/zeus/XEH_postInit.sqf @@ -10,11 +10,16 @@ // 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 { diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 5cd88750b9..5b764b6007 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -4,25 +4,35 @@ 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 class GVAR(captives): ADDON { units[] = { @@ -38,6 +48,11 @@ class CfgPatches { QGVAR(moduleSetMedicalFacility) }; }; + class GVAR(cargo): ADDON { + units[] = { + QGVAR(moduleLoadIntoCargo) + }; + }; class GVAR(cargoAndRepair): ADDON { units[] = { QGVAR(moduleAddSpareTrack), @@ -49,13 +64,20 @@ class CfgPatches { 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" 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_moduleArsenal.sqf b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf new file mode 100644 index 0000000000..2990d42633 --- /dev/null +++ b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf @@ -0,0 +1,66 @@ +/* + * Author: Bohemia Interactive + * Module function to open a full arsenal on a unit + * Edited to use ACE arsenal when present, moved isPlayer check + * + * Arguments: + * 0: The module logic + * 1: Not used + * 2: activated + * + * Return Value: + * None + * + * Example: + * [LOGIC, nil, true] call ace_zeus_fnc_bi_moduleArsenal + * + * Public: No +*/ + +#include "script_component.hpp" + +params ["_logic", "", "_activated"]; + +if (_activated && local _logic) then { + _unit = _logic getvariable ["bis_fnc_curatorAttachObject_object",objnull]; + + //--- Check if the unit is suitable + _error = ""; + switch true do { + case (isnull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";}; + case !(alive _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorDead";}; + case (isnull group _unit || !(side group _unit in [east,west,resistance,civilian])): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorBrain";}; + case (vehicle _unit != _unit || effectivecommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";}; + }; + + if (_error == "") then { + if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then { + if (!isPlayer _unit || {player == _unit}) then { + + [{ + params ["_unit"]; + + [_unit, _unit, true] call EFUNC(arsenal,openBox); + }, [_unit]] call CBA_fnc_directCall; + } else { + + [objNull, localize "str_a3_BIS_fnc_moduleArsenal_errorDead"] call bis_fnc_showCuratorFeedbackMessage; + }; + } else { + if !(isPlayer _unit) then { + + ([] call bis_fnc_rscLayer) cuttext ["","black out",0.5]; + ["#(argb,8,8,3)color(0,0,0,1)",false,nil,0,[0.5,0]] call bis_fnc_textTiles; + ["Open",[true,nil,_unit]] call bis_fnc_arsenal; + ([] call bis_fnc_rscLayer) cuttext ["","plain"]; + } else { + + [objNull, localize "str_a3_BIS_fnc_moduleArsenal_errorDead"] call bis_fnc_showCuratorFeedbackMessage; + }; + }; + } else { + + [objNull,_error] call bis_fnc_showCuratorFeedbackMessage; + }; + deleteVehicle _logic; +}; diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 66395fbb0c..b556b08197 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -12,6 +12,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_bi_moduleCurator + * * Public: No */ diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index 940dd94f38..1c85706d09 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_bi_moduleMine + * * Public: No */ @@ -19,7 +22,7 @@ params ["_logic", "_units", "_activated"]; if (_activated) then { - _explosive = gettext (configFile >> "CfgVehicles" >> typeOf _logic >> "explosive"); + _explosive = gettext (configfile >> "cfgvehicles" >> typeof _logic >> "explosive"); if (_explosive != "") then { _explosive = createvehicle [_explosive,position _logic,[],0,"none"]; _explosive attachto [_logic]; @@ -41,7 +44,7 @@ if (_activated) then { //--- Show hint to curator who placed the object [[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp; - waitUntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic}; + waituntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic}; if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;}; deletevehicle _logic; }; diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index 70002cc215..3d974c126c 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -12,38 +12,38 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_bi_moduleProjectile + * * Public: No */ #include "script_component.hpp" -_fnc_scriptNameParentTemp = if !(isNil '_fnc_scriptName') then {_fnc_scriptName} else {'BIS_fnc_moduleProjectile'}; -private _fnc_scriptNameParent = _fnc_scriptNameParentTemp; -_fnc_scriptNameParentTemp = nil; - -private _fnc_scriptName = 'BIS_fnc_moduleProjectile'; -scriptname _fnc_scriptName; - -params ["_logic", "_units", "_activated"]; +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; if ({local _x} count (objectcurators _logic) > 0) then { //--- Reveal the circle to curators _logic hideobject false; _logic setpos position _logic; }; -if !(isserver) exitWith {}; +if !(isserver) exitwith {}; if (_activated) then { - _ammo = _logic getVariable ["type",gettext (configFile >> "CfgVehicles" >> typeOf _logic >> "ammo")]; + _ammo = _logic getvariable ["type",gettext (configfile >> "cfgvehicles" >> typeof _logic >> "ammo")]; if (_ammo != "") then { - _CfgAmmo = configFile >> "CfgAmmo" >> _ammo; - _dirVar = _fnc_scriptname + typeOf _logic; - _logic setdir (missionnamespace getVariable [_dirVar,direction _logic]); //--- Restore custom direction + _cfgAmmo = configfile >> "cfgammo" >> _ammo; + //if !(isclass _cfgAmmo) exitwith {["CfgAmmo class '%1' not found.",_ammo] call bis_fnc_error;}; + // It seems BI broke this part... + // _dirVar = _fnc_scriptname + typeof _logic; + // _logic setdir (missionnamespace getvariable [_dirVar,direction _logic]); //--- Restore custom direction _pos = getposatl _logic; _posAmmo = +_pos; _posAmmo set [2,0]; _dir = direction _logic; - _simulation = tolower gettext (configFile >> "CfgAmmo" >> _ammo >> "simulation"); + _simulation = tolower gettext (configfile >> "cfgammo" >> _ammo >> "simulation"); _altitude = 0; _velocity = []; _attach = false; @@ -104,15 +104,15 @@ if (_activated) then { }; }; }; - } forEach _entities; + } foreach _entities; }; }; - if (count _hint > 0 && {count objectCurators _logic > 0}) then { + if (count _hint > 0 && {count objectcurators _logic > 0}) then { [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; }; if (count _velocity == 3) then { - _altitude = (_logic getVariable ["altitude",_altitude]) call bis_fnc_parsenumber; - _radio = _logic getVariable ["radio",_radio]; + _altitude = (_logic getvariable ["altitude",_altitude]) call bis_fnc_parsenumber; + _radio = _logic getvariable ["radio",_radio]; //--- Create projectile _posAmmo set [2,_altitude]; @@ -121,7 +121,7 @@ if (_activated) then { _projectile setvelocity _velocity; if (_attach) then {_projectile attachto [_logic,[0,0,_altitude]];}; - // Added by ace_zeus for ace_frag compatibility + // Added by ace_zeus for ace_frag compatibility if (!isNil QEFUNC(frag,addPfhRound)) then { [objNull, _ammo, _projectile, true] call EFUNC(frag,addPfhRound); }; @@ -140,13 +140,13 @@ if (_activated) then { //--- Update if (_attach) then { - waitUntil { + waituntil { _soundSource setposatl getposatl _projectile; sleep 1; isnull _projectile || isnull _logic }; } else { - waitUntil { + waituntil { _soundSource setposatl getposatl _projectile; if (getposatl _logic distance _pos > 0 || direction _logic != _dir) then { @@ -158,7 +158,7 @@ if (_activated) then { _projectile setposasl _posNew; _pos = getposatl _logic; _dir = direction _logic; - missionnamespace setVariable [_dirVar,_dir]; + missionnamespace setvariable [_dirVar,_dir]; }; sleep 0.1; isnull _projectile || isnull _logic @@ -177,7 +177,7 @@ if (_activated) then { } else { //--- Repeat to achieve permanent effect - _repeat = _logic getVariable ["repeat",0] > 0; + _repeat = _logic getvariable ["repeat",0] > 0; if (_repeat) then { [_logic,_units,_activated] call bis_fnc_moduleprojectile; } else { @@ -188,6 +188,6 @@ if (_activated) then { deletevehicle _logic; }; } else { - ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeOf _logic] call bis_fnc_error; + ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeof _logic] call bis_fnc_error; }; }; diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index 79cd35477f..994b445d8d 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_bi_moduleRemoteControl + * * Public: No */ @@ -31,13 +34,16 @@ if (_activated && local _logic && !isnull curatorcamera) then { if ((_mouseOver select 0) == typename objnull) then {_unit = _mouseOver select 1;}; _unit = effectivecommander _unit; + //--- Temp owner + private _tempOwner = _unit getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]; + //--- Check if the unit is suitable _error = ""; if !(side group _unit in [east,west,resistance,civilian]) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorEmpty";}; if (isplayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";}; if !(alive _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";}; if (isnull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";}; - if !(isnull (_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull])) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; + if (!isnull _tempOwner && {_tempOwner in allPlayers}) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; if (isuavconnected vehicle _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; if (_error == "") then { diff --git a/addons/zeus/functions/fnc_getModuleDestination.sqf b/addons/zeus/functions/fnc_getModuleDestination.sqf index d6a19d69b1..f29b42550c 100644 --- a/addons/zeus/functions/fnc_getModuleDestination.sqf +++ b/addons/zeus/functions/fnc_getModuleDestination.sqf @@ -5,10 +5,16 @@ * Arguments: * 0: The souce object * 1: Code to run when position is ready - * - Code is passed [0: Successful , 1: Object , 2: Position ASL ] - * 2: Text - * 3: Icon image file - * 4: Icon color + * - 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 @@ -23,17 +29,22 @@ 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]] call _code; + [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_displayEH) = [(findDisplay 312), "mouseButtonDown", { - params ["", "_mouseButton"]; +GVAR(moduleDestination_displayEHMouse) = [findDisplay 312, "mouseButtonDown", { + params ["", "_mouseButton", "", "", "_shift", "_ctrl", "_alt"]; + if (_mouseButton != 0) exitWith {}; // Only watch for LMB + + //IGNORE_PRIVATE_WARNING ["_thisArgs"] _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]; @@ -42,13 +53,39 @@ GVAR(moduleDestination_displayEH) = [(findDisplay 312), "mouseButtonDown", { AGLToASL (screenToWorld getMousePosition); }; TRACE_2("placed",_object,_mousePosASL); - [true, _object, _mousePosASL] call _code; + + [true, _object, _mousePosASL, _shift, _ctrl, _alt] call _code; GVAR(moduleDestination_running) = false; }, [_object, _code]] call CBA_fnc_addBISEventHandler; -// Add draw eh for the zeus map - draws the 2d icon and line +// 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 + + //IGNORE_PRIVATE_WARNING ["_thisArgs"] + _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); + }; + TRACE_2("aborted",_object,_mousePosASL); + + [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"]; + //IGNORE_PRIVATE_WARNING ["_thisArgs"] _thisArgs params ["_object", "_text", "_icon", "_color"]; private _pos2d = (((findDisplay 312) displayCtrl 50) ctrlMapScreenToWorld getMousePosition); @@ -56,12 +93,13 @@ GVAR(moduleDestination_mapDrawEH) = [((findDisplay 312) displayCtrl 50), "draw", _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]] call _code; + [false, _object, [0,0,0], false, false, false] call _code; }; if (GVAR(moduleDestination_running)) then { // Draw the 3d icon and line @@ -69,11 +107,13 @@ GVAR(moduleDestination_mapDrawEH) = [((findDisplay 312) displayCtrl 50), "draw", drawIcon3D [_icon, _color, _mousePosAGL, 1.5, 1.5, 45, _text]; drawLine3D [_mousePosAGL, ASLtoAGL (getPosASL _object), _color];; } else { - TRACE_3("cleaning up",_this select 1, GVAR(moduleDestination_displayEH), GVAR(moduleDestination_mapDrawEH)); + 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_displayEH)]; + (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_displayEH) = nil; + 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 fada3f1e32..05c5de668e 100644 --- a/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf +++ b/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf @@ -14,37 +14,34 @@ * Return Value: * 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 = []; -_numCfgs = count (configFile >> "ACE_Curator"); -for "_n" from 0 to (_numCfgs - 1) do { - _cfg = (configFile >> "ACE_Curator") select _n; - - if (isArray _cfg) then { - _requiredAddon = getArray _cfg; +private _removeAddons = []; +{ + private _addon = _x; + if (isArray _addon) then { { if !(isClass (configFile >> "CfgPatches" >> _x)) exitWith { - _removeAddons pushBack (configName _cfg); + _removeAddons pushBack (configName _addon); }; - } forEach _requiredAddon; + } forEach (getArray _addon); }; - if (isText _cfg) then { - _requiredAddon = getText _cfg; - if !(isClass (configFile >> "CfgPatches" >> _requiredAddon)) then { - _removeAddons pushBack (configName _cfg); + if (isText _addon) then { + if !(isClass (configFile >> "CfgPatches" >> getText _addon)) then { + _removeAddons pushBack (configName _addon); }; }; -}; +} forEach configProperties [configFile >> "ACE_Curator"]; _logic removeCuratorAddons _removeAddons; diff --git a/addons/zeus/functions/fnc_moduleAddArsenal.sqf b/addons/zeus/functions/fnc_moduleAddArsenal.sqf new file mode 100644 index 0000000000..68b5148521 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleAddArsenal.sqf @@ -0,0 +1,44 @@ +/* + * 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 { + if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then { + + [_object, true, true] call EFUNC(arsenal,initBox); + } else { + + 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 index d75c0173fe..6f60f80947 100644 --- a/addons/zeus/functions/fnc_moduleAddOrRemoveFRIES.sqf +++ b/addons/zeus/functions/fnc_moduleAddOrRemoveFRIES.sqf @@ -10,13 +10,16 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleAddOrRemoveFRIES + * * Public: No */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; +params ["_logic"]; -if !(_activated && {local _logic}) exitWith {}; +if !(local _logic) exitWith {}; if !(["ace_fastroping"] call EFUNC(common,isModLoaded)) then { [LSTRING(RequiresAddon)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf b/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf index 3a291ac5b3..ed633c2033 100644 --- a/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf +++ b/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf @@ -10,13 +10,16 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleAddSpareTrack + * * Public: No */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; +params ["_logic"]; -if !(_activated && local _logic) exitWith {}; +if !(local _logic) exitWith {}; if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(common,isModLoaded)) then { [LSTRING(RequiresAddon)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf b/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf index 50dc25d62c..58cd6c1063 100644 --- a/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf +++ b/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf @@ -10,13 +10,16 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleAddSpareWheel + * * Public: No */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; +params ["_logic"]; -if !(_activated && local _logic) exitWith {}; +if !(local _logic) exitWith {}; if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(common,isModLoaded)) then { [LSTRING(RequiresAddon)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleCaptive.sqf b/addons/zeus/functions/fnc_moduleCaptive.sqf index 4db34231c0..317c785f20 100644 --- a/addons/zeus/functions/fnc_moduleCaptive.sqf +++ b/addons/zeus/functions/fnc_moduleCaptive.sqf @@ -10,25 +10,27 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleCaptive + * * Public: No */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit", "_captive"]; +params ["_logic"]; -if !(_activated && local _logic) exitWith {}; +if !(local _logic) exitWith {}; if (isNil QEFUNC(captives,setHandcuffed)) then { [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 FUNC(showMessage); } else { - _unit = effectivecommander (_mouseOver select 1); + private _unit = effectivecommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); @@ -36,7 +38,7 @@ if (isNil QEFUNC(captives,setHandcuffed)) then { if !(alive _unit) then { [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..404605451e --- /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"]; + +if !(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 58e7ad19c5..1d4e2769b8 100644 --- a/addons/zeus/functions/fnc_moduleGlobalSetSkill.sqf +++ b/addons/zeus/functions/fnc_moduleGlobalSetSkill.sqf @@ -9,13 +9,16 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleGlobalSetSkill + * * Public: No */ #include "script_component.hpp" -_this params ["_varName","_varValue"]; -_varValue params ["_general","_accuracy","_handling","_spotting","_cover","_combat"]; +params ["_varName", "_varValue"]; +_varValue params ["_general", "_accuracy", "_handling", "_spotting", "_cover", "_combat"]; TRACE_1("Params",_this); TRACE_6("AI settings updated",GVAR(GlobalSkillAI)); diff --git a/addons/zeus/functions/fnc_moduleGroupSide.sqf b/addons/zeus/functions/fnc_moduleGroupSide.sqf index 050b92a9fc..2a52df09da 100644 --- a/addons/zeus/functions/fnc_moduleGroupSide.sqf +++ b/addons/zeus/functions/fnc_moduleGroupSide.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" -params ["_unit","_newSide"]; +params ["_unit", "_newSide"]; private _side = side _unit; // Nothing to do here diff --git a/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf b/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf new file mode 100644 index 0000000000..33ceb703a1 --- /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"]; + +if !(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..b14509c272 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf @@ -0,0 +1,48 @@ +/* + * 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 { + + if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then { + + [_object, true, true] call EFUNC(arsenal,removeBox); + } else { + + 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 47b423fadd..a73dbd7fe8 100644 --- a/addons/zeus/functions/fnc_moduleSearchNearby.sqf +++ b/addons/zeus/functions/fnc_moduleSearchNearby.sqf @@ -10,14 +10,17 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSearchNearby + * * Public: No */ #include "script_component.hpp" -params ["_logic","_units","_activated"]; +params ["_logic"]; -if !(_activated && local _logic) exitWith {}; +if !(local _logic) exitWith {}; //Validate the module target: private _unit = effectiveCommander (attachedTo _logic); diff --git a/addons/zeus/functions/fnc_moduleSetMedic.sqf b/addons/zeus/functions/fnc_moduleSetMedic.sqf index 55b1f2687b..b2cd233bc7 100644 --- a/addons/zeus/functions/fnc_moduleSetMedic.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedic.sqf @@ -10,25 +10,27 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSetMedic + * * Public: No */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit", "_medicN"]; +params ["_logic"]; -if !(_activated && local _logic) exitWith {}; +if !(local _logic) exitWith {}; if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { [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 FUNC(showMessage); } else { - _unit = effectivecommander (_mouseOver select 1); + private _unit = effectivecommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); @@ -39,7 +41,7 @@ if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { [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 e0a3131f44..4977b21986 100644 --- a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf @@ -10,25 +10,27 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSetMedicalFacility + * * Public: No */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit"]; +params ["_logic"]; -if !(_activated && local _logic) exitWith {}; +if !(local _logic) exitWith {}; if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { [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 FUNC(showMessage); } else { - _unit = (_mouseOver select 1); + private _unit = (_mouseOver select 1); if (_unit isKindOf "Man" || {!(_unit isKindOf "Building")}) then { [LSTRING(OnlyStructures)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf index 49070dbfb9..a819a15d9e 100644 --- a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf @@ -10,25 +10,27 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSetMedicalVehicle + * * Public: No */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit", "_medicN"]; +params ["_logic"]; -if !(_activated && local _logic) exitWith {}; +if !(local _logic) exitWith {}; if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { [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 FUNC(showMessage); } else { - _unit = (_mouseOver select 1); + private _unit = (_mouseOver select 1); if (_unit isKindOf "Man" || {_unit isKindOf "Building"}) then { [LSTRING(OnlyVehicles)] call FUNC(showMessage); @@ -39,7 +41,7 @@ if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { [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 index fe7f3564e0..fc6d6e4a06 100644 --- a/addons/zeus/functions/fnc_moduleSimulation.sqf +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [LOGIC] call ace_zeus_fnc_moduleSimulation + * * Public: No */ diff --git a/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf index 4d18c3f6e4..b2c9ba88a7 100644 --- a/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf +++ b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf @@ -3,13 +3,16 @@ * Commands the selected unit or group to start suppressive fire on the unit, group or location the module is placed on * * Arguments: - * 0: The module logic + * 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 @@ -19,7 +22,7 @@ if (canSuspend) exitWith {[FUNC(moduleSuppressiveFire), _this] call CBA_fnc_dire params ["_logic", "_units", "_activated"]; -if !(_activated && local _logic) exitWith {}; +if !(_activated && {local _logic}) exitWith {}; // Validate the module target private _unit = effectiveCommander (attachedTo _logic); @@ -31,7 +34,7 @@ if (isNull _unit) exitWith { [LSTRING(NothingSelected)] call FUNC(showMessage); }; if (!alive _unit) exitWith { - [localize LSTRING(OnlyAlive)] call FUNC(showMessage); + [LSTRING(OnlyAlive)] call FUNC(showMessage); }; if ([_unit] call EFUNC(common,isPlayer)) exitWith { ["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call FUNC(showMessage); @@ -40,8 +43,7 @@ if ([_unit] call EFUNC(common,isPlayer)) exitWith { [_unit, { params ["_successful", "_unit", "_mousePosASL"]; TRACE_3("getModuleDestination return",_successful,_unit,_mousePosASL); - if (!_successful) exitWith {}; - if (!alive _unit) exitWith {}; + 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; @@ -114,4 +116,4 @@ if ([_unit] call EFUNC(common,isPlayer)) exitWith { }; #endif -}, (localize LSTRING(ModuleSuppressiveFire_DisplayName))] call FUNC(getModuleDestination); +}, localize LSTRING(ModuleSuppressiveFire_DisplayName)] call FUNC(getModuleDestination); diff --git a/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf b/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf index 7ab7365c3b..7b11b7e18f 100644 --- a/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf +++ b/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, [5, 6, 7], "bigmagazine"] call ace_zeus_fnc_moduleSuppressiveFireLocal + * * Public: No */ #include "script_component.hpp" diff --git a/addons/zeus/functions/fnc_moduleSurrender.sqf b/addons/zeus/functions/fnc_moduleSurrender.sqf index 5e4890ae75..fceb72b57f 100644 --- a/addons/zeus/functions/fnc_moduleSurrender.sqf +++ b/addons/zeus/functions/fnc_moduleSurrender.sqf @@ -10,25 +10,27 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSurrender + * * Public: No */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit", "_surrendering"]; +params ["_logic"]; -if !(_activated && local _logic) exitWith {}; +if !(local _logic) exitWith {}; if (isNil QEFUNC(captives,setSurrendered)) then { [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 FUNC(showMessage); } else { - _unit = effectivecommander (_mouseOver select 1); + private _unit = effectivecommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); @@ -39,7 +41,7 @@ if (isNil QEFUNC(captives,setSurrendered)) then { if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { [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 4a1855ba65..c52517a7d0 100644 --- a/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf +++ b/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf @@ -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 0cf0fffda6..63e2a8c6ae 100644 --- a/addons/zeus/functions/fnc_moduleUnconscious.sqf +++ b/addons/zeus/functions/fnc_moduleUnconscious.sqf @@ -10,25 +10,27 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleUnconscious + * * Public: No */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit", "_conscious"]; +params ["_logic"]; -if !(_activated && local _logic) exitWith {}; +if !(local _logic) exitWith {}; if (isNil QEFUNC(medical,setUnconscious)) then { [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 FUNC(showMessage); } else { - _unit = effectivecommander (_mouseOver select 1); + private _unit = effectivecommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); @@ -36,9 +38,9 @@ if (isNil QEFUNC(medical,setUnconscious)) then { if !(alive _unit) then { [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); + [_unit, !_conscious, 10e10] call EFUNC(medical,setUnconscious); }; }; }; diff --git a/addons/zeus/functions/fnc_moduleZeusSettings.sqf b/addons/zeus/functions/fnc_moduleZeusSettings.sqf index 0b4e3b4027..8abd714824 100644 --- a/addons/zeus/functions/fnc_moduleZeusSettings.sqf +++ b/addons/zeus/functions/fnc_moduleZeusSettings.sqf @@ -10,14 +10,15 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleZeusSettings + * * Public: No */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; - -if !(_activated) exitWith {}; +params ["_logic"]; [_logic, QGVAR(zeusAscension), "zeusAscension"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(zeusBird), "zeusBird"] call EFUNC(common,readSettingFromModule); diff --git a/addons/zeus/functions/fnc_showMessage.sqf b/addons/zeus/functions/fnc_showMessage.sqf index 9ce8ced9c3..755b9b6278 100644 --- a/addons/zeus/functions/fnc_showMessage.sqf +++ b/addons/zeus/functions/fnc_showMessage.sqf @@ -1,14 +1,14 @@ /* * Author: 654wak654 - * Shows a zeus message through the BIS function, handles localization. + * Shows a Zeus message through the BIS function, handles localization. * If multiple args are given, they get formatted. * * Arguments: - * 0: The message - * N: Anything + * 0: Message + * N: Anything (default: nil) * * Return Value: - * Nothing + * None * * Example: * ["something"] call ace_zeus_fnc_showMessage diff --git a/addons/zeus/functions/fnc_ui_attributeCargo.sqf b/addons/zeus/functions/fnc_ui_attributeCargo.sqf index 49e5c6b2ea..fb57362fa1 100644 --- a/addons/zeus/functions/fnc_ui_attributeCargo.sqf +++ b/addons/zeus/functions/fnc_ui_attributeCargo.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_attributeCargo + * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_attributePosition.sqf b/addons/zeus/functions/fnc_ui_attributePosition.sqf index d6ae581ae4..ecd3458ac2 100644 --- a/addons/zeus/functions/fnc_ui_attributePosition.sqf +++ b/addons/zeus/functions/fnc_ui_attributePosition.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_attributePosition + * * Public: No */ @@ -45,7 +48,7 @@ private _fnc_onDraw = { }; private _fnc_onMapClick = { - params ["_map","_button","_x","_y","_shift","_ctrl","_alt"]; + params ["_map","_button"]; if (_button == 0) then { private _display = ctrlParent _map; diff --git a/addons/zeus/functions/fnc_ui_attributeRadius.sqf b/addons/zeus/functions/fnc_ui_attributeRadius.sqf index 7330d1b170..3c4d296f91 100644 --- a/addons/zeus/functions/fnc_ui_attributeRadius.sqf +++ b/addons/zeus/functions/fnc_ui_attributeRadius.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_attributeRadius + * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_defendArea.sqf b/addons/zeus/functions/fnc_ui_defendArea.sqf index 5d4f652950..13de25c2fa 100644 --- a/addons/zeus/functions/fnc_ui_defendArea.sqf +++ b/addons/zeus/functions/fnc_ui_defendArea.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_defendArea + * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_editableObjects.sqf b/addons/zeus/functions/fnc_ui_editableObjects.sqf index 040bd2630f..8cb243849e 100644 --- a/addons/zeus/functions/fnc_ui_editableObjects.sqf +++ b/addons/zeus/functions/fnc_ui_editableObjects.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_editableObjects + * * Public: No */ 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 68ffc95033..edca781152 100644 --- a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf +++ b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_globalSetSkill + * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_groupSide.sqf b/addons/zeus/functions/fnc_ui_groupSide.sqf index e983d49ea1..e5720e0720 100644 --- a/addons/zeus/functions/fnc_ui_groupSide.sqf +++ b/addons/zeus/functions/fnc_ui_groupSide.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_groupSide + * * Public: No */ @@ -112,7 +115,7 @@ private _fnc_onUnload = { }; private _fnc_onConfirm = { - params [["_ctrlButtonOK", controlNull, [controlNull]]]; + params ["_ctrlButtonOK"]; private _display = ctrlparent _ctrlButtonOK; if (isNull _display) exitWith {}; diff --git a/addons/zeus/functions/fnc_ui_patrolArea.sqf b/addons/zeus/functions/fnc_ui_patrolArea.sqf index c94e2b3dd2..c026bbce6a 100644 --- a/addons/zeus/functions/fnc_ui_patrolArea.sqf +++ b/addons/zeus/functions/fnc_ui_patrolArea.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_patrolArea + * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_searchArea.sqf b/addons/zeus/functions/fnc_ui_searchArea.sqf index 30e012e29b..06393ca578 100644 --- a/addons/zeus/functions/fnc_ui_searchArea.sqf +++ b/addons/zeus/functions/fnc_ui_searchArea.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_searchArea + * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf index 94a734ab4e..d323a9a467 100644 --- a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf +++ b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_teleportPlayers + * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf b/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf new file mode 100644 index 0000000000..9dff6808e4 --- /dev/null +++ b/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf @@ -0,0 +1,133 @@ +/* + * 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); + + [_logic, _toggle == 1, _gear == 1, _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..822e552dac --- /dev/null +++ b/addons/zeus/functions/fnc_ui_toggleNvg.sqf @@ -0,0 +1,122 @@ +/* + * 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); + + [_logic, _toggle == 1, _target] call FUNC(moduleToggleNvg); +}; + +_display displayAddEventHandler ["unload", _fnc_onUnload]; +_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm]; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 3a416358c8..c14d2fab71 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1,6 +1,13 @@  + + Zeus + Zeus + 宙斯 + 宙斯 + Zeus + Zeus Settings Ustawienia Zeusa @@ -14,6 +21,8 @@ Impostazioni Zeus Zeus 設定 Zeus 설정 + 宙斯设定 + 宙斯設定 Provides control over various aspects of Zeus. @@ -26,8 +35,10 @@ 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 @@ -42,6 +53,8 @@ Messaggi di Ascesa 転生表示 재림 메세지 + 宙斯上任讯息 + 宙斯上任訊息 Display global popup messages when a player is assigned as Zeus. @@ -56,6 +69,8 @@ Mostra messaggi popup globali quando un giocatore viene assegnato come Zeus. プレイヤーが Zeus になるとき、全体へポップアップ表示をおこないます。 플레이어가 Zeus 될 시 서버에 이를 알리는 팝업이 등장합니다. + 当一位玩家被指定为宙斯时显示全域讯息 + 當一位玩家被指定為宙斯時顯示全域訊息 Zeus Eagle @@ -70,6 +85,8 @@ Aquila Zeus Zeus イーグル Zeus 독수리 + 宙斯鹰眼模式 + 宙斯鷹眼模式 Spawn an eagle that follows the Zeus camera. @@ -84,6 +101,8 @@ Crea un'aquila che segue la camera Zeus. Zeus カメラを追うイーグルを出現します。 Zeus의 카메라를 따라다니는 독수리를 생성합니다. + 生成一个老鹰跟着宙斯的摄影机 + 生成一個老鷹跟著宙斯的攝影機 Wind Sounds @@ -98,6 +117,8 @@ Suoni del Vento 風の音 바람 소리 + 风声 + 風聲 Play wind sounds when Zeus remote controls a unit. @@ -112,6 +133,8 @@ Esegui rumori di vento quando Zeus controlla un'unità in remoto. ユニットが Zeus 遠隔操作になったとき、風の音がします。 Zeus가 유닛을 조작할 때 바람소리가 납니다. + 当宙斯开始控制单位时利用风的声音提示 + 當宙斯開始控制單位時利用風的聲音提示 Ordnance Warning @@ -126,6 +149,8 @@ Allarme Esplosivi 砲撃の警告 폭격 경고 + 武装警告 + 武裝警告 Play a radio warning when Zeus uses ordnance. @@ -137,9 +162,11 @@ 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 @@ -154,6 +181,8 @@ Rivela Mine 地雷の表示 지뢰 표시 + 显示地雷 + 顯示地雷 Reveal mines to allies and place map markers. @@ -168,6 +197,8 @@ Rivela mine ad alleati e piazza marcatori in mappa. 友軍に地雷と地図へ設置マーカーを表示します。 아군에게 지도 상의 모든 지뢰를 표시합니다. + 地图将标记队友放置的地雷 + 地圖將標記隊友放置的地雷 Reveal to Allies @@ -182,6 +213,8 @@ Rivela ad Alleati 友軍へ表示 모든 아군에게 표시 + 透露给盟军 + 透露給盟軍 Allies + Map Markers @@ -196,6 +229,8 @@ Alleati + Marcatori Mappa 友軍と地図マーカー 아군 + 지도 마커 + 显示盟军+地图标记 + 顯示盟軍+地圖標記 Toggle Captive @@ -207,9 +242,11 @@ Basculer en captif Elfogott állapot váltása Пленный (вкл./выкл.) - Apri Catturato - 捕虜としてトグル + Attivatore Prigioniero + 捕虜として切り替え 포로 토글 + 切换俘虏 + 切換俘虜 Defend Area @@ -220,41 +257,64 @@ 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 @@ -265,6 +325,9 @@ Globalne umiejętności AI Globale KI-Fähigkeit 서버 인공지능 실력 + Abilità AI Globale + AI技巧设定 + AI技巧設定 General Skill @@ -275,16 +338,22 @@ 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 @@ -295,16 +364,22 @@ Precyzja Genauigkeit 명중률 + Precisione + 精确度 + 精確度 Changes: aimingAccuracy Change : aimingAccuracy Изменяет: aimingAccuracy Upravuje: aimingAccuracy - 変更:aimingAccuracy + 変更: aimingAccuracy Zmienia: precyzję celowania Ändert: aimingAccuracy 변화: 조준 명중률 + Cambia: aimingAccuracy + 改变: 瞄准精确度 + 改變: 瞄準精確度 Weapon Handling @@ -315,16 +390,22 @@ Obsługa broni Waffenhandhabung 무기 조작 + Uso dell'Arma + 武器掌握 + 武器掌握 Changes: 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 @@ -335,16 +416,22 @@ Rozpoznanie Aufklärung 탐지 + Ricognizione + 索敌能力 + 索敵能力 Changes: 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 @@ -355,6 +442,9 @@ Szukaj osłon Deckungssuche 엄폐물 찾기 + Cerca Copertura + 寻找掩护 + 尋找掩護 Should AI seek cover @@ -365,6 +455,9 @@ Czy AI powinno szukać osłon Soll KI nach Deckung suchen 인공지능이 엄폐물을 찾아갑니다 + Le AI dovrebbero cercare una copertura + 决定AI是否会寻找掩护 + 決定AI是否會尋找掩護 Auto Combat @@ -375,6 +468,9 @@ Auto walka Automatischer Kampfmodus 자동 교전 + Combattimento Automatico + 自动交战 + 自動交戰 Should AI automatically switch to combat mode @@ -385,6 +481,9 @@ 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 @@ -395,6 +494,9 @@ Strona grupy Gruppenseite 진영 측 + Fazione del Gruppo + 小队阵营 + 小隊陣營 Patrol Area @@ -405,6 +507,9 @@ Patrol obszaru Patrouillengebiet 정찰 구역 + Area di Pattugliamento + 巡逻区域 + 巡邏區域 Toggle Surrender @@ -416,30 +521,44 @@ Basculer en capitulation Kapituláló állapot váltása Сдавшийся (вкл./выкл.) - Apri Resa - 捕虜としてトグル + Attivatore Resa + 投降として切り替え 항복 토글 + 切换投降 + 切換投降 Add/Remove FRIES - FRUES の追加と削除 + 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 @@ -450,6 +569,9 @@ Teleportuj graczy Spieler teleportieren 플레이어 순간이동 + Teletrasporta Giocatori + 传送玩家 + 傳送玩家 Player @@ -460,16 +582,22 @@ 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 @@ -480,6 +608,9 @@ Teleport grupy Gruppe teleportieren 그룹 순간이동 + Teletrasporta Gruppo + 传送小队 + 傳送小隊 Teleports all units in group @@ -490,6 +621,9 @@ Teleportuje wszystkie jednostki w grupie Teleportiert alle Einheiten der Gruppe 그룹내에 모든 인원을 순간이동 시킵니다 + Teletrasporta tutte le unità del gruppo + 传送全部小队成员 + 傳送全部小隊成員 Toggle Unconscious @@ -501,9 +635,11 @@ Basculer en inconscient Eszméletlen állapot váltása Без сознания (вкл./выкл.) - Apri Incosciente - 気絶をトグル + Attivatore Incoscienza + 気絶を切り替え 기절 토글 + 切换昏迷 + 切換昏迷 Search Area @@ -514,16 +650,22 @@ 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 @@ -537,6 +679,8 @@ Assigner médecin 衛生兵に割り当て 의무병 임명 + 指定医疗兵 + 指定醫療兵 Assign Medical Vehicle @@ -550,6 +694,8 @@ Assigner véhicule médical 医療車両として割り当て 의무 차량 임명 + 指定医疗载具 + 指定醫療載具 Assign Medical Facility @@ -563,13 +709,19 @@ Assigner installation médicale 医療施設として割り当て 의무 시설 임명 + 指定医疗设施 + 指定醫療設施 Toggle Simulation + Ändere Simulation Przełącz symulację - シミュレーションをトグル + シミュレーションを切り替え 재현 토글 Bascule Simulation + Attivatore Simulazione + 切换模拟 + 切換模擬 Add Spare Wheel @@ -583,6 +735,8 @@ Ajouter pièce de rechange 予備タイヤを追加 예비 바퀴 추가 + 增加备用轮胎 + 增加備用輪胎 Add Spare Track @@ -596,6 +750,8 @@ Ajouter une chenille de secours 車両へ予備タイヤを追加します。 예비 궤도 추가 + 增加备用履带 + 增加備用履帶 Unit must be alive @@ -610,6 +766,8 @@ Usar somente em unidades vivas ユニットを生存させます 대상이 반드시 살아있어야 합니다 + 单位必须是活着 + 單位必須是活著 Unit must be infantry @@ -624,6 +782,8 @@ Usar somente em infantaria desmontada ユニットを歩兵にさせます 대상이 반드시 보병이어야 합니다 + 单位必须是步兵 + 單位必須是步兵 Unit must be a structure @@ -637,6 +797,8 @@ L'unité doit être une structure ユニットを構造物とします 대상이 반드시 건축물이어야만 합니다 + 单位必须是建筑 + 單位必須是建築 Unit must be a vehicle @@ -650,6 +812,8 @@ L'unité doit être un véhicule ユニットを車両とします 대상이 반드시 차량이어야만 합니다 + 单位必须是载具 + 單位必須是載具 Unit must be a vehicle with cargo space @@ -663,6 +827,8 @@ L'unité doit être un véhicule avec de l'espace de cargaison ユニットをカーゴ スペースがある車両にします 대상이 반드시 화물을 실을 수 있는 차량이어야 합니다 + 单位必须是载具且有载货空间 + 單位必須是載具且有載貨空間 Unit must have cargo space left @@ -676,6 +842,8 @@ L'unité doit avoir de l'espace libre en cargaison ユニットへカーゴ スペースを与えます 대상의 화물공간이 남아있어야합니다 + 单位必须有剩余的载货空间 + 單位必須有剩餘的載貨空間 Unit must not be captive @@ -690,6 +858,8 @@ L'unità non dev'essere un prigioniero ユニットを捕虜にさせません 대상이 포로면 안됩니다 + 单位不能被俘虏 + 單位不能被俘虜 Unit must belong to an appropriate side @@ -700,6 +870,9 @@ 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 @@ -710,6 +883,9 @@ Najbliższy budynek jest zbyt daleko Nächstgelegenes Gebäude ist zu weit entfernt 가장가까운 건물이 너무 멈 + L'edificio più vicino è troppo lontano + 最近的房子离太远了 + 最近的房子離太遠了 Place on a unit @@ -724,6 +900,8 @@ Piazza su una unità ユニットの上に設置 대상에 배치하기 + 放置在一个单位上 + 放置在一個單位上 Requires an addon that is not present @@ -737,7 +915,9 @@ Требуется аддон, который отсутствует Richiede un addon che non è presente 要求されたアドオンは存在していません - 현재 없는 에드온을 필요로 합니다 + 需要一个不存在的插件 + 需要一個不存在的插件 + 현재 없는 애드온을 필요로 합니다 Add Objects to Curator @@ -751,6 +931,8 @@ Fügt Objekte zum Kurator hinzu キュレーターにオブジェクトを追加 큐레이터에 물체 추가 + 增加物件给任务策划人 + 增加物件給任務策劃人 Adds any spawned object to all curators in the mission @@ -764,28 +946,34 @@ Fügt jedes gespawnte Objekt allen Kuratoren der Mission hinzu ミッション内で作成されたオブジェクトに全キュレーターを追加 미션 내 큐레이터에 모든 생성 물체 추가 + 在任务中生成物件给所有的任务策划人 + 在任務中生成物件給所有的任務策劃人 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 @@ -796,6 +984,8 @@ Wähle eine Position, an der die Aufgabe ausgeführt werden soll 작업을 할 위치를 선택하십시요 Seleziona una posizione per eseguire l'incarico + 选择要执行目标的位置 + 選擇要執行目標的位置 Task Radius @@ -806,6 +996,8 @@ Radius der Aufgabe 작업 반경 Raggio Incarico + 目标半径 + 目標半徑 Radius to perform the task within @@ -816,6 +1008,8 @@ Radius, in dem die Aufgabe ausgeführt werden soll 다음 반경 내에서 작업 Raggio per eseguire un incarico + 设定目标范围半径 + 設定目標範圍半徑 Invalid radius entered @@ -827,10 +1021,221 @@ 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 27f89d89c0..2bb2c97d85 100644 --- a/addons/zeus/ui/RscAttributes.hpp +++ b/addons/zeus/ui/RscAttributes.hpp @@ -417,7 +417,6 @@ class GVAR(RscTeleportPlayers): RscDisplayAttributes { }; }; - class GVAR(AttributeCargo): RscControlsGroupNoScrollbars { onSetFocus = QUOTE(_this call FUNC(ui_attributeCargo)); idc = -1; @@ -473,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/circle.yml b/circle.yml new file mode 100644 index 0000000000..7616e4912c --- /dev/null +++ b/circle.yml @@ -0,0 +1,23 @@ +version: 2 +jobs: + build: + docker: + - image: python:3-alpine + steps: + - checkout + - run: + name: Validate SQF And Config style + command: python tools/sqf_validator.py && python tools/config_style_checker.py + deployment: + docker: + - image: python:3-alpine + branch: master + requires: + - build + steps: + - checkout + - deploy: + name: Deploy + command: | + pip install pygithub pygithub3 + python3 tools/deploy.py diff --git a/docs/README_DE.md b/docs/README_DE.md index 52b11e0797..5bc01c4359 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -4,7 +4,7 @@

- ACE3 Version + ACE3 Version ACE3 Fehlermeldungen diff --git a/docs/README_PL.md b/docs/README_PL.md index 5c5163313f..cdb9727492 100644 --- a/docs/README_PL.md +++ b/docs/README_PL.md @@ -3,7 +3,7 @@

- ACE3 Wersja + ACE3 Wersja ACE3 Zagadnienia diff --git a/docs/_config.yml b/docs/_config.yml index ab86d182c5..0fda565889 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -8,17 +8,17 @@ ace: githubUrl: https://github.com/acemod/ACE3 version: major: 3 - minor: 9 - patch: 2 - build: 18 + minor: 12 + patch: 0 + build: 29 acex: githubUrl: https://github.com/acemod/ACEX version: major: 3 - minor: 2 + minor: 3 patch: 0 - build: 4 + build: 6 markdown: kramdown diff --git a/docs/_config_dev.yml b/docs/_config_dev.yml index 227d4029bf..29e559c5fb 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: 9 - patch: 2 - build: 18 + minor: 12 + patch: 0 + build: 29 acex: githubUrl: https://github.com/acemod/ACEX version: major: 3 - minor: 1 - patch: 1 - build: 3 + minor: 3 + patch: 0 + build: 6 markdown: kramdown diff --git a/docs/_includes/dependencies_list.md b/docs/_includes/dependencies_list.md index ad884d8cee..86c1ae1bb1 100644 --- a/docs/_includes/dependencies_list.md +++ b/docs/_includes/dependencies_list.md @@ -22,6 +22,10 @@ `ace_main` {% endif %} +{% if include.component == "arsenal" %} +`ace_common` +{% endif %} + {% if include.component == "atragmx" %} `ACE_Advanced_Ballistics`, `ACE_common`, `ACE_weather` {% endif %} @@ -138,6 +142,10 @@ `ace_interaction` {% endif %} +{% if include.component == "hellfire" %} +`ace_interaction`, `ace_missileguidance` +{% endif %} + {% if include.component == "hitreactions" %} `ace_common` {% endif %} @@ -202,6 +210,10 @@ `ace_common` {% endif %} +{% if include.component == "maverick" %} +`ace_missileguidance` +{% endif %} + {% if include.component == "medical" %} `ace_interaction`, `ace_apl` {% endif %} @@ -258,6 +270,10 @@ `ace_common` {% endif %} +{% if include.component == "nlaw" %} +`ace_missileguidance` +{% endif %} + {% if include.component == "noidle" %} `ace_common` {% endif %} @@ -290,6 +306,14 @@ `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_scopes` {% endif %} @@ -419,7 +443,7 @@ {% endif %} {% if include.component == "zeus" %} -`ace_common` +`ace_common`, `ace_ai` {% endif %} {% if include.component == "compat_adr_97" %} @@ -482,10 +506,6 @@ `ace_common` {% endif %} -{% if include.component == "server" %} -`ace_common` -{% endif %} - {% if include.component == "tracers" %} `ace_ballistics` {% 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/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. + +

+ +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/_posts/2017-12-20-cba-settings.md b/docs/_posts/2017-12-20-cba-settings.md new file mode 100644 index 0000000000..2cec527aae --- /dev/null +++ b/docs/_posts/2017-12-20-cba-settings.md @@ -0,0 +1,54 @@ +--- +title: Using CBA Settings in ACE3 +description: With v3.12.0 we are dropping the ACE3 Settings System and now are using CBA Settings +parent: posts +image: /img/news/171220_cbaPost2.jpg +author: Pabstmirror, bux +layout: post +--- + +As announced mid november the upcoming ACE3 release (v3.12.0) will make the transition to using [CBA Settings](https://github.com/CBATeam/CBA_A3/wiki/CBA-Settings-System){:target="_blank"} to control the many settings ACE3 has. + +We have tried to make the change as smooth as possible. + + + + + + +## Players + +All of your old (client settable) settings should transfer automatically. + +The biggest change is how to access the settings now; from the escape menu hit `OPTIONS` and then `ADDON OPTIONS`. + +## Mission Makers + +Old mission should still be fully compatible with ACE3 v3.12.0. + +However the old methods of changing settings (Setting Modules and `class ace_settings` in `description.ext`) are considered deprecated (old modules will still function, but new ones are no longer placeable). + +All settings are also subject to backwards incompatible changes with future ACE3 versions. We recommend switching to changing settings via the CBA Eden Editor interface and deleting any old ACE Setting modules. From Eden Editor click on the `SETTINGS` -> `ADDON OPTIONS`. + +## Server Admins + +`ace_server.pbo` / `ACE_ServerSettings` has been removed in ACE3 v3.12.0. + +Refer to CBA's [Server Settings](https://github.com/CBATeam/CBA_A3/wiki/CBA-Settings-System#server-settings){:target="_blank"} and [Userconfig](https://github.com/CBATeam/CBA_A3/wiki/CBA-Settings-System#userconfig){:target="_blank"} to change settings for your server. + +### Convert your current server settings + + + + + +## Addon / Script Makers + +- ACE3 will convert all config based settings to CBA Settings automatically (except `typeName = "ARRAY"`). +- Non-public function `ace_common_fnc_addSettings` has been removed. +- Non-public function `ace_common_fnc_setSetting` has changed and may not function as before. +- It is critical that calls to `ace_common_fnc_readSettingFromModule` are now done **globaly** instead of just on the server. + +It is also recommended to deprecate `(scope = 1;)` your custom setting modules. + +- ACE Events `ace_settingsInitialized` and `ace_settingChanged` will continue to work normally. diff --git a/docs/css/app.css b/docs/css/app.css index 6621799c85..8130470b22 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:#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} + */@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}pre.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){pre.highlight{overflow-x:scroll;-webkit-overflow-scrolling:touch}}pre.highlight code{background-color:transparent;border:none;padding:0}pre.highlight td{padding:8px 15px}pre.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}pre.highlight .c{color:#999988;font-style:italic}pre.highlight .err{color:#a61717;background-color:#e3d2d2}pre.highlight .k{font-weight:bold}pre.highlight .o{font-weight:bold}pre.highlight .cm{color:#999988;font-style:italic}pre.highlight .cp{color:#999999;font-weight:bold}pre.highlight .c1{color:#999988;font-style:italic}pre.highlight .cs{color:#999999;font-weight:bold;font-style:italic}pre.highlight .gd{color:#000000;background-color:#ffdddd}pre.highlight .gd .x{color:#000000;background-color:#ffaaaa}pre.highlight .ge{font-style:italic}pre.highlight .gr{color:#aa0000}pre.highlight .gh{color:#999999}pre.highlight .gi{color:#000000;background-color:#ddffdd}pre.highlight .gi .x{color:#000000;background-color:#aaffaa}pre.highlight .go{color:#888888}pre.highlight .gp{color:#555555}pre.highlight .gs{font-weight:bold}pre.highlight .gu{color:#aaaaaa}pre.highlight .gt{color:#aa0000}pre.highlight .kc{font-weight:bold}pre.highlight .kd{font-weight:bold}pre.highlight .kp{font-weight:bold}pre.highlight .kr{font-weight:bold}pre.highlight .kt{color:#445588;font-weight:bold}pre.highlight .m{color:#009999}pre.highlight .s{color:#d14}pre.highlight .na{color:#008080}pre.highlight .nb{color:#0086B3}pre.highlight .nc{color:#445588;font-weight:bold}pre.highlight .no{color:#008080}pre.highlight .ni{color:#800080}pre.highlight .ne{color:#990000;font-weight:bold}pre.highlight .nf{color:#990000;font-weight:bold}pre.highlight .nn{color:#555555}pre.highlight .nt{color:#000080}pre.highlight .nv{color:#008080}pre.highlight .ow{font-weight:bold}pre.highlight .w{color:#bbbbbb}pre.highlight .mf{color:#009999}pre.highlight .mh{color:#009999}pre.highlight .mi{color:#009999}pre.highlight .mo{color:#009999}pre.highlight .sb{color:#d14}pre.highlight .sc{color:#d14}pre.highlight .sd{color:#d14}pre.highlight .s2{color:#d14}pre.highlight .se{color:#d14}pre.highlight .sh{color:#d14}pre.highlight .si{color:#d14}pre.highlight .sx{color:#d14}pre.highlight .sr{color:#009926}pre.highlight .s1{color:#d14}pre.highlight .ss{color:#990073}pre.highlight .bp{color:#999999}pre.highlight .vc{color:#008080}pre.highlight .vg{color:#008080}pre.highlight .vi{color:#008080}pre.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/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/news/171220_cbaPost2.jpg b/docs/img/news/171220_cbaPost2.jpg new file mode 100644 index 0000000000..c55c64c47e Binary files /dev/null and b/docs/img/news/171220_cbaPost2.jpg differ diff --git a/docs/img/scope_module.jpg b/docs/img/scope_module.jpg deleted file mode 100644 index 19629bddd7..0000000000 Binary files a/docs/img/scope_module.jpg and /dev/null differ diff --git a/docs/img/wiki/feature/ab_module.jpg b/docs/img/wiki/feature/ab_module.jpg deleted file mode 100644 index 70d2ec52b5..0000000000 Binary files a/docs/img/wiki/feature/ab_module.jpg and /dev/null differ diff --git a/docs/img/wiki/feature/ab_module1.jpg b/docs/img/wiki/feature/ab_module1.jpg new file mode 100644 index 0000000000..2eb900ee3c Binary files /dev/null and b/docs/img/wiki/feature/ab_module1.jpg differ diff --git a/docs/img/wiki/feature/atragmx3.png b/docs/img/wiki/feature/atragmx31.png similarity index 50% rename from docs/img/wiki/feature/atragmx3.png rename to docs/img/wiki/feature/atragmx31.png index dd4a1800e1..58afd1863e 100644 Binary files a/docs/img/wiki/feature/atragmx3.png and b/docs/img/wiki/feature/atragmx31.png differ diff --git a/docs/img/wiki/feature/atragmx31a.png b/docs/img/wiki/feature/atragmx31a.png new file mode 100644 index 0000000000..39ee84200c Binary files /dev/null and b/docs/img/wiki/feature/atragmx31a.png differ diff --git a/docs/img/wiki/feature/atragmx4.png b/docs/img/wiki/feature/atragmx4.png deleted file mode 100644 index 7db5b69077..0000000000 Binary files a/docs/img/wiki/feature/atragmx4.png and /dev/null differ diff --git a/docs/img/wiki/feature/atragmx41.png b/docs/img/wiki/feature/atragmx41.png new file mode 100644 index 0000000000..d89f6c1757 Binary files /dev/null and b/docs/img/wiki/feature/atragmx41.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/scope_module.jpg b/docs/img/wiki/feature/scope_module.jpg deleted file mode 100644 index 19629bddd7..0000000000 Binary files a/docs/img/wiki/feature/scope_module.jpg and /dev/null differ diff --git a/docs/img/wiki/feature/scope_module1.jpg b/docs/img/wiki/feature/scope_module1.jpg new file mode 100644 index 0000000000..4f5f8829f2 Binary files /dev/null and b/docs/img/wiki/feature/scope_module1.jpg differ diff --git a/docs/img/wiki/feature/simplified_zeroing.jpg b/docs/img/wiki/feature/simplified_zeroing.jpg new file mode 100644 index 0000000000..55a6ba6b20 Binary files /dev/null and b/docs/img/wiki/feature/simplified_zeroing.jpg differ diff --git a/docs/js/footer.min.js b/docs/js/footer.min.js index c12f82fe62..7e9a86bd64 100644 --- a/docs/js/footer.min.js +++ b/docs/js/footer.min.js @@ -1,7 +1,7 @@ -window.Modernizr=function(a,b,c){function d(a){o.cssText=a}function e(a,b){return typeof a===b}var f,g,h,i="2.8.3",j={},k=!0,l=b.documentElement,m="modernizr",n=b.createElement(m),o=n.style,p=({}.toString,{}),q=[],r=q.slice,s={}.hasOwnProperty;h=e(s,"undefined")||e(s.call,"undefined")?function(a,b){return b in a&&e(a.constructor.prototype[b],"undefined")}:function(a,b){return s.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=r.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(r.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(r.call(arguments)))};return d});for(var t in p)h(p,t)&&(g=t.toLowerCase(),j[g]=p[t](),q.push((j[g]?"":"no-")+g));return j.addTest=function(a,b){if("object"==typeof a)for(var d in a)h(a,d)&&j.addTest(d,a[d]);else{if(a=a.toLowerCase(),j[a]!==c)return j;b="function"==typeof b?b():b,"undefined"!=typeof k&&k&&(l.className+=" "+(b?"":"no-")+a),j[a]=b}return j},d(""),n=f=null,function(a,b){function c(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 d(){var a=s.elements;return"string"==typeof a?a.split(" "):a}function e(a){var b=r[a[p]];return b||(b={},q++,a[p]=q,r[q]=b),b}function f(a,c,d){if(c||(c=b),k)return c.createElement(a);d||(d=e(c));var f;return f=d.cache[a]?d.cache[a].cloneNode():o.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!f.canHaveChildren||n.test(a)||f.tagUrn?f:d.frag.appendChild(f)}function g(a,c){if(a||(a=b),k)return a.createDocumentFragment();c=c||e(a);for(var f=c.frag.cloneNode(),g=0,h=d(),i=h.length;g",j="hidden"in a,k=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(a){j=!0,k=!0}}();var s={elements:m.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:l,shivCSS:m.shivCSS!==!1,supportsUnknownElements:k,shivMethods:m.shivMethods!==!1,type:"default",shivDocument:i,createElement:f,createDocumentFragment:g};a.html5=s,i(b)}(this,b),j._version=i,l.className=l.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(k?" js "+q.join(" "):""),j}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==q.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=r.shift();s=1,a?a.t?o(function(){("c"==a.t?m.injectCss:m.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):s=0}function i(a,c,d,e,f,i,j){function k(b){if(!n&&g(l.readyState)&&(t.r=n=1,!s&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&o(function(){v.removeChild(l)},50);for(var d in A[c])A[c].hasOwnProperty(d)&&A[c][d].onload()}}var j=j||m.errorTimeout,l=b.createElement(a),n=0,q=0,t={t:d,s:c,e:f,a:i,x:j};1===A[c]&&(q=1,A[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,q)},r.splice(e,0,t),"img"!=a&&(q||2===A[c]?(v.insertBefore(l,u?null:p),o(k,j)):A[c].push(l))}function j(a,b,c,d,f){return s=0,b=b||"j",e(a)?i("c"==b?x:w,a,b,this.i++,c,d,f):(r.splice(this.i++,0,a),1==r.length&&h()),this}function k(){var a=m;return a.loader={load:j,i:0},a}var l,m,n=b.documentElement,o=a.setTimeout,p=b.getElementsByTagName("script")[0],q={}.toString,r=[],s=0,t="MozAppearance"in n.style,u=t&&!!b.createRange().compareNode,v=u?n:p.parentNode,n=a.opera&&"[object Opera]"==q.call(a.opera),n=!!b.attachEvent&&!n,w=t?"object":n?"script":"img",x=n?"script":w,y=Array.isArray||function(a){return"[object Array]"==q.call(a)},z=[],A={},B={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}};m=function(a){function b(a){var b,c,d,a=a.split("!"),e=z.length,f=a.pop(),g=a.length,f={url:f,origUrl:f,prefixes:a};for(c=0;ca._pfLastSize)&&(a._pfLastSize=a.offsetWidth,d=a.sizes,a.sizes+=",100vw",setTimeout(function(){a.sizes=d}))},e=function(){var a,b=document.querySelectorAll("picture > img, img[srcset][sizes]");for(a=0;a2.7?h=c+1:(f=b-c,e=Math.pow(a-.6,1.5),g=f*e,d&&(g+=.1*e),h=a+g):h=c>1?Math.sqrt(a*b):a,h>c}function h(a){var b,c=s.getSet(a),d=!1;"pending"!==c&&(d=r,c&&(b=s.setRes(c),s.applySetCandidate(b,a))),a[s.ns].evaled=d}function i(a,b){return a.res-b.res}function j(a,b,c){var d;return!c&&b&&(c=a[s.ns].sets,c=c&&c[c.length-1]),d=k(b,c),d&&(b=s.makeUrl(b),a[s.ns].curSrc=b,a[s.ns].curCan=d,d.res||aa(d,d.set.sizes)),d}function k(a,b){var c,d,e;if(a&&b)for(e=s.parseSet(b),a=s.makeUrl(a),c=0;c=l)return n;g=c(V),h=[],","===g.slice(-1)?(g=g.replace(W,""),e()):f()}}function n(a){function b(a){function b(){f&&(g.push(f),f="")}function c(){g[0]&&(h.push(g),g=[])}for(var e,f="",g=[],h=[],i=0,j=0,k=!1;;){if(e=a.charAt(j),""===e)return b(),c(),h;if(k){if("*"===e&&"/"===a[j+1]){k=!1,j+=2,b();continue}j+=1}else{if(d(e)){if(a.charAt(j-1)&&d(a.charAt(j-1))||!f){j+=1;continue}if(0===i){b(),j+=1;continue}e=" "}else if("("===e)i+=1;else if(")"===e)i-=1;else{if(","===e){b(),c(),j+=1;continue}if("/"===e&&"*"===a.charAt(j+1)){k=!0,j+=2;continue}}f+=e,j+=1}}}function c(a){return!!(k.test(a)&&parseFloat(a)>=0)||(!!l.test(a)||("0"===a||"-0"===a||"+0"===a))}var e,f,g,h,i,j,k=/^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,l=/^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i;for(f=b(a),g=f.length,e=0;e35,G="currentSrc",H=/\s+\+?\d+(e\d+)?w/,I=/(\([^)]+\))?\s*(.+)/,J=a.picturefillCFG,K="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)",L="font-size:100%!important;",M=!0,N={},O={},P=a.devicePixelRatio,Q={px:1,in:96},R=b.createElement("a"),S=!1,T=/^[ \t\n\r\u000c]+/,U=/^[, \t\n\r\u000c]+/,V=/^[^ \t\n\r\u000c]+/,W=/[,]+$/,X=/^\d+$/,Y=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,Z=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d||!1):a.attachEvent&&a.attachEvent("on"+b,c)},$=function(a){var b={};return function(c){return c in b||(b[c]=a(c)),b[c]}},_=function(){var a=/^([\d\.]+)(em|vw|px)$/,b=function(){for(var a=arguments,b=0,c=a[0];++b in a;)c=c.replace(a[b],a[++b]);return c},c=$(function(a){return"return "+b((a||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi,"")+";"});return function(b,d){var e;if(!(b in N))if(N[b]=!1,d&&(e=b.match(a)))N[b]=e[1]*Q[e[2]];else try{N[b]=new Function("e",c(b))(Q)}catch(a){}return N[b]}}(),aa=function(a,b){return a.w?(a.cWidth=s.calcListLength(b||"100vw"),a.res=a.w/a.cWidth):a.res=a.d,a},ba=function(a){if(t){var c,d,e,f=a||{};if(f.elements&&1===f.elements.nodeType&&("IMG"===f.elements.nodeName.toUpperCase()?f.elements=[f.elements]:(f.context=f.elements,f.elements=null)),c=f.elements||s.qsa(f.context||b,f.reevaluate||f.reselect?s.sel:s.selShort),e=c.length){for(s.setupRun(f),S=!0,d=0;dimg,img[srcset]",s.sel=s.selShort,s.cfg=B,s.DPR=P||1,s.u=Q,s.types=A,s.setSize=u,s.makeUrl=$(function(a){return R.href=a,R.href}),s.qsa=function(a,b){return"querySelector"in a?a.querySelectorAll(b):[]},s.matchesMedia=function(){return a.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?s.matchesMedia=function(a){return!a||matchMedia(a).matches}:s.matchesMedia=s.mMQ,s.matchesMedia.apply(this,arguments)},s.mMQ=function(a){return!a||_(a)},s.calcLength=function(a){var b=_(a,!0)||!1;return b<0&&(b=!1),b},s.supportsType=function(a){return!a||A[a]},s.parseSize=$(function(a){var b=(a||"").match(I);return{media:b&&b[1],length:b&&b[2]}}),s.parseSet=function(a){return a.cands||(a.cands=m(a.srcset,a)),a.cands},s.getEmValue=function(){var a;if(!p&&(a=b.body)){var c=b.createElement("div"),d=z.style.cssText,e=a.style.cssText;c.style.cssText=K,z.style.cssText=L,a.style.cssText=L,a.appendChild(c),p=c.offsetWidth,a.removeChild(c),p=parseFloat(p,10),z.style.cssText=d,a.style.cssText=e}return p||16},s.calcListLength=function(a){if(!(a in O)||B.uT){var b=s.calcLength(n(a));O[a]=b?b:Q.width}return O[a]},s.setRes=function(a){var b;if(a){b=s.parseSet(a);for(var c=0,d=b.length;cp,n||(l.cached=!0,l.res>=p&&(h=l))),!h)for(a.sort(i),f=a.length,h=a[f-1],d=0;d=p){e=d-1,h=a[e]&&(n||k!==s.makeUrl(c.url))&&g(a[e].res,c.res,p,a[e].cached)?a[e]:c;break}h&&(m=s.makeUrl(h.url),o.curSrc=m,o.curCan=h,m!==k&&s.setSrc(b,h),s.setSize(b))}},s.setSrc=function(a,b){var c;a.src=b.url,"image/svg+xml"===b.set.type&&(c=a.style.width,a.style.width=a.offsetWidth+1+"px",a.offsetWidth+1&&(a.style.width=c))},s.getSet=function(a){var b,c,d,e=!1,f=a[s.ns].sets;for(b=0;b0&&b-1 in a)}function d(a,b,c){if(fa.isFunction(b))return fa.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return fa.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(pa.test(b))return fa.filter(b,a,c);b=fa.filter(b,a)}return fa.grep(a,function(a){return _.call(b,a)>-1!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b={};return fa.each(a.match(va)||[],function(a,c){b[c]=!0}),b}function g(){X.removeEventListener("DOMContentLoaded",g),a.removeEventListener("load",g),fa.ready()}function h(){this.expando=fa.expando+h.uid++}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Ca,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:Ba.test(c)?fa.parseJSON(c):c)}catch(a){}Aa.set(a,b,c)}else c=void 0;return c}function j(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return fa.css(a,b,"")},i=h(),j=c&&c[3]||(fa.cssNumber[b]?"":"px"),k=(fa.cssNumber[b]||"px"!==j&&+i)&&Ea.exec(fa.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,fa.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}function k(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&fa.nodeName(a,b)?fa.merge([a],c):c}function l(a,b){for(var c=0,d=a.length;d>c;c++)za.set(a[c],"globalEval",!b||za.get(b[c],"globalEval"))}function m(a,b,c,d,e){for(var f,g,h,i,j,m,n=b.createDocumentFragment(),o=[],p=0,q=a.length;q>p;p++)if(f=a[p],f||0===f)if("object"===fa.type(f))fa.merge(o,f.nodeType?[f]:f);else if(La.test(f)){for(g=g||n.appendChild(b.createElement("div")),h=(Ia.exec(f)||["",""])[1].toLowerCase(),i=Ka[h]||Ka._default,g.innerHTML=i[1]+fa.htmlPrefilter(f)+i[2],m=i[0];m--;)g=g.lastChild;fa.merge(o,g.childNodes),g=n.firstChild,g.textContent=""}else o.push(b.createTextNode(f));for(n.textContent="",p=0;f=o[p++];)if(d&&fa.inArray(f,d)>-1)e&&e.push(f);else if(j=fa.contains(f.ownerDocument,f),g=k(n.appendChild(f),"script"),j&&l(g),c)for(m=0;f=g[m++];)Ja.test(f.type||"")&&c.push(f);return n}function n(){return!0}function o(){return!1}function p(){try{return X.activeElement}catch(a){}}function q(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)q(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=o;else if(!e)return this;return 1===f&&(g=e,e=function(a){return fa().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=fa.guid++)),a.each(function(){fa.event.add(this,b,e,d,c)})}function r(a,b){return fa.nodeName(a,"table")&&fa.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function s(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function t(a){var b=Sa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function u(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(za.hasData(a)&&(f=za.access(a),g=za.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)fa.event.add(b,e,j[e][c])}Aa.hasData(a)&&(h=Aa.access(a),i=fa.extend({},h),Aa.set(b,i))}}function v(a,b){var c=b.nodeName.toLowerCase();"input"===c&&Ha.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function w(a,b,c,d){b=Z.apply([],b);var e,f,g,h,i,j,l=0,n=a.length,o=n-1,p=b[0],q=fa.isFunction(p);if(q||n>1&&"string"==typeof p&&!da.checkClone&&Ra.test(p))return a.each(function(e){var f=a.eq(e);q&&(b[0]=p.call(this,e,f.html())),w(f,b,c,d)});if(n&&(e=m(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(g=fa.map(k(e,"script"),s),h=g.length;n>l;l++)i=e,l!==o&&(i=fa.clone(i,!0,!0),h&&fa.merge(g,k(i,"script"))),c.call(a[l],i,l);if(h)for(j=g[g.length-1].ownerDocument,fa.map(g,t),l=0;h>l;l++)i=g[l],Ja.test(i.type||"")&&!za.access(i,"globalEval")&&fa.contains(j,i)&&(i.src?fa._evalUrl&&fa._evalUrl(i.src):fa.globalEval(i.textContent.replace(Ta,"")))}return a}function x(a,b,c){for(var d,e=b?fa.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||fa.cleanData(k(d)),d.parentNode&&(c&&fa.contains(d.ownerDocument,d)&&l(k(d,"script")),d.parentNode.removeChild(d));return a}function y(a,b){var c=fa(b.createElement(a)).appendTo(b.body),d=fa.css(c[0],"display");return c.detach(),d}function z(a){var b=X,c=Va[a];return c||(c=y(a,b),"none"!==c&&c||(Ua=(Ua||fa("