mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix infantry rangefinders (again)
This commit is contained in:
parent
bf5eb78788
commit
4406f270e2
@ -6,7 +6,7 @@
|
||||
* 0: Measurement Accuracy (default: 1) <NUMBER>
|
||||
* 1: Maximum measure distance (default: 5000) <NUMBER>
|
||||
* 2: Minimum measure distance (default: 0) <NUMBER>
|
||||
* 3: Update display (default: true) <BOOL>
|
||||
* 3: Blank display on range error (default: false) <BOOL>
|
||||
*
|
||||
* Return value:
|
||||
* Measured distance <NUMBER>
|
||||
@ -15,7 +15,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params [["_accuracy",1], ["_maxDistance",5000], ["_minDistance",0],["_update",true]];
|
||||
params [["_accuracy",1], ["_maxDistance",5000], ["_minDistance",0], ["_blank",false]];
|
||||
|
||||
disableSerialization;
|
||||
private _dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull];
|
||||
@ -37,13 +37,15 @@ if (_distance == 0) then {
|
||||
_distance = (round (_distance/_accuracy)) * _accuracy;
|
||||
};
|
||||
|
||||
if (_update) then {
|
||||
// Display the minimum or maximum distance with an * if out of bounds
|
||||
if (_distance >= _maxDistance || _distance <= _minDistance) then {
|
||||
(_dlgRangefinder displayCtrl 1713151) ctrlSetText ([_distance, 4, 0] call CBA_fnc_formatNumber) + "*";
|
||||
// Change the display if the range is out of bounds
|
||||
if (_distance >= _maxDistance || _distance <= _minDistance) then {
|
||||
if (_blank) then {
|
||||
(_dlgRangefinder displayCtrl 1713151) ctrlSetText "----";
|
||||
} else {
|
||||
(_dlgRangefinder displayCtrl 1713151) ctrlSetText ([_distance, 4, 0] call CBA_fnc_formatNumber);
|
||||
(_dlgRangefinder displayCtrl 1713151) ctrlSetText ([_distance, 4, 0] call CBA_fnc_formatNumber) + "*";
|
||||
};
|
||||
} else {
|
||||
(_dlgRangefinder displayCtrl 1713151) ctrlSetText ([_distance, 4, 0] call CBA_fnc_formatNumber);
|
||||
};
|
||||
|
||||
_distance
|
||||
|
@ -17,12 +17,14 @@ params ["_vehicle", "_turret"];
|
||||
|
||||
private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath);
|
||||
|
||||
// Update display for infantry rangefinders
|
||||
if (_vehicle == ACE_player) exitWith {[5,5500,25,true] call FUNC(getRange)};
|
||||
|
||||
private _distance = [
|
||||
getNumber (_turretConfig >> QGVAR(DistanceInterval)),
|
||||
getNumber (_turretConfig >> QGVAR(MaxDistance)),
|
||||
getNumber (_turretConfig >> QGVAR(MinDistance))
|
||||
] call FUNC(getRange);
|
||||
// call FUNC(updateRangeHUD);
|
||||
|
||||
if !(!GVAR(enabled) && FUNC(canUseFCS)) exitWith {};
|
||||
|
||||
|
@ -17,8 +17,6 @@ params ["_vehicle", "_turret", "_distance", ["_showHint", false], ["_playSound",
|
||||
|
||||
private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath);
|
||||
|
||||
// call FUNC(updateRangeHUD);
|
||||
|
||||
if (isNil "_distance") then {
|
||||
_distance = [
|
||||
getNumber (_turretConfig >> QGVAR(DistanceInterval)),
|
||||
@ -56,7 +54,7 @@ if (ACE_time - GVAR(time) > 1 && GVAR(time) != -1 && isNil {_this select 2}) the
|
||||
private _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "timeToLive");
|
||||
private _simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammo >> "simulationStep");
|
||||
private _initSpeedCoef = getNumber (configFile >> "CfgWeapons" >> _weapon >> "initSpeed");
|
||||
private _simulationType = getNumber (configFile >> "CfgAmmo" >> _ammo >> "simulation");
|
||||
private _simulationType = getText (configFile >> "CfgAmmo" >> _ammo >> "simulation");
|
||||
|
||||
// More BIS fix
|
||||
if (_simulationType == "shotBullet") then {
|
||||
|
Loading…
Reference in New Issue
Block a user