Merge remote-tracking branch 'origin/laserCodes' into guidanceHandoff

This commit is contained in:
jaynus 2015-04-16 09:40:47 -07:00
commit bce4f14cc8
11 changed files with 192 additions and 34 deletions

View File

@ -35,13 +35,6 @@ class RscInGameUI {
}; };
}; };
}; };
class RscOptics_LaserDesignator {
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscWeaponRangeFinderMAAWS { class RscWeaponRangeFinderMAAWS {
class CA_IGUI_elements_group: RscControlsGroup { class CA_IGUI_elements_group: RscControlsGroup {
class controls { class controls {

View File

@ -13,5 +13,6 @@ class CfgWeapons {
lockingTargetSound[] = {"",0,1}; lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1};
}; };
}; };

View File

@ -4,30 +4,17 @@ class CfgVehicles {
class LaserTarget: All { class LaserTarget: All {
// @TODO: Changing the model and simulation hides it, but THEN IT DOESNT SPAWN WTF!? // @TODO: Changing the model and simulation hides it, but THEN IT DOESNT SPAWN WTF!?
model = "\A3\Weapons_F\empty.p3d"; model = "\A3\Weapons_F\empty.p3d";
simulation = "nvmarker"; destrType = "DestructNo";
nvTarget = 1; simulation = "house";
//simulation = "laserTarget";
//threat[] = {0,0,0};
class EventHandlers { class EventHandlers {
init = QUOTE(_this call FUNC(laser_init)); init = QUOTE(_this call FUNC(laser_init));
}; };
diffuse[] = {0,0,0};
ambient[] = {0,0,0};
brightness = 0;
name = "pozicni blik";
drawLight = 0;
drawLightSize = 0;
drawLightCenterSize = 0;
activeLight = 0;
blinking = 0;
dayLight = 0;
onlyInNvg = 0;
useFlare = 0;
}; };
// Visual laserTarget override // Visual laserTarget override
class ACE_LaserTarget_Visual : LaserTarget { class ACE_LaserTarget_Visual : LaserTarget {
//model = "\A3\Weapons_f\laserTgt.p3d"; simulation = "LaserTarget";
model = "\A3\Weapons_f\laserTgt.p3d";
}; };
}; };

View File

@ -1 +1,144 @@
// TODO: RscOptics_LaserDesignator for laser code designation class RscControlsGroup;
class VScrollbar;
class HScrollbar;
class RscText;
class RscMapControl;
class RscInGameUI {
class RscOptics_LaserDesignator {
idd = 300;
controls[] = {"CA_IGUI_elements_group"};
onLoad = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',(_this select 0)];";
onUnload = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',nil];";
class CA_IGUI_elements_group: RscControlsGroup {
idc = 170;
x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))";
y = "0 * (0.025 * SafezoneH) + (SafezoneY)";
w = "53.5 * (0.01875 * SafezoneH)";
h = "40 * (0.025 * SafezoneH)";
class VScrollbar: VScrollbar {
width = 0;
};
class HScrollbar: HScrollbar {
height = 0;
};
class controls {
class CA_OpticsZoom: RscText {
idc = 180;
style = 1;
colorText[] = {0.706,0.0745,0.0196,1};
sizeEx = "0.038*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = "4.5";
x = "43.85 * (0.01875 * SafezoneH)";
y = "19.6 * (0.025 * SafezoneH)";
w = "4.5 * (0.01875 * SafezoneH)";
h = "1.1 * (0.025 * SafezoneH)";
};
class ACE_Distance: RscText {
idc = 123002;
style = 0;
sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0;
font = "EtelkaMonospacePro";
text = "2456";
x = "24.6 * (0.01875 * SafezoneH)";
y = "3 * (0.025 * SafezoneH)";
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;
sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0;
font = "EtelkaMonospacePro";
text = "80.5";
x = "32.7 * (0.01875 * SafezoneH)";
y = "3 * (0.025 * SafezoneH)";
w = "5 * (0.01875 * SafezoneH)";
h = "1.5 * (0.025 * SafezoneH)";
};
class CA_VisionMode: RscText {
idc = 179;
style = 0;
sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0;
font = "EtelkaMonospacePro";
text = "VIS";
x = "6.5 * (0.01875 * SafezoneH)";
y = "19.6 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.1 * (0.025 * SafezoneH)";
};
class CA_Laser: RscText {
idc = 158;
style = "0x30 + 0x800";
sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0;
font = "EtelkaMonospacePro";
text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa";
x = "29.2 * (0.01875 * SafezoneH)";
y = "3 * (0.025 * SafezoneH)";
w = "3.5 * (0.01875 * SafezoneH)";
h = "1.5 * (0.025 * SafezoneH)";
};
class CA_Heading: RscText {
idc = 156;
style = 0;
sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0;
font = "EtelkaMonospacePro";
text = "023";
x = "16.1 * (0.01875 * SafezoneH)";
y = "3 * (0.025 * SafezoneH)";
w = "3.5 * (0.01875 * SafezoneH)";
h = "1.6 * (0.025 * SafezoneH)";
};
class ACE_LaserCode_Helper : RscMapControl {
idc = -1;
onDraw = QUOTE(_this call FUNC(onLaserDesignatorDraw));
w = 0;
h = 0;
};
class ACE_LaserCode : RscText {
idc = 123001;
style = 0;
sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0;
font = "EtelkaMonospacePro";
text = "Code: 1001";
x = "32.7 * (0.01875 * SafezoneH)";
y = "35.5 * (0.025 * SafezoneH)";
w = "12 * (0.01875 * SafezoneH)";
h = "1.6 * (0.025 * SafezoneH)";
};
};
};
};
};

View File

@ -2,3 +2,4 @@
["laser_laserOn", {_this call DFUNC(handleLaserOn)}] call EFUNC(common,addEventHandler); ["laser_laserOn", {_this call DFUNC(handleLaserOn)}] call EFUNC(common,addEventHandler);
["laser_laserOff", {_this call DFUNC(handleLaserOff)}] call EFUNC(common,addEventHandler); ["laser_laserOff", {_this call DFUNC(handleLaserOff)}] call EFUNC(common,addEventHandler);

View File

@ -11,6 +11,8 @@ PREP(findStrongestRay);
PREP(translateToModelSpace); PREP(translateToModelSpace);
PREP(translateToWeaponSpace); PREP(translateToWeaponSpace);
PREP(onLaserDesignatorDraw);
PREP(seekerFindLaserSpot); PREP(seekerFindLaserSpot);
PREP(laserOn); PREP(laserOn);
PREP(laserOff); PREP(laserOff);

View File

@ -13,3 +13,4 @@ class CfgPatches {
#include "CfgEventhandlers.hpp" #include "CfgEventhandlers.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"
#include "RscInGameUI.hpp"

View File

@ -1 +1,9 @@
// @TODO: This is to draw the actual LaserTarget positions to utilize for laser shooting. // This is a debug function for displaying visible lasers for ourselves
#include "script_component.hpp"
diag_log text format["[ACE]: Laser Emitter Dump"];
{
diag_log text format[" %1", _x];
diag_log text format[" %2", HASH_GET(GVAR(laserEmitters), _x)];
} forEach GVAR(laserEmitters) select 0;

View File

@ -0,0 +1,15 @@
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
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

@ -13,3 +13,10 @@
#define FIREMODE_DIRECT_LOAL 1 #define FIREMODE_DIRECT_LOAL 1
#define __LaserDesignatorIGUI (uiNamespace getVariable ["ACE_RscOptics_LaserDesignator", nil])
#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)

View File

@ -43,8 +43,8 @@ FUNC(laserHudDesignatePFH) = {
_turretInfo = [_vehicle, _gunnerInfo select 1] call EFUNC(common,getTurretDirection); _turretInfo = [_vehicle, _gunnerInfo select 1] call EFUNC(common,getTurretDirection);
_povPos = _turretInfo select 0; _povPos = _turretInfo select 0;
_laserCode = (vehicle ACE_player) getVariable[QGVAR(currentCode), ACE_DEFAULT_LASER_CODE]; _laserCode = (vehicle ACE_player) getVariable["ace_laser_code", ACE_DEFAULT_LASER_CODE];
_waveLength = (vehicle ACE_player) getVariable[QGVAR(currentWaveLength), ACE_DEFAULT_LASER_WAVELENGTH]; _waveLength = (vehicle ACE_player) getVariable["ace_laser_waveLength", ACE_DEFAULT_LASER_WAVELENGTH];
_laserResult = [_povPos, [_waveLength,_waveLength], _laserCode] call EFUNC(laser,seekerFindLaserSpot); _laserResult = [_povPos, [_waveLength,_waveLength], _laserCode] call EFUNC(laser,seekerFindLaserSpot);
@ -73,9 +73,9 @@ if(!GVAR(active)) then {
TRACE_1("Activating laser", ""); TRACE_1("Activating laser", "");
// Get the self-designation variables, or use defaults // Get the self-designation variables, or use defaults
_laserCode = (vehicle ACE_player) getVariable[QGVAR(currentCode), ACE_DEFAULT_LASER_CODE]; _laserCode = (vehicle ACE_player) getVariable["ace_laser_code", ACE_DEFAULT_LASER_CODE];
_waveLength = (vehicle ACE_player) getVariable[QGVAR(currentWaveLength), ACE_DEFAULT_LASER_WAVELENGTH]; _waveLength = (vehicle ACE_player) getVariable["ace_laser_waveLength", ACE_DEFAULT_LASER_WAVELENGTH];
_beamSpread = (vehicle ACE_player) getVariable[QGVAR(currentBeamSpread), ACE_DEFAULT_LASER_BEAMSPREAD]; _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); _laserUuid = [(vehicle ACE_player), ACE_player, QFUNC(findLaserSource), _waveLength, _laserCode, _beamSpread] call EFUNC(laser,laserOn);