2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2019-12-17 16:14:45 +00:00
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
|
|
|
* Called when listbox selection changes. Updates the rangetable with new values.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Elevation Mode (true = high,false=low) <BOOL><OPTIONAL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ace_artillerytables_fnc_rangeTableUpdate
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull];
|
|
|
|
private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE;
|
|
|
|
private _ctrlChargeList = _dialog displayCtrl IDC_CHARGELIST;
|
|
|
|
private _ctrlElevationHigh = _dialog displayCtrl IDC_BUTTON_ELEV_HIGH;
|
|
|
|
private _ctrlElevationLow = _dialog displayCtrl IDC_BUTTON_ELEV_LOW;
|
|
|
|
|
|
|
|
GVAR(lastElevationMode) = param [0, GVAR(lastElevationMode)]; // update if passed a new value
|
2024-03-03 22:43:31 +00:00
|
|
|
GVAR(lastTablePage) = lbCurSel _ctrlChargeList;
|
2019-12-17 16:14:45 +00:00
|
|
|
|
|
|
|
// get data for currently selected mag/mode combo:
|
2024-03-03 22:43:31 +00:00
|
|
|
(GVAR(magModeData) select GVAR(lastTablePage)) params [["_muzzleVelocity", -1], ["_airFriction", 0]];
|
2019-12-17 16:14:45 +00:00
|
|
|
private _elevMin = _dialog getVariable [QGVAR(elevMin), 0];
|
|
|
|
private _elevMax = _dialog getVariable [QGVAR(elevMax), 0];
|
|
|
|
_ctrlElevationHigh ctrlSetTextColor ([[0.25,0.25,0.25,1],[1,1,1,1]] select GVAR(lastElevationMode));
|
|
|
|
_ctrlElevationLow ctrlSetTextColor ([[1,1,1,1],[0.25,0.25,0.25,1]] select GVAR(lastElevationMode));
|
|
|
|
|
|
|
|
|
|
|
|
lnbClear _ctrlRangeTable;
|
|
|
|
// Call extension with current data and start workers
|
2024-08-17 15:50:38 +00:00
|
|
|
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;
|