mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' into armake
This commit is contained in:
commit
0745e249fc
@ -63,6 +63,7 @@ Dimaslg <dimaslg@telecable.es>
|
||||
dixon13 <dixonbegay@gmail.com>
|
||||
Drill <drill87@gmail.com>
|
||||
Dudakov aka [OMCB]Kaban <dudakov.s@gmail.com>
|
||||
Drofseh <drofseh@gmail.com>
|
||||
Dslyecxi <dslyecxi@gmail.com>
|
||||
ElTyranos
|
||||
eRazeri
|
||||
@ -130,6 +131,7 @@ System98
|
||||
SzwedzikPL <szwedzikpl@gmail.com>
|
||||
Tachi <zaveruha007@gmail.com>
|
||||
Tessa Elieff <Fastroping Sound - CreativeCommons Attributions 3.0>
|
||||
Timi007 <timi007@gmx.net>
|
||||
Toaster <jonathan.pereira@gmail.com>
|
||||
Tonic
|
||||
Tourorist <tourorist@gmail.com>
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/acemod/ACE3/releases/latest">
|
||||
<img src="https://img.shields.io/badge/Version-3.12.2-blue.svg?style=flat-square" alt="ACE3 Version">
|
||||
<img src="https://img.shields.io/badge/Version-3.12.3-blue.svg?style=flat-square" alt="ACE3 Version">
|
||||
</a>
|
||||
<a href="https://github.com/acemod/ACE3/issues">
|
||||
<img src="https://img.shields.io/github/issues-raw/acemod/ACE3.svg?style=flat-square&label=Issues" alt="ACE3 Issues">
|
||||
@ -21,8 +21,8 @@
|
||||
<a href="https://slackin.ace3mod.com/">
|
||||
<img src="https://slackin.ace3mod.com/badge.svg?style=flat-square&label=Slack" alt="ACE3 Slack">
|
||||
</a>
|
||||
<a href="https://travis-ci.org/acemod/ACE3">
|
||||
<img src="https://img.shields.io/travis/acemod/ACE3.svg?style=flat-square&label=Build" alt="ACE3 Build Status">
|
||||
<a href="https://circleci.com/gh/acemod/ACE3">
|
||||
<img src="https://circleci.com/gh/acemod/ACE3.svg?style=svg" alt="ACE3 Build Status">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
@ -15,7 +16,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_muzzleVelocityShiftTable", "_temperature"];
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
@ -18,7 +19,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_ballisticCoefficient", "_temperature"/*in C*/, "_pressure"/*in hPa*/, "_relativeHumidity"/*as ratio 0-1*/, "_atmosphereModel"/*"ICAO" or "ASM"*/];
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Ruthberg, MikeMatrix, joko // Jonas
|
||||
*
|
||||
@ -17,7 +18,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity"];
|
||||
TRACE_4("params",_barrelLength,_muzzleVelocityTable,_barrelLengthTable,_muzzleVelocity);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
@ -16,7 +17,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
// Source: GNU Exterior Ballistics
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
@ -20,7 +21,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: esteldunedain
|
||||
*
|
||||
@ -15,8 +17,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
private _diagnoseStartTime = diag_tickTime;
|
||||
#ifdef DEBUG_INIT_SPEEDS
|
||||
@ -33,9 +33,7 @@ for "_i" from 0 to (count _cfgWeapons)-1 do {
|
||||
if (isClass _weaponConfig) then {
|
||||
private _weapon = configName _weaponConfig;
|
||||
private _weaponType = getNumber (_weaponConfig >> "Type");
|
||||
if (_weaponType in [1, 2]) then {
|
||||
// The weapon is a primary weapon or a handgun weapon
|
||||
|
||||
if (_weaponType in [TYPE_WEAPON_PRIMARY, TYPE_WEAPON_HANDGUN]) then {
|
||||
private _weaponInitSpeed = getNumber (_weaponConfig >> "initSpeed");
|
||||
private _magazines = getArray (_weaponConfig >> "magazines");
|
||||
{
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
@ -14,7 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define __dsp (uiNamespace getVariable "RscProtractor")
|
||||
#define __ctrl1 (__dsp displayCtrl 132950)
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Glowbal, Ruthberg, joko // Jonas
|
||||
* Handle the PFH for Bullets
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
{
|
||||
_x params ["_bullet","_caliber","_bulletTraceVisible","_index"];
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Glowbal, Ruthberg
|
||||
*
|
||||
@ -14,7 +15,6 @@
|
||||
*
|
||||
* 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);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Glowbal, Ruthberg
|
||||
* Module for adjusting the advanced ballistics settings
|
||||
@ -15,7 +16,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_logic","_units", "_activated"];
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Initializes the advanced ballistics dll extension with terrain data
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
@ -25,7 +26,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
TRACE_1("Reading Ammo Config",_this);
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
@ -16,7 +17,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private _weaponConfig = (configFile >> "CfgWeapons" >> _this);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Advanced_Ballistics">
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_WindInfoKey">
|
||||
|
@ -47,13 +47,3 @@ if (!hasInterface) exitWith {};
|
||||
// - Add main loop at 1 second interval -------------------------------------------------------------
|
||||
[FUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
["ace_settingChanged", {
|
||||
params ["_name", "_value"];
|
||||
|
||||
if (_name == QGVAR(enableStaminaBar) && {!_value}) then {
|
||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
||||
_staminaBarContainer ctrlSetFade 1;
|
||||
_staminaBarContainer ctrlCommit 0;
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Adds a duty factor.
|
||||
@ -14,7 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params [["_id", "", [""]], ["_factor", 1, [0, {}]]];
|
||||
if (_id == "" || {_factor isEqualTo 1}) exitWith {};
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Creates the stamina bar.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_display"];
|
||||
|
||||
private _staminaBar = _display ctrlCreate [QGVAR(StaminaBarContainer), -1];
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Calculates the duty of the current animation.
|
||||
@ -14,7 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_unit", "_animName"];
|
||||
|
||||
private _duty = 1;
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Calculates the current metabolic costs for a unit.
|
||||
@ -15,7 +16,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_unit", "_velocity"];
|
||||
|
||||
private _gearMass = ((_unit getVariable [QEGVAR(movement,totalLoad), loadAbs _unit]) / 22.046) * GVAR(loadFactor);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Handles any audible, visual and physical effects of fatigue.
|
||||
@ -16,7 +17,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_unit", "_fatigue", "_speed", "_overexhausted"];
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Handles switching units (once on init and afterwards via Zeus).
|
||||
@ -14,7 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_newUnit", "_oldUnit"];
|
||||
TRACE_2("unit changed",_newUnit,_oldUnit);
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Handles visual changes of the stamina bar.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_stamina"];
|
||||
|
||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Main looping function that updates fatigue values.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
if (!alive ACE_player) exitWith { // Dead people don't breath, Will also handle null (Map intros)
|
||||
[FUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute;
|
||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Initializes the module settings.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_logic"];
|
||||
|
||||
[_logic, QGVAR(enabled), "Enabled"] call EFUNC(common,readSettingFromModule);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Removes a duty factor.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params [["_id", "", [""]]];
|
||||
|
||||
GVAR(dutyList) params ["_idList", "_factorList"];
|
||||
|
@ -4,7 +4,9 @@
|
||||
[LSTRING(Enabled), LSTRING(Enabled_Description)],
|
||||
LSTRING(DisplayName),
|
||||
true,
|
||||
true
|
||||
true,
|
||||
{[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)},
|
||||
true // Needs mission restart
|
||||
] call CBA_Settings_fnc_init;
|
||||
|
||||
[
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Advanced_Fatigue">
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_DisplayName">
|
||||
@ -9,6 +9,7 @@
|
||||
<Japanese>ACE アドバンスド ファティーグ</Japanese>
|
||||
<Italian>ACE Fatica Avanzata</Italian>
|
||||
<Korean>ACE 고급 피로도</Korean>
|
||||
<French>ACE Fatigue Avancée</French>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_PerformanceFactor">
|
||||
<English>Performance Factor</English>
|
||||
@ -114,12 +115,16 @@
|
||||
<Japanese>手ぶれ因数</Japanese>
|
||||
<Chinesesimp>抖动因数</Chinesesimp>
|
||||
<Chinese>抖動因素</Chinese>
|
||||
<French>Facteur de stabilisation</French>
|
||||
<Italian>Fattore di oscillazione</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_SwayFactor_Description">
|
||||
<English>Influences the amount of weapon sway. Higher means more sway.</English>
|
||||
<Japanese>武器を持つ手のぶれ度合いを設定します。 値が高ければ高いほど、手ぶれが強くなります。</Japanese>
|
||||
<Chinesesimp>影响手持武器的晃动程度,数值越高,抖动的越厉害.</Chinesesimp>
|
||||
<Chinese>影響手持武器晃動程度,數值越高抖動越厲害</Chinese>
|
||||
<French>Influence les mouvements de l'arme, une valeur plus élevée signifie plus de mouvements</French>
|
||||
<Italian>Influenza l'ammontare di oscillazione dell'arma. Maggiore significa più oscillazione.</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_Enabled">
|
||||
<English>Enabled</English>
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Checks if a throwable can be prepared.
|
||||
@ -14,7 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit", ["_ignoreLastThrownTime", false]];
|
||||
|
||||
@ -31,7 +31,7 @@ GVAR(enabled) &&
|
||||
{_unit getVariable [QGVAR(lastThrownTime), CBA_missionTime - 3] < CBA_missionTime - 2} && // Prevent throwing in quick succession
|
||||
#endif
|
||||
|
||||
{!(call EFUNC(common,isFeatureCameraActive))} &&
|
||||
{(call CBA_fnc_getActiveFeatureCamera) isEqualTo ""} &&
|
||||
{[_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}} &&
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Checks if a throwable can be thrown.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Zapat, Dslyecxi, Jonpas
|
||||
* Draws throw arc.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
// Disable drawing when intersecting with the vehicle
|
||||
if !([ACE_player] call FUNC(canThrow)) exitWith {
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas, SilentSpike
|
||||
* Handles drawing the currently selected or cooked throwable.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (dialog || {!(ACE_player getVariable [QGVAR(inHand), false])} || {!([ACE_player, true] call FUNC(canPrepare))}) exitWith {
|
||||
[ACE_player, "In dialog or no throwable in hand or cannot prepare throwable"] call FUNC(exitThrowMode);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Exits throw mode.
|
||||
@ -14,7 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit", "_reason"];
|
||||
TRACE_2("params",_unit,_reason);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Retrieve muzzle name from config.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_magazineClassname"];
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Initializes the Advanced Throwing module.
|
||||
@ -15,7 +16,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_logic", "_units", "_activated"];
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Key down event.
|
||||
@ -17,7 +18,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(ACE_player getVariable [QGVAR(inHand), false]) exitWith {false};
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Mouse button down event.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(ACE_player getVariable [QGVAR(inHand), false]) exitWith {};
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Mouse scroll wheel changed event.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(ACE_player getVariable [QGVAR(inHand), false]) exitWith {};
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Picks up a throwable from the ground.
|
||||
@ -14,7 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_helper", "_unit"];
|
||||
TRACE_2("params",_helper,_unit);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Prepares throwable or selects the next.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
TRACE_1("params",_unit);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Primes the throwable, creates global throwable vehicle and throws Fired XEH.
|
||||
@ -14,7 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit", ["_showHint", false]];
|
||||
TRACE_2("params",_unit,_showHint);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: PabstMirror, Jonpas
|
||||
* When interact_menu starts rendering (from "interact_keyDown" event).
|
||||
@ -14,7 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
[{
|
||||
params ["_args", "_idPFH"];
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Throw selected throwable.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
TRACE_1("params",_unit);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: CBA Team
|
||||
* Throws Fired XEH.
|
||||
@ -19,7 +20,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
TRACE_1("Fired",_this);
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Updates controls hints based on current state.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!GVAR(showMouseControls)) exitWith {};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Advanced_Throwing">
|
||||
<Key ID="STR_ACE_Advanced_Throwing_Category">
|
||||
|
@ -16,3 +16,9 @@ class Extended_PostInit_EventHandlers {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_DisplayLoad_EventHandlers {
|
||||
class RscDisplayCurator {
|
||||
ADDON = QUOTE(call FUNC(drawCuratorGarrisonPathing));
|
||||
};
|
||||
};
|
||||
|
@ -1,3 +1,4 @@
|
||||
PREP(drawCuratorGarrisonPathing);
|
||||
PREP(garrison);
|
||||
PREP(unGarrison);
|
||||
PREP(garrisonMove);
|
||||
|
@ -68,42 +68,3 @@
|
||||
params ["_unit", "_mode"];
|
||||
_unit enableGunLights _mode;
|
||||
}] 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
|
||||
|
54
addons/ai/functions/fnc_drawCuratorGarrisonPathing.sqf
Normal file
54
addons/ai/functions/fnc_drawCuratorGarrisonPathing.sqf
Normal file
@ -0,0 +1,54 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: alganthe
|
||||
* Add draw3D eh to the curator interface.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
addMissionEventHandler ["Draw3D", {
|
||||
if (findDisplay 312 isEqualTo displayNull) exitWith {
|
||||
removeMissionEventHandler ["Draw3D", _thisEventHandler];
|
||||
};
|
||||
|
||||
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;
|
||||
}];
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: alganthe
|
||||
* Garrison function used to garrison AI inside buildings.
|
||||
@ -19,13 +20,13 @@
|
||||
*
|
||||
* 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}};
|
||||
private _currentUnitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []];
|
||||
|
||||
if (_startingPos isEqualTo [0,0,0]) exitWith {
|
||||
TRACE_1("fnc_garrison: StartingPos error",_startingPos);
|
||||
@ -79,11 +80,9 @@ if (_topDownFilling) then {
|
||||
|
||||
//Remove positions units are already pathing to
|
||||
_buildingsIndex = _buildingsIndex apply {
|
||||
private _testedBuilding = _x;
|
||||
|
||||
_testedBuilding select {
|
||||
_x select {
|
||||
private _testedPos = _x;
|
||||
(({(_x select 1) isEqualTo _testedPos} count (missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []])) == 0)
|
||||
({(_x select 1) isEqualTo _testedPos} count (missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []])) == 0
|
||||
}
|
||||
};
|
||||
|
||||
@ -147,6 +146,8 @@ switch (_fillingType) do {
|
||||
_unit setPosATL _pos;
|
||||
};
|
||||
|
||||
_currentUnitMoveList deleteAt (_currentUnitMoveList findIf {_x select 0 == _unit});
|
||||
|
||||
} else {
|
||||
_unitMoveList pushBack [_unit,[_pos, AGLToASL _pos] select (_posSurface)];
|
||||
};
|
||||
@ -194,6 +195,8 @@ switch (_fillingType) do {
|
||||
_unit setPosATL _pos;
|
||||
};
|
||||
|
||||
_currentUnitMoveList deleteAt (_currentUnitMoveList findIf {_x select 0 == _unit});
|
||||
|
||||
} else {
|
||||
_unitMoveList pushBack [_unit,[_pos, AGLToASL _pos] select (_posSurface)];
|
||||
};
|
||||
@ -239,6 +242,8 @@ switch (_fillingType) do {
|
||||
_unit setPosATL _pos;
|
||||
};
|
||||
|
||||
_currentUnitMoveList deleteAt (_currentUnitMoveList findIf {_x select 0 == _unit});
|
||||
|
||||
} else {
|
||||
_unitMoveList pushBack [_unit,[_pos, AGLToASL _pos] select (_posSurface)];
|
||||
};
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: alganthe
|
||||
* Internal function used by ace_ai_fnc_garrison to make the units move to the positions it picked.
|
||||
@ -15,7 +16,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params [ ["_unitMoveList", nil, [[]]] ];
|
||||
|
||||
@ -53,10 +53,41 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then {
|
||||
{
|
||||
_x params ["_unit", "_pos"];
|
||||
|
||||
// Check if unit is alive or even existing
|
||||
if (!alive _unit) then {
|
||||
private _fnc_attemptFailed = {
|
||||
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: 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");
|
||||
};
|
||||
};
|
||||
|
||||
private _fnc_attemptSuccessful = {
|
||||
_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);
|
||||
LOG(format [ARR_2("garrisonMove PFH: unit dead or deleted | %1 units left", count _unitMoveList)]);
|
||||
|
||||
[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)]);
|
||||
};
|
||||
|
||||
// Check if unit is alive or even existing
|
||||
if (!alive _unit || {_unit getVariable [QGVAR(garrisoned), false]}) then {
|
||||
_unitMoveList deleteAt (_unitMoveList find _x);
|
||||
LOG(format [ARR_2("garrisonMove PFH: unit dead, deleted or garrisoned via TP | %1 units left", count _unitMoveList)]);
|
||||
|
||||
} else {
|
||||
private _unitPos = getPos _unit;
|
||||
@ -68,38 +99,15 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then {
|
||||
|
||||
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)]);
|
||||
if (_unitPos distance _pos < 1.5) then {
|
||||
call _fnc_attemptSuccessful;
|
||||
|
||||
} 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");
|
||||
};
|
||||
call _fnc_attemptFailed;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
@ -107,30 +115,12 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then {
|
||||
|
||||
// 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 ((_unitPos distance _pos) < 1.5) : {
|
||||
call _fnc_attemptSuccessful;
|
||||
};
|
||||
|
||||
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 ((_unitPosTimer + 5) < CBA_missionTime && {_unitOldPos distance _unitPos < 0.5}) : {
|
||||
call _fnc_attemptFailed;
|
||||
};
|
||||
|
||||
case (_unitOldPos distance _unitPos < 0.5) : {};
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: alganthe
|
||||
* Used to un-garrison units.
|
||||
@ -14,44 +15,37 @@
|
||||
* 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 _unit = _x;
|
||||
if (!isPlayer _unit && {local _unit}) then {
|
||||
_unit enableAI "PATH";
|
||||
_unit enableAI "FSM";
|
||||
|
||||
private _leader = leader _x;
|
||||
private _leader = leader _unit;
|
||||
|
||||
TRACE_3("fnc_ungarrison: unit and leader",_x , _leader, (_leader == _x));
|
||||
TRACE_3("fnc_ungarrison: unit and leader",_unit , _leader, (_leader == _unit));
|
||||
|
||||
_x setVariable [QGVAR(garrisonned), false, true];
|
||||
_unit setVariable [QGVAR(garrisonned), false, true];
|
||||
|
||||
if (_leader != _x) then {
|
||||
doStop _x;
|
||||
_x doFollow _leader;
|
||||
private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []];
|
||||
_unitMoveList deleteAt (_unitMoveList findIf {_x select 0 == _unit});
|
||||
|
||||
if (_leader != _unit) then {
|
||||
doStop _unit;
|
||||
_unit doFollow _leader;
|
||||
|
||||
} else {
|
||||
_x doMove ((nearestBuilding (getPos _x)) buildingExit 0);
|
||||
_unit doMove ((nearestBuilding (getPos _unit)) 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 {
|
||||
if ((units _unit) findif {(_x getVariable [QGVAR(garrisonned), false]) && !isPlayer _x} == -1) then {
|
||||
LOG("fnc_ungarrison: enableAttack true");
|
||||
(group _x) enableAttack true;
|
||||
(group _unit) enableAttack true;
|
||||
};
|
||||
};
|
||||
} foreach _units;
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="ai">
|
||||
<Key ID="STR_ACE_ai_GarrisonInvalidPosition">
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dystopian
|
||||
* Check if Eject action can be shown.
|
||||
@ -14,7 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define FULLCREW_UNIT 0
|
||||
#define FULLCREW_ROLE 1
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dystopian
|
||||
* Add Eject action to vehicle if needed.
|
||||
@ -13,7 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_vehicle"];
|
||||
|
||||
|
@ -74,6 +74,14 @@ class GVAR(stats) {
|
||||
textStatement = QUOTE(call FUNC(statTextStatement_scopeMag));
|
||||
tabs[] = {{}, {0}};
|
||||
};
|
||||
class ACE_scopeVisionMode: statBase {
|
||||
scope = 2;
|
||||
priority = 1;
|
||||
displayName = CSTRING(statVisionMode);
|
||||
showText = 1;
|
||||
textStatement = QUOTE(call FUNC(statTextStatement_scopeVisionMode));
|
||||
tabs[] = {{}, {0}};
|
||||
};
|
||||
class ACE_ballisticProtection: statBase {
|
||||
scope = 2;
|
||||
priority = 5;
|
||||
@ -101,4 +109,14 @@ class GVAR(stats) {
|
||||
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_3([ARR_2(0, 500)], [ARR_2(0.01, 1)], false)])] call FUNC(statBarStatement_default));
|
||||
tabs[] = {{3,4,5}, {}};
|
||||
};
|
||||
class ACE_smokeChemTTL: statBase {
|
||||
scope = 2;
|
||||
priority = 3;
|
||||
stats[] = {"ammo"};
|
||||
displayName = CSTRING(statTTL);
|
||||
showText = 1;
|
||||
textStatement= QUOTE(call FUNC(statTextStatement_smokeChemTTL));
|
||||
condition = QUOTE((configName (_this select 1)) isKindOf [ARR_2('smokeShell', configFile >> 'CfgMagazines')]);
|
||||
tabs[] = {{}, {5}};
|
||||
};
|
||||
};
|
||||
|
@ -8,7 +8,7 @@ class Cfg3DEN {
|
||||
class GVAR(DefaultLoadoutsListAttribute) {
|
||||
property = QGVAR(DefaultLoadoutsListAttribute);
|
||||
value = 0;
|
||||
expression = "if !(is3DEN) then {ace_arsenal_defaultLoadoutsList = _value};";
|
||||
expression = QUOTE(if (!is3DEN) then {GVAR(defaultLoadoutsList) = _value});
|
||||
defaultValue = "[]";
|
||||
validate = "none";
|
||||
wikiType = "[[Array]]";
|
||||
@ -102,6 +102,8 @@ class Cfg3DEN {
|
||||
idcLeft = IDC_ATTRIBUTE_LIST_LEFT;
|
||||
idcRight = IDC_ATTRIBUTE_LIST_RIGHT;
|
||||
onLBDblClick = QUOTE(_this call FUNC(attributeDblClick));
|
||||
onSetFocus = QUOTE(SETUVAR(QGVAR(attributeFocus),ctrlParentControlsGroup (_this select 0)));
|
||||
onKillFocus = QUOTE(SETUVAR(QGVAR(attributeFocus),nil));
|
||||
x = QUOTE(5 * ATTRIBUTE_W);
|
||||
y = QUOTE(35.83 * ATTRIBUTE_H);
|
||||
w = QUOTE(125 * ATTRIBUTE_W);
|
||||
|
34
addons/arsenal/Display3DEN.hpp
Normal file
34
addons/arsenal/Display3DEN.hpp
Normal file
@ -0,0 +1,34 @@
|
||||
class Display3DEN {
|
||||
class ContextMenu: ctrlMenu {
|
||||
class Items {
|
||||
class Arsenal {
|
||||
items[]= {"aceArsenal", "virtualArsenal"};
|
||||
};
|
||||
class virtualArsenal {
|
||||
text = "BI Virtual Arsenal";
|
||||
action = QUOTE(['arsenal'] call bis_fnc_3DENEntityMenu);
|
||||
value = 0;
|
||||
data = "Arsenal";
|
||||
opensNewWindow = 1;
|
||||
};
|
||||
class aceArsenal: virtualArsenal {
|
||||
text = "ACE 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 = QPATHTOEF(common,data\logo_ace3_ca.paa);
|
||||
action = "call ace_arsenal_fnc_portVALoadouts;";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -1,3 +1,4 @@
|
||||
PREP(addDefaultLoadout);
|
||||
PREP(addListBoxItem);
|
||||
PREP(addStat);
|
||||
PREP(addVirtualItems);
|
||||
@ -5,6 +6,7 @@ PREP(attributeAddItems);
|
||||
PREP(attributeClear);
|
||||
PREP(attributeDblClick);
|
||||
PREP(attributeInit);
|
||||
PREP(attributeKeyDown);
|
||||
PREP(attributeLoad);
|
||||
PREP(attributeMode);
|
||||
PREP(attributeSelect);
|
||||
@ -62,6 +64,8 @@ PREP(statTextStatement_accuracy);
|
||||
PREP(statTextStatement_mass);
|
||||
PREP(statTextStatement_rateOfFire);
|
||||
PREP(statTextStatement_scopeMag);
|
||||
PREP(statTextStatement_scopeVisionMode);
|
||||
PREP(statTextStatement_smokeChemTTL);
|
||||
PREP(updateCamPos);
|
||||
PREP(updateRightPanel);
|
||||
PREP(updateUniqueItemsList);
|
||||
|
@ -15,6 +15,7 @@ class CfgPatches {
|
||||
};
|
||||
|
||||
#include "ui\RscAttributes.hpp"
|
||||
#include "Display3DEN.hpp"
|
||||
#include "Cfg3DEN.hpp"
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "RscDisplayMain.hpp"
|
||||
|
31
addons/arsenal/functions/fnc_addDefaultLoadout.sqf
Normal file
31
addons/arsenal/functions/fnc_addDefaultLoadout.sqf
Normal file
@ -0,0 +1,31 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: 654wak654
|
||||
* Adds a loadout to the "Default Loadouts" list.
|
||||
* If a loadout with the same name exists, it is overwritten.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Name of loadout <STRING>
|
||||
* 1: getUnitLoadout array <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["Squad Leader", getUnitLoadout sql1] call ace_arsenal_fnc_addDefaultLoadout
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_name", "", [""]], ["_loadout", [], [[]], 10]];
|
||||
|
||||
if (isNil QGVAR(defaultLoadoutsList)) then {
|
||||
GVAR(defaultLoadoutsList) = [];
|
||||
};
|
||||
|
||||
private _loadoutIndex = (+(GVAR(defaultLoadoutsList))) findIf {(_x select 0) == _name};
|
||||
if (_loadoutIndex == -1) then {
|
||||
GVAR(defaultLoadoutsList) pushBack [_name, _loadout];
|
||||
} else {
|
||||
GVAR(defaultLoadoutsList) set [_loadoutIndex, [_name, _loadout]];
|
||||
};
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dedmen
|
||||
* Add a listbox row.
|
||||
@ -13,8 +14,6 @@
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
params ["_configCategory", "_className", "_ctrlPanel", ["_pictureEntryName", "picture", [""]]];
|
||||
|
||||
private _cacheNamespace = _ctrlPanel; //For better readability.
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Add a stat to ACE Arsenal.
|
||||
@ -29,7 +30,6 @@
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params [
|
||||
["_tabs", [[], []], [[]], 2],
|
||||
["_class", "", [""]],
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe, Dedmen
|
||||
* Add virtual items to the provided target.
|
||||
@ -16,8 +18,6 @@
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params [["_object", objNull, [objNull]], ["_items", [], [true, []]], ["_global", false, [false]]];
|
||||
|
||||
@ -81,37 +81,37 @@ if (_items isEqualType true) then {
|
||||
/* Weapon acc */
|
||||
case (
|
||||
isClass (_configItemInfo) &&
|
||||
{(getNumber (_configItemInfo >> "type")) in [101, 201, 301, 302]} &&
|
||||
{(getNumber (_configItemInfo >> "type")) in [TYPE_MUZZLE, TYPE_OPTICS, TYPE_FLASHLIGHT, TYPE_BIPOD]} &&
|
||||
{!(_x isKindOf ["CBA_MiscItem", (_configCfgWeapons)])}
|
||||
): {
|
||||
switch (getNumber (_configItemInfo >> "type")) do {
|
||||
case 201: {
|
||||
case TYPE_OPTICS: {
|
||||
(_cargo select 1) select 0 pushBackUnique _x;
|
||||
};
|
||||
case 301: {
|
||||
case TYPE_FLASHLIGHT: {
|
||||
(_cargo select 1) select 1 pushBackUnique _x;
|
||||
};
|
||||
case 101: {
|
||||
case TYPE_MUZZLE: {
|
||||
(_cargo select 1) select 2 pushBackUnique _x;
|
||||
};
|
||||
case 302: {
|
||||
case TYPE_BIPOD: {
|
||||
(_cargo select 1) select 3 pushBackUnique _x;
|
||||
};
|
||||
};
|
||||
};
|
||||
/* Headgear */
|
||||
case (isClass (_configItemInfo) &&
|
||||
{getNumber (_configItemInfo >> "type") == 605}): {
|
||||
{getNumber (_configItemInfo >> "type") == TYPE_HEADGEAR}): {
|
||||
(_cargo select 3) pushBackUnique _x;
|
||||
};
|
||||
/* Uniform */
|
||||
case (isClass (_configItemInfo) &&
|
||||
{getNumber (_configItemInfo >> "type") == 801}): {
|
||||
{getNumber (_configItemInfo >> "type") == TYPE_UNIFORM}): {
|
||||
(_cargo select 4) pushBackUnique _x;
|
||||
};
|
||||
/* Vest */
|
||||
case (isClass (_configItemInfo) &&
|
||||
{getNumber (_configItemInfo >> "type") == 701}): {
|
||||
{getNumber (_configItemInfo >> "type") == TYPE_VEST}): {
|
||||
(_cargo select 5) pushBackUnique _x;
|
||||
};
|
||||
/* NVgs */
|
||||
@ -120,7 +120,7 @@ if (_items isEqualType true) then {
|
||||
};
|
||||
/* Binos */
|
||||
case (_simulationType == "Binocular" ||
|
||||
{(_simulationType == 'Weapon') && {(getNumber (_configCfgWeapons >> _x >> 'type') == 4096)}}): {
|
||||
{(_simulationType == 'Weapon') && {(getNumber (_configCfgWeapons >> _x >> 'type') == TYPE_BINOCULAR_AND_NVG)}}): {
|
||||
(_cargo select 9) pushBackUnique _x;
|
||||
};
|
||||
/* Map */
|
||||
@ -145,20 +145,20 @@ if (_items isEqualType true) then {
|
||||
};
|
||||
/* UAV terminals */
|
||||
case (isClass (_configItemInfo) &&
|
||||
{getNumber (_configItemInfo >> "type") == 621}): {
|
||||
{getNumber (_configItemInfo >> "type") == TYPE_UAV_TERMINAL}): {
|
||||
(_cargo select 14) pushBackUnique _x;
|
||||
};
|
||||
/* Weapon, at the bottom to avoid adding binos */
|
||||
case (isClass (_configCfgWeapons >> _x >> "WeaponSlotsInfo") &&
|
||||
{getNumber (_configCfgWeapons >> _x >> 'type') != 4096}): {
|
||||
{getNumber (_configCfgWeapons >> _x >> 'type') != TYPE_BINOCULAR_AND_NVG}): {
|
||||
switch (getNumber (_configCfgWeapons >> _x >> "type")) do {
|
||||
case 1: {
|
||||
case TYPE_WEAPON_PRIMARY: {
|
||||
(_cargo select 0) select 0 pushBackUnique ([_x] call bis_fnc_baseWeapon);
|
||||
};
|
||||
case 2: {
|
||||
case TYPE_WEAPON_HANDGUN: {
|
||||
(_cargo select 0) select 2 pushBackUnique ([_x] call bis_fnc_baseWeapon);
|
||||
};
|
||||
case 4: {
|
||||
case TYPE_WEAPON_SECONDARY: {
|
||||
(_cargo select 0) select 1 pushBackUnique ([_x] call bis_fnc_baseWeapon);
|
||||
};
|
||||
};
|
||||
@ -166,9 +166,9 @@ if (_items isEqualType true) then {
|
||||
/* Misc items */
|
||||
case (
|
||||
isClass (_configItemInfo) &&
|
||||
((getNumber (_configItemInfo >> "type")) in [101, 201, 301, 302] &&
|
||||
((getNumber (_configItemInfo >> "type")) in [TYPE_MUZZLE, TYPE_OPTICS, TYPE_FLASHLIGHT, TYPE_BIPOD] &&
|
||||
{(_x isKindOf ["CBA_MiscItem", (_configCfgWeapons)])}) ||
|
||||
{(getNumber (_configItemInfo >> "type")) in [401, 619, 620]} ||
|
||||
{(getNumber (_configItemInfo >> "type")) in [TYPE_FIRST_AID_KIT, TYPE_MEDIKIT, TYPE_TOOLKIT]} ||
|
||||
{(getText (_configCfgWeapons >> _x >> "simulation")) == "ItemMineDetector"}
|
||||
): {
|
||||
(_cargo select 17) pushBackUnique _x;
|
||||
@ -193,7 +193,7 @@ if (_items isEqualType true) then {
|
||||
switch true do {
|
||||
// Rifle, handgun, secondary weapons mags
|
||||
case (
|
||||
(getNumber (configFile >> "CfgMagazines" >> _x >> "type") in [256,512,1536,16]) &&
|
||||
(getNumber (configFile >> "CfgMagazines" >> _x >> "type") in [TYPE_MAGAZINE_PRIMARY_AND_THROW,TYPE_MAGAZINE_SECONDARY_AND_PUT,1536,TYPE_MAGAZINE_HANDGUN_AND_GL]) &&
|
||||
{!(_x in _grenadeList)} &&
|
||||
{!(_x in _putList)}
|
||||
): {
|
||||
|
@ -11,7 +11,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [CONTROL, 0] call ace_arsenal_fnc_attributeAddItems
|
||||
* [CONTROL] call ace_arsenal_fnc_attributeAddItems
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -21,9 +21,16 @@ _value params ["_items", "_mode"];
|
||||
TRACE_2("Initializing object with attribute",_object,_value);
|
||||
|
||||
if (_mode > 0) then {
|
||||
// Blacklist: all full arsenal and take items away
|
||||
// Blacklist: add full arsenal and take items away
|
||||
[_object, true, true] call FUNC(initBox);
|
||||
[_object, _items, true] call FUNC(removeVirtualItems);
|
||||
|
||||
// Need to delay removal by 2 frames
|
||||
[{
|
||||
[{
|
||||
params ["_object", "_items"];
|
||||
[_object, _items, true] call FUNC(removeVirtualItems);
|
||||
}, _this] call CBA_fnc_execNextFrame;
|
||||
}, [_object, _items]] call CBA_fnc_execNextFrame;
|
||||
} else {
|
||||
// Exit on whitelist mode with no items
|
||||
if (_items isEqualTo []) exitWith {};
|
||||
|
39
addons/arsenal/functions/fnc_attributeKeyDown.sqf
Normal file
39
addons/arsenal/functions/fnc_attributeKeyDown.sqf
Normal file
@ -0,0 +1,39 @@
|
||||
#include "script_component.hpp"
|
||||
#include "\a3\ui_f\hpp\defineDIKCodes.inc"
|
||||
/*
|
||||
* Author: mharis001
|
||||
* Handles keyboard input for the 3DEN attribute.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Display <DISPLAY>
|
||||
* 1: Key code <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Handled <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [DISPLAY, 0] call ace_arsenal_fnc_attributeKeyDown
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_display", "_keyCode"];
|
||||
TRACE_2("Attribute key down",_display,_keyCode);
|
||||
|
||||
// Exit if attribute is not in focus
|
||||
private _controlsGroup = uiNamespace getVariable QGVAR(attributeFocus);
|
||||
if (isNil "_controlsGroup") exitWith {false};
|
||||
|
||||
switch (_keyCode) do {
|
||||
case DIK_LEFT;
|
||||
case DIK_NUMPADMINUS: {
|
||||
[_controlsGroup, false] call FUNC(attributeSelect);
|
||||
true
|
||||
};
|
||||
case DIK_RIGHT;
|
||||
case DIK_NUMPADPLUS: {
|
||||
[_controlsGroup, true] call FUNC(attributeSelect);
|
||||
true
|
||||
};
|
||||
default {false};
|
||||
};
|
@ -23,6 +23,11 @@ TRACE_1("Initializing 3DEN attribute",_value);
|
||||
// Store working attribute value
|
||||
uiNamespace setVariable [QGVAR(attributeValue), _value];
|
||||
|
||||
// Add keyDown EH to display
|
||||
// Does not work properly when added to controls group
|
||||
private _display = ctrlParent _controlsGroup;
|
||||
_display displayAddEventHandler ["KeyDown", {call FUNC(attributeKeyDown)}];
|
||||
|
||||
// Handle selected mode
|
||||
if (_value select 1 > 0) then {
|
||||
(_controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_MODE) lbSetCurSel 1;
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Add or remove item(s) when the + or - button is pressed in the right panel.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_addOrRemove"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Clear the current container.
|
||||
@ -10,8 +12,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display"];
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Export current loadout / default loadouts list to clipboard.
|
||||
@ -10,7 +11,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_display"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Hide / show arsenal interface.
|
||||
@ -10,8 +12,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Import loadout / default loadouts list from clipboard.
|
||||
@ -10,8 +12,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display"];
|
||||
|
||||
@ -31,16 +31,7 @@ if (GVAR(shiftState) && {is3DEN}) then {
|
||||
{_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];
|
||||
};
|
||||
_x call FUNC(addDefaultLoadout);
|
||||
};
|
||||
} foreach _data;
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Delete / unshare loadout currently selected.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Load selected loadout.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
@ -76,10 +76,17 @@ for "_index" from 0 to 15 do {
|
||||
};
|
||||
{
|
||||
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));
|
||||
if (_simulationType != "NVGoggles") then {
|
||||
if (_simulationType == "ItemGps" || _simulationType == "Weapon") then {
|
||||
GVAR(currentItems) set [14, _x];
|
||||
} else {
|
||||
|
||||
private _index = 10 + (["itemmap", "itemcompass", "itemradio", "itemwatch"] find (tolower _simulationType));
|
||||
GVAR(currentItems) set [_index, _x];
|
||||
};
|
||||
};
|
||||
} forEach (assignedItems GVAR(center));
|
||||
|
||||
call FUNC(updateUniqueItemsList);
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Rename selected loadout.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Save selected loadout.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
@ -33,7 +33,7 @@ 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 _loadoutIndex = _data findIf {(_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)
|
||||
@ -124,10 +124,10 @@ switch (GVAR(currentLoadoutsTab)) do {
|
||||
};
|
||||
};
|
||||
|
||||
if (count _sameNameLoadoutsList == 0) then {
|
||||
if (_loadoutIndex == -1) then {
|
||||
_data pushBack [_editBoxContent, _loadout];
|
||||
} else {
|
||||
_data set [_data find (_sameNameLoadoutsList select 0), [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _loadout]];
|
||||
_data set [_loadoutIndex, [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _loadout]];
|
||||
};
|
||||
|
||||
// Delete "old" loadout row
|
||||
@ -155,7 +155,7 @@ switch (GVAR(currentLoadoutsTab)) do {
|
||||
|
||||
if (is3DEN) then {
|
||||
|
||||
private _sameNameLoadoutsList = _data select {_x select 0 == _editBoxContent};
|
||||
private _loadoutIndex = _data findIf {(_x select 0) == _editBoxContent};
|
||||
|
||||
for "_dataIndex" from 0 to 10 do {
|
||||
switch (_dataIndex) do {
|
||||
@ -232,10 +232,10 @@ switch (GVAR(currentLoadoutsTab)) do {
|
||||
};
|
||||
};
|
||||
|
||||
if (count _sameNameLoadoutsList == 0) then {
|
||||
if (_loadoutIndex == -1) then {
|
||||
GVAR(defaultLoadoutsList) pushBack [_editBoxContent, _loadout];
|
||||
} else {
|
||||
GVAR(defaultLoadoutsList) set [GVAR(defaultLoadoutsList) find (_sameNameLoadoutsList select 0), [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _loadout]];
|
||||
GVAR(defaultLoadoutsList) set [_loadoutIndex, [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _loadout]];
|
||||
};
|
||||
|
||||
for '_i' from 0 to (((lnbsize _contentPanelCtrl) select 0) - 1) do {
|
||||
@ -258,10 +258,10 @@ switch (GVAR(currentLoadoutsTab)) do {
|
||||
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
|
||||
} else {
|
||||
|
||||
if (count _sameNameLoadoutsList == 0) then {
|
||||
if (_loadoutIndex == -1) then {
|
||||
_data pushBack [_editBoxContent, _curSelLoadout];
|
||||
} else {
|
||||
_data set [_data find (_sameNameLoadoutsList select 0), [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _curSelLoadout]];
|
||||
_data set [_loadoutIndex, [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _curSelLoadout]];
|
||||
_contentPanelCtrl setVariable [_editBoxContent + str IDC_buttonMyLoadouts, [_curSelLoadout] call FUNC(verifyLoadout)];
|
||||
};
|
||||
|
||||
@ -273,10 +273,10 @@ switch (GVAR(currentLoadoutsTab)) do {
|
||||
|
||||
_loadout = (GVAR(sharedLoadoutsNamespace) getVariable ((_contentPanelCtrl lnbText [_cursSelRow, 0]) + (_contentPanelCtrl lnbText [_cursSelRow, 1]))) select 2;
|
||||
|
||||
if (count _sameNameLoadoutsList == 0) then {
|
||||
if (_loadoutIndex == -1) then {
|
||||
_data pushBack [_editBoxContent, _loadout];
|
||||
} else {
|
||||
_data set [_data find (_sameNameLoadoutsList select 0), [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _loadout]];
|
||||
_data set [_loadoutIndex, [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _loadout]];
|
||||
_contentPanelCtrl setVariable [_editBoxContent + str IDC_buttonMyLoadouts, [_loadout] call FUNC(verifyLoadout)];
|
||||
};
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Share selected loadout.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Toggle the stats control group
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Handles the previous / next page buttons for stats
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control", "_nextPage"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Clear the provided searchbar.
|
||||
@ -12,8 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control", "_rightButton"];
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Create the internal stats arrays when needed for the first time
|
||||
@ -10,7 +11,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!isNil QGVAR(statsListLeftPanel)) exitWith {};
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Fill left panel.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
@ -162,6 +162,16 @@ switch true do {
|
||||
{
|
||||
["CfgUnitInsignia", configName _x, _ctrlPanel, "texture"] call FUNC(addListBoxItem);
|
||||
} foreach ("true" configClasses (configFile >> "CfgUnitInsignia"));
|
||||
|
||||
{
|
||||
private _displayName = getText (_x >> "displayName");
|
||||
private _className = configName _x;
|
||||
private _lbAdd = _ctrlPanel lbAdd _displayName;
|
||||
|
||||
_ctrlPanel lbSetData [_lbAdd, _className];
|
||||
_ctrlPanel lbSetPicture [_lbAdd, getText (_x >> "texture")];
|
||||
_ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _className]];
|
||||
} foreach ("true" configClasses (missionConfigFile >> "CfgUnitInsignia"));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Fill loadouts list.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Fill right panel.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Handles keyboard inputs inside the searchbars text boxes.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Karel Moricky, modified by Alganthe
|
||||
* Update the camera position and pitch/bank.
|
||||
@ -15,8 +17,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["", "_args"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Handle the mouse wheel.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["", "_args"];
|
||||
_args params ["", "_zPos"];
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Handles keyboard inputs inside the searchbars text boxes.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Handles the stats control group
|
||||
@ -13,8 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control", "_curSel", "_itemCfg"];
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Initialize a box / object for arsenal.
|
||||
@ -16,7 +17,6 @@
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params [["_object", objNull, [objNull]], ["_items", true, [[], true]], ["_global", true, [true]]];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Update arsenal's info box.
|
||||
@ -13,8 +15,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control", "_curSel" ,"_itemCfg"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Handles tab changing for the loadouts display.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Displays messages in arsenal.
|
||||
@ -11,8 +13,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["_display", "_message"];
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* onUnLoad EH for arsenal.
|
||||
@ -10,7 +11,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
(_this select 1) params ["", "_exitCode"];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* onLoad EH for arsenal.
|
||||
@ -12,8 +14,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
params ["", "_args"];
|
||||
_args params ["_display"];
|
||||
@ -38,7 +38,7 @@ if (isNil QGVAR(defaultLoadoutsList)) then {
|
||||
if (is3DEN) then {
|
||||
GVAR(defaultLoadoutsList) = (QGVAR(DummyCategory) get3DENMissionAttribute QGVAR(DefaultLoadoutsListAttribute));
|
||||
} else {
|
||||
GVAR(defaultLoadoutsList) = [];
|
||||
GVAR(defaultLoadoutsList) = [];
|
||||
};
|
||||
};
|
||||
|
||||
@ -165,9 +165,16 @@ for "_index" from 0 to 15 do {
|
||||
|
||||
{
|
||||
private _simulationType = getText (configFile >> "CfgWeapons" >> _x >> "simulation");
|
||||
private _index = 10 + (["itemmap", "itemcompass", "itemradio", "itemwatch", "itemgps"] find (tolower _simulationType));
|
||||
|
||||
GVAR(currentItems) set [_index, _x];
|
||||
if (_simulationType != "NVGoggles") then {
|
||||
if (_simulationType == "ItemGps" || _simulationType == "Weapon") then {
|
||||
GVAR(currentItems) set [14, _x];
|
||||
} else {
|
||||
|
||||
private _index = 10 + (["itemmap", "itemcompass", "itemradio", "itemwatch"] find (tolower _simulationType));
|
||||
GVAR(currentItems) set [_index, _x];
|
||||
};
|
||||
};
|
||||
} forEach (assignedItems GVAR(center));
|
||||
|
||||
GVAR(currentWeaponType) = switch true do {
|
||||
@ -289,6 +296,10 @@ if (is3DEN) then {
|
||||
} else {
|
||||
GVAR(centerNotPlayer) = (GVAR(center) != player);
|
||||
|
||||
if (currentVisionMode ACE_Player == 1) then {
|
||||
GVAR(center) action ["NVGogglesOff", GVAR(center)];
|
||||
};
|
||||
|
||||
{
|
||||
private _ctrl = _display displayCtrl _x;
|
||||
_ctrl ctrlEnable GVAR(enableIdentityTabs);
|
||||
|
@ -1,3 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
#include "\A3\ui_f\hpp\defineDIKCodes.inc"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Handles keyboard inputs in arsenal.
|
||||
@ -14,9 +17,6 @@
|
||||
*
|
||||
* 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"];
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* onUnLoad EH for arsenal loadouts display.
|
||||
@ -10,8 +12,6 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
GVAR(currentLoadoutsTab) = nil;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user