Пример #1
0
        private AlertControl CreateAlertControl(AlertPrototype alert, AlertState alertState)
        {
            var alertControl = new AlertControl(alert, alertState.Severity, _resourceCache);

            // show custom tooltip for the status control
            alertControl.OnShowTooltip += AlertOnOnShowTooltip;
            alertControl.OnHideTooltip += AlertOnOnHideTooltip;

            alertControl.OnPressed += AlertControlOnPressed;

            return(alertControl);
        }
Пример #2
0
        private void AlertPressed(BaseButton.ButtonEventArgs args, AlertControl alert)
        {
            if (args.Event.Function != EngineKeyFunctions.UIClick)
            {
                return;
            }

            if (AlertManager.TryEncode(alert.Alert, out var encoded))
            {
                SendNetworkMessage(new ClickAlertMessage(encoded));
            }
            else
            {
                Logger.ErrorS("alert", "unable to encode alert {0}", alert.Alert.AlertType);
            }
        }