/**
         * 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;
        }
示例#2
0
 private void IgnoreClick(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(10);
     Main.menuMode = _gotoMenu;
 }
 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);
 }
示例#5
0
 private void CloseButton_OnClick(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(SoundID.MenuClose);
     ModContent.GetInstance <SpiritMod>().SlotUserInterface.SetState(null);
 }
示例#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);
 }
示例#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;
 }
示例#8
0
 public override void MouseUp(UIMouseEvent evt)
 {
     base.MouseUp(evt);
     this._isDragging = false;
 }
示例#9
0
 private void CloseButtonClicked(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(SoundID.MenuClose);
     visible = false;
 }
示例#10
0
 private void _playButton_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
 {
     UpdatePlayButton();
 }
示例#11
0
 protected override void OnClose(UIMouseEvent evt, UIElement listeningElement)
 {
     MusicBox.Instance.CanShowMusicPlayUI = false;
 }
示例#12
0
 private void _forwardButton_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
 {
     _forwardButton.Texture = MusicBox.ModTexturesTable["ForwardButtonN"];
 }
示例#13
0
 private void _forwardButton_OnClick(UIMouseEvent evt, UIElement listeningElement)
 {
     musicPlayer.SwitchNextSong();
     UpdatePlayButton();
 }
示例#14
0
 private void _playSlider_OnMouseOver(UIMouseEvent evt, UIElement listeningElement)
 {
     _playSlider.Texture = MusicBox.ModTexturesTable["PlaySlider"];
 }
示例#15
0
 private void _volumeSlider_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
 {
     _volumeSlider.Texture = MusicBox.ModTexturesTable["PlaySliderN"];
 }
示例#16
0
 //TODO unused
 private void VisitRegisterWebpage(UIMouseEvent evt, UIElement listeningElement)
 {
     SoundEngine.PlaySound(10);
     Process.Start(REGISTER_URL);
 }
示例#17
0
 public override void Click(UIMouseEvent evt)
 {
     Focus();
     base.Click(evt);
 }
示例#18
0
 private void BackClick(UIMouseEvent evt, UIElement listeningElement)
 {
     SoundEngine.PlaySound(11);
     Main.menuMode = _backMenu;
 }
示例#19
0
 public override void MouseOut(UIMouseEvent evt)
 {
     this.Color = Drawing.DefaultBoxColor * 0.7f;
     base.MouseOut(evt);
 }
示例#20
0
 private void ButtonMouseOut(UIMouseEvent evt, UIElement listeningElement)
 {
     _buttonLabel.SetText("");
 }
示例#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;
 }
 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;
 }
示例#24
0
 void OnCloseButtonClicked(UIMouseEvent evt, UIElement listeningElement)
 {
     HideUI();
 }
示例#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);
 }
 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);
 }
 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;
 }
示例#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);
 }
示例#32
0
 public override void MouseOver(UIMouseEvent _) => Main.PlaySound(12);