diff --git a/addons/briefingtime/XEH_postInit_client.sqf b/addons/briefingtime/XEH_postInit_client.sqf index e129af6..a0b8754 100644 --- a/addons/briefingtime/XEH_postInit_client.sqf +++ b/addons/briefingtime/XEH_postInit_client.sqf @@ -7,12 +7,12 @@ if (isMultiplayer) then { [{ !isNull findDisplay 53 || !isNull findDisplay 52 }, { private _display = TUNUTI_FIND_MAPDISPLAY; - private _control = findDisplay _display ctrlCreate [QGVAR(timeText), 320001]; + private _control = findDisplay _display ctrlCreate [QGVAR(timeText), TIME_TEXT_IDC]; uiNamespace setVariable [QGVAR(timeText), _control ]; _handle = [{ - private _time = [GVAR(value), "M:SS"] call CBA_fnc_formatElapsedTime; - private _realTime = ((systemTime select 3) * 60 * 60) + ((systemTime select 4) * 60) + (systemTime select 5) + GVAR(value); + private _time = [GVAR(briefingTime), "M:SS"] call CBA_fnc_formatElapsedTime; + private _realTime = ((systemTime select 3) * 60 * 60) + ((systemTime select 4) * 60) + (systemTime select 5) + GVAR(briefingTime); if (_realTime > 86400) then { _realTime = _realTime - 86400; }; diff --git a/addons/briefingtime/XEH_postInit_server.sqf b/addons/briefingtime/XEH_postInit_server.sqf index d5f513b..c9ab920 100644 --- a/addons/briefingtime/XEH_postInit_server.sqf +++ b/addons/briefingtime/XEH_postInit_server.sqf @@ -5,9 +5,9 @@ if (isMultiplayer) then { if (GVAR(enable)) then { _handle = [{ - if (GVAR(value) > 0) then { - DEC(GVAR(value)); - publicVariable QGVAR(value); + if (GVAR(briefingTime) > 0) then { + DEC(GVAR(briefingTime)); + publicVariable QGVAR(briefingTime); }; if (cba_missiontime > 0) then { diff --git a/addons/briefingtime/XEH_preInit.sqf b/addons/briefingtime/XEH_preInit.sqf index 392ff27..1a61b7d 100644 --- a/addons/briefingtime/XEH_preInit.sqf +++ b/addons/briefingtime/XEH_preInit.sqf @@ -18,14 +18,14 @@ PREP_RECOMPILE_END; [ QGVAR(valueSettings), - "SLIDER", + "TIME", ["Briefingtime", "How much there is briefing time at start"], "Tun Utilities - Briefingtime", - [0, 30, 17, 0], + [0, 60, 17*60, 0], 1, { params ["_value"]; - GVAR(value) = round _value * 60; + GVAR(briefingTime) = round _value; }, true ] call CBA_fnc_addSetting; diff --git a/addons/briefingtime/briafingTime.hpp b/addons/briefingtime/briafingTime.hpp index 77a89a5..8b12930 100644 --- a/addons/briefingtime/briafingTime.hpp +++ b/addons/briefingtime/briafingTime.hpp @@ -3,7 +3,7 @@ class GVAR(timeText) : RscText { type = 0; - idc = 320001; + idc = TIME_TEXT_IDC; x = "safeZoneX + safeZoneW * 0.403125"; y = "safeZoneY + safeZoneH * 0.00462963"; w = "safeZoneW * 0.2625"; @@ -14,7 +14,7 @@ class GVAR(timeText) : RscText class GVAR(notificationBox) : GVAR(timeText) { type = 0; - idc = 320006; + idc = NOTIFICATION_BOX_IDC; y = "safeZoneY + safeZoneH * 0.10462963"; h = "safeZoneH * 0.125"; style = 2+16; @@ -23,13 +23,13 @@ class GVAR(notificationBox) : GVAR(timeText) class GVAR(Time) { - idd = 320000; + idd = TIME_IDD; class ControlsBackground { class GVAR(background) : RscText { type = 0; - idc = 320000; + idc = BACKGROUND_IDC; x = "safeZoneX + safeZoneW * 0.4140625"; y = "safeZoneY + safeZoneH * 0.43425926"; w = "safeZoneW * 0.171875"; @@ -45,32 +45,34 @@ class GVAR(Time) class GVAR(timeSlider) : RscXSliderH { type = 43; - idc = 320003; + idc = SLIDER_IDC; x = "safeZoneX + safeZoneW * 0.41875"; y = "safeZoneY + safeZoneH * 0.475"; w = "safeZoneW * 0.1625"; h = "safeZoneH * 0.02962963"; style = 1024; - onSliderPosChanged = QUOTE(LINKFUNC(SliderPosUpdated)); - + onSliderPosChanged = QUOTE(_this call FUNC(SliderPosUpdated)); + sliderStep = 1; + sliderRange[] = {0, 30}; }; + class GVAR(sliderTimeText) : RscText { type = 0; - idc = 320002; + idc = SLIDER_TEXT_IDC; x = "safeZoneX + safeZoneW * 0.41875"; y = "safeZoneY + safeZoneH * 0.44351852"; w = "safeZoneW * 0.1625"; h = "safeZoneH * 0.025"; style = 2; text = "test"; - colorBackground[] = GUI_BCG_COLOR; - + colorBackground[] = GUI_BCG_COLOR; }; + class GVAR(sliderOk) : RscButton { type = 1; - idc = 320004; + idc = SLIDER_OK_IDC; x = "safeZoneX + safeZoneW * 0.54375"; y = "safeZoneY + safeZoneH * 0.525"; w = "safeZoneW * 0.0375"; @@ -79,9 +81,10 @@ class GVAR(Time) text = "Ok"; onMouseButtonClick = QUOTE((uiNamespace getVariable QQGVAR(Time)) closeDisplay 1; [] call FUNC(onCloseDisplay)); }; + class GVAR(sliderCancel) : GVAR(sliderOk) { - idc = 320005; + idc = SLIDER_CANCEL_IDC; x = "safeZoneX + safeZoneW * 0.41875"; text = "Cancel"; onMouseButtonClick = QUOTE(ctrlParent (_this select 0) closeDisplay 1); diff --git a/addons/briefingtime/functions/fnc_SliderPosUpdated.sqf b/addons/briefingtime/functions/fnc_SliderPosUpdated.sqf index d69c634..cddfbe2 100644 --- a/addons/briefingtime/functions/fnc_SliderPosUpdated.sqf +++ b/addons/briefingtime/functions/fnc_SliderPosUpdated.sqf @@ -13,10 +13,10 @@ * [slider, 15] call tunuti_briefingtime_fnc_SliderPosUpdated */ #include "script_component.hpp" - params ["_control", "_newValue"]; + private _text = ["Requesting additional time:", "Set briefing time to:"] select IS_ADMIN; -private _textControl = (uiNamespace getVariable QGVAR(Time)) displayCtrl 320002; +private _textControl = (uiNamespace getVariable QGVAR(Time)) displayCtrl SLIDER_TEXT_IDC; private _roundValue = round _newValue; -_control sliderSetPosition _roundValue; +//_control sliderSetPosition _roundValue; _textControl ctrlSetText (format ["%1 %2min", _text, _roundValue]); \ No newline at end of file diff --git a/addons/briefingtime/functions/fnc_notification.sqf b/addons/briefingtime/functions/fnc_notification.sqf index fb30998..a27d4bb 100644 --- a/addons/briefingtime/functions/fnc_notification.sqf +++ b/addons/briefingtime/functions/fnc_notification.sqf @@ -29,7 +29,7 @@ if (!isNull (uiNamespace getVariable QGVAR(notificationBox))) exitWith { }; private _display = TUNUTI_FIND_MAPDISPLAY; -private _control = findDisplay _display ctrlCreate [QGVAR(notificationBox), 320006]; +private _control = findDisplay _display ctrlCreate [QGVAR(notificationBox), NOTIFICATION_BOX_IDC]; uiNamespace setVariable [QGVAR(notificationBox), _control ]; LOG("create display"); diff --git a/addons/briefingtime/functions/fnc_onCloseDisplay.sqf b/addons/briefingtime/functions/fnc_onCloseDisplay.sqf index 0af13a0..b8cf8f2 100644 --- a/addons/briefingtime/functions/fnc_onCloseDisplay.sqf +++ b/addons/briefingtime/functions/fnc_onCloseDisplay.sqf @@ -14,19 +14,19 @@ */ #include "script_component.hpp" -private _newTime = sliderPosition ((uiNamespace getVariable QGVAR(Time)) displayCtrl 320003); +private _newTime = sliderPosition ((uiNamespace getVariable QGVAR(Time)) displayCtrl SLIDER_IDC); //Create notification and admin will modify if (IS_ADMIN) then { //Update time _newTime = _newTime * 60; - GVAR(value) = _newTime; - publicVariable QGVAR(value); + GVAR(briefingTime) = _newTime; + publicVariable QGVAR(briefingTime); private _debugText = format ["set new time: %1", _newTime]; LOG(_debugText); ["Briefing time has been modified"] remoteExecCall [QFUNC(notification), [0,-2] select isDedicated, false]; } else { - private _text = format ["%2 (%1) has requestend additional %3min briefing time", playerSide, profileName, _newTime]; + private _text = format ["%2 (%1) Has requested an additional %3 minutes of briefing time.", playerSide, profileName, _newTime]; private _debugText = format ["ask new time: %1", _text]; LOG(_debugText); [_text] remoteExecCall [QFUNC(notification), [0,-2] select isDedicated, false]; diff --git a/addons/briefingtime/functions/fnc_openTimeDialog.sqf b/addons/briefingtime/functions/fnc_openTimeDialog.sqf index ce3a063..775aaa0 100644 --- a/addons/briefingtime/functions/fnc_openTimeDialog.sqf +++ b/addons/briefingtime/functions/fnc_openTimeDialog.sqf @@ -17,15 +17,13 @@ private _display = TUNUTI_FIND_MAPDISPLAY; private _control = findDisplay _display createDisplay QGVAR(Time); uiNamespace setVariable [QGVAR(Time), _control ]; -[{!isNull findDisplay 320000}, { - _sliderControl = (uiNamespace getVariable QGVAR(Time)) displayCtrl 320003; - _sliderControl sliderSetRange [0, 30]; - _sliderControl sliderSetSpeed [1, 1]; +[{!isNull findDisplay TUNUTI_FIND_MAPDISPLAY}, { + privateAll; + _sliderControl = (uiNamespace getVariable QGVAR(Time)) displayCtrl SLIDER_IDC; - private _text = ["Requesting additional time:", "Set briefing time to:"] select IS_ADMIN; - private _value = [0, round(GVAR(value) / 60)] select IS_ADMIN; + _text = ["Requesting additional time:", "Set briefing time to:"] select IS_ADMIN; + _value = [0, round(GVAR(briefingTime) / 60)] select IS_ADMIN; _sliderControl sliderSetPosition _value; - _textControl = (uiNamespace getVariable QGVAR(Time)) displayCtrl 320002; + _textControl = (uiNamespace getVariable QGVAR(Time)) displayCtrl SLIDER_TEXT_IDC; _textControl ctrlSetText (format ["%1 %2min", _text, _value]); - }] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/addons/briefingtime/script_component.hpp b/addons/briefingtime/script_component.hpp index 0478228..52e8b43 100644 --- a/addons/briefingtime/script_component.hpp +++ b/addons/briefingtime/script_component.hpp @@ -2,34 +2,20 @@ #define COMPONENT_BEAUTIFIED BriefingTime #include "\x\tunuti\addons\main\script_mod.hpp" -//#define DEBUG_MODE_FULL -//#define DISABLE_COMPILE_CACHE +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE -#ifdef DEBUG_ENABLED_BRIEFINGTIME +#ifdef DEBUG_ENABLED_MAIN #define DEBUG_MODE_FULL #endif - #ifdef DEBUG_SETTINGS_BRIEFINGTIME - #define DEBUG_SETTINGS DEBUG_SETTINGS_BRIEFINGTIME -#endif #include "\x\tunuti\addons\main\script_macros.hpp" -//#include "\a3\3DEN\UI\macros.inc" -//#include "\a3\ui_f\hpp\definecommon.inc" -//#include "\a3\ui_f\hpp\definedikcodes.inc" -#include "\a3\ui_f\hpp\definecommoncolors.inc" -//#include "\a3\ui_f\hpp\definecommongrids.inc" -//#include "\a3\ui_f\hpp\defineresincl.inc" - -// Default grid -#define GUI_GRID_WAbs ((safezoneW / safezoneH) min 1.2) -#define GUI_GRID_HAbs (GUI_GRID_WAbs / 1.2) -#define GUI_GRID_W (GUI_GRID_WAbs / 40) -#define GUI_GRID_H (GUI_GRID_HAbs / 25) -#define GUI_GRID_X (safezoneX) -#define GUI_GRID_Y (safezoneY + safezoneH - GUI_GRID_HAbs) - -// Default text sizes -#define GUI_TEXT_SIZE_SMALL (GUI_GRID_H * 0.8) -#define GUI_TEXT_SIZE_MEDIUM (GUI_GRID_H * 1) -#define GUI_TEXT_SIZE_LARGE (GUI_GRID_H * 1.2) \ No newline at end of file +#define TIME_IDD 1701951 +#define TIME_TEXT_IDC 1701952 +#define NOTIFICATION_BOX_IDC 1701953 +#define BACKGROUND_IDC 1701954 +#define SLIDER_IDC 1701955 +#define SLIDER_TEXT_IDC 1701956 +#define SLIDER_OK_IDC -1 +#define SLIDER_CANCEL_IDC -1 \ No newline at end of file diff --git a/addons/main/script_component.hpp b/addons/main/script_component.hpp index 105d296..d00fb6d 100644 --- a/addons/main/script_component.hpp +++ b/addons/main/script_component.hpp @@ -7,8 +7,5 @@ #ifdef DEBUG_ENABLED_MAIN #define DEBUG_MODE_FULL #endif - #ifdef DEBUG_SETTINGS_MAIN - #define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN -#endif #include "\x\tunuti\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index eddb1cd..3dc5ba2 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -2,13 +2,32 @@ #ifdef DISABLE_COMPILE_CACHE #undef PREP - #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,fncName).sqf) + #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,fncName).sqf) #else #undef PREP - #define PREP(fncName) [QPATHTOF(functions\DOUBLES(fnc,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction + #define PREP(fncName) [QPATHTOF(functions\DOUBLES(fnc,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction #endif -#define TUNUTI_FIND_MAPDISPLAY ([53, 52, 37, 12, nil] select ([53, 52, 37, 12] findIf {!isNull findDisplay _x})) +#define TUNUTI_FIND_MAPDISPLAY ([53, 52, 37, 12, nil] select ([53, 52, 37, 12] findIf {!isNull findDisplay _x})) -#define GITHUBLINK "https://github.com/tuntematonjr/Tun-Utilities" -#define MAIN_ADDON_STR QUOTE(MAIN_ADDON) \ No newline at end of file +#define GITHUBLINK "https://github.com/tuntematonjr/Tun-Utilities" +#define MAIN_ADDON_STR QUOTE(MAIN_ADDON) + +//This forces debug on everything. +//#define DEBUG_ENABLED_MAIN + + +#include "\a3\ui_f\hpp\definecommoncolors.inc" + +// Default grid +#define GUI_GRID_WAbs ((safezoneW / safezoneH) min 1.2) +#define GUI_GRID_HAbs (GUI_GRID_WAbs / 1.2) +#define GUI_GRID_W (GUI_GRID_WAbs / 40) +#define GUI_GRID_H (GUI_GRID_HAbs / 25) +#define GUI_GRID_X (safezoneX) +#define GUI_GRID_Y (safezoneY + safezoneH - GUI_GRID_HAbs) + +// Default text sizes +#define GUI_TEXT_SIZE_SMALL (GUI_GRID_H * 0.8) +#define GUI_TEXT_SIZE_MEDIUM (GUI_GRID_H * 1) +#define GUI_TEXT_SIZE_LARGE (GUI_GRID_H * 1.2) \ No newline at end of file diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 918b766..58f1487 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -6,7 +6,7 @@ #define VERSION MAJOR.MINOR #define VERSION_AR MAJOR,MINOR,PATCH,BUILD -#define REQUIRED_VERSION 2.14 +#define REQUIRED_VERSION 2.18 #ifdef COMPONENT_BEAUTIFIED #define COMPONENT_NAME QUOTE(tunuti - COMPONENT_BEAUTIFIED) diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index 3f2dbc5..6c8d577 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 1 #define MINOR 4 -#define PATCH 2 +#define PATCH 3 #define BUILD 0 \ No newline at end of file diff --git a/addons/planningmode/script_component.hpp b/addons/planningmode/script_component.hpp index acddb8a..48c3fe0 100644 --- a/addons/planningmode/script_component.hpp +++ b/addons/planningmode/script_component.hpp @@ -5,11 +5,8 @@ //#define DEBUG_MODE_FULL //#define DISABLE_COMPILE_CACHE -#ifdef DEBUG_ENABLED_PLANNINGMODE +#ifdef DEBUG_ENABLED_MAIN #define DEBUG_MODE_FULL #endif - #ifdef DEBUG_ENABLED_PLANNINGMODE - #define DEBUG_SETTINGS DEBUG_ENABLED_PLANNINGMODE -#endif #include "\x\tunuti\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/radiochannels/XEH_preInit.sqf b/addons/radiochannels/XEH_preInit.sqf index 6eef49c..b2d773b 100644 --- a/addons/radiochannels/XEH_preInit.sqf +++ b/addons/radiochannels/XEH_preInit.sqf @@ -6,91 +6,91 @@ PREP_RECOMPILE_START; PREP_RECOMPILE_END; [ - QGVAR(enable), // Unique setting name. Matches resulting variable name - "CHECKBOX", // Type of setting. Can be "CHECKBOX", "EDITBOX", "LIST", "SLIDER" or "COLOR" - "Enable radiochannels", // Display name or display name + tooltip (optional, default: same as setting name) - "Tun Utilities - Radio channels", // 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) + QGVAR(enable), // Unique setting name. Matches resulting variable name + "CHECKBOX", // Type of setting. Can be "CHECKBOX", "EDITBOX", "LIST", "SLIDER" or "COLOR" + "Enable radiochannels", // Display name or display name + tooltip (optional, default: same as setting name) + "Tun Utilities - Radio channels", // 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_fnc_addSetting; [ - QGVAR(enableAutoSetup), - "CHECKBOX", - "Enable Autosetup", - "Tun Utilities - Radio channels", - true, - 0, - {}, - true + QGVAR(enableAutoSetup), + "CHECKBOX", + "Enable Autosetup", + "Tun Utilities - Radio channels", + true, + 0, + {}, + true ] call CBA_fnc_addSetting; [ - QGVAR(enableAutoSetup), - "CHECKBOX", - ["Enable Autosetup","While enabled, radios will be automatically set to squad and lr frequencies"], - "Tun Utilities - Radio channels", - true, - 0, - {}, - false + QGVAR(enableAutoSetup), + "CHECKBOX", + ["Enable Autosetup","While enabled, radios will be automatically set to squad and lr frequencies"], + "Tun Utilities - Radio channels", + true, + 0, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(commandElementID), - "EDITBOX", - ["Command element ID", "If this is found in names of squads, command net is automatically made. Like if name is Alpha 10, and this has 10 in it, there will be command net named ALPHA. There can be multiple, seperate by comas"], - "Tun Utilities - Radio channels", - "10", - 1, - {}, - true + QGVAR(commandElementID), + "EDITBOX", + ["Command element ID", "If this is found in names of squads, command net is automatically made. Like if name is Alpha 10, and this has 10 in it, there will be command net named ALPHA. There can be multiple, seperate by comas"], + "Tun Utilities - Radio channels", + "10", + 1, + {}, + true ] call CBA_fnc_addSetting; [ - QGVAR(trimNames), - "EDITBOX", - ["Trim auto names", "Trim net names defined in Command element ID. This will remove all these from name."], - "Tun Utilities - Radio channels", - "1234567890 ", - 1, - {}, - true + QGVAR(trimNames), + "EDITBOX", + ["Trim auto names", "Trim net names defined in Command element ID. This will remove all these from name."], + "Tun Utilities - Radio channels", + "1234567890 ", + 1, + {}, + true ] call CBA_fnc_addSetting; [ - QGVAR(additional_LR_west), - "EDITBOX", - ["West", "Names for additional channels, seperate with comas"], - ["Tun Utilities - Radio channels", "Custom LR channels"], - "", - 1, - { GVAR(additional_LR_west) = (_this splitString ",")}, - true + QGVAR(additional_LR_west), + "EDITBOX", + ["West", "Names for additional channels, seperate with comas"], + ["Tun Utilities - Radio channels", "Custom LR channels"], + "", + 1, + { GVAR(additional_LR_west) = (_this splitString ",")}, + true ] call CBA_fnc_addSetting; [ - QGVAR(additional_LR_east), - "EDITBOX", - ["East", "Names for additional channels, seperate with comas"], - ["Tun Utilities - Radio channels", "Custom LR channels"], - "", - 1, - { GVAR(additional_LR_east) = (_this splitString ",")}, - true + QGVAR(additional_LR_east), + "EDITBOX", + ["East", "Names for additional channels, seperate with comas"], + ["Tun Utilities - Radio channels", "Custom LR channels"], + "", + 1, + { GVAR(additional_LR_east) = (_this splitString ",")}, + true ] call CBA_fnc_addSetting; [ - QGVAR(additional_LR_independent), - "EDITBOX", - ["Resistance", "Names for additional channels, seperate with comas"], - ["Tun Utilities - Radio channels", "Custom LR channels"], - "", - 1, - { GVAR(additional_LR_independent) = (_this splitString ",")}, - true + QGVAR(additional_LR_independent), + "EDITBOX", + ["Resistance", "Names for additional channels, seperate with comas"], + ["Tun Utilities - Radio channels", "Custom LR channels"], + "", + 1, + { GVAR(additional_LR_independent) = (_this splitString ",")}, + true ] call CBA_fnc_addSetting; ADDON = true; \ No newline at end of file diff --git a/addons/radiochannels/functions/fnc_playerInit.sqf b/addons/radiochannels/functions/fnc_playerInit.sqf index 2dd23ae..a5029e8 100644 --- a/addons/radiochannels/functions/fnc_playerInit.sqf +++ b/addons/radiochannels/functions/fnc_playerInit.sqf @@ -27,10 +27,10 @@ private _text = "Long Range Net(s)
Set LR - Set LR Additional - Set SR Additional ] Channel: %2 (%3) - %4
", _text, _channel, _frequency, toUpper _name, QFUNC(setSRchannel), QFUNC(setLRchannel), _index]; + _text = _text + format ["[Set LR - Set LR Additional - Set SR Additional ] Channel: %1 (%2) - %3
", _channel, _frequency, toUpper _name, QFUNC(setSRchannel), QFUNC(setLRchannel), _index]; } forEach _lrValues; -_text = format ["%1

Squad Net(s)", _text]; +_text = _text + "

Squad Net(s)"; private _commandTrimmedLast = ""; { @@ -46,20 +46,20 @@ private _commandTrimmedLast = ""; if (parseNumber _frequency < 100) then { _space = " "; }; - _text = format ["%1%5[ Set - Set Additional ] Channel: %2 (%3)%7- %4", _text, _channel, _frequency, _name, _divader, QFUNC(setSRchannel), _space, _index]; + _text = _text + (format ["%4[ Set - Set Additional ] Channel: %1 (%2)%6- %3", _channel, _frequency, _name, _divader, QFUNC(setSRchannel), _space, _index]); _commandTrimmedLast = _commandTrimmed; } forEach _srValues; -_text = format ["%1

Clear SR additional - Clear LR additional", _text, QFUNC(clearAdditional)]; +_text = _text + (format ["

Clear SR additional - Clear LR additional", QFUNC(clearAdditional)]); -_text = format ["%1

Radio channels are set automatically after mission start.
It will try to find LR net for you, if you are in Alpha platoon, it will set LR to Alpha LR net if found, if not found no LR set.
If you dont have LR, it will set your command net to your SR additional.

Buttons will start to work after the game begins.
Channel 7 is reserved for separately defined frequencies.
Channel 8 is for additional channels.

Powered By TuntematonEngine v%2.%3.%4", _text, MAJOR, MINOR, PATCH]; +_text = _text + (format ["

Radio channels are set automatically after mission start.
It will try to find LR net for you, if you are in Alpha platoon, it will set LR to Alpha LR net if found, if not found no LR set.
If you dont have LR, it will set your command net to your SR additional.

Buttons will start to work after the game begins.
Channel 7 is reserved for separately defined frequencies.
Channel 8 is for additional channels.

Powered By TuntematonEngine v%1.%2.%3.%4", MAJOR, MINOR, PATCH, BUILD]); player createDiaryRecord ["Diary",["Command & Signal",_text]]; player createDiarySubject ["Command & Signal","Command & Signal", QPATHTOF(images\TunUti_Radios.paa)]; player createDiaryRecord ["Command & Signal",["Command & Signal",_text]]; -[{ cba_missionTime > 1 && !isNull player && TFAR_core_SettingsInitialized}, { +[{ cba_missionTime > 0 && {!isNull player} && {TFAR_core_SettingsInitialized}}, { LOG("Player start auto set radios"); if (GVAR(enableAutoSetup)) then { [{ @@ -71,15 +71,16 @@ player createDiaryRecord ["Command & Signal",["Command & Signal",_text]]; if ((count (_this select 1) > 0)) then { LOG("Auto set LR"); [nil, false, true] call FUNC(setLRchannel); - }; + }; }; private _timeoutCodeLR = { LOG("Player LR auto set to SR"); if ((count (_this select 1) > 0) && leader group player isEqualTo player) then { LOG("Auto set LR to SR"); + //LR skipped, try to put those so SR [nil, 2, true, true] call FUNC(setSRchannel); - }; + }; }; private _srStatement = { diff --git a/addons/radiochannels/functions/fnc_serverInit.sqf b/addons/radiochannels/functions/fnc_serverInit.sqf index b59ed76..91312e9 100644 --- a/addons/radiochannels/functions/fnc_serverInit.sqf +++ b/addons/radiochannels/functions/fnc_serverInit.sqf @@ -137,7 +137,7 @@ FILTER(_groupsIndependent,{ if (_x in _playableUnits) exitWith {true}; false } f }; } forEach _groups; - _radioValuesHash set [_side, [_valuesSR_final,_valuesLR_final]]; + _radioValuesHash set [_side, [_valuesSR_final,_valuesLR_final]]; } forEach [[_groupsWest, west],[_groupsEast, east], [_groupsIndependent, independent]]; @@ -165,11 +165,10 @@ private _tunuti_FNC_create_LR_channel = { _valuesLR_final }; - { _x params ["_side", "_additionalLR"]; if ((count _additionalLR) isNotEqualTo 0) then { - private _values = _radioValuesHash getOrDefault [west, [[],[]]]; + private _values = _radioValuesHash getOrDefault [_side, [[],[]]]; private _lrValues = _values select 1; private _srValues = _values select 0; private _count = (count _lrValues) + 1; diff --git a/addons/radiochannels/script_component.hpp b/addons/radiochannels/script_component.hpp index 7c5fac9..6420d24 100644 --- a/addons/radiochannels/script_component.hpp +++ b/addons/radiochannels/script_component.hpp @@ -5,11 +5,8 @@ //#define DEBUG_MODE_FULL //#define DISABLE_COMPILE_CACHE -#ifdef DEBUG_ENABLED_RADIOCHANNELS - #define DEBUG_MODE_FULL -#endif - #ifdef DEBUG_SETTINGS_RADIOCHANNELS - #define DEBUG_SETTINGS DEBUG_SETTINGS_RADIOCHANNELS +#ifdef DEBUG_ENABLED_MAIN + #define DEBUG_MODE_FULL #endif #include "\x\tunuti\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/startmarkers/XEH_postInit_client.sqf b/addons/startmarkers/XEH_postInit_client.sqf index 53ff334..276b005 100644 --- a/addons/startmarkers/XEH_postInit_client.sqf +++ b/addons/startmarkers/XEH_postInit_client.sqf @@ -1,12 +1,12 @@ #include "script_component.hpp" [{ ADDON }, { - if (GVAR(enable)) then { + if (GVAR(enable)) then { //Wait server to gather first data ISNILS(GVAR(serverDone),false); [{GVAR(serverDone) && !isNull player}, { [] call FUNC(playerInit); }] call CBA_fnc_waitUntilAndExecute; - }; + }; }] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/addons/startmarkers/XEH_postInit_server.sqf b/addons/startmarkers/XEH_postInit_server.sqf index c2dd3ce..815b419 100644 --- a/addons/startmarkers/XEH_postInit_server.sqf +++ b/addons/startmarkers/XEH_postInit_server.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" [{ ADDON }, { - if (GVAR(enable)) then { + if (GVAR(enable)) then { [] call FUNC(serverInit); - }; + }; }] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/addons/startmarkers/XEH_preInit.sqf b/addons/startmarkers/XEH_preInit.sqf index 7bc6900..87f28a1 100644 --- a/addons/startmarkers/XEH_preInit.sqf +++ b/addons/startmarkers/XEH_preInit.sqf @@ -9,49 +9,50 @@ GVAR(allowedSidesStarmarker) = []; GVAR(allowedSidesBFT) = []; GVAR(squadMarkers) = []; GVAR(vehicleMarkers) = []; +GVAR(otherMarkers) = []; [ - QGVAR(enable), // Unique setting name. Matches resulting variable name - "CHECKBOX", // Type of setting. Can be "CHECKBOX", "EDITBOX", "LIST", "SLIDER" or "COLOR" - ["Enable startmakers", "Enable whole system"], // Display name or display name + tooltip (optional, default: same as setting name) - "Tun Utilities - Startmakers & BFT", // 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) + QGVAR(enable), // Unique setting name. Matches resulting variable name + "CHECKBOX", // Type of setting. Can be "CHECKBOX", "EDITBOX", "LIST", "SLIDER" or "COLOR" + ["Enable startmakers", "Enable whole system"], // Display name or display name + tooltip (optional, default: same as setting name) + "Tun Utilities - Startmakers & BFT", // 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_fnc_addSetting; [ - QGVAR(showAI), - "CHECKBOX", - ["Add tag if vehicle crew or squad is AI", "Add tag for squad where is only AI units and vehicles which crew is only AI."], - "Tun Utilities - Startmakers & BFT", - true, - 1, - {}, - true + QGVAR(showAI), + "CHECKBOX", + ["Add tag if vehicle crew or squad is AI", "Add tag for squad where is only AI units and vehicles which crew is only AI."], + "Tun Utilities - Startmakers & BFT", + true, + 1, + {}, + true ] call CBA_fnc_addSetting; [ - QGVAR(showUnmanned), - "CHECKBOX", - "Add tag if vehicle is unmanned", - "Tun Utilities - Startmakers & BFT", - false, - 1, - {}, - true + QGVAR(showUnmanned), + "CHECKBOX", + "Add tag if vehicle is unmanned", + "Tun Utilities - Startmakers & BFT", + false, + 1, + {}, + true ] call CBA_fnc_addSetting; [ - QGVAR(commandElementID), - "EDITBOX", - ["Command element ID", "If this is found in names of squads, squad marker will be HQ. There can be multiple, seperate by comas"], - "Tun Utilities - Startmakers & BFT", - "10", - 1, - {}, - true + QGVAR(commandElementID), + "EDITBOX", + ["Command element ID", "If this is found in names of squads, squad marker will be HQ. There can be multiple, seperate by comas"], + "Tun Utilities - Startmakers & BFT", + "10", + 1, + {}, + true ] call CBA_fnc_addSetting; //////////////// @@ -59,255 +60,255 @@ GVAR(vehicleMarkers) = []; //////////////// [ - QGVAR(prepTimeSetting), - "SLIDER", - ["Preparation time (minutes)", "After this time is passed, all markers are auto hidden. You can bring them up again through the settings menu."], - ["Tun Utilities - Startmakers & BFT","Startposition"], - [1, 60, 15, 0], - 1, - { - params ["_value"]; - _value = round _value; - GVAR(prepTimeSetting) = _value; - GVAR(prepTime) = (["Afi_safeStart_duration", _value ] call BIS_fnc_getParamValue) * 60; - }, - true + QGVAR(prepTimeSetting), + "TIME", + ["Preparation time (minutes)", "After this time is passed, all markers are auto hidden. You can bring them up again through the settings menu."], + ["Tun Utilities - Startmakers & BFT","Startposition"], + [1, 60*60, 15*60], + 1, + { + params ["_value"]; + _value = round _value; + GVAR(prepTimeSetting) = _value; + GVAR(prepTime) = (["Afi_safeStart_duration", _value ] call BIS_fnc_getParamValue); + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(allowMarkersWest), - "CHECKBOX", - ["Allow Startposition Blufor", "Allow Startposition for this side"], - ["Tun Utilities - Startmakers & BFT","Startposition"], - true, - 1, - { - params ["_value"]; - if (_value) then { - GVAR(allowedSidesStarmarker) pushBack west; - }; - }, - true + QGVAR(allowMarkersWest), + "CHECKBOX", + ["Allow Startposition Blufor", "Allow Startposition for this side"], + ["Tun Utilities - Startmakers & BFT","Startposition"], + true, + 1, + { + params ["_value"]; + if (_value) then { + GVAR(allowedSidesStarmarker) pushBack west; + }; + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(allowMarkerEast), - "CHECKBOX", - ["Allow Startposition Opfor", "Allow Startposition for this side"], - ["Tun Utilities - Startmakers & BFT","Startposition"], - true, - 1, - { - params ["_value"]; - if (_value) then { - GVAR(allowedSidesStarmarker) pushBack east; - }; - }, - true + QGVAR(allowMarkerEast), + "CHECKBOX", + ["Allow Startposition Opfor", "Allow Startposition for this side"], + ["Tun Utilities - Startmakers & BFT","Startposition"], + true, + 1, + { + params ["_value"]; + if (_value) then { + GVAR(allowedSidesStarmarker) pushBack east; + }; + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(allowMarkerInd), - "CHECKBOX", - ["Allow Startposition Indfor", "Allow Startposition for this side"], - ["Tun Utilities - Startmakers & BFT","Startposition"], - true, - 1, - { - params ["_value"]; - if (_value) then { - GVAR(allowedSidesStarmarker) pushBack resistance; - }; - }, - true + QGVAR(allowMarkerInd), + "CHECKBOX", + ["Allow Startposition Indfor", "Allow Startposition for this side"], + ["Tun Utilities - Startmakers & BFT","Startposition"], + true, + 1, + { + params ["_value"]; + if (_value) then { + GVAR(allowedSidesStarmarker) pushBack resistance; + }; + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(allowMarkerCivilian), - "CHECKBOX", - ["Allow Startposition Civilian", "Allow Startposition for this side"], - ["Tun Utilities - Startmakers & BFT","Startposition"], - true, - 1, - { - params ["_value"]; - if (_value) then { - GVAR(allowedSidesStarmarker) pushBack civilian; - }; - }, - true + QGVAR(allowMarkerCivilian), + "CHECKBOX", + ["Allow Startposition Civilian", "Allow Startposition for this side"], + ["Tun Utilities - Startmakers & BFT","Startposition"], + true, + 1, + { + params ["_value"]; + if (_value) then { + GVAR(allowedSidesStarmarker) pushBack civilian; + }; + }, + true ] call CBA_fnc_addSetting; /////// //BFT// /////// [ - QGVAR(enableBFT), - "CHECKBOX", - ["Blue Force Tracking", "Enable BFT"], - ["Tun Utilities - Startmakers & BFT","BFT"], - false, - 1, - {}, - true + QGVAR(enableBFT), + "CHECKBOX", + ["Blue Force Tracking", "Enable BFT"], + ["Tun Utilities - Startmakers & BFT","BFT"], + false, + 1, + {}, + true ] call CBA_fnc_addSetting; [ - QGVAR(bftAlwaysOn), - "CHECKBOX", - ["BFT always on", "Enable BFT for everyone. No item requirements"], - ["Tun Utilities - Startmakers & BFT","BFT"], - false, - 1, - {}, - true + QGVAR(bftAlwaysOn), + "CHECKBOX", + ["BFT always on", "Enable BFT for everyone. No item requirements"], + ["Tun Utilities - Startmakers & BFT","BFT"], + false, + 1, + {}, + true ] call CBA_fnc_addSetting; [ - QGVAR(addAllVehicles), - "CHECKBOX", - ["Add all vehicles", "Add all vehicles. Even if created after mission start. If vehicle side is not defined. First unit who get in vehicle will specify it."], - ["Tun Utilities - Startmakers & BFT","BFT"], - false, - 1, - {}, - true + QGVAR(addAllVehicles), + "CHECKBOX", + ["Add all vehicles", "Add all vehicles. Even if created after mission start. If vehicle side is not defined. First unit who get in vehicle will specify it."], + ["Tun Utilities - Startmakers & BFT","BFT"], + false, + 1, + {}, + true ] call CBA_fnc_addSetting; [ - QGVAR(updateInterval), - "SLIDER", - ["BFT update interval (seconds)", "Time between updates (seconds)"], - ["Tun Utilities - Startmakers & BFT","BFT"], - [1, 60, 5, 0], - 1, - { - params ["_value"]; - GVAR(updateInterval) = round _value; - }, - true + QGVAR(updateInterval), + "TIME", + ["BFT update interval", "Time between updates"], + ["Tun Utilities - Startmakers & BFT","BFT"], + [1, 60, 5], + 1, + { + params ["_value"]; + GVAR(updateInterval) = round _value; + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(bftItemsSettings), - "EDITBOX", - ["Required item", "List of item classnames to allow BFT. Seperate by comas"], - ["Tun Utilities - Startmakers & BFT","BFT"], - '"ACE_microDAGR", "ItemGPS"', - 1, - { - params ["_value"]; - _value = _value splitString """, """; - MAP(_value,toLower _x); - GVAR(bftItems) = _value; - }, - true + QGVAR(bftItemsSettings), + "EDITBOX", + ["Required item", "List of item classnames to allow BFT. Seperate by comas"], + ["Tun Utilities - Startmakers & BFT","BFT"], + '"ACE_microDAGR", "ItemGPS"', + 1, + { + params ["_value"]; + _value = _value splitString """, """; + MAP(_value,toLower _x); + GVAR(bftItems) = _value; + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(allowBftWest), - "CHECKBOX", - ["Allow BFT Blufor", "Allow BFT for this side"], - ["Tun Utilities - Startmakers & BFT","BFT"], - true, - 1, - { - params ["_value"]; - if (_value) then { - GVAR(allowedSidesBFT) pushBack west; - }; - }, - true + QGVAR(allowBftWest), + "CHECKBOX", + ["Allow BFT Blufor", "Allow BFT for this side"], + ["Tun Utilities - Startmakers & BFT","BFT"], + true, + 1, + { + params ["_value"]; + if (_value) then { + GVAR(allowedSidesBFT) pushBack west; + }; + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(allowBftEast), - "CHECKBOX", - ["Allow BFT Opfor", "Allow BFT for this side"], - ["Tun Utilities - Startmakers & BFT","BFT"], - true, - 1, - { - params ["_value"]; - if (_value) then { - GVAR(allowedSidesBFT) pushBack east; - }; - }, - true + QGVAR(allowBftEast), + "CHECKBOX", + ["Allow BFT Opfor", "Allow BFT for this side"], + ["Tun Utilities - Startmakers & BFT","BFT"], + true, + 1, + { + params ["_value"]; + if (_value) then { + GVAR(allowedSidesBFT) pushBack east; + }; + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(allowBftInd), - "CHECKBOX", - ["Allow BFT Indfor", "Allow BFT for this side"], - ["Tun Utilities - Startmakers & BFT","BFT"], - true, - 1, - { - params ["_value"]; - if (_value) then { - GVAR(allowedSidesBFT) pushBack resistance; - }; - }, - true + QGVAR(allowBftInd), + "CHECKBOX", + ["Allow BFT Indfor", "Allow BFT for this side"], + ["Tun Utilities - Startmakers & BFT","BFT"], + true, + 1, + { + params ["_value"]; + if (_value) then { + GVAR(allowedSidesBFT) pushBack resistance; + }; + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(allowBftCivilian), - "CHECKBOX", - ["Allow BFT Civilian", "Allow BFT for this side"], - ["Tun Utilities - Startmakers & BFT","BFT"], - true, - 1, - { - params ["_value"]; - if (_value) then { - GVAR(allowedSidesBFT) pushBack civilian; - }; - }, - true + QGVAR(allowBftCivilian), + "CHECKBOX", + ["Allow BFT Civilian", "Allow BFT for this side"], + ["Tun Utilities - Startmakers & BFT","BFT"], + true, + 1, + { + params ["_value"]; + if (_value) then { + GVAR(allowedSidesBFT) pushBack civilian; + }; + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(lostContactTime), - "SLIDER", - ["Lost contact time", "After this time is passed without update for marker data, marker alpha will be set to 0.5. (Minutes)"], - ["Tun Utilities - Startmakers & BFT","BFT"], - [1, 60, 5, 0], - 1, - { - params ["_value"]; - GVAR(deleteMarkerTime) = round _value; - }, - true + QGVAR(lostContactTime), + "TIME", + ["Lost contact time", "After this time is passed without update for marker data, marker alpha will be set to 0.5."], + ["Tun Utilities - Startmakers & BFT","BFT"], + [1, 60*60, 5*60], + 1, + { + params ["_value"]; + GVAR(lostContactTime) = round _value; + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(enableDeleteMarker), - "CHECKBOX", - ["Enable delete non updated markers", "Enable system to delete unupdated markers"], - ["Tun Utilities - Startmakers & BFT","BFT"], - true, - 1, - {}, - true + QGVAR(enableDeleteMarker), + "CHECKBOX", + ["Enable delete non updated markers", "Enable system to delete unupdated markers"], + ["Tun Utilities - Startmakers & BFT","BFT"], + true, + 1, + {}, + true ] call CBA_fnc_addSetting; [ - QGVAR(deleteMarkerTime), - "SLIDER", - ["Delete marker without update time", "After this time is passed without update for marker data, it will be deleted. (Minutes)"], - ["Tun Utilities - Startmakers & BFT","BFT"], - [1, 60, 15, 0], - 1, - { - params ["_value"]; - GVAR(deleteMarkerTime) = round _value; - }, - true + QGVAR(deleteMarkerTime), + "TIME", + ["Delete marker without update time", "After this time is passed without update for marker data, it will be deleted."], + ["Tun Utilities - Startmakers & BFT","BFT"], + [1, 60*60, 15*60], + 1, + { + params ["_value"]; + GVAR(deleteMarkerTime) = round _value; + }, + true ] call CBA_fnc_addSetting; ["hint", { - hint (_this select 0); + hint (_this select 0); }, "all"] call CBA_fnc_registerChatCommand; ADDON = true; \ No newline at end of file diff --git a/addons/startmarkers/XEH_prep.hpp b/addons/startmarkers/XEH_prep.hpp index 7fc7691..9511b17 100644 --- a/addons/startmarkers/XEH_prep.hpp +++ b/addons/startmarkers/XEH_prep.hpp @@ -1,6 +1,9 @@ PREP(createDiaryRecord); +PREP(createOthereMarkers); PREP(createSquadMarkers); +PREP(createVehicleIcon); PREP(createVehicleMarkers); +PREP(deleteOtherMarkers); PREP(deleteSquadMarkers); PREP(deleteVehicleMarkers); PREP(filterData); diff --git a/addons/startmarkers/config.cpp b/addons/startmarkers/config.cpp index 0a8385c..60fc3f8 100644 --- a/addons/startmarkers/config.cpp +++ b/addons/startmarkers/config.cpp @@ -2,16 +2,16 @@ // information on this addon specifically class CfgPatches { - class ADDON { - name = COMPONENT_NAME; - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {MAIN_ADDON_STR}; - author = "Tuntematon"; - authorUrl = GITHUBLINK; - VERSION_CONFIG; - }; + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {MAIN_ADDON_STR}; + author = "Tuntematon"; + authorUrl = GITHUBLINK; + VERSION_CONFIG; + }; }; // configs go here @@ -23,100 +23,100 @@ class RscCheckBox; class Cfg3DEN { - // Configuration of all objects - class Object - { - // Categories collapsible in "Edit Attributes" window - class AttributeCategories - { - // Category class, can be anything - class ADDON - { - displayName = "Tun Utilities - Starmarkers & BFT"; // Category name visible in Edit Attributes window - collapsed = 1; // When 1, the category is collapsed by default - class Attributes - { - class tunuti_startmarkers_enable_marker_inf - { - displayName = "Enable startpos and BFT for squad"; - tooltip = "Enables start position marker and BFT for this group. To disable, toggle it from group leaders attributes"; - property = "tunuti_startmarkers_enable_marker_inf"; - control = "Checkbox"; - expression = QUOTE((group _this) setVariable [ARR_3(QQGVAR(enableMarker),_value,true)]); - defaultValue = "true"; - unique = 0; - condition = "objectBrain"; - }; + // Configuration of all objects + class Object + { + // Categories collapsible in "Edit Attributes" window + class AttributeCategories + { + // Category class, can be anything + class ADDON + { + displayName = "Tun Utilities - Starmarkers & BFT"; // Category name visible in Edit Attributes window + collapsed = 1; // When 1, the category is collapsed by default + class Attributes + { + class tunuti_startmarkers_enable_marker_inf + { + displayName = "Enable startpos and BFT for squad"; + tooltip = "Enables start position marker and BFT for this group. To disable, toggle it from group leaders attributes"; + property = "tunuti_startmarkers_enable_marker_inf"; + control = "Checkbox"; + expression = QUOTE((group _this) setVariable [ARR_3(QQGVAR(enableMarker),_value,true)]); + defaultValue = "true"; + unique = 0; + condition = "objectBrain"; + }; - class tunuti_startmarkers_enable_marker_vehicle: tunuti_startmarkers_enable_marker_inf - { - displayName = "Enable startpos and BFT for vehicle"; - tooltip = "Enables start position marker and BFT for this group."; - property = "tunuti_startmarkers_enable_marker_vehicle"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(enableMarker),_value,true)]); - condition = "objectHasInventoryCargo + objectVehicle"; - }; + class tunuti_startmarkers_enable_marker_vehicle: tunuti_startmarkers_enable_marker_inf + { + displayName = "Enable startpos and BFT for vehicle"; + tooltip = "Enables start position marker and BFT for this group."; + property = "tunuti_startmarkers_enable_marker_vehicle"; + expression = QUOTE(_this setVariable [ARR_3(QQGVAR(enableMarker),_value,true)]); + condition = "objectHasInventoryCargo + objectVehicle"; + }; - class tunuti_startmarkers_startPosName: tunuti_startmarkers_enable_marker_inf - { - displayName = "Custon vehicle text"; - tooltip = "You can change the default startpos marker name shown at brieffing to a different one. Names shorter than 2 characters wont be set."; - property = "tunuti_startmarkers_startPosName"; - control = "EditShort"; - expression = "if (count _value > 1) then { _this setVariable ['displayName', str _value,true]};"; - defaultValue = "''"; - condition = "objectHasInventoryCargo + objectVehicle"; - }; + class tunuti_startmarkers_startPosName: tunuti_startmarkers_enable_marker_inf + { + displayName = "Custon vehicle text"; + tooltip = "You can change the default startpos marker name shown at brieffing to a different one. Names shorter than 2 characters wont be set."; + property = "tunuti_startmarkers_startPosName"; + control = "EditShort"; + expression = "if (count _value > 1) then { _this setVariable ['displayName', _value,true]};"; + defaultValue = "''"; + condition = "objectHasInventoryCargo + objectVehicle"; + }; - class tunuti_startmarkers_vehicle_side: tunuti_startmarkers_enable_marker_inf - { - displayName = "Vehicle Side"; - tooltip = "Select which side this vehicle is shown."; - property = QGVAR(vehicle_side_west); - control = "combo"; - expression = QUOTE(if (_value isNotEqualTo -1) then {private _side = [ARR_4(west,east,resistance,civilian)] select _value; _this setVariable [ARR_3(QQGVAR(vehicleSide),_side,true)]}); - defaultValue = -1; - condition = "objectHasInventoryCargo + objectVehicle"; - typeName = "NUMBER"; + class tunuti_startmarkers_vehicle_side: tunuti_startmarkers_enable_marker_inf + { + displayName = "Vehicle Side"; + tooltip = "Select which side this vehicle is shown."; + property = QGVAR(vehicle_side_west); + control = "combo"; + expression = QUOTE(if (_value isNotEqualTo -1) then {private _side = [ARR_4(west,east,resistance,civilian)] select _value; _this setVariable [ARR_3(QQGVAR(vehicleSide),_side,true)]}); + defaultValue = -1; + condition = "objectHasInventoryCargo + objectVehicle"; + typeName = "NUMBER"; - class Values { - class none - { - name = "None"; - value = -1; - }; + class Values { + class none + { + name = "None"; + value = -1; + }; - class west - { - name = "West"; - value = 0; - pictureRight = "a3\ui_f\data\map\diary\icons\playerwest_ca.paa"; - }; + class west + { + name = "West"; + value = 0; + pictureRight = "a3\ui_f\data\map\diary\icons\playerwest_ca.paa"; + }; - class east - { - name = "East"; - value = 1; - pictureRight = "a3\ui_f\data\map\diary\icons\playereast_ca.paa"; - }; + class east + { + name = "East"; + value = 1; + pictureRight = "a3\ui_f\data\map\diary\icons\playereast_ca.paa"; + }; - class resistance - { - name = "Resistance"; - value = 2; - pictureRight = "a3\ui_f\data\map\diary\icons\playerguer_ca.paa"; - }; + class resistance + { + name = "Resistance"; + value = 2; + pictureRight = "a3\ui_f\data\map\diary\icons\playerguer_ca.paa"; + }; - class civilian - { - name = "Civilian"; - value = 3; - pictureRight = "a3\ui_f\data\map\diary\icons\playerciv_ca.paa"; - }; - }; - }; - }; - }; - }; - }; + class civilian + { + name = "Civilian"; + value = 3; + pictureRight = "a3\ui_f\data\map\diary\icons\playerciv_ca.paa"; + }; + }; + }; + }; + }; + }; + }; }; \ No newline at end of file diff --git a/addons/startmarkers/functions/fnc_createDiaryRecord.sqf b/addons/startmarkers/functions/fnc_createDiaryRecord.sqf index fed856f..374e120 100644 --- a/addons/startmarkers/functions/fnc_createDiaryRecord.sqf +++ b/addons/startmarkers/functions/fnc_createDiaryRecord.sqf @@ -13,15 +13,17 @@ */ #include "script_component.hpp" -private _text = "This missions uses automatic startpositions markers. -
The markers are hidden after the safe start is over. -
You can bring them up again through the settings menu."; +private _text = "This missions uses automatic startpositions markers.
"; if (GVAR(enableBFT)) then { - _text = _text + "
This mission uses BFT, same settings apply for it."; + _text = _text + "
BFT is enabled in this mission. Same settings apply for it."; if (GVAR(enableDeleteMarker)) then { - _text = _text + format["
- If squad leader dies or vehicle gets destroyed, they will become semi transparrent after %1 min and they will be deleted from map after %2m",GVAR(lostContactTime), GVAR(deleteMarkerTime)]; + private _deleteMarkerTime = [GVAR(deleteMarkerTime), "M:SS"] call CBA_fnc_formatElapsedTime; + private _lostContactTime = [GVAR(lostContactTime), "M:SS"] call CBA_fnc_formatElapsedTime; + _text = _text + format["
- If squad leader dies or vehicle gets destroyed, they will become semi transparrent after %1min and they will be deleted from map after %2min",_lostContactTime, _deleteMarkerTime]; }; +} else { + _text = _text + "
The markers are hidden after the safe start is over.
You can bring them up again through the settings menu."; }; _text = _text + "

Open Settings diff --git a/addons/startmarkers/functions/fnc_createOthereMarkers.sqf b/addons/startmarkers/functions/fnc_createOthereMarkers.sqf new file mode 100644 index 0000000..b73f755 --- /dev/null +++ b/addons/startmarkers/functions/fnc_createOthereMarkers.sqf @@ -0,0 +1,62 @@ +/* + * Author: [Tuntematon] + * [Description] + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call tunuti_startmarkers_fnc_createOthereMarkers + */ +#include "script_component.hpp" +disableSerialization; + +LOG("Runned create other markers"); +[] call FUNC(deleteOtherMarkers); +if !(GVAR(otherToggle)) exitWith { LOG("exited other markers, they should be hidden");}; + +private _allowedSides = [GVAR(allowedSidesStarmarker), GVAR(allowedSidesBFT)] select ((cba_missiontime > 0) && GVAR(enableBFT)); +private _markerData = []; + +if (west in _allowedSides) then { + _markerData append values GVAR(otherMarkersWestData); +}; + +if (east in _allowedSides) then { + _markerData append values GVAR(otherMarkersEastData); +}; + +if (resistance in _allowedSides) then { + _markerData append values GVAR(otherMarkersIndependentData); +}; + +if (civilian in _allowedSides) then { + _markerData append values GVAR(otherMarkersCivilianData); +}; + +private _otherTextToggle = GVAR(otherTextToggle); +private _lastUpdateTime = GVAR(lastDataUpdate); +private _lostContactTime = GVAR(lostContactTime); +private _deleteMarkerTime = GVAR(deleteMarkerTime); + +{ + _x params ["_classname", "_texts", "_pos", "_direction", "_color", "_updateTime"]; + + if ( !(_updateTime < 0) && {(_lastUpdateTime > (_deleteMarkerTime + _updateTime))}) exitWith { + private _logText = format ["other marker %1 has not been updated long time, so it is skipped", _texts select 0]; + LOG(_logText); + }; + + private _text = ""; + private _icon = getText (configFile >> "CfgVehicles" >> _classname >> "Icon"); + + if (_otherTextToggle) then { + _text = _texts select 0; + private _occupationText = _texts select 1; + }; + + [[_text,_pos,_direction,_color,_updateTime,true]] call FUNC(createVehicleIcon); +} forEach _markerData; \ No newline at end of file diff --git a/addons/startmarkers/functions/fnc_createSquadMarkers.sqf b/addons/startmarkers/functions/fnc_createSquadMarkers.sqf index 73889d2..e2bfe19 100644 --- a/addons/startmarkers/functions/fnc_createSquadMarkers.sqf +++ b/addons/startmarkers/functions/fnc_createSquadMarkers.sqf @@ -41,8 +41,8 @@ if (civilian in _allowedSides) then { private _playableUnits = playableUnits + switchableUnits; private _lastUpdateTime = GVAR(lastDataUpdate); private _showAI = GVAR(showAI); -private _lostContactTime = GVAR(lostContactTime) * 60; -private _deleteMarkerTime = GVAR(deleteMarkerTime) * 60; +private _lostContactTime = GVAR(lostContactTime); +private _deleteMarkerTime = GVAR(deleteMarkerTime); { _x params ["_icon", "_pos", "_color", "_group", "_text", "_updateTime", "_hide"]; diff --git a/addons/startmarkers/functions/fnc_createVehicleIcon.sqf b/addons/startmarkers/functions/fnc_createVehicleIcon.sqf new file mode 100644 index 0000000..ebcac2e --- /dev/null +++ b/addons/startmarkers/functions/fnc_createVehicleIcon.sqf @@ -0,0 +1,71 @@ +/* + * Author: [Tuntematon] + * [Description] + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call tunuti_startmarkers_fnc_createVehicleIcon + */ +#include "script_component.hpp" +disableSerialization; + +params["_params", "_lastUpdateTime", "_lostContactTime", ["_isOther",false]]; +_params params ["_text", "_pos", "_direction", "_color", "_updateTime"]; + + +private _displays = []; +_displays pushBack ((findDisplay TUNUTI_FIND_MAPDISPLAY) displayCtrl 51); + +private _minimapDisplay = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull]; +if (!isNull _minimapDisplay) then { + private _miniMapControlGroup = _minimapDisplay displayCtrl 13301; + private _miniMap = _miniMapControlGroup controlsGroupCtrl 101; + _displays pushBack _miniMap; +}; + +//DialogDisplay +private _dialogDisplay = uiNamespace getVariable [["ace_microdagr_RscTitleDisplay", "ace_microdagr_DialogDisplay"] select (ace_microdagr_currentShowMode == 2), displayNull]; +if (!isNull _dialogDisplay) then { + private _microDagrCtrl= [_dialogDisplay displayCtrl 77702, _dialogDisplay displayCtrl 77703] select (ace_microdagr_mapShowTexture); + //private _miniMap = _microDagrDetail controlsGroupCtrl 101; + _displays pushBack _microDagrCtrl; +}; + + +if ( !(_updateTime < 0) && {(_lastUpdateTime > ( _lostContactTime + _updateTime))}) then { + _color set [-1, 0.5]; +}; + +{ + private _display = _x; + private _drawValues = format [' + (_this select 0) drawIcon [ + "%1", + %2, + %3, + 25, + 25, + %4, + %5, + 0, + 0.04 + ];', + _icon, + _color, + _pos, + _direction, + str _text + ]; + + private _IDC = _display ctrlAddEventHandler ["Draw",_drawValues]; + if (_isOther) then { + GVAR(otherMarkers) pushBack [_display, _IDC]; + } else { + GVAR(vehicleMarkers) pushBack [_display, _IDC]; + }; +} forEach _displays; \ No newline at end of file diff --git a/addons/startmarkers/functions/fnc_createVehicleMarkers.sqf b/addons/startmarkers/functions/fnc_createVehicleMarkers.sqf index be1700d..8cea893 100644 --- a/addons/startmarkers/functions/fnc_createVehicleMarkers.sqf +++ b/addons/startmarkers/functions/fnc_createVehicleMarkers.sqf @@ -41,26 +41,9 @@ if (civilian in _allowedSides) then { private _vehicleTextToggle = GVAR(vehicleTextToggle); private _vehicleOccupationToggle = GVAR(vehicleOccupationToggle); private _lastUpdateTime = GVAR(lastDataUpdate); -private _lostContactTime = GVAR(lostContactTime) * 60; -private _deleteMarkerTime = GVAR(deleteMarkerTime) * 60; +private _lostContactTime = GVAR(lostContactTime); +private _deleteMarkerTime = GVAR(deleteMarkerTime); -private _displays = []; -_displays pushBack ((findDisplay TUNUTI_FIND_MAPDISPLAY) displayCtrl 51); - -private _minimapDisplay = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull]; -if (!isNull _minimapDisplay) then { - private _miniMapControlGroup = _minimapDisplay displayCtrl 13301; - private _miniMap = _miniMapControlGroup controlsGroupCtrl 101; - _displays pushBack _miniMap; -}; - -//DialogDisplay -private _dialogDisplay = uiNamespace getVariable [["ace_microdagr_RscTitleDisplay", "ace_microdagr_DialogDisplay"] select (ace_microdagr_currentShowMode == 2), displayNull]; -if (!isNull _dialogDisplay) then { - private _microDagrCtrl= [_dialogDisplay displayCtrl 77702, _dialogDisplay displayCtrl 77703] select (ace_microdagr_mapShowTexture); - //private _miniMap = _microDagrDetail controlsGroupCtrl 101; - _displays pushBack _microDagrCtrl; -}; { _x params ["_classname", "_texts", "_pos", "_direction", "_color", "_updateTime"]; @@ -69,11 +52,7 @@ if (!isNull _dialogDisplay) then { private _logText = format ["Vehicle marker %1 has not been updated long time, so it is skipped", _texts select 0]; LOG(_logText); }; - - if ( !(_updateTime < 0) && {(_lastUpdateTime > ( _lostContactTime + _updateTime))}) then { - _color set [-1, 0.5]; - }; - + private _text = ""; private _icon = getText (configFile >> "CfgVehicles" >> _classname >> "Icon"); @@ -87,27 +66,5 @@ if (!isNull _dialogDisplay) then { }; }; - { - private _display = _x; - private _drawValues = format [' - (_this select 0) drawIcon [ - "%1", - %2, - %3, - 25, - 25, - %4, - %5, - 2 - ];', - _icon, - _color, - _pos, - _direction, - str _text - ]; - - private _IDC = _display ctrlAddEventHandler ["Draw",_drawValues]; - GVAR(vehicleMarkers) pushBack [_display, _IDC]; - } forEach _displays; + [[_text,_pos,_direction,_color,_updateTime]] call FUNC(createVehicleIcon); } forEach _markerData; \ No newline at end of file diff --git a/addons/startmarkers/functions/fnc_deleteOtherMarkers.sqf b/addons/startmarkers/functions/fnc_deleteOtherMarkers.sqf new file mode 100644 index 0000000..05041d0 --- /dev/null +++ b/addons/startmarkers/functions/fnc_deleteOtherMarkers.sqf @@ -0,0 +1,21 @@ +/* + * Author: [Tuntematon] + * [Description] + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call tunuti_startmarkers_fnc_deleteOtherMarkers + */ +#include "script_component.hpp" +LOG("Runned delete other markers"); +{ + _x params ["_display", "_idc"]; + _display ctrlRemoveEventHandler ["Draw", _idc]; +} forEach GVAR(otherMarkers); + +GVAR(otherMarkers) = []; \ No newline at end of file diff --git a/addons/startmarkers/functions/fnc_deleteVehicleMarkers.sqf b/addons/startmarkers/functions/fnc_deleteVehicleMarkers.sqf index 32f9078..c7c1ee3 100644 --- a/addons/startmarkers/functions/fnc_deleteVehicleMarkers.sqf +++ b/addons/startmarkers/functions/fnc_deleteVehicleMarkers.sqf @@ -12,7 +12,7 @@ * [] call tunuti_startmarkers_fnc_deleteVehicleMarkers */ #include "script_component.hpp" - +LOG("Runned delete vehicle markers"); { _x params ["_display", "_idc"]; _display ctrlRemoveEventHandler ["Draw", _idc]; diff --git a/addons/startmarkers/functions/fnc_filterData.sqf b/addons/startmarkers/functions/fnc_filterData.sqf index 343a908..01771b8 100644 --- a/addons/startmarkers/functions/fnc_filterData.sqf +++ b/addons/startmarkers/functions/fnc_filterData.sqf @@ -25,7 +25,7 @@ private _resistanceVehicleHash = GVAR(vehicleMarkersIndependentData); private _civilianVehicleHash = GVAR(vehicleMarkersCivilianData); private _lastUpdateTime = GVAR(lastDataUpdate); -private _deleteMarkerTime = GVAR(deleteMarkerTime) * 60; +private _deleteMarkerTime = GVAR(deleteMarkerTime); { private _hash = _x; diff --git a/addons/startmarkers/functions/fnc_playerInit.sqf b/addons/startmarkers/functions/fnc_playerInit.sqf index 6be10e6..fb7ea9a 100644 --- a/addons/startmarkers/functions/fnc_playerInit.sqf +++ b/addons/startmarkers/functions/fnc_playerInit.sqf @@ -17,6 +17,8 @@ GVAR(squadTogle) = true; GVAR(vehicleTogle) = true; GVAR(vehicleTextToggle) = true; GVAR(vehicleOccupationToggle) = true; +GVAR(otherToggle) = true; +GVAR(otherTextToggle) = true; GVAR(runBFT) = true; //Variable to disable bft for unit in game LOG("Initialized player init starmarkers"); @@ -28,6 +30,7 @@ LOG("Initialized player init starmarkers"); if (TUNUTI_FIND_MAPDISPLAY isNotEqualTo 12) then { [] call FUNC(createVehicleMarkers); + [] call FUNC(createOthereMarkers); } else { LOG("Skipped running createvehicle, due to skiping briefing"); }; @@ -40,13 +43,15 @@ LOG("Initialized player init starmarkers"); LOG("Ingame player init starmarkers"); GVAR(vehicleMarkers) = []; + GVAR(otherMarkers) = []; [{!isNil {TUNUTI_FIND_MAPDISPLAY} }, { [] call FUNC(createVehicleMarkers); + [] call FUNC(createOthereMarkers); }] call CBA_fnc_waitUntilAndExecute; [] call FUNC(startBFT); - }, [], 3] call CBA_fnc_waitAndExecute; + }, [], 2] call CBA_fnc_waitAndExecute; }, nil, 120] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/addons/startmarkers/functions/fnc_serverInit.sqf b/addons/startmarkers/functions/fnc_serverInit.sqf index ef5bbc9..26faa02 100644 --- a/addons/startmarkers/functions/fnc_serverInit.sqf +++ b/addons/startmarkers/functions/fnc_serverInit.sqf @@ -25,6 +25,11 @@ LOG("Runned server init starmarkers"); GVAR(vehicleMarkersEastData) = createHashMap; GVAR(vehicleMarkersIndependentData) = createHashMap; GVAR(vehicleMarkersCivilianData) = createHashMap; + + GVAR(otherMarkersWestData) = createHashMap; + GVAR(otherMarkersEastData) = createHashMap; + GVAR(otherMarkersIndependentData) = createHashMap; + GVAR(otherMarkersCivilianData) = createHashMap; [] call FUNC(updateData); }, (diag_tickTime + 10)] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/addons/startmarkers/functions/fnc_settingsDisplay.sqf b/addons/startmarkers/functions/fnc_settingsDisplay.sqf index adc2561..a3c458f 100644 --- a/addons/startmarkers/functions/fnc_settingsDisplay.sqf +++ b/addons/startmarkers/functions/fnc_settingsDisplay.sqf @@ -18,23 +18,25 @@ params ["_open"]; if (_open) then { private _control = findDisplay TUNUTI_FIND_MAPDISPLAY createDisplay "tunuti_starmakersSettings"; uiNamespace setVariable ["tunuti_starmakersSettings", _control ]; - [{!isNull findDisplay 321000}, { + [{!isNull findDisplay STARTMARKER_IDD}, { private _display = uiNamespace getVariable "tunuti_starmakersSettings"; - private _squadTogleButton = (findDisplay 321000 displayCtrl 321001); - private _vehicleTogleButton = (_display displayCtrl 321002); - private _vehicleTextTogleButton = (_display displayCtrl 321003); - private _vehicleOccupationTogleButton = (_display displayCtrl 321004); + private _squadTogleButton = (_display displayCtrl SQUADMARKER_BUTTON_IDC); + private _vehicleTogleButton = (_display displayCtrl VEHICLEMARKER_BUTTON_IDC); + private _vehicleTextTogleButton = (_display displayCtrl VEHICLETEXT_BUTTON_IDC); + private _vehicleOccupationTogleButton = (_display displayCtrl VEHICLOCCUPATION_BUTTON_IDC); + private _otherTogleButton = (_display displayCtrl OTHERMARKER_BUTTON_IDC); + private _otherTextTogleButton = (_display displayCtrl OTHERTEXT_BUTTON_IDC); _squadTogleButton cbSetChecked GVAR(squadTogle); _vehicleTogleButton cbSetChecked GVAR(vehicleTogle); _vehicleTextTogleButton cbSetChecked GVAR(vehicleTextToggle); _vehicleOccupationTogleButton cbSetChecked GVAR(vehicleOccupationToggle); + _otherTogleButton cbSetChecked GVAR(otherToggle); + _otherTextTogleButton cbSetChecked GVAR(otherTextToggle); }] call CBA_fnc_waitUntilAndExecute; } else { [] call FUNC(createSquadMarkers); [] call FUNC(createVehicleMarkers); -}; - - - + [] call FUNC(createOthereMarkers); +}; \ No newline at end of file diff --git a/addons/startmarkers/functions/fnc_startBFT.sqf b/addons/startmarkers/functions/fnc_startBFT.sqf index 5162cf4..d0a2b16 100644 --- a/addons/startmarkers/functions/fnc_startBFT.sqf +++ b/addons/startmarkers/functions/fnc_startBFT.sqf @@ -17,7 +17,9 @@ if (GVAR(enableBFT)) then { LOG("BFT Started"); - + GVAR(squadTogle) = true; + GVAR(vehicleTogle) = true; + GVAR(otherToggle) = true; //BFT PFH _handle = [{ if (GVAR(runBFT) && GVAR(lastDataUpdate) < cba_missiontime) then { @@ -30,6 +32,7 @@ [] call FUNC(updateData); [] call FUNC(createSquadMarkers); [] call FUNC(createVehicleMarkers); + [] call FUNC(createOthereMarkers); }; }; }, GVAR(updateInterval)] call CBA_fnc_addPerFrameHandler; @@ -48,6 +51,7 @@ [{ GVAR(squadTogle) = false; GVAR(vehicleTogle) = false; + GVAR(otherToggle) = false; [] call FUNC(createSquadMarkers); [] call FUNC(createVehicleMarkers); }, [], GVAR(prepTime)] call CBA_fnc_waitAndExecute; diff --git a/addons/startmarkers/functions/fnc_updateData.sqf b/addons/startmarkers/functions/fnc_updateData.sqf index 1177083..fa152f8 100644 --- a/addons/startmarkers/functions/fnc_updateData.sqf +++ b/addons/startmarkers/functions/fnc_updateData.sqf @@ -27,6 +27,11 @@ private _eastVehicleHash = GVAR(vehicleMarkersEastData); private _resistanceVehicleHash = GVAR(vehicleMarkersIndependentData); private _civilianVehicleHash = GVAR(vehicleMarkersCivilianData); +private _westOtherHash = GVAR(otherMarkersWestData); +private _eastOtherHash = GVAR(otherMarkersEastData); +private _resistanceOthereHash = GVAR(otherMarkersIndependentData); +private _civilianOtherHash = GVAR(otherMarkersCivilianData); + private _colorWEST = "ColorWEST"; private _colorEAST = "ColorEAST"; private _colorINDEPENDENT = "ColorGUER"; @@ -53,6 +58,9 @@ if (_time < 1) then { private _leader = leader _group; private _hasGPS = true; //True to make sure data is collected at briefing private _units = (units _group); + + if (count _units isEqualTo 0) exitWith { }; //Skip empty squads + if (_time > 0) then { { private _unit = _x; @@ -106,8 +114,9 @@ private _showUnmanned = GVAR(showUnmanned); private _text = ""; private _text1 = ""; _text = _vehicle getVariable ["displayName", getText (configOf _vehicle >> "displayName")]; + private _isThing = _vehicle isKindOf "thing"; - if (!(_vehicle isKindOf "thing") && {!(_vehicle isKindOf "uav")}) then { + if (!_isThing && {!(_vehicle isKindOf "uav")}) then { private _vehicleCrew = crew _vehicle; if (count _vehicleCrew > 0) then { private _groups = []; @@ -139,17 +148,21 @@ private _showUnmanned = GVAR(showUnmanned); private _data = [hashValue _vehicle, [_classname, [_text, _text1], _pos, _direction, _color, _updateTime]]; switch (_side) do { - case west: { - _westVehicleHash set _data; + case west: { + private _hash = [_westVehicleHash,_westOtherHash] select _isThing; + _hash set _data; }; case east: { - _eastVehicleHash set _data; + private _hash = [_eastVehicleHash,_eastOtherHash] select _isThing; + _hash set _data; }; - case independent: { - _resistanceVehicleHash set _data; + case independent: { + private _hash = [_resistanceVehicleHash,_resistanceOthereHash] select _isThing; + _hash set _data; }; - default { - _civilianVehicleHash set _data; + default { + private _hash = [_civilianVehicleHash,_civilianOtherHash] select _isThing; + _hash set _data; }; }; }; @@ -168,6 +181,11 @@ if (isServer) then { publicVariable QGVAR(vehicleMarkersIndependentData); publicVariable QGVAR(vehicleMarkersCivilianData); + publicVariable QGVAR(otherMarkersWestData); + publicVariable QGVAR(otherMarkersEastData); + publicVariable QGVAR(otherMarkersIndependentData); + publicVariable QGVAR(otherMarkersCivilianData); + publicVariable QGVAR(lastDataUpdate); GVAR(serverDone) = true; diff --git a/addons/startmarkers/script_component.hpp b/addons/startmarkers/script_component.hpp index 154993c..64e617a 100644 --- a/addons/startmarkers/script_component.hpp +++ b/addons/startmarkers/script_component.hpp @@ -2,14 +2,19 @@ #define COMPONENT_BEAUTIFIED StartMarkers #include "\x\tunuti\addons\main\script_mod.hpp" -//#define DEBUG_MODE_FULL -//#define DISABLE_COMPILE_CACHE +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE -#ifdef DEBUG_ENABLED_STARTMARKERS - #define DEBUG_MODE_FULL -#endif - #ifdef DEBUG_SETTINGS_STARTMARKERS - #define DEBUG_SETTINGS DEBUG_SETTINGS_STARTMARKERS +#ifdef DEBUG_ENABLED_MAIN + #define DEBUG_MODE_FULL #endif -#include "\x\tunuti\addons\main\script_macros.hpp" \ No newline at end of file +#include "\x\tunuti\addons\main\script_macros.hpp" + +#define STARTMARKER_IDD 321000 +#define SQUADMARKER_BUTTON_IDC 321001 +#define VEHICLEMARKER_BUTTON_IDC 321002 +#define VEHICLETEXT_BUTTON_IDC 321003 +#define VEHICLOCCUPATION_BUTTON_IDC 321004 +#define OTHERMARKER_BUTTON_IDC 321005 +#define OTHERTEXT_BUTTON_IDC 321006 \ No newline at end of file diff --git a/addons/startmarkers/startmarkersSettings.hpp b/addons/startmarkers/startmarkersSettings.hpp index bdb7338..fb05a41 100644 --- a/addons/startmarkers/startmarkersSettings.hpp +++ b/addons/startmarkers/startmarkersSettings.hpp @@ -1,19 +1,12 @@ //Exported via Arma Dialog Creator (https://github.com/kayler-renslow/arma-dialog-creator) -//#include "\a3\3DEN\UI\macros.inc" -//#include "\a3\3DEN\UI\macroexecs.inc" -//#include "\a3\ui_f\hpp\definedikcodes.inc" -#include "\a3\ui_f\hpp\definecommoncolors.inc" -//#include "\a3\ui_f\hpp\definecommongrids.inc" -//#include "\a3\ui_f\hpp\defineresincl.inc" - class tunuti_starmakersSettings { - idd = 321000; + idd = STARTMARKER_IDD; class ControlsBackground { - class background : RscText + class GVAR(background) : RscText { type = 0; idc = -1; @@ -23,42 +16,57 @@ class tunuti_starmakersSettings h = "safeZoneH * 0.3"; style = 0; colorBackground[] = {0.2, 0.2, 0.2, 0.75}; - onDestroy = "[false] call tunuti_startmarkers_fnc_settingsDisplay;"; + onDestroy = QUOTE([false] call FUNC(settingsDisplay);); }; }; class Controls { - class toggle_squadMarkersText : RscText + class GVAR(toggle_squadMarkersText) : RscText { - x = "safeZoneX + safeZoneW * 0.35"; + idc = -1; + x = "safeZoneX + safeZoneW * 0.37"; y = "safeZoneY + safeZoneH * 0.425"; w = "safeZoneW * 0.125"; h = "safeZoneH * 0.025"; text = "Toggle squad markers"; }; - class toggle_vehicleMarkersText : toggle_squadMarkersText + class GVAR(toggle_vehicleMarkersText) : GVAR(toggle_squadMarkersText) { idc = -1; y = "safeZoneY + safeZoneH * 0.475"; text = "Toggle vehicle markers"; }; - class toggle_textTovehiclesText : toggle_squadMarkersText + class GVAR(toggle_textToVehiclesText) : GVAR(toggle_squadMarkersText) { idc = -1; y = "safeZoneY + safeZoneH * 0.525"; text = "Toggle vehicle text"; }; - class toggle_vehicleOccupationText : toggle_squadMarkersText + class GVAR(toggle_vehicleOccupationText) : GVAR(toggle_squadMarkersText) { idc = -1; y = "safeZoneY + safeZoneH * 0.575"; text = "Toggle vehicle occupation"; }; - class header : RscText + class GVAR(toggle_otherMarkers) : GVAR(toggle_squadMarkersText) + { + idc = -1; + x = "safeZoneX + safeZoneW * 0.5"; + y = "safeZoneY + safeZoneH * 0.425"; + text = "Toggle other markers"; + tooltip = "Show boxes etc"; + }; + class GVAR(toggle_otherMarkersText) : GVAR(toggle_otherMarkers) + { + idc = -1; + y = "safeZoneY + safeZoneH * 0.475"; + text = "Toggle other text"; + }; + class GVAR(header) : RscText { idc = -1; x = "safeZoneX + safeZoneW * 0.35"; @@ -70,38 +78,53 @@ class tunuti_starmakersSettings colorBackground[] = GUI_BCG_COLOR; }; - class toggle_squadMarkers_button : RscCheckBox + class GVAR(toggle_squadMarkers_button) : RscCheckBox { - idc = 321001; - x = "safeZoneX + safeZoneW * 0.5"; + idc = SQUADMARKER_BUTTON_IDC; + x = "safeZoneX + safeZoneW * 0.35"; y = "safeZoneY + safeZoneH * 0.425"; w = "safeZoneW * 0.015"; h = "safeZoneH * 0.025"; - onCheckedChanged = "params ['_control', '_checked']; tunuti_startmarkers_squadTogle = ([false, true] select _checked);"; + onCheckedChanged = QUOTE(params [ARR_2('_control','_checked)']; GVAR(squadTogle) = ([ARR_2(false,true)] select _checked);); }; - class toggle_vehicleMarkers_button : toggle_squadMarkers_button + class GVAR(toggle_vehicleMarkers_button) : GVAR(toggle_squadMarkers_button) { - idc = 321002; + idc = VEHICLEMARKER_BUTTON_IDC; y = "safeZoneY + safeZoneH * 0.475"; - onCheckedChanged = "params ['_control', '_checked']; tunuti_startmarkers_vehicleTogle = ([false, true] select _checked);"; + onCheckedChanged = QUOTE(params [ARR_2('_control','_checked)']; GVAR(vehicleTogle) = ([ARR_2(false,true)] select _checked);); }; - class toggle_vehicleText_button : toggle_squadMarkers_button + class GVAR(toggle_vehicleText_button) : GVAR(toggle_squadMarkers_button) { - idc = 321003; + idc = VEHICLETEXT_BUTTON_IDC; y = "safeZoneY + safeZoneH * 0.525"; - onCheckedChanged = "params ['_control', '_checked']; tunuti_startmarkers_vehicleTextToggle = ([false, true] select _checked);"; + onCheckedChanged = QUOTE(params [ARR_2('_control','_checked)']; GVAR(vehicleTextToggle) = ([ARR_2(false,true)] select _checked);); }; - class toggle_vehicleOccupation_button : toggle_squadMarkers_button + class GVAR(toggle_vehicleOccupation_button) : GVAR(toggle_squadMarkers_button) + { + idc = VEHICLOCCUPATION_BUTTON_IDC; + y = "safeZoneY + safeZoneH * 0.575"; + onCheckedChanged = QUOTE(params [ARR_2('_control','_checked)']; GVAR(vehicleOccupationToggle) = ([ARR_2(false,true)] select _checked);); + }; + class GVAR(toggle_otherMarkers_button) : GVAR(toggle_squadMarkers_button) + { + idc = OTHERMARKER_BUTTON_IDC; + x = "safeZoneX + safeZoneW * 0.48"; + y = "safeZoneY + safeZoneH * 0.425"; + onCheckedChanged = QUOTE(params [ARR_2('_control','_checked)']; GVAR(otherToggle) = ([ARR_2(false,true)] select _checked);); + tooltip = "Show boxes etc"; + }; + class GVAR(toggle_otherText_button) : GVAR(toggle_otherMarkers_button) { - idc = 321004; - y = "safeZoneY + safeZoneH * 0.575"; - onCheckedChanged = "params ['_control', '_checked']; tunuti_startmarkers_vehicleOccupationToggle = ([false, true] select _checked);"; + idc = OTHERTEXT_BUTTON_IDC; + y = "safeZoneY + safeZoneH * 0.475"; + onCheckedChanged = QUOTE(params [ARR_2('_control','_checked)']; GVAR(otherTextToggle) = ([ARR_2(false,true)] select _checked);); + }; - class toggle_ok_button : RscButton + class GVAR(toggle_ok_button) : RscButton { - idc = 321005; + idc = -1; x = "safeZoneX + safeZoneW * 0.6"; y = "safeZoneY + safeZoneH * 0.55"; w = "safeZoneW * 0.04010417"; @@ -111,7 +134,5 @@ class tunuti_starmakersSettings colorBackground[] = GUI_BCG_COLOR; onMouseButtonClick = QUOTE(ctrlParent (_this select 0) closeDisplay 1); }; - }; - -}; +}; \ No newline at end of file diff --git a/addons/unconinfo/Stringtable.xml b/addons/unconinfo/Stringtable.xml index 2966c7a..ec76229 100644 --- a/addons/unconinfo/Stringtable.xml +++ b/addons/unconinfo/Stringtable.xml @@ -50,41 +50,29 @@ No hay aliados cerca 友軍は付近に居ないようです - - %1Closest unit is %2 and %2 is medic (%3m) - %1Closest unit is %2 and %2 is medic (%3m) - %1El aliado mas cercano es %2 y es medico (%3m) - %1最も近い友軍は %2 で衛生兵です (%3m) - - - %1Closest unit is %2 and %2 is medic - %1Closest unit is %2 and %2 is medic - %1El aliado mas cercano es %2 y tambien es medico - %1最も近い友軍は %2 で衛生兵です - - - %1Closest unit is %2 (%3m)<br/>Closest medic is %4 (%5m) - %1Closest unit is %2 (%3m)<br/>Closest medic is %4 (%5m) - %1El aliado mas cercano es %2 (%3m)<br/>El medico mas cercano es %4 (%5m) - %1最も近い友軍は %2 です (%3m)<br/>最も近い衛生兵は %4 です (%5m) - - - %1Closest unit is %2<br/>Closest medic is %3 - %1Closest unit is %2<br/>Closest medic is %3 - %1El aliado mas cercano es %2<br/>El medico mas cercano es %3 - %1最も近い友軍は %2 です<br/>最も近い衛生兵は %3 です - - - %1Closest unit is %2 (%3m), but no medics nearby - %1Closest unit is %2 (%3m), but no medics nearby - %1El aliado mas cercano es %2 (%3m), pero no hay ningun medico cerca - %1最も近い友軍は %2 です (%3m), しかし付近に衛生兵はいません - - - %1Closest unit is %2, but no medics nearby - %1Closest unit is %2, but no medics nearby - %1El aliado mas cercano es %2, pero no hay ningun medico cerca - %1最も近い友軍は %2 です, しかし付近に衛生兵はいません + + %1 is medic and the nearest soldier + %1 is medic and the nearest soldier + El aliado mas cercano es %1 y es medico + 最も近い友軍は %1 で衛生兵です + + + The closest friendly soldier is %1 + The closest friendly soldier is %1 + El aliado mas cercano es %1 + 最も近い友軍は %1 です + + + The nearest medic is %1 + The nearest medic is %1 + El medico mas cercano es %1 + 最も近い衛生兵は %1 です + + + but no medics nearby + but no medics nearby + pero no hay ningun medico cerca + しかし付近に衛生兵はいません You are being helped! @@ -156,8 +144,6 @@ Delay before information is displayed after a player becomes unconscious Delay before information is displayed after a player becomes unconscious - - Enable uncon info Enable uncon info @@ -271,6 +257,30 @@ Enable showing if player has stable or unstable vitals Enable showing if player has stable or unstable vitals + + inside of a %1 + inside of a %1 + + + Enable showing player is in vehicle + Enable showing player is in vehicle + + + Enable displaying whether the player is inside vehicle + Enable displaying whether the player is inside vehicle + + + You are inside %1 + You are inside %1 + + + Enable showing others are in vehicle + Enable showing others are in vehicle + + + Enable displaying whether the friendly units are inside vehicle + Enable displaying whether the friendly units are inside vehicle + diff --git a/addons/unconinfo/XEH_postInit.sqf b/addons/unconinfo/XEH_postInit.sqf index 74fdd3c..f115bb5 100644 --- a/addons/unconinfo/XEH_postInit.sqf +++ b/addons/unconinfo/XEH_postInit.sqf @@ -6,6 +6,7 @@ _entity addEventHandler ["CuratorObjectRegistered", { params ["_curator"]; + if !(GVAR(enableUnconInfo)) exitWith { }; private _player = getAssignedCuratorUnit _curator; [] remoteExecCall [QFUNC(hideMessage), _player, false]; }]; diff --git a/addons/unconinfo/XEH_postInit_client.sqf b/addons/unconinfo/XEH_postInit_client.sqf index ad4db52..ba17059 100644 --- a/addons/unconinfo/XEH_postInit_client.sqf +++ b/addons/unconinfo/XEH_postInit_client.sqf @@ -16,12 +16,12 @@ }; if (!(_player getVariable ["ACE_isUnconscious", false]) || {!alive _player}) exitWith { - cutText ["", "PLAIN NOFADE", -1, false, true]; + QGVAR(cutTextLayer) cutText ["", "PLAIN NOFADE", -1, false, true]; [_handle] call CBA_fnc_removePerFrameHandler; }; if (GVAR(enableMoan)) then { - [_player] call FUNC(moan); + [_player, "moan", round random 2, nil, [15,25,40], true] call ace_medical_feedback_fnc_playInjuredSound; }; //Dont run at curator screen diff --git a/addons/unconinfo/XEH_preInit.sqf b/addons/unconinfo/XEH_preInit.sqf index 2c43070..8ce1e6f 100644 --- a/addons/unconinfo/XEH_preInit.sqf +++ b/addons/unconinfo/XEH_preInit.sqf @@ -6,206 +6,228 @@ PREP_RECOMPILE_START; PREP_RECOMPILE_END; [ - QGVAR(enableUnconInfo), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableUnconInfo", localize "STR_TunCon_CBA_enableUnconInfoTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(enableUnconInfo), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableUnconInfo", localize "STR_TunCon_CBA_enableUnconInfoTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(enableMoan), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableMoan", localize "STR_TunCon_CBA_enableMoanTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(enableMoan), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableMoan", localize "STR_TunCon_CBA_enableMoanTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(enableShowEpinephrine), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableShowEpinephrine", localize "STR_TunCon_CBA_enableShowEpinephrineTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(enableShowEpinephrine), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowEpinephrine", localize "STR_TunCon_CBA_enableShowEpinephrineTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(enableShowBleeding), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableShowBleeding", localize "STR_TunCon_CBA_enableShowBleedingTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(enableShowBleeding), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowBleeding", localize "STR_TunCon_CBA_enableShowBleedingTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(enableShowCardiacArrest), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableShowCardiacArrest", localize "STR_TunCon_CBA_enableShowCardiacArrestTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(enableShowCardiacArrest), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowCardiacArrest", localize "STR_TunCon_CBA_enableShowCardiacArrestTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(enableShowHeartRate), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableShowHeartRate", localize "STR_TunCon_CBA_enableShowHeartRateTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(enableShowHeartRate), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowHeartRate", localize "STR_TunCon_CBA_enableShowHeartRateTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(enableShowStableVitals), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableShowStableVitals", localize "STR_TunCon_CBA_enableShowStableVitalsTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(enableShowStableVitals), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowStableVitals", localize "STR_TunCon_CBA_enableShowStableVitalsTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(enableShowIfTreated), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableShowIfTreated", localize "STR_TunCon_CBA_enableShowIfTreatedTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(enableShowIfTreated), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowIfTreated", localize "STR_TunCon_CBA_enableShowIfTreatedTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(enableShowDetailedTreatment), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableShowDetailedTreatment", localize "STR_TunCon_CBA_enableShowDetailedTreatmentTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(enableShowDetailedTreatment), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowDetailedTreatment", localize "STR_TunCon_CBA_enableShowDetailedTreatmentTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(enableShowIfTreatedConcious), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableShowIfTreatedConcious", localize "STR_TunCon_CBA_enableShowIfTreatedConciousTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(enableShowIfTreatedConcious), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowIfTreatedConcious", localize "STR_TunCon_CBA_enableShowIfTreatedConciousTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(allowNearestUnit), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableShowingNearestUnit", localize "STR_TunCon_CBA_enableShowingNearestUnitTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(allowNearestUnit), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowingNearestUnit", localize "STR_TunCon_CBA_enableShowingNearestUnitTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(allowNearestUnitDistanceShown), - "CHECKBOX", - [localize "STR_TunCon_CBA_enableShowingDistance", localize "STR_TunCon_CBA_enableShowingDistanceTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - true, - 1, - {}, - true + QGVAR(allowNearestUnitDistanceShown), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowingDistance", localize "STR_TunCon_CBA_enableShowingDistanceTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(unconinfoNearestUnitDistance), - "SLIDER", - [localize "STR_TunCon_CBA_distanceToLookFriendlies", localize "STR_TunCon_CBA_distanceToLookFriendliesTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - [10, 100, 50, 0], - 1, - { - params ["_value"]; - _value = round _value; - GVAR(unconinfoNearestUnitDistance) = _value; - }, - true + QGVAR(enableShowIsInVehicle), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowIsInVehicle", localize "STR_TunCon_CBA_enableShowIsInVehicleTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(noFriendliesNearbyText), - "EDITBOX", - [localize "STR_TunCon_CBA_noFriends", localize "STR_TunCon_CBA_noFriendsTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - "Your current situation is not looking very good, you could wait or feel free to just press Esc -> Respawn.", - 1, - {}, - true -] call CBA_fnc_addSetting; - -[ - QGVAR(updateInterval), - "TIME", - [localize "STR_TunCon_CBA_updateInterval", localize "STR_TunCon_CBA_updateIntervalTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - [1, 60, 1, 0], - 1, - { - params ["_value"]; - _value = round _value; - GVAR(updateInterval) = _value; - }, - true -] call CBA_fnc_addSetting; - -[ - QGVAR(detailedTreatmentDelay), - "TIME", - [localize "STR_TunCon_CBA_detailedTreatmentDelay", localize "STR_TunCon_CBA_detailedTreatmentDelayTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - [0, 60, 0, 0], - 1, - { - params ["_value"]; - _value = round _value; - GVAR(detailedTreatmentDelay) = _value; - }, - true + QGVAR(enableShowIsOthersInVehicle), + "CHECKBOX", + [localize "STR_TunCon_CBA_enableShowIsInVehicleOthers", localize "STR_TunCon_CBA_enableShowIsInVehicleOthersTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + true, + 1, + {}, + false ] call CBA_fnc_addSetting; [ - QGVAR(delayForUnconInfoTexts), - "TIME", - [localize "STR_TunCon_CBA_delayForUnconInfoTexts", localize "STR_TunCon_CBA_delayForUnconInfoTextsTooltip"], - ["Tun Utilities - Uncon Info", "Uncon Info"], - [0, 60, 5, 0], - 1, - { - params ["_value"]; - _value = round _value; + QGVAR(unconinfoNearestUnitDistance), + "SLIDER", + [localize "STR_TunCon_CBA_distanceToLookFriendlies", localize "STR_TunCon_CBA_distanceToLookFriendliesTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + [10, 100, 50, 0], + 1, + { + params ["_value"]; + _value = round _value; + GVAR(unconinfoNearestUnitDistance) = _value; + }, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(noFriendliesNearbyText), + "EDITBOX", + [localize "STR_TunCon_CBA_noFriends", localize "STR_TunCon_CBA_noFriendsTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + "Your current situation is not looking very good, you could wait or feel free to just press Esc -> Respawn.", + 1, + {}, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(updateInterval), + "TIME", + [localize "STR_TunCon_CBA_updateInterval", localize "STR_TunCon_CBA_updateIntervalTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + [1, 60, 1, 0], + 1, + { + params ["_value"]; + _value = round _value; + GVAR(updateInterval) = _value; + }, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(detailedTreatmentDelay), + "TIME", + [localize "STR_TunCon_CBA_detailedTreatmentDelay", localize "STR_TunCon_CBA_detailedTreatmentDelayTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + [0, 60, 0, 0], + 1, + { + params ["_value"]; + _value = round _value; + GVAR(detailedTreatmentDelay) = _value; + }, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(delayForUnconInfoTexts), + "TIME", + [localize "STR_TunCon_CBA_delayForUnconInfoTexts", localize "STR_TunCon_CBA_delayForUnconInfoTextsTooltip"], + ["Tun Utilities - Uncon Info", "Uncon Info"], + [0, 60, 5, 0], + 1, + { + params ["_value"]; + _value = round _value; GVAR(delayForUnconInfoTexts) = _value; }, - true + false ] call CBA_fnc_addSetting; ADDON = true; \ No newline at end of file diff --git a/addons/unconinfo/XEH_prep.hpp b/addons/unconinfo/XEH_prep.hpp index f2681e7..d9885d0 100644 --- a/addons/unconinfo/XEH_prep.hpp +++ b/addons/unconinfo/XEH_prep.hpp @@ -1,4 +1,3 @@ PREP(hideMessage); -PREP(moan); PREP(treatmentEH); PREP(unconInfo); \ No newline at end of file diff --git a/addons/unconinfo/config.cpp b/addons/unconinfo/config.cpp index 12984c5..1aa7773 100644 --- a/addons/unconinfo/config.cpp +++ b/addons/unconinfo/config.cpp @@ -7,7 +7,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {MAIN_ADDON_STR}; + requiredAddons[] = {MAIN_ADDON_STR, "ace_medical_feedback", "ace_medical", "ace_medical_status", "ace_common"}; author = "Tuntematon"; authorUrl = GITHUBLINK; //VERSION_CONFIG; diff --git a/addons/unconinfo/functions/fnc_hideMessage.sqf b/addons/unconinfo/functions/fnc_hideMessage.sqf index 9eab1d4..fd072c2 100644 --- a/addons/unconinfo/functions/fnc_hideMessage.sqf +++ b/addons/unconinfo/functions/fnc_hideMessage.sqf @@ -15,5 +15,5 @@ #include "script_component.hpp" if (GVAR(enableUnconInfo) && player getVariable ["ACE_isUnconscious", false]) then { - cutText ["", "PLAIN NOFADE", -1, false, true]; + QGVAR(cutTextLayer) cutText ["", "PLAIN NOFADE", -1, false, true]; }; \ No newline at end of file diff --git a/addons/unconinfo/functions/fnc_moan.sqf b/addons/unconinfo/functions/fnc_moan.sqf deleted file mode 100644 index 22b207c..0000000 --- a/addons/unconinfo/functions/fnc_moan.sqf +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Author: - * - * - * [Description] - * place holder until ace update - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call tunuti_unconInfo_fnc_moan - */ -#include "script_component.hpp" -params [["_unit", objNull, [objNull]]]; - -LOG("Start Moan"); -// Check delay between sounds -if (_unit getVariable [QGVAR(delayTime_moan), -1] > CBA_missionTime) exitWith {LOG("Exit moan. Too soon")}; -private _delayTime = (floor random 30) + 10; -_unit setVariable [QGVAR(delayTime_moan), (CBA_missionTime + _delayTime)]; - -// Get units speaker -private _speaker = speaker _unit; -if (_speaker == "ACE_NoVoice") then { - _speaker = _unit getVariable "ace_originalSpeaker"; -}; - -// Fallback if speaker has no associated scream/moan sound -if (isNull (configFile >> "CfgSounds" >> format ["ACE_moan_%1_low_1", _speaker])) then { - _speaker = "Male08ENG"; -}; - -// Select actual sound -private _variation = selectRandom ["low", "mid", "high"]; - -private _cfgSounds = configFile >> "CfgSounds"; -private _targetClass = format ["ACE_moan_%1_%2_", _speaker, _variation]; -private _index = 1; -private _sounds = []; - -while {isClass (_cfgSounds >> (_targetClass + str _index))} do { - _sounds pushBack (_cfgSounds >> (_targetClass + str _index)); - INC(_index); -}; - -private _sound = configName selectRandom _sounds; -if (isNil "_sound") exitWith {}; - -private _distance = random [10, 25, 40]; -private _players = allPlayers inAreaArray [ASLToAGL getPosASL _unit, _distance + 5, _distance + 5, 0, true, _distance + 5]; -[_unit,[_sound, _distance]] remoteExecCall ["say3D", _players]; diff --git a/addons/unconinfo/functions/fnc_unconInfo.sqf b/addons/unconinfo/functions/fnc_unconInfo.sqf index 13ede12..dddb0d2 100644 --- a/addons/unconinfo/functions/fnc_unconInfo.sqf +++ b/addons/unconinfo/functions/fnc_unconInfo.sqf @@ -51,11 +51,20 @@ if (ace_player getVariable ["ace_medical_inCardiacArrest", false]) then { }; }; +if (GVAR(enableShowIsInVehicle)) then { + private _closestUnitVehicle = vehicle ace_player; + if (_closestUnitVehicle isNotEqualTo ace_player) then { + private _vehicleName = _closestUnitVehicle getVariable ["displayName", getText (configOf _closestUnitVehicle >> "displayName")]; + _text = _text + (format[localize "STR_TunCon_insideVehicle", _vehicleName]) + "
"; + }; +}; + if (GVAR(allowNearestUnit)) then { private _distance = GVAR(unconInfoNearestUnitDistance); - private _nearUnits = (ace_player nearEntities ["CAManBase", _distance]) - [ace_player]; - FILTER(_nearUnits,playerSide isEqualTo side _x); + private _pos = ASLToAGL getPosASL ace_player; + private _nearUnits = ([_pos, _distance, _distance, 0, false] nearEntities [["CAManBase"], false, true, true]) - [ace_player]; + FILTER(_nearUnits,playerSide isEqualTo side _x && [_x] call ace_common_fnc_isAwake && !(unitIsUAV _x)); private _closestUnit = objNull; private _closestMedic = objNull; private _closestUnitDistance = _distance; @@ -64,7 +73,8 @@ if (GVAR(allowNearestUnit)) then { { private _unit = _x; private _distance = ace_player distance _unit; - if (_distance <= _closestUnitDistance && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { + + if (_distance <= _closestUnitDistance) then { _closestUnit = _unit; _closestUnitDistance = round _distance; }; @@ -76,26 +86,53 @@ if (GVAR(allowNearestUnit)) then { } forEach _nearUnits; if (_closestUnit isNotEqualTo objNull) then { - if (_closestMedic isNotEqualTo objNull) then { - if (_closestUnit isEqualTo _closestMedic) then { - if (_nearestUnitDistanceAllowed) then { - _text = format [localize "STR_TunCon_closestUnitWithDistance",_text, name _closestUnit, _closestUnitDistance]; - } else { - _text = format [localize "STR_TunCon_closestUnitWithOutDistance",_text, name _closestUnit]; - }; - } else { - if (_nearestUnitDistanceAllowed) then { - _text = format [localize "STR_TunCon_closestUnitAndMedicWithDistance",_text, name _closestUnit, _closestUnitDistance, name _closestMedic, _closestMedicDistance]; - } else { - _text = format [localize "STR_TunCon_closestUnitAndMedicWithOutDistance",_text, name _closestUnit, name _closestMedic]; - }; + private _showInVehicleAllowed = GVAR(enableShowIsOthersInVehicle); + private _closestUnitVehicle = vehicle _closestUnit; + private _closestUnitInVehicle = _closestUnitVehicle isNotEqualTo _closestUnit; + private _closestUnitInVehicleText = ""; + if (_closestUnitInVehicle) then { + private _vehicleName = _closestUnitVehicle getVariable ["displayName", getText (configOf _closestUnitVehicle >> "displayName")]; + _closestUnitInVehicleText = format [localize "STR_TunCon_isInVehicle", _vehicleName];; + }; + + if (_closestUnit isEqualTo _closestMedic) then { + _text = _text + (format [localize "STR_TunCon_closestUnitIsMedic", name _closestUnit]); + + if (_closestUnitInVehicle && _showInVehicleAllowed) then { + _text = _text + " " + _closestUnitInVehicleText; + }; + + if (_nearestUnitDistanceAllowed) then { + _text = _text + format[" (%1m)", _closestUnitDistance]; }; } else { + private _closestUnitText = (format [localize "STR_TunCon_closestUnit", name _closestUnit]); + private _closestMedicText = format [localize "STR_TunCon_closestMedic", name _closestMedic]; + + if (_closestUnitInVehicle && _showInVehicleAllowed) then { + _closestUnitText = _closestUnitText + " " + _closestUnitInVehicleText; + }; + if (_nearestUnitDistanceAllowed) then { - _text = format [localize "STR_TunCon_closestUnitNoMedicWithDistance",_text, name _closestUnit, _closestUnitDistance]; + _closestUnitText = _closestUnitText + format[" (%1m)", _closestUnitDistance]; + }; + + if (_closestMedic isEqualTo objNull) then { + _closestMedicText = localize "STR_TunCon_noMedicsNear"; } else { - _text = format [localize "STR_TunCon_closestUnitNoMedicWithOutDistance",_text, name _closestUnit]; + private _closestMedicVehicle = vehicle _closestMedic; + private _closestMedicInVehicle = _closestMedicVehicle isNotEqualTo _closestMedic; + + if (_closestMedicInVehicle && _showInVehicleAllowed) then { + private _vehicleName = _closestMedicVehicle getVariable ["displayName", getText (configOf _closestMedicVehicle >> "displayName")]; + _closestMedicText = _closestMedicText + " " + (format [localize "STR_TunCon_isInVehicle", _vehicleName]); + }; + + if (_nearestUnitDistanceAllowed) then { + _closestMedicText = _closestMedicText + format[" (%1m)", _closestMedicDistance]; + }; }; + _text = _text + _closestUnitText + "
" + _closestMedicText; }; } else { _text = _text + localize "STR_TunCon_noFriends"; @@ -128,4 +165,4 @@ if (_text isEqualTo ""+(localize "STR_TunCon_fir _text = ""; }; -cutText [""+_text+"", "PLAIN NOFADE" , -1, false, true]; \ No newline at end of file +QGVAR(cutTextLayer) cutText [""+_text+"", "PLAIN NOFADE" , -1, false, true]; \ No newline at end of file diff --git a/addons/unconinfo/script_component.hpp b/addons/unconinfo/script_component.hpp index a7b66e7..81ced0d 100644 --- a/addons/unconinfo/script_component.hpp +++ b/addons/unconinfo/script_component.hpp @@ -5,11 +5,8 @@ // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE -#ifdef DEBUG_ENABLED_UNCONINFO +#ifdef DEBUG_ENABLED_MAIN #define DEBUG_MODE_FULL #endif - #ifdef DEBUG_SETTINGS_UNCONINFO - #define DEBUG_SETTINGS DEBUG_SETTINGS_UNCONINFO -#endif #include "\x\tunuti\addons\main\script_macros.hpp" diff --git a/addons/utilities/CfgEventHandlers.hpp b/addons/utilities/CfgEventHandlers.hpp index b343216..67228c6 100644 --- a/addons/utilities/CfgEventHandlers.hpp +++ b/addons/utilities/CfgEventHandlers.hpp @@ -1,18 +1,18 @@ class Extended_PreStart_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; }; class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; }; class Extended_PostInit_EventHandlers { - class ADDON { - serverInit = QUOTE(call COMPILE_FILE(XEH_postInit_server)); - clientInit = QUOTE(call COMPILE_FILE(XEH_postInit_client)); - }; + class ADDON { + serverInit = QUOTE(call COMPILE_FILE(XEH_postInit_server)); + clientInit = QUOTE(call COMPILE_FILE(XEH_postInit_client)); + }; }; diff --git a/addons/utilities/XEH_preInit.sqf b/addons/utilities/XEH_preInit.sqf index bea4e17..69450d5 100644 --- a/addons/utilities/XEH_preInit.sqf +++ b/addons/utilities/XEH_preInit.sqf @@ -6,83 +6,83 @@ PREP_RECOMPILE_START; PREP_RECOMPILE_END; [ - QGVAR(runLoadScreen), // Unique setting name. Matches resulting variable name - "CHECKBOX", // Type of setting. Can be "CHECKBOX", "EDITBOX", "LIST", "SLIDER" or "COLOR" - ["Run load screen", "On mission start, force players to map screen, so decreasing desync"], // Display name or display name + tooltip (optional, default: same as setting name) - ["Tun Utilities - Utilities", "Load Screen"], // 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) + QGVAR(runLoadScreen), // Unique setting name. Matches resulting variable name + "CHECKBOX", // Type of setting. Can be "CHECKBOX", "EDITBOX", "LIST", "SLIDER" or "COLOR" + ["Run load screen", "On mission start, force players to map screen, so decreasing desync"], // Display name or display name + tooltip (optional, default: same as setting name) + ["Tun Utilities - Utilities", "Load Screen"], // 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_fnc_addSetting; [ - QGVAR(loadScreenTime), - "SLIDER", - ["Load screen time", "Duration for load screen (Seconds)"], - ["Tun Utilities - Utilities", "Load Screen"], - [15, 120, 20, 0], - 1, - { - params ["_value"]; - GVAR(loadScreenTime) = round _value; - }, - true + QGVAR(loadScreenTime), + "TIME", + ["Load screen time", "Duration for load screen"], + ["Tun Utilities - Utilities", "Load Screen"], + [15, 120, 20], + 1, + { + params ["_value"]; + GVAR(loadScreenTime) = round _value; + }, + true ] call CBA_fnc_addSetting; [ - QGVAR(loadScreenText), - "EDITBOX", - ["Load screen text", "Text shown during mission start"], - ["Tun Utilities - Utilities", "Load Screen"], - "Ladataan Tehtävää \n Loading mission", - 1, - { }, - true + QGVAR(loadScreenText), + "EDITBOX", + ["Load screen text", "Text shown during mission start"], + ["Tun Utilities - Utilities", "Load Screen"], + "Ladataan Tehtävää \n Loading mission", + 1, + { }, + true ] call CBA_fnc_addSetting; [ - QGVAR(rulesHintEnable), - "CHECKBOX", - "Enable rules hint", - ["Tun Utilities - Utilities", "Load Screen"], - true, - 1, - {}, - true + QGVAR(rulesHintEnable), + "CHECKBOX", + "Enable rules hint", + ["Tun Utilities - Utilities", "Load Screen"], + true, + 1, + {}, + true ] call CBA_fnc_addSetting; [ - QGVAR(rulesTitleText), - "EDITBOX", - ["Rules title text", "this is title for hintC, look more info in arma wiki"], - ["Tun Utilities - Utilities", "Load Screen"], - "The Ten Commandments", - 1, - { }, - true + QGVAR(rulesTitleText), + "EDITBOX", + ["Rules title text", "this is title for hintC, look more info in arma wiki"], + ["Tun Utilities - Utilities", "Load Screen"], + "The Ten Commandments", + 1, + { }, + true ] call CBA_fnc_addSetting; [ - QGVAR(rulesMessageText), - "EDITBOX", - ["Rules message text", "this is message for hintC, look more info in arma wiki"], - ["Tun Utilities - Utilities", "Load Screen"], - '["1. Be polite, kind and consider others in all situations","2. Play fair. Don’t cheat/hack/ghost.","3. Listen to the event host and admin","4. Act according to your leaders intent","5. Do not use any enemy vehicles or equipment unless specifically instructed by the mission","6. Do not misuse markers.","7. Do not solo. Always accompany your friendly forces. If separated, find friendly forces.","8. Do not loot dead bodies for additional equipment during mission start.","9. There is picture of each sides soldier in briefing. Take good look at them in INTEL tab in briefing, to prevent Blue on Blue!!!","10. Good Luck & Have fun"]', - 1, - { GVAR(rulesMessageText) = call compile _this}, - true + QGVAR(rulesMessageText), + "EDITBOX", + ["Rules message text", "this is message for hintC, look more info in arma wiki"], + ["Tun Utilities - Utilities", "Load Screen"], + '["1. Be polite, kind and consider others in all situations","2. Play fair. Don’t cheat/hack/ghost.","3. Listen to the event host and admin","4. Act according to your leaders intent","5. Do not use any enemy vehicles or equipment unless specifically instructed by the mission","6. Do not misuse markers.","7. Do not solo. Always accompany your friendly forces. If separated, find friendly forces.","8. Do not loot dead bodies for additional equipment during mission start.","9. There is picture of each sides soldier in briefing. Take good look at them in INTEL tab in briefing, to prevent Blue on Blue!!!","10. Good Luck & Have fun"]', + 1, + { GVAR(rulesMessageText) = call compile _this}, + true ] call CBA_fnc_addSetting; [ - QGVAR(enableSpectatorStats), - "CHECKBOX", - "Enable spectator stats", - ["Tun Utilities - Utilities", "Spectator stats"], - true, - 1, - {}, - true + QGVAR(enableSpectatorStats), + "CHECKBOX", + "Enable spectator stats", + ["Tun Utilities - Utilities", "Spectator stats"], + true, + 1, + {}, + true ] call CBA_fnc_addSetting; ADDON = true; \ No newline at end of file diff --git a/addons/utilities/config.cpp b/addons/utilities/config.cpp index e87f4f3..a60f7c3 100644 --- a/addons/utilities/config.cpp +++ b/addons/utilities/config.cpp @@ -2,16 +2,16 @@ // information on this addon specifically class CfgPatches { - class ADDON { - name = COMPONENT_NAME; - units[] = { QGVAR(combatZoneModule), "tun_utilities_combatZoneModule" }; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"cba_main","cba_xeh","cba_settings","ace_modules",MAIN_ADDON_STR}; - author = "Tuntematon"; - authorUrl = GITHUBLINK; - VERSION_CONFIG; - }; + class ADDON { + name = COMPONENT_NAME; + units[] = { QGVAR(combatZoneModule), "tun_utilities_combatZoneModule" }; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"cba_main","cba_xeh","cba_settings","ace_modules",MAIN_ADDON_STR}; + author = "Tuntematon"; + authorUrl = GITHUBLINK; + VERSION_CONFIG; + }; }; // configs go here #include "CfgEventHandlers.hpp" @@ -24,93 +24,93 @@ class RscXSliderH; class CfgFactionClasses { - class NO_CATEGORY; - class GVAR(category) : NO_CATEGORY - { - displayName = "Tun Utilities"; - }; + class NO_CATEGORY; + class GVAR(category) : NO_CATEGORY + { + displayName = "Tun Utilities"; + }; }; class CfgVehicles { - class ACE_Module; - class GVAR(combatZoneModule): ACE_Module { - author = "Tuntematon"; - category = QGVAR(category); - displayName = "Tun Combat Zone"; - function = QFUNC(combatZone); - scope = 2;// Editor visibility; 2 will show it in the menu, 1 will hide it. - isGlobal = 1; // 0 for server only execution, 1 for global execution, 2 for persistent global execution - isTriggerActivated = 0; - isDisposable = 0; // 1 if modules is to be disabled once it's activated (i.e., repeated trigger activation won't work) - //icon = QPATHTOF(UI\Icon_Module_Slideshow_ca.paa); - class Arguments { - class markerPreFix { - displayName = "Marker prefix"; - //description = ""; - typeName = "STRING"; - defaultValue = ""; - }; - - class markerCount { - displayName = "Marker Count"; - //description = ""; - typeName = "NUMBER"; - defaultValue = 0; - }; - - class updateInterval { - displayName = "Update interval"; - //description = ""; - typeName = "NUMBER"; - defaultValue = 10; - }; + class ACE_Module; + class GVAR(combatZoneModule): ACE_Module { + author = "Tuntematon"; + category = QGVAR(category); + displayName = "Tun Combat Zone"; + function = QFUNC(combatZone); + scope = 2;// Editor visibility; 2 will show it in the menu, 1 will hide it. + isGlobal = 1; // 0 for server only execution, 1 for global execution, 2 for persistent global execution + isTriggerActivated = 0; + isDisposable = 0; // 1 if modules is to be disabled once it's activated (i.e., repeated trigger activation won't work) + //icon = QPATHTOF(UI\Icon_Module_Slideshow_ca.paa); + class Arguments { + class markerPreFix { + displayName = "Marker prefix"; + //description = ""; + typeName = "STRING"; + defaultValue = ""; + }; + + class markerCount { + displayName = "Marker Count"; + //description = ""; + typeName = "NUMBER"; + defaultValue = 0; + }; + + class updateInterval { + displayName = "Update interval"; + //description = ""; + typeName = "NUMBER"; + defaultValue = 10; + }; - class hintText { - displayName = "Notification text"; - //description = ""; - typeName = "STRING"; - defaultValue = "Warning!
You are leaving the combatzone. TURN BACK!"; - }; + class hintText { + displayName = "Notification text"; + //description = ""; + typeName = "STRING"; + defaultValue = "Warning!
You are leaving the combatzone. TURN BACK!"; + }; - // class sound { - // displayName = "Sound"; - // //description = ""; - // typeName = "STRING"; - // defaultValue = "beep_strobe"; - // }; + // class sound { + // displayName = "Sound"; + // //description = ""; + // typeName = "STRING"; + // defaultValue = "beep_strobe"; + // }; - class sideWest { - displayName = "Enable West"; - //description = ""; - typeName = "BOOL"; - defaultValue = 0; - }; - - class sideEast { - displayName = "Enable East"; - //description = ""; - typeName = "BOOL"; - defaultValue = 0; - }; - - class sideResistance { - displayName = "Enable Resistance"; - //description = ""; - typeName = "BOOL"; - defaultValue = 0; - }; - - class sideCiv { - displayName = "Enable Civilian"; - //description = ""; - typeName = "BOOL"; - defaultValue = 0; - }; - }; - }; + class sideWest { + displayName = "Enable West"; + //description = ""; + typeName = "BOOL"; + defaultValue = 0; + }; + + class sideEast { + displayName = "Enable East"; + //description = ""; + typeName = "BOOL"; + defaultValue = 0; + }; + + class sideResistance { + displayName = "Enable Resistance"; + //description = ""; + typeName = "BOOL"; + defaultValue = 0; + }; + + class sideCiv { + displayName = "Enable Civilian"; + //description = ""; + typeName = "BOOL"; + defaultValue = 0; + }; + }; + }; - class tun_utilities_combatZoneModule : GVAR(combatZoneModule) { - displayName = "Deprecated - But works"; - scope = 1;// Editor visibility; 2 will show it in the menu, 1 will hide it. - }; + class tun_utilities_combatZoneModule : GVAR(combatZoneModule) { + displayName = "Deprecated - But works"; + scope = 1;// Editor visibility; 2 will show it in the menu, 1 will hide it. + }; }; \ No newline at end of file diff --git a/addons/utilities/functions/fnc_combatZone.sqf b/addons/utilities/functions/fnc_combatZone.sqf index 3392b90..23afe48 100644 --- a/addons/utilities/functions/fnc_combatZone.sqf +++ b/addons/utilities/functions/fnc_combatZone.sqf @@ -26,19 +26,19 @@ private _sideCiv = _module getVariable ["sideCiv", false]; private _sides = []; if (_sideWest) then { - _sides pushBack west; + _sides pushBack west; }; if (_sideEast) then { - _sides pushBack east; + _sides pushBack east; }; if (_sideResistance) then { - _sides pushBack resistance; + _sides pushBack resistance; }; if (_sideCiv) then { - _sides pushBack civilian; + _sides pushBack civilian; }; private _debugText = format ["init combatzone for: %1", _sides]; @@ -46,53 +46,53 @@ LOG(_debugText); [{ !isNull player && ( !isNull findDisplay 52 || !isNull findDisplay 53 || !isNull findDisplay 12 )}, { _this params ["_sides", "_markerPrefix", "_markerCount", "_updateInterval", "_hintText"]; - if (playerSide in _sides && isNil QGVAR(borderPolygon)) then { - GVAR(borderPolygon) = []; - for "_i" from 1 to _markerCount do { - GVAR(borderPolygon) pushBack (getMarkerPos (format ["%2_%1", _i,_markerPrefix])); - }; + if (playerSide in _sides && isNil QGVAR(borderPolygon)) then { + GVAR(borderPolygon) = []; + for "_i" from 1 to _markerCount do { + GVAR(borderPolygon) pushBack (getMarkerPos (format ["%2_%1", _i,_markerPrefix])); + }; - if (isNull findDisplay 12) then { - private _displayIDD = TUNUTI_FIND_MAPDISPLAY; - findDisplay _displayIDD displayCtrl 51 ctrlAddEventHandler ["Draw", { - _this select 0 drawPolygon [GVAR(borderPolygon), [1,0,0,1]]; - }]; - LOG("Create combatzone for briefing screen"); - }; + if (isNull findDisplay 12) then { + private _displayIDD = TUNUTI_FIND_MAPDISPLAY; + findDisplay _displayIDD displayCtrl 51 ctrlAddEventHandler ["Draw", { + _this select 0 drawPolygon [GVAR(borderPolygon), [1,0,0,1]]; + }]; + LOG("Create combatzone for briefing screen"); + }; - [{ controlNull isNotEqualTo (findDisplay 12 displayCtrl 51) }, { - _this params ["_updateInterval", "_hintText"]; - findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { - _this select 0 drawPolygon [GVAR(borderPolygon), [1,0,0,1]]; - }]; - LOG("Create combatzone for main screen"); - _handle = [{ - _args params ["_hintText"]; - if ( player isKindOf "man" && {alive player} && {!(player isKindOf "ace_spectator_virtual")} && {playerSide in [west,east,resistance,civilian]} && {!(vehicle player isKindOf "air")} && {!(player getVariable ["tunres_Respawn_isWaitingRespawn", false])} ) then { - private _player_pos = getPos player; - if !( _player_pos inPolygon GVAR(borderPolygon)) then { - [(format["%1",_hintText]),-1,-1,4,1,0,789] spawn BIS_fnc_dynamicText; - switch (ceil random 3) do { - case 1: { - playSound3D ['a3\dubbing_f_epa\zone_restriction\A_Warn_No_Leader\zone_restriction_a_warn_no_leader_KER_0.ogg', player]; + [{ controlNull isNotEqualTo (findDisplay 12 displayCtrl 51) }, { + _this params ["_updateInterval", "_hintText"]; + findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { + _this select 0 drawPolygon [GVAR(borderPolygon), [1,0,0,1]]; + }]; + LOG("Create combatzone for main screen"); + _handle = [{ + _args params ["_hintText"]; + if ( player isKindOf "man" && {alive player} && {!(player isKindOf "ace_spectator_virtual")} && {playerSide in [west,east,resistance,civilian]} && {!(vehicle player isKindOf "air")} && {!(player getVariable ["tunres_Respawn_isWaitingRespawn", false])} ) then { + private _player_pos = getPos player; + if !( _player_pos inPolygon GVAR(borderPolygon)) then { + [(format["%1",_hintText]),-1,-1,4,1,0,789] spawn BIS_fnc_dynamicText; + switch (ceil random 3) do { + case 1: { + playSound3D ['a3\dubbing_f_epa\zone_restriction\A_Warn_No_Leader\zone_restriction_a_warn_no_leader_KER_0.ogg', player]; - [[profileName, "Where the hell am I? I should check my map.", 0]] spawn BIS_fnc_EXP_camp_playSubtitles; - }; - case 2: { - playSound3D ['a3\dubbing_f_epa\zone_restriction\A_Warn_No_Leader\zone_restriction_a_warn_no_leader_KER_1.ogg', player]; + [[profileName, "Where the hell am I? I should check my map.", 0]] spawn BIS_fnc_EXP_camp_playSubtitles; + }; + case 2: { + playSound3D ['a3\dubbing_f_epa\zone_restriction\A_Warn_No_Leader\zone_restriction_a_warn_no_leader_KER_1.ogg', player]; - [[profileName, "This doesn't look right at all. Where am I?", 0]] spawn BIS_fnc_EXP_camp_playSubtitles; - }; - case 3: { - playSound3D ['a3\dubbing_f_epa\zone_restriction\A_Warn_No_Leader\zone_restriction_a_warn_no_leader_KER_2.ogg', player]; + [[profileName, "This doesn't look right at all. Where am I?", 0]] spawn BIS_fnc_EXP_camp_playSubtitles; + }; + case 3: { + playSound3D ['a3\dubbing_f_epa\zone_restriction\A_Warn_No_Leader\zone_restriction_a_warn_no_leader_KER_2.ogg', player]; - [[profileName, "Wow, I must be way off course. Better check my map.", 0]] spawn BIS_fnc_EXP_camp_playSubtitles; - }; - }; - LOG("player out of AO"); - }; - }; - }, _updateInterval, [_hintText]] call CBA_fnc_addPerFrameHandler; - }, [_updateInterval, _hintText]] call CBA_fnc_waitUntilAndExecute; - }; + [[profileName, "Wow, I must be way off course. Better check my map.", 0]] spawn BIS_fnc_EXP_camp_playSubtitles; + }; + }; + LOG("player out of AO"); + }; + }; + }, _updateInterval, [_hintText]] call CBA_fnc_addPerFrameHandler; + }, [_updateInterval, _hintText]] call CBA_fnc_waitUntilAndExecute; + }; }, [_sides, _markerPrefix, _markerCount, _updateInterval, _hintText]] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/addons/utilities/functions/fnc_loadScreen.sqf b/addons/utilities/functions/fnc_loadScreen.sqf index 60009c3..0061655 100644 --- a/addons/utilities/functions/fnc_loadScreen.sqf +++ b/addons/utilities/functions/fnc_loadScreen.sqf @@ -17,54 +17,54 @@ INFO("Called desync load screen"); if (!isMultiplayer) exitWith { LOG("Skip desync load screen in SP"); }; // skip if singleplayer [{!isNull player && !isNull findDisplay 12 && !isNil QGVAR(runLoadScreen)}, { - if (!GVAR(runLoadScreen) || (count allPlayers < 10)) exitWith { INFO("Desync load screen disabled or under 10 players"); }; - if !(playerSide in [west, east, resistance, civilian]) exitWith { INFO("Not in right side, so skip desync load screen"); }; - INFO("Start desync load screen"); + if (!GVAR(runLoadScreen) || (count allPlayers < 10)) exitWith { INFO("Desync load screen disabled or under 10 players"); }; + if !(playerSide in [west, east, resistance, civilian]) exitWith { INFO("Not in right side, so skip desync load screen"); }; + INFO("Start desync load screen"); GVAR(loadScreenTimer) = GVAR(loadScreenTime); - if (cba_missiontime > GVAR(loadScreenTime)) then { - GVAR(loadScreenTimer) = (GVAR(loadScreenTime) / 2); - }; + if (cba_missiontime > GVAR(loadScreenTime)) then { + GVAR(loadScreenTimer) = (GVAR(loadScreenTime) / 2); + }; - GVAR(loadscreenDone) = false; - player enableSimulationGlobal false; - - private _camera = "camera" camCreate [(getPos player select 0),(getPos player select 1),100]; - _camera cameraEffect ["internal","back"]; - _camera camSetFov 0.700; - _camera camSetTarget player; - _camera camCommit 0; + GVAR(loadscreenDone) = false; + player enableSimulationGlobal false; + + private _camera = "camera" camCreate [(getPos player select 0),(getPos player select 1),100]; + _camera cameraEffect ["internal","back"]; + _camera camSetFov 0.700; + _camera camSetTarget player; + _camera camCommit 0; openMap [true, true]; - //Run loadscreen text loop - private _debugText = format ["Desync load screen start time: %1", cba_missiontime]; - INFO(_debugText); - [{ - if (GVAR(loadScreenTimer) <= 0) then { - titleText [GVAR(loadScreenText), "PLAIN", 5, true]; - titleFadeOut 5; - [_handle] call CBA_fnc_removePerFrameHandler; - GVAR(loadscreenDone) = true; - } else { - titleText [format ["%2\n%1", GVAR(loadScreenTimer), GVAR(loadScreenText)], "PLAIN", 1, true]; - titleFadeOut 5; - GVAR(loadScreenTimer) = GVAR(loadScreenTimer) - 1; - }; - }, 1] call CBA_fnc_addPerFrameHandler; + //Run loadscreen text loop + private _debugText = format ["Desync load screen start time: %1", cba_missiontime]; + INFO(_debugText); + [{ + if (GVAR(loadScreenTimer) <= 0) then { + titleText [GVAR(loadScreenText), "PLAIN", 5, true]; + titleFadeOut 5; + [_handle] call CBA_fnc_removePerFrameHandler; + GVAR(loadscreenDone) = true; + } else { + titleText [format ["%2\n%1", GVAR(loadScreenTimer), GVAR(loadScreenText)], "PLAIN", 1, true]; + titleFadeOut 5; + GVAR(loadScreenTimer) = GVAR(loadScreenTimer) - 1; + }; + }, 1] call CBA_fnc_addPerFrameHandler; - // Destroy camera after loadtime is done - [{GVAR(loadscreenDone)}, { - private _camera = _this; - player cameraEffect ["terminate","back"]; - camDestroy _camera; - titleText ["", "PLAIN"]; - openMap [false, false]; + // Destroy camera after loadtime is done + [{GVAR(loadscreenDone)}, { + private _camera = _this; + player cameraEffect ["terminate","back"]; + camDestroy _camera; + titleText ["", "PLAIN"]; + openMap [false, false]; if (GVAR(rulesHintEnable)) then { - GVAR(rulesTitleText) hintC GVAR(rulesMessageText); + GVAR(rulesTitleText) hintC GVAR(rulesMessageText); }; - - player enableSimulationGlobal true; - private _debugText = format ["Desync load screen end time: %1", cba_missiontime]; - INFO(_debugText); - }, _camera] call CBA_fnc_waitUntilAndExecute; + + player enableSimulationGlobal true; + private _debugText = format ["Desync load screen end time: %1", cba_missiontime]; + INFO(_debugText); + }, _camera] call CBA_fnc_waitUntilAndExecute; }] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/addons/utilities/functions/fnc_openBiggerPicture.sqf b/addons/utilities/functions/fnc_openBiggerPicture.sqf index ea31129..d3a7b0d 100644 --- a/addons/utilities/functions/fnc_openBiggerPicture.sqf +++ b/addons/utilities/functions/fnc_openBiggerPicture.sqf @@ -18,7 +18,6 @@ private _display = uiNamespace getVariable [QGVAR(biggerPictureInBriefingUI), di if (!isNull _display) then { _display closeDisplay 1; - diag_log "suljettiin vanha"; }; private _control = findDisplay TUNUTI_FIND_MAPDISPLAY createDisplay QGVAR(biggerPictureInBriefingUI); @@ -28,5 +27,4 @@ uiNamespace setVariable [QGVAR(biggerPictureInBriefingUI), _control]; private _imagePath = _this; _textControl = (uiNamespace getVariable QGVAR(biggerPictureInBriefingUI)) displayCtrl BIGGER_PICTURE_IMAGE_IDC; _textControl ctrlSetText _imagePath; - }, _imagePath] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/addons/utilities/script_component.hpp b/addons/utilities/script_component.hpp index bf2b738..76de02b 100644 --- a/addons/utilities/script_component.hpp +++ b/addons/utilities/script_component.hpp @@ -5,11 +5,8 @@ //#define DEBUG_MODE_FULL //#define DISABLE_COMPILE_CACHE -#ifdef DEBUG_ENABLED_UTILITIES - #define DEBUG_MODE_FULL -#endif - #ifdef DEBUG_SETTINGS_UTILITIES - #define DEBUG_SETTINGS DEBUG_SETTINGS_UTILITIES +#ifdef DEBUG_ENABLED_MAIN + #define DEBUG_MODE_FULL #endif #include "\x\tunuti\addons\main\script_macros.hpp" diff --git a/mod.cpp b/mod.cpp index 87099d8..3815947 100644 --- a/mod.cpp +++ b/mod.cpp @@ -3,25 +3,25 @@ name = "Tun Utilities v0.0.0"; author = "Tuntematon"; -picture = "data\afilogo.paa"; // Picture displayed from the expansions menu. Optimal size is 2048x1024 -hideName = "false"; // Hide the extension name -hidePicture = "false"; // Hide the extension menu +picture = "data\afilogo.paa"; // Picture displayed from the expansions menu. Optimal size is 2048x1024 +hideName = "false"; // Hide the extension name +hidePicture = "false"; // Hide the extension menu -logoSmall = "data\afilogo.paa"; // Display next to the item added by the mod 64x64 -logo = "data\afilogo.paa"; // Logo displayed in the main menu 128x128 -logoOver = "data\afilogo.paa"; // When the mouse is over, in the main menu 128x128 -tooltip = "Mission making tools"; -tooltipOwned = "Mission making tools"; // Tool tip displayed when the mouse is left over, in the main menu -overview = "Tun Utilities v0.0.0"; // Overview text, displayed from the extension menu -description = "It's unclear where this will show"; // Probably in context with action -action = "https://github.com/Tuntematonjr/Tun-Utilities"; // Website URL, that can accessed from the expansions menu -actionName = "Github"; // label of button/tooltip in extension menu +logoSmall = "data\afilogo.paa"; // Display next to the item added by the mod 64x64 +logo = "data\afilogo.paa"; // Logo displayed in the main menu 128x128 +logoOver = "data\afilogo.paa"; // When the mouse is over, in the main menu 128x128 +tooltip = "Mission making tools"; +tooltipOwned = "Mission making tools"; // Tool tip displayed when the mouse is left over, in the main menu +overview = "Tun Utilities v0.0.0"; // Overview text, displayed from the extension menu +description = "It's unclear where this will show"; // Probably in context with action +action = "https://github.com/Tuntematonjr/Tun-Utilities"; // Website URL, that can accessed from the expansions menu +actionName = "Github"; // label of button/tooltip in extension menu // Color used for DLC stripes and backgrounds (RGBA) dlcColor[] = { - 1, - 0.0, - 0.86, - 1 + 1, + 0.0, + 0.86, + 1 };