7 protected ref SCR_BackendServiceDisplayPresets m_ServicesPresets;
11 protected ref array<ref SCR_ConnectionStateButtonComponent_StatusPreset> m_aStatuses;
15 protected ref Color m_LowBandwidthColor;
18 protected bool m_bShowLowBandwidthLabel;
21 protected string m_sTooltipTag;
24 protected float m_fSpinnerSpeed;
26 [
Attribute(defvalue:
SCR_Enum.GetDefault(EAnimationCurve.EASE_IN_OUT_SINE), uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EAnimationCurve))]
27 EAnimationCurve m_eSpinnerAnimationCurve;
29 protected bool m_bIsListeningForCommCheckEvent;
31 protected ref array<string> m_aUnavailableServices = {};
32 protected SCR_ConnectionStateButtonComponent_StatusPreset m_CurrentStatusPreset;
35 protected ImageWidget m_wConnectingSpinner;
36 protected WidgetAnimationImageRotation m_SpinnerAnimation;
39 override void HandlerAttached(Widget w)
41 super.HandlerAttached(w);
50 SCR_ConnectionStateButtonComponent_StatusPreset connectingPreset = GetStatusPreset(
SCR_ECommStatus.RUNNING);
59 GetButton().m_OnClicked.Insert(OnButtonClicked);
60 GetButton().m_OnFocus.Insert(OnButtonFocused);
61 GetButton().m_OnFocusLost.Insert(OnButtonFocusLost);
68 override void HandlerDeattached(Widget w)
70 super.HandlerDeattached(w);
80 GetGame().GetCallqueue().Remove(OnAutomaticRefresh);
84 override void SetVisible(
bool visible,
bool animate =
false,
float rate =
UIConstants.FADE_RATE_FAST)
86 super.SetVisible(visible, animate, rate);
121 protected void ClearInvokers()
129 protected void OnCommStatusUpdated(
SCR_ECommStatus status,
float responseTime,
float lastSuccessTime,
float lastFailTime)
131 UpdateStatus(status);
135 protected void OnCommStatusCheckStart()
142 protected void OnAutomaticRefresh()
154 if (AreServicesUnavailable())
156 UpdateWidgets(status);
161 if (CheckLowBandwidth())
163 UpdateWidgets(status,
true);
174 UpdateWidgets(status);
185 protected bool AreServicesUnavailable()
210 protected bool CheckLowBandwidth()
218 protected void UpdateWidgets(
SCR_ECommStatus status,
bool lowBandwidth =
false)
249 protected void AnimateSpinner()
258 if (!m_wConnectingSpinner)
264 m_SpinnerAnimation = AnimateWidget.Rotation(m_wConnectingSpinner, 360, m_fSpinnerSpeed);
265 if (m_SpinnerAnimation)
274 protected bool ShowSpinner()
280 protected SCR_ConnectionStateButtonComponent_StatusPreset GetStatusPreset(
SCR_ECommStatus status)
282 foreach (SCR_ConnectionStateButtonComponent_StatusPreset preset :
m_aStatuses)
284 if (preset.m_Status == status)
292 protected void SetIconColor(Color color)
301 protected void OnButtonClicked()
307 protected void OnButtonFocused()
313 protected void OnButtonFocusLost()
319 protected void OnTooltipShow(
SCR_ScriptedWidgetTooltip tooltipClass, Widget tooltipWidget, Widget hoverWidget, SCR_ScriptedWidgetTooltipPreset preset,
string tag)
332 protected void UpdateTooltip()
346 Widget tooltipContent =
m_Tooltip.GetContentWidget();
356 else if (CheckLowBandwidth())
375 class SCR_ConnectionStateButtonComponent_StatusPreset
393 string m_sTooltipMessage;