Beispiel #1
0
        private void AlertOnOnShowTooltip(object sender, EventArgs e)
        {
            var alertControl = (AlertControl)sender;

            _stateName.SetMessage(alertControl.Alert.Name);
            _stateDescription.SetMessage(alertControl.Alert.Description);
            // check for a cooldown
            if (alertControl.TotalDuration != null && alertControl.TotalDuration > 0)
            {
                _stateCooldown.SetMessage(FormattedMessage.FromMarkup("[color=#776a6a]" +
                                                                      alertControl.TotalDuration +
                                                                      " sec cooldown[/color]"));
                _stateCooldown.Visible = true;
            }
            else
            {
                _stateCooldown.Visible = false;
            }
            // TODO: Text display of cooldown
            Tooltips.PositionTooltip(_tooltip);
            // if we set it visible here the size of the previous tooltip will flicker for a frame,
            // so instead we wait until FrameUpdate to make it visible
            _tooltipReady = true;
        }