mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
ffaa195fe5
* Fixed headers to work with silentspike python script * Fixed rest of the files * Fixed ace-team
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
/*
|
|
* Author: PabstMirror
|
|
* Called when listbox selection changes. Updates the rangetable with new values.
|
|
*
|
|
* Arguments:
|
|
* None
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [] call ace_mk6mortar_fnc_rangeTablePageChange
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
#define RANGE_TABLE ((uiNamespace getVariable "ACE_82mm_RangeTable_Dialog") displayCtrl 20001)
|
|
#define LIST_CHARGE ((uiNamespace getVariable "ACE_82mm_RangeTable_Dialog") displayCtrl 1501)
|
|
|
|
private ["_listBoxData", "_muzzleVelocity", "_airFriction", "_precalcArray"];
|
|
|
|
_listBoxData = LIST_CHARGE lbData (lbCurSel LIST_CHARGE);
|
|
if (isNil "_listBoxData" || {_listBoxData == ""}) exitWith {ERROR("lbCurSel out of bounds or no data");};
|
|
_muzzleVelocity = parseNumber _listBoxData;
|
|
|
|
_airFriction = if (GVAR(airResistanceEnabled)) then {MK6_82mm_AIR_FRICTION} else {0};
|
|
|
|
_precalcArray = [_muzzleVelocity, _airFriction] call FUNC(rangeTablePreCalculatedValues);
|
|
|
|
lnbClear RANGE_TABLE;
|
|
{
|
|
RANGE_TABLE lnbAddRow _x;
|
|
} forEach _precalcArray;
|
|
|
|
//put dummy line at end because scrolling is fucked and can't see last line
|
|
RANGE_TABLE lnbAddRow ["", "", "", "", "", "", "", "", "", "", ""];
|