private void SetUpButton(IQuickButton quickButton, RoundButton button, List <IButton> activeButtons) { button.SetIcon(quickButton.Icon); button.EnterCallback = () => { Global.Frames.GameTooltip.SetOwner(button.Button, BlizzardApi.WidgetEnums.TooltipAnchor.ANCHOR_TOPLEFT); Global.Frames.GameTooltip.AddLine(quickButton.Tooltip); Global.Frames.GameTooltip.Show(); }; button.LeaveCallback = () => { var tooltipOwner = this.wrapper.Unwrap(Global.Frames.GameTooltip.GetOwner()); if (tooltipOwner != null && tooltipOwner == this.wrapper.Unwrap(button.Button)) { Global.Frames.GameTooltip.Hide(); } }; button.HideCallback = () => { var tooltipOwner = this.wrapper.Unwrap(Global.Frames.GameTooltip.GetOwner()); if (tooltipOwner != null && tooltipOwner == this.wrapper.Unwrap(button.Button)) { Global.Frames.GameTooltip.Hide(); } }; button.ClickCallback = quickButton.Action; // TODO: Use execution strategy. activeButtons.Add(button.Button); }
public void RegisterDefaultButton(IQuickButton button) { this.defaultSettings.QuickButtons.Add(button); }