diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index 99284c9e59..9fd402f081 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -109,10 +109,6 @@ class RscDisplayInventory { onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayInventory"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; [ARR_2('inventoryDisplayLoaded', _this)] call FUNC(localEvent);); }; -class RscDisplayChannel { - onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel)); -}; - // map class RscDisplayMainMap { onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Ingame')])] call FUNC(localEvent);); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 40fe1a0232..a88c349180 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -126,7 +126,6 @@ PREP(numberToDigits); PREP(numberToDigitsString); PREP(numberToString); PREP(onAnswerRequest); -PREP(onLoadRscDisplayChannel); PREP(owned); PREP(player); PREP(playerSide); diff --git a/addons/common/functions/fnc_currentChannel.sqf b/addons/common/functions/fnc_currentChannel.sqf index a7ca8c1dd5..127f3b7a54 100644 --- a/addons/common/functions/fnc_currentChannel.sqf +++ b/addons/common/functions/fnc_currentChannel.sqf @@ -7,11 +7,20 @@ * NONE. * * Return value: - * The current channel. Can be "group", "side", "global", "command", "vehicle" or "direct" (String) + * The current channel. Can be "group", "side", "global", "command", "vehicle", "direct" or "custom_X" (String) */ #include "script_component.hpp" -#define CHANNELS ["group", "side", "global", "command", "vehicle", "direct"] -#define CHANNELS_LOCALIZED [localize "str_channel_group", localize "str_channel_side", localize "str_channel_global", localize "str_channel_command", localize "str_channel_vehicle", localize "str_channel_direct"] +#define CHANNELS ["global", "side", "command", "group", "vehicle", "direct"] +#define CHANNELS_LOCALIZED [localize "str_channel_global", localize "str_channel_side", localize "str_channel_command", localize "str_channel_group", localize "str_channel_vehicle", localize "str_channel_direct"] -CHANNELS select (CHANNELS_LOCALIZED find (uiNamespace getVariable [QGVAR(currentChannel), ""])) max 0 +private "_currentChannel"; +_currentChannel = currentChannel; + +if (_currentChannel < count CHANNELS) then { + _currentChannel = CHANNELS select _currentChannel; +} else { + _currentChannel = format ["custom_%1", _currentChannel - count CHANNELS - 1]; +}; + +_currentChannel diff --git a/addons/common/functions/fnc_onLoadRscDisplayChannel.sqf b/addons/common/functions/fnc_onLoadRscDisplayChannel.sqf deleted file mode 100644 index ae8113c1b8..0000000000 --- a/addons/common/functions/fnc_onLoadRscDisplayChannel.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: Pabst Mirror, commy2 - * When the RscDisplayChannel is loaded, this will constantly uiNamespace variable ace_common_currentChannel - * with the raw localized text of CA_Channel (IDC=101). Only runs while the display is open. - * - * Arguments: - * 0: The RscDisplayChannel Display - * - * Return Value: - * Nothing - * - * Example: - * onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel)); - * - * Public: No - */ -#include "script_component.hpp" - -uiNamespace setVariable [QGVAR(currentChannelControl), ((_this select 0) displayCtrl 101)]; - -["ACE_currentChannel", "onEachFrame", { - if (isNull (uiNamespace getVariable [QGVAR(currentChannelControl), controlNull])) then { - ["ACE_currentChannel", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; - } else { - private "_localizedChannelText"; - _localizedChannelText = ctrlText (uiNamespace getVariable [QGVAR(currentChannelControl), controlNull]); - uiNamespace setVariable [QGVAR(currentChannel), _localizedChannelText]; - }; -}] call BIS_fnc_addStackedEventhandler;