mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Compare commits
456 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ce873ad501 | ||
|
d56a3a6a95 | ||
|
96700e8dfd | ||
|
884ae78704 | ||
|
c5fb3d4cb0 | ||
|
3b10396d3b | ||
|
db7b78c068 | ||
|
284d3105db | ||
|
a894fc78c3 | ||
|
da73cf979d | ||
|
18bd1acc33 | ||
|
cc00f5e551 | ||
|
008606f636 | ||
|
fb177e43c5 | ||
|
ed1d42f71d | ||
|
42d2322ac0 | ||
|
0983c9b3bb | ||
|
8161e5ceed | ||
|
9cfdf3dc19 | ||
|
17f2de4ec1 | ||
|
59314edf62 | ||
|
7279b94945 | ||
|
b36961937c | ||
|
9d429b8be5 | ||
|
fad9244104 | ||
|
4d088fd828 | ||
|
8d2b2ce3b9 | ||
|
a1cafef5ae | ||
|
2c4c7c2fdf | ||
|
8ac2d09c31 | ||
|
1f67058dda | ||
|
87333a1218 | ||
|
7cdafe1d10 | ||
|
dcf49d77eb | ||
|
7790028aa7 | ||
|
f564016b4b | ||
|
53a42fc89e | ||
|
afde7264ba | ||
|
82f5019488 | ||
|
15a5e74649 | ||
|
1dae884fff | ||
|
6304a9e5f3 | ||
|
b4700aeffc | ||
|
e798050a00 | ||
|
abced51bb0 | ||
|
b2091f0e4d | ||
|
ffba612011 | ||
|
52c19d53af | ||
|
0643ca6fd9 | ||
|
c292f0ed31 | ||
|
80b2fa9a05 | ||
|
2682778499 | ||
|
962b498e6a | ||
|
81f44e6e7a | ||
|
35658e41cc | ||
|
1b210d80a7 | ||
|
b72ce6180a | ||
|
fcfb2121be | ||
|
22f97270f6 | ||
|
bdf6a179ad | ||
|
094e235f7a | ||
|
043b3907fe | ||
|
1cd48c52c3 | ||
|
e5178fe6fd | ||
|
8e2398d7cc | ||
|
0164b6259f | ||
|
6572422ec7 | ||
|
8dbad08838 | ||
|
903f046810 | ||
|
4014cd5539 | ||
|
f3e2e11693 | ||
|
3728bc4b8b | ||
|
3229336018 | ||
|
740869e859 | ||
|
a2be42ba57 | ||
|
62ba5ffe24 | ||
|
b96d74fb11 | ||
|
7cd2b9820b | ||
|
a99c78cf87 | ||
|
3d86fffef6 | ||
|
cf3a86ffc7 | ||
|
72f230a3a2 | ||
|
f3938ba0cc | ||
|
5e65e56c5e | ||
|
198c09dccd | ||
|
ada7b93219 | ||
|
43d42c85cd | ||
|
285f903b14 | ||
|
3ff635f82d | ||
|
fff66bc27c | ||
|
c8e7b6396b | ||
|
be23ae7ecd | ||
|
70c8322392 | ||
|
b7f48a912f | ||
|
ff31bc69a8 | ||
|
0b4029b12f | ||
|
96f81f1c9b | ||
|
e36363e8cc | ||
|
346d56c659 | ||
|
e181cffc83 | ||
|
d7c98ea366 | ||
|
9e4bcc5d72 | ||
|
22c71ba80e | ||
|
b2a3fac4b6 | ||
|
4db0f7de24 | ||
|
5afe06999f | ||
|
0b2a8f23e6 | ||
|
7838dea543 | ||
|
80a310d4c6 | ||
|
b9a361fd39 | ||
|
973cfdd1c4 | ||
|
92e10bc578 | ||
|
f4f2dbaad9 | ||
|
c31ef9e16b | ||
|
cd678c5b90 | ||
|
4226cd383e | ||
|
c491b78468 | ||
|
2db56cc4bb | ||
|
90d855c2c5 | ||
|
6a25e9365a | ||
|
4e56d58210 | ||
|
98da279e8f | ||
|
7e93715bcc | ||
|
a6ab050a07 | ||
|
56eae4060c | ||
|
e3d8f40538 | ||
|
aa6e5c30ec | ||
|
b7cd72e936 | ||
|
ba22c407e3 | ||
|
8eefffe811 | ||
|
b85150e6eb | ||
|
e99d6d9381 | ||
|
bfbaae65e1 | ||
|
74de646a02 | ||
|
cb3c18c2fb | ||
|
43c1f97dfa | ||
|
db339ab8e3 | ||
|
b6e9cabc34 | ||
|
05c7f84b01 | ||
|
3f5a2ee64b | ||
|
f6c5425733 | ||
|
4cb358ebf2 | ||
|
a7ce63a536 | ||
|
5d133bd793 | ||
|
05ab1bbe99 | ||
|
8ab36f64ff | ||
|
5cada7d397 | ||
|
68738316c2 | ||
|
37d7c4c544 | ||
|
2c3396a4e8 | ||
|
8f84df77d0 | ||
|
f4272f0e36 | ||
|
66c31928ab | ||
|
ec5b84c278 | ||
|
63d1ab82a7 | ||
|
f65138f65e | ||
|
edc7e9af3e | ||
|
3745305323 | ||
|
4d0641abb8 | ||
|
dae2c5b465 | ||
|
7b0e5b6416 | ||
|
b714c8bce2 | ||
|
ee0e947611 | ||
|
516eb48c93 | ||
|
45f9301019 | ||
|
aecafe673b | ||
|
ba47c12a97 | ||
|
71afce53c1 | ||
|
cb40c8ec5d | ||
|
a30afe69b7 | ||
|
bfa23f01db | ||
|
ad4af0d553 | ||
|
b013ab81d5 | ||
|
5c8ea65f7c | ||
|
bdb6c7c69c | ||
|
aed2222b81 | ||
|
05d6327e5e | ||
|
c9e82afff7 | ||
|
56016a4816 | ||
|
f45dff8a09 | ||
|
f86e882b18 | ||
|
cd66f495ad | ||
|
1f5044aabd | ||
|
18ea360b1e | ||
|
7ea2aab2c9 | ||
|
db6c4a72a6 | ||
|
1439680795 | ||
|
c4fb858c1d | ||
|
5ea202ce25 | ||
|
c8be3a4e05 | ||
|
1c6c4d6bff | ||
|
8fc093de8f | ||
|
95b7951919 | ||
|
421071027e | ||
|
c28a3d6cdf | ||
|
f3722bf5e8 | ||
|
2dc0cd4fc4 | ||
|
7a6c837f1b | ||
|
34362d48eb | ||
|
d4d69b9141 | ||
|
690ee55369 | ||
|
70b0a4c434 | ||
|
59af3e1f6d | ||
|
898daff7f6 | ||
|
9760095c42 | ||
|
2bd1f39de7 | ||
|
a85074a797 | ||
|
c862c47617 | ||
|
41d6cae93b | ||
|
d66c3904d0 | ||
|
46e840b5a2 | ||
|
97bc371f5c | ||
|
130348d3a5 | ||
|
565d64d50e | ||
|
33dc7e3dbd | ||
|
c44a1e7ea7 | ||
|
73111fa0fd | ||
|
738a32dba9 | ||
|
06f47e600d | ||
|
29728352e2 | ||
|
7c689bdff7 | ||
|
fe9f59bed7 | ||
|
60eabda47e | ||
|
99bb6983bb | ||
|
1cca2db964 | ||
|
dc56cdbd8b | ||
|
9f2ee9fb6f | ||
|
5a1e3bc585 | ||
|
d30c01aee9 | ||
|
98f4b51c52 | ||
|
d9a2aa01a4 | ||
|
8c0d0944c6 | ||
|
120589512e | ||
|
440b9d5721 | ||
|
0034f4b9cc | ||
|
e535988479 | ||
|
be61424fed | ||
|
be9797d11d | ||
|
be77ef233e | ||
|
d7c1984a5a | ||
|
dc3753893f | ||
|
22c6621878 | ||
|
05ebe1f48f | ||
|
c634bbe1ab | ||
|
c0d74ba703 | ||
|
7c65f8503d | ||
|
f97f11d224 | ||
|
67fe22a5a6 | ||
|
e1137ac903 | ||
|
c03e08e51b | ||
|
052f1c95a3 | ||
|
99d7e4d57b | ||
|
52762c1e62 | ||
|
4cf61a026b | ||
|
db2bf60c28 | ||
|
a31608073e | ||
|
b26d6543a6 | ||
|
9efd60d798 | ||
|
6972f02bc4 | ||
|
2a3ff8e185 | ||
|
62353a9175 | ||
|
8e367ee80e | ||
|
7b0c1c425d | ||
|
9d168756df | ||
|
4f1c2fa8d7 | ||
|
3987c62acc | ||
|
0f5b7c8762 | ||
|
7c4f4cf8f8 | ||
|
6e32fc1144 | ||
|
3b806295f7 | ||
|
60b87f0b41 | ||
|
872d460e6d | ||
|
b513a110f5 | ||
|
a12ad9ec59 | ||
|
1eca83db9f | ||
|
c17873dcad | ||
|
9e6f624a68 | ||
|
a0e4f09555 | ||
|
5a6d6a73df | ||
|
97257ca77a | ||
|
ac9ffb5276 | ||
|
23842aab39 | ||
|
7480ae377d | ||
|
dda6b9d2dc | ||
|
b637a0ea09 | ||
|
32707dd860 | ||
|
6165b46ab6 | ||
|
bcf1133477 | ||
|
2b5ea1628f | ||
|
3255dbef36 | ||
|
5130a22008 | ||
|
095ce88279 | ||
|
0c529446ec | ||
|
6a2f3a21f2 | ||
|
f3f7f2c492 | ||
|
431c4d616e | ||
|
5ca3465b8a | ||
|
f5e8e06c24 | ||
|
04ac1d8808 | ||
|
dce7da60c9 | ||
|
8f46ffd8d5 | ||
|
ccb3e65734 | ||
|
d312792631 | ||
|
0d401b2664 | ||
|
e6cc5fca89 | ||
|
a72b3a43a5 | ||
|
558849b91c | ||
|
020d21d562 | ||
|
19e0064730 | ||
|
613fc36385 | ||
|
cc3fbc5f3f | ||
|
0375d0dae6 | ||
|
316bb355ad | ||
|
a5a3fe4232 | ||
|
7171ca7947 | ||
|
35d40e614c | ||
|
8805414669 | ||
|
8165201565 | ||
|
16411f0a5c | ||
|
3a232bbfa8 | ||
|
ac09cea0d0 | ||
|
64e16a2136 | ||
|
c8eebf461b | ||
|
7ddd62f4d3 | ||
|
0c589c2346 | ||
|
d9f6beacc5 | ||
|
dd256bfb18 | ||
|
0365565efc | ||
|
0d45a85db6 | ||
|
6c52cfa95f | ||
|
193f52222b | ||
|
686498680f | ||
|
134951f331 | ||
|
b919da797b | ||
|
3ddf147238 | ||
|
cfbadca621 | ||
|
9293623d9e | ||
|
a4dbff3ff8 | ||
|
9daf71edd0 | ||
|
cbb160c1e0 | ||
|
415d2f685c | ||
|
2a52ad14c4 | ||
|
48bdc6fbcd | ||
|
46cc49dc1e | ||
|
3bba9735c7 | ||
|
512ceaa1a1 | ||
|
dc7d7b1429 | ||
|
4952c09f41 | ||
|
c88e1abd0e | ||
|
cee187adac | ||
|
a8ed533004 | ||
|
5ca81b7ef3 | ||
|
31217ae5d0 | ||
|
80417b114d | ||
|
86f1b6b142 | ||
|
58f6430bb6 | ||
|
2456c445b2 | ||
|
9a5cb8bd91 | ||
|
3c5b46c42d | ||
|
50978efa46 | ||
|
b4eaa1e270 | ||
|
af3c95a5a6 | ||
|
8c69bd25ea | ||
|
017d47f8c9 | ||
|
c5b54c65a8 | ||
|
e7827813ee | ||
|
11844ef05e | ||
|
0856e58ae9 | ||
|
3cafac2f67 | ||
|
de106c3418 | ||
|
a332ad7095 | ||
|
5e1771aecd | ||
|
0dabc678f6 | ||
|
e5145ba4f7 | ||
|
dd32190dfa | ||
|
d54ba4ddcf | ||
|
9bb9fae85c | ||
|
a3b9c53fd8 | ||
|
8e975a6b91 | ||
|
d7e5ea4898 | ||
|
f1488c9c88 | ||
|
4694974054 | ||
|
e06c6f7835 | ||
|
aa3917c299 | ||
|
6ea0312770 | ||
|
78334e2be4 | ||
|
61ca55f268 | ||
|
86580f3d6f | ||
|
f76485ff3a | ||
|
f63704911e | ||
|
67fa53fd2c | ||
|
b1520a9aaf | ||
|
a85a65331f | ||
|
fd22ff04c5 | ||
|
22deb3af79 | ||
|
64538f2ad0 | ||
|
2036c83dc8 | ||
|
b828a14afa | ||
|
6de7d60636 | ||
|
8a67744cd4 | ||
|
bfbfc66d1c | ||
|
c4688f2ae5 | ||
|
5111062e6d | ||
|
147f28d443 | ||
|
4d487dc33e | ||
|
fd7a5004f0 | ||
|
fd5e56ffbc | ||
|
a0f3933bf0 | ||
|
05a5ccd140 | ||
|
1002dfe31b | ||
|
d6eb6b981c | ||
|
1e1d1d63f2 | ||
|
b2849aaa29 | ||
|
f3f9d18f55 | ||
|
bb7b05fd0d | ||
|
95ec6eb765 | ||
|
a47ae27080 | ||
|
cdc51643bb | ||
|
e75ef3de06 | ||
|
6928adfc72 | ||
|
41c7b12acb | ||
|
ee79decb45 | ||
|
802560da8a | ||
|
1649422cbd | ||
|
2f9b7002c3 | ||
|
28e45c2979 | ||
|
ae532c72f7 | ||
|
8731bcc8b5 | ||
|
6637a15af9 | ||
|
e69ffb6f21 | ||
|
8de0740e94 | ||
|
244bee4a61 | ||
|
77a49a081a | ||
|
907758385c | ||
|
5a3f3d3b82 | ||
|
b54992b8fc | ||
|
a3aef6a066 | ||
|
6c60b67494 | ||
|
4bb9d6c42c | ||
|
b440cf9cb2 | ||
|
f1e3753606 | ||
|
5bd1fa7629 | ||
|
ef9195f21a | ||
|
1e404cf85b | ||
|
8d6555ad0f | ||
|
2a6fd19762 | ||
|
7696d9aa2e | ||
|
a97a8dbb73 | ||
|
6ba46ffa90 | ||
|
c150d923f7 | ||
|
7bc3fab533 | ||
|
4470b1f341 | ||
|
7e255bf05b | ||
|
d8961c68d6 | ||
|
4756bb6f8c | ||
|
824679e40a |
@ -11,5 +11,8 @@ trim_trailing_whitespace = true
|
|||||||
[*.md]
|
[*.md]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.yml]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
[Makefile]
|
[Makefile]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
4
.github/ISSUE_TEMPLATE/bug_report.md
vendored
4
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -23,14 +23,14 @@ All good? Then proceed and fill out the items below.
|
|||||||
**Mods (complete and add to the following information):**
|
**Mods (complete and add to the following information):**
|
||||||
- **Arma 3:** `x.xx` [e.g. 1.00 stable, rc, dev]
|
- **Arma 3:** `x.xx` [e.g. 1.00 stable, rc, dev]
|
||||||
- **CBA:** `3.x.x` [e.g. 3.0.0 stable, commit hash]
|
- **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! -->
|
<!-- Make sure to reproduce the issue with only CBA and ACE3 on a newly created mission! -->
|
||||||
|
|
||||||
**Description:**
|
**Description:**
|
||||||
A clear and concise description of what the bug is.
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
**Steps to reproduce:**
|
**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 ..._
|
1. _Go to ..._
|
||||||
2. _Click ..._
|
2. _Click ..._
|
||||||
|
10
.github/release-drafter.yml
vendored
10
.github/release-drafter.yml
vendored
@ -11,11 +11,10 @@ sort-direction: ascending
|
|||||||
categories:
|
categories:
|
||||||
- title: '**ADDED:**'
|
- title: '**ADDED:**'
|
||||||
labels:
|
labels:
|
||||||
- 'kind/feature request'
|
- 'kind/feature'
|
||||||
- 'kind/added feature'
|
|
||||||
- title: '**FIXED:**'
|
- title: '**FIXED:**'
|
||||||
labels:
|
labels:
|
||||||
- 'kind/bug fix'
|
- 'kind/bug-fix'
|
||||||
- title: '**IMPROVED:**'
|
- title: '**IMPROVED:**'
|
||||||
labels:
|
labels:
|
||||||
- 'kind/enhancement'
|
- 'kind/enhancement'
|
||||||
@ -23,17 +22,16 @@ categories:
|
|||||||
- title: '**CHANGED:**'
|
- title: '**CHANGED:**'
|
||||||
labels:
|
labels:
|
||||||
- 'kind/cleanup'
|
- 'kind/cleanup'
|
||||||
- 'area/compatibility'
|
|
||||||
- 'kind/change'
|
- 'kind/change'
|
||||||
- title: '**SETTINGS:**'
|
- title: '**SETTINGS:**'
|
||||||
labels:
|
labels:
|
||||||
- 'kind/setting'
|
- 'kind/setting'
|
||||||
- title: '**TRANSLATIONS:**'
|
- title: '**TRANSLATIONS:**'
|
||||||
labels:
|
labels:
|
||||||
- 'area/translations'
|
- 'kind/translation'
|
||||||
|
|
||||||
exclude-labels:
|
exclude-labels:
|
||||||
- 'ignore changelog'
|
- 'ignore-changelog'
|
||||||
- 'dependencies'
|
- 'dependencies'
|
||||||
|
|
||||||
change-template: '- $TITLE (#$NUMBER)'
|
change-template: '- $TITLE (#$NUMBER)'
|
||||||
|
11
.github/workflows/arma.yml
vendored
11
.github/workflows/arma.yml
vendored
@ -27,15 +27,6 @@ jobs:
|
|||||||
- name: Validate function headers
|
- name: Validate function headers
|
||||||
run: python3 docs/tools/document_functions.py --debug
|
run: python3 docs/tools/document_functions.py --debug
|
||||||
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout the source code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Lint (sqflint)
|
|
||||||
uses: arma-actions/sqflint@master
|
|
||||||
continue-on-error: true # No failure due to many false-positives
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -48,7 +39,7 @@ jobs:
|
|||||||
- name: Rename build folder
|
- name: Rename build folder
|
||||||
run: mv .hemttout/build .hemttout/@ace
|
run: mv .hemttout/build .hemttout/@ace
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ace3-${{ github.sha }}-nobin
|
name: ace3-${{ github.sha }}-nobin
|
||||||
path: .hemttout/@*
|
path: .hemttout/@*
|
||||||
|
4
.github/workflows/documentation.yml
vendored
4
.github/workflows/documentation.yml
vendored
@ -47,7 +47,7 @@ jobs:
|
|||||||
destination: docs/_site/
|
destination: docs/_site/
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: jekyll-site
|
name: jekyll-site
|
||||||
path: docs/_site/
|
path: docs/_site/
|
||||||
@ -63,7 +63,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download Artifacts
|
- name: Download Artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: jekyll-site
|
name: jekyll-site
|
||||||
path: _site/
|
path: _site/
|
||||||
|
68
.github/workflows/extensions.yml
vendored
68
.github/workflows/extensions.yml
vendored
@ -1,29 +1,65 @@
|
|||||||
name: Extensions
|
name: Extensions
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- 'extensions/**'
|
- 'extension/**'
|
||||||
|
- 'Cargo.toml'
|
||||||
|
- 'Cargo.lock'
|
||||||
|
- '.github/workflows/extensions.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout the source code
|
||||||
|
uses: actions/checkout@master
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
rustup toolchain update stable --no-self-update
|
||||||
|
rustup default stable
|
||||||
|
rustup component add clippy rustfmt
|
||||||
|
- name: Run rustfmt
|
||||||
|
run: cargo fmt -- --check
|
||||||
|
- name: Run clippy
|
||||||
|
run: cargo clippy --all -- -Dwarnings
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: xd009642/tarpaulin
|
||||||
|
options: --security-opt seccomp=unconfined
|
||||||
|
steps:
|
||||||
|
- name: Checkout the source code
|
||||||
|
uses: actions/checkout@master
|
||||||
|
- name: Test & Coverage
|
||||||
|
run: cargo tarpaulin --verbose --no-default-features --workspace --timeout 240
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest]
|
arrays: [
|
||||||
|
os: { tag: "windows-latest", target: "i686-pc-windows-msvc" },
|
||||||
|
os: { tag: "windows-latest", target: "x86_64-pc-windows-msvc" },
|
||||||
|
]
|
||||||
|
runs-on: ${{ matrix.arrays.os.tag }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the source code
|
- name: Checkout the source code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Install stable Rust
|
||||||
shell: cmd
|
uses: actions-rs/toolchain@v1
|
||||||
run: |
|
|
||||||
cd extensions
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. && cmake --build .
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
with:
|
||||||
name: ace3_extensions-${{ matrix.os }}-debug
|
target: ${{ matrix.arrays.os.target }}
|
||||||
path: extensions/build
|
toolchain: stable
|
||||||
|
default: true
|
||||||
|
- name: Rust Cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
- name: Build
|
||||||
|
run: cargo build --verbose
|
||||||
|
- name: Upload
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.arrays.os.target }}
|
||||||
|
path: target/debug/ace.dll
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 30
|
||||||
|
4
.github/workflows/hemtt.yml
vendored
4
.github/workflows/hemtt.yml
vendored
@ -33,12 +33,14 @@ jobs:
|
|||||||
xcopy /e /h /q pullrequest\addons addons\
|
xcopy /e /h /q pullrequest\addons addons\
|
||||||
xcopy /e /h /q pullrequest\optionals optionals\
|
xcopy /e /h /q pullrequest\optionals optionals\
|
||||||
xcopy /e /h /q pullrequest\include include\
|
xcopy /e /h /q pullrequest\include include\
|
||||||
|
xcopy /y /h /q pullrequest\ace.dll ace.dll
|
||||||
|
xcopy /y /h /q pullrequest\ace_x64.dll ace_x64.dll
|
||||||
- name: Run HEMTT build
|
- name: Run HEMTT build
|
||||||
run: hemtt build
|
run: hemtt build
|
||||||
- name: Rename build folder
|
- name: Rename build folder
|
||||||
run: mv .hemttout/build .hemttout/@ace
|
run: mv .hemttout/build .hemttout/@ace
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ace3-${{ github.sha }}
|
name: ace3-${{ github.sha }}
|
||||||
path: .hemttout/@*
|
path: .hemttout/@*
|
||||||
|
5
.github/workflows/pboproject.yml
vendored
5
.github/workflows/pboproject.yml
vendored
@ -67,18 +67,19 @@ jobs:
|
|||||||
xcopy /e /h /q z\ace\tools\pDummies\gm gm\
|
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\vn vn\
|
||||||
xcopy /e /h /q z\ace\tools\pDummies\WW2 WW2\
|
xcopy /e /h /q z\ace\tools\pDummies\WW2 WW2\
|
||||||
|
xcopy /e /h /q z\ace\tools\pDummies\CUP CUP\
|
||||||
- name: Build
|
- name: Build
|
||||||
run: py P:\z\ace\tools\make.py ci
|
run: py P:\z\ace\tools\make.py ci
|
||||||
env:
|
env:
|
||||||
PYTHONUNBUFFERED: 1
|
PYTHONUNBUFFERED: 1
|
||||||
- name: Archive logs
|
- name: Archive logs
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
with:
|
with:
|
||||||
name: logs
|
name: logs
|
||||||
path: temp/*.log
|
path: temp/*.log
|
||||||
- name: Archive @ace
|
- name: Archive @ace
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: '@ace3-${{ github.sha }}'
|
name: '@ace3-${{ github.sha }}'
|
||||||
path: z\ace\release\@ace
|
path: z\ace\release\@ace
|
||||||
|
2
.github/workflows/release-drafter.yml
vendored
2
.github/workflows/release-drafter.yml
vendored
@ -11,6 +11,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Release Drafter
|
- name: Release Drafter
|
||||||
if: github.repository == 'acemod/ACE3'
|
if: github.repository == 'acemod/ACE3'
|
||||||
uses: release-drafter/release-drafter@v5
|
uses: release-drafter/release-drafter@v6
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -2,8 +2,6 @@
|
|||||||
*.zip
|
*.zip
|
||||||
release/*
|
release/*
|
||||||
releases/*
|
releases/*
|
||||||
extensions/vcproj32/*
|
|
||||||
extensions/vcproj64/*
|
|
||||||
.vscode/*
|
.vscode/*
|
||||||
hemtt
|
hemtt
|
||||||
hemtt.exe
|
hemtt.exe
|
||||||
@ -20,3 +18,5 @@ CHANGELOG.md
|
|||||||
sqfvm.exe
|
sqfvm.exe
|
||||||
ArmaScriptCompiler.exe
|
ArmaScriptCompiler.exe
|
||||||
*.sqfc
|
*.sqfc
|
||||||
|
target/
|
||||||
|
!extras/**/*.zip
|
||||||
|
@ -28,38 +28,32 @@ exclude = [
|
|||||||
"zeus/functions/fnc_zeusAttributes.sqf",
|
"zeus/functions/fnc_zeusAttributes.sqf",
|
||||||
]
|
]
|
||||||
|
|
||||||
[hemtt.launch]
|
[hemtt.launch.default]
|
||||||
workshop = [
|
workshop = [
|
||||||
"450814997", # CBA_A3
|
"450814997", # CBA_A3
|
||||||
]
|
]
|
||||||
|
|
||||||
[hemtt.launch.spe]
|
[hemtt.launch.spe]
|
||||||
workshop = [
|
extends = "default"
|
||||||
"450814997", # CBA_A3
|
|
||||||
]
|
|
||||||
dlc = [
|
dlc = [
|
||||||
"spe"
|
"spe"
|
||||||
]
|
]
|
||||||
|
|
||||||
[hemtt.launch.vn]
|
[hemtt.launch.vn]
|
||||||
workshop = [
|
extends = "default"
|
||||||
"450814997", # CBA_A3's Workshop ID
|
|
||||||
]
|
|
||||||
dlc = [
|
dlc = [
|
||||||
"S.O.G. Prairie Fire",
|
"S.O.G. Prairie Fire",
|
||||||
]
|
]
|
||||||
|
|
||||||
[hemtt.launch.ws]
|
[hemtt.launch.ws]
|
||||||
workshop = [
|
extends = "default"
|
||||||
"450814997", # CBA_A3's Workshop ID
|
|
||||||
]
|
|
||||||
dlc = [
|
dlc = [
|
||||||
"Western Sahara",
|
"Western Sahara",
|
||||||
]
|
]
|
||||||
|
|
||||||
[hemtt.launch.rhs]
|
[hemtt.launch.rhs]
|
||||||
|
extends = "default"
|
||||||
workshop = [
|
workshop = [
|
||||||
"450814997", # CBA_A3's Workshop ID
|
|
||||||
"843425103", # RHS AFRF Workshop ID
|
"843425103", # RHS AFRF Workshop ID
|
||||||
"843577117", # RHS USAF Workshop ID
|
"843577117", # RHS USAF Workshop ID
|
||||||
"843593391", # RHS GREF Workshop ID
|
"843593391", # RHS GREF Workshop ID
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
# request, preferably including an email address.
|
# request, preferably including an email address.
|
||||||
|
|
||||||
# CORE TEAM
|
# CORE TEAM
|
||||||
|
BaerMitUmlaut
|
||||||
Brett Mayson
|
Brett Mayson
|
||||||
bux578 <github@jonathandavid.de>
|
bux578 <github@jonathandavid.de>
|
||||||
commy2
|
commy2
|
||||||
@ -25,6 +26,7 @@ Kieran
|
|||||||
kymckay
|
kymckay
|
||||||
mharis001 <mhariszakar@gmail.com>
|
mharis001 <mhariszakar@gmail.com>
|
||||||
MikeMF
|
MikeMF
|
||||||
|
MiszczuZPolski
|
||||||
NouberNou
|
NouberNou
|
||||||
PabstMirror <pabstmirror@gmail.com>
|
PabstMirror <pabstmirror@gmail.com>
|
||||||
Ruthberg <ulteq@web.de>
|
Ruthberg <ulteq@web.de>
|
||||||
@ -56,7 +58,6 @@ Arcanum417 <lubos.len@gmail.com>
|
|||||||
Arkhir <wonsz666@gmail.com >
|
Arkhir <wonsz666@gmail.com >
|
||||||
ARV187 aka Spark23
|
ARV187 aka Spark23
|
||||||
Asgar Serran <piechottaf@web.de>
|
Asgar Serran <piechottaf@web.de>
|
||||||
BaerMitUmlaut
|
|
||||||
Bamse <bamsis@gmail.com>
|
Bamse <bamsis@gmail.com>
|
||||||
Barman75
|
Barman75
|
||||||
Bla1337
|
Bla1337
|
||||||
@ -126,6 +127,7 @@ Keithen <Keithen.Neu@gmail.com>
|
|||||||
Kllrt <kllrtik@gmail.com>
|
Kllrt <kllrtik@gmail.com>
|
||||||
KokaKolaA3
|
KokaKolaA3
|
||||||
Krzyciu
|
Krzyciu
|
||||||
|
LAxemann
|
||||||
legman <juicemelon@msn.com>
|
legman <juicemelon@msn.com>
|
||||||
Legolasindar "Viper" <legolasindar@gmail.com>
|
Legolasindar "Viper" <legolasindar@gmail.com>
|
||||||
licht-im-Norden87 <lichtimnorden87@gmail.com>
|
licht-im-Norden87 <lichtimnorden87@gmail.com>
|
||||||
@ -190,3 +192,4 @@ YetheSamartaka
|
|||||||
xrufix
|
xrufix
|
||||||
Zakant <Zakant@gmx.de>
|
Zakant <Zakant@gmx.de>
|
||||||
zGuba
|
zGuba
|
||||||
|
Zman6258
|
||||||
|
1364
Cargo.lock
generated
Normal file
1364
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
11
Cargo.toml
Normal file
11
Cargo.toml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[workspace]
|
||||||
|
resolver = "2"
|
||||||
|
members = [
|
||||||
|
"extension"
|
||||||
|
]
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
opt-level = "z"
|
||||||
|
lto = true
|
||||||
|
codegen-units = 1
|
||||||
|
strip = true
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/acemod/ACE3/releases/latest">
|
<a href="https://github.com/acemod/ACE3/releases/latest">
|
||||||
<img src="https://img.shields.io/badge/Version-3.16.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>
|
||||||
<a href="https://github.com/acemod/ACE3/issues">
|
<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">
|
<img src="https://img.shields.io/github/issues-raw/acemod/ACE3.svg?style=flat-square&label=Issues" alt="ACE3 Issues">
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ace_fcs.dll
BIN
ace_fcs.dll
Binary file not shown.
BIN
ace_fcs_x64.dll
BIN
ace_fcs_x64.dll
Binary file not shown.
BIN
ace_x64.dll
Normal file
BIN
ace_x64.dll
Normal file
Binary file not shown.
@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
#include "initKeybinds.inc.sqf"
|
#include "initKeybinds.inc.sqf"
|
||||||
|
|
||||||
GVAR(currentbulletID) = -1;
|
|
||||||
|
|
||||||
GVAR(Protractor) = false;
|
GVAR(Protractor) = false;
|
||||||
GVAR(ProtractorStart) = CBA_missionTime;
|
GVAR(ProtractorStart) = CBA_missionTime;
|
||||||
GVAR(allBullets) = [];
|
GVAR(allBullets) = createHashMap;
|
||||||
GVAR(currentGrid) = 0;
|
GVAR(currentGrid) = 0;
|
||||||
|
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
|
#include "initKeybinds.inc.sqf"
|
||||||
|
|
||||||
["CBA_settingsInitialized", {
|
["CBA_settingsInitialized", {
|
||||||
//If not enabled, dont't add PFEH
|
//If not enabled, dont't add PFEH
|
||||||
if (!GVAR(enabled)) exitWith {};
|
if (!GVAR(enabled)) exitWith {};
|
||||||
@ -19,27 +19,11 @@ if (!hasInterface) exitWith {};
|
|||||||
[] call FUNC(initializeTerrainExtension);
|
[] call FUNC(initializeTerrainExtension);
|
||||||
|
|
||||||
// Register fire event handler
|
// Register fire event handler
|
||||||
["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
|
["ace_firedPlayer", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler;
|
||||||
["ace_firedPlayerNonLocal", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
|
["ace_firedPlayerNonLocal", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
// Register Perframe Handler
|
// 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)
|
|
||||||
{
|
|
||||||
_x params ["_modPBO", "_compatPBO"];
|
|
||||||
if ([_modPBO] call EFUNC(common,isModLoaded) && {!([_compatPBO] call EFUNC(common,isModLoaded))}) then {
|
|
||||||
WARNING_2("Weapon Mod [%1] missing ace compat pbo [%2] (from @ace\optionals)",_modPBO,_compatPBO);
|
|
||||||
};
|
|
||||||
} forEach [
|
|
||||||
["RH_acc","ace_compat_rh_acc"],
|
|
||||||
["RH_de_cfg","ace_compat_rh_de"],
|
|
||||||
["RH_m4_cfg","ace_compat_rh_m4"],
|
|
||||||
["RH_PDW","ace_compat_rh_pdw"],
|
|
||||||
["RKSL_PMII","ace_compat_rksl_pm_ii"],
|
|
||||||
["iansky_opt","ace_compat_sma3_iansky"],
|
|
||||||
["R3F_Armes","ace_compat_r3f"]
|
|
||||||
];
|
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
#ifdef DEBUG_MODE_FULL
|
#ifdef DEBUG_MODE_FULL
|
||||||
|
@ -18,10 +18,3 @@ class CfgPatches {
|
|||||||
#include "CfgVehicles.hpp"
|
#include "CfgVehicles.hpp"
|
||||||
#include "RscTitles.hpp"
|
#include "RscTitles.hpp"
|
||||||
#include "ACE_Settings.hpp"
|
#include "ACE_Settings.hpp"
|
||||||
|
|
||||||
class ACE_Extensions {
|
|
||||||
class ace_advanced_ballistics {
|
|
||||||
windows = 1;
|
|
||||||
client = 1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
@ -80,7 +80,7 @@ for "_i" from 0 to (count _cfgWeapons)-1 do {
|
|||||||
diag_log text format ["AB_Diagnose_barrelTwist,%1,%2,%3,%4,%5",_weapon,_magazine,_ammo,_twistDirection,_barrelTwist];
|
diag_log text format ["AB_Diagnose_barrelTwist,%1,%2,%3,%4,%5",_weapon,_magazine,_ammo,_twistDirection,_barrelTwist];
|
||||||
};
|
};
|
||||||
if (_barrelLength == 0) then {
|
if (_barrelLength == 0) then {
|
||||||
diag_log text format ["AB_Diagnose_barrelLength,%1,%2,%3,%4,%5",_weapon,_magazine,_ammo,_barrelLength];
|
diag_log text format ["AB_Diagnose_barrelLength,%1,%2,%3,%4",_weapon,_magazine,_ammo,_barrelLength];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} forEach _magazines;
|
} forEach _magazines;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Glowbal, Ruthberg, joko // Jonas
|
* Author: Glowbal, Ruthberg, joko // Jonas, Brett Mayson
|
||||||
* Handle the PFH for Bullets
|
* Handle the PFH for Bullets
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
private _deleted = false;
|
private _deleted = false;
|
||||||
{
|
{
|
||||||
_x params ["_bullet","_caliber","_bulletTraceVisible","_index"];
|
_y params ["_bullet","_caliber","_bulletTraceVisible"];
|
||||||
|
|
||||||
if (alive _bullet) then {
|
if (alive _bullet) then {
|
||||||
private _bulletVelocity = velocity _bullet;
|
private _bulletVelocity = velocity _bullet;
|
||||||
@ -27,13 +27,21 @@ private _deleted = false;
|
|||||||
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""];
|
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""];
|
||||||
};
|
};
|
||||||
|
|
||||||
_bullet setVelocity (_bulletVelocity vectorAdd (parseSimpleArray ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6", _index, _bulletVelocity, _bulletPosition, wind, ASLToATL(_bulletPosition) select 2, CBA_missionTime toFixed 6])));
|
(
|
||||||
} else {
|
"ace" callExtension ["ballistics:bullet:simulate", [
|
||||||
GVAR(allBullets) set [_forEachIndex, objNull];
|
_x,
|
||||||
_deleted = true;
|
_bulletVelocity,
|
||||||
|
_bulletPosition,
|
||||||
|
wind,
|
||||||
|
ASLToATL(_bulletPosition) select 2,
|
||||||
|
CBA_missionTime toFixed 6
|
||||||
|
]]
|
||||||
|
) params ["_data", "_code"];
|
||||||
|
if (_code == 0) then {
|
||||||
|
_bullet setVelocity (_bulletVelocity vectorAdd (parseSimpleArray (_data)));
|
||||||
};
|
};
|
||||||
} forEach GVAR(allBullets);
|
} else {
|
||||||
|
GVAR(allBullets) deleteAt _x;
|
||||||
if (_deleted) then {
|
"ace" callExtension ["ballistics:bullet:delete", [_x]];
|
||||||
GVAR(allBullets) = GVAR(allBullets) - [objNull];
|
};
|
||||||
};
|
} forEach GVAR(allBullets)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Glowbal, Ruthberg
|
* Author: Glowbal, Ruthberg, Brett Mayson
|
||||||
*
|
*
|
||||||
* Handles advanced ballistics for (BulletBase) projectiles. Called from the unified fired EH only for players.
|
* Handles advanced ballistics for (BulletBase) projectiles. Called from the unified fired EH only for players.
|
||||||
*
|
*
|
||||||
@ -17,9 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
|
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
|
||||||
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
|
TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret);
|
||||||
|
|
||||||
if (!(_ammo isKindOf "BulletBase")) exitWith {};
|
if !(_ammo isKindOf "BulletBase") exitWith {};
|
||||||
if (!alive _projectile) exitWith {};
|
if (!alive _projectile) exitWith {};
|
||||||
if (underwater _unit) exitWith {};
|
if (underwater _unit) exitWith {};
|
||||||
|
|
||||||
@ -120,8 +120,26 @@ if (_caliber * _bulletLength * _bulletMass * _barrelTwist > 0) then {
|
|||||||
_stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor);
|
_stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor);
|
||||||
};
|
};
|
||||||
|
|
||||||
GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000;
|
("ace" callExtension [
|
||||||
|
"ballistics:bullet:new", [
|
||||||
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _ammoCount, _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _transonicStabilityCoef, getPosASL _projectile, _bulletVelocity, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), EGVAR(weather,currentOvercast), CBA_missionTime toFixed 6];
|
_ammoCount,
|
||||||
|
_airFriction,
|
||||||
GVAR(allBullets) pushBack [_projectile, _caliber, _bulletTraceVisible, GVAR(currentbulletID)];
|
_ballisticCoefficients,
|
||||||
|
_velocityBoundaries,
|
||||||
|
_atmosphereModel,
|
||||||
|
_dragModel,
|
||||||
|
_stabilityFactor,
|
||||||
|
_twistDirection,
|
||||||
|
_transonicStabilityCoef,
|
||||||
|
_bulletVelocity,
|
||||||
|
EGVAR(common,mapLatitude),
|
||||||
|
EGVAR(weather,currentTemperature),
|
||||||
|
EGVAR(common,mapAltitude),
|
||||||
|
EGVAR(weather,currentHumidity),
|
||||||
|
EGVAR(weather,currentOvercast),
|
||||||
|
CBA_missionTime toFixed 6
|
||||||
|
]
|
||||||
|
]) params ["_id", "_code"];
|
||||||
|
if (_code == 0) then {
|
||||||
|
GVAR(allBullets) set [_id, [_projectile, _caliber, _bulletTraceVisible]];
|
||||||
|
};
|
||||||
|
@ -21,8 +21,15 @@ if (!GVAR(enabled)) exitWith {};
|
|||||||
private _initStartTime = diag_tickTime;
|
private _initStartTime = diag_tickTime;
|
||||||
private _mapSize = worldSize;
|
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);
|
"ace" callExtension ["ballistics:map:init", [worldName, _mapSize]]
|
||||||
|
) params ["_data", "_code"];
|
||||||
|
if (_code != 0) exitWith {
|
||||||
|
ERROR("Error initializing map")
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_data == "true") exitWith {
|
||||||
|
INFO_1("Terrain already initialized [world: %1]",worldName);
|
||||||
#ifdef DEBUG_MODE_FULL
|
#ifdef DEBUG_MODE_FULL
|
||||||
systemChat "AdvancedBallistics: Terrain already initialized";
|
systemChat "AdvancedBallistics: Terrain already initialized";
|
||||||
#endif
|
#endif
|
||||||
@ -33,14 +40,14 @@ private _gridCells = _mapGrids * _mapGrids;
|
|||||||
|
|
||||||
GVAR(currentGrid) = 0;
|
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"];
|
params ["_args","_idPFH"];
|
||||||
_args params ["_mapGrids", "_gridCells", "_initStartTime"];
|
_args params ["_mapGrids", "_gridCells", "_initStartTime"];
|
||||||
|
|
||||||
if (GVAR(currentGrid) >= _gridCells) exitWith {
|
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
|
#ifdef DEBUG_MODE_FULL
|
||||||
systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", (diag_tickTime - _initStartTime) toFixed 2];
|
systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", (diag_tickTime - _initStartTime) toFixed 2];
|
||||||
#endif
|
#endif
|
||||||
@ -53,8 +60,7 @@ INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldNa
|
|||||||
private _gridCenter = [_x + 25, _y + 25];
|
private _gridCenter = [_x + 25, _y + 25];
|
||||||
private _gridHeight = round(getTerrainHeightASL _gridCenter);
|
private _gridHeight = round(getTerrainHeightASL _gridCenter);
|
||||||
private _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]);
|
private _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]);
|
||||||
private _gridSurfaceIsWater = if (surfaceIsWater _gridCenter) then {1} else {0};
|
"ace" callExtension ["ballistics:map:set", [GVAR(currentGrid), _gridHeight, _gridNumObjects, surfaceIsWater _gridCenter]];
|
||||||
"ace_advanced_ballistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater];
|
|
||||||
GVAR(currentGrid) = GVAR(currentGrid) + 1;
|
GVAR(currentGrid) = GVAR(currentGrid) + 1;
|
||||||
if (GVAR(currentGrid) >= _gridCells) exitWith {};
|
if (GVAR(currentGrid) >= _gridCells) exitWith {};
|
||||||
};
|
};
|
||||||
|
@ -40,10 +40,13 @@ if (_transonicStabilityCoef == 0) then {
|
|||||||
_transonicStabilityCoef = 0.5;
|
_transonicStabilityCoef = 0.5;
|
||||||
};
|
};
|
||||||
private _dragModel = getNumber(_ammoConfig >> "ACE_dragModel");
|
private _dragModel = getNumber(_ammoConfig >> "ACE_dragModel");
|
||||||
if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then {
|
if !(_dragModel in [1, 2, 5, 6, 7, 8]) then {
|
||||||
_dragModel = 1;
|
_dragModel = 1;
|
||||||
};
|
};
|
||||||
private _ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients");
|
private _ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients");
|
||||||
|
if (_ballisticCoefficients isEqualTo []) then {
|
||||||
|
_ballisticCoefficients = [0.5];
|
||||||
|
};
|
||||||
private _velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries");
|
private _velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries");
|
||||||
private _atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere");
|
private _atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere");
|
||||||
if (_atmosphereModel isEqualTo "") then {
|
if (_atmosphereModel isEqualTo "") then {
|
||||||
@ -66,7 +69,7 @@ if ((_typicalSpeed > 0) && {_typicalSpeed < 360}) then {
|
|||||||
if (_inheritedBarrelConfig || _inheritedTempConfig) then {
|
if (_inheritedBarrelConfig || _inheritedTempConfig) then {
|
||||||
private _parentConfig = inheritsFrom _ammoConfig;
|
private _parentConfig = inheritsFrom _ammoConfig;
|
||||||
private _parentSpeed = getNumber (_parentConfig >> "typicalSpeed");
|
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
|
if (_parentSpeed <= 0) exitWith {//Handle weird or null parent
|
||||||
_muzzleVelocityTable = [];
|
_muzzleVelocityTable = [];
|
||||||
_ammoTempMuzzleVelocityShifts = [];
|
_ammoTempMuzzleVelocityShifts = [];
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
private _weaponConfig = (configFile >> "CfgWeapons" >> _this);
|
private _weaponConfig = (configFile >> "CfgWeapons" >> _this);
|
||||||
|
|
||||||
private _barrelTwist = 0 max getNumber(_weaponConfig >> "ACE_barrelTwist");
|
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 {
|
if (isNumber (_weaponConfig >> "ACE_twistDirection")) then {
|
||||||
_twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection");
|
_twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection");
|
||||||
if !(_twistDirection in [-1, 0, 1]) then {
|
if !(_twistDirection in [-1, 0, 1]) then {
|
||||||
|
@ -5,7 +5,9 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)];
|
|||||||
[LSTRING(enabled_DisplayName), LSTRING(enabled_Description)],
|
[LSTRING(enabled_DisplayName), LSTRING(enabled_Description)],
|
||||||
_category,
|
_category,
|
||||||
false,
|
false,
|
||||||
1
|
1,
|
||||||
|
{[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)},
|
||||||
|
true // Needs mission restart
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
|
||||||
[
|
[
|
||||||
@ -45,5 +47,7 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)];
|
|||||||
[LSTRING(simulationInterval_DisplayName), LSTRING(simulationInterval_Description)],
|
[LSTRING(simulationInterval_DisplayName), LSTRING(simulationInterval_Description)],
|
||||||
_category,
|
_category,
|
||||||
[0, 0.2, 0.05, 2],
|
[0, 0.2, 0.05, 2],
|
||||||
1
|
1,
|
||||||
|
{[QGVAR(simulationInterval), _this] call EFUNC(common,cbaSettings_settingChanged)},
|
||||||
|
true // Needs mission restart
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<Hungarian>Fejlett ballisztika</Hungarian>
|
<Hungarian>Fejlett ballisztika</Hungarian>
|
||||||
<Russian>Продвинутая баллистика</Russian>
|
<Russian>Продвинутая баллистика</Russian>
|
||||||
<Italian>Balistica Avanzata</Italian>
|
<Italian>Balistica Avanzata</Italian>
|
||||||
<Japanese>アドバンスド弾道計算</Japanese>
|
<Japanese>高度な弾道計算</Japanese>
|
||||||
<Korean>고급 탄도학</Korean>
|
<Korean>고급 탄도학</Korean>
|
||||||
<Chinese>先進彈道系統</Chinese>
|
<Chinese>先進彈道系統</Chinese>
|
||||||
<Chinesesimp>进阶弹道系统</Chinesesimp>
|
<Chinesesimp>进阶弹道系统</Chinesesimp>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
<Hungarian>Fejlett ballisztika</Hungarian>
|
<Hungarian>Fejlett ballisztika</Hungarian>
|
||||||
<Russian>Продвинутая баллистика</Russian>
|
<Russian>Продвинутая баллистика</Russian>
|
||||||
<Italian>Balistica Avanzata</Italian>
|
<Italian>Balistica Avanzata</Italian>
|
||||||
<Japanese>アドバンスド弾道計算を有効化</Japanese>
|
<Japanese>高度な弾道計算を有効化</Japanese>
|
||||||
<Korean>고급 탄도학</Korean>
|
<Korean>고급 탄도학</Korean>
|
||||||
<Chinese>先進彈道系統</Chinese>
|
<Chinese>先進彈道系統</Chinese>
|
||||||
<Chinesesimp>进阶弹道系统</Chinesesimp>
|
<Chinesesimp>进阶弹道系统</Chinesesimp>
|
||||||
@ -80,7 +80,7 @@
|
|||||||
<Hungarian>Engedélyezi a fejlett ballisztikát</Hungarian>
|
<Hungarian>Engedélyezi a fejlett ballisztikát</Hungarian>
|
||||||
<Russian>Включает продвинутую баллистику</Russian>
|
<Russian>Включает продвинутую баллистику</Russian>
|
||||||
<Italian>Abilita Balistica Avanzata</Italian>
|
<Italian>Abilita Balistica Avanzata</Italian>
|
||||||
<Japanese>アドバンスド弾道計算は高度な弾道計算処理を有効化します。</Japanese>
|
<Japanese>高度な弾道計算を有効化します。</Japanese>
|
||||||
<Korean>고급 탄도학을 적용합니다</Korean>
|
<Korean>고급 탄도학을 적용합니다</Korean>
|
||||||
<Chinese>啟用先進彈道系統</Chinese>
|
<Chinese>啟用先進彈道系統</Chinese>
|
||||||
<Chinesesimp>启用进阶弹道系统</Chinesesimp>
|
<Chinesesimp>启用进阶弹道系统</Chinesesimp>
|
||||||
@ -280,7 +280,7 @@
|
|||||||
<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>
|
<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>
|
<Russian>Определяет радиус вокруг игрока (в метрах), в котором продвинутая баллистика применяется к снарядам</Russian>
|
||||||
<Italian>Definisce il raggio attorno al giocatore (in metri) entro il quale la Balistica Avanzata è applicata ai proiettili</Italian>
|
<Italian>Definisce il raggio attorno al giocatore (in metri) entro il quale la Balistica Avanzata è applicata ai proiettili</Italian>
|
||||||
<Japanese>アドバンスド弾道計算の適用半径範囲 (プレイヤー中心、メートル単位) を定義します。</Japanese>
|
<Japanese>高度な弾道計算が飛翔体に適用される半径距離 (プレイヤー中心、メートル単位) を定義します。</Japanese>
|
||||||
<Korean>플레이어 주위의 발사체를 고급 탄도학으로 정의하는 범위를 정합니다(미터)</Korean>
|
<Korean>플레이어 주위의 발사체를 고급 탄도학으로 정의하는 범위를 정합니다(미터)</Korean>
|
||||||
<Chinese>以玩家的半徑距離(公尺)定義先進彈道系統啟用範圍</Chinese>
|
<Chinese>以玩家的半徑距離(公尺)定義先進彈道系統啟用範圍</Chinese>
|
||||||
<Chinesesimp>定义玩家周围的半径(米),在这个半径内,进阶弹道系统会被启用</Chinesesimp>
|
<Chinesesimp>定义玩家周围的半径(米),在这个半径内,进阶弹道系统会被启用</Chinesesimp>
|
||||||
@ -297,7 +297,7 @@
|
|||||||
<Russian>Этот модуль включает симуляцию продвинутой баллистики - при этом на траекторию полета снаряда влияют различные параметры, такие как температура воздуха, атмосферное давление, влажность, гравитация, тип боеприпаса и оружия, из которого произвели выстрел.</Russian>
|
<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>
|
<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 - 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>
|
<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>
|
<Japanese>高度な弾道計算のシミュレーションを有効化します。 弾道は気温・気圧・湿度・重力・弾薬の種類・発射する武器などの変化による影響を受けるようになります。</Japanese>
|
||||||
<Korean>이 모듈은 고급 탄도학을 적용시킵니다 - 이는 발사체의 궤적이 기온, 대기압, 습도, 중력, 탄환의 종류와 어느 무기에서 발사되는지에 따라 영향을 받습니다.</Korean>
|
<Korean>이 모듈은 고급 탄도학을 적용시킵니다 - 이는 발사체의 궤적이 기온, 대기압, 습도, 중력, 탄환의 종류와 어느 무기에서 발사되는지에 따라 영향을 받습니다.</Korean>
|
||||||
<Chinese>該模塊實現先進的彈道仿真 - 這意味著子彈的軌跡是由空氣溫度、大氣壓力、濕度、重力、彈藥類型以及射擊的武器所影響</Chinese>
|
<Chinese>該模塊實現先進的彈道仿真 - 這意味著子彈的軌跡是由空氣溫度、大氣壓力、濕度、重力、彈藥類型以及射擊的武器所影響</Chinese>
|
||||||
<Chinesesimp>该模块实现增强的弹道模拟—子弹的轨迹由空气温度、大气压力、湿度、重力、弹药类型和射击的武器等变量所影响</Chinesesimp>
|
<Chinesesimp>该模块实现增强的弹道模拟—子弹的轨迹由空气温度、大气压力、湿度、重力、弹药类型和射击的武器等变量所影响</Chinesesimp>
|
||||||
|
@ -9,3 +9,5 @@ PREP(handleStaminaBar);
|
|||||||
PREP(mainLoop);
|
PREP(mainLoop);
|
||||||
PREP(moduleSettings);
|
PREP(moduleSettings);
|
||||||
PREP(removeDutyFactor);
|
PREP(removeDutyFactor);
|
||||||
|
PREP(renderDebugLines);
|
||||||
|
PREP(updateStaminaBar);
|
||||||
|
@ -2,7 +2,21 @@
|
|||||||
|
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
["baseline", {
|
#ifdef DEBUG_MODE_FULL
|
||||||
|
call FUNC(renderDebugLines);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
["unit", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler;
|
||||||
|
|
||||||
|
["CBA_settingsInitialized", {
|
||||||
|
if (!GVAR(enabled)) exitWith {};
|
||||||
|
|
||||||
|
[QEGVAR(ui,hideHud), LINKFUNC(updateStaminaBar)] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
|
["baseline", {
|
||||||
private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0];
|
private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0];
|
||||||
switch (stance ACE_player) do {
|
switch (stance ACE_player) do {
|
||||||
case ("CROUCH"): {
|
case ("CROUCH"): {
|
||||||
@ -15,29 +29,7 @@ if (!hasInterface) exitWith {};
|
|||||||
(1.5 + _fatigue ^ 2 * 3.0)
|
(1.5 + _fatigue ^ 2 * 3.0)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
|
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
|
||||||
|
|
||||||
["multiplier", {
|
|
||||||
switch (true) do {
|
|
||||||
case (isWeaponRested ACE_player): {
|
|
||||||
GVAR(swayFactor) * GVAR(restedSwayFactor)
|
|
||||||
};
|
|
||||||
case (isWeaponDeployed ACE_player): {
|
|
||||||
GVAR(swayFactor) * GVAR(deployedSwayFactor)
|
|
||||||
};
|
|
||||||
default {
|
|
||||||
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;
|
|
||||||
["unit", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler;
|
|
||||||
|
|
||||||
["CBA_settingsInitialized", {
|
|
||||||
if (!GVAR(enabled)) exitWith {};
|
|
||||||
|
|
||||||
// - Post process effect ------------------------------------------------------
|
// - Post process effect ------------------------------------------------------
|
||||||
GVAR(ppeBlackout) = ppEffectCreate ["ColorCorrections", 4220];
|
GVAR(ppeBlackout) = ppEffectCreate ["ColorCorrections", 4220];
|
||||||
@ -47,25 +39,23 @@ if (!hasInterface) exitWith {};
|
|||||||
GVAR(ppeBlackout) ppEffectCommit 0.4;
|
GVAR(ppeBlackout) ppEffectCommit 0.4;
|
||||||
|
|
||||||
// - GVAR updating and initialization -----------------------------------------
|
// - GVAR updating and initialization -----------------------------------------
|
||||||
["unit", LINKFUNC(handlePlayerChanged), true] call CBA_fnc_addPlayerEventHandler;
|
["unit", LINKFUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler;
|
||||||
|
|
||||||
["visibleMap", {
|
["visibleMap", {
|
||||||
params ["", "_visibleMap"]; // command visibleMap is updated one frame later
|
params ["", "_visibleMap"]; // command visibleMap is updated one frame later
|
||||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
(uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]) ctrlShow (!_visibleMap && isNull objectParent ACE_player);
|
||||||
_staminaBarContainer ctrlShow ((!_visibleMap) && {(vehicle ACE_player) == ACE_player});
|
|
||||||
}, true] call CBA_fnc_addPlayerEventHandler;
|
}, true] call CBA_fnc_addPlayerEventHandler;
|
||||||
["vehicle", {
|
["vehicle", {
|
||||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
(uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]) ctrlShow (!visibleMap && isNull objectParent ACE_player);
|
||||||
_staminaBarContainer ctrlShow ((!visibleMap) && {(vehicle ACE_player) == ACE_player});
|
|
||||||
}, true] call CBA_fnc_addPlayerEventHandler;
|
}, true] call CBA_fnc_addPlayerEventHandler;
|
||||||
|
|
||||||
// - Duty factors -------------------------------------------------------------
|
// - Duty factors -------------------------------------------------------------
|
||||||
if (["ace_medical"] call EFUNC(common,isModLoaded)) then {
|
if (GETEGVAR(medical,enabled,false)) then {
|
||||||
[QEGVAR(medical,pain), { // 0->1.0, 0.5->1.05, 1->1.1
|
[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];
|
linearConversion [0, 1, _this getVariable [QEGVAR(medical,pain), 0], 1, 1.1, true];
|
||||||
}] call FUNC(addDutyFactor);
|
}] call FUNC(addDutyFactor);
|
||||||
[QEGVAR(medical,bloodVolume), { // 6->1.0, 5->1.167, 4->1.33
|
[QEGVAR(medical,bloodVolume), { // 6->1.0, 5->1.167, 4->1.33
|
||||||
linearConversion [6, 0, (_this getVariable [QEGVAR(medical,bloodVolume), 6]), 1, 2, true];
|
linearConversion [6, 0, _this getVariable [QEGVAR(medical,bloodVolume), 6], 1, 2, true];
|
||||||
}] call FUNC(addDutyFactor);
|
}] call FUNC(addDutyFactor);
|
||||||
};
|
};
|
||||||
if (["ace_dragging"] call EFUNC(common,isModLoaded)) then {
|
if (["ace_dragging"] call EFUNC(common,isModLoaded)) then {
|
||||||
@ -76,7 +66,7 @@ if (!hasInterface) exitWith {};
|
|||||||
// Weather has an off switch, Dragging & Medical don't.
|
// Weather has an off switch, Dragging & Medical don't.
|
||||||
if (missionNamespace getVariable [QEGVAR(weather,enabled), false]) then {
|
if (missionNamespace getVariable [QEGVAR(weather,enabled), false]) then {
|
||||||
[QEGVAR(weather,temperature), { // 35->1, 45->2
|
[QEGVAR(weather,temperature), { // 35->1, 45->2
|
||||||
linearConversion [35, 45, (missionNamespace getVariable [QEGVAR(weather,currentTemperature), 25]), 1, 2, true];
|
linearConversion [35, 45, missionNamespace getVariable [QEGVAR(weather,currentTemperature), 25], 1, 2, true];
|
||||||
}] call FUNC(addDutyFactor);
|
}] call FUNC(addDutyFactor);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: BaerMitUmlaut
|
* Author: BaerMitUmlaut
|
||||||
* Calculates the duty of the current animation.
|
* Calculates the duty ('postureWeight') of the current animation.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
|
@ -1,54 +1,74 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: BaerMitUmlaut
|
* Author: BaerMitUmlaut, ulteq
|
||||||
* Calculates the current metabolic costs for a unit.
|
* Calculates the current metabolic costs.
|
||||||
* Calculation is done according to the Pandolf/Wojtowicz formulas.
|
* Calculation is done according to the Pandolf/Wojtowicz formulas.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Unit <OBJECT>
|
* 0: Duty of animation
|
||||||
* 1: Speed <NUMBER>
|
* 1: Mass of unit <NUMBER>
|
||||||
|
* 2: Terrain gradient <NUMBER>
|
||||||
|
* 3: Terrain factor <NUMBER>
|
||||||
|
* 4: Speed <NUMBER>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Metabolic cost <NUMBER>
|
* Metabolic cost <NUMBER>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [player, 3.3] call ace_advanced_fatigue_fnc_getMetabolicCosts
|
* [1, 840, 20, 1, 4] call ace_advanced_fatigue_fnc_getMetabolicCosts
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
params ["_unit", "_velocity"];
|
|
||||||
|
|
||||||
private _gearMass = ((_unit getVariable [QEGVAR(movement,totalLoad), loadAbs _unit]) / 22.046) * GVAR(loadFactor);
|
params ["_duty", "_gearMass", "_terrainGradient", "_terrainFactor", "_speed"];
|
||||||
|
|
||||||
private _terrainAngle = asin (1 - ((surfaceNormal getPosASL _unit) select 2));
|
|
||||||
private _terrainGradient = (_terrainAngle / 45 min 1) * 5 * GVAR(terrainGradientFactor);
|
|
||||||
private _duty = GVAR(animDuty);
|
|
||||||
|
|
||||||
{
|
|
||||||
if (_x isEqualType 0) then {
|
|
||||||
_duty = _duty * _x;
|
|
||||||
} else {
|
|
||||||
_duty = _duty * (_unit call _x);
|
|
||||||
};
|
|
||||||
} forEach (values GVAR(dutyList));
|
|
||||||
|
|
||||||
if (GVAR(isSwimming)) then {
|
|
||||||
_terrainGradient = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Metabolic cost for walking and running is different
|
// Metabolic cost for walking and running is different
|
||||||
if (_velocity > 2) then {
|
if (_speed > 2) then {
|
||||||
// Running
|
// Running
|
||||||
|
#ifdef DEBUG_MODE_FULL
|
||||||
|
private _baseline = 2.1 * SIM_BODYMASS + 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) + (SIM_BODYMASS + _gearMass) * 0.9 * (_speed ^ 2);
|
||||||
|
private _graded = 2.1 * SIM_BODYMASS + 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) + _terrainFactor * (SIM_BODYMASS + _gearMass) * (0.9 * (_speed ^ 2) + 0.66 * _speed * _terrainGradient);
|
||||||
|
private _terrainImpact = abs ((_graded / _baseline) - 1);
|
||||||
|
hintSilent format ["FwdAngle: %1 | SideAngle: %2 \n TerrainFactor: %3 | TerrainGradient: %4 \n TerrainImpact: %5 \n Speed: %6 | CarriedLoad: %7 \n Duty: %8 | Work: %9",
|
||||||
|
_fwdAngle toFixed 1,
|
||||||
|
_sideAngle toFixed 1,
|
||||||
|
_terrainFactor toFixed 2,
|
||||||
|
_terrainGradient toFixed 1,
|
||||||
|
_terrainImpact toFixed 2,
|
||||||
|
_speed toFixed 2,
|
||||||
|
_gearMass toFixed 1,
|
||||||
|
_duty toFixed 2,
|
||||||
|
round (_graded * BIOMECH_EFFICIENCY * _duty)
|
||||||
|
];
|
||||||
|
#endif
|
||||||
|
|
||||||
(
|
(
|
||||||
2.10 * SIM_BODYMASS
|
2.1 * SIM_BODYMASS
|
||||||
+ 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2)
|
+ 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2)
|
||||||
+ (SIM_BODYMASS + _gearMass) * (0.9 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient)
|
+ _terrainFactor * (SIM_BODYMASS + _gearMass) * (0.9 * (_speed ^ 2) + 0.66 * _speed * _terrainGradient)
|
||||||
) * 0.23 * _duty
|
) * BIOMECH_EFFICIENCY * _duty
|
||||||
} else {
|
} else {
|
||||||
// Walking
|
// Walking
|
||||||
|
#ifdef DEBUG_MODE_FULL
|
||||||
|
private _baseline = 1.05 * SIM_BODYMASS + 2 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) + (SIM_BODYMASS + _gearMass) * 1.15 * (_speed ^ 2);
|
||||||
|
private _graded = 1.05 * SIM_BODYMASS + 2 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) + _terrainFactor * (SIM_BODYMASS + _gearMass) * (1.15 * (_speed ^ 2) + 0.66 * _speed * _terrainGradient);
|
||||||
|
private _terrainImpact = abs ((_graded / _baseline) - 1);
|
||||||
|
hintSilent format ["FwdAngle: %1 | SideAngle: %2 \n TerrainFactor: %3 | TerrainGradient: %4 \n TerrainImpact: %5 \n Speed: %6 | CarriedLoad: %7 \n Duty: %8 | Work: %9",
|
||||||
|
_fwdAngle toFixed 1,
|
||||||
|
_sideAngle toFixed 1,
|
||||||
|
_terrainFactor toFixed 2,
|
||||||
|
_terrainGradient toFixed 1,
|
||||||
|
_terrainImpact toFixed 2,
|
||||||
|
_speed toFixed 2,
|
||||||
|
_gearMass toFixed 1,
|
||||||
|
_duty toFixed 2,
|
||||||
|
round (_graded * BIOMECH_EFFICIENCY * _duty)
|
||||||
|
];
|
||||||
|
#endif
|
||||||
|
|
||||||
(
|
(
|
||||||
1.05 * SIM_BODYMASS
|
1.05 * SIM_BODYMASS
|
||||||
+ 2 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2)
|
+ 2 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2)
|
||||||
+ (SIM_BODYMASS + _gearMass) * (1.15 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient)
|
+ _terrainFactor * (SIM_BODYMASS + _gearMass) * (1.15 * (_speed ^ 2) + 0.66 * _speed * _terrainGradient)
|
||||||
) * 0.23 * _duty
|
) * BIOMECH_EFFICIENCY * _duty
|
||||||
};
|
};
|
||||||
|
@ -1,44 +1,44 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: BaerMitUmlaut
|
* Author: BaerMitUmlaut, ulteq
|
||||||
* Handles any audible, visual and physical effects of fatigue.
|
* Handles any audible, visual and physical effects of fatigue.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
* 1: Fatigue <NUMBER>
|
* 1: Fatigue <NUMBER>
|
||||||
* 2: Speed <NUMBER>
|
* 2: Overexhausted <BOOL>
|
||||||
* 3: Overexhausted <BOOL>
|
* 3: Forward Angle <NUMBER>
|
||||||
|
* 4: Side Angle <NUMBER>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [_player, 0.5, 3.3, true] call ace_advanced_fatigue_fnc_handleEffects
|
* [_player, 0.5, 3.3, true, 0, 0] call ace_advanced_fatigue_fnc_handleEffects
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
params ["_unit", "_fatigue", "_speed", "_overexhausted"];
|
|
||||||
|
|
||||||
#ifdef DEBUG_MODE_FULL
|
params ["_unit", "_fatigue", "_overexhausted", "_fwdAngle", "_sideAngle"];
|
||||||
systemChat str _fatigue;
|
|
||||||
systemChat str vectorMagnitude velocity _unit;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// - Audible effects ----------------------------------------------------------
|
// - Audible effects ----------------------------------------------------------
|
||||||
GVAR(lastBreath) = GVAR(lastBreath) + 1;
|
GVAR(lastBreath) = GVAR(lastBreath) + 1;
|
||||||
|
|
||||||
if (_fatigue > 0.4 && {GVAR(lastBreath) > (_fatigue * -10 + 9)} && {!underwater _unit}) then {
|
if (_fatigue > 0.4 && {GVAR(lastBreath) > (_fatigue * -10 + 9)} && {!underwater _unit}) then {
|
||||||
if (!isGameFocused) exitWith {};
|
if (!isGameFocused) exitWith {};
|
||||||
|
|
||||||
switch (true) do {
|
switch (true) do {
|
||||||
case (_fatigue < 0.6): {
|
case (_fatigue < 0.6): {
|
||||||
playSound (QGVAR(breathLow) + str(floor random 6));
|
playSound (QGVAR(breathLow) + str (floor random 6));
|
||||||
};
|
};
|
||||||
case (_fatigue < 0.85): {
|
case (_fatigue < 0.85): {
|
||||||
playSound (QGVAR(breathMid) + str(floor random 6));
|
playSound (QGVAR(breathMid) + str (floor random 6));
|
||||||
};
|
};
|
||||||
default {
|
default {
|
||||||
playSound (QGVAR(breathMax) + str(floor random 6));
|
playSound (QGVAR(breathMax) + str (floor random 6));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
GVAR(lastBreath) = 0;
|
GVAR(lastBreath) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -62,31 +62,35 @@ if (GVAR(isSwimming)) exitWith {
|
|||||||
if (GVAR(setAnimExclusions) isEqualTo []) then {
|
if (GVAR(setAnimExclusions) isEqualTo []) then {
|
||||||
_unit setAnimSpeedCoef linearConversion [0.7, 0.9, _fatigue, 1, 0.5, true];
|
_unit setAnimSpeedCoef linearConversion [0.7, 0.9, _fatigue, 1, 0.5, true];
|
||||||
};
|
};
|
||||||
if ((isSprintAllowed _unit) && {_fatigue > 0.7}) then {
|
|
||||||
|
if (isSprintAllowed _unit && _fatigue > 0.7) then { // small checks like these are faster without lazy eval
|
||||||
[_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
|
[_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
|
||||||
} else {
|
} else {
|
||||||
if ((!isSprintAllowed _unit) && {_fatigue < 0.7}) then {
|
if (!isSprintAllowed _unit && _fatigue < 0.7) then {
|
||||||
[_unit, "blockSprint", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
|
[_unit, "blockSprint", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if ((getAnimSpeedCoef _unit) != 1) then {
|
|
||||||
if (GVAR(setAnimExclusions) isEqualTo []) then {
|
// If other components are setting setAnimSpeedCoef, do not change animSpeedCoef
|
||||||
|
if (getAnimSpeedCoef _unit != 1 && {GVAR(setAnimExclusions) isEqualTo []}) then {
|
||||||
TRACE_1("reset",getAnimSpeedCoef _unit);
|
TRACE_1("reset",getAnimSpeedCoef _unit);
|
||||||
_unit setAnimSpeedCoef 1;
|
_unit setAnimSpeedCoef 1;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_overexhausted) then {
|
if (!isForcedWalk _unit && _fatigue >= 1) then { // small checks like these are faster without lazy eval
|
||||||
[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
|
[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
|
||||||
|
[_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
|
||||||
} else {
|
} else {
|
||||||
if (isForcedWalk _unit && {_fatigue < 0.7}) then {
|
if (isForcedWalk _unit && _fatigue < 0.7) then {
|
||||||
[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
|
[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
|
||||||
|
[_unit, "blockSprint", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
|
||||||
} else {
|
} else {
|
||||||
if ((isSprintAllowed _unit) && {_fatigue > 0.7}) then {
|
// Forward angle is the slope of the terrain, side angle simulates the unevenness/roughness of the terrain
|
||||||
|
if (isSprintAllowed _unit && {_fatigue > 0.7 || abs _fwdAngle > 20 || abs _sideAngle > 20}) then {
|
||||||
[_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
|
[_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
|
||||||
} else {
|
} else {
|
||||||
if ((!isSprintAllowed _unit) && {_fatigue < 0.6}) then {
|
if (!isSprintAllowed _unit && _fatigue < 0.6 && abs _fwdAngle < 20 && abs _sideAngle < 20) then {
|
||||||
[_unit, "blockSprint", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
|
[_unit, "blockSprint", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: BaerMitUmlaut
|
* Author: BaerMitUmlaut, ulteq
|
||||||
* Handles switching units (once on init and afterwards via Zeus).
|
* Handles switching units (once on init and afterwards via Zeus). Also handles CBA setting change for performance factor.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: New Unit <OBJECT>
|
* 0: New Unit <OBJECT>
|
||||||
@ -15,20 +15,24 @@
|
|||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_newUnit", "_oldUnit"];
|
params ["_newUnit", "_oldUnit"];
|
||||||
|
|
||||||
TRACE_2("unit changed",_newUnit,_oldUnit);
|
TRACE_2("unit changed",_newUnit,_oldUnit);
|
||||||
|
|
||||||
if !(isNull _oldUnit) then {
|
if (!isNull _oldUnit) then {
|
||||||
|
TRACE_1("remove old",_oldUnit getVariable QGVAR(animHandler));
|
||||||
|
|
||||||
_oldUnit enableStamina true;
|
_oldUnit enableStamina true;
|
||||||
_oldUnit removeEventHandler ["AnimChanged", _oldUnit getVariable [QGVAR(animHandler), -1]];
|
_oldUnit removeEventHandler ["AnimChanged", _oldUnit getVariable [QGVAR(animHandler), -1]];
|
||||||
_oldUnit setVariable [QGVAR(animHandler), nil];
|
_oldUnit setVariable [QGVAR(animHandler), nil];
|
||||||
TRACE_1("remove old",_oldUnit getVariable QGVAR(animHandler));
|
|
||||||
|
|
||||||
_oldUnit setVariable [QGVAR(ae1Reserve), GVAR(ae1Reserve)];
|
_oldUnit setVariable [QGVAR(ae1Reserve), GVAR(ae1Reserve)];
|
||||||
_oldUnit setVariable [QGVAR(ae2Reserve), GVAR(ae2Reserve)];
|
_oldUnit setVariable [QGVAR(ae2Reserve), GVAR(ae2Reserve)];
|
||||||
_oldUnit setVariable [QGVAR(anReserve), GVAR(anReserve)];
|
_oldUnit setVariable [QGVAR(anReserve), GVAR(anReserve)];
|
||||||
_oldUnit setVariable [QGVAR(anFatigue), GVAR(anFatigue)];
|
_oldUnit setVariable [QGVAR(anFatigue), GVAR(anFatigue)];
|
||||||
_oldUnit setVariable [QGVAR(muscleDamage), GVAR(muscleDamage)];
|
_oldUnit setVariable [QGVAR(muscleDamage), GVAR(muscleDamage)];
|
||||||
|
_oldUnit setVariable [QGVAR(respiratoryRate), GVAR(respiratoryRate)];
|
||||||
};
|
};
|
||||||
|
|
||||||
_newUnit enableStamina false;
|
_newUnit enableStamina false;
|
||||||
@ -38,6 +42,7 @@ if (_newUnit getVariable [QGVAR(animHandler), -1] == -1) then {
|
|||||||
private _animHandler = _newUnit addEventHandler ["AnimChanged", {
|
private _animHandler = _newUnit addEventHandler ["AnimChanged", {
|
||||||
GVAR(animDuty) = _this call FUNC(getAnimDuty);
|
GVAR(animDuty) = _this call FUNC(getAnimDuty);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
TRACE_1("add new",_animHandler);
|
TRACE_1("add new",_animHandler);
|
||||||
_newUnit setVariable [QGVAR(animHandler), _animHandler];
|
_newUnit setVariable [QGVAR(animHandler), _animHandler];
|
||||||
};
|
};
|
||||||
@ -47,18 +52,27 @@ GVAR(ae2Reserve) = _newUnit getVariable [QGVAR(ae2Reserve), AE2_MAXRESERVE]
|
|||||||
GVAR(anReserve) = _newUnit getVariable [QGVAR(anReserve), AN_MAXRESERVE];
|
GVAR(anReserve) = _newUnit getVariable [QGVAR(anReserve), AN_MAXRESERVE];
|
||||||
GVAR(anFatigue) = _newUnit getVariable [QGVAR(anFatigue), 0];
|
GVAR(anFatigue) = _newUnit getVariable [QGVAR(anFatigue), 0];
|
||||||
GVAR(muscleDamage) = _newUnit getVariable [QGVAR(muscleDamage), 0];
|
GVAR(muscleDamage) = _newUnit getVariable [QGVAR(muscleDamage), 0];
|
||||||
|
GVAR(respiratoryRate) = _newUnit getVariable [QGVAR(respiratoryRate), 0];
|
||||||
|
|
||||||
// Clean variables for respawning units
|
// Clean variables for respawning units
|
||||||
{
|
{
|
||||||
_newUnit setVariable [_x, nil];
|
_newUnit setVariable [_x, nil];
|
||||||
} forEach [QGVAR(ae1Reserve), QGVAR(ae2Reserve), QGVAR(anReserve), QGVAR(anFatigue), QGVAR(muscleDamage)];
|
} forEach [QGVAR(ae1Reserve), QGVAR(ae2Reserve), QGVAR(anReserve), QGVAR(anFatigue), QGVAR(muscleDamage), QGVAR(respiratoryRate)];
|
||||||
|
|
||||||
GVAR(VO2Max) = 35 + 20 * (_newUnit getVariable [QGVAR(performanceFactor), GVAR(performanceFactor)]);
|
GVAR(VO2Max) = 35 + 20 * (_newUnit getVariable [QGVAR(performanceFactor), GVAR(performanceFactor)]);
|
||||||
GVAR(VO2MaxPower) = GVAR(VO2Max) * SIM_BODYMASS * 0.23 * JOULES_PER_ML_O2 / 60;
|
GVAR(VO2MaxPower) = GVAR(VO2Max) * SIM_BODYMASS * BIOMECH_EFFICIENCY * JOULES_PER_ML_O2 / 60;
|
||||||
GVAR(peakPower) = VO2MAX_STRENGTH * GVAR(VO2MaxPower);
|
GVAR(peakPower) = VO2MAX_STRENGTH * GVAR(VO2MaxPower);
|
||||||
|
|
||||||
GVAR(ae1PathwayPower) = GVAR(peakPower) / (13.3 + 16.7 + 113.3) * 13.3 * ANTPERCENT ^ 1.28 * 1.362;
|
GVAR(ae1PathwayPower) = GVAR(peakPower) / (AE1_ATP_RELEASE_RATE + AE2_ATP_RELEASE_RATE + AN_ATP_RELEASE_RATE) * AE1_ATP_RELEASE_RATE * ANTPERCENT ^ 1.28 * 1.362;
|
||||||
GVAR(ae2PathwayPower) = GVAR(peakPower) / (13.3 + 16.7 + 113.3) * 16.7 * ANTPERCENT ^ 1.28 * 1.362;
|
GVAR(ae2PathwayPower) = GVAR(peakPower) / (AE1_ATP_RELEASE_RATE + AE2_ATP_RELEASE_RATE + AN_ATP_RELEASE_RATE) * AE2_ATP_RELEASE_RATE * ANTPERCENT ^ 1.28 * 1.362;
|
||||||
|
GVAR(aePathwayPower) = GVAR(ae1PathwayPower) + GVAR(ae2PathwayPower);
|
||||||
|
GVAR(anPathwayPower) = GVAR(peakPower) - GVAR(aePathwayPower);
|
||||||
|
|
||||||
|
GVAR(aeWattsPerATP) = GVAR(ae1PathwayPower) / AE1_ATP_RELEASE_RATE;
|
||||||
|
GVAR(anWattsPerATP) = GVAR(anPathwayPower) / AN_ATP_RELEASE_RATE;
|
||||||
|
|
||||||
|
GVAR(respiratoryBufferDivisor) = (RESPIRATORY_BUFFER - 1) / RESPIRATORY_BUFFER;
|
||||||
|
GVAR(maxPowerFatigueRatio) = 0.057 / GVAR(peakPower);
|
||||||
|
|
||||||
GVAR(ppeBlackoutLast) = 100;
|
GVAR(ppeBlackoutLast) = 100;
|
||||||
GVAR(lastBreath) = 0;
|
GVAR(lastBreath) = 0;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: BaerMitUmlaut
|
* Author: BaerMitUmlaut, ulteq
|
||||||
* Main looping function that updates fatigue values.
|
* Main looping function that updates fatigue values.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
@ -17,67 +17,131 @@
|
|||||||
|
|
||||||
// Dead people don't breathe, will also handle null (map intros)
|
// Dead people don't breathe, will also handle null (map intros)
|
||||||
if (!alive ACE_player) exitWith {
|
if (!alive ACE_player) exitWith {
|
||||||
[FUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute;
|
[LINKFUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute;
|
||||||
|
|
||||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
||||||
_staminaBarContainer ctrlSetFade 1;
|
_staminaBarContainer ctrlSetFade 1;
|
||||||
_staminaBarContainer ctrlCommit 1;
|
_staminaBarContainer ctrlCommit 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private _velocity = velocity ACE_player;
|
||||||
|
private _normal = surfaceNormal (getPosWorld ACE_player);
|
||||||
|
private _movementVector = vectorNormalized _velocity;
|
||||||
|
private _sideVector = vectorNormalized (_movementVector vectorCrossProduct _normal);
|
||||||
|
private _fwdAngle = asin (_movementVector select 2);
|
||||||
|
private _sideAngle = asin (_sideVector select 2);
|
||||||
|
|
||||||
private _currentWork = REE;
|
private _currentWork = REE;
|
||||||
private _currentSpeed = (vectorMagnitude (velocity ACE_player)) min 6;
|
private _currentSpeed = (vectorMagnitude _velocity) min 6;
|
||||||
|
|
||||||
// fix #4481. Diving to the ground is recorded as PRONE stance with running speed velocity. Cap maximum speed to fix.
|
// fix #4481. Diving to the ground is recorded as PRONE stance with running speed velocity. Cap maximum speed to fix.
|
||||||
if (GVAR(isProne)) then {
|
if (GVAR(isProne)) then {
|
||||||
_currentSpeed = _currentSpeed min 1.5;
|
_currentSpeed = _currentSpeed min 1.5;
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((vehicle ACE_player == ACE_player) && {_currentSpeed > 0.1} && {isTouchingGround ACE_player || {underwater ACE_player}}) then {
|
// Get the current duty
|
||||||
_currentWork = [ACE_player, _currentSpeed] call FUNC(getMetabolicCosts);
|
private _duty = GVAR(animDuty);
|
||||||
|
|
||||||
|
{
|
||||||
|
if (_x isEqualType 0) then {
|
||||||
|
_duty = _duty * _x;
|
||||||
|
} else {
|
||||||
|
_duty = _duty * (ACE_player call _x);
|
||||||
|
};
|
||||||
|
} forEach (values GVAR(dutyList));
|
||||||
|
|
||||||
|
private _terrainGradient = abs _fwdAngle;
|
||||||
|
private _terrainFactor = 1;
|
||||||
|
private _gearMass = 0 max (((ACE_player getVariable [QEGVAR(movement,totalLoad), loadAbs ACE_player]) / 22.046 - UNDERWEAR_WEIGHT) * GVAR(loadFactor));
|
||||||
|
|
||||||
|
if (isNull objectParent ACE_player && {_currentSpeed > 0.1} && {isTouchingGround ACE_player || {underwater ACE_player}}) then {
|
||||||
|
if (!GVAR(isSwimming)) then {
|
||||||
|
// If the unit is going downhill, it's much less demanding
|
||||||
|
if (_fwdAngle < 0) then {
|
||||||
|
_terrainGradient = 0.15 * _terrainGradient;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Used to simulate the unevenness/roughness of the terrain
|
||||||
|
if ((getPosATL ACE_player) select 2 < 0.01) then {
|
||||||
|
private _sideGradient = abs (_sideAngle / 45) min 1;
|
||||||
|
|
||||||
|
_terrainFactor = 1 + _sideGradient ^ 4;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
_currentWork = [_duty, _gearMass, _terrainGradient * GVAR(terrainGradientFactor), _terrainFactor, _currentSpeed] call FUNC(getMetabolicCosts);
|
||||||
_currentWork = _currentWork max REE;
|
_currentWork = _currentWork max REE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Oxygen calculation
|
||||||
|
private _oxygen = if (GETEGVAR(medical,enabled,false) && {EGVAR(medical_vitals,simulateSpo2)}) then { // Defer to medical
|
||||||
|
(ACE_player getVariable [QEGVAR(medical,spo2), 97]) / 100
|
||||||
|
} else {
|
||||||
|
1 - 0.131 * GVAR(respiratoryRate) ^ 2 // Default AF oxygen saturation
|
||||||
|
};
|
||||||
// Calculate muscle damage increase
|
// Calculate muscle damage increase
|
||||||
// Note: Muscle damage recovery is ignored as it takes multiple days
|
GVAR(muscleDamage) = GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.2 * MUSCLE_TEAR_RATE;
|
||||||
GVAR(muscleDamage) = (GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.2 * 0.00004) min 1;
|
|
||||||
private _muscleIntegritySqrt = sqrt (1 - GVAR(muscleDamage));
|
// Calculate muscle damage recovery
|
||||||
|
GVAR(muscleDamage) = 0 max (GVAR(muscleDamage) - MUSCLE_RECOVERY * GVAR(recoveryFactor)) min 1;
|
||||||
|
private _muscleIntegrity = 1 - GVAR(muscleDamage);
|
||||||
|
private _muscleFactor = sqrt _muscleIntegrity;
|
||||||
|
|
||||||
// Calculate available power
|
// Calculate available power
|
||||||
private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt;
|
private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * _oxygen * _muscleFactor;
|
||||||
private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt;
|
private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * _oxygen * _muscleFactor;
|
||||||
|
private _aePathwayPowerFatigued = _ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued;
|
||||||
|
private _anPathwayPowerFatigued = GVAR(anPathwayPower) * sqrt (GVAR(anReserve) / AN_MAXRESERVE) * _oxygen * _muscleIntegrity;
|
||||||
|
|
||||||
// Calculate how much power is consumed from each reserve
|
// Calculate how much power is consumed from each reserve
|
||||||
private _ae1Power = _currentWork min _ae1PathwayPowerFatigued;
|
private _ae1Power = _currentWork min _ae1PathwayPowerFatigued;
|
||||||
private _ae2Power = ((_currentWork - _ae1Power) max 0) min _ae2PathwayPowerFatigued;
|
private _ae2Power = (_currentWork - _ae1Power) min _ae2PathwayPowerFatigued;
|
||||||
private _anPower = (_currentWork - _ae1Power - _ae2Power) max 0;
|
private _anPower = 0 max (_currentWork - _ae1Power - _ae2Power);
|
||||||
|
|
||||||
// Remove ATP from reserves for current work
|
// Remove ATP from reserves for current work
|
||||||
GVAR(ae1Reserve) = GVAR(ae1Reserve) - _ae1Power / WATTSPERATP;
|
GVAR(ae1Reserve) = 0 max (GVAR(ae1Reserve) - _ae1Power / GVAR(aeWattsPerATP));
|
||||||
GVAR(ae2Reserve) = GVAR(ae2Reserve) - _ae2Power / WATTSPERATP;
|
GVAR(ae2Reserve) = 0 max (GVAR(ae2Reserve) - _ae2Power / GVAR(aeWattsPerATP));
|
||||||
GVAR(anReserve) = GVAR(anReserve) - _anPower / WATTSPERATP;
|
GVAR(anReserve) = 0 max (GVAR(anReserve) - _anPower / GVAR(anWattsPerATP));
|
||||||
// Increase anearobic fatigue
|
|
||||||
GVAR(anFatigue) = GVAR(anFatigue) + _anPower * (0.057 / GVAR(peakPower)) * 1.1;
|
// Acidosis accumulation
|
||||||
|
GVAR(anFatigue) = GVAR(anFatigue) + _anPower * GVAR(maxPowerFatigueRatio) * 1.1;
|
||||||
|
|
||||||
// Aerobic ATP reserve recovery
|
// Aerobic ATP reserve recovery
|
||||||
GVAR(ae1Reserve) = ((GVAR(ae1Reserve) + OXYGEN * 6.60 * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower) * GVAR(recoveryFactor)) min AE1_MAXRESERVE) max 0;
|
GVAR(ae1Reserve) = (GVAR(ae1Reserve) + _oxygen * GVAR(recoveryFactor) * AE1_ATP_RECOVERY * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower)) min AE1_MAXRESERVE;
|
||||||
GVAR(ae2Reserve) = ((GVAR(ae2Reserve) + OXYGEN * 5.83 * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower) * GVAR(recoveryFactor)) min AE2_MAXRESERVE) max 0;
|
GVAR(ae2Reserve) = (GVAR(ae2Reserve) + _oxygen * GVAR(recoveryFactor) * AE2_ATP_RECOVERY * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower)) min AE2_MAXRESERVE;
|
||||||
|
|
||||||
// Anaerobic ATP reserver and fatigue recovery
|
private _aeSurplus = _ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power;
|
||||||
GVAR(anReserve) = ((GVAR(anReserve)
|
|
||||||
+ (_ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power) / GVAR(VO2MaxPower) * 56.7 * GVAR(anFatigue) ^ 2 * GVAR(recoveryFactor)
|
|
||||||
) min AN_MAXRESERVE) max 0;
|
|
||||||
|
|
||||||
GVAR(anFatigue) = ((GVAR(anFatigue)
|
// Anaerobic ATP reserve recovery
|
||||||
- (_ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power) * (0.057 / GVAR(peakPower)) * GVAR(anFatigue) ^ 2 * GVAR(recoveryFactor)
|
GVAR(anReserve) = 0 max (GVAR(anReserve) + _aeSurplus / GVAR(VO2MaxPower) * AN_ATP_RECOVERY * GVAR(recoveryFactor) * (GVAR(anFatigue) max linearConversion [AN_MAXRESERVE, 0, GVAR(anReserve), 0, 0.75, true]) ^ 2) min AN_MAXRESERVE; // max linearConversion ensures that if GVAR(anFatigue) is very low, it will still regenerate reserves
|
||||||
) min 1) max 0;
|
// Acidosis recovery
|
||||||
|
GVAR(anFatigue) = 0 max (GVAR(anFatigue) - _aeSurplus * GVAR(maxPowerFatigueRatio) * GVAR(recoveryFactor) * GVAR(anFatigue) ^ 2) min 1;
|
||||||
|
|
||||||
private _aeReservePercentage = (GVAR(ae1Reserve) / AE1_MAXRESERVE + GVAR(ae2Reserve) / AE2_MAXRESERVE) / 2;
|
// Respiratory rate decrease
|
||||||
private _anReservePercentage = GVAR(anReserve) / AN_MAXRESERVE;
|
GVAR(respiratoryRate) = GVAR(respiratoryRate) * GVAR(respiratoryBufferDivisor);
|
||||||
private _perceivedFatigue = 1 - (_anReservePercentage min _aeReservePercentage);
|
|
||||||
|
|
||||||
[ACE_player, _perceivedFatigue, _currentSpeed, GVAR(anReserve) == 0] call FUNC(handleEffects);
|
// Respiratory rate increase
|
||||||
|
private _aePowerRatio = (GVAR(aePathwayPower) / _aePathwayPowerFatigued) min 2;
|
||||||
|
private _respiratorySampleDivisor = 1 / (RESPIRATORY_BUFFER * 4.72 * GVAR(VO2Max));
|
||||||
|
GVAR(respiratoryRate) = (GVAR(respiratoryRate) + _currentWork * _respiratorySampleDivisor * _aePowerRatio) min 1;
|
||||||
|
|
||||||
if (GVAR(enableStaminaBar)) then {
|
// Calculate a pseudo-perceived fatigue, which is used for effects
|
||||||
|
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));
|
||||||
|
|
||||||
|
#ifdef DEBUG_MODE_FULL
|
||||||
|
systemChat format ["---- muscleDamage: %1 ----", GVAR(muscleDamage) toFixed 8];
|
||||||
|
systemChat format ["---- ae2: %1 - an: %2 ----", (GVAR(ae2Reserve) / AE2_MAXRESERVE) toFixed 2, (GVAR(anReserve) / AN_MAXRESERVE) toFixed 2];
|
||||||
|
systemChat format ["---- anFatigue: %1 - perceivedFatigue: %2 ----", GVAR(anFatigue) toFixed 2, _perceivedFatigue toFixed 2];
|
||||||
|
systemChat format ["---- velocity %1 - respiratoryRate: %2 ----", (vectorMagnitude _velocity) toFixed 2, GVAR(respiratoryRate) toFixed 2];
|
||||||
|
// systemChat format ["---- aePower: %1 ----", _aePathwayPowerFatigued toFixed 1];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[ACE_player, _perceivedFatigue, GVAR(anReserve) == 0, _fwdAngle, _sideAngle] call FUNC(handleEffects);
|
||||||
|
|
||||||
|
if (GVAR(enableStaminaBarRealized)) then {
|
||||||
[GVAR(anReserve) / AN_MAXRESERVE] call FUNC(handleStaminaBar);
|
[GVAR(anReserve) / AN_MAXRESERVE] call FUNC(handleStaminaBar);
|
||||||
};
|
};
|
||||||
|
|
||||||
[FUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute;
|
[LINKFUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute;
|
||||||
|
40
addons/advanced_fatigue/functions/fnc_renderDebugLines.sqf
Normal file
40
addons/advanced_fatigue/functions/fnc_renderDebugLines.sqf
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: ulteq
|
||||||
|
* Draw lines for debugging.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* call ace_advanced_fatigue_fnc_renderDebugLines
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
|
||||||
|
addMissionEventHandler ["Draw3D", {
|
||||||
|
private _normal = surfaceNormal (getPosWorld ACE_player);
|
||||||
|
private _beg = (getPosWorld ACE_player) vectorAdd (_normal vectorMultiply 0.5);
|
||||||
|
private _end = _beg vectorAdd (_normal vectorMultiply 2);
|
||||||
|
drawLine3D [ASLToATL _beg, ASLToATL _end, [0, 1, 0, 1]];
|
||||||
|
|
||||||
|
private _side = vectorNormalized (_normal vectorCrossProduct [0, 0, 1]);
|
||||||
|
private _end = _beg vectorAdd (_side vectorMultiply 2);
|
||||||
|
drawLine3D [ASLToATL _beg, ASLToATL _end, [0, 0, 1, 1]];
|
||||||
|
|
||||||
|
private _up = vectorNormalized (_normal vectorCrossProduct _side);
|
||||||
|
private _end = _beg vectorAdd (_up vectorMultiply 2);
|
||||||
|
drawLine3D [ASLToATL _beg, ASLToATL _end, [1, 0, 0, 1]];
|
||||||
|
|
||||||
|
private _movementVector = vectorNormalized (velocity ACE_player);
|
||||||
|
private _end = _beg vectorAdd (_movementVector vectorMultiply 2);
|
||||||
|
drawLine3D [ASLToATL _beg, ASLToATL _end, [1, 1, 0, 1]];
|
||||||
|
|
||||||
|
private _sideVector = vectorNormalized (_movementVector vectorCrossProduct _normal);
|
||||||
|
_sideVector set [2, 0];
|
||||||
|
private _end = _beg vectorAdd (_sideVector vectorMultiply 2);
|
||||||
|
drawLine3D [ASLToATL _beg, ASLToATL _end, [0, 1, 1, 1]];
|
||||||
|
}];
|
25
addons/advanced_fatigue/functions/fnc_updateStaminaBar.sqf
Normal file
25
addons/advanced_fatigue/functions/fnc_updateStaminaBar.sqf
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: PabstMirror
|
||||||
|
* Updates the stamina bar state
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [] call ace_advanced_fatigue_fnc_updateStaminaBar
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
|
||||||
|
GVAR(enableStaminaBarRealized) = GVAR(enabled) && GVAR(enableStaminaBar) && {!(missionNamespace getVariable [QEGVAR(ui,hideHud), false])};
|
||||||
|
TRACE_1("updateStaminaBar",GVAR(enableStaminaBarRealized));
|
||||||
|
|
||||||
|
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
||||||
|
if (isNull _staminaBarContainer) exitWith {};
|
||||||
|
|
||||||
|
_staminaBarContainer ctrlSetFade ([1, 0] select GVAR(enableStaminaBarRealized));
|
||||||
|
_staminaBarContainer ctrlCommit 0;
|
@ -4,12 +4,9 @@
|
|||||||
[LSTRING(Enabled), LSTRING(Enabled_Description)],
|
[LSTRING(Enabled), LSTRING(Enabled_Description)],
|
||||||
LSTRING(DisplayName),
|
LSTRING(DisplayName),
|
||||||
true,
|
true,
|
||||||
true, {
|
1,
|
||||||
if (!_this) then {
|
{
|
||||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
call FUNC(updateStaminaBar);
|
||||||
_staminaBarContainer ctrlSetFade 1;
|
|
||||||
_staminaBarContainer ctrlCommit 0;
|
|
||||||
};
|
|
||||||
[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)
|
[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)
|
||||||
},
|
},
|
||||||
true // Needs mission restart
|
true // Needs mission restart
|
||||||
@ -21,13 +18,8 @@
|
|||||||
[LSTRING(EnableStaminaBar), LSTRING(EnableStaminaBar_Description)],
|
[LSTRING(EnableStaminaBar), LSTRING(EnableStaminaBar_Description)],
|
||||||
LSTRING(DisplayName),
|
LSTRING(DisplayName),
|
||||||
true,
|
true,
|
||||||
true, {
|
1,
|
||||||
if (!_this) then {
|
{call FUNC(updateStaminaBar)}
|
||||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
|
||||||
_staminaBarContainer ctrlSetFade 1;
|
|
||||||
_staminaBarContainer ctrlCommit 0;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
|
||||||
[
|
[
|
||||||
@ -36,7 +28,8 @@
|
|||||||
[LSTRING(FadeStaminaBar), LSTRING(FadeStaminaBar_Description)],
|
[LSTRING(FadeStaminaBar), LSTRING(FadeStaminaBar_Description)],
|
||||||
LSTRING(DisplayName),
|
LSTRING(DisplayName),
|
||||||
true,
|
true,
|
||||||
false, {
|
0,
|
||||||
|
{
|
||||||
if (!_this && GVAR(enabled) && GVAR(enableStaminaBar)) then {
|
if (!_this && GVAR(enabled) && GVAR(enableStaminaBar)) then {
|
||||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
||||||
_staminaBarContainer ctrlSetFade 0;
|
_staminaBarContainer ctrlSetFade 0;
|
||||||
@ -50,8 +43,14 @@
|
|||||||
"SLIDER",
|
"SLIDER",
|
||||||
[LSTRING(PerformanceFactor), LSTRING(PerformanceFactor_Description)],
|
[LSTRING(PerformanceFactor), LSTRING(PerformanceFactor_Description)],
|
||||||
LSTRING(DisplayName),
|
LSTRING(DisplayName),
|
||||||
[0, 5, 1, 1],
|
[0, 10, 1, 2],
|
||||||
true
|
1,
|
||||||
|
{
|
||||||
|
// Recalculate values if the setting is changed mid-mission
|
||||||
|
if (GVAR(enabled) && hasInterface && !isNull ACE_player) then {
|
||||||
|
[ACE_player, ACE_player] call FUNC(handlePlayerChanged);
|
||||||
|
};
|
||||||
|
}
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
|
||||||
[
|
[
|
||||||
@ -59,8 +58,8 @@
|
|||||||
"SLIDER",
|
"SLIDER",
|
||||||
[LSTRING(RecoveryFactor), LSTRING(RecoveryFactor_Description)],
|
[LSTRING(RecoveryFactor), LSTRING(RecoveryFactor_Description)],
|
||||||
LSTRING(DisplayName),
|
LSTRING(DisplayName),
|
||||||
[0, 5, 1, 1],
|
[0, 10, 1, 2],
|
||||||
true
|
1
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
|
||||||
[
|
[
|
||||||
@ -68,8 +67,8 @@
|
|||||||
"SLIDER",
|
"SLIDER",
|
||||||
[LSTRING(LoadFactor), LSTRING(LoadFactor_Description)],
|
[LSTRING(LoadFactor), LSTRING(LoadFactor_Description)],
|
||||||
LSTRING(DisplayName),
|
LSTRING(DisplayName),
|
||||||
[0, 5, 1, 1],
|
[0, 5, 1, 2],
|
||||||
true
|
1
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
|
||||||
[
|
[
|
||||||
@ -77,33 +76,6 @@
|
|||||||
"SLIDER",
|
"SLIDER",
|
||||||
[LSTRING(TerrainGradientFactor), LSTRING(TerrainGradientFactor_Description)],
|
[LSTRING(TerrainGradientFactor), LSTRING(TerrainGradientFactor_Description)],
|
||||||
LSTRING(DisplayName),
|
LSTRING(DisplayName),
|
||||||
[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;
|
|
||||||
|
|
||||||
[
|
|
||||||
QGVAR(restedSwayFactor),
|
|
||||||
"SLIDER",
|
|
||||||
[LSTRING(RestedSwayFactor), LSTRING(RestedSwayFactor_Description)],
|
|
||||||
LSTRING(DisplayName),
|
|
||||||
[0, 5, 1, 2],
|
[0, 5, 1, 2],
|
||||||
true
|
1
|
||||||
] call CBA_fnc_addSetting;
|
|
||||||
|
|
||||||
[
|
|
||||||
QGVAR(deployedSwayFactor),
|
|
||||||
"SLIDER",
|
|
||||||
[LSTRING(DeployedSwayFactor), LSTRING(DeployedSwayFactor_Description)],
|
|
||||||
LSTRING(DisplayName),
|
|
||||||
[0, 5, 1, 2],
|
|
||||||
true
|
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
@ -16,14 +16,28 @@
|
|||||||
|
|
||||||
#include "\z\ace\addons\main\script_macros.hpp"
|
#include "\z\ace\addons\main\script_macros.hpp"
|
||||||
|
|
||||||
|
#define UNDERWEAR_WEIGHT 3.5
|
||||||
|
|
||||||
#define ANTPERCENT 0.8
|
#define ANTPERCENT 0.8
|
||||||
#define SIM_BODYMASS 70
|
#define SIM_BODYMASS 70
|
||||||
#define JOULES_PER_ML_O2 20.9
|
#define JOULES_PER_ML_O2 20.9
|
||||||
#define VO2MAX_STRENGTH 4.1
|
#define VO2MAX_STRENGTH 4.1
|
||||||
#define REE 18.83 //((0.5617 * SIM_BODYMASS + 42.57) * 0.23)
|
#define BIOMECH_EFFICIENCY 0.23
|
||||||
#define OXYGEN 0.9
|
#define REE 18.83 // ((0.5617 * SIM_BODYMASS + 42.57) * BIOMECH_EFFICIENCY)
|
||||||
#define WATTSPERATP 7
|
|
||||||
|
|
||||||
#define AE1_MAXRESERVE 4000000
|
#define RESPIRATORY_BUFFER 60
|
||||||
#define AE2_MAXRESERVE 84000
|
|
||||||
#define AN_MAXRESERVE 2300
|
#define MUSCLE_TEAR_RATE 0.00004
|
||||||
|
#define MUSCLE_RECOVERY 0.00000386
|
||||||
|
|
||||||
|
#define AE1_ATP_RELEASE_RATE 13.3 // mmol
|
||||||
|
#define AE2_ATP_RELEASE_RATE 16.7 // mmol
|
||||||
|
#define AN_ATP_RELEASE_RATE 113.3 // mmol
|
||||||
|
|
||||||
|
#define AE1_ATP_RECOVERY 6.60 // mmol
|
||||||
|
#define AE2_ATP_RECOVERY 5.83 // mmol
|
||||||
|
#define AN_ATP_RECOVERY 56.70 // mmol
|
||||||
|
|
||||||
|
#define AE1_MAXRESERVE 4000000 // mmol
|
||||||
|
#define AE2_MAXRESERVE 84000 // mmol
|
||||||
|
#define AN_MAXRESERVE 2300 // mmol
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<German>ACE Erweiterte Ausdauer</German>
|
<German>ACE Erweiterte Ausdauer</German>
|
||||||
<Chinese>ACE 進階疲勞</Chinese>
|
<Chinese>ACE 進階疲勞</Chinese>
|
||||||
<Chinesesimp>ACE 进阶体力</Chinesesimp>
|
<Chinesesimp>ACE 进阶体力</Chinesesimp>
|
||||||
<Japanese>ACE アドバンスド疲労</Japanese>
|
<Japanese>ACE 高度な疲労</Japanese>
|
||||||
<Italian>ACE Fatica Avanzata</Italian>
|
<Italian>ACE Fatica Avanzata</Italian>
|
||||||
<Korean>ACE 고급 피로도</Korean>
|
<Korean>ACE 고급 피로도</Korean>
|
||||||
<French>ACE Fatigue avancée</French>
|
<French>ACE Fatigue avancée</French>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
<Italian>Influenza la prestazione generale 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>
|
<Chinese>影響所有玩家的體力表現,值越高代表體力越好</Chinese>
|
||||||
<Chinesesimp>影响所有玩家的体力表现,值越高代表体力越好</Chinesesimp>
|
<Chinesesimp>影响所有玩家的体力表现,值越高代表体力越好</Chinesesimp>
|
||||||
<Russian>Влияет на общую производительность игроков, у которых не задано персональное значение.</Russian>
|
<Russian>Влияет на общую производительность игроков, у которых не задано персональное значение. Чем выше, тем лучше.</Russian>
|
||||||
<Portuguese>Influencia na performance geral de todos os jogadores sem nenhum fator personalizado. Quanto maior, melhor.</Portuguese>
|
<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>
|
<Czech>Ovlivňuje celkový výkon všech hráčů bez vlastního faktoru. Vyšší znamená lépe.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
<Italian>Influenza la prestazione personalizzata di questa unità. Maggiore significa migliore.</Italian>
|
<Italian>Influenza la prestazione personalizzata di questa unità. Maggiore significa migliore.</Italian>
|
||||||
<Chinese>影響這個單位的體力表現,值越高代表體力越好</Chinese>
|
<Chinese>影響這個單位的體力表現,值越高代表體力越好</Chinese>
|
||||||
<Chinesesimp>影响这个单位的体力表现,值越高代表体力越好</Chinesesimp>
|
<Chinesesimp>影响这个单位的体力表现,值越高代表体力越好</Chinesesimp>
|
||||||
<Russian>Влияет на общую производительность юнита.</Russian>
|
<Russian>Влияет на общую производительность юнита.Чем выше, тем лучше.</Russian>
|
||||||
<Portuguese>Influencia na performance geral dessa unidade. Quanto maior, melhor.</Portuguese>
|
<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>
|
<Czech>Ovlivňuje celkový výkon této jednotky. Vyšší znamená lépe.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
@ -154,72 +154,6 @@
|
|||||||
<Portuguese>Define o quanto que um terreno íngrime aumenta na perda de estamina. Quanto maior, maior a perda de estamina.</Portuguese>
|
<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>
|
<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>
|
||||||
<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, 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'aumento di oscillazione dell'arma quando affaticato. 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_RestedSwayFactor">
|
|
||||||
<English>Rested sway factor</English>
|
|
||||||
<French>Facteur de balancement au repos</French>
|
|
||||||
<Korean>휴식 시 손떨림 정도</Korean>
|
|
||||||
<Portuguese>Fator de balanço de mira em repouso</Portuguese>
|
|
||||||
<German>Verwacklungsfaktor, wenn aufgelegt</German>
|
|
||||||
<Italian>Fattore di Oscillazione Appoggiato</Italian>
|
|
||||||
<Japanese>静止時の手ぶれ係数</Japanese>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_ACE_Advanced_Fatigue_RestedSwayFactor_Description">
|
|
||||||
<English>Influences the amount of weapon sway while weapon is rested.</English>
|
|
||||||
<French>Influence le degré de balancement de l'arme au repos.</French>
|
|
||||||
<Korean>무기가 아무런 행동도 하지 않는 동안 무기가 흔들리는 정도를 정합니다.</Korean>
|
|
||||||
<Portuguese>Influencia a quantidade de balanço de mira enquanto a arma está em repouso.</Portuguese>
|
|
||||||
<German>Beeinflusst, wie ruhig man die Waffe hält, während sie aufgelegt ist.</German>
|
|
||||||
<Italian>Determina la quantità di oscillazione dell'arma quando questa è appoggiata.</Italian>
|
|
||||||
<Japanese>静止している時の武器の手ぶれの量に影響します。</Japanese>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_ACE_Advanced_Fatigue_DeployedSwayFactor">
|
|
||||||
<English>Deployed sway factor</English>
|
|
||||||
<French>Facteur de balancement déployé</French>
|
|
||||||
<Korean>거치 시 손떨림 정도</Korean>
|
|
||||||
<Portuguese>Fator de balanço de mira em posição de tiro</Portuguese>
|
|
||||||
<German>Verwacklungsfaktor, wenn Zweibein aufgestellt ist.</German>
|
|
||||||
<Italian>Fattore di Oscillazione su Bipode</Italian>
|
|
||||||
<Japanese>展開時の手ぶれ係数</Japanese>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_ACE_Advanced_Fatigue_DeployedSwayFactor_Description">
|
|
||||||
<English>Influences the amount of weapon sway while weapon is deployed.</English>
|
|
||||||
<French>Influence le degré de balancement de l'arme déployée.</French>
|
|
||||||
<Korean>무기를 거치하는 동안 무기를 흔드는 정도를 정합니다.</Korean>
|
|
||||||
<Portuguese>Influencia a quantidade de balanço de mira enquanto a arma está em posição de tiro.</Portuguese>
|
|
||||||
<German>Beeinflusst, wie ruhig man die Waffen hält, während das Zweibein aufgestellt ist.</German>
|
|
||||||
<Italian>Determina la quantità di oscillazione dell'arma quando questa è stabilizzata usando il bipode.</Italian>
|
|
||||||
<Japanese>武器の展開(Cキー)時の武器の手ぶれの量に影響します。</Japanese>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_ACE_Advanced_Fatigue_Enabled">
|
<Key ID="STR_ACE_Advanced_Fatigue_Enabled">
|
||||||
<English>Enabled</English>
|
<English>Enabled</English>
|
||||||
<Spanish>Activada</Spanish>
|
<Spanish>Activada</Spanish>
|
||||||
@ -239,14 +173,14 @@
|
|||||||
<English>Enables/disables Advanced Fatigue.</English>
|
<English>Enables/disables Advanced Fatigue.</English>
|
||||||
<Spanish>Activa/desactiva la fatiga avanzada</Spanish>
|
<Spanish>Activa/desactiva la fatiga avanzada</Spanish>
|
||||||
<German>Aktiviert/deaktiviert Advanced Fatigue.</German>
|
<German>Aktiviert/deaktiviert Advanced Fatigue.</German>
|
||||||
<Japanese>アドバンスド疲労は高度な疲労管理システムを有効化します。</Japanese>
|
<Japanese>高度な疲労を有効/無効化します。</Japanese>
|
||||||
<Polish>Włącza/wyłącza zaawansowaną wytrzymałość</Polish>
|
<Polish>Włącza/wyłącza zaawansowaną wytrzymałość</Polish>
|
||||||
<Korean>고급 피로도 활성화/비활성화</Korean>
|
<Korean>고급 피로도 활성화/비활성화</Korean>
|
||||||
<French>Active/Désactive la fatigue avancée.</French>
|
<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>
|
<Chinese>啟用/關閉進階體力.</Chinese>
|
||||||
<Chinesesimp>启用/关闭进阶体力。</Chinesesimp>
|
<Chinesesimp>启用/关闭进阶体力。</Chinesesimp>
|
||||||
<Russian>Включает / Отключает Продвинутую усталость</Russian>
|
<Russian>Включает/отключает Продвинутую усталость</Russian>
|
||||||
<Portuguese>Ativa/Desativa Fadiga Avançada.</Portuguese>
|
<Portuguese>Ativa/Desativa Fadiga Avançada.</Portuguese>
|
||||||
<Czech>Aktivuje / deaktivuje Pokročilou únavu.</Czech>
|
<Czech>Aktivuje / deaktivuje Pokročilou únavu.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
|
@ -2,26 +2,18 @@
|
|||||||
|
|
||||||
// Fired XEH
|
// Fired XEH
|
||||||
GVAR(ammoEventHandlers) = createHashMap;
|
GVAR(ammoEventHandlers) = createHashMap;
|
||||||
[QGVAR(throwFiredXEH), FUNC(throwFiredXEH)] call CBA_fnc_addEventHandler;
|
[QGVAR(throwFiredXEH), LINKFUNC(throwFiredXEH)] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
// Exit on HC
|
// Exit on HC
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
// Ammo/Magazines look-up hash for correctness of initSpeed
|
// Temporary Wind Info indication
|
||||||
GVAR(ammoMagLookup) = call CBA_fnc_createNamespace;
|
GVAR(tempWindInfo) = false;
|
||||||
{
|
|
||||||
{
|
|
||||||
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");
|
|
||||||
|
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3 Weapons", QGVAR(prepare), localize LSTRING(Prepare), {
|
["ACE3 Weapons", QGVAR(prepare), localize LSTRING(Prepare), {
|
||||||
// Condition
|
// Condition
|
||||||
if (!([ACE_player] call FUNC(canPrepare))) exitWith {false};
|
if !([ACE_player] call FUNC(canPrepare)) exitWith {false};
|
||||||
if (EGVAR(common,isReloading)) exitWith {true};
|
if (EGVAR(common,isReloading)) exitWith {true};
|
||||||
|
|
||||||
// Statement
|
// Statement
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#include "XEH_PREP.hpp"
|
#include "XEH_PREP.hpp"
|
||||||
|
|
||||||
|
// Ammo/Magazines look-up hash for correctness of initSpeed
|
||||||
|
private _cfgMagazines = configFile >> "CfgMagazines";
|
||||||
|
private _cfgAmmo = configFile >> "CfgAmmo";
|
||||||
|
private _cfgThrow = configFile >> "CfgWeapons" >> "Throw";
|
||||||
|
|
||||||
|
private _ammoMagLookup = createHashMap;
|
||||||
|
|
||||||
|
{
|
||||||
|
{
|
||||||
|
private _ammo = getText (_cfgMagazines >> _x >> "ammo");
|
||||||
|
if (_ammo != "") then {
|
||||||
|
_ammoMagLookup set [configName (_cfgAmmo >> _ammo), _x];
|
||||||
|
};
|
||||||
|
} forEach (getArray (_cfgThrow >> _x >> "magazines"));
|
||||||
|
} forEach (getArray (_cfgThrow >> "muzzles"));
|
||||||
|
|
||||||
|
uiNamespace setVariable [QGVAR(ammoMagLookup), compileFinal _ammoMagLookup];
|
||||||
|
@ -19,7 +19,7 @@ params ["_unit"];
|
|||||||
|
|
||||||
if !(_unit getVariable [QGVAR(inHand), false]) exitWith {false};
|
if !(_unit getVariable [QGVAR(inHand), false]) exitWith {false};
|
||||||
|
|
||||||
if (vehicle _unit != _unit) exitWith {
|
if (!isNull objectParent _unit) exitWith {
|
||||||
private _startPos = eyePos _unit;
|
private _startPos = eyePos _unit;
|
||||||
private _aimLinePos = AGLToASL (positionCameraToWorld [0, 0, 1]);
|
private _aimLinePos = AGLToASL (positionCameraToWorld [0, 0, 1]);
|
||||||
private _intersections = lineIntersectsSurfaces [_startPos, _aimLinePos, _unit, objNull, false];
|
private _intersections = lineIntersectsSurfaces [_startPos, _aimLinePos, _unit, objNull, false];
|
||||||
|
@ -43,13 +43,10 @@ if ((!_primed) && {!((_throwableMag in (uniformItems ACE_player)) || {_throwable
|
|||||||
|
|
||||||
// Get correct throw power for primed grenade
|
// Get correct throw power for primed grenade
|
||||||
if (_primed) then {
|
if (_primed) then {
|
||||||
private _ammoType = typeOf _activeThrowable;
|
// If ammo type is not found:
|
||||||
_throwableMag = GVAR(ammoMagLookup) getVariable _ammoType;
|
|
||||||
if (isNil "_throwableMag") then {
|
|
||||||
// What we're trying to throw must not be a normal throwable because it is not in our lookup hash (e.g. 40mm smoke)
|
// What we're trying to throw must not be a normal throwable because it is not in our lookup hash (e.g. 40mm smoke)
|
||||||
// Just use HandGrenade as it has an average initSpeed value
|
// Just use HandGrenade as it has an average initSpeed value
|
||||||
_throwableMag = "HandGrenade";
|
_throwableMag = (uiNamespace getVariable QGVAR(ammoMagLookup)) getOrDefault [typeOf _activeThrowable, "HandGrenade"];
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Some throwables have different classname for magazine and ammo
|
// Some throwables have different classname for magazine and ammo
|
||||||
|
@ -53,6 +53,12 @@ _unit setVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT];
|
|||||||
// Remove controls hint (check if ever enabled is inside the function)
|
// Remove controls hint (check if ever enabled is inside the function)
|
||||||
call EFUNC(interaction,hideMouseHint);
|
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
|
// Remove throw action
|
||||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(throwAction), -1]] call EFUNC(common,removeActionEventHandler);
|
[_unit, "DefaultAction", _unit getVariable [QGVAR(throwAction), -1]] call EFUNC(common,removeActionEventHandler);
|
||||||
|
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
params ["_magazineClassname"];
|
params ["_magazineClassname"];
|
||||||
|
|
||||||
_magazineClassname = toLower _magazineClassname;
|
_magazineClassname = toLowerANSI _magazineClassname;
|
||||||
private _throwMuzzles = getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
|
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 [])
|
[_throwMuzzles select 0, ""] select (_throwMuzzles isEqualTo [])
|
||||||
|
@ -21,7 +21,7 @@ TRACE_1("params",_unit);
|
|||||||
// Select next throwable if one already in hand
|
// Select next throwable if one already in hand
|
||||||
if (_unit getVariable [QGVAR(inHand), false]) exitWith {
|
if (_unit getVariable [QGVAR(inHand), false]) exitWith {
|
||||||
TRACE_1("inHand",_unit);
|
TRACE_1("inHand",_unit);
|
||||||
if (!(_unit getVariable [QGVAR(primed), false])) then {
|
if !(_unit getVariable [QGVAR(primed), false]) then {
|
||||||
TRACE_1("not primed",_unit);
|
TRACE_1("not primed",_unit);
|
||||||
// Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory)
|
// Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory)
|
||||||
// selectNextGrenade relies on muzzles array (setAmmo 0 removes the muzzle from the array and current can't be found, cycles between 0 and 1 muzzles)
|
// selectNextGrenade relies on muzzles array (setAmmo 0 removes the muzzle from the array and current can't be found, cycles between 0 and 1 muzzles)
|
||||||
@ -35,6 +35,11 @@ if (isNull (_unit getVariable [QGVAR(activeThrowable), objNull]) && {(currentThr
|
|||||||
TRACE_1("no throwables",_unit);
|
TRACE_1("no throwables",_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;
|
||||||
|
};
|
||||||
|
|
||||||
_unit setVariable [QGVAR(inHand), true];
|
_unit setVariable [QGVAR(inHand), true];
|
||||||
|
|
||||||
|
@ -44,8 +44,7 @@
|
|||||||
_addedPickUpHelpers pushBack _pickUpHelper;
|
_addedPickUpHelpers pushBack _pickUpHelper;
|
||||||
_throwablesHelped pushBack _x;
|
_throwablesHelped pushBack _x;
|
||||||
};
|
};
|
||||||
nil
|
} forEach _nearThrowables;
|
||||||
} count _nearThrowables;
|
|
||||||
|
|
||||||
_args set [0, getPosASL ACE_player];
|
_args set [0, getPosASL ACE_player];
|
||||||
_args set [3, _nearThrowables];
|
_args set [3, _nearThrowables];
|
||||||
@ -56,11 +55,10 @@
|
|||||||
{
|
{
|
||||||
// Only handling with attachTo works nicely
|
// Only handling with attachTo works nicely
|
||||||
_x attachTo [_x getVariable [QGVAR(throwable), objNull], [0, 0, 0]];
|
_x attachTo [_x getVariable [QGVAR(throwable), objNull], [0, 0, 0]];
|
||||||
nil
|
} forEach _addedPickUpHelpers;
|
||||||
} count _addedPickUpHelpers;
|
|
||||||
} else {
|
} else {
|
||||||
TRACE_1("Cleaning Pick Up Helpers",count _addedPickUpHelpers);
|
TRACE_1("Cleaning Pick Up Helpers",count _addedPickUpHelpers);
|
||||||
{deleteVehicle _x} count _addedPickUpHelpers;
|
{deleteVehicle _x} forEach _addedPickUpHelpers;
|
||||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
}, 0, [(getPosASL ACE_player) vectorAdd [-100, 0, 0], [], [], []]] call CBA_fnc_addPerFrameHandler;
|
}, 0, [(getPosASL ACE_player) vectorAdd [-100, 0, 0], [], [], []]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
@ -20,7 +20,7 @@ TRACE_1("params",_unit);
|
|||||||
|
|
||||||
// Prime the throwable if it hasn't been cooking already
|
// Prime the throwable if it hasn't been cooking already
|
||||||
// Next to proper simulation this also has to happen before delay for orientation of the throwable to be set
|
// Next to proper simulation this also has to happen before delay for orientation of the throwable to be set
|
||||||
if (!(_unit getVariable [QGVAR(primed), false])) then {
|
if !(_unit getVariable [QGVAR(primed), false]) then {
|
||||||
[_unit] call FUNC(prime);
|
[_unit] call FUNC(prime);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ if (!(_unit getVariable [QGVAR(primed), false])) then {
|
|||||||
private _newVelocity = (_p1 vectorFromTo _p2) vectorMultiply _velocity;
|
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
|
// 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));
|
_newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -40,3 +40,11 @@ private _category = format ["ACE %1", localize LSTRING(Category)];
|
|||||||
true,
|
true,
|
||||||
1
|
1
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
|
||||||
|
[
|
||||||
|
QGVAR(enableTempWindInfo), "CHECKBOX",
|
||||||
|
[LSTRING(EnableTempWindInfo_DisplayName), LSTRING(EnableTempWindInfo_Description)],
|
||||||
|
_category,
|
||||||
|
true,
|
||||||
|
0
|
||||||
|
] call CBA_fnc_addSetting;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<English>Advanced Throwing</English>
|
<English>Advanced Throwing</English>
|
||||||
<Spanish>Lanzamiento Avanzado</Spanish>
|
<Spanish>Lanzamiento Avanzado</Spanish>
|
||||||
<Russian>Улучшенный бросок гранат</Russian>
|
<Russian>Улучшенный бросок гранат</Russian>
|
||||||
<Japanese>アドバンスド投擲</Japanese>
|
<Japanese>高度な投擲</Japanese>
|
||||||
<Polish>Zaawansowane rzucanie</Polish>
|
<Polish>Zaawansowane rzucanie</Polish>
|
||||||
<German>Erweitertes Wurfsystem</German>
|
<German>Erweitertes Wurfsystem</German>
|
||||||
<Korean>고급 투척</Korean>
|
<Korean>고급 투척</Korean>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<English>Allows changing advanced throwing behaviour.</English>
|
<English>Allows changing advanced throwing behaviour.</English>
|
||||||
<Spanish>Permite modificar el comportamiento del lanzamiento avanzado</Spanish>
|
<Spanish>Permite modificar el comportamiento del lanzamiento avanzado</Spanish>
|
||||||
<Russian>Позволяет настраивать поведение улучшенного броска гранат.</Russian>
|
<Russian>Позволяет настраивать поведение улучшенного броска гранат.</Russian>
|
||||||
<Japanese>アドバンスド投擲は投擲の高度な動作挙動を変更可能にします。</Japanese>
|
<Japanese>高度な投擲挙動への変更を可能にします。</Japanese>
|
||||||
<Polish>Zezwala na zmianę zachowania zaawansowanego trybu rzucania.</Polish>
|
<Polish>Zezwala na zmianę zachowania zaawansowanego trybu rzucania.</Polish>
|
||||||
<German>Erlaubt es, das Verhalten des erweiterten Wurfsystems zu ändern.</German>
|
<German>Erlaubt es, das Verhalten des erweiterten Wurfsystems zu ändern.</German>
|
||||||
<Korean>고급 투척 행위를 허가합니다</Korean>
|
<Korean>고급 투척 행위를 허가합니다</Korean>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
<English>Enable Advanced Throwing</English>
|
<English>Enable Advanced Throwing</English>
|
||||||
<Spanish>Activar Lanzamiento Avanzado</Spanish>
|
<Spanish>Activar Lanzamiento Avanzado</Spanish>
|
||||||
<Russian>Вкл. улучшенный бросок</Russian>
|
<Russian>Вкл. улучшенный бросок</Russian>
|
||||||
<Japanese>アドバンスド投擲を有効化</Japanese>
|
<Japanese>高度な投擲を有効化</Japanese>
|
||||||
<Polish>Aktywuj zaawansowane rzucanie</Polish>
|
<Polish>Aktywuj zaawansowane rzucanie</Polish>
|
||||||
<German>Aktiviere erweitertes Wurfsystem</German>
|
<German>Aktiviere erweitertes Wurfsystem</German>
|
||||||
<Korean>고급 투척 활성화 </Korean>
|
<Korean>고급 투척 활성화 </Korean>
|
||||||
@ -52,7 +52,7 @@
|
|||||||
<English>Enables advanced throwing system.</English>
|
<English>Enables advanced throwing system.</English>
|
||||||
<Spanish>Activa el Lanzamiento Avanzado</Spanish>
|
<Spanish>Activa el Lanzamiento Avanzado</Spanish>
|
||||||
<Russian>Включает систему улучшенного броска.</Russian>
|
<Russian>Включает систему улучшенного броска.</Russian>
|
||||||
<Japanese>アドバンスド投擲は高度な投擲システムを有効化します。</Japanese>
|
<Japanese>高度な投擲システムを有効化します。</Japanese>
|
||||||
<Polish>Aktywuje system zaawansowanego rzucania.</Polish>
|
<Polish>Aktywuje system zaawansowanego rzucania.</Polish>
|
||||||
<German>Aktiviert das erweiterte Wurfsystem.</German>
|
<German>Aktiviert das erweiterte Wurfsystem.</German>
|
||||||
<Korean>고급 투척을 활성화 합니다</Korean>
|
<Korean>고급 투척을 활성화 합니다</Korean>
|
||||||
@ -144,7 +144,7 @@
|
|||||||
<English>Enables ability to pick up throwables from the ground.</English>
|
<English>Enables ability to pick up throwables from the ground.</English>
|
||||||
<Spanish>Activa la habilidad de coger objetos lanzados del suelo</Spanish>
|
<Spanish>Activa la habilidad de coger objetos lanzados del suelo</Spanish>
|
||||||
<Russian>Включает возможность подбирать гранаты с земли.</Russian>
|
<Russian>Включает возможность подбирать гранаты с земли.</Russian>
|
||||||
<Japanese>地面に落ちている投擲物を拾い上げる機能を有効化します。</Japanese>
|
<Japanese>地面に落ちている投擲物を拾う機能を有効化します。</Japanese>
|
||||||
<Polish>Umożliwia podnoszenie obiektów miotanych z ziemi.</Polish>
|
<Polish>Umożliwia podnoszenie obiektów miotanych z ziemi.</Polish>
|
||||||
<German>Aktiviert die Möglichkeit, geworfene Objekte wieder vom Boden aufzuheben.</German>
|
<German>Aktiviert die Möglichkeit, geworfene Objekte wieder vom Boden aufzuheben.</German>
|
||||||
<Korean>땅에 떨어진 투척물을 주울 수 있게 해줍니다.</Korean>
|
<Korean>땅에 떨어진 투척물을 주울 수 있게 해줍니다.</Korean>
|
||||||
@ -174,7 +174,7 @@
|
|||||||
<English>Enables ability to pick up throwables from attached objects.</English>
|
<English>Enables ability to pick up throwables from attached objects.</English>
|
||||||
<Spanish>Activa la habilidad de lanzar objetos enganchados</Spanish>
|
<Spanish>Activa la habilidad de lanzar objetos enganchados</Spanish>
|
||||||
<Russian>Включает возможность подбирать гранаты, прикрепленные к объектам.</Russian>
|
<Russian>Включает возможность подбирать гранаты, прикрепленные к объектам.</Russian>
|
||||||
<Japanese>オブジェクトに装着された投擲可能物を拾い上げる機能を有効化します。</Japanese>
|
<Japanese>オブジェクトに装着された投擲物を拾う機能を有効化します。</Japanese>
|
||||||
<Polish>Umożliwia podnoszenie obiektów miotanych przyczepionych do innych obiektów.</Polish>
|
<Polish>Umożliwia podnoszenie obiektów miotanych przyczepionych do innych obiektów.</Polish>
|
||||||
<German>Aktiviert die Möglichkeit, befestigte Wurfobjekte erneut aufzunehmen.</German>
|
<German>Aktiviert die Möglichkeit, befestigte Wurfobjekte erneut aufzunehmen.</German>
|
||||||
<Korean>부착된 투척물을 주울 수 있게 해줍니다.</Korean>
|
<Korean>부착된 투척물을 주울 수 있게 해줍니다.</Korean>
|
||||||
@ -185,6 +185,26 @@
|
|||||||
<Portuguese>Permite que arremessáveis fixados em objetos sejam pegos.</Portuguese>
|
<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>
|
<Czech>Zapíná schopnost zvednutí předmětů z objektů ke kterým jsou připnuté.</Czech>
|
||||||
</Key>
|
</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>
|
||||||
|
<Spanish>Mostrar información del viento temporalmente</Spanish>
|
||||||
|
</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>
|
||||||
|
<Spanish>Mostrar información del viento temporalmente mientras se lanza, para ayudar a lanzar las granadas de humo de forma efectiva.</Spanish>
|
||||||
|
</Key>
|
||||||
<Key ID="STR_ACE_Advanced_Throwing_Prepare">
|
<Key ID="STR_ACE_Advanced_Throwing_Prepare">
|
||||||
<English>Prepare/Change Throwable</English>
|
<English>Prepare/Change Throwable</English>
|
||||||
<Spanish>Preparar/Cambiar objetos lanzables</Spanish>
|
<Spanish>Preparar/Cambiar objetos lanzables</Spanish>
|
||||||
@ -234,7 +254,7 @@
|
|||||||
<English>Primed</English>
|
<English>Primed</English>
|
||||||
<Spanish>Preparado</Spanish>
|
<Spanish>Preparado</Spanish>
|
||||||
<Russian>Подготовлена</Russian>
|
<Russian>Подготовлена</Russian>
|
||||||
<Japanese>点火</Japanese>
|
<Japanese>を点火した</Japanese>
|
||||||
<Polish>Odbezpieczony</Polish>
|
<Polish>Odbezpieczony</Polish>
|
||||||
<German>Scharf gemacht</German>
|
<German>Scharf gemacht</German>
|
||||||
<Korean>뇌관 작동</Korean>
|
<Korean>뇌관 작동</Korean>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
} forEach _sections;
|
} forEach _sections;
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
[QGVAR(unGarrison), FUNC(unGarrison)] call CBA_fnc_addEventHandler;
|
[QGVAR(unGarrison), LINKFUNC(unGarrison)] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
[QGVAR(doMove), {
|
[QGVAR(doMove), {
|
||||||
params ["_unitsArray"];
|
params ["_unitsArray"];
|
||||||
@ -73,6 +73,6 @@
|
|||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
["CAManBase", "init", {
|
["CAManBase", "init", {
|
||||||
// wait for HMD to be assigned so `hmd _unit` works
|
// 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;
|
}] call CBA_fnc_addClassEventHandler;
|
||||||
};
|
};
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
* 0: The building(s) nearest this position are used <POSITION>
|
* 0: The building(s) nearest this position are used <POSITION>
|
||||||
* 1: Limit the building search to those type of building <ARRAY>
|
* 1: Limit the building search to those type of building <ARRAY>
|
||||||
* 2: Units that will be garrisoned <ARRAY>
|
* 2: Units that will be garrisoned <ARRAY>
|
||||||
* 3: Radius to fill building(s) <SCALAR> (default: 50)
|
* 3: Radius to fill building(s) <NUMBER> (default: 50)
|
||||||
* 4: 0: even filling, 1: building by building, 2: random filling <SCALAR> (default: 0)
|
* 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)
|
* 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)
|
* 6: Teleport units <BOOL> (default: false)
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ if (_startingPos isEqualTo [0,0,0]) exitWith {
|
|||||||
[LSTRING(GarrisonInvalidPosition)] call EFUNC(common,displayTextStructured);
|
[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);
|
TRACE_1("fnc_garrison: Units error",_unitsArray);
|
||||||
[LSTRING(GarrisonNoUnits)] call EFUNC(common,displayTextStructured);
|
[LSTRING(GarrisonNoUnits)] call EFUNC(common,displayTextStructured);
|
||||||
};
|
};
|
||||||
@ -43,7 +43,7 @@ if (_fillingRadius >= 50) then {
|
|||||||
_buildings = [_buildings] call CBA_fnc_shuffle;
|
_buildings = [_buildings] call CBA_fnc_shuffle;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (count _buildings == 0) exitWith {
|
if (_buildings isEqualTo []) exitWith {
|
||||||
TRACE_1("fnc_garrison: Building error",_buildings);
|
TRACE_1("fnc_garrison: Building error",_buildings);
|
||||||
[LSTRING(GarrisonNoBuilding)] call EFUNC(common,displayTextStructured);
|
[LSTRING(GarrisonNoBuilding)] call EFUNC(common,displayTextStructured);
|
||||||
};
|
};
|
||||||
@ -128,7 +128,7 @@ switch (_fillingType) do {
|
|||||||
} else {
|
} else {
|
||||||
private _pos = _building select 0;
|
private _pos = _building select 0;
|
||||||
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
|
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 {
|
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)]);
|
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 {
|
} else {
|
||||||
private _pos = _building select 0;
|
private _pos = _building select 0;
|
||||||
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
|
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 {
|
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)]);
|
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 {
|
} else {
|
||||||
private _pos = selectRandom _building;
|
private _pos = selectRandom _building;
|
||||||
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
|
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 {
|
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)]);
|
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
|
// Update the unit list and remove duplicate positions and units
|
||||||
private _garrison_unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []];
|
private _garrison_unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []];
|
||||||
@ -279,5 +279,5 @@ if (_teleport) then {
|
|||||||
[_unitMoveList] call FUNC(garrisonMove);
|
[_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
|
_unitsArray
|
||||||
|
@ -81,13 +81,13 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then {
|
|||||||
[QGVAR(enableAttack), [[_unit], true], _unit] call CBA_fnc_targetEvent;
|
[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
|
// Check if unit is alive or even existing
|
||||||
if (!alive _unit || {_unit getVariable [QGVAR(garrisoned), false]}) then {
|
if (!alive _unit || {_unit getVariable [QGVAR(garrisoned), false]}) then {
|
||||||
_unitMoveList deleteAt (_unitMoveList find _x);
|
_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 {
|
} else {
|
||||||
private _unitPos = getPos _unit;
|
private _unitPos = getPos _unit;
|
||||||
|
@ -28,7 +28,7 @@ _units = _units select {local _x};
|
|||||||
|
|
||||||
private _leader = leader _unit;
|
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];
|
_unit setVariable [QGVAR(garrisonned), false, true];
|
||||||
|
|
||||||
|
@ -90,6 +90,8 @@
|
|||||||
<French>Equipement JVN automatique</French>
|
<French>Equipement JVN automatique</French>
|
||||||
<Portuguese>Equipar NVGs automaticamente</Portuguese>
|
<Portuguese>Equipar NVGs automaticamente</Portuguese>
|
||||||
<Japanese>暗視装置の自動装備</Japanese>
|
<Japanese>暗視装置の自動装備</Japanese>
|
||||||
|
<Russian>Автоматическое оснащение ПНВ</Russian>
|
||||||
|
<Spanish>Auto equipar gafas de visión nocturna</Spanish>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_AI_AssignNVG_Description">
|
<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>
|
<English>Equips NVG in inventory during night time and unequips it during day time.\nDoes not add NVGs to inventory!</English>
|
||||||
@ -100,6 +102,8 @@
|
|||||||
<French>Equipe des JVN pendant la nuit et les déséquipe le jour.\nN'ajoute pas les JVN dans l'intenvaire !</French>
|
<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>
|
<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>
|
<Japanese>インベントリ内の暗視装置を夜間に装備し、日中は解除し収納します。\nこれはNVGをインベントリに追加しません。</Japanese>
|
||||||
|
<Russian>Экипирует ПНВ в ночное время и отключает его в дневное время.\nНе добавляет ПНВ в инвентарь!</Russian>
|
||||||
|
<Spanish>Equipa las gafas de visión nocturna en el inventario cuando es de noche, y las desequipa cuando es de día.\nNo añade las gafas al inventario!</Spanish>
|
||||||
</Key>
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -30,6 +30,6 @@ _vehicle == vehicle _unit
|
|||||||
if (_unit == _x select FULLCREW_UNIT) exitWith {
|
if (_unit == _x select FULLCREW_UNIT) exitWith {
|
||||||
_ejectVarName = format [QGVAR(ejectAction_%1_%2), _x select FULLCREW_ROLE, _x select FULLCREW_TURRETPATH];
|
_ejectVarName = format [QGVAR(ejectAction_%1_%2), _x select FULLCREW_ROLE, _x select FULLCREW_TURRETPATH];
|
||||||
};
|
};
|
||||||
} count fullCrew _vehicle;
|
} forEach fullCrew _vehicle;
|
||||||
_vehicle getVariable [_ejectVarName, false]
|
_vehicle getVariable [_ejectVarName, false]
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ if (!alive _vehicle) exitWith {};
|
|||||||
if (_vehicle getVariable [QGVAR(droneActionsAdded), false]) exitWith {};
|
if (_vehicle getVariable [QGVAR(droneActionsAdded), false]) exitWith {};
|
||||||
_vehicle setVariable [QGVAR(droneActionsAdded), true];
|
_vehicle setVariable [QGVAR(droneActionsAdded), true];
|
||||||
|
|
||||||
// move to location
|
// Move to location
|
||||||
private _condition = {
|
private _condition = {
|
||||||
params ["_vehicle"];
|
params ["_vehicle"];
|
||||||
(missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]}
|
(missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]}
|
||||||
@ -37,9 +37,58 @@ private _action = [QGVAR(droneSetWaypointMove), localize "$STR_AC_MOVE",
|
|||||||
"\a3\3DEN\Data\CfgWaypoints\Move_ca.paa", _statement, _condition] call EFUNC(interact_menu,createAction);
|
"\a3\3DEN\Data\CfgWaypoints\Move_ca.paa", _statement, _condition] call EFUNC(interact_menu,createAction);
|
||||||
[_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject);
|
[_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject);
|
||||||
|
|
||||||
|
// Follow unit/vehicle at turret location
|
||||||
|
_condition = {
|
||||||
|
params ["_vehicle"];
|
||||||
|
private _target = cursorTarget;
|
||||||
|
(missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]} && {!isNull _target} && {["CAManBase", "LandVehicle", "Ship"] findIf {_target isKindOf _x} != -1}
|
||||||
|
};
|
||||||
|
_statement = {
|
||||||
|
params ["_vehicle"];
|
||||||
|
private _group = group driver _vehicle;
|
||||||
|
private _pos = ([_vehicle, [0]] call FUNC(droneGetTurretTargetPos)) select 0;
|
||||||
|
[QGVAR(droneSetWaypoint), [_vehicle, _group, _pos, "FOLLOW", cursorTarget], _group] call CBA_fnc_targetEvent;
|
||||||
|
private _followDistance = _vehicle getVariable [QGVAR(wpFollowDistance), 0];
|
||||||
|
[[LLSTRING(DroneFollowHint), _followDistance], 3] call EFUNC(common,displayTextStructured);
|
||||||
|
};
|
||||||
|
_action = [QGVAR(droneSetWaypointFollow), localize "$STR_AC_FOLLOW", "\a3\3DEN\Data\CfgWaypoints\Follow_ca.paa", _statement, _condition] call EFUNC(interact_menu,createAction);
|
||||||
|
[_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject);
|
||||||
|
|
||||||
|
// Set drone follow distance
|
||||||
|
_condition = {
|
||||||
|
params ["_vehicle"];
|
||||||
|
private _group = group driver _vehicle;
|
||||||
|
private _index = (currentWaypoint _group) min count waypoints _group;
|
||||||
|
private _waypoint = [_group, _index];
|
||||||
|
(missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]} && {(waypointType _waypoint) == "HOLD"}
|
||||||
|
};
|
||||||
|
_statement = {
|
||||||
|
params ["_vehicle", "", "_value"];
|
||||||
|
_vehicle setVariable [QGVAR(wpFollowDistance), _value];
|
||||||
|
[[LLSTRING(DroneFollowHint), _value], 3] call EFUNC(common,displayTextStructured);
|
||||||
|
};
|
||||||
|
_action = [QGVAR(droneSetFollowDistance), LLSTRING(DroneFollowDistance), "", {}, _condition] call EFUNC(interact_menu,createAction);
|
||||||
|
private _base = [_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject);
|
||||||
|
private _followDistances = if (_vehicle isKindOf "Car_F") then {
|
||||||
|
[0, 25, 50, 100, 200]
|
||||||
|
} else {
|
||||||
|
[0, 100, 200, 300, 400, 500]
|
||||||
|
};
|
||||||
|
{
|
||||||
|
_action = [
|
||||||
|
QGVAR(droneSetFollowDistance_) + str _x,
|
||||||
|
str _x,
|
||||||
|
"",
|
||||||
|
_statement,
|
||||||
|
{true},
|
||||||
|
{},
|
||||||
|
_x
|
||||||
|
] call EFUNC(interact_menu,createAction);
|
||||||
|
[_vehicle, 1, _base, _action] call EFUNC(interact_menu,addActionToObject);
|
||||||
|
} forEach _followDistances;
|
||||||
|
|
||||||
if (_vehicle isKindOf "Air") then {
|
if (_vehicle isKindOf "Air") then {
|
||||||
// loiter at location
|
// Loiter at location
|
||||||
_condition = {
|
_condition = {
|
||||||
params ["_vehicle"];
|
params ["_vehicle"];
|
||||||
(missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]}
|
(missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]}
|
||||||
@ -55,7 +104,7 @@ if (_vehicle isKindOf "Air") then {
|
|||||||
[_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject);
|
[_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject);
|
||||||
|
|
||||||
|
|
||||||
// set height
|
// Set height
|
||||||
_condition = {
|
_condition = {
|
||||||
params ["_vehicle"];
|
params ["_vehicle"];
|
||||||
(missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]}
|
(missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]}
|
||||||
@ -74,7 +123,7 @@ if (_vehicle isKindOf "Air") then {
|
|||||||
} forEach [20, 50, 200, 500, 2000];
|
} forEach [20, 50, 200, 500, 2000];
|
||||||
|
|
||||||
|
|
||||||
// set loiter radius
|
// Set loiter radius
|
||||||
_condition = {
|
_condition = {
|
||||||
params ["_vehicle"];
|
params ["_vehicle"];
|
||||||
private _group = group driver _vehicle;
|
private _group = group driver _vehicle;
|
||||||
@ -97,7 +146,7 @@ if (_vehicle isKindOf "Air") then {
|
|||||||
} forEach [500, 750, 1000, 1250, 1500];
|
} forEach [500, 750, 1000, 1250, 1500];
|
||||||
|
|
||||||
|
|
||||||
// set loiter direction
|
// Set loiter direction
|
||||||
_condition = {
|
_condition = {
|
||||||
params ["_vehicle", "", "_args"];
|
params ["_vehicle", "", "_args"];
|
||||||
private _group = group driver _vehicle;
|
private _group = group driver _vehicle;
|
||||||
|
@ -23,7 +23,7 @@ TRACE_4("droneModifyWaypoint",_vehicle,_group,_type,_value);
|
|||||||
|
|
||||||
private _index = (currentWaypoint _group) min count waypoints _group;
|
private _index = (currentWaypoint _group) min count waypoints _group;
|
||||||
private _waypoint = [_group, _index];
|
private _waypoint = [_group, _index];
|
||||||
switch (toLower _type) do {
|
switch (toLowerANSI _type) do {
|
||||||
case ("height"): {
|
case ("height"): {
|
||||||
private _pos = waypointPosition _waypoint;
|
private _pos = waypointPosition _waypoint;
|
||||||
_pos set [2, _value];
|
_pos set [2, _value];
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
* 1: Group <GROUP>
|
* 1: Group <GROUP>
|
||||||
* 2: Pos 2D <ARRAY>
|
* 2: Pos 2D <ARRAY>
|
||||||
* 3: Type <STRING>
|
* 3: Type <STRING>
|
||||||
|
* 4: Target to follow <OBJECT> (default: objNull)
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -18,7 +19,7 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_vehicle", "_group", "_pos", "_type"];
|
params ["_vehicle", "_group", "_pos", "_type", ["_target", objNull]];
|
||||||
TRACE_4("droneSetWaypoint",_vehicle,_group,_pos,_type);
|
TRACE_4("droneSetWaypoint",_vehicle,_group,_pos,_type);
|
||||||
|
|
||||||
private _index = (currentWaypoint _group) min count waypoints _group;
|
private _index = (currentWaypoint _group) min count waypoints _group;
|
||||||
@ -29,11 +30,39 @@ private _currentLoiterRadius = waypointLoiterRadius _waypoint;
|
|||||||
private _currentLoiterType = waypointLoiterType _waypoint;
|
private _currentLoiterType = waypointLoiterType _waypoint;
|
||||||
|
|
||||||
// Set pos to ATL
|
// 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];
|
_waypoint = _group addWaypoint [_pos, 0];
|
||||||
_waypoint setWaypointType _type;
|
// The Vanilla "FOLLOW"-type waypoint is not used directly, due to 2 main issues (as of v2.16):
|
||||||
|
// - It does not work at all for UGVs, which is a known issue https://feedback.bistudio.com/T126283;
|
||||||
|
// - No clear scripting way was found to mimic the UAV Terminal's "Follow Distance" functionality;
|
||||||
|
// Instead, the solution for both UAV and UGV following consists of a CBA PFH that moves a "HOLD"-type Waypoint every 3 seconds.
|
||||||
|
// Either on the target itself, or on the Drone's current position if the target is within the desired follow distance.
|
||||||
|
if (_type == "FOLLOW" && {["CAManBase", "LandVehicle", "Ship"] findIf {_target isKindOf _x} != -1}) then {
|
||||||
|
_waypoint setWaypointType "HOLD";
|
||||||
|
[{
|
||||||
|
params ["_args", "_handle"];
|
||||||
|
_args params ["_vehicle", "_group", "_waypoint", "_target"];
|
||||||
|
|
||||||
|
if ( // Abort PFH if a new waypoint is created via UAV Terminal or ACE Interaction
|
||||||
|
_waypoint select 1 != currentWaypoint _group ||
|
||||||
|
{!alive _vehicle} || {isNull _target}
|
||||||
|
) exitWith {
|
||||||
|
deleteWaypoint _waypoint;
|
||||||
|
[_handle] call CBA_fnc_removePerFrameHandler;
|
||||||
|
};
|
||||||
|
|
||||||
|
private _followDistance = _vehicle getVariable [QGVAR(wpFollowDistance), 0];
|
||||||
|
if ((_vehicle distance2D _target) < _followDistance) then {
|
||||||
|
_waypoint setWaypointPosition [getPosASL _vehicle, -1];
|
||||||
|
} else {
|
||||||
|
_waypoint setWaypointPosition [getPosASL _target, -1];
|
||||||
|
};
|
||||||
|
}, 3, [_vehicle, _group, _waypoint, _target]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
};
|
||||||
|
|
||||||
TRACE_3("",_currentHeight,_currentLoiterRadius,_currentLoiterType);
|
TRACE_3("",_currentHeight,_currentLoiterRadius,_currentLoiterType);
|
||||||
if (_currentHeight > 1) then { _vehicle flyInHeight _currentHeight; };
|
if (_currentHeight > 1) then { _vehicle flyInHeight _currentHeight; };
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
<Russian>Открыть грузовой отсек</Russian>
|
<Russian>Открыть грузовой отсек</Russian>
|
||||||
<Italian>Apri la rampa di carico</Italian>
|
<Italian>Apri la rampa di carico</Italian>
|
||||||
<Portuguese>Abrir porta de carga</Portuguese>
|
<Portuguese>Abrir porta de carga</Portuguese>
|
||||||
<Japanese>カーゴ ドアを開く</Japanese>
|
<Japanese>貨物室ドアを 開く</Japanese>
|
||||||
<Korean>화물칸 개방</Korean>
|
<Korean>화물칸 개방</Korean>
|
||||||
<Chinese>開啟貨艙門</Chinese>
|
<Chinese>開啟貨艙門</Chinese>
|
||||||
<Chinesesimp>开启货舱门</Chinesesimp>
|
<Chinesesimp>开启货舱门</Chinesesimp>
|
||||||
@ -46,7 +46,7 @@
|
|||||||
<Russian>Закрыть грузовой отсек</Russian>
|
<Russian>Закрыть грузовой отсек</Russian>
|
||||||
<Italian>Chiudi la rampa di carico</Italian>
|
<Italian>Chiudi la rampa di carico</Italian>
|
||||||
<Portuguese>Fechar porta de carga</Portuguese>
|
<Portuguese>Fechar porta de carga</Portuguese>
|
||||||
<Japanese>カーゴ ドアを閉じる</Japanese>
|
<Japanese>貨物室ドアを 閉じる</Japanese>
|
||||||
<Korean>화물칸 폐쇄</Korean>
|
<Korean>화물칸 폐쇄</Korean>
|
||||||
<Chinese>關閉貨艙門</Chinese>
|
<Chinese>關閉貨艙門</Chinese>
|
||||||
<Chinesesimp>关闭货舱门</Chinesesimp>
|
<Chinesesimp>关闭货舱门</Chinesesimp>
|
||||||
@ -129,7 +129,7 @@
|
|||||||
<Japanese>30mm コンバット ミックス 4:1 劣化ウラン徹甲弾:焼夷榴弾</Japanese>
|
<Japanese>30mm コンバット ミックス 4:1 劣化ウラン徹甲弾:焼夷榴弾</Japanese>
|
||||||
<Czech>30mm Bojový Mix 4:1 DU:HEI</Czech>
|
<Czech>30mm Bojový Mix 4:1 DU:HEI</Czech>
|
||||||
<Russian>30мм Смешанное боепитание 4:1 ОУ:ОФЗ</Russian>
|
<Russian>30мм Смешанное боепитание 4:1 ОУ:ОФЗ</Russian>
|
||||||
<Korean>30mm 4:1 열화:고폭소이</Korean>
|
<Korean>30mm 열화우라늄:고폭소이 4:1 혼합</Korean>
|
||||||
<Portuguese>30mm Mix de Combate 4:1 DU:AEI</Portuguese>
|
<Portuguese>30mm Mix de Combate 4:1 DU:AEI</Portuguese>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Aircraft_GatlingDescriptionShortCM41">
|
<Key ID="STR_ACE_Aircraft_GatlingDescriptionShortCM41">
|
||||||
@ -145,7 +145,7 @@
|
|||||||
<Japanese>30mm CM 4:1</Japanese>
|
<Japanese>30mm CM 4:1</Japanese>
|
||||||
<Czech>30mm BM 4:1</Czech>
|
<Czech>30mm BM 4:1</Czech>
|
||||||
<Russian>30мм СБ 4:1</Russian>
|
<Russian>30мм СБ 4:1</Russian>
|
||||||
<Korean>30mm CM 4:1</Korean>
|
<Korean>30mm 4:1 혼합</Korean>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Aircraft_GatlingDescriptionCM51">
|
<Key ID="STR_ACE_Aircraft_GatlingDescriptionCM51">
|
||||||
<English>30mm Combat Mix 5:1 DU:HEI</English>
|
<English>30mm Combat Mix 5:1 DU:HEI</English>
|
||||||
@ -160,7 +160,7 @@
|
|||||||
<Japanese>30mm コンバット ミックス 5:1 劣化ウラン徹甲弾:焼夷榴弾</Japanese>
|
<Japanese>30mm コンバット ミックス 5:1 劣化ウラン徹甲弾:焼夷榴弾</Japanese>
|
||||||
<Czech>30mm Bojový Mix 5:1 DU:HEI</Czech>
|
<Czech>30mm Bojový Mix 5:1 DU:HEI</Czech>
|
||||||
<Russian>30мм Смешанное боепитание 5:1 ОУ:ОФЗ</Russian>
|
<Russian>30мм Смешанное боепитание 5:1 ОУ:ОФЗ</Russian>
|
||||||
<Korean>30mm 5:1 열화:고폭소이</Korean>
|
<Korean>30mm 열화우라늄:고폭소이 5:1 혼합</Korean>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Aircraft_GatlingDescriptionShortCM51">
|
<Key ID="STR_ACE_Aircraft_GatlingDescriptionShortCM51">
|
||||||
<English>30mm CM 5:1</English>
|
<English>30mm CM 5:1</English>
|
||||||
@ -175,7 +175,23 @@
|
|||||||
<Japanese>30mm CM 5:1</Japanese>
|
<Japanese>30mm CM 5:1</Japanese>
|
||||||
<Czech>30mm BM 5:1</Czech>
|
<Czech>30mm BM 5:1</Czech>
|
||||||
<Russian>30мм СБ 5:1</Russian>
|
<Russian>30мм СБ 5:1</Russian>
|
||||||
<Korean>30mm CM 5:1</Korean>
|
<Korean>30mm 5:1 혼합</Korean>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Aircraft_DroneFollowDistance">
|
||||||
|
<English>Follow Distance</English>
|
||||||
|
<Italian>Distanza di seguimento</Italian>
|
||||||
|
<German>Folge-Entfernung</German>
|
||||||
|
<Korean>따라가는 거리</Korean>
|
||||||
|
<French>Distance de suivi</French>
|
||||||
|
<Japanese>追跡距離</Japanese>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Aircraft_DroneFollowHint">
|
||||||
|
<English>Following unit within %1m</English>
|
||||||
|
<Italian>Seguendo unità entro %1m</Italian>
|
||||||
|
<German>Folgt Einheit bis zu %1m</German>
|
||||||
|
<Korean>%1m 이내로 유닛을 따라갑니다</Korean>
|
||||||
|
<French>Suivre l'unité jusqu'à %1m</French>
|
||||||
|
<Japanese>%1m 間隔で 目標を追跡します</Japanese>
|
||||||
</Key>
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -123,7 +123,9 @@ class GVAR(stats) {
|
|||||||
stats[] = {"maximumLoad"};
|
stats[] = {"maximumLoad"};
|
||||||
displayName = "$STR_a3_rscdisplayarsenal_stat_load";
|
displayName = "$STR_a3_rscdisplayarsenal_stat_load";
|
||||||
showBar = 1;
|
showBar = 1;
|
||||||
|
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));
|
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}, {}};
|
tabs[] = {{3,4,5}, {}};
|
||||||
};
|
};
|
||||||
class ACE_smokeChemTTL: statBase {
|
class ACE_smokeChemTTL: statBase {
|
||||||
|
@ -110,7 +110,7 @@ class Cfg3DEN {
|
|||||||
h = QUOTE(65 * ATTRIBUTE_H);
|
h = QUOTE(65 * ATTRIBUTE_H);
|
||||||
drawSideArrows = 1;
|
drawSideArrows = 1;
|
||||||
disableOverflow = 1;
|
disableOverflow = 1;
|
||||||
columns[] = {0.05, 0.15, 0.85};
|
columns[] = {0.05, 0.15, 0.83, 0.87};
|
||||||
};
|
};
|
||||||
class ArrowLeft: ctrlButton {
|
class ArrowLeft: ctrlButton {
|
||||||
idc = IDC_ATTRIBUTE_LIST_LEFT;
|
idc = IDC_ATTRIBUTE_LIST_LEFT;
|
||||||
|
@ -16,6 +16,8 @@ PREP(attributeKeyDown);
|
|||||||
PREP(attributeLoad);
|
PREP(attributeLoad);
|
||||||
PREP(attributeMode);
|
PREP(attributeMode);
|
||||||
PREP(attributeSelect);
|
PREP(attributeSelect);
|
||||||
|
PREP(baseAttachment);
|
||||||
|
PREP(baseOptic);
|
||||||
PREP(baseWeapon);
|
PREP(baseWeapon);
|
||||||
PREP(buttonActionsPage);
|
PREP(buttonActionsPage);
|
||||||
PREP(buttonCargo);
|
PREP(buttonCargo);
|
||||||
@ -76,6 +78,7 @@ PREP(removeStat);
|
|||||||
PREP(removeVirtualItems);
|
PREP(removeVirtualItems);
|
||||||
PREP(renameDefaultLoadout);
|
PREP(renameDefaultLoadout);
|
||||||
PREP(replaceUniqueItemsLoadout);
|
PREP(replaceUniqueItemsLoadout);
|
||||||
|
PREP(saveLoadout);
|
||||||
PREP(scanConfig);
|
PREP(scanConfig);
|
||||||
PREP(showItem);
|
PREP(showItem);
|
||||||
PREP(sortPanel);
|
PREP(sortPanel);
|
||||||
@ -96,6 +99,7 @@ PREP(statBarStatement_rateOfFIre);
|
|||||||
PREP(statTextStatement_accuracy);
|
PREP(statTextStatement_accuracy);
|
||||||
PREP(statTextStatement_explosionTime);
|
PREP(statTextStatement_explosionTime);
|
||||||
PREP(statTextStatement_illuminators);
|
PREP(statTextStatement_illuminators);
|
||||||
|
PREP(statTextStatement_load);
|
||||||
PREP(statTextStatement_magCount);
|
PREP(statTextStatement_magCount);
|
||||||
PREP(statTextStatement_mass);
|
PREP(statTextStatement_mass);
|
||||||
PREP(statTextStatement_rateOfFire);
|
PREP(statTextStatement_rateOfFire);
|
||||||
|
@ -22,7 +22,8 @@ GVAR(lastSortDirectionRight) = DESCENDING;
|
|||||||
params ["_object"];
|
params ["_object"];
|
||||||
|
|
||||||
// If the arsenal is already open, refresh arsenal display
|
// If the arsenal is already open, refresh arsenal display
|
||||||
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) isEqualTo _object}) then {
|
// Deliberate == check, fail on objNull
|
||||||
|
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) == _object}) then {
|
||||||
[true, true] call FUNC(refresh);
|
[true, true] call FUNC(refresh);
|
||||||
};
|
};
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
@ -69,7 +70,7 @@ GVAR(lastSortDirectionRight) = DESCENDING;
|
|||||||
if (!isNil QGVAR(currentLoadoutsTab) && {GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts}) then {
|
if (!isNil QGVAR(currentLoadoutsTab) && {GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts}) then {
|
||||||
private _curSelData = _contentPanelCtrl lnbData [lnbCurSelRow _contentPanelCtrl, 1];
|
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"];
|
_extendedLoadout params ["_loadout"];
|
||||||
|
|
||||||
private _newRow = _contentPanelCtrl lnbAddRow [_playerName, _loadoutName];
|
private _newRow = _contentPanelCtrl lnbAddRow [_playerName, _loadoutName];
|
||||||
@ -80,10 +81,10 @@ GVAR(lastSortDirectionRight) = DESCENDING;
|
|||||||
_contentPanelCtrl lnbSetData [[_newRow, 1], _playerName + _loadoutName];
|
_contentPanelCtrl lnbSetData [[_newRow, 1], _playerName + _loadoutName];
|
||||||
|
|
||||||
// Set color of row, depending if items are unavailable/missing
|
// 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]];
|
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]];
|
||||||
} else {
|
} else {
|
||||||
if (_unavailableItemsAmount > 0) then {
|
if (_unavailableItemsList isNotEqualTo []) then {
|
||||||
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]];
|
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -107,24 +108,16 @@ GVAR(lastSortDirectionRight) = DESCENDING;
|
|||||||
private _face = _extendedInfo getOrDefault [QGVAR(face), ""];
|
private _face = _extendedInfo getOrDefault [QGVAR(face), ""];
|
||||||
|
|
||||||
if (_face != "") then {
|
if (_face != "") then {
|
||||||
if (isMultiplayer) then {
|
private _id = [QGVAR(broadcastFace), [_unit, _face], QGVAR(centerFace_) + hashValue _unit] call CBA_fnc_globalEventJIP;
|
||||||
private _id = [QGVAR(broadcastFace), [_unit, _face], QGVAR(centerFace_) + netId _unit] call CBA_fnc_globalEventJIP;
|
|
||||||
[_id, _unit] call CBA_fnc_removeGlobalEventJIP;
|
[_id, _unit] call CBA_fnc_removeGlobalEventJIP;
|
||||||
} else {
|
|
||||||
_unit setFace _face;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set voice
|
// Set voice
|
||||||
private _voice = _extendedInfo getOrDefault [QGVAR(voice), ""];
|
private _voice = _extendedInfo getOrDefault [QGVAR(voice), ""];
|
||||||
|
|
||||||
if (_voice != "") then {
|
if (_voice != "") then {
|
||||||
if (isMultiplayer) then {
|
private _id = [QGVAR(broadcastVoice), [_unit, _voice], QGVAR(centerVoice_) + hashValue _unit] call CBA_fnc_globalEventJIP;
|
||||||
private _id = [QGVAR(broadcastVoice), [_unit, _voice], QGVAR(centerVoice_) + netId _unit] call CBA_fnc_globalEventJIP;
|
|
||||||
[_id, _unit] call CBA_fnc_removeGlobalEventJIP;
|
[_id, _unit] call CBA_fnc_removeGlobalEventJIP;
|
||||||
} else {
|
|
||||||
_unit setSpeaker _voice;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set insignia
|
// Set insignia
|
||||||
@ -146,7 +139,7 @@ GVAR(lastSortDirectionRight) = DESCENDING;
|
|||||||
|
|
||||||
// Set voice if enabled
|
// Set voice if enabled
|
||||||
if (GVAR(loadoutsSaveVoice)) then {
|
if (GVAR(loadoutsSaveVoice)) then {
|
||||||
_extendedInfo set [QGVAR(voice), speaker _unit];
|
_extendedInfo set [QGVAR(voice), (speaker _unit) call EFUNC(common,getConfigName)];
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set insignia if enabled
|
// Set insignia if enabled
|
||||||
|
@ -36,7 +36,59 @@ call FUNC(compileStats);
|
|||||||
EGVAR(common,blockItemReplacement) = false;
|
EGVAR(common,blockItemReplacement) = false;
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] 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
|
// Setup Tools tab
|
||||||
[keys (uiNamespace getVariable [QGVAR(configItemsTools), createHashMap]), LLSTRING(toolsTab), TOOLS_TAB_ICON, -1, true] call FUNC(addRightPanelButton);
|
[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 [configName _x, 1];
|
||||||
|
} forEach (_insigniaCondition configClasses (campaignConfigFile >> "CfgUnitInsignia"));
|
||||||
|
{
|
||||||
|
GVAR(insigniaCache) set [configName _x, 2];
|
||||||
|
} forEach (_insigniaCondition configClasses (missionConfigFile >> "CfgUnitInsignia"));
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -155,6 +155,8 @@
|
|||||||
#define IDC_statsNextPage 53
|
#define IDC_statsNextPage 53
|
||||||
#define IDC_statsCurrentPage 54
|
#define IDC_statsCurrentPage 54
|
||||||
#define IDC_actionsBox 90
|
#define IDC_actionsBox 90
|
||||||
|
#define IDC_actionsBackground1 90010
|
||||||
|
#define IDC_actionsBackground2 90011
|
||||||
#define IDC_actionsText1 9001
|
#define IDC_actionsText1 9001
|
||||||
#define IDC_actionsButton1 9002
|
#define IDC_actionsButton1 9002
|
||||||
#define IDC_actionsText2 9003
|
#define IDC_actionsText2 9003
|
||||||
@ -268,6 +270,7 @@
|
|||||||
#define IDX_VIRT_UNIQUE_UNKNOWN_ITEMS 25
|
#define IDX_VIRT_UNIQUE_UNKNOWN_ITEMS 25
|
||||||
|
|
||||||
// Indexes of current items array
|
// 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_PRIMARY_WEAPON 0
|
||||||
#define IDX_CURR_SECONDARY_WEAPON 1
|
#define IDX_CURR_SECONDARY_WEAPON 1
|
||||||
#define IDX_CURR_HANDGUN_WEAPON 2
|
#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, 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, 8], getText (_cfgWeapons >> _loadout select IDX_LOADOUT_HEADGEAR >> "picture")];\
|
||||||
_contentPanelCtrl lnbSetPicture [[_newRow, 9], getText (configFile >> "CfgGlasses" >> _loadout select IDX_LOADOUT_GOGGLES >> "picture")];
|
_contentPanelCtrl lnbSetPicture [[_newRow, 9], getText (configFile >> "CfgGlasses" >> _loadout select IDX_LOADOUT_GOGGLES >> "picture")];
|
||||||
|
|
||||||
|
#define ACTION_TYPE_TEXT 0
|
||||||
|
#define ACTION_TYPE_BUTTON 1
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
|
#include "..\defines.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: johnb43
|
* Author: johnb43
|
||||||
* Adds custom action buttons.
|
* Adds custom action buttons.
|
||||||
@ -10,6 +11,7 @@
|
|||||||
* 3: Actions <ARRAY of ARRAYS>
|
* 3: Actions <ARRAY of ARRAYS>
|
||||||
* 4: Condition <CODE> (default: {true})
|
* 4: Condition <CODE> (default: {true})
|
||||||
* 5: Scope editor <NUMBER> (default: 2)
|
* 5: Scope editor <NUMBER> (default: 2)
|
||||||
|
* 6: Update when cargo content changes <BOOL> (default: false)
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* 0: Array of IDs <ARRAY of STRINGS>
|
* 0: Array of IDs <ARRAY of STRINGS>
|
||||||
@ -30,7 +32,8 @@ params [
|
|||||||
["_title", "", [""]],
|
["_title", "", [""]],
|
||||||
["_actions", [], [[]]],
|
["_actions", [], [[]]],
|
||||||
["_rootCondition", {true}, [{}]],
|
["_rootCondition", {true}, [{}]],
|
||||||
["_scopeEditor", 2, [0]]
|
["_scopeEditor", 2, [0]],
|
||||||
|
["_updateOnCargoChange", false, [false]]
|
||||||
];
|
];
|
||||||
|
|
||||||
// Compile actions from config (in case this is called before preInit)
|
// 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
|
// Skip if not allowed in editor and in editor
|
||||||
if (is3DEN && {_scopeEditor != 2}) exitWith {
|
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
|
// Class can't contain ~, because it's used for formatting result
|
||||||
if ("~" in _rootClass) exitWith {
|
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
|
// Don't allow two of the same class
|
||||||
if (_group findIf {(_x select 0) == _class} != -1) then {
|
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;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -119,4 +122,8 @@ private _group = [];
|
|||||||
};
|
};
|
||||||
} forEach _tabs;
|
} forEach _tabs;
|
||||||
|
|
||||||
|
if (_updateOnCargoChange) then {
|
||||||
|
GVAR(updateActionsOnCargoChange) = true;
|
||||||
|
};
|
||||||
|
|
||||||
_return
|
_return
|
||||||
|
@ -6,9 +6,10 @@
|
|||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Config category, must be "CfgWeapons", "CfgVehicles", "CfgMagazines", "CfgVoice" or "CfgUnitInsignia" <STRING>
|
* 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>
|
* 2: Panel control <CONTROL>
|
||||||
* 3: Name of the picture entry in that Cfg class <STRING> (default: "picture")
|
* 3: Name of the picture entry in that Cfg class <STRING> (default: "picture")
|
||||||
|
* 4: Config root <NUMBER> (default: 0 -> configFile)
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -19,9 +20,9 @@
|
|||||||
* Public: Yes
|
* 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 {
|
if (_skip) then {
|
||||||
switch (GVAR(currentLeftPanel)) do {
|
switch (GVAR(currentLeftPanel)) do {
|
||||||
case IDC_buttonPrimaryWeapon: {
|
case IDC_buttonPrimaryWeapon: {
|
||||||
@ -41,10 +42,10 @@ if (_skip) then {
|
|||||||
|
|
||||||
if (_skip) exitWith {};
|
if (_skip) exitWith {};
|
||||||
|
|
||||||
// Sanitise key, as it's public; If not in cache, find info and cache it for later use
|
// If not in cache, find info and cache it for later use
|
||||||
((uiNamespace getVariable QGVAR(addListBoxItemCache)) getOrDefaultCall [_configCategory + _className, {
|
((uiNamespace getVariable QGVAR(addListBoxItemCache)) getOrDefaultCall [_configCategory + _className + str _configRoot, {
|
||||||
// Get classname (config case), display name, picture and DLC
|
// 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);
|
private _dlcName = _configPath call EFUNC(common,getAddon);
|
||||||
|
|
||||||
// If _pictureEntryName is empty, then this item has no picture (e.g. faces)
|
// 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 lbSetPictureRight [_lbAdd, ["", _modPicture] select GVAR(enableModIcons)];
|
||||||
_ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _className]];
|
_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 lbSetColor [_lbAdd, FAVORITES_COLOR];
|
||||||
_ctrlPanel lbSetSelectColor [_lbAdd, FAVORITES_COLOR];
|
_ctrlPanel lbSetSelectColor [_lbAdd, FAVORITES_COLOR];
|
||||||
};
|
};
|
||||||
|
@ -66,7 +66,8 @@ _items = _items select {
|
|||||||
_x isKindOf ["CBA_MiscItem", _cfgWeapons] && {getNumber (_configItemInfo >> "type") in [TYPE_MUZZLE, TYPE_OPTICS, TYPE_FLASHLIGHT, TYPE_BIPOD]} ||
|
_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]} ||
|
{getNumber (_configItemInfo >> "type") in [TYPE_FIRST_AID_KIT, TYPE_MEDIKIT, TYPE_TOOLKIT]} ||
|
||||||
{getText (_cfgWeapons >> _x >> "simulation") == "ItemMineDetector"} ||
|
{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]];
|
GVAR(customRightPanelButtons) set [_position, [_items apply {_x call EFUNC(common,getConfigName)}, _picture, _tooltip, _moveOnOverwrite]];
|
||||||
|
@ -72,7 +72,7 @@ private _fnc_addToTabs = {
|
|||||||
_currentTab pushBack _sort;
|
_currentTab pushBack _sort;
|
||||||
_return pushBack _sortName;
|
_return pushBack _sortName;
|
||||||
} else {
|
} else {
|
||||||
TRACE_1("A sort with this ID already exists", _sortName);
|
TRACE_1("A sort with this ID already exists",_sortName);
|
||||||
};
|
};
|
||||||
} forEach _tabsToAddTo;
|
} forEach _tabsToAddTo;
|
||||||
};
|
};
|
||||||
|
@ -77,7 +77,7 @@ private _fnc_addToTabs = {
|
|||||||
|
|
||||||
// Find if there is an entry with same ID
|
// Find if there is an entry with same ID
|
||||||
if (_currentTab findIf {_x select 5 == _statName} != -1) then {
|
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 {
|
} else {
|
||||||
_stat = +_finalArray;
|
_stat = +_finalArray;
|
||||||
_stat set [5, _statName];
|
_stat set [5, _statName];
|
||||||
@ -109,11 +109,10 @@ private _tabToChange = [];
|
|||||||
{
|
{
|
||||||
_x params ["_tab", "_tabSide"];
|
_x params ["_tab", "_tabSide"];
|
||||||
|
|
||||||
_tabToChange = if (_tabSide == "R") then {
|
_tabToChange = [
|
||||||
|
GVAR(statsListLeftPanel),
|
||||||
GVAR(statsListRightPanel)
|
GVAR(statsListRightPanel)
|
||||||
} else {
|
] select (_tabSide == "R");
|
||||||
GVAR(statsListLeftPanel)
|
|
||||||
};
|
|
||||||
|
|
||||||
_stats = _tabToChange select _tab;
|
_stats = _tabToChange select _tab;
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ private _cfgWeapons = configFile >> "CfgWeapons";
|
|||||||
private _cfgMagazines = configFile >> "CfgMagazines";
|
private _cfgMagazines = configFile >> "CfgMagazines";
|
||||||
private _cfgVehicles = configFile >> "CfgVehicles";
|
private _cfgVehicles = configFile >> "CfgVehicles";
|
||||||
private _cfgGlasses = configFile >> "CfgGlasses";
|
private _cfgGlasses = configFile >> "CfgGlasses";
|
||||||
|
private _dlcName = "";
|
||||||
|
|
||||||
// Exit with current items (no specific category)
|
// Exit with current items (no specific category)
|
||||||
if (_category == IDX_CAT_ALL) exitWith {
|
if (_category == IDX_CAT_ALL) exitWith {
|
||||||
@ -73,6 +74,12 @@ if (_category == IDX_CAT_ALL) exitWith {
|
|||||||
_listbox lnbSetData [[_index, 1], _x];
|
_listbox lnbSetData [[_index, 1], _x];
|
||||||
_listbox lnbSetPicture [[_index, 0], getText (_config >> "picture")];
|
_listbox lnbSetPicture [[_index, 0], getText (_config >> "picture")];
|
||||||
_listbox lnbSetTooltip [[_index, 0], _x];
|
_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;
|
} forEach _attributeItems;
|
||||||
|
|
||||||
@ -130,12 +137,20 @@ private _config = _cfgClass;
|
|||||||
_alpha = 0.5;
|
_alpha = 0.5;
|
||||||
};
|
};
|
||||||
|
|
||||||
_index = _listbox lnbAddRow ["", _displayName, _symbol];
|
_index = _listbox lnbAddRow ["", _displayName, "", _symbol];
|
||||||
_listbox lnbSetData [[_index, 1], _x];
|
_listbox lnbSetData [[_index, 1], _x];
|
||||||
_listbox lnbSetPicture [[_index, 0], getText (_config >> _x >> "picture")];
|
_listbox lnbSetPicture [[_index, 0], getText (_config >> _x >> "picture")];
|
||||||
_listbox lnbSetTooltip [[_index, 0], _x];
|
_listbox lnbSetTooltip [[_index, 0], _x];
|
||||||
_listbox lnbSetColor [[_index, 1], [1, 1, 1, _alpha]];
|
_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);
|
} forEach (keys _categoryItems);
|
||||||
|
|
||||||
|
@ -35,9 +35,10 @@ if (_addItem && {_itemIndex == -1}) exitWith {
|
|||||||
_attributeItems pushBack _itemClassname;
|
_attributeItems pushBack _itemClassname;
|
||||||
|
|
||||||
// Change symbol and increase alpha
|
// 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, 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
|
// Remove item if in list
|
||||||
@ -45,7 +46,8 @@ if (!_addItem && {_itemIndex != -1}) exitWith {
|
|||||||
_attributeItems deleteAt _itemIndex;
|
_attributeItems deleteAt _itemIndex;
|
||||||
|
|
||||||
// Change symbol and reduce alpha
|
// 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, 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]];
|
||||||
};
|
};
|
||||||
|
59
addons/arsenal/functions/fnc_baseAttachment.sqf
Normal file
59
addons/arsenal/functions/fnc_baseAttachment.sqf
Normal 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
|
32
addons/arsenal/functions/fnc_baseOptic.sqf
Normal file
32
addons/arsenal/functions/fnc_baseOptic.sqf
Normal 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
|
@ -19,7 +19,7 @@
|
|||||||
params [["_weapon", "", [""]]];
|
params [["_weapon", "", [""]]];
|
||||||
|
|
||||||
// Check if item is cached
|
// Check if item is cached
|
||||||
(uiNamespace getVariable QGVAR(baseWeaponNameCache)) getOrDefaultCall [toLower _weapon, {
|
(uiNamespace getVariable QGVAR(baseWeaponNameCache)) getOrDefaultCall [toLowerANSI _weapon, {
|
||||||
private _cfgWeapons = configfile >> "CfgWeapons";
|
private _cfgWeapons = configfile >> "CfgWeapons";
|
||||||
private _config = _cfgWeapons >> _weapon;
|
private _config = _cfgWeapons >> _weapon;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
params ["_display", "_control", "_nextPage"];
|
params ["_display", "_control", "_nextPage"];
|
||||||
|
|
||||||
TRACE_1("control enabled", ctrlEnabled _control);
|
TRACE_1("control enabled",ctrlEnabled _control);
|
||||||
if !(ctrlEnabled _control) exitWith {};
|
if !(ctrlEnabled _control) exitWith {};
|
||||||
|
|
||||||
GVAR(currentActionPage) = GVAR(currentActionPage) + ([-1, 1] select _nextPage);
|
GVAR(currentActionPage) = GVAR(currentActionPage) + ([-1, 1] select _nextPage);
|
||||||
|
@ -26,28 +26,27 @@ if (GVAR(shiftState)) then {
|
|||||||
switch (true) do {
|
switch (true) do {
|
||||||
// Beginning
|
// Beginning
|
||||||
case (_index == -1): {
|
case (_index == -1): {
|
||||||
"ace_clipboard" callExtension (format ["[%1", endl]);
|
"ace" callExtension ["clipboard:append", [format ["[%1", endl]]];
|
||||||
};
|
};
|
||||||
// End
|
// End
|
||||||
case (_index == _listLength): {
|
case (_index == _listLength): {
|
||||||
"ace_clipboard" callExtension "];";
|
"ace" callExtension ["clipboard:append", ["];"]];
|
||||||
};
|
};
|
||||||
// Rest
|
// Rest
|
||||||
default {
|
default {
|
||||||
"ace_clipboard" callExtension ([" ", str (GVAR(defaultLoadoutsList) select _index), [",", ""] select (_index == _listLength - 1), endl] joinString "");
|
"ace" callExtension ["clipboard:append", [[" ", str (GVAR(defaultLoadoutsList) select _index), [",", ""] select (_index == _listLength - 1), endl] joinString ""]];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
"ace_clipboard" callExtension "--COMPLETE--";
|
"ace" callExtension ["clipboard:complete", []];
|
||||||
|
|
||||||
[_display, LLSTRING(exportDefault)] call FUNC(message);
|
[_display, LLSTRING(exportDefault)] call FUNC(message);
|
||||||
} else {
|
} else {
|
||||||
// Export singular loadout
|
// Export singular loadout
|
||||||
private _export = str (GVAR(center) call CBA_fnc_getLoadout);
|
private _export = str (GVAR(center) call CBA_fnc_getLoadout);
|
||||||
|
"ace" callExtension ["clipboard:append", [_export]];
|
||||||
"ace_clipboard" callExtension (_export + ";");
|
"ace" callExtension ["clipboard:complete", []];
|
||||||
"ace_clipboard" callExtension "--COMPLETE--";
|
|
||||||
|
|
||||||
[_display, LLSTRING(exportCurrent)] call FUNC(message);
|
[_display, LLSTRING(exportCurrent)] call FUNC(message);
|
||||||
};
|
};
|
||||||
|
@ -16,7 +16,13 @@
|
|||||||
params ["_display"];
|
params ["_display"];
|
||||||
|
|
||||||
// Can be either a singular loadout or an array of loadouts
|
// Can be either a singular loadout or an array of loadouts
|
||||||
private _extendedLoadout = call compile copyFromClipboard;
|
private _extendedLoadout = if (isMultiplayer) then {
|
||||||
|
("ace" callExtension ["clipboard:loadout", []]) params ["_loadout", "_code"];
|
||||||
|
if (_code != 0) exitWith {};
|
||||||
|
parseSimpleArray _loadout
|
||||||
|
} else {
|
||||||
|
call compile copyFromClipboard
|
||||||
|
};
|
||||||
|
|
||||||
// If error, exit
|
// If error, exit
|
||||||
if (isNil "_extendedLoadout" || {!(_extendedLoadout isEqualType [])}) exitWith {
|
if (isNil "_extendedLoadout" || {!(_extendedLoadout isEqualType [])}) exitWith {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
params ["_display", "_control", "_nextPage"];
|
params ["_display", "_control", "_nextPage"];
|
||||||
|
|
||||||
TRACE_1("control enabled", ctrlEnabled _control);
|
TRACE_1("control enabled",ctrlEnabled _control);
|
||||||
if !(ctrlEnabled _control) exitWith {};
|
if !(ctrlEnabled _control) exitWith {};
|
||||||
|
|
||||||
GVAR(currentStatPage) = GVAR(currentStatPage) + ([-1, 1] select _nextPage);
|
GVAR(currentStatPage) = GVAR(currentStatPage) + ([-1, 1] select _nextPage);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
|
#include "..\defines.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Brett Mayson
|
* Author: Brett Mayson
|
||||||
* Create the internal actions arrays when needed for the first time.
|
* Create the internal actions arrays when needed for the first time.
|
||||||
@ -37,6 +38,8 @@ private _actionList = [
|
|||||||
|
|
||||||
private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions));
|
private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions));
|
||||||
|
|
||||||
|
GVAR(updateActionsOnCargoChange) = false;
|
||||||
|
|
||||||
{
|
{
|
||||||
private _scopeEditor = getNumber (_x >> "scopeEditor");
|
private _scopeEditor = getNumber (_x >> "scopeEditor");
|
||||||
|
|
||||||
@ -48,6 +51,10 @@ private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions)
|
|||||||
private _rootDisplayName = getText (_x >> "displayName");
|
private _rootDisplayName = getText (_x >> "displayName");
|
||||||
private _rootCondition = getText (_x >> "condition");
|
private _rootCondition = getText (_x >> "condition");
|
||||||
private _rootTabs = getArray (_x >> "tabs");
|
private _rootTabs = getArray (_x >> "tabs");
|
||||||
|
private _updateOnCargoChanged = getNumber (_x >> "updateOnCargoChanged");
|
||||||
|
if (_updateOnCargoChanged > 0) then {
|
||||||
|
GVAR(updateActionsOnCargoChange) = true;
|
||||||
|
};
|
||||||
|
|
||||||
if (_rootCondition != "") then {
|
if (_rootCondition != "") then {
|
||||||
_rootCondition = compile _rootCondition;
|
_rootCondition = compile _rootCondition;
|
||||||
|
@ -101,7 +101,7 @@ private _priority = 0;
|
|||||||
(_finalArray select 4) set [1, compile (getText (_x >> "textStatement"))];
|
(_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 {
|
if (_leftTabsList isNotEqualTo []) then {
|
||||||
[_statsListLeftPanel, _leftTabsList, "L"] call _fnc_addToTabs;
|
[_statsListLeftPanel, _leftTabsList, "L"] call _fnc_addToTabs;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
#include "..\defines.hpp"
|
#include "..\defines.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Alganthe, johnb43
|
* Author: Alganthe, johnb43, LinkIsGrim
|
||||||
* Fills left panel.
|
* Fills left panel.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
@ -17,21 +17,28 @@
|
|||||||
|
|
||||||
params ["_display", "_control", ["_animate", true]];
|
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
|
// Fade old control background
|
||||||
if (!isNil QGVAR(currentLeftPanel)) then {
|
if (!isNil QGVAR(currentLeftPanel)) then {
|
||||||
private _previousCtrlBackground = _display displayCtrl (GVAR(currentLeftPanel) - 1);
|
private _previousCtrlBackground = _display displayCtrl (GVAR(currentLeftPanel) - 1);
|
||||||
_previousCtrlBackground ctrlSetFade 1;
|
_previousCtrlBackground ctrlSetFade 1;
|
||||||
_previousCtrlBackground ctrlCommit ([0, FADE_DELAY] select _animate);
|
_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
|
// Show new control background
|
||||||
private _ctrlIDC = ctrlIDC _control;
|
|
||||||
private _ctrlBackground = _display displayCtrl (_ctrlIDC - 1);
|
private _ctrlBackground = _display displayCtrl (_ctrlIDC - 1);
|
||||||
_ctrlBackground ctrlSetFade 0;
|
_ctrlBackground ctrlSetFade 0;
|
||||||
_ctrlBackground ctrlCommit ([0, FADE_DELAY] select _animate);
|
_ctrlBackground ctrlCommit ([0, FADE_DELAY] select _animate);
|
||||||
|
|
||||||
private _ctrlPanel = _display displayCtrl IDC_leftTabContent;
|
|
||||||
|
|
||||||
// Force a "refresh" animation of the panel
|
// Force a "refresh" animation of the panel
|
||||||
if (_animate) then {
|
if (_animate) then {
|
||||||
_ctrlPanel ctrlSetFade 1;
|
_ctrlPanel ctrlSetFade 1;
|
||||||
@ -41,163 +48,54 @@ if (_animate) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_ctrlPanel lbSetCurSel -1;
|
_ctrlPanel lbSetCurSel -1;
|
||||||
|
// Purge old data
|
||||||
|
lbClear _ctrlPanel;
|
||||||
|
|
||||||
// Handle icons and filling
|
// For every left tab except faces and voices, add "Empty" entry
|
||||||
private _selectedItem = switch (true) do {
|
if !(_ctrlIDC in [IDC_buttonFace, IDC_buttonVoice]) then {
|
||||||
// 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"];
|
private _addEmpty = _ctrlPanel lbAdd format [" <%1>", localize "str_empty"];
|
||||||
_ctrlPanel lbSetValue [_addEmpty, -1];
|
_ctrlPanel lbSetValue [_addEmpty, -1];
|
||||||
|
};
|
||||||
|
|
||||||
// Add selected tab's weapons
|
// Don't reset the current right panel for weapons, binos and containers
|
||||||
private _index = [IDC_buttonPrimaryWeapon, IDC_buttonSecondaryWeapon, IDC_buttonHandgun] find _ctrlIDC;
|
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 {
|
||||||
|
|
||||||
{
|
|
||||||
["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;
|
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"};
|
||||||
};
|
};
|
||||||
|
|
||||||
lbClear _ctrlPanel;
|
private _items = if (_idxVirt < IDX_VIRT_HEADGEAR) then {
|
||||||
|
keys ((GVAR(virtualItems) get IDX_VIRT_WEAPONS) get _idxVirt)
|
||||||
// For every left tab except faces and voices, add "Empty" entry
|
} else {
|
||||||
if !(_ctrlIDC in [IDC_buttonFace, IDC_buttonVoice]) then {
|
keys (GVAR(virtualItems) get _idxVirt)
|
||||||
private _addEmpty = _ctrlPanel lbAdd format [" <%1>", localize "str_empty"];
|
|
||||||
_ctrlPanel lbSetValue [_addEmpty, -1];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
{
|
||||||
|
[_configParent, _x, _ctrlPanel] call FUNC(addListBoxItem);
|
||||||
|
} forEach _items;
|
||||||
|
|
||||||
|
GVAR(currentItems) select _idxVirt
|
||||||
|
} else { // Special cases
|
||||||
switch (_ctrlIDC) do {
|
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
|
// Faces
|
||||||
case IDC_buttonFace: {
|
case IDC_buttonFace: {
|
||||||
private _lbAdd = -1;
|
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"];
|
_y params ["_displayName", "_modPicture"];
|
||||||
|
|
||||||
_lbAdd = _ctrlPanel lbAdd _displayName;
|
_lbAdd = _ctrlPanel lbAdd _displayName;
|
||||||
_ctrlPanel lbSetData [_lbAdd, _x];
|
_ctrlPanel lbSetData [_lbAdd, _x];
|
||||||
_ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _x]];
|
_ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _x]];
|
||||||
_ctrlPanel lbSetPictureRight [_lbAdd, _modPicture];
|
_ctrlPanel lbSetPictureRight [_lbAdd, ["", _modPicture] select GVAR(enableModIcons)];
|
||||||
} forEach (uiNamespace getVariable QGVAR(faceCache));
|
} forEach GVAR(faceCache); // HashMap, not array
|
||||||
|
|
||||||
GVAR(currentFace)
|
GVAR(currentFace)
|
||||||
};
|
};
|
||||||
@ -205,48 +103,27 @@ private _selectedItem = switch (true) do {
|
|||||||
case IDC_buttonVoice: {
|
case IDC_buttonVoice: {
|
||||||
{
|
{
|
||||||
["CfgVoice", _x, _ctrlPanel, "icon"] call FUNC(addListBoxItem);
|
["CfgVoice", _x, _ctrlPanel, "icon"] call FUNC(addListBoxItem);
|
||||||
} forEach (uiNamespace getVariable QGVAR(voiceCache));
|
} forEach (keys GVAR(voiceCache));
|
||||||
|
|
||||||
GVAR(currentVoice)
|
GVAR(currentVoice)
|
||||||
};
|
};
|
||||||
// Insignia
|
// Insignia
|
||||||
case IDC_buttonInsignia: {
|
case IDC_buttonInsignia: {
|
||||||
// Insignia from config
|
|
||||||
{
|
{
|
||||||
["CfgUnitInsignia", _x, _ctrlPanel, "texture"] call FUNC(addListBoxItem);
|
["CfgUnitInsignia", _x, _ctrlPanel, "texture", _y] call FUNC(addListBoxItem);
|
||||||
} forEach (uiNamespace getVariable QGVAR(insigniaCache));
|
} forEach GVAR(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)
|
GVAR(currentInsignia)
|
||||||
};
|
};
|
||||||
// Unknown
|
// Unknown
|
||||||
default {""};
|
default {
|
||||||
|
WARNING_1("Unknown arsenal left panel with IDC %1, update ace_arsenal_idxMap and relevant macros if adding a new tab",_ctrlIDC);
|
||||||
|
""
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// When switching tabs, clear searchbox
|
|
||||||
if (GVAR(currentLeftPanel) != _ctrlIDC) then {
|
|
||||||
(_display displayCtrl IDC_leftSearchbar) ctrlSetText "";
|
|
||||||
(_display displayCtrl IDC_rightSearchbar) ctrlSetText "";
|
|
||||||
};
|
|
||||||
|
|
||||||
// Trigger event
|
// Trigger event
|
||||||
GVAR(currentLeftPanel) = _ctrlIDC;
|
|
||||||
[QGVAR(leftPanelFilled), [_display, _ctrlIDC, GVAR(currentRightPanel)]] call CBA_fnc_localEvent;
|
[QGVAR(leftPanelFilled), [_display, _ctrlIDC, GVAR(currentRightPanel)]] call CBA_fnc_localEvent;
|
||||||
|
|
||||||
// Sort
|
// Sort
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
#include "..\defines.hpp"
|
#include "..\defines.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Alganthe, johnb43
|
* Author: Alganthe, johnb43, LinkIsGrim
|
||||||
* Fill loadouts list.
|
* 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:
|
* Arguments:
|
||||||
* 0: Loadouts display <DISPLAY>
|
* 0: Loadouts display <DISPLAY>
|
||||||
* 1: Tab control <CONTROL>
|
* 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:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -14,29 +18,46 @@
|
|||||||
* Public: No
|
* 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;
|
private _contentPanelCtrl = _display displayCtrl IDC_contentPanel;
|
||||||
|
if (_currentFrame == 0) then {
|
||||||
|
(_display displayCtrl IDC_textEditBox) ctrlSetText "";
|
||||||
|
|
||||||
// Force a "refresh" animation of the panel
|
// Force a "refresh" animation of the panel
|
||||||
_contentPanelCtrl ctrlSetFade 1;
|
_contentPanelCtrl ctrlSetFade 1;
|
||||||
_contentPanelCtrl ctrlCommit 0;
|
_contentPanelCtrl ctrlCommit 0;
|
||||||
_contentPanelCtrl ctrlSetFade 0;
|
_contentPanelCtrl ctrlSetFade 0;
|
||||||
_contentPanelCtrl ctrlCommit FADE_DELAY;
|
_contentPanelCtrl ctrlCommit FADE_DELAY;
|
||||||
|
|
||||||
_contentPanelCtrl lnbSetCurSelRow -1;
|
_contentPanelCtrl lnbSetCurSelRow -1;
|
||||||
lnbClear _contentPanelCtrl;
|
lnbClear _contentPanelCtrl;
|
||||||
|
};
|
||||||
|
|
||||||
private _sharedLoadoutsVars = GVAR(sharedLoadoutsNamespace) getVariable QGVAR(sharedLoadoutsVars);
|
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;
|
private _newRow = -1;
|
||||||
|
|
||||||
if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
|
if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
|
||||||
private _loadoutNameAndTab = "";
|
private _loadoutNameAndTab = "";
|
||||||
private _loadoutCachedInfo = "";
|
private _loadoutCachedInfo = "";
|
||||||
private _sharingEnabled = GVAR(allowSharedLoadouts) && {isMultiplayer};
|
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
|
// Add all loadouts to loadout list
|
||||||
{
|
{
|
||||||
@ -50,15 +71,16 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
|
|||||||
_loadoutCachedInfo = [_loadoutData] call FUNC(verifyLoadout);
|
_loadoutCachedInfo = [_loadoutData] call FUNC(verifyLoadout);
|
||||||
_contentPanelCtrl setVariable [_loadoutNameAndTab, _loadoutCachedInfo];
|
_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)
|
// 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 _printComponent = "ACE_Arsenal - Loadout:";
|
||||||
private _printNullItemsList = ["Missing items:", str _nullItemsList] joinString " ";
|
private _printNullItemsList = ["Missing items:", str _nullItemsList] joinString " ";
|
||||||
private _printUnavailableItemsList = ["Unavailable items:", str _unavailableItemsList] 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];
|
_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"];
|
_loadoutCachedInfo params ["_extendedLoadout", "_nullItemsList", "_unavailableItemsList"];
|
||||||
_extendedLoadout params ["_loadout"];
|
_extendedLoadout params ["_loadout"]; // Used by ADD_LOADOUTS_LIST_PICTURES macro, do not remove
|
||||||
|
|
||||||
_newRow = _contentPanelCtrl lnbAddRow ["", _loadoutName];
|
_newRow = _contentPanelCtrl lnbAddRow ["", _loadoutName];
|
||||||
|
|
||||||
ADD_LOADOUTS_LIST_PICTURES
|
ADD_LOADOUTS_LIST_PICTURES
|
||||||
|
|
||||||
// Change color on loadout lines that have items that aren't available or don't exist
|
// 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
|
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; // Red
|
||||||
} else {
|
} else {
|
||||||
if (_unavailableItemsAmount > 0) then {
|
if (_unavailableItemsList isNotEqualTo []) then {
|
||||||
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; // Gray
|
_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 lnbSetPicture [[_newRow, 0], QPATHTOF(data\iconPublic.paa)];
|
||||||
_contentPanelCtrl lnbSetValue [[_newRow, 0], 1];
|
_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 {
|
} else {
|
||||||
private _allPlayerNames = allPlayers apply {name _x};
|
private _allPlayerNames = allPlayers apply {name _x};
|
||||||
|
private _loadouts = _sharedLoadoutsVars apply {GVAR(sharedLoadoutsNamespace) getVariable _x};
|
||||||
private _loadoutVar = "";
|
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"];
|
_x params ["_playerName", "_loadoutName", "_loadoutData"];
|
||||||
@ -107,8 +135,8 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
|
|||||||
|
|
||||||
[QGVAR(loadoutUnshared), [_contentPanelCtrl, profileName, _loadoutName]] call CBA_fnc_remoteEvent;
|
[QGVAR(loadoutUnshared), [_contentPanelCtrl, profileName, _loadoutName]] call CBA_fnc_remoteEvent;
|
||||||
} else {
|
} else {
|
||||||
([_loadoutData] call FUNC(verifyLoadout)) params ["_extendedLoadout", "_nullItemsAmount", "_unavailableItemsAmount"];
|
([_loadoutData] call FUNC(verifyLoadout)) params ["_extendedLoadout", "_nullItemsList", "_unavailableItemsList"];
|
||||||
_extendedLoadout params ["_loadout"];
|
_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];
|
_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];
|
_newRow = _contentPanelCtrl lnbAddRow [_playerName, _loadoutName];
|
||||||
@ -118,17 +146,23 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
|
|||||||
_contentPanelCtrl lnbSetData [[_newRow, 1], _loadoutVar];
|
_contentPanelCtrl lnbSetData [[_newRow, 1], _loadoutVar];
|
||||||
|
|
||||||
// Change color on loadout lines that have items that aren't available or don't exist
|
// 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
|
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; // Red
|
||||||
} else {
|
} else {
|
||||||
if (_unavailableItemsAmount > 0) then {
|
if (_unavailableItemsList isNotEqualTo []) then {
|
||||||
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; // Gray
|
_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;
|
[QGVAR(loadoutsListFilled), [_display, _control]] call CBA_fnc_localEvent;
|
||||||
|
|
||||||
// Sort loadouts alphabetically
|
// Sort loadouts alphabetically
|
||||||
|
@ -53,7 +53,7 @@ if (GVAR(favoritesOnly)) then {
|
|||||||
private _fnc_fillRightContainer = {
|
private _fnc_fillRightContainer = {
|
||||||
params ["_configCategory", "_className", ["_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 item is not in the arsenal, it must be unique
|
||||||
if (!_isUnique && {!(_className in GVAR(virtualItemsFlat))}) then {
|
if (!_isUnique && {!(_className in GVAR(virtualItemsFlat))}) then {
|
||||||
@ -87,9 +87,9 @@ private _fnc_fillRightContainer = {
|
|||||||
_ctrlPanel lnbSetText [[_lbAdd, 1], _displayName];
|
_ctrlPanel lnbSetText [[_lbAdd, 1], _displayName];
|
||||||
_ctrlPanel lnbSetData [[_lbAdd, 0], _className];
|
_ctrlPanel lnbSetData [[_lbAdd, 0], _className];
|
||||||
_ctrlPanel lnbSetPicture [[_lbAdd, 0], _picture];
|
_ctrlPanel lnbSetPicture [[_lbAdd, 0], _picture];
|
||||||
_ctrlPanel lnbSetValue [[_lbAdd, 2], [0, 1] select _isUnique];
|
_ctrlPanel lnbSetValue [[_lbAdd, 2], parseNumber _isUnique];
|
||||||
_ctrlPanel lnbSetTooltip [[_lbAdd, 0], format ["%1\n%2", _displayName, _className]];
|
_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 lnbSetColor [[_lbAdd, 1], FAVORITES_COLOR];
|
||||||
_ctrlPanel lnbSetColorRight [[_lbAdd, 1], FAVORITES_COLOR];
|
_ctrlPanel lnbSetColorRight [[_lbAdd, 1], FAVORITES_COLOR];
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Arsenal display <DISPLAY>
|
* 0: Arsenal display <DISPLAY>
|
||||||
* 1: Current panel control <CONTROL>
|
* 1: Current panel control <CONTROL>
|
||||||
* 2: Current panel selection <SCALAR>
|
* 2: Current panel selection <NUMBER>
|
||||||
* 3: Item config entry <CONFIG>
|
* 3: Item config entry <CONFIG>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
@ -15,7 +15,6 @@
|
|||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_display", "_control", "_curSel", "_itemCfg"];
|
params ["_display", "_control", "_curSel", "_itemCfg"];
|
||||||
|
|
||||||
GVAR(actionsInfo) = [_control, _curSel, _itemCfg];
|
GVAR(actionsInfo) = [_control, _curSel, _itemCfg];
|
||||||
@ -46,13 +45,12 @@ private _groups = (GVAR(actionList) select _panel) select {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private _show = _groups isNotEqualTo [];
|
private _show = _groups isNotEqualTo [];
|
||||||
private _ctrl = _display displayCtrl IDC_actionsBox;
|
private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox;
|
||||||
_ctrl ctrlShow _show;
|
_actionsBoxCtrl ctrlShow _show;
|
||||||
_ctrl ctrlCommit 0.15;
|
_actionsBoxCtrl ctrlCommit FADE_DELAY;
|
||||||
|
|
||||||
if (!_show) exitWith {};
|
if (!_show) exitWith {};
|
||||||
|
|
||||||
private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox;
|
|
||||||
private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage;
|
private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage;
|
||||||
|
|
||||||
private _currentPage = GVAR(currentActionPage);
|
private _currentPage = GVAR(currentActionPage);
|
||||||
@ -79,33 +77,29 @@ private _items = _group select 3 select {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_actionsCurrentPageCtrl ctrlSetText (_group select 1);
|
_actionsCurrentPageCtrl ctrlSetText (_group select 1);
|
||||||
_actionsCurrentPageCtrl ctrlSetFade 0;
|
|
||||||
_actionsCurrentPageCtrl ctrlShow true;
|
_actionsCurrentPageCtrl ctrlShow true;
|
||||||
_actionsCurrentPageCtrl ctrlCommit 0;
|
_actionsCurrentPageCtrl ctrlCommit 0;
|
||||||
|
|
||||||
|
private _activeCtrls = [];
|
||||||
{
|
{
|
||||||
_x params ["", "_type", "_label", "_statement"];
|
_x params ["", "_type", "_label", "_statement"];
|
||||||
|
|
||||||
private _idc = 9001 + _forEachIndex * 2;
|
private _idc = IDC_actionsText1 + _type + _forEachIndex * 2;
|
||||||
private _actionTextCtrl = _display displayCtrl _idc;
|
private _actionCtrl = _display displayCtrl _idc;
|
||||||
private _actionButtonCtrl = _display displayCtrl (_idc + 1);
|
|
||||||
|
|
||||||
switch (_type) do {
|
switch (_type) do {
|
||||||
case ACTION_TYPE_BUTTON: {
|
case ACTION_TYPE_BUTTON: {
|
||||||
_actionButtonCtrl ctrlRemoveAllEventHandlers "ButtonClick";
|
_actionCtrl ctrlRemoveAllEventHandlers "ButtonClick";
|
||||||
_actionButtonCtrl ctrlAddEventHandler ["ButtonClick", {
|
_actionCtrl ctrlAddEventHandler ["ButtonClick", {
|
||||||
if (is3DEN) exitWith {[true] call FUNC(refresh)};
|
if (is3DEN) exitWith {[true] call FUNC(refresh)};
|
||||||
[{
|
[{
|
||||||
[true] call FUNC(refresh);
|
[true] call FUNC(refresh);
|
||||||
}] call CBA_fnc_execNextFrame;
|
}] call CBA_fnc_execNextFrame;
|
||||||
}];
|
}];
|
||||||
_actionButtonCtrl ctrlAddEventHandler ["ButtonClick", _statement];
|
|
||||||
_actionButtonCtrl ctrlSetText _label;
|
_actionCtrl ctrlAddEventHandler ["ButtonClick", _statement];
|
||||||
_actionButtonCtrl ctrlSetFade 0;
|
_actionCtrl ctrlSetText _label;
|
||||||
_actionButtonCtrl ctrlEnable true;
|
_actionCtrl ctrlEnable true;
|
||||||
_actionButtonCtrl ctrlCommit 0;
|
|
||||||
_actionTextCtrl ctrlSetFade 1;
|
|
||||||
_actionTextCtrl ctrlCommit 0;
|
|
||||||
};
|
};
|
||||||
case ACTION_TYPE_TEXT: {
|
case ACTION_TYPE_TEXT: {
|
||||||
private _text = call _statement;
|
private _text = call _statement;
|
||||||
@ -113,38 +107,43 @@ _actionsCurrentPageCtrl ctrlCommit 0;
|
|||||||
if (isNil "_text") then {
|
if (isNil "_text") then {
|
||||||
_text = "";
|
_text = "";
|
||||||
};
|
};
|
||||||
|
if (_text isEqualType []) then {
|
||||||
|
_text = _text joinString endl;
|
||||||
|
};
|
||||||
|
|
||||||
_actionTextCtrl ctrlSetText _text;
|
_actionCtrl ctrlSetText _text;
|
||||||
_actionTextCtrl ctrlSetFade 0;
|
_actionCtrl ctrlSetPositionH (ctrlTextHeight _actionCtrl);
|
||||||
_actionTextCtrl ctrlCommit 0;
|
_actionCtrl ctrlEnable false;
|
||||||
_actionButtonCtrl ctrlSetFade 1;
|
|
||||||
_actionButtonCtrl ctrlEnable false;
|
|
||||||
_actionButtonCtrl ctrlCommit 0;
|
|
||||||
};
|
|
||||||
default {
|
|
||||||
_actionTextCtrl ctrlSetFade 1;
|
|
||||||
_actionTextCtrl ctrlCommit 0;
|
|
||||||
_actionButtonCtrl ctrlSetFade 1;
|
|
||||||
_actionButtonCtrl ctrlEnable false;
|
|
||||||
_actionButtonCtrl ctrlCommit 0;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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;
|
} forEach _items;
|
||||||
|
|
||||||
private _actionCount = count _items;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
private _idc = 9001 + _x * 2;
|
private _idc = ctrlIDC _x;
|
||||||
private _actionTextCtrl = _display displayCtrl _idc;
|
if (_idc < IDC_actionsText1 || _idc > IDC_actionsButton5) then {continue};
|
||||||
private _actionButtonCtrl = _display displayCtrl (_idc + 1);
|
|
||||||
|
|
||||||
_actionTextCtrl ctrlSetFade 1;
|
_x ctrlShow false;
|
||||||
_actionTextCtrl ctrlCommit 0;
|
_x ctrlEnable false;
|
||||||
_actionButtonCtrl ctrlSetFade 1;
|
_x ctrlSetPositionY 0;
|
||||||
_actionButtonCtrl ctrlCommit 0;
|
_x ctrlCommit 0;
|
||||||
} forEach ([0, 1, 2, 3, 4] select [_actionCount, 5]);
|
} forEach ((allControls _actionsBoxCtrl) select {!(_x in _activeCtrls)});
|
||||||
|
|
||||||
private _pos = ctrlPosition _actionsBoxCtrl;
|
(ctrlPosition (_activeCtrls select -1)) params ["", "_lastPosY", "", "_lastPosH"];
|
||||||
_pos set [3, ([11, (5 * _actionCount) + 6] select (_actionCount > 0)) * GRID_H];
|
private _actionsBoxHeight = _lastPosY + _lastPosH + GRID_H;
|
||||||
_actionsBoxCtrl ctrlSetPosition _pos;
|
_actionsBoxCtrl ctrlSetPositionH _actionsBoxHeight;
|
||||||
_actionsBoxCtrl ctrlCommit 0;
|
_actionsBoxCtrl ctrlCommit 0;
|
||||||
|
|
||||||
|
private _background = _display displayCtrl IDC_actionsBackground1;
|
||||||
|
_background ctrlSetPositionH _actionsBoxHeight;
|
||||||
|
_background ctrlCommit 0;
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
(_this select 1) params ["", "_exitCode"];
|
(_this select 1) params ["", "_exitCode"];
|
||||||
|
|
||||||
[QGVAR(displayClosed), []] call CBA_fnc_localEvent;
|
[QGVAR(displayClosed), []] call CBA_fnc_localEvent;
|
||||||
removeMissionEventHandler ["draw3D", GVAR(camPosUpdateHandle)];
|
removeMissionEventHandler ["Draw3D", GVAR(camPosUpdateHandle)];
|
||||||
|
|
||||||
if (is3DEN) then {
|
if (is3DEN) then {
|
||||||
private _centerOriginParent = objectParent GVAR(centerOrigin);
|
private _centerOriginParent = objectParent GVAR(centerOrigin);
|
||||||
@ -78,10 +78,10 @@ if (!isNull curatorCamera) then {
|
|||||||
|
|
||||||
// Make face and voice selection JIP compatible; 3DEN doesn't need this though
|
// Make face and voice selection JIP compatible; 3DEN doesn't need this though
|
||||||
if (isMultiplayer && {!is3DEN}) then {
|
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, 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;
|
[_id, GVAR(center)] call CBA_fnc_removeGlobalEventJIP;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ if (isNil QGVAR(virtualItems)) then {
|
|||||||
GVAR(virtualItemsFlatAll) = +GVAR(virtualItemsFlat);
|
GVAR(virtualItemsFlatAll) = +GVAR(virtualItemsFlat);
|
||||||
|
|
||||||
GVAR(currentFace) = face GVAR(center);
|
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(currentInsignia) = GVAR(center) call BIS_fnc_getUnitInsignia;
|
||||||
|
|
||||||
GVAR(currentAction) = "Stand";
|
GVAR(currentAction) = "Stand";
|
||||||
@ -138,14 +138,6 @@ _actionsBoxCtrl ctrlSetPosition [
|
|||||||
];
|
];
|
||||||
_actionsBoxCtrl ctrlCommit 0;
|
_actionsBoxCtrl ctrlCommit 0;
|
||||||
|
|
||||||
// Disable import in MP
|
|
||||||
if (isMultiplayer) then {
|
|
||||||
private _importButtonCtrl = _display displayCtrl IDC_buttonImport;
|
|
||||||
_importButtonCtrl ctrlEnable false;
|
|
||||||
_importButtonCtrl ctrlSetFade 0.6;
|
|
||||||
_importButtonCtrl ctrlCommit 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
//--------------- Camera prep
|
//--------------- Camera prep
|
||||||
cutText ["", "PLAIN"];
|
cutText ["", "PLAIN"];
|
||||||
showCommandingMenu "";
|
showCommandingMenu "";
|
||||||
@ -278,4 +270,4 @@ showCinemaBorder false;
|
|||||||
|
|
||||||
//--------------- Reset camera pos
|
//--------------- Reset camera pos
|
||||||
[nil, [controlNull, 0, 0]] call FUNC(handleMouse);
|
[nil, [controlNull, 0, 0]] call FUNC(handleMouse);
|
||||||
GVAR(camPosUpdateHandle) = addMissionEventHandler ["draw3D", {call FUNC(updateCamPos)}];
|
GVAR(camPosUpdateHandle) = addMissionEventHandler ["Draw3D", {call FUNC(updateCamPos)}];
|
||||||
|
@ -94,8 +94,8 @@ if (!isNull _loadoutsDisplay) then {
|
|||||||
};
|
};
|
||||||
} params ["_className"];
|
} params ["_className"];
|
||||||
|
|
||||||
"ace_clipboard" callExtension (_className + ";");
|
"ace" callExtension ["clipboard:append", [_className]];
|
||||||
"ace_clipboard" callExtension "--COMPLETE--";
|
"ace" callExtension ["clipboard:complete", []];
|
||||||
|
|
||||||
[_display, LLSTRING(exportedClassnameText)] call FUNC(message);
|
[_display, LLSTRING(exportedClassnameText)] call FUNC(message);
|
||||||
} else {
|
} else {
|
||||||
@ -147,7 +147,7 @@ if (!isNull _loadoutsDisplay) then {
|
|||||||
// Right panel lnb + and - buttons
|
// Right panel lnb + and - buttons
|
||||||
case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): {
|
case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): {
|
||||||
if (GVAR(rightTabLnBFocus)) then {
|
if (GVAR(rightTabLnBFocus)) then {
|
||||||
[_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo);
|
[_display, parseNumber (_keyPressed != DIK_LEFT)] call FUNC(buttonCargo);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -27,9 +27,9 @@ private _favorited = false;
|
|||||||
// Favorites/blacklist will always be lowercase to handle configCase changes
|
// Favorites/blacklist will always be lowercase to handle configCase changes
|
||||||
private _item = "";
|
private _item = "";
|
||||||
if (_isLnB) then {
|
if (_isLnB) then {
|
||||||
_item = toLower (_control lnbData [_curSel, 0]);
|
_item = toLowerANSI (_control lnbData [_curSel, 0]);
|
||||||
} else {
|
} else {
|
||||||
_item = toLower (_control lbData _curSel);
|
_item = toLowerANSI (_control lbData _curSel);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_item in GVAR(favorites)) then {
|
if (_item in GVAR(favorites)) then {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user