示例#1
0
        private void Step_SmartKeys()
        {
            PaintKey smartCursorKey = _smartCursorKey;
            PaintKey smartSelectKey = _smartSelectKey;

            if (_player.DeadOrGhost || _player.frozen || _player.tongued || _player.webbed || _player.stoned || _player.noItems)
            {
                smartCursorKey.SetClear();
                smartSelectKey.SetClear();
                return;
            }
            if (Main.SmartCursorEnabled)
            {
                smartCursorKey.SetSolid(PainterColors.SmartCursor);
            }
            else
            {
                smartCursorKey.SetClear();
            }
            if (_player.nonTorch >= 0)
            {
                smartSelectKey.SetSolid(PainterColors.SmartSelect);
            }
            else
            {
                smartSelectKey.SetClear();
            }
        }
示例#2
0
        private void Step_QuickMana()
        {
            PaintKey manaKey = _manaKey;

            if (_player.QuickMana_GetItemToUse() == null || _player.DeadOrGhost || _player.statMana == _player.statManaMax2)
            {
                manaKey.SetClear();
            }
            else
            {
                manaKey.SetSolid(PainterColors.QuickMana);
            }
        }
示例#3
0
        private void Step_Jump()
        {
            PaintKey jumpKey = _jumpKey;

            if (_player.DeadOrGhost)
            {
                jumpKey.SetClear();
            }
            else if (_player.frozen || _player.tongued || _player.webbed || _player.stoned)
            {
                jumpKey.SetSolid(PainterColors.DangerKeyBlocked);
            }
            else
            {
                jumpKey.SetSolid(PainterColors.MovementKeys);
            }
        }
示例#4
0
        private void Step_Grapple()
        {
            PaintKey grappleKey = _grappleKey;

            if (_player.QuickGrapple_GetItemToUse() == null || _player.DeadOrGhost)
            {
                grappleKey.SetClear();
            }
            else if (_player.frozen || _player.tongued || _player.webbed || _player.stoned || _player.noItems)
            {
                grappleKey.SetSolid(PainterColors.DangerKeyBlocked);
            }
            else
            {
                grappleKey.SetSolid(PainterColors.QuickGrapple);
            }
        }
示例#5
0
        private void Step_Throw()
        {
            PaintKey throwKey = _throwKey;

            _ = _player.HeldItem;
            if (_player.DeadOrGhost || _player.HeldItem.favorited || _player.noThrow > 0)
            {
                throwKey.SetClear();
            }
            else if (_player.frozen || _player.tongued || _player.webbed || _player.stoned || _player.noItems)
            {
                throwKey.SetClear();
            }
            else
            {
                throwKey.SetSolid(PainterColors.Throw);
            }
        }
示例#6
0
        private void Step_QuickHeal()
        {
            PaintKey healKey = _healKey;

            if (_player.QuickHeal_GetItemToUse() == null || _player.DeadOrGhost)
            {
                healKey.SetClear();
                _quickHealAlert = 0;
            }
            else if (_player.potionDelay > 0)
            {
                float lerpValue = Utils.GetLerpValue(_player.potionDelayTime, 0f, _player.potionDelay, clamped: true);
                Color solid     = Color.Lerp(PainterColors.DangerKeyBlocked, PainterColors.QuickHealCooldown, lerpValue) * lerpValue * lerpValue * lerpValue;
                healKey.SetSolid(solid);
                _quickHealAlert = 0;
            }
            else if (_player.statLife == _player.statLifeMax2)
            {
                healKey.SetClear();
                _quickHealAlert = 0;
            }
            else if ((float)_player.statLife <= (float)_player.statLifeMax2 / 4f)
            {
                if (_quickHealAlert != 1)
                {
                    _quickHealAlert = 1;
                    healKey.SetAlert(Color.Black, PainterColors.QuickHealReadyUrgent, -1f, 2f);
                }
            }
            else if ((float)_player.statLife <= (float)_player.statLifeMax2 / 2f)
            {
                if (_quickHealAlert != 2)
                {
                    _quickHealAlert = 2;
                    healKey.SetAlert(Color.Black, PainterColors.QuickHealReadyUrgent, -1f, 2f);
                }
            }
            else
            {
                healKey.SetSolid(PainterColors.QuickHealReady);
                _quickHealAlert = 0;
            }
        }
示例#7
0
        private void Step_Mount()
        {
            PaintKey mountKey = _mountKey;

            if (_player.QuickMount_GetItemToUse() == null || _player.DeadOrGhost)
            {
                mountKey.SetClear();
            }
            else if (_player.frozen || _player.tongued || _player.webbed || _player.stoned || _player.gravDir == -1f || _player.noItems)
            {
                mountKey.SetSolid(PainterColors.DangerKeyBlocked);
                if (_player.gravDir == -1f)
                {
                    mountKey.SetSolid(PainterColors.DangerKeyBlocked * 0.6f);
                }
            }
            else
            {
                mountKey.SetSolid(PainterColors.QuickMount);
            }
        }
示例#8
0
 public void CollectBoundKeys()
 {
     foreach (KeyValuePair <string, PaintKey> key in _keys)
     {
         key.Value.Unbind();
     }
     _keys.Clear();
     foreach (KeyValuePair <string, List <string> > item in PlayerInput.CurrentProfile.InputModes[InputMode.Keyboard].KeyStatus)
     {
         _keys.Add(item.Key, new PaintKey(item.Key, item.Value));
     }
     foreach (KeyValuePair <string, PaintKey> key2 in _keys)
     {
         key2.Value.Bind();
     }
     _wasdKeys = new List <PaintKey>
     {
         _keys["Up"],
         _keys["Down"],
         _keys["Left"],
         _keys["Right"]
     };
     _healKey        = _keys["QuickHeal"];
     _mountKey       = _keys["QuickMount"];
     _jumpKey        = _keys["Jump"];
     _grappleKey     = _keys["Grapple"];
     _throwKey       = _keys["Throw"];
     _manaKey        = _keys["QuickMana"];
     _buffKey        = _keys["QuickBuff"];
     _smartCursorKey = _keys["SmartCursor"];
     _smartSelectKey = _keys["SmartSelect"];
     _reactiveKeys.Clear();
     _xnaKeysInUse.Clear();
     foreach (KeyValuePair <string, PaintKey> key3 in _keys)
     {
         _xnaKeysInUse.AddRange(key3.Value.GetXNAKeysInUse());
     }
     _xnaKeysInUse = _xnaKeysInUse.Distinct().ToList();
 }