Esempio n. 1
0
        // handles new interactions with GatheringNodes, called by BeginInteraction
        private void BeginGathering(GatheringNode node)
        {
            if (Player.GetLevel(node.Skill) < node.Level)
            {
                // does not meet level requirement
                RaiseMessage("You need a " + PlayerSkill.SKILL_NAMES[(int)node.Skill] + " level of " + node.Level + ".");
            }

            // show gathering UI
            OnUIEvent?.Invoke(this, new UIEventArgs(UIEventType.ShowGathering, node.ID));
        }
Esempio n. 2
0
        public override void Update()
        {
            if (_onScreen)
            {
                _cameraPos = Camera.Pos;
            }

            if (_fadesIn)
            {
                _fadeCount++;
            }

            _fadeCount = Clamp(_fadeCount, 0, 100);

            _buttonArea = new Rectangle()
            {
                X      = Pos.X + _cameraPos.X,
                Y      = Pos.Y + _cameraPos.Y,
                Width  = _width,
                Height = _height
            };

            if (MiddleAligned)
            {
                _buttonArea.X -= _width / 2;
                _buttonArea.Y -= _height / 2;
            }

            Rectangle _activeMouseRect = new Rectangle()
            {
                X      = Pos.X,
                Y      = Pos.Y,
                Width  = _width,
                Height = _height
            };

            if (MiddleAligned)
            {
                _activeMouseRect.X -= _width / 2;
                _activeMouseRect.Y -= _height / 2;
            }

            if (SwinGame.PointInRect(SwinGame.MousePosition(), _activeMouseRect))
            {
                if (_isMouseOver == false)
                {
                    //false-->true mousing over.
                    if (_mouseOverSoundEffect != null)
                    {
                        if (Artillery3R.Services.A3RData.EasterEggTriggered)
                        {
                            SwinGame.PlaySoundEffect("newMenuSound");
                        }
                        else
                        {
                            SwinGame.PlaySoundEffect(_mouseOverSoundEffect);
                        }
                    }
                }
                _isMouseOver = true;
            }
            else
            {
                _isMouseOver = false;
            }

            if (_isMouseOver && SwinGame.MouseClicked(MouseButton.LeftButton))
            {
                if (Artillery3R.Services.A3RData.EasterEggTriggered)
                {
                    SwinGame.PlaySoundEffect("confirmSound");
                }
                OnUIEvent?.Invoke(this, _uiEventArgs);
                _buttonEvent?.Invoke();
            }
        }
Esempio n. 3
0
 public void ShowVendor(int vendorID)
 {
     CurrentVendor = World.GetVendor(vendorID);
     OnUIEvent?.Invoke(this, new UIEventArgs(UIEventType.ShowVendor, vendorID));
 }