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