Only show distance if laser is on.

This commit is contained in:
jaynus 2015-04-14 16:57:01 -07:00
parent 934f2ce097
commit fb6553a7a7
3 changed files with 27 additions and 5 deletions

View File

@ -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;

View File

@ -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);
};

View File

@ -16,4 +16,7 @@
#define __LaserDesignatorIGUI (uiNamespace getVariable ["ACE_RscOptics_LaserDesignator", nil])
#define __LaserDesignatorIGUI_LaserCode (__LaserDesignatorIGUI displayCtrl 123001)
#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)