From 2ec74a6a3e07935cc8eddd6c50a52b84546394c5 Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 16:20:03 -0700 Subject: [PATCH] align correctly, create event, remove FCS from laserDesignator. --- addons/fcs/CfgOptics.hpp | 7 ------- addons/javelin/CfgWeapons.hpp | 1 + addons/laser/CfgVehicles.hpp | 1 + addons/laser/RscInGameUI.hpp | 13 ++++++++++++- addons/laser/XEH_pre_init.sqf | 2 ++ .../laser/functions/fnc_onLaserDesignatorDraw.sqf | 5 +++++ addons/laser/script_component.hpp | 6 +++++- 7 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 addons/laser/functions/fnc_onLaserDesignatorDraw.sqf diff --git a/addons/fcs/CfgOptics.hpp b/addons/fcs/CfgOptics.hpp index c9704081f9..91f83dd6f6 100644 --- a/addons/fcs/CfgOptics.hpp +++ b/addons/fcs/CfgOptics.hpp @@ -35,13 +35,6 @@ class RscInGameUI { }; }; }; - class RscOptics_LaserDesignator { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; class RscWeaponRangeFinderMAAWS { class CA_IGUI_elements_group: RscControlsGroup { class controls { diff --git a/addons/javelin/CfgWeapons.hpp b/addons/javelin/CfgWeapons.hpp index cef967e32e..8573218048 100644 --- a/addons/javelin/CfgWeapons.hpp +++ b/addons/javelin/CfgWeapons.hpp @@ -10,5 +10,6 @@ class CfgWeapons { lockingTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1}; + }; }; \ No newline at end of file diff --git a/addons/laser/CfgVehicles.hpp b/addons/laser/CfgVehicles.hpp index 361f3e1867..1e83f66cc9 100644 --- a/addons/laser/CfgVehicles.hpp +++ b/addons/laser/CfgVehicles.hpp @@ -4,6 +4,7 @@ class CfgVehicles { class LaserTarget: All { // @TODO: Changing the model and simulation hides it, but THEN IT DOESNT SPAWN WTF!? model = "\A3\Weapons_F\empty.p3d"; + destrType = "DestructNo"; simulation = "house"; class EventHandlers { diff --git a/addons/laser/RscInGameUI.hpp b/addons/laser/RscInGameUI.hpp index 366d779fde..770c2104b6 100644 --- a/addons/laser/RscInGameUI.hpp +++ b/addons/laser/RscInGameUI.hpp @@ -2,12 +2,17 @@ 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; @@ -43,7 +48,7 @@ class RscInGameUI { shadow = 0; font = "EtelkaMonospacePro"; text = "2456"; - x = "24.5 * (0.01875 * SafezoneH)"; + x = "24.6 * (0.01875 * SafezoneH)"; y = "3 * (0.025 * SafezoneH)"; w = "4 * (0.01875 * SafezoneH)"; h = "1.5 * (0.025 * SafezoneH)"; @@ -101,6 +106,12 @@ class RscInGameUI { 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; diff --git a/addons/laser/XEH_pre_init.sqf b/addons/laser/XEH_pre_init.sqf index e160a533f2..de56274759 100644 --- a/addons/laser/XEH_pre_init.sqf +++ b/addons/laser/XEH_pre_init.sqf @@ -11,6 +11,8 @@ PREP(findStrongestRay); PREP(translateToModelSpace); PREP(translateToWeaponSpace); +PREP(onLaserDesignatorDraw); + PREP(seekerFindLaserSpot); PREP(laserOn); PREP(laserOff); diff --git a/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf new file mode 100644 index 0000000000..3f756443fa --- /dev/null +++ b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf @@ -0,0 +1,5 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" + + +TRACE_1("", _this); \ No newline at end of file diff --git a/addons/laser/script_component.hpp b/addons/laser/script_component.hpp index 2be1e9e14b..6bd4063f4e 100644 --- a/addons/laser/script_component.hpp +++ b/addons/laser/script_component.hpp @@ -12,4 +12,8 @@ #include "\z\ace\Addons\main\script_macros.hpp" -#define FIREMODE_DIRECT_LOAL 1 \ No newline at end of file +#define FIREMODE_DIRECT_LOAL 1 + + +#define __LaserDesignatorIGUI (uiNamespace getVariable ["ACE_RscOptics_LaserDesignator", nil]) +#define __LaserDesignatorIGUI_LaserCode (__LaserDesignatorIGUI displayCtrl 123001) \ No newline at end of file