Esempio n. 1
0
        Button AddTipButton(Rect rect, string tipID, BaseScreenComponent.OnMouseClickHandler handler, DaggerfallShortcut.Buttons button)
        {
            Button tipButton = DaggerfallUI.AddButton(rect, NativePanel);

            tipButton.OnMouseEnter += TipButton_OnMouseEnter;
            tipButton.OnMouseLeave += TipButton_OnMouseLeave;
            tipButton.OnMouseClick += handler;
            tipButton.Hotkey        = DaggerfallShortcut.GetBinding(button);
            tipButton.Tag           = tipID;

            return(tipButton);
        }
Esempio n. 2
0
        private Button AddButton(Panel panel, string label, BaseScreenComponent.OnMouseClickHandler onMouseClickHandler)
        {
            Button button = DaggerfallUI.AddButton(new Vector2(panel.Size.x / 2, y), new Vector2(30, 8), panel);

            button.Label.Text      = label;
            button.OnMouseClick   += onMouseClickHandler;
            button.Outline.Enabled = true;
            button.BackgroundColor = new Color(0.0f, 0.5f, 0.0f, 0.4f);

            y += itemSpacing + 2;

            return(button);
        }
Esempio n. 3
0
 private void SetupBottomBarButton(int index, string labelKey, BaseScreenComponent.OnMouseClickHandler onMouseClickHandler, Button button = null)
 {
     if (button == null)
     {
         button = new Button();
     }
     button.Size              = new Vector2((mainPanel.Size.x - 10) / 4f, 10);
     button.Position          = new Vector2(button.Size.x * index, 0);
     button.VerticalAlignment = VerticalAlignment.Middle;
     button.Label.Text        = ModManager.GetText(labelKey);
     button.Label.Font        = DaggerfallUI.Instance.Font3;
     button.Label.ShadowColor = Color.clear;
     button.Label.TextColor   = enabledButtonsColor;
     button.OnMouseClick     += onMouseClickHandler;
     controlPanel.Components.Add(button);
 }
Esempio n. 4
0
        private static Button MakeSimpleButton(string labelKey, ToolTip toolTip, string toolTipKey, Vector2 position, BaseScreenComponent.OnMouseClickHandler onMouseClickHandler, Button button = null)
        {
            if (button == null)
            {
                button = new Button();
            }

            button.Size                = new Vector2(40, 12);
            button.Position            = position;
            button.HorizontalAlignment = HorizontalAlignment.Center;
            button.Outline.Enabled     = true;
            button.BackgroundColor     = new Color(0.0f, 0.5f, 0.0f, 0.4f);
            button.Label.Text          = ModManager.GetText(labelKey);
            if (toolTip != null)
            {
                button.Label.ToolTip     = toolTip;
                button.Label.ToolTipText = ModManager.GetText(toolTipKey);
            }
            button.OnMouseClick += onMouseClickHandler;
            return(button);
        }
Esempio n. 5
0
        private void SetupSideBarButton(int index, string labelKey, string toolTipKey, BaseScreenComponent.OnMouseClickHandler onMouseClickHandler, Button button = null)
        {
            const int buttonsCount = 5;

            sideBarPanel.Components.Add(MakeSimpleButton(labelKey, defaultToolTip, toolTipKey, new Vector2(0, sideBarPanel.Size.y / buttonsCount * index), onMouseClickHandler, button));
        }