Beispiel #1
0
        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);
        }
Beispiel #2
0
        private void SetUpMainButton()
        {
            this.mainButton = new RoundButton(52);
            this.mainButton.SetIcon(MainIconPath);

            this.mainButton.EnterCallback          = this.ShowQuickButtons;
            this.mainButton.PositionChangeCallback = this.MoveButtonCluster;
            this.mainButton.UpdateCallback         = this.ButtonUpdate;
        }