Exemplo n.º 1
0
        /**
         * Mouse utilities
         */
        public UIMouseEventRef ListenForMouse(Rectangle region, UIMouseEvent callback)
        {
            var newRegion = new UIMouseEventRef()
            {
                Callback = callback,
                Region = region,
                Element = this
            };
            if (m_MouseRefs == null)
            {
                m_MouseRefs = new List<UIMouseEventRef>();
            }
            m_MouseRefs.Add(newRegion);

            return newRegion;
        }
Exemplo n.º 2
0
 private void IgnoreClick(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(10);
     Main.menuMode = _gotoMenu;
 }
Exemplo n.º 3
0
 private void DeleteMouseOver(UIMouseEvent evt, UIElement listeningElement)
 {
     this._deleteButtonLabel.SetText(Language.GetTextValue("UI.Delete"));
 }
 public override void MouseOver(UIMouseEvent evt)
 {
     base.MouseOver(evt);
     BackgroundColor = new Color(46, 60, 119);
     BorderColor     = new Color(20, 30, 56);
 }
Exemplo n.º 5
0
 private void CloseButton_OnClick(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(SoundID.MenuClose);
     ModContent.GetInstance <SpiritMod>().SlotUserInterface.SetState(null);
 }
Exemplo n.º 6
0
 public override void MouseOver(UIMouseEvent evt)
 {
     Main.PlaySound(12, -1, -1, 1, 1f, 0f);
     this.Color = Drawing.DefaultBoxColor * 1.2f;
     base.MouseOver(evt);
 }
Exemplo n.º 7
0
 private void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement)
 {
     SoundEngine.PlaySound(12);
     ((UIPanel)evt.Target).BackgroundColor = new Color(73, 94, 171);
     ((UIPanel)evt.Target).BorderColor     = Colors.FancyUIFatButtonMouseOver;
 }
Exemplo n.º 8
0
 public override void MouseUp(UIMouseEvent evt)
 {
     base.MouseUp(evt);
     this._isDragging = false;
 }
Exemplo n.º 9
0
 private void CloseButtonClicked(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(SoundID.MenuClose);
     visible = false;
 }
Exemplo n.º 10
0
 private void _playButton_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
 {
     UpdatePlayButton();
 }
Exemplo n.º 11
0
 protected override void OnClose(UIMouseEvent evt, UIElement listeningElement)
 {
     MusicBox.Instance.CanShowMusicPlayUI = false;
 }
Exemplo n.º 12
0
 private void _forwardButton_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
 {
     _forwardButton.Texture = MusicBox.ModTexturesTable["ForwardButtonN"];
 }
Exemplo n.º 13
0
 private void _forwardButton_OnClick(UIMouseEvent evt, UIElement listeningElement)
 {
     musicPlayer.SwitchNextSong();
     UpdatePlayButton();
 }
Exemplo n.º 14
0
 private void _playSlider_OnMouseOver(UIMouseEvent evt, UIElement listeningElement)
 {
     _playSlider.Texture = MusicBox.ModTexturesTable["PlaySlider"];
 }
Exemplo n.º 15
0
 private void _volumeSlider_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
 {
     _volumeSlider.Texture = MusicBox.ModTexturesTable["PlaySliderN"];
 }
Exemplo n.º 16
0
 //TODO unused
 private void VisitRegisterWebpage(UIMouseEvent evt, UIElement listeningElement)
 {
     SoundEngine.PlaySound(10);
     Process.Start(REGISTER_URL);
 }
Exemplo n.º 17
0
 public override void Click(UIMouseEvent evt)
 {
     Focus();
     base.Click(evt);
 }
Exemplo n.º 18
0
 private void BackClick(UIMouseEvent evt, UIElement listeningElement)
 {
     SoundEngine.PlaySound(11);
     Main.menuMode = _backMenu;
 }
Exemplo n.º 19
0
 public override void MouseOut(UIMouseEvent evt)
 {
     this.Color = Drawing.DefaultBoxColor * 0.7f;
     base.MouseOut(evt);
 }
Exemplo n.º 20
0
 private void ButtonMouseOut(UIMouseEvent evt, UIElement listeningElement)
 {
     _buttonLabel.SetText("");
 }
Exemplo n.º 21
0
 private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement)
 {
     ((UIPanel)evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.7f;
     ((UIPanel)evt.Target).BorderColor     = Color.Black;
 }
Exemplo n.º 22
0
 private void OnButtonClick(UIMouseEvent evt, UIElement listeningEvent)
 {
     // TODO: check which was clicked
     text.SetText("I was clicked!");
 }
 public override void MouseOut(UIMouseEvent evt)
 {
     base.MouseOut(evt);
     BackgroundColor = new Color(26, 40, 89) * 0.8f;
     BorderColor     = new Color(13, 20, 44) * 0.8f;
 }
Exemplo n.º 24
0
 void OnCloseButtonClicked(UIMouseEvent evt, UIElement listeningElement)
 {
     HideUI();
 }
Exemplo n.º 25
0
 private void OpenURL(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(10);
     Process.Start(_url);
 }
 public override void MouseDown(UIMouseEvent evt)
 {
     base.MouseDown(evt);
     DragStart(evt);
 }
Exemplo n.º 27
0
 private void PlayMouseOver(UIMouseEvent evt, UIElement listeningElement)
 {
     this._buttonLabel.SetText(Language.GetTextValue("UI.Play"));
 }
 public override void MouseUp(UIMouseEvent evt)
 {
     base.MouseUp(evt);
     DragEnd(evt);
 }
Exemplo n.º 29
0
 private void DeleteMouseOut(UIMouseEvent evt, UIElement listeningElement)
 {
     this._deleteButtonLabel.SetText("");
 }
 private void DragStart(UIMouseEvent evt)
 {
     Offset   = new Vector2(evt.MousePosition.X - Left.Pixels, evt.MousePosition.Y - Top.Pixels);
     Dragging = true;
 }
Exemplo n.º 31
0
 /// <summary>
 /// Listen for mouse events on the whole image
 /// </summary>
 /// <param name="callback"></param>
 public void ListenForMouse(UIMouseEvent callback)
 {
     m_MouseEvent = ListenForMouse(new Rectangle(0, 0, (int)Width, (int)Height), callback);
 }
Exemplo n.º 32
0
 public override void MouseOver(UIMouseEvent _) => Main.PlaySound(12);