Merge branch 'master' into cargo-inventory-ui

# Conflicts:
#	addons/cargo/CfgEventHandlers.hpp
#	addons/cargo/functions/fnc_initVehicle.sqf
#	addons/cargo/functions/fnc_setSpace.sqf
#	addons/cargo/functions/fnc_startUnload.sqf
This commit is contained in:
jokoho482 2024-04-20 23:33:12 +02:00
commit 0959735400
1678 changed files with 24299 additions and 44938 deletions

View File

@ -36,7 +36,7 @@ We welcome anyone to contribute to this repository. Issues that we are actively
When contributing to this repository, please first discuss the change you wish to make via issue or [Discord](https://acemod.org/discord) with the [ACE3 project maintainers](https://ace3.acemod.org/team.html) before making a change. This may not be necessary if you are contributing for something which has an existing issue in our repository already.
1. Please make a pull request (PR) as early as possible. This lets use help you in the proces of developing it. When opening a work in progress pull request, mark your PR with a `WIP:` prefix.
1. Please make a pull request (PR) as early as possible. This lets use help you in the proces of developing it. When opening a work in progress pull request, use GitHub's draft feature. This will mark the PR as a work in progress and will prevent it from being merged until you mark it as ready for review.
2. Describe what this pull request will do and how it solves this in the description of your PR. A clear intent and description of the way the issue is resolved will help us to review the PR more efficiently.
3. Please follow our [Development Guidelines](https://ace3.acemod.org/wiki/development/).

View File

@ -23,14 +23,14 @@ All good? Then proceed and fill out the items below.
**Mods (complete and add to the following information):**
- **Arma 3:** `x.xx` [e.g. 1.00 stable, rc, dev]
- **CBA:** `3.x.x` [e.g. 3.0.0 stable, commit hash]
- **ACE3:** `3.x.x` [eg. 3.0.0 stable, commit hash]
- **ACE3:** `3.x.x` [e.g. 3.0.0 stable, commit hash]
<!-- Make sure to reproduce the issue with only CBA and ACE3 on a newly created mission! -->
**Description:**
A clear and concise description of what the bug is.
**Steps to reproduce:**
_Follow [https://ace3.acemod.org/img/wiki/user/issue_flowchart.webp](this flowchart)!_
_Follow [this flowchart](https://ace3.acemod.org/img/wiki/user/issue_flowchart.webp)!_
1. _Go to ..._
2. _Click ..._

View File

@ -4,6 +4,6 @@
### IMPORTANT
- [ ] If the contribution affects [the documentation](https://github.com/acemod/ACE3/tree/master/docs), please include your changes in this pull request so the documentation will appear on the [website](https://ace3.acemod.org/).
- [ ] [Development Guidelines](https://ace3.acemod.org/wiki/development/) are read, understood and applied.
- [ ] Title of this PR uses our standard template `Component - Add|Fix|Improve|Change|Make|Remove {changes}`.
- If the contribution affects [the documentation](https://github.com/acemod/ACE3/tree/master/docs), please include your changes in this pull request so the documentation will appear on the [website](https://ace3.acemod.org/).
- [Development Guidelines](https://ace3.acemod.org/wiki/development/) are read, understood and applied.
- Title of this PR uses our standard template `Component - Add|Fix|Improve|Change|Make|Remove {changes}`.

View File

@ -5,14 +5,16 @@ branches:
name-template: 'Version $NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
sort-by: title # sort alphabetically
sort-direction: ascending
categories:
- title: '**ADDED:**'
labels:
- 'kind/feature request'
- 'kind/added feature'
- 'kind/feature'
- title: '**FIXED:**'
labels:
- 'kind/bug fix'
- 'kind/bug-fix'
- title: '**IMPROVED:**'
labels:
- 'kind/enhancement'
@ -20,13 +22,16 @@ categories:
- title: '**CHANGED:**'
labels:
- 'kind/cleanup'
- 'area/compatibility'
- 'kind/change'
- title: '**SETTINGS:**'
labels:
- 'kind/setting'
- title: '**TRANSLATIONS:**'
labels:
- 'area/translations'
- 'kind/translation'
exclude-labels:
- 'ignore changelog'
- 'ignore-changelog'
- 'dependencies'
change-template: '- $TITLE (#$NUMBER)'
@ -39,5 +44,5 @@ template: |
replacers:
# Category titles
- search: '/\#\# (\*\*(ADDED|FIXED|IMPROVED|CHANGED|TRANSLATIONS):\*\*)/g'
- search: '/\#\# (\*\*(ADDED|FIXED|IMPROVED|CHANGED|SETTINGS|TRANSLATIONS):\*\*)/g'
replace: '$1'

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Validate SQF
run: python3 tools/sqf_validator.py
- name: Validate Config
@ -22,6 +22,8 @@ jobs:
run: python3 tools/check_strings.py
- name: Check for BOM
uses: arma-actions/bom-check@master
with:
path: 'addons'
- name: Validate function headers
run: python3 docs/tools/document_functions.py --debug
@ -29,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Lint (sqflint)
uses: arma-actions/sqflint@master
continue-on-error: true # No failure due to many false-positives
@ -38,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Run HEMTT build
@ -46,7 +48,7 @@ jobs:
- name: Rename build folder
run: mv .hemttout/build .hemttout/@ace
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ace3-${{ github.sha }}-nobin
path: .hemttout/@*

View File

@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Python packages
run: |
pip3 install wheel
@ -33,7 +33,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Extract Dependencies
run: python3 tools/extract_dependencies.py --markdown
@ -47,7 +47,7 @@ jobs:
destination: docs/_site/
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: jekyll-site
path: docs/_site/
@ -63,7 +63,7 @@ jobs:
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: jekyll-site
path: _site/

View File

@ -14,7 +14,7 @@ jobs:
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build
shell: cmd
run: |
@ -23,7 +23,7 @@ jobs:
cd build
cmake .. && cmake --build .
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ace3_extensions-${{ matrix.os }}-debug
path: extensions/build

44
.github/workflows/hemtt.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: HEMTT
on:
push:
branches:
- master
pull_request_target:
jobs:
windows:
runs-on: windows-latest
steps:
- name: Install Arma 3 Tools
uses: arma-actions/arma3-tools@master
with:
toolsUrl: ${{ secrets.ARMA3_TOOLS_URL }}
- name: Checkout the source code
uses: actions/checkout@v4
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Checkout pull request
uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request_target' }}
with:
path: pullrequest
ref: 'refs/pull/${{ github.event.number }}/merge'
- name: Replace addons with pull request addons
if: ${{ github.event_name == 'pull_request_target' }}
run: |
rm -r addons\
rm -r optionals\
rm -r include\
xcopy /e /h /q pullrequest\addons addons\
xcopy /e /h /q pullrequest\optionals optionals\
xcopy /e /h /q pullrequest\include include\
- name: Run HEMTT build
run: hemtt build
- name: Rename build folder
run: mv .hemttout/build .hemttout/@ace
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ace3-${{ github.sha }}
path: .hemttout/@*

View File

@ -25,7 +25,7 @@ jobs:
Invoke-WebRequest "$env:RHSUSF_URL" -OutFile rhsusf.zip
$files = @("arma3.zip", "rhsafrf.zip", "rhsgref.zip", "rhssaf.zip", "rhsusf.zip")
ForEach ($file in $files) {
Extract-7Zip -Path $file -DestinationPath .
Expand-7ZipArchive -Path $file -DestinationPath .
Remove-Item $file
}
env:
@ -35,18 +35,18 @@ jobs:
RHSSAF_URL: ${{ secrets.RHSSAF_URL }}
RHSUSF_URL: ${{ secrets.RHSUSF_URL }}
- name: Checkout CBA A3
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: x\cba
ref: master
repository: CBATeam/CBA_A3.git
- name: Checkout ACE3
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: z\ace
persist-credentials: false
- name: Checkout pull request
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request_target' }}
with:
path: pullrequest
@ -67,18 +67,19 @@ jobs:
xcopy /e /h /q z\ace\tools\pDummies\gm gm\
xcopy /e /h /q z\ace\tools\pDummies\vn vn\
xcopy /e /h /q z\ace\tools\pDummies\WW2 WW2\
xcopy /e /h /q z\ace\tools\pDummies\CUP CUP\
- name: Build
run: py P:\z\ace\tools\make.py ci
env:
PYTHONUNBUFFERED: 1
- name: Archive logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: logs
path: temp/*.log
- name: Archive @ace
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: '@ace3-${{ github.sha }}'
path: z\ace\release\@ace

View File

@ -11,6 +11,6 @@ jobs:
steps:
- name: Release Drafter
if: github.repository == 'acemod/ACE3'
uses: release-drafter/release-drafter@v5
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ CHANGELOG.md
sqfvm.exe
ArmaScriptCompiler.exe
*.sqfc
!extras/**/*.zip

View File

@ -18,21 +18,16 @@ include = [
[version]
git_hash = 0
# Unused in HEMTT v1.11 or higher, kept for backwards compatibility
[asc]
enabled = true
exclude = [
"/initsettings.sqf",
"/initkeybinds.sqf",
"/xeh_prep.sqf",
".inc.sqf",
"/dev/",
"medical_ai/statemachine.sqf",
"common/functions/fnc_dummy.sqf",
"zeus/functions/fnc_zeusAttributes.sqf",
]
[hemtt.config]
preset = "Hemtt"
[hemtt.launch]
workshop = [
"450814997", # CBA_A3
@ -61,3 +56,12 @@ workshop = [
dlc = [
"Western Sahara",
]
[hemtt.launch.rhs]
workshop = [
"450814997", # CBA_A3's Workshop ID
"843425103", # RHS AFRF Workshop ID
"843577117", # RHS USAF Workshop ID
"843593391", # RHS GREF Workshop ID
"843632231", # RHS SAF Workshop ID
]

View File

@ -6,11 +6,12 @@
# request, preferably including an email address.
# CORE TEAM
BaerMitUmlaut
Brett Mayson
bux578 <github@jonathandavid.de>
commy2
Dahlgren
tcvm <baileydanyluk@gmail.com>
Drofseh <drofseh.arma@gmail.com>
esteldunedain <nicolas.d.badano@gmail.com>
Felix Wiegand <koffeinflummi@gmail.com>
Garth "L-H" de Wet <garthofhearts@gmail.com>
@ -18,14 +19,18 @@ Giallustio
Glowbal
Grim
Janus
johnb43
jokoho482 <jokoho482@gmail.com>
Jonpas <jonpas33@gmail.com>
Kieran
kymckay
mharis001 <mhariszakar@gmail.com>
MikeMF
MiszczuZPolski
NouberNou
PabstMirror <pabstmirror@gmail.com>
Ruthberg <ulteq@web.de>
tcvm <baileydanyluk@gmail.com>
tpM
veteran29
ViperMaul
@ -53,7 +58,6 @@ Arcanum417 <lubos.len@gmail.com>
Arkhir <wonsz666@gmail.com >
ARV187 aka Spark23
Asgar Serran <piechottaf@web.de>
BaerMitUmlaut
Bamse <bamsis@gmail.com>
Barman75
Bla1337
@ -79,7 +83,6 @@ diwako
dixon13 <dixonbegay@gmail.com>
Drift_91
Drill <drill87@gmail.com>
Drofseh <drofseh@gmail.com>
Dslyecxi <dslyecxi@gmail.com>
Dudakov aka [OMCB]Kaban <dudakov.s@gmail.com>
Eclipser <jms@modeemi.fi>
@ -124,6 +127,7 @@ Keithen <Keithen.Neu@gmail.com>
Kllrt <kllrtik@gmail.com>
KokaKolaA3
Krzyciu
LAxemann
legman <juicemelon@msn.com>
Legolasindar "Viper" <legolasindar@gmail.com>
licht-im-Norden87 <lichtimnorden87@gmail.com>
@ -135,7 +139,6 @@ MarcBook
meat <p.humberdroz@gmail.com>
Michail Nikolaev
MikeMatrix <m.braun92@gmail.com>
MikeMF
mjc4wilton <mjc4wilton@gmail.com>
Mysteryjuju
nic547 <nic547@outlook.com>
@ -189,3 +192,4 @@ YetheSamartaka
xrufix
Zakant <Zakant@gmx.de>
zGuba
Zman6258

View File

@ -5,7 +5,7 @@
<p align="center">
<a href="https://github.com/acemod/ACE3/releases/latest">
<img src="https://img.shields.io/badge/Version-3.15.2-blue.svg?style=flat-square" alt="ACE3 Version">
<img src="https://img.shields.io/github/release/acemod/ACE3.svg?style=flat-square&label=Version" 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">

View File

@ -1,7 +1,5 @@
#include "script_component.hpp"
#include "initKeybinds.sqf"
GVAR(currentbulletID) = -1;
GVAR(Protractor) = false;
@ -11,6 +9,8 @@ GVAR(currentGrid) = 0;
if (!hasInterface) exitWith {};
#include "initKeybinds.inc.sqf"
["CBA_settingsInitialized", {
//If not enabled, dont't add PFEH
if (!GVAR(enabled)) exitWith {};
@ -19,11 +19,11 @@ if (!hasInterface) exitWith {};
[] call FUNC(initializeTerrainExtension);
// Register fire event handler
["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
["ace_firedPlayerNonLocal", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
["ace_firedPlayer", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler;
["ace_firedPlayerNonLocal", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler;
// Register Perframe Handler
[FUNC(handleFirePFH), GVAR(simulationInterval)] call CBA_fnc_addPerFrameHandler;
[LINKFUNC(handleFirePFH), GVAR(simulationInterval)] call CBA_fnc_addPerFrameHandler;
//Add warnings for missing compat PBOs (only if AB is on)
{

View File

@ -6,6 +6,6 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
#include "initSettings.sqf"
#include "initSettings.inc.sqf"
ADDON = true;

View File

@ -17,7 +17,7 @@
*/
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret);
if (!(_ammo isKindOf "BulletBase")) exitWith {};
if (!alive _projectile) exitWith {};

View File

@ -22,7 +22,7 @@ private _initStartTime = diag_tickTime;
private _mapSize = worldSize;
if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith {
INFO_1("Terrain already initialized [world: %1]", worldName);
INFO_1("Terrain already initialized [world: %1]",worldName);
#ifdef DEBUG_MODE_FULL
systemChat "AdvancedBallistics: Terrain already initialized";
#endif
@ -33,14 +33,14 @@ private _gridCells = _mapGrids * _mapGrids;
GVAR(currentGrid) = 0;
INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldName);
INFO_2("Starting Terrain Extension [cells: %1] [world: %2]",_gridCells,worldName);
[{
params ["_args","_idPFH"];
_args params ["_mapGrids", "_gridCells", "_initStartTime"];
if (GVAR(currentGrid) >= _gridCells) exitWith {
INFO_2("Finished terrain initialization in %1 seconds [world: %2]", (diag_tickTime - _initStartTime) toFixed 2, 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", (diag_tickTime - _initStartTime) toFixed 2];
#endif
@ -53,7 +53,7 @@ INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldNa
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};
private _gridSurfaceIsWater = parseNumber (surfaceIsWater _gridCenter);
"ace_advanced_ballistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater];
GVAR(currentGrid) = GVAR(currentGrid) + 1;
if (GVAR(currentGrid) >= _gridCells) exitWith {};

View File

@ -44,6 +44,9 @@ if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then {
_dragModel = 1;
};
private _ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients");
if (_ballisticCoefficients isEqualTo []) then {
_ballisticCoefficients = [0.5];
};
private _velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries");
private _atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere");
if (_atmosphereModel isEqualTo "") then {
@ -66,7 +69,7 @@ if ((_typicalSpeed > 0) && {_typicalSpeed < 360}) then {
if (_inheritedBarrelConfig || _inheritedTempConfig) then {
private _parentConfig = inheritsFrom _ammoConfig;
private _parentSpeed = getNumber (_parentConfig >> "typicalSpeed");
WARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig, _parentSpeed);
WARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig,_parentSpeed);
if (_parentSpeed <= 0) exitWith {//Handle weird or null parent
_muzzleVelocityTable = [];
_ammoTempMuzzleVelocityShifts = [];

View File

@ -21,7 +21,7 @@
private _weaponConfig = (configFile >> "CfgWeapons" >> _this);
private _barrelTwist = 0 max getNumber(_weaponConfig >> "ACE_barrelTwist");
private _twistDirection = [0, 1] select (_barrelTwist != 0);
private _twistDirection = parseNumber (_barrelTwist != 0);
if (isNumber (_weaponConfig >> "ACE_twistDirection")) then {
_twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection");
if !(_twistDirection in [-1, 0, 1]) then {

View File

@ -4,7 +4,7 @@
<Key ID="STR_ACE_Advanced_Ballistics_WindInfoKey">
<English>Show Wind Info</English>
<Polish>Pokaż inf. o wietrze</Polish>
<Italian>Mostra indicazioni del vento</Italian>
<Italian>Mostra indicazioni vento</Italian>
<Russian>Показать информацию о ветре</Russian>
<French>Afficher les infos sur le vent</French>
<Spanish>Mostrar información del viento</Spanish>
@ -46,7 +46,7 @@
<Hungarian>Fejlett ballisztika</Hungarian>
<Russian>Продвинутая баллистика</Russian>
<Italian>Balistica Avanzata</Italian>
<Japanese>アドバンスド バリスティックス</Japanese>
<Japanese>アドバンスド弾道計算</Japanese>
<Korean>고급 탄도학</Korean>
<Chinese>先進彈道系統</Chinese>
<Chinesesimp>进阶弹道系统</Chinesesimp>
@ -63,7 +63,7 @@
<Hungarian>Fejlett ballisztika</Hungarian>
<Russian>Продвинутая баллистика</Russian>
<Italian>Balistica Avanzata</Italian>
<Japanese>アドバンスド バリスティックスを有効化</Japanese>
<Japanese>アドバンスド弾道計算を有効化</Japanese>
<Korean>고급 탄도학</Korean>
<Chinese>先進彈道系統</Chinese>
<Chinesesimp>进阶弹道系统</Chinesesimp>
@ -80,7 +80,7 @@
<Hungarian>Engedélyezi a fejlett ballisztikát</Hungarian>
<Russian>Включает продвинутую баллистику</Russian>
<Italian>Abilita Balistica Avanzata</Italian>
<Japanese>アドバンスド バリスティックスを有効化します。</Japanese>
<Japanese>アドバンスド弾道計算は高度な弾道計算処理を有効化します。</Japanese>
<Korean>고급 탄도학을 적용합니다</Korean>
<Chinese>啟用先進彈道系統</Chinese>
<Chinesesimp>启用进阶弹道系统</Chinesesimp>
@ -106,8 +106,8 @@
<English>Simulates slight variations in muzzle velocity between each shot</English>
<Spanish>Simula variaciones ligeras de velocidad entre cada disparo</Spanish>
<German>Simuliert leichte Variationen der Mündungsgeschwindigkeit zwischen jedem Schuss.</German>
<Japanese>発射毎の銃口初速の変動をシミュレートします。</Japanese>
<Italian>Simula lievi variazioni della velocità della volata tra un colpo e l'altro</Italian>
<Japanese>発射毎の銃口初速のわずかな変動をシミュレートします。</Japanese>
<Italian>Simula piccole variazioni della velocità alla volata tra ogni colpo.</Italian>
<Korean>각 사격 사이에 총구속도 변화를 시뮬레이션 합니다.</Korean>
<Chinese>模擬每發子彈的槍口初速都略有不同</Chinese>
<Chinesesimp>模拟每发子弹的枪口初速都略有不同</Chinesesimp>
@ -128,8 +128,8 @@
<French>Activer la simulation de la température</French>
<Hungarian>Lőszer-hő szimuláció engedélyezése</Hungarian>
<Russian>Симуляция температуры для боеприпасов</Russian>
<Italian>Abilita simulazione della temperatura delle munizioni</Italian>
<Japanese>弾薬温度シミュレーションを有効化</Japanese>
<Italian>Abilita simulazione temperatura munizioni</Italian>
<Japanese>弾薬温度シミュレーションを有効化</Japanese>
<Korean>탄약 온도 구현 적용</Korean>
<Chinese>啟用彈藥溫度模擬系統</Chinese>
<Chinesesimp>启用弹药温度模拟系统</Chinesesimp>
@ -145,7 +145,7 @@
<French>La vitesse initiale varie en fonction de la température des munitions.</French>
<Hungarian>A kezdősebesség a lőszer hőmérsékletétől függően változó</Hungarian>
<Russian>Начальная скорость пули зависит от температуры</Russian>
<Italian>La velocità dello sparo varia a seconda della temperatura delle munizioni</Italian>
<Italian>La velocità alla volata varia a seconda della temperatura delle munizioni.</Italian>
<Japanese>弾薬の温度により銃口初速を変動させます。</Japanese>
<Korean>탄약 온도에 비례해 총구 속도가 달라집니다</Korean>
<Chinese>子彈初速將隨彈藥溫度而有所變化</Chinese>
@ -162,8 +162,8 @@
<French>Activer la simulation de la longueur de canon</French>
<Hungarian>Csőhossz-szimuláció engedélyezése</Hungarian>
<Russian>Симуляция длины ствола</Russian>
<Italian>Abilita simulazione della lunghezza della canna</Italian>
<Japanese>銃身長シミュレーションを有効化</Japanese>
<Italian>Abilita simulazione lunghezza canna</Italian>
<Japanese>銃身長シミュレーションを有効化</Japanese>
<Korean>총열 길이 구현 적용</Korean>
<Chinese>啟用槍管長度模擬系統</Chinese>
<Chinesesimp>启用枪管长度模拟系统</Chinesesimp>
@ -179,7 +179,7 @@
<French>La vitesse initiale varie en fonction de la longueur du canon.</French>
<Hungarian>A kezdősebesség a cső hosszától függően változó</Hungarian>
<Russian>Начальная скорость пули зависит от длины ствола</Russian>
<Italian>La velocità di sparo varia a seconda della lunghezza della canna</Italian>
<Italian>La velocità alla volata varia a seconda della lunghezza della canna.</Italian>
<Japanese>銃身長により銃口初速を変動させます。</Japanese>
<Korean>총구 속도가 총열에 비례해 달라집니다</Korean>
<Chinese>子彈初速將隨槍管長度而有所變化</Chinese>
@ -196,7 +196,7 @@
<French>Activer l'effet de balle traçante</French>
<Hungarian>Nyomkövető-effekt engedélyezése</Hungarian>
<Russian>Следы пуль</Russian>
<Italian>Abilita effetto dei Proiettili Traccianti</Italian>
<Italian>Abilita effetto di traccia proiettile</Italian>
<Japanese>弾丸の軌跡エフェクトを有効化</Japanese>
<Korean>예광탄 효과 적용</Korean>
<Chinese>啟用曳光彈效果</Chinese>
@ -213,7 +213,7 @@
<French>Active un effet de balle traçante pour les munitions de gros calibre (seulement visible en utilisant une optique à fort grossissement).</French>
<Hungarian>Engedélyezi a nagy kaliberű lövedékek nyomának vizuális követését (csak nagy teljesítményű optikán keresztül látható)</Hungarian>
<Russian>Включает эффект следов пуль для больших калибров (видны только через мощную оптику)</Russian>
<Italian>Abilita effetto dei proiettili traccianti di alto calibro (visibile solo attraverso ottiche ad alto potenziale)</Italian>
<Italian>Abilita effetto di traccia lasciata da proiettili di alto calibro (visibile solo attraverso ottiche ad alto ingrandimento)</Italian>
<Japanese>大口径弾の軌跡エフェクトを有効化します。 (高性能光学機器を介してのみ見ることができます)</Japanese>
<Korean>대구경 탄환에 예광탄 효과를 적용합니다(오직 고성능 조준경 사용시에만 보입니다)</Korean>
<Chinese>啟用曳光彈效果給大口徑子彈 (只有透過高倍率光學瞄鏡才能看到)</Chinese>
@ -230,7 +230,7 @@
<French>Intervalle de simulation</French>
<Hungarian>Szimuláció intervalluma</Hungarian>
<Russian>Интервал симуляции</Russian>
<Italian>Intervallo Simulazione</Italian>
<Italian>Intervallo di Simulazione</Italian>
<Japanese>シミュレーション間隔</Japanese>
<Korean>구현 간격</Korean>
<Chinese>模擬間隔</Chinese>
@ -246,7 +246,7 @@
<French>Définit l'intervalle entre chacune des étapes de calcul.</French>
<Hungarian>Meghatározza a számítási lépések közötti időintervallumot</Hungarian>
<Russian>Определяет временной интервал между вычислениями</Russian>
<Italian>Definisce l'intervallo tra ogni step di calcolo</Italian>
<Italian>Definisce l'intervallo tra ogni passo del calcolo</Italian>
<Japanese>各シミュレーション毎の間隔を定義します。</Japanese>
<Korean>각 계산 단위의 간격을 정의합니다</Korean>
<Chinese>定義每個模擬計算之間的時間間隔</Chinese>
@ -263,7 +263,7 @@
<Hungarian>Szimuláció hatóköre</Hungarian>
<Russian>Радиус симуляции</Russian>
<Italian>Raggio Simulazione</Italian>
<Japanese>シミュレーションの範囲</Japanese>
<Japanese>シミュレーションの半径</Japanese>
<Korean>구현 범위</Korean>
<Chinese>模擬半徑</Chinese>
<Chinesesimp>模拟半径</Chinesesimp>
@ -279,8 +279,8 @@
<French>Définit le rayon autour du joueur (en mètres), dans lequel la balistique avancée est appliquée aux projectiles.</French>
<Hungarian>Meghatározza a játékos körüli hatókört (méterben), ahol a lövedékek fejlett ballisztikát használnak</Hungarian>
<Russian>Определяет радиус вокруг игрока (в метрах), в котором продвинутая баллистика применяется к снарядам</Russian>
<Italian>Definisce il raggio attorno al giocatore (in metri) per cui la Balistica Avanzata è applicata ai proiettili</Italian>
<Japanese>アドバンスド バリスティックスの適用半径範囲 (プレイヤー中心、メートル単位) を定義します。</Japanese>
<Italian>Definisce il raggio attorno al giocatore (in metri) entro il quale la Balistica Avanzata è applicata ai proiettili</Italian>
<Japanese>アドバンスド弾道計算の適用半径範囲 (プレイヤー中心、メートル単位) を定義します。</Japanese>
<Korean>플레이어 주위의 발사체를 고급 탄도학으로 정의하는 범위를 정합니다(미터)</Korean>
<Chinese>以玩家的半徑距離(公尺)定義先進彈道系統啟用範圍</Chinese>
<Chinesesimp>定义玩家周围的半径(米),在这个半径内,进阶弹道系统会被启用</Chinesesimp>
@ -296,8 +296,8 @@
<Hungarian>Ez a modul engedélyezi a fejlett ballisztikai szimulációt - a lövedékek röppályáját befolyásolni fogja a levegő hőmérséklete, légnyomás, páratartalom, gravitáció, a lövedék fajtája, valamint a fegyver, amiből kilőtték a lövedéket.</Hungarian>
<Russian>Этот модуль включает симуляцию продвинутой баллистики - при этом на траекторию полета снаряда влияют различные параметры, такие как температура воздуха, атмосферное давление, влажность, гравитация, тип боеприпаса и оружия, из которого произвели выстрел.</Russian>
<Spanish>Este módulo permite la simulación balística avanzada - es decir, la trayectoria de los proyectiles está influenciada por variables como la temperatura del aire, la presión atmosférica, la humedad, la gravedad, el tipo de municiones y el arma desde el que fue disparada.</Spanish>
<Italian>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</Italian>
<Japanese>アドバンスド バリスティックスのシミュレーションを有効化します。 弾道は気温・気圧・湿度・重力・弾薬の種類・発射する武器などの変化による影響を受けるようになります。</Japanese>
<Italian>Questo modulo abilita la simulazione della Balistica Avanzata - essa comporta che 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.</Italian>
<Japanese>アドバンスド弾道計算のシミュレーションを有効化します。 弾道は気温・気圧・湿度・重力・弾薬の種類・発射する武器などの変化による影響を受けるようになります。</Japanese>
<Korean>이 모듈은 고급 탄도학을 적용시킵니다 - 이는 발사체의 궤적이 기온, 대기압, 습도, 중력, 탄환의 종류와 어느 무기에서 발사되는지에 따라 영향을 받습니다.</Korean>
<Chinese>該模塊實現先進的彈道仿真 - 這意味著子彈的軌跡是由空氣溫度、大氣壓力、濕度、重力、彈藥類型以及射擊的武器所影響</Chinese>
<Chinesesimp>该模块实现增强的弹道模拟—子弹的轨迹由空气温度、大气压力、湿度、重力、弹药类型和射击的武器等变量所影响</Chinesesimp>

View File

@ -2,23 +2,6 @@
if (!hasInterface) exitWith {};
["baseline", {
private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0];
switch (stance ACE_player) do {
case ("CROUCH"): {
(1.0 + _fatigue ^ 2 * 0.1)
};
case ("PRONE"): {
(1.0 + _fatigue ^ 2 * 2.0)
};
default {
(1.5 + _fatigue ^ 2 * 3.0)
};
};
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
["multiplier", {GVAR(swayFactor)}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
// recheck weapon inertia after weapon swap, change of attachments or switching unit
["weapon", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler;
["loadout", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler;
@ -27,6 +10,21 @@ if (!hasInterface) exitWith {};
["CBA_settingsInitialized", {
if (!GVAR(enabled)) exitWith {};
["baseline", {
private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0];
switch (stance ACE_player) do {
case ("CROUCH"): {
(1.0 + _fatigue ^ 2 * 0.1)
};
case ("PRONE"): {
(1.0 + _fatigue ^ 2 * 2.0)
};
default {
(1.5 + _fatigue ^ 2 * 3.0)
};
};
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
// - Post process effect ------------------------------------------------------
GVAR(ppeBlackout) = ppEffectCreate ["ColorCorrections", 4220];
GVAR(ppeBlackout) ppEffectEnable true;
@ -48,7 +46,7 @@ if (!hasInterface) exitWith {};
}, true] call CBA_fnc_addPlayerEventHandler;
// - Duty factors -------------------------------------------------------------
if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
if (GVAR(medicalLoaded)) then {
[QEGVAR(medical,pain), { // 0->1.0, 0.5->1.05, 1->1.1
linearConversion [0, 1, (_this getVariable [QEGVAR(medical,pain), 0]), 1, 1.1, true];
}] call FUNC(addDutyFactor);
@ -56,7 +54,7 @@ if (!hasInterface) exitWith {};
linearConversion [6, 0, (_this getVariable [QEGVAR(medical,bloodVolume), 6]), 1, 2, true];
}] call FUNC(addDutyFactor);
};
if (["ACE_Dragging"] call EFUNC(common,isModLoaded)) then {
if (["ace_dragging"] call EFUNC(common,isModLoaded)) then {
[QEGVAR(dragging,isCarrying), {
[1, 3] select (_this getVariable [QEGVAR(dragging,isCarrying), false]);
}] call FUNC(addDutyFactor);

View File

@ -6,12 +6,13 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
#include "initSettings.sqf"
#include "initSettings.inc.sqf"
GVAR(staminaBarWidth) = 10 * (((safezoneW / safezoneH) min 1.2) / 40);
GVAR(dutyList) = createHashMap;
GVAR(setAnimExclusions) = [];
GVAR(inertia) = 0;
GVAR(inertiaCache) = createHashMap;
GVAR(medicalLoaded) = ["ace_medical"] call EFUNC(common,isModLoaded);
ADDON = true;

View File

@ -23,6 +23,12 @@ if (!alive ACE_player) exitWith {
_staminaBarContainer ctrlCommit 1;
};
private _oxygen = 0.9; // Default AF oxygen saturation
if (GVAR(medicalLoaded) && {EGVAR(medical_vitals,simulateSpo2)}) then {
_oxygen = (ACE_player getVariable [QEGVAR(medical,spo2), 97]) / 100;
};
private _currentWork = REE;
private _currentSpeed = (vectorMagnitude (velocity ACE_player)) min 6;
@ -42,8 +48,8 @@ GVAR(muscleDamage) = (GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.
private _muscleIntegritySqrt = sqrt (1 - GVAR(muscleDamage));
// Calculate available power
private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt;
private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt;
private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * _oxygen * _muscleIntegritySqrt;
private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * _oxygen * _muscleIntegritySqrt;
// Calculate how much power is consumed from each reserve
private _ae1Power = _currentWork min _ae1PathwayPowerFatigued;
@ -58,8 +64,8 @@ GVAR(anReserve) = GVAR(anReserve) - _anPower / WATTSPERATP;
GVAR(anFatigue) = GVAR(anFatigue) + _anPower * (0.057 / GVAR(peakPower)) * 1.1;
// Aerobic ATP reserve recovery
GVAR(ae1Reserve) = ((GVAR(ae1Reserve) + OXYGEN * 6.60 * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower) * GVAR(recoveryFactor)) min AE1_MAXRESERVE) max 0;
GVAR(ae2Reserve) = ((GVAR(ae2Reserve) + OXYGEN * 5.83 * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower) * GVAR(recoveryFactor)) min AE2_MAXRESERVE) max 0;
GVAR(ae1Reserve) = ((GVAR(ae1Reserve) + _oxygen * 6.60 * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower) * GVAR(recoveryFactor)) min AE1_MAXRESERVE) max 0;
GVAR(ae2Reserve) = ((GVAR(ae2Reserve) + _oxygen * 5.83 * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower) * GVAR(recoveryFactor)) min AE2_MAXRESERVE) max 0;
// Anaerobic ATP reserver and fatigue recovery
GVAR(anReserve) = ((GVAR(anReserve)
@ -70,9 +76,9 @@ GVAR(anFatigue) = ((GVAR(anFatigue)
- (_ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power) * (0.057 / GVAR(peakPower)) * GVAR(anFatigue) ^ 2 * GVAR(recoveryFactor)
) min 1) max 0;
private _aeReservePercentage = (GVAR(ae1Reserve) / AE1_MAXRESERVE + GVAR(ae2Reserve) / AE2_MAXRESERVE) / 2;
private _anReservePercentage = GVAR(anReserve) / AN_MAXRESERVE;
private _perceivedFatigue = 1 - (_anReservePercentage min _aeReservePercentage);
GVAR(aeReservePercentage) = (GVAR(ae1Reserve) / AE1_MAXRESERVE + GVAR(ae2Reserve) / AE2_MAXRESERVE) / 2;
GVAR(anReservePercentage) = GVAR(anReserve) / AN_MAXRESERVE;
private _perceivedFatigue = 1 - (GVAR(anReservePercentage) min GVAR(aeReservePercentage));
[ACE_player, _perceivedFatigue, _currentSpeed, GVAR(anReserve) == 0] call FUNC(handleEffects);

View File

@ -80,12 +80,3 @@
[0, 5, 1, 1],
true
] call CBA_fnc_addSetting;
[
QGVAR(swayFactor),
"SLIDER",
[LSTRING(SwayFactor), LSTRING(SwayFactor_Description)],
LSTRING(DisplayName),
[0, 5, 1, 1],
true
] call CBA_fnc_addSetting;

View File

@ -7,7 +7,7 @@
<German>ACE Erweiterte Ausdauer</German>
<Chinese>ACE 進階疲勞</Chinese>
<Chinesesimp>ACE 进阶体力</Chinesesimp>
<Japanese>ACE アドバンスド ファティーグ</Japanese>
<Japanese>ACE アドバンスド疲労</Japanese>
<Italian>ACE Fatica Avanzata</Italian>
<Korean>ACE 고급 피로도</Korean>
<French>ACE Fatigue avancée</French>
@ -41,10 +41,10 @@
<Polish>Wpływa na ogólną wydolność organizmu u wszystkich graczy bez ustawionego niestandardowego współczynnika. Więcej znaczy lepiej.</Polish>
<Korean>모든 성능이 임의로 설정된 값 없이 영향받습니다. 값이 클수록 더 나은 성능을 발휘합니다</Korean>
<French>Impacte la performance globale de tous les joueurs n'ayant pas de facteur personnalisé.\nPlus la valeur est élevée, plus le joueur est performant.</French>
<Italian>Influenza qualsiasi prestazione di tutti i giocatori smuniti di un fattore personalizzato. Maggiore significa migliore.</Italian>
<Italian>Influenza la prestazione generale di tutti i giocatori smuniti di un fattore personalizzato. Maggiore significa migliore.</Italian>
<Chinese>影響所有玩家的體力表現,值越高代表體力越好</Chinese>
<Chinesesimp>影响所有玩家的体力表现,值越高代表体力越好</Chinesesimp>
<Russian>Влияет на общую производительность игроков, у которых не задано персональное значение.</Russian>
<Russian>Влияет на общую производительность игроков, у которых не задано персональное значение. Чем выше, тем лучше.</Russian>
<Portuguese>Influencia na performance geral de todos os jogadores sem nenhum fator personalizado. Quanto maior, melhor.</Portuguese>
<Czech>Ovlivňuje celkový výkon všech hráčů bez vlastního faktoru. Vyšší znamená lépe.</Czech>
</Key>
@ -56,10 +56,10 @@
<Polish>Wpływa na ogólną wydolność tej jednostki. Więcej znaczy lepiej.</Polish>
<Korean>모든 성능이 이 단위로 영향을 받습니다. 값이 클수록 더 나은 성능을 발휘합니다</Korean>
<French>Impacte la performance globale de cette unité.\nPlus la valeur est élevée, plus l'unité est performante.</French>
<Italian>Influenza qualsiasi prestazione di questa unità. Maggiore significa migliore.</Italian>
<Italian>Influenza la prestazione personalizzata di questa unità. Maggiore significa migliore.</Italian>
<Chinese>影響這個單位的體力表現,值越高代表體力越好</Chinese>
<Chinesesimp>影响这个单位的体力表现,值越高代表体力越好</Chinesesimp>
<Russian>Влияет на общую производительность юнита.</Russian>
<Russian>Влияет на общую производительность юнита.Чем выше, тем лучше.</Russian>
<Portuguese>Influencia na performance geral dessa unidade. Quanto maior, melhor.</Portuguese>
<Czech>Ovlivňuje celkový výkon této jednotky. Vyšší znamená lépe.</Czech>
</Key>
@ -87,7 +87,7 @@
<Polish>Wpływa na czas regeneracji podczas postoju. Więcej znaczy szybciej.</Polish>
<Korean>얼마나 빨리 회복하는지를 바꿉니다. 값이 클수록 더 나은 성능을 발휘합니다</Korean>
<French>Modifie la vitesse à laquelle le joueur récupère lorsqu'il se repose.\nPlus la valeur est élevée, plus la récupération est rapide.</French>
<Italian>Determina in quanto tempo il giocatore recupera quando rilassato. Maggiore significa migliore.</Italian>
<Italian>Determina quanto velocemente il giocatore recupera le energie quando si ferma. Maggiore significa migliore.</Italian>
<Chinese>決定玩家休息多久就能回復體力,值越高恢復越快</Chinese>
<Chinesesimp>决定玩家休息多久就能恢复体力,值越高恢复越快</Chinesesimp>
<Russian>Изменяет скорость восстановления игрока во время отдыха. Чем выше, тем быстрее.</Russian>
@ -102,7 +102,7 @@
<Polish>Współczynnik masy ekwipunku</Polish>
<Korean>부담 요인</Korean>
<French>Facteur de charge</French>
<Italian>Fattore Caricamento</Italian>
<Italian>Fattore Carico</Italian>
<Chinese>負重量</Chinese>
<Chinesesimp>重量系数</Chinesesimp>
<Russian>Фактор нагрузки</Russian>
@ -117,7 +117,7 @@
<Polish>Zmniejsza lub zwiększa wpływ ciężaru ekwipunku na wydolność gracza. Zero oznacza kompletny brak wpływu na wydolność.</Polish>
<Korean>플레이어가 무게에 따라 얼마나 영향받는지를 증가시키거나 감소시킵니다. 0의 경우 플레이어가 장비 무게에 영향받지 않습니다.</Korean>
<French>Augmente ou diminue l'influence du poids sur les performances du joueur.\nUne valeur nulle indique que le poids de l'équipement n'a aucun impact sur les performances.</French>
<Italian>Incrementa o decrementa quanto il peso influenza le prestazioni dei giocatori. Zero significa che il peso dell'equipaggiamento non ha alcuna influenza nelle prestazioni.</Italian>
<Italian>Determina quanto il peso trasportato influenza le prestazioni dei giocatori. Zero significa che il peso dell'equipaggiamento non influisce sulle prestazioni.</Italian>
<Chinese>增加或降低玩家所能承受的負重量. 如設定值為0, 代表裝備的重量將不會影響到玩家的體力表現</Chinese>
<Chinesesimp>增加或降低玩家所能承受的负重量。如设定值为0代表装备的重量将不会影响到玩家的体力表现</Chinesesimp>
<Russian>Увеличивает или уменьшает вес, влияющий на производительность игроков. Ноль означает, что вес снаряжения не влияет на производительность</Russian>
@ -147,52 +147,22 @@
<Polish>Wpływa na to w jakim stopniu stromy teren wpływa na utratę wytrzymałości. Więcej oznacza szybszą utratę wytrzymałości.</Polish>
<Korean>경사도에 따라 얼마나 피로해지는지를 정합니다. 값이 클수록 더 많은 피로를 유발합니다.</Korean>
<French>Définit à quel point un terrain escarpé réduit l'endurance du joueur.\nPlus la valeur est élevée, moins le joueur est endurant.</French>
<Italian>Stabilisce quanto la pendenza del terreno incrementa la perdita della stamina. Maggiore significa più stamina persa.</Italian>
<Italian>Determina quanto la pendenza del terreno incrementa la perdita della stamina. Maggiore significa più stamina persa.</Italian>
<Chinese>設定陡峭的地形將會影響多少體力的流失,值越高代表體力流失越快</Chinese>
<Chinesesimp>设定陡峭的地形将会影响多少体力的流失速度,值越高代表体力流失越快</Chinesesimp>
<Russian>Устанавливает, насколько крутая местность увеличивает потерю выносливости. Чем выше, тем быстрее теряется выносливость.</Russian>
<Portuguese>Define o quanto que um terreno íngrime aumenta na perda de estamina. Quanto maior, maior a perda de estamina.</Portuguese>
<Czech>Nastavuje, o kolik strmý terén zvyšuje ztrátu výdrže. Vyšší znamená vyšší ztrátu výdrže.</Czech>
</Key>
<Key ID="STR_ACE_Advanced_Fatigue_SwayFactor">
<English>Sway factor</English>
<Spanish>Factor de balanceo de mira</Spanish>
<German>Verwacklungsfaktor</German>
<Japanese>手ぶれ因数</Japanese>
<Chinesesimp>抖动系数</Chinesesimp>
<Chinese>抖動因素</Chinese>
<French>Facteur de tremblement</French>
<Italian>Fattore di oscillazione</Italian>
<Polish>Czynnik kołysania</Polish>
<Russian>Фактор колебания прицела</Russian>
<Portuguese>Fator de Balanço de Mira</Portuguese>
<Czech>Faktor kývání</Czech>
<Korean>손떨림 정도</Korean>
</Key>
<Key ID="STR_ACE_Advanced_Fatigue_SwayFactor_Description">
<English>Influences the amount of weapon sway. Higher means more sway.</English>
<Spanish>Afecta al la estabilidad de la mira. Más alto significa más balanceo</Spanish>
<German>Beeinflusst den Faktor, wie ruhig man eine Waffe halten kann. Ein höherer Wert bedeutet weniger Stabilisierung</German>
<Japanese>武器を持つ手のぶれ度合いを設定します。 値が高ければ高いほど、手ぶれが強くなります。</Japanese>
<Chinesesimp>影响手持武器的晃动程度,数值越高,抖动的越厉害。</Chinesesimp>
<Chinese>影響手持武器晃動程度,數值越高抖動越厲害</Chinese>
<French>Influe sur l'amplitude du tremblement de l'arme. Une valeur plus élevée signifie plus de tremblement.</French>
<Italian>Influenza l'ammontare di oscillazione dell'arma. Maggiore significa più oscillazione.</Italian>
<Polish>Wpływa na poziom kołysania broni. Większa ilość znaczy większe kołysanie.</Polish>
<Russian>Влияет на колебания прицела оружия. Чем выше - тем больше.</Russian>
<Portuguese>Influencia a quantidade de balanço da mira da arma. Quanto maior, mais balanço.</Portuguese>
<Czech>Ovlivňuje množství kývání zbraní. Vyšší znamená více kývání.</Czech>
<Korean>손떨림의 정도를 정합니다. 높을 수록 많이 휘적입니다.</Korean>
</Key>
<Key ID="STR_ACE_Advanced_Fatigue_Enabled">
<English>Enabled</English>
<Spanish>Activada</Spanish>
<German>Aktiv</German>
<Japanese>アドバンスド ファティーグを有効化</Japanese>
<Japanese>有効化</Japanese>
<Polish>Włączone</Polish>
<Korean>활성화</Korean>
<French>Activé</French>
<Italian>Abilitato</Italian>
<Italian>Abilitata</Italian>
<Chinese>啟用</Chinese>
<Chinesesimp>启用</Chinesesimp>
<Russian>Включена</Russian>
@ -203,14 +173,14 @@
<English>Enables/disables Advanced Fatigue.</English>
<Spanish>Activa/desactiva la fatiga avanzada</Spanish>
<German>Aktiviert/deaktiviert Advanced Fatigue.</German>
<Japanese>アドバンスド ファティーグを有効化します。</Japanese>
<Japanese>アドバンスド疲労は高度な疲労管理システムを有効化します。</Japanese>
<Polish>Włącza/wyłącza zaawansowaną wytrzymałość</Polish>
<Korean>고급 피로도 활성화/비활성화</Korean>
<French>Active/Désactive la fatigue avancée.</French>
<Italian>Abilita/disabilita la Fatica Avanzata.</Italian>
<Italian>Abilita/Disabilita la Fatica Avanzata.</Italian>
<Chinese>啟用/關閉進階體力.</Chinese>
<Chinesesimp>启用/关闭进阶体力。</Chinesesimp>
<Russian>Включает / Отключает Продвинутую усталость</Russian>
<Russian>Включает/отключает Продвинутую усталость</Russian>
<Portuguese>Ativa/Desativa Fadiga Avançada.</Portuguese>
<Czech>Aktivuje / deaktivuje Pokročilou únavu.</Czech>
</Key>
@ -251,7 +221,7 @@
<German>Blende Ausdauerleiste automatisch aus</German>
<Chinese>體力條自動淡去</Chinese>
<Chinesesimp>自动淡化体力条</Chinesesimp>
<Italian>Dissolvenza automatica della barra della stamina</Italian>
<Italian>Nascondi in automatico la barra della stamina</Italian>
<Czech>Automaticky schovat lištu výdrže</Czech>
<French>Fondu automatique de la barre d'endurance</French>
<Japanese>自動的にスタミナバーを非表示</Japanese>

View File

@ -1,20 +1,23 @@
#include "script_component.hpp"
// Fired XEH
[QGVAR(throwFiredXEH), FUNC(throwFiredXEH)] call CBA_fnc_addEventHandler;
GVAR(ammoEventHandlers) = createHashMap;
[QGVAR(throwFiredXEH), LINKFUNC(throwFiredXEH)] call CBA_fnc_addEventHandler;
// Exit on HC
if (!hasInterface) exitWith {};
// Temporary Wind Info indication
GVAR(tempWindInfo) = false;
// Ammo/Magazines look-up hash for correctness of initSpeed
GVAR(ammoMagLookup) = call CBA_fnc_createNamespace;
{
{
private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo");
if (_ammo != "") then { GVAR(ammoMagLookup) setVariable [_ammo, _x]; };
} count (getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"));
nil
} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
} forEach (getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"));
} forEach getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
// Add keybinds

View File

@ -6,6 +6,6 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
#include "initSettings.sqf"
#include "initSettings.inc.sqf"
ADDON = true;

View File

@ -19,7 +19,7 @@ params ["_unit"];
if !(_unit getVariable [QGVAR(inHand), false]) exitWith {false};
if (vehicle _unit != _unit) exitWith {
if (!isNull objectParent _unit) exitWith {
private _startPos = eyePos _unit;
private _aimLinePos = AGLToASL (positionCameraToWorld [0, 0, 1]);
private _intersections = lineIntersectsSurfaces [_startPos, _aimLinePos, _unit, objNull, false];

View File

@ -53,6 +53,12 @@ _unit setVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT];
// Remove controls hint (check if ever enabled is inside the function)
call EFUNC(interaction,hideMouseHint);
// Hide wind info after throw, if it was temporarily enabled for the throw
if (GVAR(tempWindInfo)) then {
EGVAR(weather,WindInfo) = false;
GVAR(tempWindInfo) = false;
};
// Remove throw action
[_unit, "DefaultAction", _unit getVariable [QGVAR(throwAction), -1]] call EFUNC(common,removeActionEventHandler);

View File

@ -17,9 +17,9 @@
params ["_magazineClassname"];
_magazineClassname = toLower _magazineClassname;
_magazineClassname = toLowerANSI _magazineClassname;
private _throwMuzzles = getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
_throwMuzzles = _throwMuzzles select {_magazineClassname in ((getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines")) apply {toLower _x})};
_throwMuzzles = _throwMuzzles select {_magazineClassname in ((getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines")) apply {toLowerANSI _x})};
[_throwMuzzles select 0, ""] select (_throwMuzzles isEqualTo [])

View File

@ -18,6 +18,15 @@
params ["_unit"];
TRACE_1("params",_unit);
// Temporarily enable wind info, to aid in throwing smoke grenades effectively
if (
GVAR(enableTempWindInfo) &&
{!(missionNamespace getVariable [QEGVAR(weather,WindInfo), false])}
) then {
[] call EFUNC(weather,displayWindInfo);
GVAR(tempWindInfo) = true;
};
// Select next throwable if one already in hand
if (_unit getVariable [QGVAR(inHand), false]) exitWith {
TRACE_1("inHand",_unit);

View File

@ -44,8 +44,7 @@
_addedPickUpHelpers pushBack _pickUpHelper;
_throwablesHelped pushBack _x;
};
nil
} count _nearThrowables;
} forEach _nearThrowables;
_args set [0, getPosASL ACE_player];
_args set [3, _nearThrowables];
@ -56,11 +55,10 @@
{
// Only handling with attachTo works nicely
_x attachTo [_x getVariable [QGVAR(throwable), objNull], [0, 0, 0]];
nil
} count _addedPickUpHelpers;
} forEach _addedPickUpHelpers;
} else {
TRACE_1("Cleaning Pick Up Helpers",count _addedPickUpHelpers);
{deleteVehicle _x} count _addedPickUpHelpers;
{deleteVehicle _x} forEach _addedPickUpHelpers;
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
}, 0, [(getPosASL ACE_player) vectorAdd [-100, 0, 0], [], [], []]] call CBA_fnc_addPerFrameHandler;

View File

@ -45,7 +45,7 @@ if (!(_unit getVariable [QGVAR(primed), false])) then {
private _newVelocity = (_p1 vectorFromTo _p2) vectorMultiply _velocity;
// Adjust for throwing from inside vehicles, where we have a vehicle-based velocity that can't be compensated for by a human
if (vehicle _unit != _unit) then {
if (!isNull objectParent _unit) then {
_newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit));
};

View File

@ -20,14 +20,25 @@
*
* Public: No
*/
params ["_unit", "", "_muzzle", "", "_ammo"];
TRACE_1("Fired",_this);
{
_this call _x;
} forEach ((_this select 0) getVariable "cba_xeh_fired");
} forEach (_unit getVariable "cba_xeh_fired");
// Call muzzle fired EH
{
_this call compile getText (_x >> "fired");
} forEach (configProperties [configFile >> "CfgWeapons" >> "Throw" >> (_this select 2) >> "EventHandlers", "isClass _x", true]);
} forEach (configProperties [configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "EventHandlers", "isClass _x", true]);
// Call ammo fired EH
{ _this call _x } forEach (GVAR(ammoEventHandlers) getOrDefaultCall [_ammo, {
private _cfg = configFile >> "CfgAmmo" >> _ammo >> "EventHandlers";
private _eventHandlers = [];
{
private _eh = getText (_x >> "fired");
if (_eh != "") then { _eventHandlers pushBack compile _eh };
} forEach ([_cfg] + configProperties [_cfg, "isClass _x", true]);
_eventHandlers
}, true]);

View File

@ -40,3 +40,11 @@ private _category = format ["ACE %1", localize LSTRING(Category)];
true,
1
] call CBA_fnc_addSetting;
[
QGVAR(enableTempWindInfo), "CHECKBOX",
[LSTRING(EnableTempWindInfo_DisplayName), LSTRING(EnableTempWindInfo_Description)],
_category,
true,
0
] call CBA_fnc_addSetting;

View File

@ -5,7 +5,7 @@
<English>Advanced Throwing</English>
<Spanish>Lanzamiento Avanzado</Spanish>
<Russian>Улучшенный бросок гранат</Russian>
<Japanese>アドバンスド スローイング</Japanese>
<Japanese>アドバンスド投擲</Japanese>
<Polish>Zaawansowane rzucanie</Polish>
<German>Erweitertes Wurfsystem</German>
<Korean>고급 투척</Korean>
@ -21,7 +21,7 @@
<English>Allows changing advanced throwing behaviour.</English>
<Spanish>Permite modificar el comportamiento del lanzamiento avanzado</Spanish>
<Russian>Позволяет настраивать поведение улучшенного броска гранат.</Russian>
<Japanese>アドバンスド スローイングの動作挙動を変更します。</Japanese>
<Japanese>アドバンスド投擲は投擲の高度な動作挙動を変更可能にします。</Japanese>
<Polish>Zezwala na zmianę zachowania zaawansowanego trybu rzucania.</Polish>
<German>Erlaubt es, das Verhalten des erweiterten Wurfsystems zu ändern.</German>
<Korean>고급 투척 행위를 허가합니다</Korean>
@ -36,7 +36,7 @@
<English>Enable Advanced Throwing</English>
<Spanish>Activar Lanzamiento Avanzado</Spanish>
<Russian>Вкл. улучшенный бросок</Russian>
<Japanese>アドバンスド スローイングを有効化</Japanese>
<Japanese>アドバンスド投擲を有効化</Japanese>
<Polish>Aktywuj zaawansowane rzucanie</Polish>
<German>Aktiviere erweitertes Wurfsystem</German>
<Korean>고급 투척 활성화 </Korean>
@ -52,7 +52,7 @@
<English>Enables advanced throwing system.</English>
<Spanish>Activa el Lanzamiento Avanzado</Spanish>
<Russian>Включает систему улучшенного броска.</Russian>
<Japanese>アドバンスド スローイングを有効化します。</Japanese>
<Japanese>アドバンスド投擲は高度な投擲システムを有効化します。</Japanese>
<Polish>Aktywuje system zaawansowanego rzucania.</Polish>
<German>Aktiviert das erweiterte Wurfsystem.</German>
<Korean>고급 투척을 활성화 합니다</Korean>
@ -68,7 +68,7 @@
<English>Show Throw Arc</English>
<Spanish>Mostrar Arco de Lanzamiento</Spanish>
<Russian>Показать траекторию броска</Russian>
<Japanese>てき軌道を表示</Japanese>
<Japanese>軌道を表示</Japanese>
<Polish>Pokaż trasę lotu</Polish>
<German>Zeige Wurfbogen</German>
<Korean>투척 궤적 표시</Korean>
@ -84,7 +84,7 @@
<English>Enables visualization of the throw arc (where throwable will fly).</English>
<Spanish>Activa la visualización del arco de lanzamiento (donde irá el objeto lanzado)</Spanish>
<Russian>Включает визуализацию траектории броска (как полетит граната).</Russian>
<Japanese>てき軌道 (投てき物がどこに飛ぶか) の表示を有効化します。</Japanese>
<Japanese>擲軌道 (投擲物がどこに飛ぶか) の表示を有効化します。</Japanese>
<Polish>Wyświetla wizualizację trasy przelotu granatu.</Polish>
<German>Aktiviert die Visualisierung des Wurfbogens (wohin das Objekt geworfen werden wird).</German>
<Korean>투척 궤도를 시각화 합니다(투척물이 어디로 갈지)</Korean>
@ -99,12 +99,12 @@
<English>Show Throwing Mouse Controls</English>
<Spanish>Mostrar controles de ratón de lanzamiento</Spanish>
<Russian>Показывать управление мышью</Russian>
<Japanese>てきのマウス操作を表示</Japanese>
<Japanese>のマウス操作を表示</Japanese>
<Polish>Pokaż podpowiedzi sterowania myszą</Polish>
<German>Zeige Maussteuerung beim Werfen</German>
<Korean>마우스 조작 표시</Korean>
<French>Afficher les contrôles à la souris du lancé</French>
<Italian>Mostra Comandi Mouse Lancio</Italian>
<Italian>Mostra Comandi Mouse di Lancio</Italian>
<Chinese>顯示滑鼠投擲控制提示</Chinese>
<Chinesesimp>显示鼠标投掷控制提示</Chinesesimp>
<Portuguese>Mostrar os controles de mouse para Arremesso</Portuguese>
@ -114,7 +114,7 @@
<English>Enables visual cues for mouse controls when throwable is prepared.</English>
<Spanish>Activa muestras visuales para los controles del ratón cuando el objeto lanzable está preparado</Spanish>
<Russian>Включает отображение подсказок по управлению мышью, когда граната подготовлена.</Russian>
<Japanese>てき物を構える時、マウス操作の説明表示を有効化します。</Japanese>
<Japanese>物を構える時、マウス操作の説明表示を有効化します。</Japanese>
<Polish>Wyświetla podpowiedzi sterowania myszą kiedy obiekt miotany jest w ręku.</Polish>
<German>Aktiviert visuelle Hinweise zur Maussteuerung, wenn ein Objekt zum Werfen vorbereitet wird.</German>
<Korean>투척물을 준비시 마우스 조작을 시각화해서 보여줍니다</Korean>
@ -129,12 +129,12 @@
<English>Enable Throwables Pick Up</English>
<Spanish>Habilitar recoger objetos lanzados</Spanish>
<Russian>Вкл. подбор гранат</Russian>
<Japanese>てき物の拾い上げを有効化</Japanese>
<Japanese>物の拾い上げを有効化</Japanese>
<Polish>Zezwól na podnoszenie obiektów miotanych</Polish>
<German>Aktiviere Aufheben von Wurfobjekten</German>
<Korean>투척물 줍기 활성화</Korean>
<French>Permettre le ramassage d'objets lançables</French>
<Italian>Abilita Raccogli Oggetti</Italian>
<Italian>Abilita Raccolta Lanciabili</Italian>
<Chinese>啟用可撿取地面投擲物</Chinese>
<Chinesesimp>启用捡取地面投掷物</Chinesesimp>
<Portuguese>Permitir pegar arremessáveis</Portuguese>
@ -144,12 +144,12 @@
<English>Enables ability to pick up throwables from the ground.</English>
<Spanish>Activa la habilidad de coger objetos lanzados del suelo</Spanish>
<Russian>Включает возможность подбирать гранаты с земли.</Russian>
<Japanese>地面に落ちている投てき物を拾い上げる機能を有効化します。</Japanese>
<Japanese>地面に落ちている投物を拾い上げる機能を有効化します。</Japanese>
<Polish>Umożliwia podnoszenie obiektów miotanych z ziemi.</Polish>
<German>Aktiviert die Möglichkeit, geworfene Objekte wieder vom Boden aufzuheben.</German>
<Korean>땅에 떨어진 투척물을 주울 수 있게 해줍니다.</Korean>
<French>Active la possibilité de ramasser des objets lançables du sol.</French>
<Italian>Abilita la possibilità di raccogliere un oggetto lanciabile da terra.</Italian>
<Italian>Permette ai giocatori di raccogliere un oggetto lanciabile da terra.</Italian>
<Chinese>啟用後, 可撿取地面上的投擲物</Chinese>
<Chinesesimp>启用后,可捡取地面上的投掷物</Chinesesimp>
<Portuguese>Permite que objetos arremessados sejam pegos do chão. (ACE Menu de Interação)</Portuguese>
@ -159,12 +159,12 @@
<English>Enable Attached Throwables Pick Up</English>
<Spanish>Activar coger objetos lanzables que se enganchan</Spanish>
<Russian>Вкл. подбор прикрепленных гранат</Russian>
<Japanese>取り付けられた投てき物の拾い上げを有効化</Japanese>
<Japanese>装着済の投擲物の拾い上げを有効化</Japanese>
<Polish>Zezwól na podnoszenie przyczepionych obiektów miotanych</Polish>
<German>Aktiviere erneute Aufnahme befestigter Wurfobjekte</German>
<Korean>부착 투척물 줍기 활성화</Korean>
<French>Activer le ramassage d'objets lançables attachés</French>
<Italian>Abilita Raccogli Oggetti Lanciabili da altri Oggetti</Italian>
<Italian>Abilita Raccolta Lanciabili Attaccati</Italian>
<Chinese>啟用可撿取附著投擲物</Chinese>
<Chinesesimp>启用捡取附着投掷物</Chinesesimp>
<Portuguese>Permitir pegar arremessáveis fixados</Portuguese>
@ -174,27 +174,45 @@
<English>Enables ability to pick up throwables from attached objects.</English>
<Spanish>Activa la habilidad de lanzar objetos enganchados</Spanish>
<Russian>Включает возможность подбирать гранаты, прикрепленные к объектам.</Russian>
<Japanese>取り付けられた投てき物を拾い上げる機能を有効化します。</Japanese>
<Japanese>オブジェクトに装着された投擲可能物を拾い上げる機能を有効化します。</Japanese>
<Polish>Umożliwia podnoszenie obiektów miotanych przyczepionych do innych obiektów.</Polish>
<German>Aktiviert die Möglichkeit, befestigte Wurfobjekte erneut aufzunehmen.</German>
<Korean>부착된 투척물을 주울 수 있게 해줍니다.</Korean>
<French>Active la possibilité de ramasser des objets lançables attachés à d'autres objets.</French>
<Italian>Abilita la possibilità di raccogliere gli oggetti lanciabili dagli altri oggetti. </Italian>
<Italian>Permette ai giocatori di raccogliere gli oggetti lanciabili da altri oggetti attaccati.</Italian>
<Chinese>啟用後, 可撿取附著在物件上的投擲物</Chinese>
<Chinesesimp>启用后,可捡取附着在物体上的投掷物</Chinesesimp>
<Portuguese>Permite que arremessáveis fixados em objetos sejam pegos.</Portuguese>
<Czech>Zapíná schopnost zvednutí předmětů z objektů ke kterým jsou připnuté.</Czech>
</Key>
<Key ID="STR_ACE_Advanced_Throwing_EnableTempWindInfo_DisplayName">
<English>Show Temporary Wind Info</English>
<German>Zeige temporäre Windinformationen</German>
<Italian>Mostra informazioni sul vento temporaneamente</Italian>
<Japanese>一時的に風の情報を表示</Japanese>
<Korean>바람 정보 임시로 표시</Korean>
<French>Afficher temporairement les informations sur le vent</French>
<Russian>Временно показать информацию о ветре</Russian>
</Key>
<Key ID="STR_ACE_Advanced_Throwing_EnableTempWindInfo_Description">
<English>Temporarily display Wind Info while throwing, to aid in placing smoke grenades effectively.</English>
<German>Zeige während des werfens Windinformationen an, um Rauchgranaten effektiver zu platzieren.</German>
<Italian>Mostra le informazioni sul vento durante il lancio di granate, facilitando il piazzamento ottimale di fumogeni.</Italian>
<Japanese>投擲行動中に風向きの情報を一時的に表示し、発煙手榴弾の煙幕を効果的に展開しやすくします。</Japanese>
<Korean>연막탄을 효과적으로 배치하는 데 도움이 되도록 투척하는 동안 일시적으로 바람 정보를 표시합니다.</Korean>
<French>Affiche les informations sur le vent pendant le lancement pour placer les grenades fumigènes plus efficacement.</French>
<Russian>Временно отображайте информацию о ветре во время броска, чтобы помочь эффективно разместить дымовые шашки.</Russian>
</Key>
<Key ID="STR_ACE_Advanced_Throwing_Prepare">
<English>Prepare/Change Throwable</English>
<Spanish>Preparar/Cambiar objetos lanzables</Spanish>
<Russian>Подготовить/заменить гранату</Russian>
<Japanese>投てき物の準備/変更</Japanese>
<Japanese>物の準備/変更</Japanese>
<Polish>Przygotuj/zmień ob. miotany</Polish>
<German>Wurfobjekt vorbereiten/wechseln</German>
<Korean>투척물 준비/변경</Korean>
<French>Préparer/Changer d'objet lançable</French>
<Italian>Prepara/Cambia Oggetto lanciabile</Italian>
<Italian>Prepara/Cambia Oggetto Lanciabile</Italian>
<Chinese>準備/變更投擲物</Chinese>
<Chinesesimp>准备/变更投掷物</Chinesesimp>
<Portuguese>Preparar/Mudar Arremessável</Portuguese>
@ -204,12 +222,12 @@
<English>Throwable Drop Mode (Hold)</English>
<Spanish>Modo soltar objeto lanzable (Mantener pulsado)</Spanish>
<Russian>Режим броска гранаты (удерживать)</Russian>
<Japanese>てきモード (押している間)</Japanese>
<Japanese>モード (押している間)</Japanese>
<Polish>Tryb upuszczania ob. miotanego (przytrzymaj)</Polish>
<German>Wurfobjekt Fallmodus (halten)</German>
<Korean>투척물 떨어뜨리기 모드(꾹눌러서)</Korean>
<French>Mode de lancé de l'objet (Tenir)</French>
<Italian>Modalità Oggetto Gettabile (Mantenere)</Italian>
<Italian>Modalità Gettare (Tieni premuto)</Italian>
<Chinese>投擲模式 (按住)</Chinese>
<Chinesesimp>投掷模式(按住)</Chinesesimp>
<Portuguese>Modo de Arremesso (Segurar)</Portuguese>
@ -219,12 +237,12 @@
<English>Throwable Drop Mode (Toggle)</English>
<Spanish>Modo soltar objeto lanzable (interruptor)</Spanish>
<Russian>Режим броска гранаты (переключить)</Russian>
<Japanese>てきモード (切り替え)</Japanese>
<Japanese>モード (切り替え)</Japanese>
<Polish>Tryb upuszczania ob. miotanego (przełącz)</Polish>
<German>Wurfobjekt Fallmodus (umschalten)</German>
<Korean>투척물 떨어뜨리기 모드(토글)</Korean>
<French>Mode de lancé de l'objet (Basculer)</French>
<Italian>Modalità Oggetto lanciabile Gettabile (Interruttore)</Italian>
<Italian>Modalità Getta Oggetto (Cambia)</Italian>
<Chinese>投擲模式 (切換)</Chinese>
<Chinesesimp>投掷模式(切换)</Chinesesimp>
<Portuguese>Modo de Arremesso (Alternar)</Portuguese>
@ -239,7 +257,7 @@
<German>Scharf gemacht</German>
<Korean>뇌관 작동</Korean>
<French>amorcée</French>
<Italian>Armato</Italian>
<Italian>Innescato</Italian>
<Chinese>引信開始燃燒</Chinese>
<Chinesesimp>已开引信</Chinesesimp>
<Portuguese>Preparado</Portuguese>
@ -254,7 +272,7 @@
<German>Werfen</German>
<Korean>던지기</Korean>
<French>Lancer</French>
<Italian>Lanciare</Italian>
<Italian>Lancia</Italian>
<Chinese>投擲</Chinese>
<Chinesesimp>投掷</Chinesesimp>
<Portuguese>Arremessar</Portuguese>
@ -270,7 +288,7 @@
<German>(Scrollen) Modus wechseln</German>
<Korean>(마우스 휠) 모드 변경</Korean>
<French>(Défilement) Changer de mode</French>
<Italian>(Scorrere) Cambio Modalità</Italian>
<Italian>(Scorri) Cambia Modalità</Italian>
<Chinese>(滾輪) 變更模式</Chinese>
<Chinesesimp>(滚轮)变更模式</Chinesesimp>
<Portuguese>(Roda do Mouse) Alternar modo</Portuguese>
@ -286,10 +304,10 @@
<German>(Scrollen) Erweitern</German>
<Korean>(마우스 휠) 연장</Korean>
<French>(Défilement) Étendre</French>
<Italian>(Scorrere) Estendere</Italian>
<Italian>(Scorri) Estendi</Italian>
<Chinese>(滾輪) 延長</Chinese>
<Chinesesimp>(滚轮)延长</Chinesesimp>
<Portuguese>(Roda do Mouse) Extender</Portuguese>
<Portuguese>(Roda do Mouse) Estender</Portuguese>
<Czech>(Scrollovat) Oddálit</Czech>
<Turkish>(Tekerlek) Uzat</Turkish>
</Key>
@ -302,7 +320,7 @@
<German>(Klicken) Abkochen</German>
<Korean>(클릭) 예열</Korean>
<French>(Clique) Dégoupiller</French>
<Italian>(Click) Arma</Italian>
<Italian>(Click) Innesca</Italian>
<Chinese>(點擊) 提早拉開引信</Chinese>
<Chinesesimp>(点击)提早拉开引信</Chinesesimp>
<Portuguese>(Clique) Cozinhar</Portuguese>
@ -313,7 +331,7 @@
<English>Pick Up</English>
<Spanish>Coger</Spanish>
<Russian>Подобрать</Russian>
<Japanese>い上げる</Japanese>
<Japanese></Japanese>
<Polish>Podnieś</Polish>
<German>Aufheben</German>
<Korean>줍기</Korean>

View File

@ -16,7 +16,7 @@
} forEach _sections;
}] call CBA_fnc_addEventHandler;
[QGVAR(unGarrison), FUNC(unGarrison)] call CBA_fnc_addEventHandler;
[QGVAR(unGarrison), LINKFUNC(unGarrison)] call CBA_fnc_addEventHandler;
[QGVAR(doMove), {
params ["_unitsArray"];
@ -73,6 +73,6 @@
if (isServer) then {
["CAManBase", "init", {
// wait for HMD to be assigned so `hmd _unit` works
[FUNC(assignNVG), _this, 1] call CBA_fnc_waitAndExecute;
[LINKFUNC(assignNVG), _this, 1] call CBA_fnc_waitAndExecute;
}] call CBA_fnc_addClassEventHandler;
};

View File

@ -11,6 +11,6 @@ if (isServer) then {
GVAR(assignNVGstate) = false;
};
#include "initSettings.sqf"
#include "initSettings.inc.sqf"
ADDON = true;

View File

@ -7,8 +7,8 @@
* 0: The building(s) nearest this position are used <POSITION>
* 1: Limit the building search to those type of building <ARRAY>
* 2: Units that will be garrisoned <ARRAY>
* 3: Radius to fill building(s) <SCALAR> (default: 50)
* 4: 0: even filling, 1: building by building, 2: random filling <SCALAR> (default: 0)
* 3: Radius to fill building(s) <NUMBER> (default: 50)
* 4: 0: even filling, 1: building by building, 2: random filling <NUMBER> (default: 0)
* 5: True to fill building(s) from top to bottom <BOOL> (default: false) (note: only works with filling mode 0 and 1)
* 6: Teleport units <BOOL> (default: false)
@ -33,7 +33,7 @@ if (_startingPos isEqualTo [0,0,0]) exitWith {
[LSTRING(GarrisonInvalidPosition)] call EFUNC(common,displayTextStructured);
};
if (count _unitsArray == 0 || {isNull (_unitsArray select 0)}) exitWith {
if (_unitsArray isEqualTo [] || {isNull (_unitsArray select 0)}) exitWith {
TRACE_1("fnc_garrison: Units error",_unitsArray);
[LSTRING(GarrisonNoUnits)] call EFUNC(common,displayTextStructured);
};
@ -43,7 +43,7 @@ if (_fillingRadius >= 50) then {
_buildings = [_buildings] call CBA_fnc_shuffle;
};
if (count _buildings == 0) exitWith {
if (_buildings isEqualTo []) exitWith {
TRACE_1("fnc_garrison: Building error",_buildings);
[LSTRING(GarrisonNoBuilding)] call EFUNC(common,displayTextStructured);
};
@ -128,7 +128,7 @@ switch (_fillingType) do {
} 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)]);
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)]);
@ -177,7 +177,7 @@ switch (_fillingType) do {
} 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)]);
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)]);
@ -224,7 +224,7 @@ switch (_fillingType) do {
} 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)]);
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)]);
@ -258,7 +258,7 @@ switch (_fillingType) do {
};
};
TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)], _teleport);
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), []];
@ -279,5 +279,5 @@ if (_teleport) then {
[_unitMoveList] call FUNC(garrisonMove);
};
TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left", count _unitsArray, count _buildingsIndex)], _unitsArray);
TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left",count _unitsArray,count _buildingsIndex)],_unitsArray);
_unitsArray

View File

@ -81,13 +81,13 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then {
[QGVAR(enableAttack), [[_unit], true], _unit] call CBA_fnc_targetEvent;
};
LOG(format [ARR_2("garrisonMove PFH: unit in position | %1 units left", count _unitMoveList)]);
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)]);
LOG(format [ARR_2("garrisonMove PFH: unit dead, deleted or garrisoned via TP | %1 units left",count _unitMoveList)]);
} else {
private _unitPos = getPos _unit;

View File

@ -28,7 +28,7 @@ _units = _units select {local _x};
private _leader = leader _unit;
TRACE_3("fnc_ungarrison: unit and leader",_unit , _leader, (_leader == _unit));
TRACE_3("fnc_ungarrison: unit and leader",_unit,_leader,(_leader == _unit));
_unit setVariable [QGVAR(garrisonned), false, true];

View File

@ -6,7 +6,7 @@
<Chinese>AI</Chinese>
<French>IA</French>
<Spanish>IA</Spanish>
<Italian>AI</Italian>
<Italian>IA</Italian>
<Polish>SI</Polish>
<Russian>ИИ</Russian>
<German>KI</German>
@ -85,13 +85,23 @@
<English>Auto-Equip NVGs</English>
<Polish>Automatyczne zakładanie NVG</Polish>
<German>Automatisch NVGs ausrüsten</German>
<Italian>Equipaggia NVG in automatico</Italian>
<Korean>야투경 자동 창착</Korean>
<French>Equipement JVN automatique</French>
<Portuguese>Equipar NVGs automaticamente</Portuguese>
<Japanese>暗視装置の自動装備</Japanese>
<Russian>Автоматическое оснащение ПНВ</Russian>
</Key>
<Key ID="STR_ACE_AI_AssignNVG_Description">
<English>Equips NVG in inventory during night time and unequips it during day time.\nDoes not add NVGs to inventory!</English>
<Polish>Zakłada NVG w nocy i zdejmuje je w ciągu dnia.\nNie dodaje NVG do ekwipunku!</Polish>
<German>Rüstet NVG nachts aus dem Inventar aus und entfernt es tagsüber.\nFügt keine NVGs zum Inventar hinzu!</German>
<Italian>Equipaggia NVG dall'inventario durante la notte, e li mette nell'inventario durante il giorno.\nNon aggiunge NVG all'inventario se non sono presenti.</Italian>
<Korean>야간에는 야투경을 소지품에 장착하고 주간에는 장착을 해제합니다.\n주의! 소지품에 야투경을 추가하는 것이 아닙니다!</Korean>
<French>Equipe des JVN pendant la nuit et les déséquipe le jour.\nN'ajoute pas les JVN dans l'intenvaire !</French>
<Portuguese>Equipa o NVG do inventário durante a noite e desequipa durante o dia.\nNão adiciona NVGs ao inventário!</Portuguese>
<Japanese>インベントリ内の暗視装置を夜間に装備し、日中は解除し収納します。\nこれはNVGをインベントリに追加しません。</Japanese>
<Russian>Экипирует ПНВ в ночное время и отключает его в дневное время.\nНе добавляет ПНВ в инвентарь!</Russian>
</Key>
</Package>
</Project>

View File

@ -30,6 +30,6 @@ _vehicle == vehicle _unit
if (_unit == _x select FULLCREW_UNIT) exitWith {
_ejectVarName = format [QGVAR(ejectAction_%1_%2), _x select FULLCREW_ROLE, _x select FULLCREW_TURRETPATH];
};
} count fullCrew _vehicle;
} forEach fullCrew _vehicle;
_vehicle getVariable [_ejectVarName, false]
}

View File

@ -17,13 +17,13 @@
*
* Public: No
*/
params ["_vehicle", "_group", "_type", "_value"];
TRACE_4("droneModifyWaypoint",_vehicle,_group,_type,_value);
private _index = (currentWaypoint _group) min count waypoints _group;
private _waypoint = [_group, _index];
switch (toLower _type) do {
switch (toLowerANSI _type) do {
case ("height"): {
private _pos = waypointPosition _waypoint;
_pos set [2, _value];

View File

@ -29,7 +29,10 @@ private _currentLoiterRadius = waypointLoiterRadius _waypoint;
private _currentLoiterType = waypointLoiterType _waypoint;
// Set pos to ATL
_pos set [2, if (_currentHeight >= 50) then { _currentHeight } else { 0 }];
_pos set [
2,
[0, _currentHeight] select (_currentHeight >= 50)
];
// [_group] call CBA_fnc_clearWaypoints;
_waypoint = _group addWaypoint [_pos, 0];

View File

@ -29,7 +29,7 @@
<Russian>Открыть грузовой отсек</Russian>
<Italian>Apri la rampa di carico</Italian>
<Portuguese>Abrir porta de carga</Portuguese>
<Japanese>カーゴ ドアを開く</Japanese>
<Japanese>貨物室ドアを 開く</Japanese>
<Korean>화물칸 개방</Korean>
<Chinese>開啟貨艙門</Chinese>
<Chinesesimp>开启货舱门</Chinesesimp>
@ -46,7 +46,7 @@
<Russian>Закрыть грузовой отсек</Russian>
<Italian>Chiudi la rampa di carico</Italian>
<Portuguese>Fechar porta de carga</Portuguese>
<Japanese>カーゴ ドアを閉じる</Japanese>
<Japanese>貨物室ドアを 閉じる</Japanese>
<Korean>화물칸 폐쇄</Korean>
<Chinese>關閉貨艙門</Chinese>
<Chinesesimp>关闭货舱门</Chinesesimp>
@ -61,16 +61,19 @@
<Polish>30mm Odłamkowo-Burzące - Zapalające</Polish>
<Turkish>30mm Yüksek Patlayıcı </Turkish>
<German>30mm Hochexplosiv/Brandladung</German>
<Japanese>30mm 焼夷りゅう弾</Japanese>
<Italian>30mm Esplosivo/Incendiario</Italian>
<Japanese>30mm 焼夷榴弾</Japanese>
<Czech>30mm Tříštivo-trhavá zápalná střela</Czech>
<Russian>30мм Осколочно-Фугасный Зажигательный</Russian>
<Korean>30mm 고폭소이탄</Korean>
<Portuguese>30mm Alto-Explosivo Incendiária</Portuguese>
</Key>
<Key ID="STR_ACE_Aircraft_GatlingDescriptionShortHEI">
<English>30mm HEI</English>
<Spanish>30mm AEI</Spanish>
<Chinese>30毫米高爆燃燒</Chinese>
<Chinesesimp>30mm 高爆燃烧</Chinesesimp>
<Italian>30mm HEI</Italian>
<French>30 mm HEI</French>
<Polish>30mm OB-Z</Polish>
<Turkish>30mm HEI</Turkish>
@ -79,6 +82,7 @@
<Czech>30mm HEI</Czech>
<Russian>30мм ОФЗ</Russian>
<Korean>30mm HEI</Korean>
<Portuguese>30mm AEI</Portuguese>
</Key>
<Key ID="STR_ACE_Aircraft_GatlingDescriptionAP">
<English>30mm DU Armor Piercing</English>
@ -86,13 +90,15 @@
<Chinese>30毫米貧化鈾穿甲彈 </Chinese>
<Chinesesimp>30 mm 贫铀穿甲</Chinesesimp>
<French>30 mm UA Armor Piercing</French>
<Italian>30mm AP Uranio Impoverito</Italian>
<Polish>30mm Zubożony Uran - Przebijające</Polish>
<Turkish>30mm DU Zırh Delici</Turkish>
<German>30mm abgereichertes panzerbrechendes Uraniumgeschoss</German>
<Japanese>30mm DU 徹甲弾</Japanese>
<Japanese>30mm 劣化ウラン徹甲弾</Japanese>
<Czech>30mm Protipancéřová střela z ochuzeného Uranu</Czech>
<Russian>30мм ОУ Бронебойный Снаряд</Russian>
<Korean>30mm 열화우라늄 철갑탄</Korean>
<Portuguese>30mm DU Perfurante de Blindagem</Portuguese>
</Key>
<Key ID="STR_ACE_Aircraft_GatlingDescriptionShortAP">
<English>30mm DU AP</English>
@ -100,6 +106,7 @@
<Chinese>30毫米貧鈾穿甲</Chinese>
<Chinesesimp>30mm 贫铀穿甲</Chinesesimp>
<French>30 mm UA AP</French>
<Italian>30mm AP-UI</Italian>
<Polish>30mm ZU-P</Polish>
<Turkish>30mm DU AP</Turkish>
<German>30mm DU-PB</German>
@ -107,6 +114,7 @@
<Czech>30 mm DU AP</Czech>
<Russian>30мм ОУ БС</Russian>
<Korean>30mm DU AP</Korean>
<Portuguese>30mm DU AP</Portuguese>
</Key>
<Key ID="STR_ACE_Aircraft_GatlingDescriptionCM41">
<English>30mm Combat Mix 4:1 DU:HEI</English>
@ -114,13 +122,15 @@
<Chinese>30毫米戰鬥混合彈4:1 穿甲:高爆</Chinese>
<Chinesesimp>30mm 战斗混合 穿甲/高爆 4:1</Chinesesimp>
<French>30 mm Mix de Combat 4:1 UA:HEI</French>
<Italian>30mm Misto 4:1 UI:HEI</Italian>
<Polish>30mm Mieszanka bojowa 4:1 ZU:OB-Z</Polish>
<Turkish>30mm Combat Mix 4:1 DU:HEI</Turkish>
<German>30mm Kampfmischung 4:1 DU:HEB</German>
<Japanese>30mm コンバット ミックス 4:1 DU:HEI</Japanese>
<Japanese>30mm コンバット ミックス 4:1 劣化ウラン徹甲弾:焼夷榴弾</Japanese>
<Czech>30mm Bojový Mix 4:1 DU:HEI</Czech>
<Russian>30мм Смешанное боепитание 4:1 ОУ:ОФЗ</Russian>
<Korean>30mm 4:1 열화:고폭소이</Korean>
<Portuguese>30mm Mix de Combate 4:1 DU:AEI</Portuguese>
</Key>
<Key ID="STR_ACE_Aircraft_GatlingDescriptionShortCM41">
<English>30mm CM 4:1</English>
@ -128,6 +138,7 @@
<Chinese>30毫米 穿高混合 4:1</Chinese>
<Chinesesimp>30mm 穿爆混合 4:1</Chinesesimp>
<French>30 mm MdC 4:1</French>
<Italian>30mm Misto 4:1</Italian>
<Polish>30mm MB 4:1</Polish>
<Turkish>30mm CM 4:1</Turkish>
<German>30mm KM 4:1</German>
@ -142,10 +153,11 @@
<Chinese>30毫米戰鬥混合彈5:1 穿甲:高爆</Chinese>
<Chinesesimp>30 mm 战斗混合 穿甲/高爆 5:1</Chinesesimp>
<French>30 mm Mix de Combat 5:1 UA:HEI</French>
<Italian>30mm Misto 5:1 UI:HEI</Italian>
<Polish>30mm Mieszanka bojowa 5:1 ZU:OB-Z</Polish>
<Turkish>30mm Combat Mix 5:1 DU:HEI</Turkish>
<German>30mm Kampfmischung 5:1 DU:HEB</German>
<Japanese>30mm コンバット ミックス 5:1 DU:HEI</Japanese>
<Japanese>30mm コンバット ミックス 5:1 劣化ウラン徹甲弾:焼夷榴弾</Japanese>
<Czech>30mm Bojový Mix 5:1 DU:HEI</Czech>
<Russian>30мм Смешанное боепитание 5:1 ОУ:ОФЗ</Russian>
<Korean>30mm 5:1 열화:고폭소이</Korean>
@ -156,6 +168,7 @@
<Chinese>30毫米 穿高混合 5:1</Chinese>
<Chinesesimp>30mm 穿爆混合 5:1</Chinesesimp>
<French>30 mm MdC 5:1</French>
<Italian>30mm Misto 5:1</Italian>
<Polish>30mm MB 5:1</Polish>
<Turkish>30mm CM 5:1</Turkish>
<German>30mm KM 5:1</German>

View File

@ -75,11 +75,11 @@ class GVAR(sorts) {
scope = 2;
displayName = CSTRING(sortByProtectionBallistic);
tabs[] = {{3,4,6}, {}};
statement = QUOTE([ARR_3(_this, 1000000, 1000)] call FUNC(sortStatement_protection));
statement = QUOTE([ARR_3(_this,1000000,1000)] call FUNC(sortStatement_protection));
};
class ACE_protectionExplosive: ACE_protectionBallistic {
displayName = CSTRING(sortByProtectionExplosive);
statement = QUOTE([ARR_3(_this, 1000, 1000000)] call FUNC(sortStatement_protection));
statement = QUOTE([ARR_3(_this,1000,1000000)] call FUNC(sortStatement_protection));
};
};

View File

@ -24,7 +24,7 @@ class GVAR(stats) {
priority = 1.5;
displayName = "$STR_a3_rscdisplayarsenal_stat_weight";
showText = 1;
textStatement = QUOTE([ARR_2(_this select 0, _this select 1)] call FUNC(statTextStatement_mass));
textStatement = QUOTE([ARR_2(_this select 0,_this select 1)] call FUNC(statTextStatement_mass));
tabs[] = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14}, {0,1,2,3,4,5,6,7}};
};
class ACE_rateOfFire: statBase {
@ -34,8 +34,8 @@ class GVAR(stats) {
displayName = "$STR_a3_rscdisplayarsenal_stat_rof";
showBar = 1;
showText = 1;
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_2([ARR_2(-1.4, 0.31)], [ARR_2(1, 0.01)])])] call FUNC(statBarStatement_rateOfFIre));
textStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_2([ARR_2(-1.4, 0.31)], false)])] call FUNC(statTextStatement_rateOfFire));
barStatement = QUOTE([ARR_3((_this select 0) select 0,_this select 1,[ARR_2([ARR_2(-1.4,0.31)],[ARR_2(1,0.01)])])] call FUNC(statBarStatement_rateOfFIre));
textStatement = QUOTE([ARR_3((_this select 0) select 0,_this select 1,[ARR_2([ARR_2(-1.4,0.31)],false)])] call FUNC(statTextStatement_rateOfFire));
tabs[] = {{0,1}, {}};
};
class ACE_accuracy: statBase {
@ -45,8 +45,8 @@ class GVAR(stats) {
displayName = "$STR_a3_rscdisplayarsenal_stat_dispersion";
showBar = 1;
showText = 1;
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_3([ARR_2(-4, -1.7)], [ARR_2(1, 0.01)], true)])] call FUNC(statBarStatement_accuracy));
textStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_2([ARR_2(-4, -1.7)], false)])] call FUNC(statTextStatement_accuracy));
barStatement = QUOTE([ARR_3((_this select 0) select 0,_this select 1,[ARR_3([ARR_2(-4,-1.7)],[ARR_2(1,0.01)],true)])] call FUNC(statBarStatement_accuracy));
textStatement = QUOTE([ARR_3((_this select 0) select 0,_this select 1,[ARR_2([ARR_2(-4,-1.7)],false)])] call FUNC(statTextStatement_accuracy));
tabs[] = {{0,1}, {}};
};
class ACE_maxZeroing: statBase {
@ -55,7 +55,7 @@ class GVAR(stats) {
stats[] = {"maxZeroing"};
displayName = "$STR_a3_rscdisplayarsenal_stat_range";
showBar = 1;
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_3([ARR_2(0, 2500)], [ARR_2(0.01, 1)], false)])] call FUNC(statBarStatement_default));
barStatement = QUOTE([ARR_3((_this select 0) select 0,_this select 1,[ARR_3([ARR_2(0,2500)],[ARR_2(0.01,1)],false)])] call FUNC(statBarStatement_default));
tabs[] = {{0,1,2}, {}};
};
class ACE_impact: statBase {
@ -64,7 +64,7 @@ class GVAR(stats) {
stats[] = {"hit", "initSpeed"};
displayName = "$STR_a3_rscdisplayarsenal_stat_impact";
showBar = 1;
barStatement = QUOTE([ARR_3(_this select 0, _this select 1, [ARR_2([ARR_2(0, 3.2)], [ARR_2(-1, 1100)])])] call FUNC(statBarStatement_impact));
barStatement = QUOTE([ARR_3(_this select 0,_this select 1,[ARR_2([ARR_2(0,3.2)],[ARR_2(-1,1100)])])] call FUNC(statBarStatement_impact));
tabs[] = {{0,1,2}, {}};
};
class ACE_scopeMagnification: statBase {
@ -105,7 +105,7 @@ class GVAR(stats) {
stats[] = {"passthrough"};
displayName = "$STR_a3_rscdisplayarsenal_stat_passthrough";
showBar = 1;
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_3([ARR_2(0, 0.63)], [ARR_2(0.01, 1)], false)])] call FUNC(statBarStatement_default));
barStatement = QUOTE([ARR_3((_this select 0) select 0,_this select 1,[ARR_3([ARR_2(0,0.63)],[ARR_2(0.01,1)],false)])] call FUNC(statBarStatement_default));
tabs[] = {{3,4,6}, {}};
};
class ACE_explosiveResistance: statBase {
@ -114,7 +114,7 @@ class GVAR(stats) {
stats[] = {"armor"};
displayName = "$STR_a3_rscdisplayarsenal_stat_armor";
showBar = 1;
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_3([ARR_2(0, 0.80)], [ARR_2(0.01, 1)], false)])] call FUNC(statBarStatement_default));
barStatement = QUOTE([ARR_3((_this select 0) select 0,_this select 1,[ARR_3([ARR_2(0,0.80)],[ARR_2(0.01,1)],false)])] call FUNC(statBarStatement_default));
tabs[] = {{3,4,6}, {}};
};
class ACE_load: statBase {
@ -123,7 +123,9 @@ class GVAR(stats) {
stats[] = {"maximumLoad"};
displayName = "$STR_a3_rscdisplayarsenal_stat_load";
showBar = 1;
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));
showText = 1;
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));
textStatement = QUOTE(call FUNC(statTextStatement_load));
tabs[] = {{3,4,5}, {}};
};
class ACE_smokeChemTTL: statBase {
@ -133,7 +135,7 @@ class GVAR(stats) {
displayName = CSTRING(statTTL);
showText = 1;
textStatement = QUOTE(call FUNC(statTextStatement_smokeChemTTL));
condition = QUOTE((configName (_this select 1)) isKindOf [ARR_2('smokeShell', configFile >> 'CfgMagazines')]);
condition = QUOTE((configName (_this select 1)) isKindOf [ARR_2('smokeShell',configFile >> 'CfgMagazines')]);
tabs[] = {{}, {5}};
};
class ACE_explosionTime: statBase {
@ -152,4 +154,13 @@ class GVAR(stats) {
textStatement = QUOTE(call FUNC(statTextStatement_magCount));
tabs[] = {{}, {4}};
};
class ACE_illuminators: statBase {
scope = 2;
priority = 1;
stats[] = {};
displayName = CSTRING(statIlluminators);
showText = 1;
textStatement = QUOTE(call FUNC(statTextStatement_illuminators));
tabs[] = {{}, {1}};
};
};

View File

@ -28,7 +28,7 @@ class Cfg3DEN {
w = QUOTE(130 * ATTRIBUTE_W);
h = QUOTE(106.83 * ATTRIBUTE_H);
attributeLoad = QUOTE([ARR_2(_this,+_value)] call FUNC(attributeLoad));
attributeSave = QUOTE(uiNamespace getVariable [ARR_2(QQGVAR(attributeValue),[ARR_2([], 0)])]);
attributeSave = QUOTE(uiNamespace getVariable [ARR_2(QQGVAR(attributeValue),[ARR_2([],0)])]);
class controls {
class ModeTitle: ctrlStatic {
idc = -1;
@ -40,7 +40,7 @@ class Cfg3DEN {
};
class Mode: ctrlToolbox {
idc = IDC_ATTRIBUTE_MODE;
onToolBoxSelChanged = QUOTE([ARR_2(ctrlParentControlsGroup (_this select 0), _this select 1)] call FUNC(attributeMode));
onToolBoxSelChanged = QUOTE([ARR_2(ctrlParentControlsGroup (_this select 0),_this select 1)] call FUNC(attributeMode));
x = QUOTE(5 * ATTRIBUTE_W);
y = QUOTE(5 * ATTRIBUTE_H);
w = QUOTE(125 * ATTRIBUTE_W);
@ -55,7 +55,7 @@ class Cfg3DEN {
};
class Category: ctrlToolboxPictureKeepAspect {
idc = IDC_ATTRIBUTE_CATEGORY;
onToolBoxSelChanged = QUOTE([ARR_2(ctrlParentControlsGroup (_this select 0), _this select 1)] call FUNC(attributeCategory));
onToolBoxSelChanged = QUOTE([ARR_2(ctrlParentControlsGroup (_this select 0),_this select 1)] call FUNC(attributeCategory));
x = QUOTE(5 * ATTRIBUTE_W);
y = QUOTE(15 * ATTRIBUTE_H);
w = QUOTE(125 * ATTRIBUTE_W);
@ -110,7 +110,7 @@ class Cfg3DEN {
h = QUOTE(65 * ATTRIBUTE_H);
drawSideArrows = 1;
disableOverflow = 1;
columns[] = {0.05, 0.15, 0.85};
columns[] = {0.05, 0.15, 0.83, 0.87};
};
class ArrowLeft: ctrlButton {
idc = IDC_ATTRIBUTE_LIST_LEFT;
@ -129,7 +129,8 @@ class Cfg3DEN {
};
class SearchButton: ctrlButtonPicture {
idc = IDC_ATTRIBUTE_SEARCH_BUTTON;
onButtonClick = QUOTE( \
#pragma hemtt suppress pw3_padded_arg
onButtonClick = QUOTE(\
params ['_searchButton']; \
private _controlsGroup = ctrlParentControlsGroup _searchButton; \
private _searchBar = _controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_SEARCHBAR; \
@ -147,7 +148,8 @@ class Cfg3DEN {
class SearchBar: ctrlEdit {
idc = IDC_ATTRIBUTE_SEARCHBAR;
onKeyUp = QUOTE([ctrlParentControlsGroup (_this select 0)] call FUNC(attributeAddItems));
onMouseButtonClick = QUOTE( \
#pragma hemtt suppress pw3_padded_arg
onMouseButtonClick = QUOTE(\
params [ARR_2('_searchBar','_button')]; \
if (_button != 1) exitWith {}; \
_searchBar ctrlSetText ''; \

View File

@ -26,7 +26,7 @@ class Display3DEN {
class GVAR(portVALoadouts) {
text = CSTRING(portLoadoutsText);
picture = QPATHTOEF(common,data\logo_ace3_ca.paa);
action = QUOTE(call DFUNC(portVALoadouts););
action = QUOTE(call DFUNC(portVALoadouts));
};
};
};

View File

@ -16,6 +16,8 @@ PREP(attributeKeyDown);
PREP(attributeLoad);
PREP(attributeMode);
PREP(attributeSelect);
PREP(baseAttachment);
PREP(baseOptic);
PREP(baseWeapon);
PREP(buttonActionsPage);
PREP(buttonCargo);
@ -39,11 +41,14 @@ PREP(fillLeftPanel);
PREP(fillLoadoutsList);
PREP(fillRightPanel);
PREP(fillSort);
PREP(getVirtualItems);
PREP(handleActions);
PREP(handleLoadoutsSearchbar);
PREP(handleMouse);
PREP(handleScrollWheel);
PREP(handleSearchbar);
PREP(handleSearchInputChanged);
PREP(handleSearchModeToggle);
PREP(handleStats);
PREP(initBox);
PREP(itemInfo);
@ -92,6 +97,8 @@ PREP(statBarStatement_impact);
PREP(statBarStatement_rateOfFIre);
PREP(statTextStatement_accuracy);
PREP(statTextStatement_explosionTime);
PREP(statTextStatement_illuminators);
PREP(statTextStatement_load);
PREP(statTextStatement_magCount);
PREP(statTextStatement_mass);
PREP(statTextStatement_rateOfFire);
@ -102,4 +109,5 @@ PREP(updateCamPos);
PREP(updateRightPanel);
PREP(updateCurrentItemsList);
PREP(updateUniqueItemsList);
PREP(updateVirtualItemsFlat);
PREP(verifyLoadout);

View File

@ -18,6 +18,16 @@ GVAR(lastSortDirectionRight) = DESCENDING;
[QGVAR(removeDefaultLoadout), LINKFUNC(removeDefaultLoadout)] call CBA_fnc_addEventHandler;
[QGVAR(renameDefaultLoadout), LINKFUNC(renameDefaultLoadout)] call CBA_fnc_addEventHandler;
[QGVAR(refresh), {
params ["_object"];
// If the arsenal is already open, refresh arsenal display
// Deliberate == check, fail on objNull
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) == _object}) then {
[true, true] call FUNC(refresh);
};
}] call CBA_fnc_addEventHandler;
[QGVAR(broadcastFace), {
params ["_unit", "_face"];
_unit setFace _face;
@ -60,7 +70,7 @@ GVAR(lastSortDirectionRight) = DESCENDING;
if (!isNil QGVAR(currentLoadoutsTab) && {GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts}) then {
private _curSelData = _contentPanelCtrl lnbData [lnbCurSelRow _contentPanelCtrl, 1];
([_loadoutData] call FUNC(verifyLoadout)) params ["_extendedLoadout", "_nullItemsAmount", "_unavailableItemsAmount"];
([_loadoutData] call FUNC(verifyLoadout)) params ["_extendedLoadout", "_nullItemsList", "_unavailableItemsList"];
_extendedLoadout params ["_loadout"];
private _newRow = _contentPanelCtrl lnbAddRow [_playerName, _loadoutName];
@ -71,10 +81,10 @@ GVAR(lastSortDirectionRight) = DESCENDING;
_contentPanelCtrl lnbSetData [[_newRow, 1], _playerName + _loadoutName];
// Set color of row, depending if items are unavailable/missing
if (_nullItemsAmount > 0) then {
if (_nullItemsList isNotEqualTo []) then {
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]];
} else {
if (_unavailableItemsAmount > 0) then {
if (_unavailableItemsList isNotEqualTo []) then {
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]];
};
};
@ -98,24 +108,16 @@ GVAR(lastSortDirectionRight) = DESCENDING;
private _face = _extendedInfo getOrDefault [QGVAR(face), ""];
if (_face != "") then {
if (isMultiplayer) then {
private _id = [QGVAR(broadcastFace), [_unit, _face], QGVAR(centerFace_) + netId _unit] call CBA_fnc_globalEventJIP;
[_id, _unit] call CBA_fnc_removeGlobalEventJIP;
} else {
_unit setFace _face;
};
private _id = [QGVAR(broadcastFace), [_unit, _face], QGVAR(centerFace_) + hashValue _unit] call CBA_fnc_globalEventJIP;
[_id, _unit] call CBA_fnc_removeGlobalEventJIP;
};
// Set voice
private _voice = _extendedInfo getOrDefault [QGVAR(voice), ""];
if (_voice != "") then {
if (isMultiplayer) then {
private _id = [QGVAR(broadcastVoice), [_unit, _voice], QGVAR(centerVoice_) + netId _unit] call CBA_fnc_globalEventJIP;
[_id, _unit] call CBA_fnc_removeGlobalEventJIP;
} else {
_unit setSpeaker _voice;
};
private _id = [QGVAR(broadcastVoice), [_unit, _voice], QGVAR(centerVoice_) + hashValue _unit] call CBA_fnc_globalEventJIP;
[_id, _unit] call CBA_fnc_removeGlobalEventJIP;
};
// Set insignia
@ -137,7 +139,7 @@ GVAR(lastSortDirectionRight) = DESCENDING;
// Set voice if enabled
if (GVAR(loadoutsSaveVoice)) then {
_extendedInfo set [QGVAR(voice), speaker _unit];
_extendedInfo set [QGVAR(voice), (speaker _unit) call EFUNC(common,getConfigName)];
};
// Set insignia if enabled

View File

@ -9,60 +9,13 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
#include "initSettings.sqf"
#include "initSettings.inc.sqf"
// Arsenal events
[QGVAR(statsToggle), {
params ["_display", "_showStats"];
private _statsCtrlGroupCtrl = _display displayCtrl IDC_statsBox;
private _statsPreviousPageCtrl = _display displayCtrl IDC_statsPreviousPage;
private _statsNextPageCtrl = _display displayCtrl IDC_statsNextPage;
private _statsCurrentPageCtrl = _display displayCtrl IDC_statsCurrentPage;
{
_x ctrlShow (GVAR(showStats) && {_showStats});
} forEach [
_statsCtrlGroupCtrl,
_statsPreviousPageCtrl,
_statsNextPageCtrl,
_statsCurrentPageCtrl
];
}] call CBA_fnc_addEventHandler;
[QGVAR(statsChangePage), {
_this call FUNC(buttonStatsPage);
}] call CBA_fnc_addEventHandler;
[QGVAR(displayStats), {
_this call FUNC(handleStats);
}] call CBA_fnc_addEventHandler;
[QGVAR(actionsChangePage), {
_this call FUNC(buttonActionsPage);
}] call CBA_fnc_addEventHandler;
[QGVAR(displayActions), {
_this call FUNC(handleActions);
}] call CBA_fnc_addEventHandler;
[QGVAR(actionsToggle), {
params ["_display", "_showActions"];
private _actionsCtrlGroupCtrl = _display displayCtrl IDC_actionsBox;
private _actionsPreviousPageCtrl = _display displayCtrl IDC_actionsPreviousPage;
private _actionsNextPageCtrl = _display displayCtrl IDC_actionsNextPage;
private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage;
{
_x ctrlShow (GVAR(showActions) && {_showActions});
} forEach [
_actionsCtrlGroupCtrl,
_actionsPreviousPageCtrl,
_actionsNextPageCtrl,
_actionsCurrentPageCtrl
];
}] call CBA_fnc_addEventHandler;
[QGVAR(statsChangePage), LINKFUNC(buttonStatsPage)] call CBA_fnc_addEventHandler;
[QGVAR(displayStats), LINKFUNC(handleStats)] call CBA_fnc_addEventHandler;
[QGVAR(actionsChangePage), LINKFUNC(buttonActionsPage)] call CBA_fnc_addEventHandler;
[QGVAR(displayActions), LINKFUNC(handleActions)] call CBA_fnc_addEventHandler;
call FUNC(compileActions);
call FUNC(compileSorts);
@ -83,8 +36,59 @@ call FUNC(compileStats);
EGVAR(common,blockItemReplacement) = false;
}] call CBA_fnc_addEventHandler;
[QGVAR(cargoChanged), {
params ["_display"];
// Only update actions if necessary, this can get performance-intensive using the arrow keys
if (!GVAR(updateActionsOnCargoChange)) exitWith {};
private _actionInfo = [_display];
_actionInfo append GVAR(actionInfo);
[QGVAR(displayActions), _actionInfo] call CBA_fnc_localEvent;
}] call CBA_fnc_addEventHandler;
// Setup Tools tab
[keys (uiNamespace getVariable [QGVAR(configItemsTools), createHashMap]), LLSTRING(toolsTab), TOOLS_TAB_ICON, -1, true] call FUNC(addRightPanelButton);
// TODO: make IDCs able to match IDX with simple math?
GVAR(idxMap) = createHashMapFromArray [
[IDC_buttonPrimaryWeapon, IDX_VIRT_PRIMARY_WEAPONS],
[IDC_buttonHandgun, IDX_VIRT_HANDGUN_WEAPONS],
[IDC_buttonSecondaryWeapon, IDX_VIRT_SECONDARY_WEAPONS],
[IDC_buttonHeadgear, IDX_VIRT_HEADGEAR],
[IDC_buttonUniform, IDX_VIRT_UNIFORM],
[IDC_buttonVest, IDX_VIRT_VEST],
[IDC_buttonBackpack, IDX_VIRT_BACKPACK],
[IDC_buttonGoggles, IDX_VIRT_GOGGLES],
[IDC_buttonNVG, IDX_VIRT_NVG],
[IDC_buttonBinoculars, IDX_VIRT_BINO],
[IDC_buttonMap, IDX_VIRT_MAP],
[IDC_buttonGPS, IDX_VIRT_COMMS],
[IDC_buttonRadio, IDX_VIRT_RADIO],
[IDC_buttonCompass, IDX_VIRT_COMPASS],
[IDC_buttonWatch, IDX_VIRT_WATCH]
];
// Make new hashmaps for face/voice/insignia so mission makers can disable them
// Copies of hashmaps aren't final
GVAR(faceCache) = +(uiNamespace getVariable QGVAR(faceCache));
GVAR(voiceCache) = +(uiNamespace getVariable QGVAR(voiceCache));
GVAR(insigniaCache) = +(uiNamespace getVariable QGVAR(insigniaCache));
// Get mission/campaign insignias
// BIS_fnc_setUnitInsignia will look in mission config, then campaign, then global config last, so overwrite accordingly
private _insigniaCondition = toString {
if (isNumber (_x >> "scope")) then {
getNumber (_x >> "scope") == 2
} else {
true
};
};
// Ref fnc_addListBoxItem, 0/nil = configFile, 1 = campaignConfigFile, 2 = missionConfigFile
{
GVAR(insigniaCache) set [_x, 1];
} forEach (_insigniaCondition configClasses (campaignConfigFile >> "CfgUnitInsignia"));
{
GVAR(insigniaCache) set [_x, 2];
} forEach (_insigniaCondition configClasses (missionConfigFile >> "CfgUnitInsignia"));
ADDON = true;

View File

@ -155,6 +155,8 @@
#define IDC_statsNextPage 53
#define IDC_statsCurrentPage 54
#define IDC_actionsBox 90
#define IDC_actionsBackground1 90010
#define IDC_actionsBackground2 90011
#define IDC_actionsText1 9001
#define IDC_actionsButton1 9002
#define IDC_actionsText2 9003
@ -268,6 +270,7 @@
#define IDX_VIRT_UNIQUE_UNKNOWN_ITEMS 25
// Indexes of current items array
// Should match IDX_VIRT_X macros for any left panel tabs
#define IDX_CURR_PRIMARY_WEAPON 0
#define IDX_CURR_SECONDARY_WEAPON 1
#define IDX_CURR_HANDGUN_WEAPON 2
@ -487,3 +490,6 @@ if (!isNil QGVAR(customRightPanelButtons)) then {\
_contentPanelCtrl lnbSetPicture [[_newRow, 7], getText (configFile >> "CfgVehicles" >> (_loadout select IDX_LOADOUT_BACKPACK) select 0 >> "picture")];\
_contentPanelCtrl lnbSetPicture [[_newRow, 8], getText (_cfgWeapons >> _loadout select IDX_LOADOUT_HEADGEAR >> "picture")];\
_contentPanelCtrl lnbSetPicture [[_newRow, 9], getText (configFile >> "CfgGlasses" >> _loadout select IDX_LOADOUT_GOGGLES >> "picture")];
#define ACTION_TYPE_TEXT 0
#define ACTION_TYPE_BUTTON 1

View File

@ -1,4 +1,5 @@
#include "..\script_component.hpp"
#include "..\defines.hpp"
/*
* Author: johnb43
* Adds custom action buttons.
@ -10,6 +11,7 @@
* 3: Actions <ARRAY of ARRAYS>
* 4: Condition <CODE> (default: {true})
* 5: Scope editor <NUMBER> (default: 2)
* 6: Update when cargo content changes <BOOL> (default: false)
*
* Return Value:
* 0: Array of IDs <ARRAY of STRINGS>
@ -30,7 +32,8 @@ params [
["_title", "", [""]],
["_actions", [], [[]]],
["_rootCondition", {true}, [{}]],
["_scopeEditor", 2, [0]]
["_scopeEditor", 2, [0]],
["_updateOnCargoChange", false, [false]]
];
// Compile actions from config (in case this is called before preInit)
@ -38,13 +41,13 @@ call FUNC(compileActions);
// Skip if not allowed in editor and in editor
if (is3DEN && {_scopeEditor != 2}) exitWith {
TRACE_1("Skipping action because in editor", _rootClass);
TRACE_1("Skipping action because in editor",_rootClass);
[]
};
// Class can't contain ~, because it's used for formatting result
if ("~" in _rootClass) exitWith {
TRACE_1("Classname can't contain '~'", _rootClass);
TRACE_1("Classname can't contain '~'",_rootClass);
[]
};
@ -65,7 +68,7 @@ private _fnc_addToGroup = {
// Don't allow two of the same class
if (_group findIf {(_x select 0) == _class} != -1) then {
TRACE_1("An action with this ID already exists", _class);
TRACE_1("An action with this ID already exists",_class);
continue;
};
@ -119,4 +122,8 @@ private _group = [];
};
} forEach _tabs;
if (_updateOnCargoChange) then {
GVAR(updateActionsOnCargoChange) = true;
};
_return

View File

@ -20,8 +20,9 @@
params [["_name", "", [""]], ["_loadout", [], [[]]], ["_global", false, [false]]];
if (_global) then {
[QGVAR(addDefaultLoadout), [_name, _loadout]] call CBA_fnc_remoteEvent;
if (_global) exitWith {
private _eventID = format [QGVAR(loadouts_%1), _name];
[QGVAR(addDefaultLoadout), [_name, _loadout], _eventID] call CBA_fnc_globalEventJIP;
};
private _extendedInfo = createHashMap;

View File

@ -6,9 +6,10 @@
*
* Arguments:
* 0: Config category, must be "CfgWeapons", "CfgVehicles", "CfgMagazines", "CfgVoice" or "CfgUnitInsignia" <STRING>
* 1: Classname <STRING>
* 1: Classname (must be in config case) <STRING>
* 2: Panel control <CONTROL>
* 3: Name of the picture entry in that Cfg class <STRING> (default: "picture")
* 4: Config root <NUMBER> (default: 0 -> configFile)
*
* Return Value:
* None
@ -19,9 +20,9 @@
* Public: Yes
*/
params ["_configCategory", "_className", "_ctrlPanel", ["_pictureEntryName", "picture", [""]]];
params ["_configCategory", "_className", "_ctrlPanel", ["_pictureEntryName", "picture", [""]], ["_configRoot", 0, [0]]];
private _skip = GVAR(favoritesOnly) && {!(_className in GVAR(currentItems))} && {!((toLower _className) in GVAR(favorites))};
private _skip = GVAR(favoritesOnly) && {!(_className in GVAR(currentItems))} && {!((toLowerANSI _className) in GVAR(favorites))};
if (_skip) then {
switch (GVAR(currentLeftPanel)) do {
case IDC_buttonPrimaryWeapon: {
@ -41,10 +42,10 @@ if (_skip) then {
if (_skip) exitWith {};
// Sanitise key, as it's public; If not in cache, find info and cache it for later use
((uiNamespace getVariable QGVAR(addListBoxItemCache)) getOrDefaultCall [_configCategory + _className, {
// If not in cache, find info and cache it for later use
((uiNamespace getVariable QGVAR(addListBoxItemCache)) getOrDefaultCall [_configCategory + _className + str _configRoot, {
// Get classname (config case), display name, picture and DLC
private _configPath = configFile >> _configCategory >> _className;
private _configPath = ([configFile, campaignConfigFile, missionConfigFile] select _configRoot) >> _configCategory >> _className;
private _dlcName = _configPath call EFUNC(common,getAddon);
// If _pictureEntryName is empty, then this item has no picture (e.g. faces)
@ -57,7 +58,7 @@ _ctrlPanel lbSetPicture [_lbAdd, _itemPicture];
_ctrlPanel lbSetPictureRight [_lbAdd, ["", _modPicture] select GVAR(enableModIcons)];
_ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _className]];
if ((toLower _className) in GVAR(favorites)) then {
if ((toLowerANSI _className) in GVAR(favorites)) then {
_ctrlPanel lbSetColor [_lbAdd, FAVORITES_COLOR];
_ctrlPanel lbSetSelectColor [_lbAdd, FAVORITES_COLOR];
};

View File

@ -66,7 +66,8 @@ _items = _items select {
_x isKindOf ["CBA_MiscItem", _cfgWeapons] && {getNumber (_configItemInfo >> "type") in [TYPE_MUZZLE, TYPE_OPTICS, TYPE_FLASHLIGHT, TYPE_BIPOD]} ||
{getNumber (_configItemInfo >> "type") in [TYPE_FIRST_AID_KIT, TYPE_MEDIKIT, TYPE_TOOLKIT]} ||
{getText (_cfgWeapons >> _x >> "simulation") == "ItemMineDetector"} ||
{getNumber (_cfgMagazines >> _x >> "ACE_isUnique") == 1}
{getNumber (_cfgMagazines >> _x >> "ACE_isUnique") == 1} ||
{getNumber (_cfgMagazines >> _x >> "ACE_asItem") == 1}
};
GVAR(customRightPanelButtons) set [_position, [_items apply {_x call EFUNC(common,getConfigName)}, _picture, _tooltip, _moveOnOverwrite]];

View File

@ -72,7 +72,7 @@ private _fnc_addToTabs = {
_currentTab pushBack _sort;
_return pushBack _sortName;
} else {
TRACE_1("A sort with this ID already exists", _sortName);
TRACE_1("A sort with this ID already exists",_sortName);
};
} forEach _tabsToAddTo;
};

View File

@ -77,7 +77,7 @@ private _fnc_addToTabs = {
// Find if there is an entry with same ID
if (_currentTab findIf {_x select 5 == _statName} != -1) then {
TRACE_1("A stat with this ID already exists", _statName);
TRACE_1("A stat with this ID already exists",_statName);
} else {
_stat = +_finalArray;
_stat set [5, _statName];
@ -109,11 +109,10 @@ private _tabToChange = [];
{
_x params ["_tab", "_tabSide"];
_tabToChange = if (_tabSide == "R") then {
_tabToChange = [
GVAR(statsListLeftPanel),
GVAR(statsListRightPanel)
} else {
GVAR(statsListLeftPanel)
};
] select (_tabSide == "R");
_stats = _tabToChange select _tab;

View File

@ -123,3 +123,10 @@ if (_items isEqualType true) then {
};
_object setVariable [QGVAR(virtualItems), _cargo, _global];
// If the arsenal is already open, refresh arsenal display
if (_global) then {
[QGVAR(refresh), _object] call CBA_fnc_globalEvent;
} else {
[QGVAR(refresh), _object] call CBA_fnc_localEvent;
};

View File

@ -18,6 +18,8 @@
params ["_controlsGroup"];
forceUnicode 0; // handle non-ANSI characters
private _category = lbCurSel (_controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_CATEGORY);
private _filter = ctrlText (_controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_SEARCHBAR);
private _configItems = uiNamespace getVariable QGVAR(configItems);
@ -28,7 +30,7 @@ _attributeValue params ["_attributeItems", "_attributeMode"];
TRACE_3("Populating list",_category,_filter,_attributeValue);
if (_filter != "") then {
_filter = _filter call EFUNC(common,escapeRegex);
_filter = ".*?" + (_filter splitString " " joinString ".*?" + ".*?/io");
_filter = ".*?" + (_filter splitString " " joinString ".*?") + ".*?/io";
} else {
_filter = ".*?/io";
};
@ -44,6 +46,7 @@ private _cfgWeapons = configFile >> "CfgWeapons";
private _cfgMagazines = configFile >> "CfgMagazines";
private _cfgVehicles = configFile >> "CfgVehicles";
private _cfgGlasses = configFile >> "CfgGlasses";
private _dlcName = "";
// Exit with current items (no specific category)
if (_category == IDX_CAT_ALL) exitWith {
@ -71,6 +74,12 @@ if (_category == IDX_CAT_ALL) exitWith {
_listbox lnbSetData [[_index, 1], _x];
_listbox lnbSetPicture [[_index, 0], getText (_config >> "picture")];
_listbox lnbSetTooltip [[_index, 0], _x];
_dlcName = _config call EFUNC(common,getAddon);
if (_dlcName != "") then {
_listbox lnbSetPicture [[_index, 2], (modParams [_dlcName, ["logo"]]) param [0, ""]];
};
};
} forEach _attributeItems;
@ -128,14 +137,25 @@ private _config = _cfgClass;
_alpha = 0.5;
};
_index = _listbox lnbAddRow ["", _displayName, _symbol];
_index = _listbox lnbAddRow ["", _displayName, "", _symbol];
_listbox lnbSetData [[_index, 1], _x];
_listbox lnbSetPicture [[_index, 0], getText (_config >> _x >> "picture")];
_listbox lnbSetTooltip [[_index, 0], _x];
_listbox lnbSetColor [[_index, 1], [1, 1, 1, _alpha]];
_listbox lnbSetColor [[_index, 2], [1, 1, 1, _alpha]];
_listbox lnbSetColor [[_index, 3], [1, 1, 1, _alpha]];
// Mod icon is in column 2
_dlcName = (_config >> _x) call EFUNC(common,getAddon);
if (_dlcName != "") then {
_listbox lnbSetPicture [[_index, 2], (modParams [_dlcName, ["logo"]]) param [0, ""]];
_listbox lnbSetPictureColor [[_index, 2], [1, 1, 1, _alpha]];
};
};
} forEach (keys _categoryItems);
// Sort alphabetically
_listbox lnbSort [1, false];
// Reset unicode flag
forceUnicode -1;

View File

@ -24,14 +24,12 @@ if (_mode > 0) then {
// Blacklist: add full arsenal and take items away
[_object, true, true] call FUNC(initBox);
// Need to delay removal by 2 frames
// Wait until all items have been added, so that the blacklisted items can be removed
[{
[{
params ["_object", "_items"];
[_object, _items, true] call FUNC(removeVirtualItems);
}, _this] call CBA_fnc_execNextFrame;
}, [_object, _items]] call CBA_fnc_execNextFrame;
!isNil {(_this select 0) getVariable QGVAR(virtualItems)}
}, {
[_this select 0, _this select 1, true] call FUNC(removeVirtualItems);
}, [_object, _items], 20] call CBA_fnc_waitUntilAndExecute; // 20s timeout in case of failure
} else {
// Exit on whitelist mode with no items
if (_items isEqualTo []) exitWith {};

View File

@ -35,9 +35,10 @@ if (_addItem && {_itemIndex == -1}) exitWith {
_attributeItems pushBack _itemClassname;
// Change symbol and increase alpha
_listbox lnbSetText [[_currentRow, 2], [SYMBOL_ITEM_VIRTUAL, SYMBOL_ITEM_REMOVE] select _attributeMode];
_listbox lnbSetText [[_currentRow, 3], [SYMBOL_ITEM_VIRTUAL, SYMBOL_ITEM_REMOVE] select _attributeMode];
_listbox lnbSetColor [[_currentRow, 1], [1, 1, 1, 1]];
_listbox lnbSetColor [[_currentRow, 2], [1, 1, 1, 1]];
_listbox lnbSetPictureColor [[_currentRow, 2], [1, 1, 1, 1]]; // mod icon is in column 2
_listbox lnbSetColor [[_currentRow, 3], [1, 1, 1, 1]];
};
// Remove item if in list
@ -45,7 +46,8 @@ if (!_addItem && {_itemIndex != -1}) exitWith {
_attributeItems deleteAt _itemIndex;
// Change symbol and reduce alpha
_listbox lnbSetText [[_currentRow, 2], SYMBOL_ITEM_NONE];
_listbox lnbSetText [[_currentRow, 3], SYMBOL_ITEM_NONE];
_listbox lnbSetColor [[_currentRow, 1], [1, 1, 1, 0.5]];
_listbox lnbSetColor [[_currentRow, 2], [1, 1, 1, 0.5]];
_listbox lnbSetPictureColor [[_currentRow, 2], [1, 1, 1, 0.5]]; // mod icon is in column 2
_listbox lnbSetColor [[_currentRow, 3], [1, 1, 1, 0.5]];
};

View File

@ -0,0 +1,59 @@
#include "..\script_component.hpp"
/*
* Author: Jonpas, LinkIsGrim
* Returns base attachment for CBA scripted attachment
* Adapted from CBA_fnc_switchableAttachments
*
* Arguments:
* 0: Attachment <STRING>
*
* Return Value:
* Base attachment <STRING>
*
* Example:
* "ACE_acc_pointer_green_IR" call ace_arsenal_fnc_baseAttachment
*
* Public: Yes
*/
params [["_item", "", [""]]];
TRACE_1("looking up base attachment",_item);
private _switchableClasses = [];
private _cfgWeapons = configfile >> "CfgWeapons";
private _config = _cfgWeapons >> _item;
_item = configName _config;
// If the switch config entries are inherited, ignore
if (
(inheritsFrom (_config >> "MRT_SwitchItemNextClass") isNotEqualTo _config) ||
{inheritsFrom (_config >> "MRT_SwitchItemPrevClass") isNotEqualTo _config}
) exitWith {
_item // return
};
while {
_config = _cfgWeapons >> getText (_config >> "MRT_SwitchItemNextClass");
isClass _config && {_switchableClasses pushBackUnique configName _config != -1}
} do {};
_config = _cfgWeapons >> _item;
private _backward = [];
while {
_config = _cfgWeapons >> getText (_config >> "MRT_SwitchItemPrevClass");
isClass _config && {_backward pushBackUnique configName _config != -1}
} do {};
_switchableClasses append _backward;
_switchableClasses = _switchableClasses arrayIntersect _switchableClasses;
{
if (getNumber (_cfgWeapons >> _x >> "scope") == 2) exitWith {
TRACE_2("found class",_item,_x);
_item = _x;
};
} forEach _switchableClasses;
_item

View File

@ -0,0 +1,32 @@
#include "..\script_component.hpp"
/*
* Author: Jonpas, LinkIsGrim
* Returns base optic for CBA scripted optics (PIP and 2D)
*
* Arguments:
* 0: Optic <STRING>
*
* Return Value:
* Base optic <STRING>
*
* Example:
* "CUP_optic_Elcan_SpecterDR_black_PIP" call ace_arsenal_fnc_baseOptic
*
* Public: Yes
*/
params [["_optic", "", [""]]];
// PIP
private _baseClasses = configProperties [configFile >> "CBA_PIPItems", "getText _x == _optic"];
// Carry Handle
{
_baseClasses append (configProperties [_x, "getText _x == _optic"]);
} forEach configProperties [configFile >> "CBA_CarryHandleTypes"];
if (_baseClasses isNotEqualTo []) then {
_optic = configName (_baseClasses select 0);
};
_optic

View File

@ -19,7 +19,7 @@
params [["_weapon", "", [""]]];
// Check if item is cached
(uiNamespace getVariable QGVAR(baseWeaponNameCache)) getOrDefaultCall [toLower _weapon, {
(uiNamespace getVariable QGVAR(baseWeaponNameCache)) getOrDefaultCall [toLowerANSI _weapon, {
private _cfgWeapons = configfile >> "CfgWeapons";
private _config = _cfgWeapons >> _weapon;

View File

@ -2,12 +2,12 @@
#include "..\defines.hpp"
/*
* Author: Brett Mayson
* Handles the previous / next page buttons for actions
* Handles the previous / next page buttons for actions.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Actions control <CONTROL>
* 2: Previous or next <BOOL> (false = previous, true = next)
* 1: Actions page <CONTROL>
* 2: Previous (false) or next (true) page <BOOL>
*
* Return Value:
* None
@ -17,10 +17,11 @@
params ["_display", "_control", "_nextPage"];
TRACE_1("control enabled", ctrlEnabled _control);
TRACE_1("control enabled",ctrlEnabled _control);
if !(ctrlEnabled _control) exitWith {};
GVAR(currentActionPage) = GVAR(currentActionPage) + ([-1, 1] select _nextPage);
GVAR(actionsInfo) params ["_panelControl", "_curSel", "_itemCfg"];
[QGVAR(displayActions), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent;

View File

@ -47,8 +47,8 @@ private _container = switch (GVAR(currentLeftPanel)) do {
};
};
/// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 3, 0, 0, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = uniformItems GVAR(center);
// Update currentItems
GVAR(currentItems) set [IDX_CURR_UNIFORM_ITEMS, ((getUnitLoadout GVAR(center)) select IDX_LOADOUT_UNIFORM) param [1, []]];
@ -75,8 +75,8 @@ private _container = switch (GVAR(currentLeftPanel)) do {
};
};
// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 0, 3, 0, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = vestItems GVAR(center);
// Update currentItems
GVAR(currentItems) set [IDX_CURR_VEST_ITEMS, ((getUnitLoadout GVAR(center)) select IDX_LOADOUT_VEST) param [1, []]];
@ -103,8 +103,8 @@ private _container = switch (GVAR(currentLeftPanel)) do {
};
};
// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 0, 0, 3, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = backpackItems GVAR(center);
// Update currentItems
GVAR(currentItems) set [IDX_CURR_BACKPACK_ITEMS, ((getUnitLoadout GVAR(center)) select IDX_LOADOUT_BACKPACK) param [1, []]];
@ -117,7 +117,7 @@ private _container = switch (GVAR(currentLeftPanel)) do {
};
// Find out how many items of that type there are and update the number displayed
_ctrlList lnbSetText [[_lnbCurSel, 2], str (_containerItems getOrDefault [_item, 0])];
_ctrlList lnbSetText [[_lnbCurSel, 2], str ({_item == _x} count _containerItems)];
[QGVAR(cargoChanged), [_display, _item, _addOrRemove, GVAR(shiftState)]] call CBA_fnc_localEvent;

View File

@ -52,10 +52,20 @@ private _ctrl = controlNull;
IDC_buttonCurrentMag2,
IDC_iconBackgroundCurrentMag,
IDC_iconBackgroundCurrentMag2,
IDC_statsBox,
IDC_statsPreviousPage,
IDC_statsNextPage,
IDC_statsCurrentPage
IDC_statsCurrentPage,
IDC_actionsBox,
IDC_actionsPreviousPage,
IDC_actionsNextPage,
IDC_actionsCurrentPage
];
[QGVAR(statsToggle), [_display, _showToggle]] call CBA_fnc_localEvent;
[QGVAR(actionsToggle), [_display, _showToggle]] call CBA_fnc_localEvent;
if (!_showToggle) exitWith {};
// When showing the stats/actions again, update them to fit with currently selected item
GVAR(actionsInfo) params ["_control", "_curSel", "_itemCfg"];
[QGVAR(displayStats), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent;
[QGVAR(displayActions), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent;

View File

@ -43,11 +43,7 @@ private _loadoutIndex = _data findIf {(_x select 0) == _loadoutName};
(_data select _loadoutIndex) set [0, _editBoxContent];
if (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts) then {
if (is3DEN) then {
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
} else {
[QGVAR(renameDefaultLoadout), [_loadoutName, _editBoxContent]] call CBA_fnc_remoteEvent;
};
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
};
private _currentLoadoutsTab = str GVAR(currentLoadoutsTab);

View File

@ -17,11 +17,11 @@
params ["_display", "_control", "_nextPage"];
TRACE_1("control enabled", ctrlEnabled _control);
TRACE_1("control enabled",ctrlEnabled _control);
if !(ctrlEnabled _control) exitWith {};
GVAR(currentStatPage) = [GVAR(currentStatPage) - 1, GVAR(currentStatPage) + 1] select _nextPage;
GVAR(currentStatPage) = GVAR(currentStatPage) + ([-1, 1] select _nextPage);
GVAR(statsInfo) params ["_isLeftPanel", "_panelControl", "_curSel", "_itemCfg"];
GVAR(statsInfo) params ["", "_panelControl", "_curSel", "_itemCfg"];
[QGVAR(displayStats), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent;

View File

@ -1,4 +1,5 @@
#include "..\script_component.hpp"
#include "..\defines.hpp"
/*
* Author: Brett Mayson
* Create the internal actions arrays when needed for the first time.
@ -37,6 +38,8 @@ private _actionList = [
private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions));
GVAR(updateActionsOnCargoChange) = false;
{
private _scopeEditor = getNumber (_x >> "scopeEditor");
@ -48,6 +51,10 @@ private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions)
private _rootDisplayName = getText (_x >> "displayName");
private _rootCondition = getText (_x >> "condition");
private _rootTabs = getArray (_x >> "tabs");
private _updateOnCargoChanged = getNumber (_x >> "updateOnCargoChanged");
if (_updateOnCargoChanged > 0) then {
GVAR(updateActionsOnCargoChange) = true;
};
if (_rootCondition != "") then {
_rootCondition = compile _rootCondition;

View File

@ -101,7 +101,7 @@ private _priority = 0;
(_finalArray select 4) set [1, compile (getText (_x >> "textStatement"))];
};
TRACE_3("stats array", _finalArray, _leftTabsList, _rightTabsList);
TRACE_3("stats array",_finalArray,_leftTabsList,_rightTabsList);
if (_leftTabsList isNotEqualTo []) then {
[_statsListLeftPanel, _leftTabsList, "L"] call _fnc_addToTabs;

View File

@ -1,12 +1,13 @@
#include "..\script_component.hpp"
#include "..\defines.hpp"
/*
* Author: Alganthe, johnb43
* Author: Alganthe, johnb43, LinkIsGrim
* Fills left panel.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Tab control <CONTROL>
* 2: Animate panel refresh <BOOL>
*
* Return Value:
* None
@ -14,236 +15,115 @@
* Public: No
*/
params ["_display", "_control"];
params ["_display", "_control", ["_animate", true]];
private _ctrlIDC = ctrlIDC _control;
private _ctrlPanel = _display displayCtrl IDC_leftTabContent;
private _idxVirt = GVAR(idxMap) getOrDefault [_ctrlIDC, -1, true];
// Fade old control background
if (!isNil QGVAR(currentLeftPanel)) then {
private _previousCtrlBackground = _display displayCtrl (GVAR(currentLeftPanel) - 1);
_previousCtrlBackground ctrlSetFade 1;
_previousCtrlBackground ctrlCommit FADE_DELAY;
_previousCtrlBackground ctrlCommit ([0, FADE_DELAY] select _animate);
// When switching tabs, clear searchbox
if (GVAR(currentLeftPanel) != _ctrlIDC) then {
(_display displayCtrl IDC_leftSearchbar) ctrlSetText "";
(_display displayCtrl IDC_rightSearchbar) ctrlSetText "";
};
};
// Show new control background
private _ctrlIDC = ctrlIDC _control;
private _ctrlBackground = _display displayCtrl (_ctrlIDC - 1);
_ctrlBackground ctrlSetFade 0;
_ctrlBackground ctrlCommit FADE_DELAY;
private _ctrlPanel = _display displayCtrl IDC_leftTabContent;
_ctrlBackground ctrlCommit ([0, FADE_DELAY] select _animate);
// Force a "refresh" animation of the panel
_ctrlPanel ctrlSetFade 1;
_ctrlPanel ctrlCommit 0;
_ctrlPanel ctrlSetFade 0;
_ctrlPanel ctrlCommit FADE_DELAY;
_ctrlPanel lbSetCurSel -1;
// Handle icons and filling
private _selectedItem = switch (true) do {
// Primary weapons, secondary weapons, handgun weapons
case (_ctrlIDC in [IDC_buttonPrimaryWeapon, IDC_buttonHandgun, IDC_buttonSecondaryWeapon]): {
// Purge old data
lbClear _ctrlPanel;
// Add "Empty" entry
private _addEmpty = _ctrlPanel lbAdd format [" <%1>", localize "str_empty"];
_ctrlPanel lbSetValue [_addEmpty, -1];
// Add selected tab's weapons
private _index = [IDC_buttonPrimaryWeapon, IDC_buttonSecondaryWeapon, IDC_buttonHandgun] find _ctrlIDC;
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys ((GVAR(virtualItems) get IDX_VIRT_WEAPONS) get _index));
GVAR(currentItems) select _index
};
// Uniforms, vests, backpacks
case (_ctrlIDC in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBackpack]): {
// Purge old data
lbClear _ctrlPanel;
// Add "Empty" entry
private _addEmpty = _ctrlPanel lbAdd format [" <%1>", localize "str_empty"];
_ctrlPanel lbSetValue [_addEmpty, -1];
switch (_ctrlIDC) do {
// Add uniforms
case IDC_buttonUniform: {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIFORM));
GVAR(currentItems) select IDX_CURR_UNIFORM
};
// Add vests
case IDC_buttonVest: {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_VEST));
GVAR(currentItems) select IDX_CURR_VEST
};
// Add backpacks
case IDC_buttonBackpack: {
{
["CfgVehicles", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_BACKPACK));
GVAR(currentItems) select IDX_CURR_BACKPACK
};
};
};
// Other
default {
// Don't reset right panel selection if left tab is binos
if (_ctrlIDC != IDC_buttonBinoculars) then {
GVAR(currentRightPanel) = nil;
};
lbClear _ctrlPanel;
// For every left tab except faces and voices, add "Empty" entry
if !(_ctrlIDC in [IDC_buttonFace, IDC_buttonVoice]) then {
private _addEmpty = _ctrlPanel lbAdd format [" <%1>", localize "str_empty"];
_ctrlPanel lbSetValue [_addEmpty, -1];
};
switch (_ctrlIDC) do {
// Headgear
case IDC_buttonHeadgear: {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_HEADGEAR));
GVAR(currentItems) select IDX_CURR_HEADGEAR
};
// Facewear
case IDC_buttonGoggles: {
{
["CfgGlasses", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_GOGGLES));
GVAR(currentItems) select IDX_CURR_GOGGLES
};
// NVGs
case IDC_buttonNVG: {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_NVG));
GVAR(currentItems) select IDX_CURR_NVG
};
// Binoculars
case IDC_buttonBinoculars: {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_BINO));
GVAR(currentItems) select IDX_CURR_BINO
};
// Maps
case IDC_buttonMap: {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_MAP));
GVAR(currentItems) select IDX_CURR_MAP
};
// Compasses
case IDC_buttonCompass: {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_COMPASS));
GVAR(currentItems) select IDX_CURR_COMPASS
};
// Radios
case IDC_buttonRadio: {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_RADIO));
GVAR(currentItems) select IDX_CURR_RADIO
};
// Watches
case IDC_buttonWatch: {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_WATCH));
GVAR(currentItems) select IDX_CURR_WATCH
};
// GPS and UAV Terminals
case IDC_buttonGPS: {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_COMMS));
GVAR(currentItems) select IDX_CURR_COMMS
};
// Faces
case IDC_buttonFace: {
private _lbAdd = -1;
{
_y params ["_displayName", "_modPicture"];
_lbAdd = _ctrlPanel lbAdd _displayName;
_ctrlPanel lbSetData [_lbAdd, _x];
_ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _x]];
_ctrlPanel lbSetPictureRight [_lbAdd, _modPicture];
} forEach (uiNamespace getVariable QGVAR(faceCache));
GVAR(currentFace)
};
// Voices
case IDC_buttonVoice: {
{
["CfgVoice", _x, _ctrlPanel, "icon"] call FUNC(addListBoxItem);
} forEach (uiNamespace getVariable QGVAR(voiceCache));
GVAR(currentVoice)
};
// Insignia
case IDC_buttonInsignia: {
// Insignia from config
{
["CfgUnitInsignia", _x, _ctrlPanel, "texture"] call FUNC(addListBoxItem);
} forEach (uiNamespace getVariable QGVAR(insigniaCache));
private _displayName = "";
private _className = "";
private _lbAdd = -1;
// Insignia from mission file
{
_className = configName _x;
_displayName = getText (_x >> "displayName");
_lbAdd = _ctrlPanel lbAdd _displayName;
_ctrlPanel lbSetData [_lbAdd, _className];
_ctrlPanel lbSetPicture [_lbAdd, getText (_x >> "texture")];
_ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _className]];
} forEach ("(if (isNumber (_x >> 'scope')) then {getNumber (_x >> 'scope')} else {2}) == 2" configClasses (missionConfigFile >> "CfgUnitInsignia"));
GVAR(currentInsignia)
};
// Unknown
default {""};
};
};
if (_animate) then {
_ctrlPanel ctrlSetFade 1;
_ctrlPanel ctrlCommit 0;
_ctrlPanel ctrlSetFade 0;
_ctrlPanel ctrlCommit FADE_DELAY;
};
// When switching tabs, clear searchbox
if (GVAR(currentLeftPanel) != _ctrlIDC) then {
(_display displayCtrl IDC_leftSearchbar) ctrlSetText "";
(_display displayCtrl IDC_rightSearchbar) ctrlSetText "";
_ctrlPanel lbSetCurSel -1;
// Purge old data
lbClear _ctrlPanel;
// For every left tab except faces and voices, add "Empty" entry
if !(_ctrlIDC in [IDC_buttonFace, IDC_buttonVoice]) then {
private _addEmpty = _ctrlPanel lbAdd format [" <%1>", localize "str_empty"];
_ctrlPanel lbSetValue [_addEmpty, -1];
};
// Don't reset the current right panel for weapons, binos and containers
if !(_idxVirt in [IDX_VIRT_PRIMARY_WEAPONS, IDX_VIRT_SECONDARY_WEAPONS, IDX_VIRT_HANDGUN_WEAPONS, IDX_VIRT_BINO, IDX_VIRT_UNIFORM, IDX_VIRT_VEST, IDX_VIRT_BACKPACK]) then {
GVAR(currentRightPanel) = nil;
};
GVAR(currentLeftPanel) = _ctrlIDC;
// Add items to the listbox
private _selectedItem = if (_idxVirt != -1) then { // Items
private _configParent = switch (_idxVirt) do {
case IDX_VIRT_GOGGLES: {"CfgGlasses"};
case IDX_VIRT_BACKPACK: {"CfgVehicles"};
default {"CfgWeapons"};
};
private _items = if (_idxVirt < IDX_VIRT_HEADGEAR) then {
keys ((GVAR(virtualItems) get IDX_VIRT_WEAPONS) get _idxVirt)
} else {
keys (GVAR(virtualItems) get _idxVirt)
};
{
[_configParent, _x, _ctrlPanel] call FUNC(addListBoxItem);
} forEach _items;
GVAR(currentItems) select _idxVirt
} else { // Special cases
switch (_ctrlIDC) do {
// Faces
case IDC_buttonFace: {
private _lbAdd = -1; // micro-optimization
// Faces need to be added like this because their config path is
// configFile >> "CfgFaces" >> face category >> className
{
_y params ["_displayName", "_modPicture"];
_lbAdd = _ctrlPanel lbAdd _displayName;
_ctrlPanel lbSetData [_lbAdd, _x];
_ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _x]];
_ctrlPanel lbSetPictureRight [_lbAdd, ["", _modPicture] select GVAR(enableModIcons)];
} forEach GVAR(faceCache); // HashMap, not array
GVAR(currentFace)
};
// Voices
case IDC_buttonVoice: {
{
["CfgVoice", _x, _ctrlPanel, "icon"] call FUNC(addListBoxItem);
} forEach (keys GVAR(voiceCache));
GVAR(currentVoice)
};
// Insignia
case IDC_buttonInsignia: {
{
["CfgUnitInsignia", _x, _ctrlPanel, "texture", _y] call FUNC(addListBoxItem);
} forEach GVAR(insigniaCache);
GVAR(currentInsignia)
};
// Unknown
default {
WARNING_1("Unknown arsenal left panel with IDC %1, update ace_arsenal_idxMap and relevant macros if adding a new tab",_ctrlIDC);
""
};
};
};
// Trigger event
GVAR(currentLeftPanel) = _ctrlIDC;
[QGVAR(leftPanelFilled), [_display, _ctrlIDC, GVAR(currentRightPanel)]] call CBA_fnc_localEvent;
// Sort

View File

@ -1,12 +1,16 @@
#include "..\script_component.hpp"
#include "..\defines.hpp"
/*
* Author: Alganthe, johnb43
* Fill loadouts list.
* Author: Alganthe, johnb43, LinkIsGrim
* Fill loadouts list over multiple frames. LOADOUTS_PER_FRAME macro does what it says on the tin.
* Should only ever be called by display load (with optional params as default) and by itself.
* Listen to ace_arsenal_loadoutsListFilled event if you need to iterate over the loadouts list.
*
* Arguments:
* 0: Loadouts display <DISPLAY>
* 1: Tab control <CONTROL>
* 2: Current frame filling loadouts list <NUMBER> (default: 0)
* 3: Frames necessary to fill loadouts list <NUMBER> (default: -1)
*
* Return Value:
* None
@ -14,29 +18,46 @@
* Public: No
*/
params ["_display", "_control"];
// Can just be modified directly, no further setup needed
#define LOADOUTS_PER_FRAME 10
(_display displayCtrl IDC_textEditBox) ctrlSetText "";
params ["_display", "_control", ["_currentFrame", 0], ["_framesToFill", -1]];
if (isNull _display) exitWith {
TRACE_2("display closed, aborting",_currentFrame,_framesToFill);
};
private _contentPanelCtrl = _display displayCtrl IDC_contentPanel;
if (_currentFrame == 0) then {
(_display displayCtrl IDC_textEditBox) ctrlSetText "";
// Force a "refresh" animation of the panel
_contentPanelCtrl ctrlSetFade 1;
_contentPanelCtrl ctrlCommit 0;
_contentPanelCtrl ctrlSetFade 0;
_contentPanelCtrl ctrlCommit FADE_DELAY;
// Force a "refresh" animation of the panel
_contentPanelCtrl ctrlSetFade 1;
_contentPanelCtrl ctrlCommit 0;
_contentPanelCtrl ctrlSetFade 0;
_contentPanelCtrl ctrlCommit FADE_DELAY;
_contentPanelCtrl lnbSetCurSelRow -1;
lnbClear _contentPanelCtrl;
_contentPanelCtrl lnbSetCurSelRow -1;
lnbClear _contentPanelCtrl;
};
private _sharedLoadoutsVars = GVAR(sharedLoadoutsNamespace) getVariable QGVAR(sharedLoadoutsVars);
private _cfgWeapons = configFile >> "CfgWeapons";
private _cfgWeapons = configFile >> "CfgWeapons"; // Used by ADD_LOADOUTS_LIST_PICTURES macro, do not remove
private _newRow = -1;
if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
private _loadoutNameAndTab = "";
private _loadoutCachedInfo = "";
private _sharingEnabled = GVAR(allowSharedLoadouts) && {isMultiplayer};
private _loadouts = [
profileNamespace getVariable [QGVAR(saved_loadouts), []],
GVAR(defaultLoadoutsList)
] select (ctrlIDC _control == IDC_buttonDefaultLoadouts);
if (_currentFrame == 0) then {
_framesToFill = floor ((count _loadouts) / LOADOUTS_PER_FRAME);
TRACE_2("filling loadouts list",_currentFrame,_framesToFill);
_this set [3, _framesToFill];
};
// Add all loadouts to loadout list
{
@ -50,15 +71,16 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
_loadoutCachedInfo = [_loadoutData] call FUNC(verifyLoadout);
_contentPanelCtrl setVariable [_loadoutNameAndTab, _loadoutCachedInfo];
_loadoutCachedInfo params ["", "_nullItemsAmount", "_unavailableItemsAmount", "_nullItemsList", "_unavailableItemsList"];
_loadoutCachedInfo params ["", "_nullItemsList", "_unavailableItemsList", "_missingExtendedInfo"];
// Log missing / nil items to RPT (only once per arsenal session)
if (GVAR(EnableRPTLog) && {(_nullItemsAmount > 0) || {_unavailableItemsAmount > 0}}) then {
if (GVAR(EnableRPTLog) && {(_nullItemsList isNotEqualTo []) || {_unavailableItemsList isNotEqualTo [] || {_missingExtendedInfo isNotEqualTo []}}}) then {
private _printComponent = "ACE_Arsenal - Loadout:";
private _printNullItemsList = ["Missing items:", str _nullItemsList] joinString " ";
private _printUnavailableItemsList = ["Unavailable items:", str _unavailableItemsList] joinString " ";
private _printMissingExtendedInfo = ["Missing extended loadout:", str _missingExtendedInfo] joinString " ";
diag_log text (format ["%1%5 %2%5 %3%5 %4", _printComponent, "Name: " + _loadoutName, _printNullItemsList, _printUnavailableItemsList, endl]);
diag_log text (format ["%1%6 %2%6 %3%6 %4%6 %5", _printComponent, "Name: " + _loadoutName, _printNullItemsList, _printUnavailableItemsList, _printMissingExtendedInfo, endl]);
};
};
@ -69,18 +91,18 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
_contentPanelCtrl lnbSetColumnsPos [0, 0.05, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90];
};
_loadoutCachedInfo params ["_extendedLoadout", "_nullItemsAmount", "_unavailableItemsAmount"];
_extendedLoadout params ["_loadout"];
_loadoutCachedInfo params ["_extendedLoadout", "_nullItemsList", "_unavailableItemsList"];
_extendedLoadout params ["_loadout"]; // Used by ADD_LOADOUTS_LIST_PICTURES macro, do not remove
_newRow = _contentPanelCtrl lnbAddRow ["", _loadoutName];
ADD_LOADOUTS_LIST_PICTURES
// Change color on loadout lines that have items that aren't available or don't exist
if (_nullItemsAmount > 0) then {
if (_nullItemsList isNotEqualTo []) then {
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; // Red
} else {
if (_unavailableItemsAmount > 0) then {
if (_unavailableItemsList isNotEqualTo []) then {
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; // Gray
};
};
@ -90,10 +112,16 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
_contentPanelCtrl lnbSetPicture [[_newRow, 0], QPATHTOF(data\iconPublic.paa)];
_contentPanelCtrl lnbSetValue [[_newRow, 0], 1];
};
} forEach ([profileNamespace getVariable [QGVAR(saved_loadouts), []], GVAR(defaultLoadoutsList)] select (ctrlIDC _control == IDC_buttonDefaultLoadouts));
} forEach (_loadouts select [_currentFrame * LOADOUTS_PER_FRAME, [LOADOUTS_PER_FRAME, count _loadouts] select is3DEN]);
} else {
private _allPlayerNames = allPlayers apply {name _x};
private _loadouts = _sharedLoadoutsVars apply {GVAR(sharedLoadoutsNamespace) getVariable _x};
private _loadoutVar = "";
if (_currentFrame == 0) then {
_framesToFill = floor ((count _loadouts) / LOADOUTS_PER_FRAME);
TRACE_2("filling loadouts list",_currentFrame,_framesToFill);
_this set [3, _framesToFill];
};
{
_x params ["_playerName", "_loadoutName", "_loadoutData"];
@ -107,8 +135,8 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
[QGVAR(loadoutUnshared), [_contentPanelCtrl, profileName, _loadoutName]] call CBA_fnc_remoteEvent;
} else {
([_loadoutData] call FUNC(verifyLoadout)) params ["_extendedLoadout", "_nullItemsAmount", "_unavailableItemsAmount"];
_extendedLoadout params ["_loadout"];
([_loadoutData] call FUNC(verifyLoadout)) params ["_extendedLoadout", "_nullItemsList", "_unavailableItemsList"];
_extendedLoadout params ["_loadout"]; // Used by ADD_LOADOUTS_LIST_PICTURES macro, do not remove
_contentPanelCtrl lnbSetColumnsPos [0, 0.15, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90];
_newRow = _contentPanelCtrl lnbAddRow [_playerName, _loadoutName];
@ -118,17 +146,23 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
_contentPanelCtrl lnbSetData [[_newRow, 1], _loadoutVar];
// Change color on loadout lines that have items that aren't available or don't exist
if (_nullItemsAmount > 0) then {
if (_nullItemsList isNotEqualTo []) then {
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; // Red
} else {
if (_unavailableItemsAmount > 0) then {
if (_unavailableItemsList isNotEqualTo []) then {
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; // Gray
};
};
};
} forEach (_sharedLoadoutsVars apply {GVAR(sharedLoadoutsNamespace) getVariable _x});
} forEach (_loadouts select [_currentFrame * LOADOUTS_PER_FRAME, [LOADOUTS_PER_FRAME, count _loadouts] select is3DEN]);
};
if (!is3DEN && _currentFrame != _framesToFill) exitWith {
_this set [2, _currentFrame + 1];
[FUNC(fillLoadoutsList), _this] call CBA_fnc_execNextFrame;
};
TRACE_3("finished",_currentFrame,_framesToFill,lnbSize _contentPanelCtrl);
[QGVAR(loadoutsListFilled), [_display, _control]] call CBA_fnc_localEvent;
// Sort loadouts alphabetically

View File

@ -7,6 +7,7 @@
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Tab control <CONTROL>
* 2: Animate panel refresh <BOOL> (default: true)
*
* Return Value:
* None
@ -14,13 +15,13 @@
* Public: No
*/
params ["_display", "_control"];
params ["_display", "_control", ["_animate", true]];
// Fade old control background
if (!isNil QGVAR(currentRightPanel)) then {
private _previousCtrlBackground = _display displayCtrl (GVAR(currentRightPanel) - 1);
_previousCtrlBackground ctrlSetFade 1;
_previousCtrlBackground ctrlCommit FADE_DELAY;
_previousCtrlBackground ctrlCommit ([0, FADE_DELAY] select _animate);
};
// Show new control background
@ -28,7 +29,7 @@ private _ctrlIDC = ctrlIDC _control;
private _ctrlBackground = _display displayCtrl (_ctrlIDC - 1);
_ctrlBackground ctrlShow true;
_ctrlBackground ctrlSetFade 0;
_ctrlBackground ctrlCommit FADE_DELAY;
_ctrlBackground ctrlCommit ([0, FADE_DELAY] select _animate);
private _searchbarCtrl = _display displayCtrl IDC_rightSearchbar;
@ -43,12 +44,16 @@ private _cfgMagazines = configFile >> "CfgMagazines";
private _cfgWeapons = configFile >> "CfgWeapons";
private _rightPanelCache = uiNamespace getVariable QGVAR(rightPanelCache);
private _currentCargo = itemsWithMagazines GVAR(center);
private _currentCargo = []; // we only need this if we're filtering for favorites
if (GVAR(favoritesOnly)) then {
_currentCargo = itemsWithMagazines GVAR(center) + backpacks GVAR(center);
_currentCargo = _currentCargo arrayIntersect _currentCargo;
};
private _fnc_fillRightContainer = {
params ["_configCategory", "_className", "_hasItemInfo", ["_isUnique", false, [false]], ["_unknownOrigin", false, [false]]];
params ["_configCategory", "_className", ["_isUnique", false, [false]], ["_unknownOrigin", false, [false]]];
if (GVAR(favoritesOnly) && {!(_className in _currentCargo)} && {!((toLower _className) in GVAR(favorites))}) exitWith {};
if (GVAR(favoritesOnly) && {!(_className in _currentCargo)} && {!((toLowerANSI _className) in GVAR(favorites))}) exitWith {};
// If item is not in the arsenal, it must be unique
if (!_isUnique && {!(_className in GVAR(virtualItemsFlat))}) then {
@ -63,7 +68,6 @@ private _fnc_fillRightContainer = {
// "Misc. items" magazines (e.g. spare barrels, intel, photos)
if (_className in (uiNamespace getVariable QGVAR(magazineMiscItems))) then {
_configPath = _cfgMagazines >> _className;
_hasItemInfo = false;
};
// If an item with unknown origin is in the arsenal list, try to find it
@ -74,37 +78,18 @@ private _fnc_fillRightContainer = {
if (isNull _configPath) then {
_configPath = _className call CBA_fnc_getObjectConfig;
};
// Check if item is has item info
_itemInfo = isClass (_cfgWeapons >> configName _configPath);
};
// Get mass
private _mass = if (!_hasItemInfo) then {
getNumber (_configPath >> "mass")
} else {
private _mass = getNumber (_configPath >> "itemInfo" >> "mass");
if (_mass == 0) then {
_mass = getNumber (_configPath >> "WeaponSlotsInfo" >> "mass");
};
_mass
};
_rightPanelCache set [_className, _mass]; // Needed because this provides more accurate weight for FUNC(updateRightPanel)
[getText (_configPath >> "displayName"), getText (_configPath >> "picture"), _mass]
}, true]) params ["_displayName", "_picture", "_mass"];
[getText (_configPath >> "displayName"), getText (_configPath >> "picture")]
}, true]) params ["_displayName", "_picture"];
private _lbAdd = _ctrlPanel lnbAddRow ["", _displayName, "0"];
_ctrlPanel lnbSetText [[_lbAdd, 1], _displayName];
_ctrlPanel lnbSetData [[_lbAdd, 0], _className];
_ctrlPanel lnbSetPicture [[_lbAdd, 0], _picture];
_ctrlPanel lnbSetValue [[_lbAdd, 0], _mass];
_ctrlPanel lnbSetValue [[_lbAdd, 2], [0, 1] select _isUnique];
_ctrlPanel lnbSetValue [[_lbAdd, 2], parseNumber _isUnique];
_ctrlPanel lnbSetTooltip [[_lbAdd, 0], format ["%1\n%2", _displayName, _className]];
if ((toLower _className) in GVAR(favorites)) then {
if ((toLowerANSI _className) in GVAR(favorites)) then {
_ctrlPanel lnbSetColor [[_lbAdd, 1], FAVORITES_COLOR];
_ctrlPanel lnbSetColorRight [[_lbAdd, 1], FAVORITES_COLOR];
};
@ -113,15 +98,9 @@ private _fnc_fillRightContainer = {
private _ctrlPanel = _display displayCtrl IDC_rightTabContent;
private _listnBox = _display displayCtrl IDC_rightTabContentListnBox;
// Reset right panel content
lbClear _ctrlPanel;
lbClear _listnBox;
_ctrlPanel lbSetCurSel -1;
_listnBox lbSetCurSel -1;
// Retrieve compatible items
private _itemToCheck = "";
private _isContainer = false;
private _selectedItem = "";
private _compatibleItems = [];
private _compatibleMagsMuzzle = [];
private _compatibleMagsAll = createHashMap;
@ -153,12 +132,12 @@ switch (GVAR(currentLeftPanel)) do {
// Check if weapon attachement or magazine
if (_index != -1) then {
_itemToCheck = (GVAR(currentItems) select _currentWeaponItemsIndex) select _index;
_selectedItem = (GVAR(currentItems) select _currentWeaponItemsIndex) select _index;
// If weapon attachment, get base weapon; Get compatible items
if (_index <= 3) then {
_compatibleItems = compatibleItems _weapon;
_itemToCheck = _itemToCheck call FUNC(baseWeapon);
_selectedItem = _selectedItem call FUNC(baseWeapon);
} else {
// Get compatible magazines for primary & secondary muzzle (secondary muzzle is not guaranteed to exist)
// Assumption: One weapon can have two muzzles maximum
@ -170,7 +149,15 @@ switch (GVAR(currentLeftPanel)) do {
case IDC_buttonUniform;
case IDC_buttonVest;
case IDC_buttonBackpack: {
_ctrlPanel = _listnBox;
_isContainer = true;
// Get the currently selected item in panel
private _selectedItemIndex = lnbCurSelRow _listnBox;
// If something is selected, save it
if (_selectedItemIndex != -1) then {
_selectedItem = _listnBox lnbData [_selectedItemIndex, 0];
};
// This is for the "compatible magazines" tab when a container is open
if (_ctrlIDC == IDC_buttonMag) then {
@ -182,11 +169,24 @@ switch (GVAR(currentLeftPanel)) do {
};
};
// Reset right panel content
lbClear _ctrlPanel;
lnbClear _listnBox;
_ctrlPanel lbSetCurSel -1;
_listnBox lnbSetCurSelRow -1;
if (_isContainer) then {
_ctrlPanel = _listnBox;
};
// Force a "refresh" animation of the panel
_ctrlPanel ctrlSetFade 1;
_ctrlPanel ctrlCommit 0;
_ctrlPanel ctrlSetFade 0;
_ctrlPanel ctrlCommit FADE_DELAY;
if (_animate) then {
_ctrlPanel ctrlSetFade 1;
_ctrlPanel ctrlCommit 0;
_ctrlPanel ctrlSetFade 0;
_ctrlPanel ctrlCommit FADE_DELAY;
};
// Check if the left panel is a weapon. If so, right panel will be compatible items with weapon only
private _leftPanelState = GVAR(currentLeftPanel) in [IDC_buttonPrimaryWeapon, IDC_buttonHandgun, IDC_buttonSecondaryWeapon, IDC_buttonBinoculars];
@ -214,11 +214,11 @@ switch (_ctrlIDC) do {
} forEach _compatibleItems;
} else {
{
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
["CfgWeapons", _x] call _fnc_fillRightContainer;
} forEach (keys ((GVAR(virtualItems) get IDX_VIRT_ATTACHMENTS) get _index));
{
["CfgWeapons", _x, true, true] call _fnc_fillRightContainer;
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
} forEach (keys ((GVAR(virtualItems) get IDX_VIRT_UNIQUE_ATTACHMENTS) get _index));
};
};
@ -237,44 +237,44 @@ switch (_ctrlIDC) do {
case IDC_buttonMag: {
{
if (_x in (GVAR(virtualItems) get IDX_VIRT_ITEMS_ALL)) then {
["CfgMagazines", _x, false] call _fnc_fillRightContainer;
["CfgMagazines", _x] call _fnc_fillRightContainer;
continue;
};
if (_x in (GVAR(virtualItems) get IDX_VIRT_UNIQUE_VIRT_ITEMS_ALL)) then {
["CfgMagazines", _x, false, true] call _fnc_fillRightContainer;
["CfgMagazines", _x, true] call _fnc_fillRightContainer;
};
} forEach (keys _compatibleMagsAll);
};
// All magazines
case IDC_buttonMagALL: {
{
["CfgMagazines", _x, false] call _fnc_fillRightContainer;
["CfgMagazines", _x] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_ITEMS_ALL));
{
["CfgMagazines", _x, false, true] call _fnc_fillRightContainer;
["CfgMagazines", _x, true] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_VIRT_ITEMS_ALL));
};
// Grenades
case IDC_buttonThrow: {
{
["CfgMagazines", _x, false] call _fnc_fillRightContainer;
["CfgMagazines", _x] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_GRENADES));
{
["CfgMagazines", _x, false, true] call _fnc_fillRightContainer;
["CfgMagazines", _x, true] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_GRENADES));
};
// Explosives
case IDC_buttonPut: {
{
["CfgMagazines", _x, false] call _fnc_fillRightContainer;
["CfgMagazines", _x] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_EXPLOSIVES));
{
["CfgMagazines", _x, false, true] call _fnc_fillRightContainer;
["CfgMagazines", _x, true] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_EXPLOSIVES));
};
// Misc. items
@ -293,33 +293,35 @@ switch (_ctrlIDC) do {
// "Regular" misc. items
{
if !(_x in _items) then {
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
["CfgWeapons", _x] call _fnc_fillRightContainer;
};
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_MISC_ITEMS));
// Unique items
{
if !(_x in _items) then {
["CfgWeapons", _x, true, true] call _fnc_fillRightContainer;
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
};
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_MISC_ITEMS));
// Unique backpacks
{
if !(_x in _items) then {
["CfgVehicles", _x, false, true] call _fnc_fillRightContainer;
["CfgVehicles", _x, true] call _fnc_fillRightContainer;
};
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_BACKPACKS));
// Unique goggles
{
if !(_x in _items) then {
["CfgGlasses", _x, false, true] call _fnc_fillRightContainer;
// _y indicates if an item is truly unique or if it's a non-inventory item in a container (e.g. goggles in backpack)
["CfgGlasses", _x, _y] call _fnc_fillRightContainer;
};
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_GOGGLES));
} forEach (GVAR(virtualItems) get IDX_VIRT_UNIQUE_GOGGLES);
// Unknown items
{
if !(_x in _items) then {
["CfgWeapons", _x, true, true, true] call _fnc_fillRightContainer;
// _y indicates if an item is truly unique or if it's a non-inventory item in a container (e.g. helmet in backpack)
["CfgWeapons", _x, _y, true] call _fnc_fillRightContainer;
};
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_UNKNOWN_ITEMS));
} forEach (GVAR(virtualItems) get IDX_VIRT_UNIQUE_UNKNOWN_ITEMS); // if an item is here but in virtual items, it's just in the wrong place
};
// Custom buttons
default {
@ -331,23 +333,23 @@ switch (_ctrlIDC) do {
switch (true) do {
// "Regular" misc. items
case (_x in (GVAR(virtualItems) get IDX_VIRT_MISC_ITEMS)): {
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
["CfgWeapons", _x] call _fnc_fillRightContainer;
};
// Unique items
case (_x in (GVAR(virtualItems) get IDX_VIRT_UNIQUE_MISC_ITEMS)): {
["CfgWeapons", _x, true, true] call _fnc_fillRightContainer;
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
};
// Unique backpacks
case (_x in (GVAR(virtualItems) get IDX_VIRT_UNIQUE_BACKPACKS)): {
["CfgVehicles", _x, false, true] call _fnc_fillRightContainer;
["CfgVehicles", _x, true] call _fnc_fillRightContainer;
};
// Unique goggles
case (_x in (GVAR(virtualItems) get IDX_VIRT_UNIQUE_GOGGLES)): {
["CfgGlasses", _x, false, true] call _fnc_fillRightContainer;
["CfgGlasses", _x, GVAR(virtualItems) get IDX_VIRT_UNIQUE_GOGGLES get _x] call _fnc_fillRightContainer;
};
// Unknown items
case (_x in (GVAR(virtualItems) get IDX_VIRT_UNIQUE_UNKNOWN_ITEMS)): {
["CfgWeapons", _x, true, true, true] call _fnc_fillRightContainer;
["CfgWeapons", _x, GVAR(virtualItems) get IDX_VIRT_UNIQUE_UNKNOWN_ITEMS get _x, true] call _fnc_fillRightContainer;
};
};
} forEach _items;
@ -365,7 +367,7 @@ GVAR(currentRightPanel) = _ctrlIDC;
[QGVAR(rightPanelFilled), [_display, GVAR(currentLeftPanel), _ctrlIDC]] call CBA_fnc_localEvent;
// Add current items, change progress bar of container load and get relevant container
if (GVAR(currentLeftPanel) in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBackpack]) then {
if (_isContainer) then {
private _containerItems = [];
private _container = switch (GVAR(currentLeftPanel)) do {
// Uniform
@ -373,8 +375,8 @@ if (GVAR(currentLeftPanel) in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBack
// Update load bar
(_display displayCtrl IDC_loadIndicatorBar) progressSetPosition (loadUniform GVAR(center));
// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 3, 0, 0, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = uniformItems GVAR(center);
uniformContainer GVAR(center)
};
@ -383,8 +385,8 @@ if (GVAR(currentLeftPanel) in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBack
// Update load bar
(_display displayCtrl IDC_loadIndicatorBar) progressSetPosition (loadVest GVAR(center));
// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 0, 3, 0, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = vestItems GVAR(center);
vestContainer GVAR(center)
};
@ -393,8 +395,8 @@ if (GVAR(currentLeftPanel) in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBack
// Update load bar
(_display displayCtrl IDC_loadIndicatorBar) progressSetPosition (loadBackpack GVAR(center));
// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 0, 0, 3, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = backpackItems GVAR(center);
backpackContainer GVAR(center)
};
@ -402,7 +404,8 @@ if (GVAR(currentLeftPanel) in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBack
// Find out how many items of a type there are and update the number displayed
for "_lbIndex" from 0 to (lnbSize _ctrlPanel select 0) - 1 do {
_ctrlPanel lnbSetText [[_lbIndex, 2], str (_containerItems getOrDefault [_ctrlPanel lnbData [_lbIndex, 0], 0])];
private _xItem = _ctrlPanel lnbData [_lbIndex, 0];
_ctrlPanel lnbSetText [[_lbIndex, 2], str ({_xItem == _x} count _containerItems)];
};
// Refresh availibility of items based on space remaining in container
@ -412,17 +415,34 @@ if (GVAR(currentLeftPanel) in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBack
// Sorting
[_display, _control, _display displayCtrl IDC_sortRightTab, _display displayCtrl IDC_sortRightTabDirection] call FUNC(fillSort);
// Try to select previously selected item again, otherwise select first item ("Empty")
if (_itemToCheck != "") then {
private _index = 0;
if (_selectedItem != "") then {
if (_isContainer) then {
// Try to select previously selected item again, otherwise select nothing
private _index = -1;
for "_lbIndex" from 0 to (lbSize _ctrlPanel) - 1 do {
if ((_ctrlPanel lbData _lbIndex) == _itemToCheck) exitWith {
_index = _lbIndex;
for "_lbIndex" from 0 to (lnbSize _ctrlPanel select 0) - 1 do {
if ((_ctrlPanel lnbData [_lbIndex, 0]) == _selectedItem) exitWith {
_index = _lbIndex;
};
};
};
_ctrlPanel lbSetCurSel _index;
_ctrlPanel lnbSetCurSelRow _index;
} else {
// Try to select previously selected item again, otherwise select first item ("Empty")
private _index = 0;
for "_lbIndex" from 0 to (lbSize _ctrlPanel) - 1 do {
if ((_ctrlPanel lbData _lbIndex) == _selectedItem) exitWith {
_index = _lbIndex;
};
};
_ctrlPanel lbSetCurSel _index;
};
} else {
_ctrlPanel lbSetCurSel 0;
if (_isContainer) then {
_ctrlPanel lnbSetCurSelRow -1; // select nothing
} else {
_ctrlPanel lbSetCurSel 0; // select "Empty"
};
};

View File

@ -0,0 +1,39 @@
#include "..\script_component.hpp"
#include "..\defines.hpp"
/*
* Author: johnb43, Grim
* Gets list of virtual items available to the object.
*
* Arguments:
* 0: Target <OBJECT>
*
* Return Value:
* Virtual Items <HASHMAP>
*
* Example:
* cursorObject call ace_arsenal_fnc_getVirtualItems
*
* Public: Yes
*/
params [["_object", objNull, [objNull]]];
private _virtualItems = _object getVariable QGVAR(virtualItems);
if (isNil "_virtualItems") exitWith {createHashMap};
private _virtualItemsFlat = +_virtualItems;
private _weapons = _virtualItemsFlat deleteAt IDX_VIRT_WEAPONS;
private _attachments = _virtualItemsFlat deleteAt IDX_VIRT_ATTACHMENTS;
for "_index" from IDX_VIRT_ITEMS_ALL to IDX_VIRT_MISC_ITEMS do {
_virtualItemsFlat merge [_virtualItemsFlat deleteAt _index, true];
};
for "_index" from IDX_VIRT_PRIMARY_WEAPONS to IDX_VIRT_HANDGUN_WEAPONS do {
_virtualItemsFlat merge [_weapons deleteAt _index, true];
};
for "_index" from IDX_VIRT_OPTICS_ATTACHMENTS to IDX_VIRT_BIPOD_ATTACHMENTS do {
_virtualItemsFlat merge [_attachments deleteAt _index, true];
};
_virtualItemsFlat // return

View File

@ -7,7 +7,7 @@
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Current panel control <CONTROL>
* 2: Current panel selection <SCALAR>
* 2: Current panel selection <NUMBER>
* 3: Item config entry <CONFIG>
*
* Return Value:
@ -15,7 +15,6 @@
*
* Public: No
*/
params ["_display", "_control", "_curSel", "_itemCfg"];
GVAR(actionsInfo) = [_control, _curSel, _itemCfg];
@ -46,13 +45,12 @@ private _groups = (GVAR(actionList) select _panel) select {
};
private _show = _groups isNotEqualTo [];
private _ctrl = _display displayCtrl IDC_actionsBox;
_ctrl ctrlShow _show;
_ctrl ctrlCommit 0.15;
private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox;
_actionsBoxCtrl ctrlShow _show;
_actionsBoxCtrl ctrlCommit FADE_DELAY;
if (!_show) exitWith {};
private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox;
private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage;
private _currentPage = GVAR(currentActionPage);
@ -79,33 +77,29 @@ private _items = _group select 3 select {
};
_actionsCurrentPageCtrl ctrlSetText (_group select 1);
_actionsCurrentPageCtrl ctrlSetFade 0;
_actionsCurrentPageCtrl ctrlShow true;
_actionsCurrentPageCtrl ctrlCommit 0;
private _activeCtrls = [];
{
_x params ["", "_type", "_label", "_statement"];
private _idc = 9001 + _forEachIndex * 2;
private _actionTextCtrl = _display displayCtrl _idc;
private _actionButtonCtrl = _display displayCtrl (_idc + 1);
private _idc = IDC_actionsText1 + _type + _forEachIndex * 2;
private _actionCtrl = _display displayCtrl _idc;
switch (_type) do {
case ACTION_TYPE_BUTTON: {
_actionButtonCtrl ctrlRemoveAllEventHandlers "ButtonClick";
_actionButtonCtrl ctrlAddEventHandler ["ButtonClick", {
_actionCtrl ctrlRemoveAllEventHandlers "ButtonClick";
_actionCtrl ctrlAddEventHandler ["ButtonClick", {
if (is3DEN) exitWith {[true] call FUNC(refresh)};
[{
[true] call FUNC(refresh);
}] call CBA_fnc_execNextFrame;
}];
_actionButtonCtrl ctrlAddEventHandler ["ButtonClick", _statement];
_actionButtonCtrl ctrlSetText _label;
_actionButtonCtrl ctrlSetFade 0;
_actionButtonCtrl ctrlEnable true;
_actionButtonCtrl ctrlCommit 0;
_actionTextCtrl ctrlSetFade 1;
_actionTextCtrl ctrlCommit 0;
_actionCtrl ctrlAddEventHandler ["ButtonClick", _statement];
_actionCtrl ctrlSetText _label;
_actionCtrl ctrlEnable true;
};
case ACTION_TYPE_TEXT: {
private _text = call _statement;
@ -113,36 +107,43 @@ _actionsCurrentPageCtrl ctrlCommit 0;
if (isNil "_text") then {
_text = "";
};
if (_text isEqualType []) then {
_text = _text joinString endl;
};
_actionTextCtrl ctrlSetText _text;
_actionTextCtrl ctrlSetFade 0;
_actionTextCtrl ctrlCommit 0;
_actionButtonCtrl ctrlSetFade 1;
_actionButtonCtrl ctrlCommit 0;
};
default {
_actionTextCtrl ctrlSetFade 1;
_actionTextCtrl ctrlCommit 0;
_actionButtonCtrl ctrlSetFade 1;
_actionButtonCtrl ctrlCommit 0;
_actionCtrl ctrlSetText _text;
_actionCtrl ctrlSetPositionH (ctrlTextHeight _actionCtrl);
_actionCtrl ctrlEnable false;
};
};
if (_activeCtrls isNotEqualTo []) then {
(ctrlPosition (_activeCtrls select -1)) params ["", "_lastPosY", "", "_lastPosH"];
_actionCtrl ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H);
} else {
_actionCtrl ctrlSetPositionY ((5 + _type) * GRID_H);
};
_actionCtrl ctrlShow true;
_actionCtrl ctrlCommit 0;
_activeCtrls pushBack _actionCtrl;
} forEach _items;
private _actionCount = count _items;
{
private _idc = 9001 + _x * 2;
private _actionTextCtrl = _display displayCtrl _idc;
private _actionButtonCtrl = _display displayCtrl (_idc + 1);
private _idc = ctrlIDC _x;
if (_idc < IDC_actionsText1 || _idc > IDC_actionsButton5) then {continue};
_actionTextCtrl ctrlSetFade 1;
_actionTextCtrl ctrlCommit 0;
_actionButtonCtrl ctrlSetFade 1;
_actionButtonCtrl ctrlCommit 0;
} forEach ([0, 1, 2, 3, 4] select [_actionCount, 5]);
_x ctrlShow false;
_x ctrlEnable false;
_x ctrlSetPositionY 0;
_x ctrlCommit 0;
} forEach ((allControls _actionsBoxCtrl) select {!(_x in _activeCtrls)});
private _pos = ctrlPosition _actionsBoxCtrl;
_pos set [3, ([11, (5 * _actionCount) + 6] select (_actionCount > 0)) * GRID_H];
_actionsBoxCtrl ctrlSetPosition _pos;
(ctrlPosition (_activeCtrls select -1)) params ["", "_lastPosY", "", "_lastPosH"];
private _actionsBoxHeight = _lastPosY + _lastPosH + GRID_H;
_actionsBoxCtrl ctrlSetPositionH _actionsBoxHeight;
_actionsBoxCtrl ctrlCommit 0;
private _background = _display displayCtrl IDC_actionsBackground1;
_background ctrlSetPositionH _actionsBoxHeight;
_background ctrlCommit 0;

View File

@ -0,0 +1,28 @@
#include "..\script_component.hpp"
#include "..\defines.hpp"
/*
* Author: PabstMirror
* Handles user input in the search text boxes
*
* Arguments:
* 0: Search text input (left or right) <CONTROL>
* 1: Text <STRING>
*
* Return Value:
* None
*
* Public: No
*/
params ["_ctrl", "_newText"];
if (!GVAR(liveUpdateSearch)) exitWith {};
private _display = ctrlParent _ctrl;
if (GVAR(leftSearchbarFocus)) then {
[_display, _display displayCtrl IDC_leftSearchbar, false] call FUNC(handleSearchBar);
};
if (GVAR(rightSearchbarFocus)) then {
[_display, _display displayCtrl IDC_rightSearchbar, false] call FUNC(handleSearchBar);
};

View File

@ -0,0 +1,30 @@
#include "..\script_component.hpp"
#include "..\defines.hpp"
/*
* Author: PabstMirror
* Handles mouse clicks on search button to toggle live results
*
* Arguments:
* 0: Search button (left or right) <CONTROL>
* 1: Mouse Button <NUMBER>
* 2: Not used
* 3: Not used
* 4: Not used
* 5: Ctrl Button <BOOL>
*
* Return Value:
* None
*
* Public: No
*/
params ["_ctrl", "_mouseButton", "", "", "", "_keyCtrl"];
if ((!_keyCtrl)) exitWith {}; // Ignore if not CTRL + Click
GVAR(liveUpdateSearch) = !GVAR(liveUpdateSearch);
private _display = ctrlParent _ctrl;
private _color = if (GVAR(liveUpdateSearch)) then { [0,1,0,0.5] } else { [0,0,0,0.5] };
(_display displayCtrl IDC_leftSearchbarButton) ctrlSetBackgroundColor _color;
(_display displayCtrl IDC_rightSearchbarButton) ctrlSetBackgroundColor _color;

View File

@ -7,6 +7,7 @@
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Searchbar control <CONTROL>
* 2: Animate panel refresh <BOOL> (default: true)
*
* Return Value:
* None
@ -14,25 +15,28 @@
* Public: No
*/
params ["_display", "_control"];
params ["_display", "_control", ["_animate", true]];
forceUnicode 0; // handle non-ANSI characters
private _searchString = ctrlText _control;
private _searchPattern = "";
if (_searchString != "") then {
_searchString = _searchString call EFUNC(common,escapeRegex);
_searchString = ".*?" + (_searchString splitString " " joinString ".*?") + ".*?/io";
_searchPattern = _searchString call EFUNC(common,escapeRegex);
_searchPattern = ".*?" + (_searchPattern splitString " " joinString ".*?") + ".*?/io";
};
// Right panel search bar
if ((ctrlIDC _control) == IDC_rightSearchbar) then {
// Don't refill if there is no need
if (GVAR(lastSearchTextRight) != "" && {GVAR(lastSearchTextRight) isNotEqualTo _searchString}) then {
[_display, _display displayCtrl GVAR(currentRightPanel)] call FUNC(fillRightPanel);
if (GVAR(lastSearchTextRight) != "" && {(_searchString find GVAR(lastSearchTextRight)) != 0}) then {
[_display, _display displayCtrl GVAR(currentRightPanel), _animate] call FUNC(fillRightPanel);
};
GVAR(lastSearchTextRight) = _searchString;
// If nothing searched, quit here
if (_searchString == "") exitWith {};
if (_searchPattern == "") exitWith {};
private _rightPanelState = GVAR(currentLeftPanel) in [IDC_buttonPrimaryWeapon, IDC_buttonHandgun, IDC_buttonSecondaryWeapon, IDC_buttonBinoculars];
private _rightPanelCtrl = [_display displayCtrl IDC_rightTabContentListnBox, _display displayCtrl IDC_rightTabContent] select _rightPanelState;
@ -45,7 +49,7 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
// If something is selected, save it
if (_selectedItemIndex != -1) then {
_selectedItem = _rightPanelCtrl lbText _selectedItemIndex;
_selectedItem = _rightPanelCtrl lbData _selectedItemIndex;
};
private _currentDisplayName = "";
@ -57,7 +61,7 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
_currentClassname = _rightPanelCtrl lbData _lbIndex;
// Remove item in panel if it doesn't match search, skip otherwise
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchString) && {!(_currentClassname regexMatch _searchString)}}) then {
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchPattern) && {!(_currentClassname regexMatch _searchPattern)}}) then {
_rightPanelCtrl lbDelete _lbIndex;
};
};
@ -68,7 +72,7 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
// Try to find previously selected item in panel
for "_lbIndex" from 0 to (lbSize _rightPanelCtrl) - 1 do {
if ((_rightPanelCtrl lbText _lbIndex) == _selectedItem) exitWith {
if ((_rightPanelCtrl lbData _lbIndex) == _selectedItem) exitWith {
_index = _lbIndex;
};
};
@ -85,7 +89,7 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
// If something is selected, save it
if (_selectedItemIndex != -1) then {
_selectedItem = _rightPanelCtrl lnbText [_selectedItemIndex, 1];
_selectedItem = _rightPanelCtrl lnbData [_selectedItemIndex, 0];
};
private _currentDisplayName = "";
@ -97,7 +101,7 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
_currentClassname = _rightPanelCtrl lnbData [_lbIndex, 0];
// Remove item in panel if it doesn't match search, skip otherwise
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchString) && {!(_currentClassname regexMatch _searchString)}}) then {
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchPattern) && {!(_currentClassname regexMatch _searchPattern)}}) then {
_rightPanelCtrl lnbDeleteRow _lbIndex;
};
};
@ -108,7 +112,7 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
// Try to find previously selected item in panel
for "_lbIndex" from 0 to (lnbSize _rightPanelCtrl select 0) - 1 do {
if ((_rightPanelCtrl lnbText [_lbIndex, 1]) == _selectedItem) exitWith {
if ((_rightPanelCtrl lnbData [_lbIndex, 0]) == _selectedItem) exitWith {
_index = _lbIndex;
};
};
@ -124,14 +128,14 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
} else {
// Left panel search bar
// Don't refill if there is no need
if (GVAR(lastSearchTextLeft) != "" && {GVAR(lastSearchTextLeft) isNotEqualTo _searchString}) then {
[_display, _display displayCtrl GVAR(currentLeftPanel)] call FUNC(fillLeftPanel);
if (GVAR(lastSearchTextLeft) != "" && {(_searchString find GVAR(lastSearchTextLeft)) != 0}) then {
[_display, _display displayCtrl GVAR(currentLeftPanel), _animate] call FUNC(fillLeftPanel);
};
GVAR(lastSearchTextLeft) = _searchString;
// If nothing searched, quit here
if (_searchString == "") exitWith {};
if (_searchPattern == "") exitWith {};
private _leftPanelCtrl = _display displayCtrl IDC_leftTabContent;
@ -141,7 +145,7 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
// If something is selected, save it
if (_selectedItemIndex != -1) then {
_selectedItem = _leftPanelCtrl lbText _selectedItemIndex;
_selectedItem = _leftPanelCtrl lbData _selectedItemIndex;
};
private _currentDisplayName = "";
@ -153,7 +157,7 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
_currentClassname = _leftPanelCtrl lbData _lbIndex;
// Remove item in panel if it doesn't match search, skip otherwise
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchString) && {!(_currentClassname regexMatch _searchString)}}) then {
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchPattern) && {!(_currentClassname regexMatch _searchPattern)}}) then {
_leftPanelCtrl lbDelete _lbIndex;
};
};
@ -163,7 +167,7 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
private _index = -1;
for "_lbIndex" from 0 to (lbSize _leftPanelCtrl) - 1 do {
if ((_leftPanelCtrl lbText _lbIndex) == _selectedItem) exitWith {
if ((_leftPanelCtrl lbData _lbIndex) == _selectedItem) exitWith {
_index = _lbIndex;
};
};
@ -175,3 +179,6 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
[_display, nil, nil, configNull] call FUNC(itemInfo);
};
// Reset unicode flag
forceUnicode -1;

View File

@ -51,7 +51,10 @@ if (_global && {isMultiplayer} && {isNil {_object getVariable QGVAR(initBoxJIP)}
] call EFUNC(interact_menu,createAction);
[_object, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject);
[_object, _items, false] call FUNC(addVirtualItems);
// If items were set globally, do not add items locally
if (isNil {_object getVariable QGVAR(virtualItems)}) then {
[_object, _items, false] call FUNC(addVirtualItems);
};
[QGVAR(boxInitialized), [_object, _items]] call CBA_fnc_localEvent;
};

View File

@ -63,6 +63,7 @@ switch (ctrlIDC _control) do {
_saveButtonCtrl ctrlSetTooltip LLSTRING(buttonSaveTooltip);
};
_renameButtonCtrl ctrlEnable is3DEN; // no renaming mid-mission
_saveButtonCtrl ctrlEnable call FUNC(canEditDefaultLoadout);
_saveButtonCtrl ctrlCommit 0;
};

View File

@ -51,13 +51,6 @@ if (is3DEN) then {
["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 (!isNull curatorCamera && {ACE_player == player}) then {
curatorCamera cameraEffect ["Internal", "BACK"];
} else {
@ -85,10 +78,10 @@ if (!isNull curatorCamera) then {
// Make face and voice selection JIP compatible; 3DEN doesn't need this though
if (isMultiplayer && {!is3DEN}) then {
private _id = [QGVAR(broadcastFace), [GVAR(center), GVAR(currentFace)], QGVAR(centerFace_) + netId GVAR(center)] call CBA_fnc_globalEventJIP;
private _id = [QGVAR(broadcastFace), [GVAR(center), GVAR(currentFace)], QGVAR(centerFace_) + hashValue GVAR(center)] call CBA_fnc_globalEventJIP;
[_id, GVAR(center)] call CBA_fnc_removeGlobalEventJIP;
_id = [QGVAR(broadcastVoice), [GVAR(center), GVAR(currentVoice)], QGVAR(centerVoice_) + netId GVAR(center)] call CBA_fnc_globalEventJIP;
_id = [QGVAR(broadcastVoice), [GVAR(center), GVAR(currentVoice)], QGVAR(centerVoice_) + hashValue GVAR(center)] call CBA_fnc_globalEventJIP;
[_id, GVAR(center)] call CBA_fnc_removeGlobalEventJIP;
};
@ -104,11 +97,13 @@ GVAR(currentLeftPanel) = nil;
GVAR(currentRightPanel) = nil;
GVAR(leftSearchbarFocus) = nil;
GVAR(rightSearchbarFocus) = nil;
GVAR(liveUpdateSearch) = nil;
GVAR(shiftState) = nil;
GVAR(leftTabFocus) = nil;
GVAR(rightTabFocus) = nil;
GVAR(rightTabLnBFocus) = nil;
GVAR(ignoreFirstSortPanelCall) = nil;
GVAR(refreshing) = nil;
GVAR(selectedWeaponType) = nil;
GVAR(virtualItems) = nil;
@ -120,12 +115,11 @@ GVAR(currentVoice) = nil;
GVAR(currentInsignia) = nil;
GVAR(currentAction) = nil;
GVAR(showStats) = nil;
GVAR(currentStatPage) = nil;
GVAR(statsInfo) = nil;
GVAR(showActions) = nil;
GVAR(currentActionPage) = nil;
GVAR(actionsInfo) = nil;
profileNamespace setVariable [QGVAR(favorites), GVAR(favorites)];
GVAR(favoritesOnly) = nil;
@ -134,4 +128,6 @@ GVAR(favorites) = nil;
GVAR(center) = nil;
GVAR(centerNotPlayer) = nil;
GVAR(ignoredVirtualItems) = nil;
[QUOTE(ADDON), []] call EFUNC(common,showHud);

View File

@ -42,6 +42,10 @@ if (isNil QGVAR(defaultLoadoutsList)) then {
};
};
if (isNil {profileNamespace getVariable QGVAR(saved_loadouts)}) then {
profileNamespace setVariable [QGVAR(saved_loadouts), []];
};
if (isNil QGVAR(virtualItems)) then {
private _virtualItems = [
[IDX_VIRT_WEAPONS, createHashMapFromArray [[IDX_VIRT_PRIMARY_WEAPONS, createHashMap], [IDX_VIRT_SECONDARY_WEAPONS, createHashMap], [IDX_VIRT_HANDGUN_WEAPONS, createHashMap]]],
@ -57,40 +61,24 @@ if (isNil QGVAR(virtualItems)) then {
GVAR(virtualItems) = _virtualItems;
// Flatten out hashmaps for easy checking later
private _virtualItemsFlat = +_virtualItems;
private _weapons = _virtualItemsFlat deleteAt IDX_VIRT_WEAPONS;
private _attachments = _virtualItemsFlat deleteAt IDX_VIRT_ATTACHMENTS;
for "_index" from IDX_VIRT_ITEMS_ALL to IDX_VIRT_MISC_ITEMS do {
_virtualItemsFlat merge [_virtualItemsFlat deleteAt _index, true];
};
for "_index" from IDX_VIRT_PRIMARY_WEAPONS to IDX_VIRT_HANDGUN_WEAPONS do {
_virtualItemsFlat merge [_weapons deleteAt _index, true];
};
for "_index" from IDX_VIRT_OPTICS_ATTACHMENTS to IDX_VIRT_BIPOD_ATTACHMENTS do {
_virtualItemsFlat merge [_attachments deleteAt _index, true];
};
GVAR(virtualItemsFlat) = _virtualItemsFlat;
call FUNC(updateVirtualItemsFlat);
};
// Includes items not in the arsenal but equipped on player
GVAR(virtualItemsFlatAll) = +GVAR(virtualItemsFlat);
GVAR(currentFace) = face GVAR(center);
GVAR(currentVoice) = speaker GVAR(center);
GVAR(currentVoice) = (speaker GVAR(center)) call EFUNC(common,getConfigName);
GVAR(currentInsignia) = GVAR(center) call BIS_fnc_getUnitInsignia;
GVAR(currentAction) = "Stand";
GVAR(shiftState) = false;
GVAR(showStats) = true;
GVAR(currentStatPage) = 0;
GVAR(statsInfo) = [true, controlNull, nil, nil];
GVAR(showActions) = true;
GVAR(currentActionPage) = 0;
GVAR(actionsInfo) = [controlNull, nil, nil];
// Update current item list
call FUNC(updateCurrentItemsList);
@ -241,10 +229,12 @@ GVAR(currentLeftPanel) = nil;
GVAR(currentRightPanel) = nil;
GVAR(leftSearchbarFocus) = false;
GVAR(rightSearchbarFocus) = false;
GVAR(liveUpdateSearch) = false;
GVAR(leftTabFocus) = false;
GVAR(rightTabFocus) = false;
GVAR(rightTabLnBFocus) = false;
GVAR(ignoreFirstSortPanelCall) = false;
GVAR(refreshing) = false;
{
private _panel = _display displayCtrl _x;
@ -252,7 +242,15 @@ GVAR(ignoreFirstSortPanelCall) = false;
_panel ctrlCommit 0;
} forEach [IDC_leftTabContent, IDC_rightTabContent, IDC_rightTabContentListnBox];
[_display, _display displayCtrl IDC_buttonPrimaryWeapon] call FUNC(fillLeftPanel);
// Open left panel for current weapon, do some math
GVAR(selectedWeaponType) = [primaryWeapon GVAR(center), secondaryWeapon GVAR(center), handgunWeapon GVAR(center), binocular GVAR(center)] find (currentWeapon GVAR(center));
if (GVAR(selectedWeaponType) == -1) then {
GVAR(selectedWeaponType) = 0; // default to primary
};
private _leftPanelIDC = [IDC_buttonPrimaryWeapon, IDC_buttonSecondaryWeapon, IDC_buttonHandgun, IDC_buttonBinoculars] select GVAR(selectedWeaponType);
[_display, _display displayCtrl _leftPanelIDC] call FUNC(fillLeftPanel);
//--------------- Init camera
if (isNil QGVAR(cameraPosition)) then {

View File

@ -147,7 +147,7 @@ if (!isNull _loadoutsDisplay) then {
// Right panel lnb + and - buttons
case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): {
if (GVAR(rightTabLnBFocus)) then {
[_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo);
[_display, parseNumber (_keyPressed != DIK_LEFT)] call FUNC(buttonCargo);
};
};
};

View File

@ -27,9 +27,9 @@ private _favorited = false;
// Favorites/blacklist will always be lowercase to handle configCase changes
private _item = "";
if (_isLnB) then {
_item = toLower (_control lnbData [_curSel, 0]);
_item = toLowerANSI (_control lnbData [_curSel, 0]);
} else {
_item = toLower (_control lbData _curSel);
_item = toLowerANSI (_control lbData _curSel);
};
if (_item in GVAR(favorites)) then {

View File

@ -23,8 +23,9 @@ private _display = ctrlParent _control;
private _item = [_control lbData _curSel, _control lnbData [_curSel, 0]] select (ctrlType _control == CT_LISTNBOX);
// When having chosen a new category, see if the current right panel can be kept open, otherwise take default
private _selectCorrectPanelWeapon = [_display displayCtrl IDC_buttonOptic, _display displayCtrl GVAR(currentRightPanel)] select (!isNil QGVAR(currentRightPanel) && {GVAR(currentRightPanel) in [RIGHT_PANEL_ACC_IDCS, IDC_buttonCurrentMag, IDC_buttonCurrentMag2]});
private _selectCorrectPanelContainer = [_display displayCtrl IDC_buttonMisc, _display displayCtrl GVAR(currentRightPanel)] select (!isNil QGVAR(currentRightPanel) && {GVAR(currentRightPanel) in [RIGHT_PANEL_ITEMS_IDCS]});
private _currentRightPanel = _display displayCtrl GVAR(currentRightPanel);
private _selectCorrectPanelWeapon = [_display displayCtrl IDC_buttonOptic, _currentRightPanel] select (!isNil QGVAR(currentRightPanel) && {GVAR(currentRightPanel) in [RIGHT_PANEL_ACC_IDCS, IDC_buttonCurrentMag, IDC_buttonCurrentMag2]});
private _selectCorrectPanelContainer = [_display displayCtrl IDC_buttonMisc, _currentRightPanel] select (!isNil QGVAR(currentRightPanel) && {GVAR(currentRightPanel) in [RIGHT_PANEL_ITEMS_IDCS]});
// Remove all magazines from the current weapon that aren't compatible with the new weapon
private _fnc_clearCurrentWeaponMags = {
@ -115,7 +116,7 @@ switch (GVAR(currentLeftPanel)) do {
TOGGLE_RIGHT_PANEL_WEAPON
[_display, _selectCorrectPanelWeapon] call FUNC(fillRightPanel);
[_display, _selectCorrectPanelWeapon, !GVAR(refreshing) && {_currentRightPanel isNotEqualTo _selectCorrectPanelWeapon}] call FUNC(fillRightPanel);
};
// Make unit switch to new item
@ -191,7 +192,7 @@ switch (GVAR(currentLeftPanel)) do {
TOGGLE_RIGHT_PANEL_WEAPON
[_display, _selectCorrectPanelWeapon] call FUNC(fillRightPanel);
[_display, _selectCorrectPanelWeapon, !GVAR(refreshing) && {_currentRightPanel isNotEqualTo _selectCorrectPanelWeapon}] call FUNC(fillRightPanel);
};
// Make unit switch to new item
@ -273,7 +274,7 @@ switch (GVAR(currentLeftPanel)) do {
_this call FUNC(fillRightPanel);
}, [_display, _selectCorrectPanelWeapon]] call CBA_fnc_execNextFrame;
} else {
[_display, _selectCorrectPanelWeapon] call FUNC(fillRightPanel);
[_display, _selectCorrectPanelWeapon, !GVAR(refreshing) && {_currentRightPanel isNotEqualTo _selectCorrectPanelWeapon}] call FUNC(fillRightPanel);
};
};
@ -347,7 +348,7 @@ switch (GVAR(currentLeftPanel)) do {
TOGGLE_RIGHT_PANEL_CONTAINER
[_display, _selectCorrectPanelContainer] call FUNC(fillRightPanel);
[_display, _selectCorrectPanelContainer, !GVAR(refreshing) && {_currentRightPanel isNotEqualTo _selectCorrectPanelContainer}] call FUNC(fillRightPanel);
};
// Make unit switch to new item
@ -385,7 +386,7 @@ switch (GVAR(currentLeftPanel)) do {
TOGGLE_RIGHT_PANEL_CONTAINER
[_display, _selectCorrectPanelContainer] call FUNC(fillRightPanel);
[_display, _selectCorrectPanelContainer, !GVAR(refreshing) && {_currentRightPanel isNotEqualTo _selectCorrectPanelContainer}] call FUNC(fillRightPanel);
};
// Make unit switch to new item
@ -423,7 +424,7 @@ switch (GVAR(currentLeftPanel)) do {
TOGGLE_RIGHT_PANEL_CONTAINER
[_display, _selectCorrectPanelContainer] call FUNC(fillRightPanel);
[_display, _selectCorrectPanelContainer, !GVAR(refreshing) && {_currentRightPanel isNotEqualTo _selectCorrectPanelContainer}] call FUNC(fillRightPanel);
};
// Make unit switch to new item
@ -538,7 +539,7 @@ switch (GVAR(currentLeftPanel)) do {
TOGGLE_RIGHT_PANEL_WEAPON
[_display, _selectCorrectPanelWeapon] call FUNC(fillRightPanel);
[_display, _selectCorrectPanelWeapon, !GVAR(refreshing) && {_currentRightPanel isNotEqualTo _selectCorrectPanelWeapon}] call FUNC(fillRightPanel);
};
// Make unit switch to new item
@ -682,14 +683,19 @@ switch (GVAR(currentLeftPanel)) do {
TOGGLE_RIGHT_PANEL_HIDE
private _unitInsigniaConfig = configFile >> "CfgUnitInsignia" >> _item;
// Check for correct config: First mission, then campaign and finally regular config
private _itemCfg = missionConfigFile >> "CfgUnitInsignia" >> _item;
if (isNull _itemCfg) then {
_itemCfg = campaignConfigFile >> "CfgUnitInsignia" >> _item;
};
if (isNull _itemCfg) then {
_itemCfg = configFile >> "CfgUnitInsignia" >> _item;
};
// Display new items's info on the bottom right
if (isNull _unitInsigniaConfig) then {
[_display, _control, _curSel, missionConfigFile >> "CfgUnitInsignia" >> _item] call FUNC(itemInfo);
} else {
[_display, _control, _curSel, _unitInsigniaConfig] call FUNC(itemInfo);
};
[_display, _control, _curSel, _itemCfg] call FUNC(itemInfo);
};
};

View File

@ -28,13 +28,15 @@ if (
) exitWith {};
// If object has no arsenal and chosen option is to not ignore virtual items of object, exit
if (isNil {_object getVariable QGVAR(virtualItems)} && {!_mode}) exitWith {
private _virtualItems = _object getVariable QGVAR(virtualItems);
if (isNil "_virtualItems" && {!_mode}) exitWith {
[LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText);
};
// Don't execute in scheduled environment
if (canSuspend) exitWith {
[{_this call FUNC(openBox)}, _this] call CBA_fnc_directCall;
[FUNC(openBox), _this] call CBA_fnc_directCall;
};
private _displayToUse = findDisplay IDD_RSCDISPLAYCURATOR;
@ -46,53 +48,23 @@ if (isNull _displayToUse || {!isNil QGVAR(camera)}) exitWith {
[LLSTRING(CantOpenDisplay), false, 5, 1] call EFUNC(common,displayText);
};
GVAR(center) = _center;
GVAR(currentBox) = _object;
if (_mode) then {
// Add all the items from the game that the arsenal has detected
GVAR(virtualItems) = +(uiNamespace getVariable QGVAR(configItems));
GVAR(virtualItemsFlat) = +(uiNamespace getVariable QGVAR(configItemsFlat));
GVAR(ignoredVirtualItems) = true;
} else {
// Add only specified items to the arsenal
private _virtualItems = _object getVariable QGVAR(virtualItems);
GVAR(virtualItems) = if (isNil "_virtualItems") then {
_virtualItems = [
[IDX_VIRT_WEAPONS, createHashMapFromArray [[IDX_VIRT_PRIMARY_WEAPONS, createHashMap], [IDX_VIRT_SECONDARY_WEAPONS, createHashMap], [IDX_VIRT_HANDGUN_WEAPONS, createHashMap]]],
[IDX_VIRT_ATTACHMENTS, createHashMapFromArray [[IDX_VIRT_OPTICS_ATTACHMENTS, createHashMap], [IDX_VIRT_FLASHLIGHT_ATTACHMENTS, createHashMap], [IDX_VIRT_MUZZLE_ATTACHMENTS, createHashMap], [IDX_VIRT_BIPOD_ATTACHMENTS, createHashMap]]]
];
_virtualItems = createHashMapFromArray _virtualItems;
for "_index" from IDX_VIRT_ITEMS_ALL to IDX_VIRT_MISC_ITEMS do {
_virtualItems set [_index, createHashMap];
};
} else {
+_virtualItems
};
GVAR(virtualItems) = +_virtualItems;
// Flatten out hashmaps for easy checking later
private _virtualItemsFlat = +_virtualItems;
private _weapons = _virtualItemsFlat deleteAt IDX_VIRT_WEAPONS;
private _attachments = _virtualItemsFlat deleteAt IDX_VIRT_ATTACHMENTS;
for "_index" from IDX_VIRT_ITEMS_ALL to IDX_VIRT_MISC_ITEMS do {
_virtualItemsFlat merge [_virtualItemsFlat deleteAt _index, true];
};
for "_index" from IDX_VIRT_PRIMARY_WEAPONS to IDX_VIRT_HANDGUN_WEAPONS do {
_virtualItemsFlat merge [_weapons deleteAt _index, true];
};
for "_index" from IDX_VIRT_OPTICS_ATTACHMENTS to IDX_VIRT_BIPOD_ATTACHMENTS do {
_virtualItemsFlat merge [_attachments deleteAt _index, true];
};
GVAR(virtualItemsFlat) = _virtualItemsFlat;
call FUNC(updateVirtualItemsFlat);
};
GVAR(center) = _center;
if (is3DEN) then {
_displayToUse createDisplay QGVAR(display);
} else {

View File

@ -6,6 +6,8 @@
*
* Arguments:
* 0: Update current and unique items lists <BOOL> (default: true)
* 1: Update virtual items list <BOOL> (default: false)
* 2: Use panel refresh animation <BOOL> (default: false)
*
* Return Value:
* None
@ -15,19 +17,57 @@
*
* Public: Yes
*/
params [["_updateItems", true, [true]]];
params [["_updateItems", true, [true]], ["_updateVirtualItems", false, [false]], ["_animate", false, [false]]];
TRACE_2("",_updateItems,_updateVirtualItems);
// Don't execute in scheduled environment
if (canSuspend) exitWith {
[{_this call FUNC(refresh)}, _this] call CBA_fnc_directCall;
};
private _display = findDisplay IDD_ace_arsenal;
// Exit quietly if no display found
if (isNull _display) exitWith {};
if (_updateItems) then {
// Update current item list
call FUNC(updateCurrentItemsList);
// This takes care of unique inventory items (arsenal doesn't have it whitelisted)
if (!_updateVirtualItems) then {
call FUNC(updateUniqueItemsList);
};
};
private _virtualItems = GVAR(currentBox) getVariable QGVAR(virtualItems);
if (is3DEN) then {
_virtualItems = uiNamespace getVariable QGVAR(configItems); // GVAR(currentBox) is nil in 3DEN
_animate = true; // CBA frame functions are disabled during preInit
};
// Do not close an arsenal if it was opened with ignoring the existing content (see FUNC(openBox))
if (isNil "_virtualItems" && {isNil QGVAR(ignoredVirtualItems)}) exitWith {
[LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText);
// Delay a frame in case this is running on display open
[{(findDisplay IDD_ace_arsenal) closeDisplay 0}] call CBA_fnc_execNextFrame;
};
if (_updateVirtualItems) then {
GVAR(virtualItems) = +_virtualItems;
call FUNC(updateVirtualItemsFlat);
// Gotta update this regardless of condition to prevent desync
call FUNC(updateUniqueItemsList);
};
// Don't refresh left panel if in loadout tab
if (!isNull findDisplay IDD_loadouts_display) exitWith {};
private _display = findDisplay IDD_ace_arsenal;
if (!_animate) then {
GVAR(refreshing) = true;
[{GVAR(refreshing) = false}, nil, 3] call CBA_fnc_execAfterNFrames;
};
[_display, _display displayCtrl GVAR(currentLeftPanel)] call FUNC(fillLeftPanel);
[_display, _display displayCtrl GVAR(currentLeftPanel), _animate] call FUNC(fillLeftPanel);

View File

@ -1,4 +1,5 @@
#include "..\script_component.hpp"
#include "..\defines.hpp"
/*
* Author: Alganthe, johnb43
* Remove arsenal from target.
@ -24,7 +25,7 @@ private _id = _object getVariable QGVAR(initBoxJIP);
if (_global && {isMultiplayer} && {!isNil "_id"}) then {
// Remove event from JIP queue
[_id] call CBA_fnc_removeGlobalEventJIP;
_id call CBA_fnc_removeGlobalEventJIP;
// Reset JIP ID
_object setVariable [QGVAR(initBoxJIP), nil, true];
@ -39,3 +40,16 @@ if (_global && {isMultiplayer} && {!isNil "_id"}) then {
[_object, 0, ["ACE_MainActions", QGVAR(interaction)]] call EFUNC(interact_menu,removeActionFromObject);
[QGVAR(boxRemoved), _object] call CBA_fnc_localEvent;
};
// If the arsenal is already open and not ignoring content (see FUNC(openBox)), close arsenal display
// Deliberate == check, fail on objNull
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) == _object} && {isNil QGVAR(ignoredVirtualItems)}) then {
// Delay a frame in case this is running on display open/close
[{
private _display = findDisplay IDD_ace_arsenal;
if (isNull _display) exitWith {};
[LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText);
_display closeDisplay 0;
}] call CBA_fnc_execNextFrame;
};

View File

@ -17,8 +17,10 @@
*/
params [["_name", "", [""]], ["_global", false, [false]]];
if (_global) then {
[QGVAR(removeDefaultLoadout), [_name]] call CBA_fnc_remoteEvent;
if (_global) exitWith {
private _eventID = format [QGVAR(loadouts_%1), _name];
[_eventID] call CBA_fnc_removeGlobalEventJIP;
[QGVAR(removeDefaultLoadout), [_name]] call CBA_fnc_globalEvent;
};
GVAR(defaultLoadoutsList) deleteAt (GVAR(defaultLoadoutsList) findIf {(_x select 0) == _name});

View File

@ -31,7 +31,7 @@ private _tabToChange = [];
_stringCount = count _currentID;
// Make sure to keep at least 1 sort per category, so make default sort not deletable
if ("ace_alphabetically" in toLower (_currentID select [0, _stringCount - 3])) then {
if ("ace_alphabetically" in toLowerANSI (_currentID select [0, _stringCount - 3])) then {
continue;
};

View File

@ -100,5 +100,12 @@ if (_items isEqualType true) then {
[_object, _global] call FUNC(removeBox);
} else {
_object setVariable [QGVAR(virtualItems), _cargo, _global];
// If the arsenal is already open, refresh arsenal display
if (_global) then {
[QGVAR(refresh), _object] call CBA_fnc_globalEvent;
} else {
[QGVAR(refresh), _object] call CBA_fnc_localEvent;
};
};
};

View File

@ -25,7 +25,6 @@ if (count _loadout == 2) then {
if (count _loadout != 10) exitWith {[]};
private _weapon = "";
private _weaponsInfo = [];
private _uniqueBaseCfgText = "";
private _cfgWeapons = configFile >> "CfgWeapons";
@ -43,7 +42,7 @@ private _cfgVehicles = configFile >> "CfgVehicles";
// Check weapon & weapon attachments
{
// Magazines
// Magazines in weapons have 2 entries: Name and ammo count
if (_forEachIndex in [4, 5]) then {
_x params [["_magazine", ""], "_count"];
@ -69,23 +68,69 @@ private _cfgVehicles = configFile >> "CfgVehicles";
_x params [["_containerClass", ""], ["_items", []]];
if (_containerClass != "") then {
_uniqueBaseCfgText = (getText ([_cfgWeapons, _cfgVehicles] select (_forEachIndex == IDX_LOADOUT_BACKPACK) >> _containerClass >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName);
if (_forEachIndex == IDX_LOADOUT_BACKPACK) then {
// Check for non-preset first
_uniqueBaseCfgText = [_containerClass, "CfgVehicles"] call CBA_fnc_getNonPresetClass;
if (_uniqueBaseCfgText != "") then {
(_x select 0) set [0, _uniqueBaseCfgText];
if (_uniqueBaseCfgText != "") then {
_containerClass = _uniqueBaseCfgText;
};
// Check if non-preset backpack has a unique base
_uniqueBaseCfgText = (getText (_cfgVehicles >> _containerClass >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName);
if (_uniqueBaseCfgText != "") then {
_containerClass = _uniqueBaseCfgText;
};
_x set [0, _containerClass];
} else {
_uniqueBaseCfgText = (getText (_cfgWeapons >> _containerClass >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName);
if (_uniqueBaseCfgText != "") then {
_x set [0, _uniqueBaseCfgText];
};
};
// Check if container has items that need replacing with a defined base
{
switch (true) do {
// Containers have 2 entries: Name and isBackpack
case (_x isEqualTypeArray ["", false]);
case (_x isEqualTypeArray ["", false]): {
_x params ["_containerClass", "_isBackpack"];
if (_containerClass != "") then {
if (_isBackpack) then {
// Check for non-preset first
_uniqueBaseCfgText = [_containerClass, "CfgVehicles"] call CBA_fnc_getNonPresetClass;
if (_uniqueBaseCfgText != "") then {
_containerClass = _uniqueBaseCfgText;
};
// Check if non-preset backpack has a unique base
_uniqueBaseCfgText = (getText (_cfgVehicles >> _containerClass >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName);
if (_uniqueBaseCfgText != "") then {
_containerClass = _uniqueBaseCfgText;
};
_x set [0, _containerClass];
} else {
_uniqueBaseCfgText = (getText (_cfgWeapons >> _containerClass >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName);
if (_uniqueBaseCfgText != "") then {
_x set [0, _uniqueBaseCfgText];
};
};
};
};
// Misc. items have 2 entries: Name and amount
case (_x isEqualTypeArray ["", 0]): {
_x params ["_item", "_arg"];
_x params ["_item"];
if (_item != "") then {
_uniqueBaseCfgText = (getText ([_cfgWeapons, _cfgVehicles] select ((_arg isEqualType false) && {_arg}) >> _item >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName);
_uniqueBaseCfgText = (getText (_cfgWeapons >> _item >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName);
if (_uniqueBaseCfgText != "") then {
_x set [0, _uniqueBaseCfgText];
@ -94,7 +139,7 @@ private _cfgVehicles = configFile >> "CfgVehicles";
};
// Weapons have 2 entries: Weapon info array and amount
case (_x isEqualTypeArray [[], 0]): {
_weaponsInfo = _x select 0;
_x params ["_weaponsInfo"];
// Check weapon & weapon attachments
{

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