RDF - Initial

This commit is contained in:
PabstMirror 2019-08-26 23:34:11 -05:00
parent 4204205908
commit e3bedbbfc3
38 changed files with 1334 additions and 0 deletions

View File

@ -0,0 +1 @@
z\ace\addons\radiodirectionfinder

View File

@ -0,0 +1,15 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart));
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -0,0 +1,63 @@
class CBA_Extended_EventHandlers;
class CfgVehicles {
// Backpack device
class Bag_Base;
class GVAR(backpack): Bag_Base {
scope = 2;
displayName = "PRD-13 Radio Direction Finder";
author = "PabstMirror";
model = "z\ace\addons\radiodirectionfinder\data\ace_antennaBackpack";
maximumLoad = 50;
mass = 100;
};
// Device:
class Items_base_F;
class ACE_transmitter_base: Items_base_F {
class EventHandlers {
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
};
author = ECSTRING(common,aceteam);
model = "\A3\Structures_F\Items\Tools\MultiMeter_F.p3d";
scope = 1;
};
class ACE_transmitter_406MHz: ACE_transmitter_base {
displayName = "Transmitter 406MHz";
GVAR(freq) = 406;
GVAR(power) = 5000;
};
// Self interactions
class Man;
class CAManBase: Man {
class ACE_SelfActions {
class ACE_Equipment {
class GVAR(open) {
//Opens the dialog
// displayName = CSTRING(configure);
displayName = "open";
condition = QUOTE(_player call FUNC(displayCondition));
statement = QUOTE([DISPLAY_MODE_DIALOG] call FUNC(toggleDisplayMode));
// icon = QPATHTOF(UI\icon_android.paa);
exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"};
class GVAR(show) {
//Opens the mini map
// displayName = CSTRING(show);
displayName = "Show";
condition = QUOTE(GVAR(currentShowMode) != DISPLAY_MODE_DISPLAY);
statement = QUOTE([DISPLAY_MODE_DISPLAY] call FUNC(toggleDisplayMode));
exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"};
};
class GVAR(close) {
// displayName = CSTRING(closeUnit);
displayName = "Close";
condition = QUOTE(GVAR(currentShowMode) != DISPLAY_MODE_CLOSED);
statement = QUOTE([DISPLAY_MODE_CLOSED] call FUNC(toggleDisplayMode));
exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"};
};
};
};
};
};
};

View File

@ -0,0 +1,20 @@
class CfgWeapons {
class ACE_ItemCore;
class CBA_MiscItem_ItemInfo;
class ACE_TransmitterItem_406MHz: ACE_ItemCore {
ACE_attachable = "ACE_transmitter_406MHz";
author = ECSTRING(common,ACETeam);
scope = 2;
// displayName = CSTRING(IrStrobe_Name);
displayName = "406MHz Locator Bacon";
// descriptionShort = CSTRING(IrStrobe_Description);
// model = QPATHTOF(data\x.p3d);
model = "\A3\Structures_F\Items\Tools\MultiMeter_F.p3d";
// picture = QPATHTOF(UI\irstrobe_item.paa);
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 1;
};
};
};

View File

@ -0,0 +1,149 @@
class RscObject;
class RscText;
class RscControlsGroupNoScrollbars;
class RscButton;
class GVAR(menuButton): RscButton {
colorText[] = {0.7,0.7,0.7,1};
colorDisabled[] = {0,0,0,0};
colorBackground[] = {0,0,0,0};
colorBackgroundDisabled[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
colorFocused[] = {0,0,0,0};
colorShadow[] = {0,0,0,0};
colorBorder[] = {0.5,0.5,0.5,1};
sizeEx = 0.05;
shadow = 0;
};
class RscStructuredText;
class GVAR(structuredText): RscStructuredText {
colorText[] = {0.7,0.7,0.7,1};
size = 0.05;
shadow = 0;
};
class GVAR(text5): RscText {
colorText[] = {0.7,0.7,0.7,1};
sizeEx = 0.05;
shadow = 0;
};
class GVAR(text5right): GVAR(text5) {
style = 1;
};
class GVAR(text15): GVAR(text5) {
sizeEx = 0.15;
};
class RscListBox;
class GVAR(listBox): RscListBox {
sizeEx = 0.05;
arrowEmpty = "#(argb,8,8,3)color(0.7,0.7,0.7,1)";
arrowFull = "#(argb,8,8,3)color(0.7,0.7,0.7,1)";
colorText[] = {0.7,0.7,0.7,1};
colorTextRight[] = {0.7,0.7,0.7,1};
};
class GVAR(dialog) {
idd = -1;
movingEnable = 1;
duration = 9999999;
fadein = 0;
fadeout = 0;
onLoad = QUOTE(with uiNamespace do {GVAR(dialog) = _this select 0;};);
// onUnload = QUOTE(call FUNC());
class objects {
class GVAR(MapGpsDisplay): RscObject {
// show = 0;
idc = IDC_OBJECT_SCREEN;
type = 82;
model = QPATHTOF(data\ace_handheldDeviceDisplay.p3d);
// useGlobalLight = 1;
// minGlobalLightIntensity = -100;
/*
1.000 - normal model
memory - has 4 points in selection "deviceScreen" and then those 4 as individual "deviceScreen tl", "deviceScreen br", "deviceScreen b'", "deviceScreen br"
geometry - has a simpe box with a name selection component01 (needed to make it dragable)
*/
scale = 0.333;
direction[] = {0,1,0};
up[] = {0,0,-1};
x = 0.9;
y = 0.9;
z = 0.2;
xBack = 0.9;
yBack = 0.9;
zBack = 0.3;
inBack = 1;
enableZoom = 1;
zoomDuration = 0.001;
class Areas {
class deviceScreen {
selection = "deviceScreen";
class controls {
class test: RscControlsGroupNoScrollbars {
idc = IDC_SCREEN_GROUP;
x = 0;
y = 0;
w = 1;
h = 1;
};
};
};
};
};
};
};
class RscTitles {
class GVAR(display) {
idd = -1;
movingEnable = 1;
duration = 9999999;
fadein = 0;
fadeout = 0;
onLoad = QUOTE(with uiNamespace do {GVAR(display) = _this select 0;};);
class controls {};
class objects {
class GVAR(MapGpsDisplay): RscObject {
// show = 0;
idc = IDC_OBJECT_SCREEN;
type = 82;
model = QPATHTOF(data\ace_handheldDeviceDisplay.p3d);
// useGlobalLight = 1;
// minGlobalLightIntensity = -100;
/*
1.000 - normal model
memory - has 4 points in selection "deviceScreen" and then those 4 as individual "deviceScreen tl", "deviceScreen br", "deviceScreen b'", "deviceScreen br"
geometry - has a simpe box with a name selection component01 (needed to make it dragable)
*/
scale = 0.333;
direction[] = {0,1,0};
up[] = {0,0,-1};
x = 0.9;
y = 0.9;
z = 0.2;
xBack = 0.9;
yBack = 0.9;
zBack = 0.3;
inBack = 1;
enableZoom = 1;
zoomDuration = 0.001;
class Areas {
class deviceScreen {
selection = "deviceScreen";
class controls {
class test: RscControlsGroupNoScrollbars {
idc = IDC_SCREEN_GROUP;
x = 0;
y = 0;
w = 1;
h = 1;
};
};
};
};
};
};
};
};

View File

@ -0,0 +1,14 @@
ace_
==========
Introducing the ability to
#### Items Added:
``
## Maintainers
The people responsible for merging changes to this component or answering potential questions.
- [PabstMirror](https://github.com/PabstMirror)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,14 @@
LOG("prep");
PREP(addSignal);
PREP(beaconCleanup);
PREP(beaconInit);
PREP(createGUI);
PREP(displayCondition);
PREP(getSignals);
PREP(getSignalsACRE);
PREP(getSignalsScripted);
PREP(getSignalsUAV);
PREP(toggleDisplayMode);
PREP(updateDisplayAnim);
PREP(updatePFEH);

View File

@ -0,0 +1,39 @@
#include "script_component.hpp"
// debug
["Q", "Q", "Q", {
systemChat "Q RECOMPILE";
[] call ACE_PREP_RECOMPILE;
[-1] call FUNC(toggleDisplayMode);
false
}, {false}, [0x10, [false, false, false]], false] call CBA_fnc_addKeybind; // Q Key
if (isServer) then {
["ACE_transmitter_base", "init", FUNC(beaconInit), true, [], true] call CBA_fnc_addClassEventHandler;
[QGVAR(getUavFreq), {
params ["_uav"];
if (!isNil {_uav getVariable QGVAR(freqMhz)}) exitWith {TRACE_1("getUavFreq - already set",_uav);};
private _randomFreq = 1675 + floor random 250;
TRACE_2("getUavFreq eh",_uav,_randomFreq);
_uav setVariable [QGVAR(freqMhz), _randomFreq, true];
}] call CBA_fnc_addEventHandler;
};
if (!hasInterface) exitWith {};
GVAR(currentShowMode) = 0;
// Add deviceKey entry:
private _conditonCode = {
[ACE_player] call FUNC(displayCondition)
};
private _toggleCode = {
if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {};
[] call FUNC(toggleDisplayMode); //toggle display mode
};
private _closeCode = {
if (GVAR(currentShowMode) == DISPLAY_MODE_CLOSED) exitWith {};
[DISPLAY_MODE_CLOSED] call FUNC(toggleDisplayMode);
};
// [(localize LSTRING(itemName)), QPATHTOF(images\x_item.paa), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew);
["RDF", "", _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew);

View File

@ -0,0 +1,13 @@
#include "script_component.hpp"
ADDON = false;
PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
// Semi-public var:
GVAR(signalSourceFuncs) = [FUNC(getSignalsScripted), FUNC(getSignalsUAV)];
if (isClass (configFile >> "CfgPatches" >> "acre_sys_core")) then { GVAR(signalSourceFuncs) pushBack FUNC(getSignalsACRE); };
ADDON = true;

View File

@ -0,0 +1,3 @@
#include "script_component.hpp"
#include "XEH_PREP.hpp"

View File

@ -0,0 +1,20 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {"ACE_TransmitterItem_406MHz"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
author = ECSTRING(common,ACETeam);
authors[] = {"PabstMirror"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"
#include "GUI.hpp"

View File

@ -0,0 +1,90 @@
class StageTI
{
texture="#(argb,8,8,3)color(0,0,0,0)";
};
ambient[]={1,1,1,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,1};
emmisive[]={0,0,0,1};
specular[]={0.67843139,0.67843139,0.67843139,0};
specularPower=52;
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1
{
texture="z\ace\addons\radiodirectionfinder\data\us_assault_coyote_nohq.paa";
uvSource="tex";
class uvTransform
{
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage2
{
texture="#(argb,8,8,3)color(0.5,0.5,0.5,0.5,DT)";
uvSource="tex";
class uvTransform
{
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage3
{
texture="#(argb,8,8,3)color(0,0,0,0,MC)";
uvSource="tex";
class uvTransform
{
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage4
{
texture="#(argb,8,8,3)color(1,1,1,1,AS)";
uvSource="tex";
class uvTransform
{
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage5
{
texture="z\ace\addons\radiodirectionfinder\data\us_assault_coyote_smdi.paa";
uvSource="tex";
class uvTransform
{
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage6
{
texture="#(ai,32,64,1)fresnel(1.68,0.5)";
uvSource="none";
Filter="Anizotropic";
};
class Stage7
{
texture="a3\data_f\env_land_co.paa";
uvSource="tex";
class uvTransform
{
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};

View File

@ -0,0 +1 @@
part of backpack and textures from ca\weapons_e\AmmoBoxes

View File

@ -0,0 +1,165 @@
class CfgSkeletons
{
class Default
{
isDiscrete = 1;
skeletonInherit = "";
skeletonBones[] = {};
};
class OFP2_ManSkeleton
{
isDiscrete = 0;
skeletonInherit = "";
skeletonBones[] =
{
"Pelvis","",
"Spine","Pelvis",
"Spine1","Spine",
"Spine2","Spine1",
"Spine3","Spine2",
"Camera","Pelvis",
"weapon","Spine1",
"launcher","Spine1",
// Head skeleton in hierarchy
"neck","Spine3",
"neck1","neck",
"head","neck1",
// New facial features
"Face_Hub","head",
"Face_Jawbone","Face_Hub",
"Face_Jowl","Face_Jawbone",
"Face_chopRight","Face_Jawbone",
"Face_chopLeft","Face_Jawbone",
"Face_LipLowerMiddle","Face_Jawbone",
"Face_LipLowerLeft","Face_Jawbone",
"Face_LipLowerRight","Face_Jawbone",
"Face_Chin","Face_Jawbone",
"Face_Tongue","Face_Jawbone",
"Face_CornerRight","Face_Hub",
"Face_CheekSideRight","Face_CornerRight",
"Face_CornerLeft","Face_Hub",
"Face_CheekSideLeft","Face_CornerLeft",
"Face_CheekFrontRight","Face_Hub",
"Face_CheekFrontLeft","Face_Hub",
"Face_CheekUpperRight","Face_Hub",
"Face_CheekUpperLeft","Face_Hub",
"Face_LipUpperMiddle","Face_Hub",
"Face_LipUpperRight","Face_Hub",
"Face_LipUpperLeft","Face_Hub",
"Face_NostrilRight","Face_Hub",
"Face_NostrilLeft","Face_Hub",
"Face_Forehead","Face_Hub",
"Face_BrowFrontRight","Face_Forehead",
"Face_BrowFrontLeft","Face_Forehead",
"Face_BrowMiddle","Face_Forehead",
"Face_BrowSideRight","Face_Forehead",
"Face_BrowSideLeft","Face_Forehead",
"Face_Eyelids","Face_Hub",
"Face_EyelidUpperRight","Face_Hub",
"Face_EyelidUpperLeft","Face_Hub",
"Face_EyelidLowerRight","Face_Hub",
"Face_EyelidLowerLeft","Face_Hub",
"EyeLeft","Face_Hub",
"EyeRight","Face_Hub",
// Left upper side
"LeftShoulder","Spine3",
"LeftArm","LeftShoulder",
"LeftArmRoll","LeftArm",
"LeftForeArm","LeftArmRoll",
"LeftForeArmRoll","LeftForeArm",
"LeftHand","LeftForeArmRoll",
"LeftHandRing","LeftHand",
"LeftHandRing1","LeftHandRing",
"LeftHandRing2","LeftHandRing1",
"LeftHandRing3","LeftHandRing2",
"LeftHandPinky1","LeftHandRing",
"LeftHandPinky2","LeftHandPinky1",
"LeftHandPinky3","LeftHandPinky2",
"LeftHandMiddle1","LeftHand",
"LeftHandMiddle2","LeftHandMiddle1",
"LeftHandMiddle3","LeftHandMiddle2",
"LeftHandIndex1","LeftHand",
"LeftHandIndex2","LeftHandIndex1",
"LeftHandIndex3","LeftHandIndex2",
"LeftHandThumb1","LeftHand",
"LeftHandThumb2","LeftHandThumb1",
"LeftHandThumb3","LeftHandThumb2",
// Right upper side
"RightShoulder","Spine3",
"RightArm","RightShoulder",
"RightArmRoll","RightArm",
"RightForeArm","RightArmRoll",
"RightForeArmRoll","RightForeArm",
"RightHand","RightForeArmRoll",
"RightHandRing","RightHand",
"RightHandRing1","RightHandRing",
"RightHandRing2","RightHandRing1",
"RightHandRing3","RightHandRing2",
"RightHandPinky1","RightHandRing",
"RightHandPinky2","RightHandPinky1",
"RightHandPinky3","RightHandPinky2",
"RightHandMiddle1","RightHand",
"RightHandMiddle2","RightHandMiddle1",
"RightHandMiddle3","RightHandMiddle2",
"RightHandIndex1","RightHand",
"RightHandIndex2","RightHandIndex1",
"RightHandIndex3","RightHandIndex2",
"RightHandThumb1","RightHand",
"RightHandThumb2","RightHandThumb1",
"RightHandThumb3","RightHandThumb2",
// Left lower side
"LeftUpLeg","Pelvis",
"LeftUpLegRoll","LeftUpLeg",
"LeftLeg","LeftUpLegRoll",
"LeftLegRoll","LeftLeg",
"LeftFoot","LeftLegRoll",
"LeftToeBase","LeftFoot",
// Right lower side
"RightUpLeg","Pelvis",
"RightUpLegRoll","RightUpLeg",
"RightLeg","RightUpLegRoll",
"RightLegRoll","RightLeg",
"RightFoot","RightLegRoll",
"RightToeBase","RightFoot"
};
// location of pivot points (local axes) for hierarchical animation
pivotsModel="A3\anims_f\data\skeleton\SkeletonPivots.p3d";
};
};
class CfgModels
{
class Default
{
sectionsInherit="";
sections[] = {};
skeletonName = "";
};
class ArmaMan: Default
{
htMin = 60; // Minimum half-cooling time (in seconds)
htMax = 1800; // Maximum half-cooling time (in seconds)
afMax = 30; // Maximum temperature in case the model is alive (in celsius)
mfMax = 0; // Maximum temperature when the model is moving (in celsius)
mFact = 1; // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)).
tBody = 37; // Metabolism temperature of the model (in celsius)
sections[] =
{
"osobnost","Head_Injury","Body_Injury","l_leg_injury","l_arm_injury","r_arm_injury","r_leg_injury", "injury_body", "injury_legs", "injury_hands",
"clan","clan_sign","Camo","CamoB","Camo1","Camo2","personality","hl", "injury_head", "insignia", "ghillie_hide"
};
skeletonName = "OFP2_ManSkeleton";
};
class ace_antennaBackpack: ArmaMan {
sections[] = {};
};
};

Binary file not shown.

View File

@ -0,0 +1,25 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
*
*
* Arguments:
* 0:
*
* Return Value:
* None
*
* Example:
* [] call ace_radiodirectionfinder_fnc_addSignal
*
* Public: No
*/
if (!isServer) exitWith {};
params [["_object", objNull, [objNull, []]], ["_freqMHz", 0, [0]], ["_powerMW", 0, [0]]];
TRACE_3("addSignal",_object,_freqMHz,_powerMW);
private _list = missionNamespace getVariable [QGVAR(signalList), []];
_list pushBack [_object, _freqMHz, _powerMW];
missionNamespace setVariable [QGVAR(signalList), _list, true];

View File

@ -0,0 +1,35 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
*
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_radiodirectionfinder_fnc_beaconCleanup
*
* Public: No
*/
TRACE_1("beaconCleanup",_this);
[{
private _removed = false;
private _list = missionNamespace getVariable [QGVAR(signalList), []];
_list = _list select {
_x params ["_obj"];
if ((_obj isEqualType []) || {alive _obj} || {!isNull _obj && {!(_obj isKindOf "ACE_transmitter_base")}}) then {
true
} else {
_removed = true;
false
};
};
TRACE_1("",_removed);
if (!_removed) exitWith {};
missionNamespace setVariable [QGVAR(signalList), _list, true];
}, []] call CBA_fnc_execNextFrame;

View File

@ -0,0 +1,29 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
* (Server Only)
*
* Arguments:
* 0: Beacon <OBJECT>
*
* Return Value:
* None
*
* Example:
* [] call ace_radiodirectionfinder_fnc_beaconInit
*
* Public: No
*/
params ["_beacon"];
if (!alive _beacon) exitWith { TRACE_1("dead",_this); };
private _typeOf = typeOf _beacon;
private _freqMHz = getNumber (configFile >> "CfgVehicles" >> QGVAR(freq));
private _powerMW = getNumber (configFile >> "CfgVehicles" >> QGVAR(power));
TRACE_4("beaconInit - new",_beacon,_typeOf,_freqMHz,_powerMW);
[_beacon, 444, 55] call FUNC(addSignal);
_beacon addEventHandler ["Killed", {call FUNC(beaconCleanup)}];
_beacon addEventHandler ["Deleted", {call FUNC(beaconCleanup)}];

View File

@ -0,0 +1,164 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
*
*
* Arguments:
* 0: Display <DISPLAY>
*
* Return Value:
* None
*
* Example:
* [] call ace_attach_fnc_createGUI
*
* Public: No
*/
params ["_display"];
TRACE_1("createGUI",_display);
private _ctrlScreenGroup = _display displayCtrl IDC_SCREEN_GROUP;
// Common:
private _ctrlBackground = _display ctrlCreate ["RscPicture", -1, _ctrlScreenGroup];
_ctrlBackground ctrlSetText "#(argb,8,8,3)color(0.1,0.1,0.1,1)";
_ctrlBackground ctrlSetPosition [0,0,1,1];
_ctrlBackground ctrlCommit 0;
private _ctrlTime = _display ctrlCreate [QGVAR(text5right), IDC_CLOCK_TEXT, _ctrlScreenGroup];
_ctrlTime ctrlSetPosition [0.75,0,0.25,0.05];
_ctrlTime ctrlCommit 0;
private _fnc_menuButton = {
TRACE_1("menu button",backpackContainer ace_player);
(backpackContainer ace_player) setVariable [QGVAR(currentMode), ctrlIDC (_this select 0)];
GVAR(nextGuiUpate) = -1;
};
private _ctrlMenuBackground1 = _display ctrlCreate ["RscPicture", IDC_MENU_BG1, _ctrlScreenGroup];
_ctrlMenuBackground1 ctrlSetPosition [0.01,0,0.23,0.05];
_ctrlMenuBackground1 ctrlCommit 0;
private _ctrlMenuButton1 = _display ctrlCreate [QGVAR(menuButton), IDC_MENU_BUTTON1, _ctrlScreenGroup];
_ctrlMenuButton1 ctrlSetText "Scan";
_ctrlMenuButton1 ctrlAddEventHandler ["ButtonClick", _fnc_menuButton];
_ctrlMenuButton1 ctrlSetPosition [0,0,0.25,0.05];
_ctrlMenuButton1 ctrlCommit 0;
private _ctrlMenuBackground2 = _display ctrlCreate ["RscPicture", IDC_MENU_BG2, _ctrlScreenGroup];
_ctrlMenuBackground2 ctrlSetPosition [0.26,0,0.23,0.05];
_ctrlMenuBackground2 ctrlCommit 0;
private _ctrlMenuButton2 = _display ctrlCreate [QGVAR(menuButton), IDC_MENU_BUTTON2, _ctrlScreenGroup];
_ctrlMenuButton2 ctrlSetText "Frequency Selection";
_ctrlMenuButton2 ctrlAddEventHandler ["ButtonClick", _fnc_menuButton];
_ctrlMenuButton2 ctrlSetPosition [0.25,0,0.25,0.05];
_ctrlMenuButton2 ctrlCommit 0;
private _ctrlMenuBackground3 = _display ctrlCreate ["RscPicture", IDC_MENU_BG3, _ctrlScreenGroup];
_ctrlMenuBackground3 ctrlSetPosition [0.51,0,0.23,0.05];
_ctrlMenuBackground3 ctrlCommit 0;
private _ctrlMenuButton3 = _display ctrlCreate [QGVAR(menuButton), IDC_MENU_BUTTON3, _ctrlScreenGroup];
_ctrlMenuButton3 ctrlSetText "Signal List";
_ctrlMenuButton3 ctrlAddEventHandler ["ButtonClick", _fnc_menuButton];
_ctrlMenuButton3 ctrlSetPosition [0.5,0,0.25,0.05];
_ctrlMenuButton3 ctrlCommit 0;
// Mode 1:
private _ctrlModeGroup1 = _display ctrlCreate ["RscControlsGroupNoScrollbars", IDC_MODE1_GROUP, _ctrlScreenGroup];
_ctrlModeGroup1 ctrlSetPosition [0,0.05,1,0.95];
_ctrlModeGroup1 ctrlCommit 0;
private _circleY = 0;
private _circleH = 0.861-.05; // Magic number from aspect ratio of p3d mem points
private _circleW = 3/4 * _circleH;
private _circleX = 1 - _circleW;
private _ctrlCircleBase = _display ctrlCreate ["RscPicture", -1, _ctrlModeGroup1];
// _ctrlCircleBase ctrlSetTextColor [0.5, 0.5, 0.5, 1];
_ctrlCircleBase ctrlSetText QPATHTOF(UI\base_ca.paa);
_ctrlCircleBase ctrlSetTextColor [0.75, 0.75, 0.75, 1];
_ctrlCircleBase ctrlSetPosition [_circleX,_circleY,_circleW,_circleH];
_ctrlCircleBase ctrlCommit 0;
private _ctrlCircleDot = _display ctrlCreate ["RscPicture", IDC_MODE1_CIRCLE_DOT, _ctrlModeGroup1];
_ctrlCircleDot ctrlSetText QPATHTOF(UI\dot_ca.paa);
_ctrlCircleDot ctrlSetPosition [_circleX,_circleY,_circleW,_circleH];
_ctrlCircleDot ctrlCommit 0;
private _ctrlCircleArrow = _display ctrlCreate ["RscPicture", IDC_MODE1_CIRCLE_ARROW, _ctrlModeGroup1];
_ctrlCircleArrow ctrlSetText QPATHTOF(UI\arrow_ca.paa);
_ctrlCircleArrow ctrlSetTextColor [0.75, 0.75, 0.75, 1];
_ctrlCircleArrow ctrlSetPosition [_circleX,_circleY,_circleW,_circleH];
_ctrlCircleArrow ctrlCommit 0;
private _lines = [];
for "_i" from 0 to 9 do {
private _ctrlLine = _display ctrlCreate ["RscPicture", -1, _ctrlModeGroup1];
_ctrlLine ctrlSetText QPATHTOF(UI\line_ca.paa);
_ctrlLine ctrlSetTextColor [0.75, 0.75, 0.75, 1];
_ctrlLine ctrlSetPosition [_circleX,_circleY,_circleW,_circleH];
_ctrlLine ctrlCommit 0;
_lines pushBack _ctrlLine;
};
_display setVariable [QGVAR(lines), _lines];
private _ctrlText = _display ctrlCreate [QGVAR(structuredText), IDC_MODE1_SCAN_INFO_TEXT, _ctrlModeGroup1];
_ctrlText ctrlSetPosition [0,_circleY+_circleH/4,1-_circleW,_circleH/2];
_ctrlText ctrlCommit 0;
// _ctrlText ctrlSetBackgroundColor [0.1,0.1,0.1,0.5];
// Mode 2:
private _ctrlModeGroup2 = _display ctrlCreate ["RscControlsGroupNoScrollbars", IDC_MODE2_GROUP, _ctrlScreenGroup];
_ctrlModeGroup2 ctrlSetPosition [0,0.05,1,0.95];
_ctrlModeGroup2 ctrlCommit 0;
private _ctrlFreqSelectionText = _display ctrlCreate [QGVAR(structuredText), IDC_MODE2_FREQ_TEXT, _ctrlModeGroup2];
_ctrlFreqSelectionText ctrlSetPosition [0.05,0.05,0.9,0.2];
_ctrlFreqSelectionText ctrlCommit 0;
private _currentTargetFreq = (backpackContainer ace_player) getVariable [QGVAR(targetFreq), 0]; // Get Current Value
private _ctrlSlider = _display ctrlCreate ["ctrlXSliderH", IDC_MODE2_FREQ_SLIDER, _ctrlModeGroup2];
_ctrlSlider sliderSetRange [0, 3000];
_ctrlSlider sliderSetSpeed [10, 3];
_ctrlSlider sliderSetPosition _currentTargetFreq;
_ctrlSlider ctrlAddEventHandler ["SliderPosChanged", {
params ["_ctrlSlider", "_sliderPos"];
_sliderPos = ((10 * (round (_sliderPos / 10))) min 3000) max 0;
_ctrlSlider sliderSetPosition _sliderPos;
(backpackContainer ace_player) setVariable [QGVAR(targetFreq), _sliderPos];
GVAR(nextGuiUpate) = -1;
TRACE_1("setting targetFreq",_sliderPos);
}];
_ctrlSlider ctrlSetPosition [0,0.275,1, 0.1];
_ctrlSlider ctrlCommit 0;
private _ctrlResetBackground = _display ctrlCreate ["RscPicture", IDC_MODE2_RESET_BACKGROUND, _ctrlModeGroup2];
_ctrlResetBackground ctrlSetPosition [0.75,0.45,0.2,0.1];
_ctrlResetBackground ctrlCommit 0;
private _ctrlResetButton = _display ctrlCreate [QGVAR(menuButton), -1, _ctrlModeGroup2];
_ctrlResetButton ctrlAddEventHandler ["ButtonClick", {
private _ctrlSlider = (ctrlParent (_this select 0)) displayCtrl IDC_MODE2_FREQ_SLIDER;
_ctrlSlider sliderSetPosition 0;
(backpackContainer ace_player) setVariable [QGVAR(targetFreq), 0];
GVAR(nextGuiUpate) = -1;
TRACE_1("clearing targetFreq",0);
}];
_ctrlResetButton ctrlSetText "Remove Filter";
_ctrlResetButton ctrlSetPosition [0.75,0.45,0.2,0.1];
_ctrlResetButton ctrlCommit 0;
private _ctrlSignalCount = _display ctrlCreate [QGVAR(text15), IDC_MODE2_SIGNAL_COUNT, _ctrlModeGroup2];
_ctrlSignalCount ctrlSetPosition [0.05,0.45,0.7,0.1];
_ctrlSignalCount ctrlCommit 0;
// Mode 3:
private _ctrlModeGroup3 = _display ctrlCreate ["RscControlsGroupNoScrollbars", IDC_MODE3_GROUP, _ctrlScreenGroup];
_ctrlModeGroup3 ctrlSetPosition [0,0.05,1,0.95];
_ctrlModeGroup3 ctrlCommit 0;
private _ctrlSignalList = _display ctrlCreate ["RscListBox", IDC_MODE3_LIST, _ctrlModeGroup3];
_ctrlSignalList ctrlSetPosition [0,0,1,_circleH];
_ctrlSignalList ctrlCommit 0;

View File

@ -0,0 +1,21 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
*
*
* Arguments:
* 0: vehicle that it will be attached to (player or vehicle) <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call ace_radiodirectionfinder_fnc_displayCondition
*
* Public: No
*/
params ["_unit"];
(alive _unit)
&& {(backpack _unit) == QGVAR(backpack)}

View File

@ -0,0 +1,52 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
*
*
* Arguments:
* 0: <ARRAY>
*
* Return Value:
* None
*
* Example:
* [] call ace_radiodirectionfinder_fnc_getSignals
*
* Public: No
*/
params ["_positionASL", "_targetFreq", "_maxSignals"];
// TRACE_3("getSignals",_positionASL,_targetFreq,_maxSignals);
// semi-cached (Run though only a single source func each tick, then process all at end)
if (GVAR(signalStage) < count GVAR(signalSourceFuncs)) then {
[GVAR(signalsAccumulator)] call (GVAR(signalSourceFuncs) select GVAR(signalStage));
TRACE_2("tick",GVAR(signalsAccumulator),GVAR(signalStage));
GVAR(signalStage) = GVAR(signalStage) + 1;
} else {
GVAR(signalStage) = 0;
GVAR(signalsLast) = [];
{
_x params ["_object", "_freqMhz", "_powerMW"];
if ((_targetFreq == 0) || {(abs (_targetFreq - _freqMhz)) < 9}) then {
private _xPosASL = if (_object isEqualType []) then { _object } else { getPosASL _object };
private _distance = (_positionASL vectorDistance _xPosASL) max 5;
// for meters/MHz/miliwatts (ignoring antenna gain, terrain.....)
private _rtx = (10 * log _powerMW) - (-27.55 + 20 * log _freqMhz + 20 * log _distance);
private _bearing = _positionASL getDir _xPosASL;
GVAR(signalsLast) pushBack [_rtx, _freqMhz, _bearing];
#ifdef DEBUG_MODE_FULL
systemChat format ["%1: %2dbm %3mhz %4 deg", _object, _rtx toFixed 1, _freqMhz toFixed 0, _bearing toFixed 1];
#endif
};
} forEach GVAR(signalsAccumulator);
GVAR(signalsAccumulator) = [];
GVAR(signalsLast) sort true; // sort by recieved power
if ((count GVAR(signalsLast)) > _maxSignals) then { GVAR(signalsLast) resize _maxSignals };
};
// return
GVAR(signalsLast)

View File

@ -0,0 +1,34 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
*
*
* Arguments:
* 0: List of signals (Return) <ARRAY>
*
* Return Value:
* None
*
* Example:
* [] call ace_radiodirectionfinder_fnc_getSignalsACRE
*
* Public: No
*/
params ["_list"];
// not tested
{
private _object = _x;
private _radioId = _object getVariable ["acre_sys_data_CurrentSpeakingRadio", ""];
if (_radioId == "") then {
TRACE_1("unknown id",_object);
} else {
private _transmittingRadioData = [_radioId, "getCurrentChannelData"] call acre_sys_data_fnc_dataEvent; // cba hash
private _freqMhz = _transmittingRadioData getVariable ["frequencytx", -1];
private _powerMW = _transmittingRadioData getVariable ["power", -1];
TRACE_4("",_object,_radioId,_freqMhz,_powerMW);
_list pushBack [_object, _freqMhz, _powerMW];
};
} forEach acre_sys_core_keyedMicRadios; // only remote units

View File

@ -0,0 +1,30 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
*
*
* Arguments:
* 0: List of signals (Return) <ARRAY>
*
* Return Value:
* <ARRAY>
*
* Example:
* [] call ace_radiodirectionfinder_fnc_getSignalsScripted
*
* Public: No
*/
params ["_list"];
{
_x params ["_obj", "_freqMhz", "_powerMW"];
if (_obj isEqualType objNull) then {
if (isNull _obj) exitWith {};
if (_obj getVariable [QGVAR(enabled), true]) then {
_list pushBack [getPosASL _obj, _freqMhz, _powerMW];
};
} else {
_list pushBack _x;
};
} forEach (missionNamespace getVariable [QGVAR(signalList), []]);

View File

@ -0,0 +1,31 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
*
*
* Arguments:
* 0: List of signals (Return) <ARRAY>
*
* Return Value:
* None
*
* Example:
* [] call ace_radiodirectionfinder_fnc_getSignalsUAV
*
* Public: No
*/
params ["_list"];
{
private _freqMhz = _x getVariable [QGVAR(freqMhz), -1];
if (_freqMhz < 0) then {
[QGVAR(getUavFreq), [_x]] call CBA_fnc_serverEvent;
} else {
_list pushBack [getPosASL _x, _freqMhz, 10000];
private _unit = (UAVControl _x) param [0, objNull];
if (alive _unit) then {
_list pushBack [getPosASL _unit, _freqMhz, 10000];
};
};
} forEach allUnitsUAV;

View File

@ -0,0 +1,66 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
* Changes the display mode between dialog/display.
*
* Arguments:
* 0: Display Mode to show in <NUMBER> (default: -1)
*
* Return Value:
* None
*
* Example:
* [1] call ace_radiodirectionfinder_fnc_toggleDisplayMode
*
* Public: No
*/
params [["_newDisplayShowMode", -1, [-1]], ["_currentShown", 0, [0]]];
TRACE_1("toggleDisplayMode",_newDisplayShowMode);
if (_newDisplayShowMode == -1) then { // Toggle
_newDisplayShowMode = if (GVAR(currentShowMode) != DISPLAY_MODE_DIALOG) then { DISPLAY_MODE_DIALOG } else { DISPLAY_MODE_DISPLAY };
};
private _display = uiNamespace getVariable [QGVAR(display), displayNull];
private _dialog = uiNamespace getVariable [QGVAR(dialog), displayNull];
TRACE_2("",isNull _display,isNull _dialog);
if ((_newDisplayShowMode != DISPLAY_MODE_DIALOG) && {!isNull _dialog}) then {
_currentShown = _dialog getVariable [QGVAR(currentShown), 0];
TRACE_1("closing dialog",_dialog);
closeDialog 0;
};
if ((_newDisplayShowMode != DISPLAY_MODE_DISPLAY) && {!isNull _display}) then {
_currentShown = _display getVariable [QGVAR(currentShown), 0];
TRACE_1("closing display",_display);
QGVAR(display) cutText ["", "PLAIN"];
};
if (_newDisplayShowMode == DISPLAY_MODE_DIALOG) then {
createDialog QGVAR(dialog);
_dialog = uiNamespace getVariable [QGVAR(dialog), displayNull];
_dialog setVariable [QGVAR(currentShown), _currentShown];
[_dialog] call FUNC(createGUI);
TRACE_1("created dialog",_display);
};
if (_newDisplayShowMode == DISPLAY_MODE_DISPLAY) then {
QGVAR(display) cutRsc [QGVAR(display), "PLAIN", 2, false];
_display = uiNamespace getVariable [QGVAR(display), displayNull];
_display setVariable [QGVAR(currentShown), _currentShown];
[_display] call FUNC(createGUI);
TRACE_1("created display",_display);
};
if (!isNil QGVAR(pfeh)) then {
TRACE_1("removing PFEH",GVAR(pfeh));
[GVAR(pfeh)] call CBA_fnc_removePerFrameHandler;
GVAR(pfeh) = nil;
};
GVAR(currentShowMode) = _newDisplayShowMode;
GVAR(nextGuiUpate) = -1;
GVAR(signalStage) = 0;
GVAR(signalsAccumulator) = [];
if (isNil QGVAR(signalsLast)) then { GVAR(signalsLast) = []; };
if (_newDisplayShowMode != DISPLAY_MODE_CLOSED) then {
GVAR(pfeh) = [FUNC(updatePFEH), 0, [CBA_missionTime, -1]] call CBA_fnc_addPerFrameHandler;
TRACE_1("added PFEH",GVAR(pfeh));
};

View File

@ -0,0 +1,45 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
* Updates the display (several times a second) called from the pfeh
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_radiodirectionfinder_fnc_updateDisplayAnim
*
* Public: No
*/
params ["_display", "_desiredPhase", "_deltaTime"];
// TRACE_3("updateDisplayAnim",_display,_desiredPhase,_deltaTime);
private _ctrlPhoneObject = _display displayCtrl IDC_OBJECT_SCREEN;
private _currentShown = _display getVariable [QGVAR(currentShown), 0];
if (_desiredPhase > _currentShown) then {
_currentShown = (_currentShown + (_deltaTime / 0.5)) min _desiredPhase;
} else {
_currentShown = (_currentShown - (_deltaTime / 0.5)) max _desiredPhase;
};
_display setVariable [QGVAR(currentShown), _currentShown];
_ctrlPhoneObject ctrlSetModelScale 0.5;
if (_currentShown == 0) then {
_ctrlPhoneObject ctrlShow false;
false
} else {
_ctrlPhoneObject ctrlShow true;
private _xPos = linearConversion [0.9, 1, _currentShown, 0.35, 0.5, true];
private _yPos = linearConversion [0.9, 1, _currentShown, 0.12, 0.08, true];
private _zPos = linearConversion [0, 1, _currentShown, 1.25, 0.75] + linearConversion [0, 0.5, _currentShown, 0.25, 0, true];
private _yAngle = linearConversion [0, 1, _currentShown, 30, 80] + linearConversion [0, 0.75, _currentShown, -30, 0, true];
// [xScreen, dist, yScreen] x/y extents are based on UI scaling
_ctrlPhoneObject ctrlSetPosition [_xPos, _yPos, _zPos];
_ctrlPhoneObject ctrlSetModelDirAndUp [[0,cos _yAngle, sin _yAngle], [0,-1,0]];
true
};

View File

@ -0,0 +1,146 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
* Updates the display (several times a second) called from the pfeh
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_radiodirectionfinder_fnc_updateDisplayAnim
*
* Public: No
*/
private _unit = ace_player;
private _backpackObject = backpackContainer _unit;
if (!([_unit] call FUNC(displayCondition))) exitWith {
TRACE_2("displayCondition failed",_unit,_backpackObject);
[DISPLAY_MODE_CLOSED] call FUNC(toggleDisplayMode);
};
params ["_args"];
_args params ["_deltaTime"];
_deltaTime = CBA_missionTime - _deltaTime;
_args set [0, CBA_missionTime];
private _canShow = [_unit, objNull, ["isNotSitting"]] call EFUNC(common,canInteractWith);
private _display = displayNull;
private _shown = false;
if (GVAR(currentShowMode) == DISPLAY_MODE_DISPLAY) then {
_display = uiNamespace getVariable [QGVAR(display), displayNull];
private _desiredPhase = if (_canShow && {cameraView != "GUNNER"} && {EGVAR(interact_menu,openedMenuType) < 0}) then {
if (weaponLowered _unit) then { 0.9 } else { 0.7 };
} else {
0
};
_shown = [_display, _desiredPhase, _deltaTime] call FUNC(updateDisplayAnim);
} else {
_display = uiNamespace getVariable [QGVAR(dialog), displayNull];
if ((!_canShow) || {isNull _display}) exitWith { [DISPLAY_MODE_DISPLAY, 1] call FUNC(toggleDisplayMode); };
_shown = [_display, 1, _deltaTime * 2] call FUNC(updateDisplayAnim);
};
if (!_shown) exitWith {};
if (GVAR(nextGuiUpate) > CBA_missionTime) exitWith {};
GVAR(nextGuiUpate) = CBA_missionTime + 0.1;
BEGIN_COUNTER(hudUpdate);
private _currentTargetFreq = _backpackObject getVariable [QGVAR(targetFreq), 0];
private _menuTab = _backpackObject getVariable [QGVAR(currentMode), IDC_MENU_BUTTON1];
// Update clock:
private _ctrlTime = _display displayCtrl IDC_CLOCK_TEXT;
_ctrlTime ctrlSetText ([daytime, "HH:MM"] call bis_fnc_timeToString);
// Update Menus:
(_display displayCtrl IDC_MODE1_GROUP) ctrlShow (_menuTab == IDC_MENU_BUTTON1);
(_display displayCtrl IDC_MODE2_GROUP) ctrlShow (_menuTab == IDC_MENU_BUTTON2);
(_display displayCtrl IDC_MODE3_GROUP) ctrlShow (_menuTab == IDC_MENU_BUTTON3);
(_display displayCtrl IDC_MENU_BG1) ctrlSetText (["#(argb,8,8,3)color(0.15,0.15,0.15,1)", "#(argb,8,8,3)color(0.5,0.5,0.5,1)"] select (_menuTab == IDC_MENU_BUTTON1));
(_display displayCtrl IDC_MENU_BG2) ctrlSetText (["#(argb,8,8,3)color(0.15,0.15,0.15,1)", "#(argb,8,8,3)color(0.5,0.5,0.5,1)"] select (_menuTab == IDC_MENU_BUTTON2));
(_display displayCtrl IDC_MENU_BG3) ctrlSetText (["#(argb,8,8,3)color(0.15,0.15,0.15,1)", "#(argb,8,8,3)color(0.5,0.5,0.5,1)"] select (_menuTab == IDC_MENU_BUTTON3));
switch (_menuTab) do {
case (IDC_MENU_BUTTON1): {
private _signals = [getPosASL _unit, _currentTargetFreq, 10] call FUNC(getSignals);
private _baseDir = getDir _unit;
// re-sort by relative dir
_signals = _signals apply {
_x params ["_rtx", "_freqMhz", "_bearing"];
private _relDir = (_bearing - getDir _unit) call CBA_fnc_simplifyAngle180;
[abs _relDir, _rtx, _freqMhz, _relDir, _bearing];
};
_signals sort true;
// Update compass
private _ctrlCircleArrow = _display displayCtrl IDC_MODE1_CIRCLE_ARROW;
_ctrlCircleArrow ctrlSetAngle [-_baseDir, 0.5, 0.5, true];
// Update dot for most front aligned signal
private _ctrlCircleDot = _display displayCtrl IDC_MODE1_CIRCLE_DOT;
private _primarySignalInfo = [];
if (_signals isEqualTo []) then {
_primarySignalInfo pushBack format ["<t size='2'><t align='center'>Nothing</t></t>", _freqMhz];
_ctrlCircleDot ctrlShow false;
} else {
_ctrlCircleDot ctrlShow true;
(_signals select 0) params ["", "_rtx", "_freqMhz", "_relDir", "_bearing"];
_ctrlCircleDot ctrlSetAngle [_relDir, 0.5, 0.5, true];
_primarySignalInfo pushBack format ["<t size='1.25' align='left'>Center Frequency</t><t align='right'>%1 MHz</t>", _freqMhz toFixed 1];
_primarySignalInfo pushBack format ["<t size='1.25' align='left'>Recieved Power</t><t align='right'>%1 dBm</t>", _rtx toFixed 1];
_primarySignalInfo pushBack format ["<t size='1.25' align='left'>Bearing</t><t align='right'>%1°</t>", _bearing toFixed 0];
};
private _ctrlText = _display displayCtrl IDC_MODE1_SCAN_INFO_TEXT;
_ctrlText ctrlSetStructuredText parseText (_primarySignalInfo joinString "<br/>");
// Update lines
private _lines = _display getVariable [QGVAR(lines), []];
{
if (_forEachIndex < (count _signals)) then {
_x ctrlShow true;
(_signals select _forEachIndex) params ["", "", "", "_relDir"];
_x ctrlSetAngle [_relDir, 0.5, 0.5, true];
} else {
_x ctrlShow false;
};
} forEach _lines;
};
case (IDC_MENU_BUTTON2): {
private _signals = [getPosASL _unit, _currentTargetFreq, 10] call FUNC(getSignals);
private _ctrlFreqSelectionText = _display displayCtrl IDC_MODE2_FREQ_TEXT;
private _currentTargetFreqText = if (_currentTargetFreq > 0) then { format ["%1 MHz",_currentTargetFreq] } else { "Any" };
_ctrlFreqSelectionText ctrlSetStructuredText parseText format ["<t size='2'>Target Frequency: %1", _currentTargetFreqText];
private _ctrlSignalCount = _display displayCtrl IDC_MODE2_SIGNAL_COUNT;
_ctrlSignalCount ctrlSetText format ["Signal Count: %1", count _signals];
private _ctrlResetBackground = _display displayCtrl IDC_MODE2_RESET_BACKGROUND;
_ctrlResetBackground ctrlSetText (["#(argb,8,8,3)color(0.2,0.2,0.2,1)", "#(argb,8,8,3)color(0.9,0.1,0.1,1)"] select (_currentTargetFreq > 0));
};
case (IDC_MENU_BUTTON3): {
private _signals = [getPosASL _unit, 0, 20] call FUNC(getSignals); // no freq filter
_signals = _signals apply {
_x params ["_rtx", "_freqMhz", "_bearing"];
[_freqMhz, _rtx, _bearing]
};
_signals sort true;
private _ctrlSignalList = _display displayCtrl IDC_MODE3_LIST;
lnbClear _ctrlSignalList;
{
_x params ["_freqMhz", "_rtx", "_bearing"];
_ctrlSignalList lbAdd format ["%1 MHz (%2 dBm)", _freqMhz toFixed 0, _rtx toFixed 2];
_ctrlSignalList lbSetTextRight [_forEachIndex, format ["%1°", _bearing toFixed 0]];
} forEach _signals;
};
default {
ERROR_1("bad enum %1",_menuTab);
_backpackObject setVariable [QGVAR(currentMode), nil];
};
};
END_COUNTER(hudUpdate);

View File

@ -0,0 +1 @@
#include "\z\ace\addons\radiodirectionfinder\script_component.hpp"

View File

@ -0,0 +1,40 @@
#define COMPONENT radiodirectionfinder
#define COMPONENT_BEAUTIFIED RadioDirectionFinder
#include "\z\ace\addons\main\script_mod.hpp"
#define DEBUG_MODE_FULL
#define DISABLE_COMPILE_CACHE
#define ENABLE_PERFORMANCE_COUNTERS
#include "\z\ace\addons\main\script_macros.hpp"
// GVAR(currentShowMode) enums
#define DISPLAY_MODE_CLOSED 0
#define DISPLAY_MODE_DISPLAY 1
#define DISPLAY_MODE_DIALOG 2
// IDCS
#define IDC_OBJECT_SCREEN 1000
#define IDC_SCREEN_GROUP 1001
#define IDC_CLOCK_TEXT 1010
#define IDC_MENU_BUTTON1 1011
#define IDC_MENU_BG1 1021
#define IDC_MENU_BUTTON2 1012
#define IDC_MENU_BG2 1022
#define IDC_MENU_BUTTON3 1013
#define IDC_MENU_BG3 1023
#define IDC_MODE1_GROUP 1100
#define IDC_MODE1_CIRCLE_DOT 1102
#define IDC_MODE1_CIRCLE_ARROW 1103
#define IDC_MODE1_SCAN_INFO_TEXT 1104
#define IDC_MODE2_GROUP 1200
#define IDC_MODE2_FREQ_TEXT 1201
#define IDC_MODE2_FREQ_SLIDER 1202
#define IDC_MODE2_RESET_BACKGROUND 1203
#define IDC_MODE2_SIGNAL_COUNT 1204
#define IDC_MODE3_GROUP 1300
#define IDC_MODE3_LIST 1301

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="radiodirectionfinder">
<Key ID="STR_ACE_radiodirectionfinder_x">
<English>x</English>
</Key>
</Package>
</Project>