diff --git a/addons/artycomputer_models/$PREFIX$ b/addons/artycomputer_models/$PREFIX$ deleted file mode 100644 index 618f576..0000000 --- a/addons/artycomputer_models/$PREFIX$ +++ /dev/null @@ -1 +0,0 @@ -x\tun\addons\artycomputer_models \ No newline at end of file diff --git a/addons/firesupport/$PREFIX$ b/addons/firesupport/$PREFIX$ deleted file mode 100644 index 9920076..0000000 --- a/addons/firesupport/$PREFIX$ +++ /dev/null @@ -1 +0,0 @@ -x\tun\addons\firesupport \ No newline at end of file diff --git a/addons/firesupport/Convert_dialog.hpp b/addons/firesupport/Convert_dialog.hpp new file mode 100644 index 0000000..8753a6b --- /dev/null +++ b/addons/firesupport/Convert_dialog.hpp @@ -0,0 +1,78 @@ +//Exported via Arma Dialog Creator (https://github.com/kayler-renslow/arma-dialog-creator) + +#include "CustomControlClasses.hpp" +class tun_firesupport_convertDialog +{ + idd = MAINCONVERT_IDD; + enableSimulation = false; + class ControlsBackground + { + class tun_firesupport_convert_background + { + type = 0; + idc = -1; + x = safeZoneX + safeZoneW * 0.3; + y = safeZoneY + safeZoneH * 0.175; + w = safeZoneW * 0.4; + h = safeZoneH * 0.575; + style = 0; + text = ""; + colorBackground[] = GUI_BCG_MENU; + colorText[] = {0.2431,0.1725,0.3333,1}; + font = "PuristaMedium"; + sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); + }; + + }; + class Controls + { + class tun_firesupport_convert_header : tun_firesupport_header_base + { + x = safeZoneX + safeZoneW * 0.325; + y = safeZoneY + safeZoneH * 0.2; + w = safeZoneW * 0.35; + h = safeZoneH * 0.05; + text = "$STR_tun_firesupport_converter_header"; + + + }; + class tun_firesupport_convert_swtEditBox : tun_default_editBox + { + idc = SWTDATA; + x = safeZoneX + safeZoneW * 0.325; + y = safeZoneY + safeZoneH * 0.52777778; + w = safeZoneW * 0.35; + h = safeZoneH * 0.19722223; + text = "$STR_tun_firesupport_converter_swtEditBoxText"; + style = 16+2; + }; + class tun_firesupport_convert_tunEditBox : tun_firesupport_convert_swtEditBox + { + idc = TUNDATA; + y = safeZoneY + safeZoneH * 0.26851852; + text = "$STR_tun_firesupport_converter_firesupportEditBoxText"; + + }; + class tun_firesupport_swt_to_firesupport_button : RscButton + { + idc = -1; + x = safeZoneX + safeZoneW * 0.3625; + y = safeZoneY + safeZoneH * 0.47222223; + w = safeZoneW * 0.096875; + h = safeZoneH * 0.0462963; + text = "To Firesupport"; + onButtonClick = "[false] call tun_firesupport_fnc_convertData"; + colorBackground[] = GUI_BCG_COLOR; + colorBackgroundActive[] = GUI_BCG_COLOR; + }; + class tun_firesupport_firesupport_to_swt_button : tun_firesupport_swt_to_firesupport_button + { + idc = -1; + x = safeZoneX + safeZoneW * 0.540625; + text = "To SWT"; + onButtonClick = "[true] call tun_firesupport_fnc_convertData"; + }; + + }; + +}; diff --git a/addons/firesupport/CustomControlClasses.hpp b/addons/firesupport/CustomControlClasses.hpp index 7f206f2..0df6009 100644 --- a/addons/firesupport/CustomControlClasses.hpp +++ b/addons/firesupport/CustomControlClasses.hpp @@ -14,23 +14,24 @@ class RscTree; class RscCombo; class RscXSliderH; class RscCheckBox; +#include "\a3\ui_f\hpp\definecommoncolors.inc" +#include "\a3\ui_f\hpp\definecommoncolors.inc" -#define GUI_USER_COLORBACKGROUND { "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", 1 } +//#define GUI_BCG_COLOR { "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", 1 } class tun_default_editBox : RscEdit { autocomplete = ""; borderSize = 0.01; - colorBorder[] = GUI_USER_COLORBACKGROUND; + colorBorder[] = GUI_BCG_COLOR; colorBackground[] = {0.2,0.2,0.2,0.2}; colorDisabled[] = {0,0,0,0}; - colorSelection[] = GUI_USER_COLORBACKGROUND; + colorSelection[] = GUI_BCG_COLOR; colorText[] = {1,1,1,1}; canModify = true; shadow = 0; }; - class tun_firesupport_coordinate_preset : tun_default_editBox { text = "000"; @@ -41,7 +42,7 @@ class tun_firesupport_coordinate_preset : tun_default_editBox class tun_default_text : RscText { - colorBackground[] = GUI_USER_COLORBACKGROUND; + colorBackground[] = GUI_BCG_COLOR; colorText[] = {1,1,1,1}; }; @@ -51,4 +52,13 @@ class tun_default_CheckBox : RscCheckBox h = safeZoneH * 0.025; }; +class tun_firesupport_header_base : RscText +{ + type = 0; + idc = -1; + style = 32+2; + shadow = 2; + colorBackground[] = GUI_BCG_COLOR; + colorText[] = GUI_TITLETEXT_COLOR; +}; #endif diff --git a/addons/firesupport/Firesupport_dialog.hpp b/addons/firesupport/Firesupport_dialog.hpp index 344b537..20101a6 100644 --- a/addons/firesupport/Firesupport_dialog.hpp +++ b/addons/firesupport/Firesupport_dialog.hpp @@ -107,7 +107,7 @@ class Firesupport_dialog w = safeZoneW * 0.1421875; h = safeZoneH * 0.21481482; borderSize = 0.01; - colorBorder[] = GUI_USER_COLORBACKGROUND; + colorBorder[] = GUI_BCG_COLOR; colorLines[] = {1,1,1,1}; colorBackground[] = {0.2,0.2,0.2,0.2}; onTreeSelChanged = "[] call tun_firesupport_fnc_setValues"; @@ -129,6 +129,7 @@ class Firesupport_dialog x = safeZoneX + safeZoneW * 0.378125; y = safeZoneY + safeZoneH * 0.27870371; tooltip = "$STR_tun_firesupport_coordinates_tooltip_easting"; + onKeyUp = "[] call tun_firesupport_fnc_firingPosMarker"; }; class tun_firesupport_easting_text : tun_default_text @@ -171,6 +172,7 @@ class Firesupport_dialog x = safeZoneX + safeZoneW * 0.378125; y = safeZoneY + safeZoneH * 0.34351852; tooltip = "$STR_tun_firesupport_coordinates_tooltip_easting"; + onKeyUp = "[] call tun_firesupport_fnc_firingPosMarker; [false] call tun_firesupport_fnc_check_values;"; }; class tun_firesupport_northing_end_point_value : tun_firesupport_easting_end_point_value @@ -188,7 +190,7 @@ class Firesupport_dialog y = safeZoneY + safeZoneH * 0.31574075; text = "$STR_tun_firesupport_northing_end_point"; }; - + class tun_firesupport_ammo_count : tun_default_editBox { idc = COUNT_IDC; @@ -282,17 +284,13 @@ class Firesupport_dialog text = "Value"; tooltip = "$STR_tun_firesupport_eta_tooltip"; }; - class tun_firesupport_header : RscText + class tun_firesupport_header : tun_firesupport_header_base { - type = 0; - idc = -1; x = safeZoneX + safeZoneW * 0.22447917; y = safeZoneY + safeZoneH * 0.18518519; w = safeZoneW * 0.55104167; h = safeZoneH * 0.05; - style = 32+2; text = "$STR_tun_firesupport_Header"; - shadow = 2; }; class tun_firesupport_status : tun_default_text @@ -423,7 +421,7 @@ class Firesupport_dialog y = safeZoneY + safeZoneH * 0.27870371; w = safeZoneW * 0.1375; h = safeZoneH * 0.02962963; - //onLBSelChanged = ""; + onLBSelChanged = "[] call tun_firesupport_fnc_firingPosMarker"; }; class tun_firesupport_trp2_list : tun_firesupport_trp1_list { @@ -475,8 +473,14 @@ class Firesupport_dialog idc = TOGGLEVOLLEY; x = safeZoneX + safeZoneW * 0.69010417; y = safeZoneY + safeZoneH * 0.34351852; - tooltip = "$STR_tun_firesupport_toggleVolleyFire_tooltip"; - + tooltip = "$STR_tun_firesupport_toggleVolleyFire_tooltip"; + }; + + class tun_firesupport_toggleMoveMap: tun_firesupport_togglevolleyfire + { + idc = TOGGLEMAPMOVE; + x = safeZoneX + safeZoneW * 0.69010417 + (safeZoneW * 0.015)*2; + tooltip = "$STR_tun_firesupport_toggleMoveMap_tooltip"; }; class tun_firesupport_time_text : tun_default_text @@ -487,16 +491,15 @@ class Firesupport_dialog w = safeZoneW * 0.09739584; h = safeZoneH * 0.025; text = "$STR_tun_firesupport_toggletimetext"; - tooltip = "$STR_tun_firesupport_toggletimetext_tooltip"; - + tooltip = "$STR_tun_firesupport_toggletimetext_tooltip"; }; + class tun_firesupport_queue_list : tun_firesupport_bookmark_list { idc = QUEUELIST; - onLBSelChanged = ""; - - + onLBSelChanged = ""; }; + class tun_firesupport_queue_remove_button : RscButton { type = 1; @@ -507,10 +510,7 @@ class Firesupport_dialog h = safeZoneH * 0.05; text = "$STR_tun_firesupport_queue_remove"; onMouseButtonClick = "[] call tun_firesupport_fnc_removeQueue"; - tooltip = "$STR_tun_firesupport_queue_remove_tooltip"; - + tooltip = "$STR_tun_firesupport_queue_remove_tooltip"; }; }; - -}; - +}; \ No newline at end of file diff --git a/addons/firesupport/Firesupport_idc.hpp b/addons/firesupport/Firesupport_idc.hpp index 19a36b0..a00dc9c 100644 --- a/addons/firesupport/Firesupport_idc.hpp +++ b/addons/firesupport/Firesupport_idc.hpp @@ -7,7 +7,7 @@ #define EASTING_END_IDC 22206 #define NORTHING_END_IDC 22207 #define REMAINIG_AMMO_IDC 22208 -#define TRP LIST 22209 +//#define TRP LIST 22209 #define ETA_IDC 22210 #define STATUS_IDC 22211 #define FIRE_IDC 22212 @@ -43,6 +43,9 @@ #define QUEUELIST 22242 #define QUEUEREMOVE 22243 #define TOGGLEVOLLEY 22244 +#define TOGGLEMAPMOVE 22245 - +#define MAINCONVERT_IDD 22250 +#define SWTDATA 22251 +#define TUNDATA 22252 diff --git a/addons/firesupport/Stringtable.xml b/addons/firesupport/Stringtable.xml index e3526b4..99b7f6f 100644 --- a/addons/firesupport/Stringtable.xml +++ b/addons/firesupport/Stringtable.xml @@ -266,6 +266,30 @@ Remove Remove + + Distance + Distance + Distance + Distance + Distance + Distance + Distance + Distance + Distance + Distance + + + Direction + Direction + Direction + Direction + Direction + Direction + Direction + Direction + Direction + Direction + @@ -508,6 +532,42 @@ Toggle volley fire. All guns will fire same time, othervise they will keep constant barrage going on. Toggle volley fire. All guns will fire same time, othervise they will keep constant barrage going on. + + Corrected distance from given coordinates. In meters. + Corrected distance from given coordinates. In meters. + Corrected distance from given coordinates. In meters. + Corrected distance from given coordinates. In meters. + Corrected distance from given coordinates. In meters. + Corrected distance from given coordinates. In meters. + Corrected distance from given coordinates. In meters. + Corrected distance from given coordinates. In meters. + Corrected distance from given coordinates. In meters. + Corrected distance from given coordinates. In meters. + + + Correction direction for given coordinates. + Correction direction for given coordinates. + Correction direction for given coordinates. + Correction direction for given coordinates. + Correction direction for given coordinates. + Correction direction for given coordinates. + Correction direction for given coordinates. + Correction direction for given coordinates. + Correction direction for given coordinates. + Correction direction for given coordinates. + + + Toggle auto move map to target coordinates + Toggle auto move map to target coordinates + Toggle auto move map to target coordinates + Toggle auto move map to target coordinates + Toggle auto move map to target coordinates + Toggle auto move map to target coordinates + Toggle auto move map to target coordinates + Toggle auto move map to target coordinates + Toggle auto move map to target coordinates + Toggle auto move map to target coordinates + @@ -582,6 +642,114 @@ Debug mode Debug mode + + Show marker on firing pos + Show marker on firing pos + Show marker on firing pos + Show marker on firing pos + Show marker on firing pos + Show marker on firing pos + Show marker on firing pos + Show marker on firing pos + Show marker on firing pos + Show marker on firing pos + + + If enabled, there will be marker where you are calling firesupport in firesupport interface. + If enabled, there will be marker where you are calling firesupport in firesupport interface. + If enabled, there will be marker where you are calling firesupport in firesupport interface. + If enabled, there will be marker where you are calling firesupport in firesupport interface. + If enabled, there will be marker where you are calling firesupport in firesupport interface. + If enabled, there will be marker where you are calling firesupport in firesupport interface. + If enabled, there will be marker where you are calling firesupport in firesupport interface. + If enabled, there will be marker where you are calling firesupport in firesupport interface. + If enabled, there will be marker where you are calling firesupport in firesupport interface. + If enabled, there will be marker where you are calling firesupport in firesupport interface. + + + Always show TRP markers + Always show TRP markers + Always show TRP markers + Always show TRP markers + Always show TRP markers + Always show TRP markers + Always show TRP markers + Always show TRP markers + Always show TRP markers + Always show TRP markers + + + Enable TRP markers + Enable TRP markers + Enable TRP markers + Enable TRP markers + Enable TRP markers + Enable TRP markers + Enable TRP markers + Enable TRP markers + Enable TRP markers + Enable TRP markers + + + If enabled, TRP markers are always shown in map, not only when interface is opened. + If enabled, TRP markers are always shown in map, not only when interface is opened. + If enabled, TRP markers are always shown in map, not only when interface is opened. + If enabled, TRP markers are always shown in map, not only when interface is opened. + If enabled, TRP markers are always shown in map, not only when interface is opened. + If enabled, TRP markers are always shown in map, not only when interface is opened. + If enabled, TRP markers are always shown in map, not only when interface is opened. + If enabled, TRP markers are always shown in map, not only when interface is opened. + If enabled, TRP markers are always shown in map, not only when interface is opened. + If enabled, TRP markers are always shown in map, not only when interface is opened. + + + If enabled, TRP markers will be created + If enabled, TRP markers will be created + If enabled, TRP markers will be created + If enabled, TRP markers will be created + If enabled, TRP markers will be created + If enabled, TRP markers will be created + If enabled, TRP markers will be created + If enabled, TRP markers will be created + If enabled, TRP markers will be created + If enabled, TRP markers will be created + + + TRP marker type + TRP marker type + TRP marker type + TRP marker type + TRP marker type + TRP marker type + TRP marker type + TRP marker type + TRP marker type + TRP marker type + + + mil_destroy_noShadow + mil_destroy_noShadow + mil_destroy_noShadow + mil_destroy_noShadow + mil_destroy_noShadow + mil_destroy_noShadow + mil_destroy_noShadow + mil_destroy_noShadow + mil_destroy_noShadow + mil_destroy_noShadow + + + classname for marker used in TRPs + classname for marker used in TRPs + classname for marker used in TRPs + classname for marker used in TRPs + classname for marker used in TRPs + classname for marker used in TRPs + classname for marker used in TRPs + classname for marker used in TRPs + classname for marker used in TRPs + classname for marker used in TRPs + @@ -1205,5 +1373,81 @@ Add queue + + + SWT and Firesupport array converter + SWT and Firesupport array converter + SWT and Firesupport array converter + SWT and Firesupport array converter + SWT and Firesupport array converter + SWT and Firesupport array converter + SWT and Firesupport array converter + SWT and Firesupport array converter + SWT and Firesupport array converter + SWT and Firesupport array converter + + + Put sweet marker array here + Put sweet marker array here + Put sweet marker array here + Put sweet marker array here + Put sweet marker array here + Put sweet marker array here + Put sweet marker array here + Put sweet marker array here + Put sweet marker array here + Put sweet marker array here + + + Put firesupport array here + Put firesupport array here + Put firesupport array here + Put firesupport array here + Put firesupport array here + Put firesupport array here + Put firesupport array here + Put firesupport array here + Put firesupport array here + Put firesupport array here + + + + + Tun - Firesupport + Tun - Firesupport + Tun - Firesupport + Tun - Firesupport + Tun - Firesupport + Tun - Firesupport + Tun - Firesupport + Tun - Firesupport + Tun - Firesupport + Tun - Firesupport + + + Convert TRP/SWT + Convert TRP/SWT + Convert TRP/SWT + Convert TRP/SWT + Convert TRP/SWT + Convert TRP/SWT + Convert TRP/SWT + Convert TRP/SWT + Convert TRP/SWT + Convert TRP/SWT + + + <font size=20><execute expression=' [] call tun_firesupport_fnc_openConvertDialog'>Open convert dialog</execute></font> + <font size=20><execute expression=' [] call tun_firesupport_fnc_openConvertDialog'>Open convert dialog</execute></font> + <font size=20><execute expression=' [] call tun_firesupport_fnc_openConvertDialog'>Open convert dialog</execute></font> + <font size=20><execute expression=' [] call tun_firesupport_fnc_openConvertDialog'>Open convert dialog</execute></font> + <font size=20><execute expression=' [] call tun_firesupport_fnc_openConvertDialog'>Open convert dialog</execute></font> + <font size=20><execute expression=' [] call tun_firesupport_fnc_openConvertDialog'>Open convert dialog</execute></font> + <font size=20><execute expression=' [] call tun_firesupport_fnc_openConvertDialog'>Open convert dialog</execute></font> + <font size=20><execute expression=' [] call tun_firesupport_fnc_openConvertDialog'>Open convert dialog</execute></font> + <font size=20><execute expression=' [] call tun_firesupport_fnc_openConvertDialog'>Open convert dialog</execute></font> + <font size=20><execute expression=' [] call tun_firesupport_fnc_openConvertDialog'>Open convert dialog</execute></font> + + \ No newline at end of file diff --git a/addons/firesupport/XEH_postInit.sqf b/addons/firesupport/XEH_postInit.sqf index 84f2529..eee7d56 100644 --- a/addons/firesupport/XEH_postInit.sqf +++ b/addons/firesupport/XEH_postInit.sqf @@ -1 +1,5 @@ -#include "script_component.hpp" \ No newline at end of file +#include "script_component.hpp" + +if (hasInterface) then { + [] call FUNC(createConvertDiaryEntry); +}; \ No newline at end of file diff --git a/addons/firesupport/XEH_preInit.sqf b/addons/firesupport/XEH_preInit.sqf index cbe7523..fa206c5 100644 --- a/addons/firesupport/XEH_preInit.sqf +++ b/addons/firesupport/XEH_preInit.sqf @@ -12,6 +12,11 @@ ISNILS(GVAR(soundOBJ),objNull); ISNILS(GVAR(playingSounds),false); ISNILS(GVAR(bookmarkOpen),false); ISNILS(GVAR(BookmarkSkip),false); +GVAR(firingPosMarkerStart) = ["",""]; +GVAR(firingPosMarkerEnd) = ""; +GVAR(firingPosMarkerArea) = ["",""]; +GVAR(trpMarkers) = []; + //Main settings [ @@ -25,6 +30,49 @@ ISNILS(GVAR(BookmarkSkip),false); true //Setting will be marked as needing mission restart after being changed. (optional, default false) ] call CBA_Settings_fnc_init; +[ + QGVAR(enableFiringPosMarker), // Unique setting name. Matches resulting variable name + "CHECKBOX", // Type of setting. Can be "CHECKBOX", "EDITBOX", "LIST", "SLIDER" or "COLOR" + [localize "STR_tun_firesupport_cba_firePosMarker", localize "STR_tun_firesupport_cba_firePosMarker_tooltip"], // Display name or display name + tooltip (optional, default: same as setting name) + localize "STR_tun_firesupport_cba_Category_main", // Category for the settings menu + optional sub-category + true, // Extra properties of the setting depending of _settingType. + 0, // 1: all clients share the same setting, 2: setting can't be overwritten (optional, default: 0) + {}, // Script to execute when setting is changed. (optional) + true //Setting will be marked as needing mission restart after being changed. (optional, default false) +] call CBA_Settings_fnc_init; + +[ + QGVAR(enableShowTRPmarkers), // Unique setting name. Matches resulting variable name + "CHECKBOX", // Type of setting. Can be "CHECKBOX", "EDITBOX", "LIST", "SLIDER" or "COLOR" + [localize "STR_tun_firesupport_cba_enableShowTRPmarkers", localize "STR_tun_firesupport_cba_enableShowTRPmarkers_tooltip"], // Display name or display name + tooltip (optional, default: same as setting name) + localize "STR_tun_firesupport_cba_Category_main", // Category for the settings menu + optional sub-category + true, // Extra properties of the setting depending of _settingType. + 0, // 1: all clients share the same setting, 2: setting can't be overwritten (optional, default: 0) + {}, // Script to execute when setting is changed. (optional) + true //Setting will be marked as needing mission restart after being changed. (optional, default false) +] call CBA_Settings_fnc_init; + +[ + QGVAR(alwaysShowTRPmarkers), // Unique setting name. Matches resulting variable name + "CHECKBOX", // Type of setting. Can be "CHECKBOX", "EDITBOX", "LIST", "SLIDER" or "COLOR" + [localize "STR_tun_firesupport_cba_alwaysShowTRPmarkers", localize "STR_tun_firesupport_cba_alwaysShowTRPmarkers_tooltip"], // Display name or display name + tooltip (optional, default: same as setting name) + localize "STR_tun_firesupport_cba_Category_main", // Category for the settings menu + optional sub-category + true, // Extra properties of the setting depending of _settingType. + 1, // 1: all clients share the same setting, 2: setting can't be overwritten (optional, default: 0) + {}, // Script to execute when setting is changed. (optional) + true //Setting will be marked as needing mission restart after being changed. (optional, default false) +] call CBA_Settings_fnc_init; + +[ + QGVAR(trpMarkerType), // Unique setting name. Matches resulting variable name + "EDITBOX", // Type of setting. Can be "CHECKBOX", "EDITBOX", "LIST", "SLIDER" or "COLOR" + [localize "STR_tun_firesupport_cba_trpMarkerType", localize "STR_tun_firesupport_cba_alwaysShowTRPmarkers_tooltip"], // Display name or display name + tooltip (optional, default: same as setting name) + localize "STR_tun_firesupport_cba_Category_main", // Category for the settings menu + optional sub-category + [localize "STR_tun_firesupport_cba_trpMarkerType_value"], // Extra properties of the setting depending of _settingType. + 0, // 1: all clients share the same setting, 2: setting can't be overwritten (optional, default: 0) + {}, // Script to execute when setting is changed. (optional) + true //Setting will be marked as needing mission restart after being changed. (optional, default false) +] call CBA_Settings_fnc_init; [ QGVAR(debug), // Unique setting name. Matches resulting variable name diff --git a/addons/firesupport/XEH_prep.sqf b/addons/firesupport/XEH_prep.sqf index 1cb320f..890fe01 100644 --- a/addons/firesupport/XEH_prep.sqf +++ b/addons/firesupport/XEH_prep.sqf @@ -28,4 +28,11 @@ PREP(removeQueue); PREP(firemission_creepingBarrage); PREP(firemission_wall); PREP(playSound); +PREP(firingPosMarker); +PREP(getTargetPositon); +PREP(createTRPmarkers); +PREP(deleteTRPmarkers); +PREP(convertData); +PREP(createConvertDiaryEntry); +PREP(openConvertDialog); diff --git a/addons/firesupport/config.cpp b/addons/firesupport/config.cpp index ab838cc..22512a0 100644 --- a/addons/firesupport/config.cpp +++ b/addons/firesupport/config.cpp @@ -7,12 +7,13 @@ class CfgPatches units[] = { QGVAR(gun_classname) }; weapons[] = {}; requiredVersion = 1.94; - requiredAddons[] = {"A3_Modules_F","3DEN","cba_main","cba_xeh","cba_settings","ace_common","ace_interaction","ace_interact_menu"}; + requiredAddons[] = {"A3_Modules_F","3DEN","cba_main","cba_xeh","cba_settings","ace_common","ace_interaction","ace_interact_menu","ace_modules"}; author = "Tuntematon"; authorUrl = "https://armafinland.fi/"; }; }; +#include "Convert_dialog.hpp" #include "Firesupport_dialog.hpp" #include "CfgSounds.hpp" diff --git a/addons/firesupport/functions/fnc_calculate_eta.sqf b/addons/firesupport/functions/fnc_calculate_eta.sqf index 676bed9..1e14568 100644 --- a/addons/firesupport/functions/fnc_calculate_eta.sqf +++ b/addons/firesupport/functions/fnc_calculate_eta.sqf @@ -20,28 +20,17 @@ private _northing = ctrlText NORTHING_IDC; private _etaText = "NONE"; private _etaNumber = -1; private _minEta = -1; +private _trp1Toggle = cbChecked (findDisplay MAIN_IDD displayCtrl TRP1); +private _trp1Index = lbCurSel TRP1_LIST; -if ( count _listArray isEqualTo 2 ) then { +if ( count _listArray isEqualTo 2) then { private _gunModule = (tvData [ARTY_LIST_IDC, [(_listArray select 0)]]) call BIS_fnc_objectFromNetId; private _ammoModule = (tvData [ARTY_LIST_IDC, _listArray]) call BIS_fnc_objectFromNetId; private _magazineClass = _ammoModule getVariable "Ammo"; private _initSpeed = getNumber (configfile >> "CfgMagazines" >> _magazineClass >> "initSpeed"); - private _trp1Toggle = cbChecked (findDisplay MAIN_IDD displayCtrl TRP1); - private _trp1Index = lbCurSel TRP1_LIST; - if (_trp1Toggle) then { - if (_trp1Index != -1 && (count GVAR(trpValues)) isNotEqualTo 0) then { - private _trp1Values = GVAR(trpValues) select _trp1Index; - _easting = _trp1Values select 1; - _northing = _trp1Values select 2; - } else { - _easting = "000"; - _northing = "000"; - }; - }; - - private _pos = [[_easting, _northing], true] call CBA_fnc_mapGridToPos; + private _pos = ([] call FUNC(getTargetPositon)) select 0; private _countdown = _gunModule getVariable ["countDown", 60]; private _distance = _gunModule distance _pos; private _minRange= _gunModule getVariable ["minRange", 0]; @@ -91,7 +80,7 @@ if ( count _listArray isEqualTo 2 ) then { _etaText = "Out of Ammo"; }; - if (_trp1Index == -1 && _trp1Toggle) then { + if (_trp1Index isEqualTo -1 && _trp1Toggle) then { _etaText = "No TRP selected"; }; }; diff --git a/addons/firesupport/functions/fnc_check_values.sqf b/addons/firesupport/functions/fnc_check_values.sqf index 4e58f40..f281cf8 100644 --- a/addons/firesupport/functions/fnc_check_values.sqf +++ b/addons/firesupport/functions/fnc_check_values.sqf @@ -20,15 +20,41 @@ params [["_updateSlider",false]]; +private _firingStyle = lbText [FIRING_TYPE_IDC,lbCurSel FIRING_TYPE_IDC]; + +if (_firingStyle isEqualTo (localize "STR_tun_firesupport_firemode_standard")) then { + //private _distance = ctrlText EASTING_END_IDC; + private _direction = ctrlText NORTHING_END_IDC; + private _directionParset = parseNumber _direction; + ctrlSetText [NORTHING_END_IDC, str _directionParset]; + + if (_directionParset < 0) then { + ctrlSetText [NORTHING_END_IDC, "0"]; + }; + + if (count _direction > 3) then { + ctrlSetText [NORTHING_END_IDC, _direction select [0,3]]; + }; + + if (_directionParset isEqualTo 360) then { + ctrlSetText [NORTHING_END_IDC, "0"]; + }; + + if (_directionParset > 359 && _directionParset isNotEqualTo 360) then { + ctrlSetText [NORTHING_END_IDC, "359"]; + }; + +}; + private _listArray = tvCurSel ARTY_LIST_IDC; if (count _listArray isNotEqualTo 2) exitWith { }; private _gunModule = (tvData [ARTY_LIST_IDC, [(_listArray select 0)]]) call BIS_fnc_objectFromNetId; private _ammoModule = (tvData [ARTY_LIST_IDC, _listArray]) call BIS_fnc_objectFromNetId; -private _min_spread = _gunModule getVariable ["spreadMin", 50]; -private _max_spread = _gunModule getVariable ["spreadMax", 500]; -private _min_delay = _gunModule getVariable ["delayMin", 1]; -private _max_delay = _gunModule getVariable ["delayMax", 60]; +private _minSpread = _gunModule getVariable ["spreadMin", 50]; +private _maxSpread = _gunModule getVariable ["spreadMax", 500]; +private _mindelay = _gunModule getVariable ["delayMin", 1]; +private _maxdelay = _gunModule getVariable ["delayMax", 60]; private _currentAmmoCount = _ammoModule getVariable ["currentCount", 0]; private _ammoValue = -1; private _radiusValue = -1; @@ -52,20 +78,20 @@ if (_ammoValue < 0) then { _ammoValue = 0; }; -if (_radiusValue > _max_spread) then { - _radiusValue = _max_spread; +if (_radiusValue > _maxSpread) then { + _radiusValue = _maxSpread; }; -if (_radiusValue < _min_spread) then { - _radiusValue = _min_spread; +if (_radiusValue < _minSpread) then { + _radiusValue = _minSpread; }; -if (_delayValue > _max_delay) then { - _delayValue = _max_delay; +if (_delayValue > _maxdelay) then { + _delayValue = _maxdelay; }; -if (_delayValue < _min_delay || 0.5 > _delayValue) then { - _delayValue = _min_delay; +if (_delayValue < _mindelay || 0.5 > _delayValue) then { + _delayValue = _mindelay; }; sliderSetPosition [SLIDER_AMMO, _ammoValue]; @@ -75,3 +101,7 @@ sliderSetPosition [SLIDER_DELAY, _delayValue]; ctrlSetText [COUNT_IDC, str _ammoValue]; ctrlSetText [RANGE_IDC, str _radiusValue]; ctrlSetText [DELAY_IDC, str _delayValue]; + +[] call FUNC(firingPosMarker); + + diff --git a/addons/firesupport/functions/fnc_convertData.sqf b/addons/firesupport/functions/fnc_convertData.sqf new file mode 100644 index 0000000..1c5c5ba --- /dev/null +++ b/addons/firesupport/functions/fnc_convertData.sqf @@ -0,0 +1,61 @@ +/* + * Author: [Tuntematon] + * [Description] + * + * Arguments: + * 0: The first argument + * 1: The second argument + * 2: Multiple input types + * 3: Optional input (default: true) + * 4: Optional input with multiple types (default: {true}) + * 5: Not mandatory input (default: nil) + * + * Return Value: + * The return value + * + * Example: + * [true] call tun_firesupport_fnc_convertData + */ +#include "script_component.hpp" + +params ["_dataType"]; + +private _finalValues = []; + +if (_dataType) then { + private _tunData = ctrlText ((uiNamespace getVariable "tun_firesupport_convertDialog") displayCtrl TUNDATA); + if !("[" in _tunData && {"]" in _tunData}) exitWith { systemChat "Not array" }; + _tunData = call compile _tunData; + if (IS_ARRAY(_tunData)) then { + _tunData = _tunData select 1; + private _type = swt_cfgMarkers_names find swt_markers_mark_type; + private _color = swt_cfgMarkerColors_names find swt_markers_mark_color; + { + private _params = _x; + if (count _params > 2 && IS_ARRAY(_params)) then { + _params params ["_name", "_easting", "_northing"]; + private _pos = ([_easting, _northing, nil, nil, true] call FUNC(getTargetPositon)) select 0; + _finalValues pushBack [_name, _pos, _Type, _Color, 0, 1]; + }; + } forEach _tunData; + ((uiNamespace getVariable "tun_firesupport_convertDialog") displayCtrl SWTDATA) ctrlSetText (str _finalValues); + }; +} else { + private _swtData = ctrlText ((uiNamespace getVariable "tun_firesupport_convertDialog") displayCtrl SWTDATA); + if !("[" in _swtData && {"]" in _swtData}) exitWith { systemChat "Not array" }; + _swtData = call compile _swtData; + if (IS_ARRAY(_swtData)) then { + { + private _params = _x; + if (count _params > 1 && IS_ARRAY(_params)) then { + _params params ["_name", "_pos"]; + private _pos = mapGridPosition _pos; + private _lenght = (count _pos)/2; + private _easting = _pos select [0,_lenght]; + private _northing = _pos select [_lenght]; + _finalValues pushBack [_name, _easting, _northing]; + }; + } forEach _swtData; + ((uiNamespace getVariable "tun_firesupport_convertDialog") displayCtrl TUNDATA) ctrlSetText (str [[],_finalValues]); + }; +}; \ No newline at end of file diff --git a/addons/firesupport/functions/fnc_createConvertDiaryEntry.sqf b/addons/firesupport/functions/fnc_createConvertDiaryEntry.sqf new file mode 100644 index 0000000..75d3bd9 --- /dev/null +++ b/addons/firesupport/functions/fnc_createConvertDiaryEntry.sqf @@ -0,0 +1,25 @@ +/* + * Author: [Tuntematon] + * [Description] + * + * Arguments: + * 0: The first argument + * 1: The second argument + * 2: Multiple input types + * 3: Optional input (default: true) + * 4: Optional input with multiple types (default: {true}) + * 5: Not mandatory input (default: nil) + * + * Return Value: + * The return value + * + * Example: + * ["something", player] call tun_firesupport_fnc_createConvertDiaryEntry + */ +#include "script_component.hpp" + +if (isClass(configFile >> "CfgPatches" >> "swt_markers")) then { + player createDiarySubject ["STR_tun_firesupport_briefing_subject" call BIS_fnc_localize, "STR_tun_firesupport_briefing_subject" call BIS_fnc_localize]; + player createDiaryRecord ["STR_tun_firesupport_briefing_subject" call BIS_fnc_localize, ["STR_tun_firesupport_briefing_convertRecord" call BIS_fnc_localize,"STR_tun_firesupport_briefing_convertRecord_text" call BIS_fnc_localize + ]]; +}; \ No newline at end of file diff --git a/addons/firesupport/functions/fnc_createTRPmarkers.sqf b/addons/firesupport/functions/fnc_createTRPmarkers.sqf new file mode 100644 index 0000000..a2ae131 --- /dev/null +++ b/addons/firesupport/functions/fnc_createTRPmarkers.sqf @@ -0,0 +1,41 @@ +/* + * Author: [Tuntematon] + * [Description] + * + * Arguments: + * 0: The first argument + * 1: The second argument + * 2: Multiple input types + * 3: Optional input (default: true) + * 4: Optional input with multiple types (default: {true}) + * 5: Not mandatory input (default: nil) + * + * Return Value: + * The return value + * + * Example: + * ["something", player] call tun_firesupport_fnc_createTRPmarkers + */ +#include "script_component.hpp" + +if !(GVAR(enableShowTRPmarkers)) then {}; + +[] call FUNC(deleteTRPmarkers); +private _hasSWT = isClass(configFile >> "CfgPatches" >> "swt_markers"); +private _trpArray = GVAR(trpValues); +private _swtMarkers = missionNamespace getVariable ["swt_markers_allMarkers_params", []]; +{ + private _name = _x select 0; + + if (_hasSWT && { (_swtMarkers findIf {_x select 2 isEqualTo _name}) isEqualTo -1 }) then { + private _easting = _x select 1; + private _northing = _x select 2; + private _position = ([_easting, _northing] call FUNC(getTargetPositon)) select 0; + + _name = _name select [0, (_name find "[")]; + private _marker = createMarkerLocal [format ["Tun-Firesupport_%1",_name], _position]; + _marker setMarkerTypeLocal GVAR(trpMarkerType); + _marker setMarkerTextLocal _name; + GVAR(trpMarkers) pushBack _marker; + }; +} forEach _trpArray; \ No newline at end of file diff --git a/addons/firesupport/functions/fnc_deleteTRPmarkers.sqf b/addons/firesupport/functions/fnc_deleteTRPmarkers.sqf new file mode 100644 index 0000000..204a9eb --- /dev/null +++ b/addons/firesupport/functions/fnc_deleteTRPmarkers.sqf @@ -0,0 +1,25 @@ +/* + * Author: [Tuntematon] + * [Description] + * + * Arguments: + * 0: The first argument + * 1: The second argument + * 2: Multiple input types + * 3: Optional input (default: true) + * 4: Optional input with multiple types (default: {true}) + * 5: Not mandatory input (default: nil) + * + * Return Value: + * The return value + * + * Example: + * ["something", player] call tun_firesupport_fnc_deleteTRPmarkers + */ +#include "script_component.hpp" + +{ + deleteMarkerLocal _x; +} forEach GVAR(trpMarkers); + +GVAR(trpMarkers) = []; \ No newline at end of file diff --git a/addons/firesupport/functions/fnc_dialog_close.sqf b/addons/firesupport/functions/fnc_dialog_close.sqf index 3196d6e..9f4609d 100644 --- a/addons/firesupport/functions/fnc_dialog_close.sqf +++ b/addons/firesupport/functions/fnc_dialog_close.sqf @@ -16,5 +16,21 @@ private _values = [ctrlText EASTING_IDC, ctrlText NORTHING_IDC, ctrlText EASTING_END_IDC, ctrlText NORTHING_END_IDC]; player setVariable [QGVAR(oldCoordinates), _values]; +player setVariable [QGVAR(saveToggleVolley), (cbChecked (findDisplay MAIN_IDD displayCtrl TOGGLEVOLLEY))]; +player setVariable [QGVAR(saveToggleMapMove), (cbChecked (findDisplay MAIN_IDD displayCtrl TOGGLEMAPMOVE))]; -[GVAR(dialog_PFH)] call CBA_fnc_removePerFrameHandler; \ No newline at end of file +[GVAR(dialog_PFH)] call CBA_fnc_removePerFrameHandler; + +deleteMarkerLocal (GVAR(firingPosMarkerStart) select 0); +deleteMarkerLocal GVAR(firingPosMarkerEnd); +deleteMarkerLocal (GVAR(firingPosMarkerStart) select 1); +deleteMarkerLocal (GVAR(firingPosMarkerArea) select 0); +deleteMarkerLocal (GVAR(firingPosMarkerArea) select 1); + +GVAR(firingPosMarkerStart) = ["",""]; +GVAR(firingPosMarkerEnd) = ""; +GVAR(firingPosMarkerArea) = ["",""]; + +if !(GVAR(alwaysShowTRPmarkers)) then { + [] call FUNC(deleteTRPmarkers); +}; \ No newline at end of file diff --git a/addons/firesupport/functions/fnc_fire.sqf b/addons/firesupport/functions/fnc_fire.sqf index d9d65c9..805e822 100644 --- a/addons/firesupport/functions/fnc_fire.sqf +++ b/addons/firesupport/functions/fnc_fire.sqf @@ -48,7 +48,6 @@ private _radius = parseNumber ctrlText RANGE_IDC; private _delay = parseNumber ctrlText DELAY_IDC; private _firing_style = lbText [FIRING_TYPE_IDC,lbCurSel FIRING_TYPE_IDC]; - //Due to shit desing, no timed strikes to queue. if (_gunModule getVariable [QGVAR(is_firing), false] && _timeToggle) exitWith { playSound "3DEN_notificationWarning"; @@ -59,26 +58,21 @@ private _trp1Index = lbCurSel TRP1_LIST; private _trp2Index = lbCurSel TRP2_LIST; //No trp selected -if (((_trp1Index == -1) && _trp1Toggle) || ((_trp2Index == -1) && _trp2Toggle))exitWith { +if (((_trp1Index isEqualTo -1) && _trp1Toggle) || ((_trp2Index isEqualTo -1) && _trp2Toggle))exitWith { playSound "3DEN_notificationWarning"; hintSilent localize "STR_tun_firesupport_NoTrpSelected"; }; -//TRP & positions -if (_trp1Toggle) then { - private _trp1Values = GVAR(trpValues) select _trp1Index; - _easting = _trp1Values select 1; - _northing = _trp1Values select 2; -}; +//Get positions +private _positions = [] call FUNC(getTargetPositon); -if (_trp2Toggle) then { - private _trp2Values = GVAR(trpValues) select _trp2Index; - _easting_end = _trp2Values select 1; - _northing_end = _trp2Values select 2; +if (_positions isEqualTo "fail") exitWith { + playSound "3DEN_notificationWarning"; + hintSilent "Failed to get firing positions!"; }; -private _position = [[_easting, _northing], true] call CBA_fnc_mapGridToPos; -private _positionEnd = [[_easting_end, _northing_end], true] call CBA_fnc_mapGridToPos; +_position = _positions select 0; +_positionEnd = _positions select 1; //Out of range private _distanceRange = _gunModule distance _position; diff --git a/addons/firesupport/functions/fnc_firingPosMarker.sqf b/addons/firesupport/functions/fnc_firingPosMarker.sqf new file mode 100644 index 0000000..899458f --- /dev/null +++ b/addons/firesupport/functions/fnc_firingPosMarker.sqf @@ -0,0 +1,119 @@ +/* + * Author: [Tuntematon] + * [Description] + * + * Arguments: + * 0: The first argument + * 1: The second argument + * 2: Multiple input types + * 3: Optional input (default: true) + * 4: Optional input with multiple types (default: {true}) + * 5: Not mandatory input (default: nil) + * + * Return Value: + * The return value + * + * Example: + * [] call tun_firesupport_fnc_firingPosMarker + */ +#include "script_component.hpp" + +if !(GVAR(enableFiringPosMarker)) exitWith { }; +private _listArray = tvCurSel ARTY_LIST_IDC; +if (count _listArray isNotEqualTo 2) exitWith { }; + +private _markerStartPoint = GVAR(firingPosMarkerStart) select 0; +private _markerEndPoint = GVAR(firingPosMarkerEnd); +private _markerStartPointArea1 = GVAR(firingPosMarkerStart) select 1; +private _markerStartPointArea2 = GVAR(firingPosMarkerArea) select 0; +private _markerStartPointArea3 = GVAR(firingPosMarkerArea) select 1; + +private _positions = [] call FUNC(getTargetPositon); +if (_positions isEqualTo "fail") exitWith { }; + +private _positionStart = _positions select 0; +private _positionEnd = _positions select 1; +private _firingStyle = lbText [FIRING_TYPE_IDC,lbCurSel FIRING_TYPE_IDC]; +private _radius = parseNumber ctrlText RANGE_IDC; +private _color = "ColorRed"; +private _alpha = 0.5; +private _brush = "grid"; + +//auto move map to target pos. +private _mapMoveToggle = (findDisplay MAIN_IDD displayCtrl TOGGLEMAPMOVE); + +if (cbChecked _mapMoveToggle) then { + private _control = (findDisplay MAIN_IDD) displayCtrl MINIMAP_IDC; + private _scale = ctrlMapScale _control; + ctrlMapAnimClear _control; + _control ctrlMapAnimAdd [0.3, _scale, _positionStart]; + ctrlMapAnimCommit _control; +}; + +if (_markerStartPoint isEqualTo "") then { + private _markerStartPoint = createMarkerLocal ["tun_firesupport_startPointMarker", _positionStart]; + _markerStartPoint setMarkerTypeLocal "mil_dot_noShadow"; + _markerStartPoint setMarkerTextLocal "1st pos"; + + _markerStartPointArea1 = createMarkerLocal ["tun_firesupport_startPointMarkerArea1", _positionStart]; + _markerStartPointArea1 setMarkerShapeLocal "Ellipse"; + _markerStartPointArea1 setMarkerSizeLocal [_radius, _radius]; + _markerStartPointArea1 setMarkerBrush _brush; + _markerStartPointArea1 setMarkerAlphaLocal _alpha; + _markerStartPointArea1 setMarkerColorLocal _color; + GVAR(firingPosMarkerStart) = [_markerStartPoint, _markerStartPointArea1]; +} else { + _markerStartPoint setMarkerPosLocal _positionStart; + + _markerStartPointArea1 setMarkerPosLocal _positionStart; + _markerStartPointArea1 setMarkerSizeLocal [_radius, _radius]; +}; + +if (_firingStyle isNotEqualTo (localize "STR_tun_firesupport_firemode_standard")) then { + + if ( _markerEndPoint isEqualTo "") then { + private _markerEndPoint = createMarkerLocal ["tun_firesupport_endPointMarker", _positionEnd]; + _markerEndPoint setMarkerTypeLocal "mil_dot_noShadow"; + _markerEndPoint setMarkerTextLocal "2nd pos"; + GVAR(firingPosMarkerEnd) = _markerEndPoint; + } else { + _markerEndPoint setMarkerPosLocal _positionEnd; + }; + + private _dir = _positionStart getDir _positionEnd; + private _distance = (_positionStart distance2D _positionEnd) / 2; + private _newPos = _positionStart getPos [_distance, _dir]; + + if (_markerStartPointArea2 isEqualTo "") then { + _markerStartPointArea2 = createMarkerLocal ["tun_firesupport_startPointMarkerArea2", _newPos]; + _markerStartPointArea2 setMarkerShapeLocal "Rectangle"; + _markerStartPointArea2 setMarkerDir _dir; + _markerStartPointArea2 setMarkerSizeLocal [_radius, _distance]; + + _markerStartPointArea3 = createMarkerLocal ["tun_firesupport_startPointMarkerArea3", _positionEnd]; + _markerStartPointArea3 setMarkerShapeLocal "Ellipse"; + _markerStartPointArea3 setMarkerSizeLocal [_radius, _radius]; + + { + private _marker = _x; + _marker setMarkerBrush _brush; + _marker setMarkerAlphaLocal _alpha; + _marker setMarkerColorLocal _color; + } forEach [_markerStartPointArea2, _markerStartPointArea3]; + GVAR(firingPosMarkerArea) = [_markerStartPointArea2, _markerStartPointArea3]; + } else { + _markerStartPointArea2 setMarkerPosLocal _newPos; + _markerStartPointArea2 setMarkerDir _dir; + _markerStartPointArea2 setMarkerSizeLocal [_radius, _distance]; + + _markerStartPointArea3 setMarkerPosLocal _positionEnd; + _markerStartPointArea3 setMarkerSizeLocal [_radius, _radius]; + }; +} else { + deleteMarkerLocal GVAR(firingPosMarkerEnd); + deleteMarkerLocal (GVAR(firingPosMarkerArea) select 0); + deleteMarkerLocal (GVAR(firingPosMarkerArea) select 1); + + GVAR(firingPosMarkerEnd) = ""; + GVAR(firingPosMarkerArea) = ["",""]; +}; \ No newline at end of file diff --git a/addons/firesupport/functions/fnc_getTargetPositon.sqf b/addons/firesupport/functions/fnc_getTargetPositon.sqf new file mode 100644 index 0000000..f8a011f --- /dev/null +++ b/addons/firesupport/functions/fnc_getTargetPositon.sqf @@ -0,0 +1,69 @@ +/* + * Author: [Tuntematon] + * [Description] + * + * Arguments: + * 0: The first argument + * 1: The second argument + * 2: Multiple input types + * 3: Optional input (default: true) + * 4: Optional input with multiple types (default: {true}) + * 5: Not mandatory input (default: nil) + * + * Return Value: + * The return value + * + * Example: + * [_easting, _northing, _eastingEnd, _northingEnd, _skipFiremode] call tun_firesupport_fnc_getTargetPositon + */ +#include "script_component.hpp" + +params [ + ["_easting", ctrlText EASTING_IDC], + ["_northing", ctrlText NORTHING_IDC], + ["_eastingEnd", ctrlText EASTING_END_IDC], + ["_northingEnd", ctrlText NORTHING_END_IDC], + ["_skipFiremode", false] +]; + + +private _trp1Toggle = cbChecked (findDisplay MAIN_IDD displayCtrl TRP1); +private _trp2Toggle = cbChecked (findDisplay MAIN_IDD displayCtrl TRP2); +private _firing_style = lbText [FIRING_TYPE_IDC,lbCurSel FIRING_TYPE_IDC]; + +private _trp1Index = lbCurSel TRP1_LIST; +private _trp2Index = lbCurSel TRP2_LIST; +private _return = "fail"; + +//No trp selected +if !(((_trp1Index isEqualTo -1) && _trp1Toggle) || ((_trp2Index isEqualTo -1) && _trp2Toggle)) then { + //TRP & positions + if (_trp1Toggle) then { + private _trp1Values = GVAR(trpValues) select _trp1Index; + _easting = _trp1Values select 1; + _northing = _trp1Values select 2; + }; + + if (_trp2Toggle) then { + private _trp2Values = GVAR(trpValues) select _trp2Index; + _eastingEnd = _trp2Values select 1; + _northingEnd = _trp2Values select 2; + }; + + private _positionStart = [[_easting, _northing], false] call CBA_fnc_mapGridToPos; + private _positionEnd = [0,0,0]; + + if !(_skipFiremode) then { + if (_firing_style isEqualTo (localize "STR_tun_firesupport_firemode_standard")) then { + _positionStart = _positionStart getPos [parseNumber _eastingEnd, parseNumber _northingEnd]; + } else { + + _positionEnd = [[_eastingEnd, _northingEnd], false] call CBA_fnc_mapGridToPos; + }; + }; + MAP(_positionStart,_x + 1); + MAP(_positionEnd,_x + 1); + _return = [_positionStart, _positionEnd]; +}; + +_return \ No newline at end of file diff --git a/addons/firesupport/functions/fnc_modify_bookmarks.sqf b/addons/firesupport/functions/fnc_modify_bookmarks.sqf index b806618..6e83156 100644 --- a/addons/firesupport/functions/fnc_modify_bookmarks.sqf +++ b/addons/firesupport/functions/fnc_modify_bookmarks.sqf @@ -62,7 +62,7 @@ switch (toLower _value) do { private _name = ctrlText BOOKMARK_NAME_VALUE_IDC; private _easting = ctrlText EASTING_IDC; private _northing = ctrlText NORTHING_IDC; - private _position = [[_easting, _northing], true] call CBA_fnc_mapGridToPos; + //private _position = ([] call FUNC(getTargetPositon)) select 0; _name = format["TRP-%1 [%2:%3]",_name, _easting, _northing]; GVAR(trpValues) pushBackUnique [_name, _easting, _northing]; }; diff --git a/addons/firesupport/functions/fnc_module_gun.sqf b/addons/firesupport/functions/fnc_module_gun.sqf index acdb223..8ce9276 100644 --- a/addons/firesupport/functions/fnc_module_gun.sqf +++ b/addons/firesupport/functions/fnc_module_gun.sqf @@ -16,7 +16,6 @@ if (!isServer) exitWith { }; private _gunModule = param [0,objNull,[objNull]]; -//TODO lisää conffiin että voi muuttaa private _classname = _gunModule getVariable ["className", "Missing classname"]; private _name = _gunModule getVariable ["displayName", "Missing name"]; private _side = _gunModule getVariable ["side", sideLogic]; @@ -32,12 +31,10 @@ private _color = "colorCivilian"; // private _minRange= _gunModule getVariable ["minRange", 0]; // private _maxRange = _gunModule getVariable ["maxRange", 10000]; - if (_gunCount < 1) then { _gunModule setVariable [QGVAR(gunCount), 1, true]; }; - //Ammo module stuff { private _obj = _x; diff --git a/addons/firesupport/functions/fnc_openConvertDialog.sqf b/addons/firesupport/functions/fnc_openConvertDialog.sqf new file mode 100644 index 0000000..d79e78f --- /dev/null +++ b/addons/firesupport/functions/fnc_openConvertDialog.sqf @@ -0,0 +1,25 @@ +/* + * Author: [Tuntematon] + * [Description] + * + * Arguments: + * 0: The first argument + * 1: The second argument + * 2: Multiple input types + * 3: Optional input (default: true) + * 4: Optional input with multiple types (default: {true}) + * 5: Not mandatory input (default: nil) + * + * Return Value: + * The return value + * + * Example: + * [] call tun_firesupport_fnc_openConvertDialog + */ +#include "script_component.hpp" + +private _displays = [52,53,37,12]; +private _result = _displays findIf {!isNull findDisplay _x}; +private _display = _displays select _result; +private _control = findDisplay _display createDisplay "tun_firesupport_convertDialog"; +uiNamespace setVariable ["tun_firesupport_convertDialog", _control ]; \ No newline at end of file diff --git a/addons/firesupport/functions/fnc_open_dialog.sqf b/addons/firesupport/functions/fnc_open_dialog.sqf index 3fa471e..a8a819a 100644 --- a/addons/firesupport/functions/fnc_open_dialog.sqf +++ b/addons/firesupport/functions/fnc_open_dialog.sqf @@ -23,7 +23,7 @@ waitUntil {!isnull (findDisplay MAIN_IDD)}; [true, true] call FUNC(trpCheckbox); -private _oldCoordinates = player getVariable [QGVAR(oldCoordinates),["00000","00000","00000","00000"]]; +private _oldCoordinates = player getVariable [QGVAR(oldCoordinates),["00000","00000","0","0"]]; ctrlSetText [EASTING_IDC, (_oldCoordinates select 0) ]; ctrlSetText [NORTHING_IDC, (_oldCoordinates select 1) ]; @@ -97,10 +97,13 @@ sliderSetSpeed [SLIDER_AMMO, 1, 1]; sliderSetSpeed [SLIDER_RADIUS, 1, 1]; sliderSetSpeed [SLIDER_DELAY, 0.1, 0.1]; -(findDisplay MAIN_IDD displayCtrl TOGGLEVOLLEY) cbSetChecked true; + +(findDisplay MAIN_IDD displayCtrl TOGGLEVOLLEY) cbSetChecked (player getVariable [QGVAR(saveToggleVolley), true]); +(findDisplay MAIN_IDD displayCtrl TOGGLEMAPMOVE) cbSetChecked (player getVariable [QGVAR(saveToggleMapMove), true]); [] call FUNC(update_firemode); [] call FUNC(timeCheckbox); +[] call FUNC(createTRPmarkers); //Start layout ctrlShow [BOOKMARK_LIST_IDC, false]; diff --git a/addons/firesupport/functions/fnc_removeQueue.sqf b/addons/firesupport/functions/fnc_removeQueue.sqf index 0bbd8d6..e105fc2 100644 --- a/addons/firesupport/functions/fnc_removeQueue.sqf +++ b/addons/firesupport/functions/fnc_removeQueue.sqf @@ -37,7 +37,7 @@ if (_textQueue isEqualTo _firemissionText) then { _reservedCount = _reservedCount - _ammoCount; private _firemission = _firemissions select _curSelected; - if (_curSelected == 0) then { + if (_curSelected isEqualTo 0) then { if (_status isEqualTo ("STR_tun_firesupport_status_calculating" call BIS_fnc_localize)) then { _firemissions deleteAt _curSelected; _ammoModule setVariable ["reservedCount", _reservedCount, true]; @@ -53,7 +53,7 @@ if (_textQueue isEqualTo _firemissionText) then { _this params ["_gunModule", "_firemission"]; private _firemissions = _gunModule getVariable [QGVAR(firemissions), []]; private _value = _firemissions find _firemission; - if (_value != -1) then { + if (_value isNotEqualTo -1) then { _firemissions deleteAt _value; _gunModule setVariable [QGVAR(firemissions), _firemissions, true]; }; diff --git a/addons/firesupport/functions/fnc_setValues.sqf b/addons/firesupport/functions/fnc_setValues.sqf index e36c8ba..cab077f 100644 --- a/addons/firesupport/functions/fnc_setValues.sqf +++ b/addons/firesupport/functions/fnc_setValues.sqf @@ -27,7 +27,7 @@ if (_count > 0) then { } forEach _firemissions; }; -if (_count != 2) exitWith { }; +if (_count isNotEqualTo 2) exitWith { }; private _ammoModule = (tvData [ARTY_LIST_IDC, _listArray]) call BIS_fnc_objectFromNetId; @@ -48,4 +48,6 @@ sliderSetRange [SLIDER_DELAY, _min_delay, _max_delay]; sliderSetPosition [SLIDER_DELAY, _min_delay]; ctrlSetText [DELAY_IDC, str _min_delay]; -ctrlSetText [REMAINIG_AMMO_IDC, str _countAmmo]; \ No newline at end of file +ctrlSetText [REMAINIG_AMMO_IDC, str _countAmmo]; + +[] call FUNC(firingPosMarker); \ No newline at end of file diff --git a/addons/firesupport/functions/fnc_toggle_mode.sqf b/addons/firesupport/functions/fnc_toggle_mode.sqf index a54901e..b3f6b54 100644 --- a/addons/firesupport/functions/fnc_toggle_mode.sqf +++ b/addons/firesupport/functions/fnc_toggle_mode.sqf @@ -68,4 +68,4 @@ if (_selected isEqualTo 2) then { } else { ctrlShow [QUEUELIST, false]; ctrlShow [QUEUEREMOVE, false]; -}; \ No newline at end of file +}; diff --git a/addons/firesupport/functions/fnc_updateStatus.sqf b/addons/firesupport/functions/fnc_updateStatus.sqf index 4101730..1e568a4 100644 --- a/addons/firesupport/functions/fnc_updateStatus.sqf +++ b/addons/firesupport/functions/fnc_updateStatus.sqf @@ -19,7 +19,7 @@ if ((count _listArray > 0)) then { _gunModule = (tvData [ARTY_LIST_IDC, [(_listArray select 0)]]) call BIS_fnc_objectFromNetId; private _firemissions = _gunModule getVariable [QGVAR(firemissions), []]; private _selected = lbCurSel CHANGE_MODE; - if (count _firemissions != lbSize QUEUELIST && _selected == 2) then { + if (count _firemissions isNotEqualTo lbSize QUEUELIST && _selected isEqualTo 2) then { lbClear QUEUELIST; { @@ -29,7 +29,6 @@ if ((count _listArray > 0)) then { }; }; - if (count _listArray < 2) exitWith { ctrlSetText [STATUS_IDC, "STR_tun_firesupport_status_none" call BIS_fnc_localize]; }; @@ -49,5 +48,4 @@ private _ammoModule = _ammoModuleID call BIS_fnc_objectFromNetId; private _currentAmmoCount = _ammoModule getVariable ["currentCount", -1]; private _reservedCount = _ammoModule getVariable ["reservedCount", -1]; private _text = format ["%1 (%2)",_currentAmmoCount, (_currentAmmoCount - _reservedCount)]; -ctrlSetText [REMAINIG_AMMO_IDC, _text]; - +ctrlSetText [REMAINIG_AMMO_IDC, _text]; \ No newline at end of file diff --git a/addons/firesupport/functions/fnc_update_bookmarks.sqf b/addons/firesupport/functions/fnc_update_bookmarks.sqf index 11a5ab7..b8d40fe 100644 --- a/addons/firesupport/functions/fnc_update_bookmarks.sqf +++ b/addons/firesupport/functions/fnc_update_bookmarks.sqf @@ -37,4 +37,6 @@ lbClear TRP2_LIST; lbAdd [TRP1_LIST, _name]; lbAdd [TRP2_LIST, _name]; -} forEach GVAR(trpValues); \ No newline at end of file +} forEach GVAR(trpValues); + +[] call FUNC(createTRPmarkers); \ No newline at end of file diff --git a/addons/firesupport/functions/fnc_update_firemode.sqf b/addons/firesupport/functions/fnc_update_firemode.sqf index e28a4bd..d974d10 100644 --- a/addons/firesupport/functions/fnc_update_firemode.sqf +++ b/addons/firesupport/functions/fnc_update_firemode.sqf @@ -19,11 +19,21 @@ private _firing_style = lbText [FIRING_TYPE_IDC,lbCurSel FIRING_TYPE_IDC]; switch (_firing_style) do { case (localize "STR_tun_firesupport_firemode_standard"): { - ctrlEnable [EASTING_END_IDC, false]; - ctrlEnable [NORTHING_END_IDC, false]; - ctrlEnable [EASTING_END_TEXT_IDC, false]; - ctrlEnable [NORTHING_END_TEXT_IDC, false]; + ctrlEnable [EASTING_END_IDC, true]; + ctrlEnable [NORTHING_END_IDC, true]; + ctrlEnable [EASTING_END_TEXT_IDC, true]; + ctrlEnable [NORTHING_END_TEXT_IDC, true]; + + + ctrlEnable [TRP2, false]; + (findDisplay MAIN_IDD displayCtrl TRP2) cbSetChecked false; + [false, true] call FUNC(trpCheckbox); + ctrlSetText [EASTING_END_TEXT_IDC, ("STR_tun_firesupport_correctionDistance" call BIS_fnc_localize)]; + ctrlSetText [NORTHING_END_TEXT_IDC, ("STR_tun_firesupport_correctionDirection" call BIS_fnc_localize)]; + (findDisplay MAIN_IDD displayCtrl EASTING_END_IDC) ctrlSetTooltip ("STR_tun_firesupport_correctionDistance_tooltip" call BIS_fnc_localize); + (findDisplay MAIN_IDD displayCtrl NORTHING_END_IDC) ctrlSetTooltip ("STR_tun_firesupport_correctionDirection_tooltip" call BIS_fnc_localize); + }; case (localize "STR_tun_firesupport_firemode_creeping_barrage"); @@ -33,9 +43,16 @@ switch (_firing_style) do { ctrlEnable [EASTING_END_TEXT_IDC, true]; ctrlEnable [NORTHING_END_TEXT_IDC, true]; ctrlEnable [TRP2, true]; + [true, true] call FUNC(trpCheckbox); + ctrlSetText [EASTING_END_TEXT_IDC, ("STR_tun_firesupport_easting_end_point" call BIS_fnc_localize)]; + ctrlSetText [NORTHING_END_TEXT_IDC, ("STR_tun_firesupport_northing_end_point" call BIS_fnc_localize)]; + (findDisplay MAIN_IDD displayCtrl EASTING_END_IDC) ctrlSetTooltip ("STR_tun_firesupport_coordinates_tooltip_easting" call BIS_fnc_localize); + (findDisplay MAIN_IDD displayCtrl NORTHING_END_IDC) ctrlSetTooltip ("STR_tun_firesupport_coordinates_tooltip_northing" call BIS_fnc_localize); }; default { hint "Missing Update firemode"; }; -}; \ No newline at end of file +}; + +[] call FUNC(firingPosMarker); \ No newline at end of file diff --git a/addons/firesupport/script_component.hpp b/addons/firesupport/script_component.hpp index e26f1b1..60cb0e7 100644 --- a/addons/firesupport/script_component.hpp +++ b/addons/firesupport/script_component.hpp @@ -2,9 +2,9 @@ #define PREFIX Tun #define MAJOR 2 -#define MINOR 0 -#define PATCHLVL 1 -#define BUILD 21082021 +#define MINOR 1 +#define PATCHLVL 0 +#define BUILD 05062022 #define VERSION MAJOR.MINOR.PATCHLVL.BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD