From a997c5417005c425881c1d99f10194e384175a56 Mon Sep 17 00:00:00 2001 From: Valmo Trindade Date: Tue, 13 May 2025 01:09:12 -0300 Subject: [PATCH] added initial zeus core module functions --- addons/main/CfgFunctions.hpp | 7 +++ .../gui/fn_ZeusCoreModule_configure.sqf | 54 +++++++++++++++++++ .../functions/gui/fn_ZeusCoreModule_show.sqf | 5 ++ 3 files changed, 66 insertions(+) create mode 100644 addons/main/functions/gui/fn_ZeusCoreModule_configure.sqf create mode 100644 addons/main/functions/gui/fn_ZeusCoreModule_show.sqf diff --git a/addons/main/CfgFunctions.hpp b/addons/main/CfgFunctions.hpp index 1b46e70..a3f6187 100644 --- a/addons/main/CfgFunctions.hpp +++ b/addons/main/CfgFunctions.hpp @@ -56,6 +56,13 @@ class CfgFunctions { file = "\armatak\armatak\armatak_main\functions\extract_data\fn_shorten_name.sqf"; }; + class ZeusCoreModule_show { + file = "\armatak\armatak\armatak_main\functions\gui\fn_ZeusCoreModule_show.sqf"; + }; + class ZeusCoreModule_configure { + file = "\armatak\armatak\armatak_main\functions\gui\fn_ZeusCoreModule_configure.sqf"; + }; + class convert_location { file = "\armatak\armatak\armatak_main\functions\map\fn_convert_location.sqf"; }; diff --git a/addons/main/functions/gui/fn_ZeusCoreModule_configure.sqf b/addons/main/functions/gui/fn_ZeusCoreModule_configure.sqf new file mode 100644 index 0000000..1d14825 --- /dev/null +++ b/addons/main/functions/gui/fn_ZeusCoreModule_configure.sqf @@ -0,0 +1,54 @@ + +_armatak_tcp_socket_is_running = missionNamespace getVariable "armatak_tcp_socket_is_running"; + +if (isNil _armatak_tcp_socket_is_running) exitWith { + _warning = format ["ARMATAK
%1", "Connecting to TAK Server TCP Socket..."]; + [[_warning, 1.5]] call CBA_fnc_notify; + + call armatak_fnc_handleCallbacks; + + _tak_server_instance_address = ctrlText 1400; + _tak_server_instance_port = ctrlText 1401; + + _tak_server_fulladdress = _tak_server_instance_address + ":" + (str _tak_server_instance_port); + + missionNamespace setVariable ["armatak_server_instance", _tak_server_fulladdress]; + missionNamespace setVariable ["armatak_tcp_socket_is_running", true]; + missionNamespace setVariable ["armatak_group_colors", ["White", "Yellow", "Orange", "Magenta", "Red", "Maroon", "Purple", "DarkBlue", "Blue", "Cyan", "Teal", "Green", "DarkGreen", "Brown"]]; + + "armatak" callExtension ["tcp_socket:start", [_tak_server_fulladdress]]; + + _syncUnits = synchronizedObjects _logic; + + missionNamespace setVariable ["armatak_marked_units", _syncUnits]; + + _syncedUnits = missionNamespace getVariable "armatak_marked_units"; + + [{ + _syncedUnits = missionNamespace getVariable "armatak_marked_units"; + + { + _objectType = _x call BIS_fnc_objectType; + if ((_objectType select 0) == "Soldier") then { + _callsign = [_x] call armatak_fnc_extract_unit_callsign; + _group_name = [group _x] call armatak_fnc_extract_group_color; + _group_role = [_x] call armatak_fnc_extract_group_role; + + [_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot; + [_x] call armatak_fnc_send_digital_pointer_cot; + }; + if ((_objectType select 0) == "Vehicle") then { + _atak_type = [_x] call armatak_fnc_extract_role; + _callsign = [_x] call armatak_fnc_extract_marker_callsign; + + [_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot; + }; + if (unitIsUAV _x) then { + [_x] call armatak_fnc_send_drone_cot; + [_x] call armatak_fnc_send_digital_pointer_cot; + }; + } forEach _syncedUnits; + }, 2, []] call CBA_fnc_addPerFrameHandler; +}; + +true; \ No newline at end of file diff --git a/addons/main/functions/gui/fn_ZeusCoreModule_show.sqf b/addons/main/functions/gui/fn_ZeusCoreModule_show.sqf new file mode 100644 index 0000000..64b9ca7 --- /dev/null +++ b/addons/main/functions/gui/fn_ZeusCoreModule_show.sqf @@ -0,0 +1,5 @@ +disableSerialization; + +createDialog "armatak_zeus_core_module_dialog"; + +waitUntil {!isNull (findDisplay 999991);}; \ No newline at end of file