Set Default Channel at mission start

This commit is contained in:
PabstMirror 2015-09-29 11:36:30 -05:00
parent 6e24d2868c
commit c0b78ecf3a
5 changed files with 59 additions and 1 deletions

View File

@ -2,33 +2,55 @@ class ACE_Settings {
class GVAR(BFT_Interval) { class GVAR(BFT_Interval) {
value = 1.0; value = 1.0;
typeName = "SCALAR"; typeName = "SCALAR";
displayName = CSTRING(BFT_Interval_DisplayName);
description = CSTRING(BFT_Interval_Description);
}; };
class GVAR(BFT_Enabled) { class GVAR(BFT_Enabled) {
value = 0; value = 0;
typeName = "BOOL"; typeName = "BOOL";
displayName = CSTRING(BFT_Enabled_DisplayName);
description = CSTRING(BFT_Enabled_Description);
}; };
class GVAR(BFT_HideAiGroups) { class GVAR(BFT_HideAiGroups) {
value = 0; value = 0;
typeName = "BOOL"; typeName = "BOOL";
displayName = CSTRING(BFT_HideAiGroups_DisplayName);
description = CSTRING(BFT_HideAiGroups_Description);
}; };
class GVAR(mapIllumination) { class GVAR(mapIllumination) {
value = 1; value = 1;
typeName = "BOOL"; typeName = "BOOL";
displayName = CSTRING(MapIllumination_DisplayName);
description = CSTRING(MapIllumination_Description);
}; };
class GVAR(mapGlow) { class GVAR(mapGlow) {
value = 1; value = 1;
typeName = "BOOL"; typeName = "BOOL";
displayName = CSTRING(MapGlow_DisplayName);
description = CSTRING(MapGlow_Description);
}; };
class GVAR(mapShake) { class GVAR(mapShake) {
value = 1; value = 1;
typeName = "BOOL"; typeName = "BOOL";
displayName = CSTRING(MapShake_DisplayName);
description = CSTRING(MapShake_Description);
}; };
class GVAR(mapLimitZoom) { class GVAR(mapLimitZoom) {
value = 0; value = 0;
typeName = "BOOL"; typeName = "BOOL";
displayName = CSTRING(MapLimitZoom_DisplayName);
description = CSTRING(MapLimitZoom_Description);
}; };
class GVAR(mapShowCursorCoordinates) { class GVAR(mapShowCursorCoordinates) {
value = 0; value = 0;
typeName = "BOOL"; 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);
}; };
}; };

View File

@ -55,6 +55,20 @@ class CfgVehicles {
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 0; 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 { class ModuleDescription {
description = CSTRING(Module_Description); description = CSTRING(Module_Description);

View File

@ -56,6 +56,21 @@ call FUNC(determineZoom);
}, 0] call CBA_fnc_addPerFrameHandler; }, 0] call CBA_fnc_addPerFrameHandler;
["SettingsInitialized", { ["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 // Start Blue Force Tracking if Enabled
if (GVAR(BFT_Enabled)) then { if (GVAR(BFT_Enabled)) then {
GVAR(BFT_markers) = []; GVAR(BFT_markers) = [];

View File

@ -13,7 +13,7 @@
if !(isServer) exitWith {}; if !(isServer) exitWith {};
params ["_logic", "_units", "_activated"]; params ["_logic", "", "_activated"];
if !(_activated) exitWith {}; if !(_activated) exitWith {};
@ -22,5 +22,6 @@ if !(_activated) exitWith {};
[_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(mapShowCursorCoordinates), "MapShowCursorCoordinates"] 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."); ACE_LOGINFO("Map Module Initialized.");

View File

@ -256,5 +256,11 @@
<Czech>Snížit jas</Czech> <Czech>Snížit jas</Czech>
<Spanish>Reducir brillo</Spanish> <Spanish>Reducir brillo</Spanish>
</Key> </Key>
<Key ID="STR_ACE_Map_DefaultChannel_DisplayName">
<English>Set Channel At Start</English>
</Key>
<Key ID="STR_ACE_Map_DefaultChannel_Description">
<English>Change the starting marker channel at mission start</English>
</Key>
</Package> </Package>
</Project> </Project>