diff --git a/addons/laser/RscInGameUI.hpp b/addons/laser/RscInGameUI.hpp index 770c2104b6..d3dfaa5d43 100644 --- a/addons/laser/RscInGameUI.hpp +++ b/addons/laser/RscInGameUI.hpp @@ -40,8 +40,8 @@ class RscInGameUI { w = "4.5 * (0.01875 * SafezoneH)"; h = "1.1 * (0.025 * SafezoneH)"; }; - class CA_Distance: RscText { - idc = 151; + class ACE_Distance: RscText { + idc = 123002; style = 0; sizeEx = "0.038*SafezoneH"; colorText[] = {0.706,0.0745,0.0196,1}; @@ -53,6 +53,19 @@ class RscInGameUI { w = "4 * (0.01875 * SafezoneH)"; h = "1.5 * (0.025 * SafezoneH)"; }; + class CA_Distance: RscText { + idc = 151; + style = 0; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "2456"; + x = 0; + y = 0; + w = 0; + h = 0; + }; class CA_Elev: RscText { idc = 175; style = 1; diff --git a/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf index a5da33b236..7f8537ab9b 100644 --- a/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf +++ b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf @@ -1,9 +1,15 @@ -#define DEBUG_MODE_FULL +//#define DEBUG_MODE_FULL #include "script_component.hpp" -TRACE_1("", _this); private["_laserCode"]; _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]; +}; + +if(! (ctrlShown __LaserDesignatorIGUI_LaserOn) ) then { + // TODO: hide distance + __LaserDesignatorIGUI_ACE_Distance ctrlSetText "----"; +} else { + __LaserDesignatorIGUI_ACE_Distance ctrlSetText (ctrlText __LaserDesignatorIGUI_CA_Distance); }; \ No newline at end of file diff --git a/addons/laser/script_component.hpp b/addons/laser/script_component.hpp index 6bd4063f4e..77369ead96 100644 --- a/addons/laser/script_component.hpp +++ b/addons/laser/script_component.hpp @@ -16,4 +16,7 @@ #define __LaserDesignatorIGUI (uiNamespace getVariable ["ACE_RscOptics_LaserDesignator", nil]) -#define __LaserDesignatorIGUI_LaserCode (__LaserDesignatorIGUI displayCtrl 123001) \ No newline at end of file +#define __LaserDesignatorIGUI_LaserCode (__LaserDesignatorIGUI displayCtrl 123001) +#define __LaserDesignatorIGUI_ACE_Distance (__LaserDesignatorIGUI displayCtrl 123002) +#define __LaserDesignatorIGUI_CA_Distance (__LaserDesignatorIGUI displayCtrl 151) +#define __LaserDesignatorIGUI_LaserOn (__LaserDesignatorIGUI displayCtrl 158) \ No newline at end of file