diff --git a/addons/map/ACE_Settings.hpp b/addons/map/ACE_Settings.hpp index 4e2a5d5706..c0d2718c1f 100644 --- a/addons/map/ACE_Settings.hpp +++ b/addons/map/ACE_Settings.hpp @@ -2,33 +2,55 @@ class ACE_Settings { class GVAR(BFT_Interval) { value = 1.0; typeName = "SCALAR"; + displayName = CSTRING(BFT_Interval_DisplayName); + description = CSTRING(BFT_Interval_Description); }; class GVAR(BFT_Enabled) { value = 0; typeName = "BOOL"; + displayName = CSTRING(BFT_Enabled_DisplayName); + description = CSTRING(BFT_Enabled_Description); }; class GVAR(BFT_HideAiGroups) { value = 0; typeName = "BOOL"; + displayName = CSTRING(BFT_HideAiGroups_DisplayName); + description = CSTRING(BFT_HideAiGroups_Description); }; class GVAR(mapIllumination) { value = 1; typeName = "BOOL"; + displayName = CSTRING(MapIllumination_DisplayName); + description = CSTRING(MapIllumination_Description); }; class GVAR(mapGlow) { value = 1; typeName = "BOOL"; + displayName = CSTRING(MapGlow_DisplayName); + description = CSTRING(MapGlow_Description); }; class GVAR(mapShake) { value = 1; typeName = "BOOL"; + displayName = CSTRING(MapShake_DisplayName); + description = CSTRING(MapShake_Description); }; class GVAR(mapLimitZoom) { value = 0; typeName = "BOOL"; + displayName = CSTRING(MapLimitZoom_DisplayName); + description = CSTRING(MapLimitZoom_Description); }; class GVAR(mapShowCursorCoordinates) { value = 0; typeName = "BOOL"; + displayName = CSTRING(MapShowCursorCoordinates_DisplayName); + description = CSTRING(MapShowCursorCoordinates_Description); + }; + class GVAR(DefaultChannel) { + value = -1; + typeName = "SCALAR"; + displayName = CSTRING(DefaultChannel_DisplayName); + description = CSTRING(DefaultChannel_Description); }; }; diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 560453b416..7906de8bb7 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -55,6 +55,20 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 0; }; + class DefaultChannel { + displayName = CSTRING(DefaultChannel_DisplayName); + description = CSTRING(DefaultChannel_Description); + typeName = "NUMBER"; + class values { + class disable {name = ECSTRING(common,Disabled); value = -1; default = 1;}; + class global {name = "$STR_channel_global"; value = 0;}; + class side {name = "$STR_channel_side"; value = 1;}; + class command {name = "$STR_channel_command"; value = 2;}; + class group {name = "$STR_channel_group"; value = 3;}; + class vehicle {name = "$STR_channel_vehicle"; value = 4;}; + class direct {name = "$STR_channel_direct"; value = 5;}; + }; + }; }; class ModuleDescription { description = CSTRING(Module_Description); diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 02800c2540..c162f8802d 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -56,6 +56,21 @@ call FUNC(determineZoom); }, 0] call CBA_fnc_addPerFrameHandler; ["SettingsInitialized", { + if (isMultiplayer && {GVAR(DefaultChannel) != -1}) then { + //Set the chat channel once the map has finished loading + [{ + if ((isNull findDisplay 37) && {isNull findDisplay 52} && {isNull findDisplay 53} && {isNull findDisplay 12}) exitWith {}; + [_this select 1] call CBA_fnc_removePerFrameHandler; + + setCurrentChannel GVAR(DefaultChannel); + if (currentChannel == GVAR(DefaultChannel)) then { + // ACE_LOGINFO_1("Channel Set - %1", currentChannel); + } else { + ACE_LOGERROR_2("Failed To Set Channel %1 (is %2)", GVAR(DefaultChannel), currentChannel); + }; + }, 0, []] call CBA_fnc_addPerFrameHandler; + }; + // Start Blue Force Tracking if Enabled if (GVAR(BFT_Enabled)) then { GVAR(BFT_markers) = []; diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf index b7db6996d6..605c15127e 100644 --- a/addons/map/functions/fnc_moduleMap.sqf +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -13,7 +13,7 @@ if !(isServer) exitWith {}; -params ["_logic", "_units", "_activated"]; +params ["_logic", "", "_activated"]; if !(_activated) exitWith {}; @@ -22,5 +22,6 @@ if !(_activated) exitWith {}; [_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapShowCursorCoordinates), "MapShowCursorCoordinates"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(DefaultChannel), "DefaultChannel" ] call EFUNC(common,readSettingFromModule); ACE_LOGINFO("Map Module Initialized."); diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 8f693ef37a..76055cc45a 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -256,5 +256,11 @@ Snížit jas Reducir brillo + + Set Channel At Start + + + Change the starting marker channel at mission start + \ No newline at end of file