Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions - Rust #9015

Merged
merged 70 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
cb181d8
ballistics, clipboard
BrettMayson Aug 27, 2022
1b21ff1
change extension name, fix command call
BrettMayson Aug 27, 2022
944f1ff
build and tested
BrettMayson Aug 27, 2022
4cf4391
one day I will remember to add files before commit
BrettMayson Aug 27, 2022
ae2ff2a
wip
BrettMayson Aug 27, 2022
8c10e12
wip
BrettMayson Aug 30, 2022
cb7fb0a
artillery tables, fcs
BrettMayson Aug 30, 2022
850cf1b
fcs
BrettMayson Aug 30, 2022
0be3415
working tables
BrettMayson Aug 30, 2022
834786f
cleanup, docs, make
BrettMayson Aug 30, 2022
b9ad607
fix extension yml
BrettMayson Aug 30, 2022
8ca10b9
fix extension yml
BrettMayson Aug 30, 2022
d5ef801
fix extension yml
BrettMayson Aug 30, 2022
d9f6c86
fix extension yml
BrettMayson Aug 30, 2022
e073c66
install linux test dependencies
BrettMayson Aug 30, 2022
90bf98e
fix extension yml
BrettMayson Aug 30, 2022
cfa1105
fix extension yml
BrettMayson Aug 30, 2022
7401a45
fix extension yml
BrettMayson Aug 30, 2022
4d9730c
don't test clipboard on linux
BrettMayson Aug 31, 2022
2cabd20
don't test clipboard on linux
BrettMayson Aug 31, 2022
8fe4b9a
add test for fcs
BrettMayson Aug 31, 2022
3b8fe5b
use published arma-rs
BrettMayson Aug 31, 2022
d3411df
first char is already checked for existance
BrettMayson Aug 31, 2022
7ae959f
fix extension path
BrettMayson Aug 31, 2022
78b25e4
flip typo on artillery precision
BrettMayson Aug 31, 2022
6eeee96
isEqualTo > ==
BrettMayson Aug 31, 2022
12f95bf
;
BrettMayson Aug 31, 2022
19393a8
remove ';' from export
BrettMayson Oct 8, 2022
d02ebbd
Initial Commit
LorenLuke Jul 28, 2023
880242c
Merge branch 'master' of github.com:acemod/ACE3 into ArtilleryExtension
LorenLuke Jul 29, 2023
1168694
Second Commit.
LorenLuke Jul 31, 2023
df8ea11
Incorporate suggestions, clarify variables
LorenLuke Aug 11, 2023
07e817d
Apply suggestions from Eathox's code review
BrettMayson Sep 13, 2023
ada9b0c
Merge branch 'master' into rust
BrettMayson Sep 18, 2023
a3f72ca
fix error macro usage
BrettMayson Sep 18, 2023
4a06e7b
Merge branch 'master' into rust
BrettMayson Oct 19, 2023
c03d86d
Merge branch 'master' into rust
BrettMayson Oct 23, 2023
f149ee4
update deps, add checkFiles
BrettMayson Oct 24, 2023
13feb23
Apply suggestions from code review
BrettMayson Oct 24, 2023
dcb2997
rebuild, add cache to ci
BrettMayson Oct 24, 2023
63737b8
Merge branch 'master' into rust
BrettMayson Nov 20, 2023
024d28c
Update extension/src/lib.rs
BrettMayson Dec 12, 2023
37d7399
Merge remote-tracking branch 'upstream/master' into rust
BrettMayson Jan 18, 2024
667510f
extension fmt and update deps
BrettMayson Jan 18, 2024
a022867
get version from git
BrettMayson Jan 18, 2024
4e40a1b
merge #9298
BrettMayson Jan 18, 2024
9db162e
add build.rs
BrettMayson Jan 18, 2024
3a22190
fix includes to script_component
BrettMayson Jan 18, 2024
2ebd632
update dlls, fix get_solution
BrettMayson Jan 18, 2024
f0145b5
a bit of rust cleanup
BrettMayson Jan 18, 2024
532b193
test the extension on more file changes
BrettMayson Jan 18, 2024
6ff692d
fix atmosphericmodel from arma
BrettMayson Jan 19, 2024
8716f52
xm157 conversion
PabstMirror Jan 19, 2024
ec34f36
parseSimpleArray
BrettMayson Jan 21, 2024
417a0f1
Merge branch 'rust' of github.com:brettmayson/ace3 into rust
BrettMayson Jan 21, 2024
ffe9b31
fix example calls, fix find_max_angle
BrettMayson Jan 21, 2024
5bfd5a6
fix argument order
BrettMayson Jan 23, 2024
f29cbe3
Merge remote-tracking branch 'upstream/master' into rust
BrettMayson Apr 20, 2024
a95e2cf
fix merge
BrettMayson Apr 20, 2024
ca7ccf3
semicolon
LinkIsGrim Jun 20, 2024
df8fd3b
fix max/min
LinkIsGrim Jun 20, 2024
bbde68f
variable name
LinkIsGrim Jun 20, 2024
38c8eb0
Merge remote-tracking branch 'origin/master' into pr/BrettMayson/9015
LinkIsGrim Jun 20, 2024
fa8a3fa
Merge branch 'master' into pr/9015
johnb432 Jun 22, 2024
0464be6
Update fnc_checkFiles.sqf
johnb432 Jun 24, 2024
1d37820
update EPSILON for newer rust versions
BrettMayson Jul 1, 2024
c46023a
Extension: get loadout from clipboard (#5)
BrettMayson Jul 1, 2024
db8d552
ab::bullet - cleanup unused vars
PabstMirror Aug 16, 2024
08c9ae0
Minor cleanup
johnb432 Aug 16, 2024
90706ca
Use endl
johnb432 Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 114 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions addons/artillerytables/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,30 @@
};
}] call CBA_fnc_addEventHandler;

addMissionEventHandler ["ExtensionCallback", {
params ["_name", "_function", "_data"];
if (_name isEqualTo "ace:artillery") then {
if (_function isEqualTo "calculate_table") then {
(parseSimpleArray _data) params ["_line", "_data"];
GVAR(tableData) set [_line, _data];
GVAR(tableSizeReceived) = GVAR(tableSizeReceived) + 1;
if (GVAR(tableSizeReceived) == GVAR(tableSizeActual)) then {
private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull];
private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE;
if (isNull _dialog) exitWith {true};
for "_i" from 0 to GVAR(tableSizeActual) do {
_ctrlRangeTable lnbAdd GVAR(tableData) select _i;
};
};
private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull];
private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE;
if (isNull _dialog) exitWith {TRACE_1("dialog closed",_this);};
_ctrlRangeTable lnbAddRow ["", "", "", "", "", "", "", "", "", "", ""];
TRACE_1("table filled",_ctrlRangeTable);
};
};
}]

#ifdef DEBUG_MODE_FULL
#include "dev\showShotInfo.sqf"
#include "dev\checkConfigs.sqf"
Expand Down
37 changes: 9 additions & 28 deletions addons/artillerytables/functions/fnc_rangeTableUpdate.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,12 @@ _ctrlElevationLow ctrlSetTextColor ([[1,1,1,1],[0.25,0.25,0.25,1]] select GVAR(l

lnbClear _ctrlRangeTable;
// Call extension with current data and start workers
TRACE_5("callExtension:start",_muzzleVelocity,_airFriction,_elevMin,_elevMax,GVAR(lastElevationMode));
private _ret = "ace_artillerytables" callExtension ["start", [_muzzleVelocity,_airFriction,_elevMin,_elevMax,GVAR(lastElevationMode)]];
TRACE_1("",_ret);

// Non-blocking read data out of extension as it becomes availiable
[{
private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull];
private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE;
if (isNull _dialog) exitWith {true};

private _status = 1; // 1 = data on line, 2 - data not ready, 3 - done
while {_status == 1} do {
private _ret = ("ace_artillerytables" callExtension ["getline", []]);
// TRACE_1("callExtension:getline",_ret);
_status = _ret select 1;
if (_status == 1) then { _ctrlRangeTable lnbAddRow parseSimpleArray (_ret select 0) };
};

(_status == 3) // exit loop when all data read
}, {
// put dummy line at end because scrolling is problematic and can't see last line
private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull];
private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE;
if (isNull _dialog) exitWith {TRACE_1("dialog closed",_this);};

_ctrlRangeTable lnbAddRow ["", "", "", "", "", "", "", "", "", "", ""];
TRACE_1("table filled",_ctrlRangeTable);
}, []] call CBA_fnc_waitUntilAndExecute;
TRACE_5("callExtension:artillery:calculate_table",_muzzleVelocity,_airFriction,_elevMin,_elevMax,GVAR(lastElevationMode));
(
"ace" callExtension ["artillery:calculate_table", [_muzzleVelocity,_airFriction,_elevMin,_elevMax,GVAR(lastElevationMode)]];
) params ["_data", "_code"];
TRACE_1("",_code)

GVAR(tableData) = createHashMap;
GVAR(tableSizeActual) = (parseSimpleArray _data) select 1;
GVAR(tableSizeReceived) = 0;
2 changes: 1 addition & 1 deletion addons/fcs/functions/fnc_calculateSolution.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private _turretConfig = [configOf _vehicle, _turret] call EFUNC(common,getTurret
false
} count (_vehicle weaponsTurret _turret);

private _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance];
private _offset = "ace" callExtension ["fcs", [_initSpeed, _airFriction, _angleTarget, _distance]];
BrettMayson marked this conversation as resolved.
Show resolved Hide resolved
_offset = parseNumber _offset;

_FCSInitSpeed pushBack _initSpeed;
Expand Down
2 changes: 1 addition & 1 deletion addons/fcs/functions/fnc_firedEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (_zeroDistance > 0) then {
private _weaponCombo = [_weapon, _magazine, _ammo, _zeroDistance];
if (_weaponCombo isNotEqualTo (_gunner getVariable [QGVAR(lastWeaponCombo), []])) then {
private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction");
private _antiOffset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, 0, _zeroDistance];
private _antiOffset = "ace" callExtension ["fcs", [_initSpeed, _airFriction, 0, _zeroDistance]];
BrettMayson marked this conversation as resolved.
Show resolved Hide resolved
_antiOffset = parseNumber _antiOffset;

_gunner setVariable [QGVAR(lastWeaponCombo), _weaponCombo];
Expand Down
3 changes: 3 additions & 0 deletions extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ uuid = { version = "1.1.2", features = ["v4"] }
rand = "0.8.5"
rand_chacha = "0.3.1"

# Artillery
rayon = "1.5.3"

# Clipboard
clipboard = { version = "0.5", optional = true }

Expand Down
Loading