Exemplo n.º 1
0
            public override void OnMouseClick(ICustomMenu.MouseStateEx mouseState)
            {
                var pos_as_point = mouseState.Pos.AsXNAPoint();

                _originalColour = _liveDummyChest.playerChoiceColor.Value = this.GetColourAt(pos_as_point.X, pos_as_point.Y);

                base.OnMouseClick(mouseState);
            }
Exemplo n.º 2
0
        // Private:
        #region Private

        // Component event handlers:
        #region Component event handlers

        private void _componentOnClick(Object sender, ICustomMenu.MouseStateEx mouseState)
        {
            switch ((sender as BaseTypes.ICustomItemGrabMenuItem.BasicComponent).Name)
            {
            case "configBTN":
                GlobalVars.SMAPIMonitor.Log("configbtn");
                break;
            }
        }
        // Component event handlers:
        #region Component event handlers

        private void _componentOnClick(Object sender, ICustomMenu.MouseStateEx mouseState)
        {
            switch ((sender as BaseTypes.ICustomItemGrabMenuItem.BasicComponent).Name)
            {
            case "openPanelBTN":
                _isShowingColourEditors.Flip();
                _colourPalette.SetVisible(_isShowingColourEditors);
                this.HostMenu.SourceInventoryOptions.SetVisible(!_isShowingColourEditors);
                break;

            case "palette":
                var pos_as_point = mouseState.Pos.AsXNAPoint();
                this.HostMenu.GetSourceAs <Chest>().playerChoiceColor.Value = _colourPalette.GetColourAt(pos_as_point.X, pos_as_point.Y);
                break;
            }
        }