public void Update() { MinimapFrame.Button buttonUnderMouse = this.GetButtonUnderMouse(); this._zoomInButton.IsHighlighted = buttonUnderMouse == this._zoomInButton; this._zoomOutButton.IsHighlighted = buttonUnderMouse == this._zoomOutButton; this._resetButton.IsHighlighted = buttonUnderMouse == this._resetButton; if (buttonUnderMouse == null || Main.LocalPlayer.lastMouseInterface) { return; } buttonUnderMouse.IsHighlighted = true; if (PlayerInput.IgnoreMouseInterface) { return; } Main.LocalPlayer.mouseInterface = true; if (!Main.mouseLeft) { return; } buttonUnderMouse.Click(); if (!Main.mouseLeftRelease) { return; } SoundEngine.PlaySound(12, -1, -1, 1, 1f, 0.0f); }
public void SetZoomOutButton(Asset <Texture2D> hoverTexture, Vector2 position) { this._zoomOutButton = new MinimapFrame.Button(hoverTexture, position, (Action)(() => this.ZoomOutButton())); }