From 934f2ce097637ac140eeb5b994b66c4b32f01bea Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 16:29:49 -0700 Subject: [PATCH] Display current laser code. Standardize GVARs --- addons/laser/XEH_post_init.sqf | 1 + addons/laser/functions/fnc_onLaserDesignatorDraw.sqf | 8 ++++++-- .../functions/fnc_laserHudDesignateOn.sqf | 10 +++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/addons/laser/XEH_post_init.sqf b/addons/laser/XEH_post_init.sqf index fb189d5041..f868ef9895 100644 --- a/addons/laser/XEH_post_init.sqf +++ b/addons/laser/XEH_post_init.sqf @@ -2,3 +2,4 @@ ["laser_laserOn", {_this call DFUNC(handleLaserOn)}] call EFUNC(common,addEventHandler); ["laser_laserOff", {_this call DFUNC(handleLaserOff)}] call EFUNC(common,addEventHandler); + diff --git a/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf index 3f756443fa..a5da33b236 100644 --- a/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf +++ b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf @@ -1,5 +1,9 @@ #define DEBUG_MODE_FULL #include "script_component.hpp" +TRACE_1("", _this); +private["_laserCode"]; - -TRACE_1("", _this); \ No newline at end of file +_laserCode = ACE_player getVariable[QGVAR(code), ACE_DEFAULT_LASER_CODE]; +if(!isNil "_laserCode") then { + __LaserDesignatorIGUI_LaserCode ctrlSetText format["Code: %1", [_laserCode, 4, 0, false] call CBA_fnc_formatNumber]; +}; \ No newline at end of file diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index c480c051bb..6301f6f5e4 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -43,8 +43,8 @@ FUNC(laserHudDesignatePFH) = { _turretInfo = [_vehicle, _gunnerInfo select 1] call EFUNC(common,getTurretDirection); _povPos = _turretInfo select 0; - _laserCode = (vehicle ACE_player) getVariable[QGVAR(currentCode), ACE_DEFAULT_LASER_CODE]; - _waveLength = (vehicle ACE_player) getVariable[QGVAR(currentWaveLength), ACE_DEFAULT_LASER_WAVELENGTH]; + _laserCode = (vehicle ACE_player) getVariable["ace_laser_code", ACE_DEFAULT_LASER_CODE]; + _waveLength = (vehicle ACE_player) getVariable["ace_laser_waveLength", ACE_DEFAULT_LASER_WAVELENGTH]; _laserResult = [_povPos, [_waveLength,_waveLength], _laserCode] call EFUNC(laser,seekerFindLaserSpot); @@ -73,9 +73,9 @@ if(!GVAR(active)) then { TRACE_1("Activating laser", ""); // Get the self-designation variables, or use defaults - _laserCode = (vehicle ACE_player) getVariable[QGVAR(currentCode), ACE_DEFAULT_LASER_CODE]; - _waveLength = (vehicle ACE_player) getVariable[QGVAR(currentWaveLength), ACE_DEFAULT_LASER_WAVELENGTH]; - _beamSpread = (vehicle ACE_player) getVariable[QGVAR(currentBeamSpread), ACE_DEFAULT_LASER_BEAMSPREAD]; + _laserCode = (vehicle ACE_player) getVariable["ace_laser_code", ACE_DEFAULT_LASER_CODE]; + _waveLength = (vehicle ACE_player) getVariable["ace_laser_waveLength", ACE_DEFAULT_LASER_WAVELENGTH]; + _beamSpread = (vehicle ACE_player) getVariable["ace_laser_beamSpread", ACE_DEFAULT_LASER_BEAMSPREAD]; _laserUuid = [(vehicle ACE_player), ACE_player, QFUNC(findLaserSource), _waveLength, _laserCode, _beamSpread] call EFUNC(laser,laserOn);