예제 #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;
        }
예제 #2
0
 private void IgnoreClick(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(10);
     Main.menuMode = _gotoMenu;
 }
예제 #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);
 }
예제 #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;
 }
예제 #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;
 }
예제 #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);
 }
예제 #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);
 }
예제 #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;
 }
예제 #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);