Exemplo n.º 1
0
 private void Step_SmartKeys()
 {
     ChromaHotkeyPainter.PaintKey smartCursorKey = this._smartCursorKey;
     ChromaHotkeyPainter.PaintKey smartSelectKey = this._smartSelectKey;
     if (this._player.DeadOrGhost || this._player.frozen || (this._player.tongued || this._player.webbed) || (this._player.stoned || this._player.noItems))
     {
         smartCursorKey.SetClear();
         smartSelectKey.SetClear();
     }
     else
     {
         if (Main.SmartCursorEnabled)
         {
             smartCursorKey.SetSolid(ChromaHotkeyPainter.PainterColors.SmartCursor);
         }
         else
         {
             smartCursorKey.SetClear();
         }
         if (this._player.nonTorch >= 0)
         {
             smartSelectKey.SetSolid(ChromaHotkeyPainter.PainterColors.SmartSelect);
         }
         else
         {
             smartSelectKey.SetClear();
         }
     }
 }
Exemplo n.º 2
0
 private void Step_QuickMana()
 {
     ChromaHotkeyPainter.PaintKey manaKey = this._manaKey;
     if (this._player.QuickMana_GetItemToUse() == null || this._player.DeadOrGhost || this._player.statMana == this._player.statManaMax2)
     {
         manaKey.SetClear();
     }
     else
     {
         manaKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickMana);
     }
 }
Exemplo n.º 3
0
 private void Step_Jump()
 {
     ChromaHotkeyPainter.PaintKey jumpKey = this._jumpKey;
     if (this._player.DeadOrGhost)
     {
         jumpKey.SetClear();
     }
     else if (this._player.frozen || this._player.tongued || (this._player.webbed || this._player.stoned))
     {
         jumpKey.SetSolid(ChromaHotkeyPainter.PainterColors.DangerKeyBlocked);
     }
     else
     {
         jumpKey.SetSolid(ChromaHotkeyPainter.PainterColors.MovementKeys);
     }
 }
Exemplo n.º 4
0
 private void Step_Grapple()
 {
     ChromaHotkeyPainter.PaintKey grappleKey = this._grappleKey;
     if (this._player.QuickGrapple_GetItemToUse() == null || this._player.DeadOrGhost)
     {
         grappleKey.SetClear();
     }
     else if (this._player.frozen || this._player.tongued || (this._player.webbed || this._player.stoned) || this._player.noItems)
     {
         grappleKey.SetSolid(ChromaHotkeyPainter.PainterColors.DangerKeyBlocked);
     }
     else
     {
         grappleKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickGrapple);
     }
 }
Exemplo n.º 5
0
        private void Step_Throw()
        {
            ChromaHotkeyPainter.PaintKey throwKey = this._throwKey;
            Item heldItem = this._player.HeldItem;

            if (this._player.DeadOrGhost || this._player.HeldItem.favorited || this._player.noThrow > 0)
            {
                throwKey.SetClear();
            }
            else if (this._player.frozen || this._player.tongued || (this._player.webbed || this._player.stoned) || this._player.noItems)
            {
                throwKey.SetClear();
            }
            else
            {
                throwKey.SetSolid(ChromaHotkeyPainter.PainterColors.Throw);
            }
        }
Exemplo n.º 6
0
 private void Step_QuickHeal()
 {
     ChromaHotkeyPainter.PaintKey healKey = this._healKey;
     if (this._player.QuickHeal_GetItemToUse() == null || this._player.DeadOrGhost)
     {
         healKey.SetClear();
         this._quickHealAlert = 0;
     }
     else if (this._player.potionDelay > 0)
     {
         float lerpValue = Utils.GetLerpValue((float)this._player.potionDelayTime, 0.0f, (float)this._player.potionDelay, true);
         Color color     = Color.Lerp(ChromaHotkeyPainter.PainterColors.DangerKeyBlocked, ChromaHotkeyPainter.PainterColors.QuickHealCooldown, lerpValue) * lerpValue * lerpValue * lerpValue;
         healKey.SetSolid(color);
         this._quickHealAlert = 0;
     }
     else if (this._player.statLife == this._player.statLifeMax2)
     {
         healKey.SetClear();
         this._quickHealAlert = 0;
     }
     else if ((double)this._player.statLife <= (double)this._player.statLifeMax2 / 4.0)
     {
         if (this._quickHealAlert == 1)
         {
             return;
         }
         this._quickHealAlert = 1;
         healKey.SetAlert(Color.Black, ChromaHotkeyPainter.PainterColors.QuickHealReadyUrgent, -1f, 2f);
     }
     else if ((double)this._player.statLife <= (double)this._player.statLifeMax2 / 2.0)
     {
         if (this._quickHealAlert == 2)
         {
             return;
         }
         this._quickHealAlert = 2;
         healKey.SetAlert(Color.Black, ChromaHotkeyPainter.PainterColors.QuickHealReadyUrgent, -1f, 2f);
     }
     else
     {
         healKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickHealReady);
         this._quickHealAlert = 0;
     }
 }
Exemplo n.º 7
0
 private void Step_Mount()
 {
     ChromaHotkeyPainter.PaintKey mountKey = this._mountKey;
     if (this._player.QuickMount_GetItemToUse() == null || this._player.DeadOrGhost)
     {
         mountKey.SetClear();
     }
     else if (this._player.frozen || this._player.tongued || (this._player.webbed || this._player.stoned) || ((double)this._player.gravDir == -1.0 || this._player.noItems))
     {
         mountKey.SetSolid(ChromaHotkeyPainter.PainterColors.DangerKeyBlocked);
         if ((double)this._player.gravDir != -1.0)
         {
             return;
         }
         mountKey.SetSolid(ChromaHotkeyPainter.PainterColors.DangerKeyBlocked * 0.6f);
     }
     else
     {
         mountKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickMount);
     }
 }
Exemplo n.º 8
0
 public void CollectBoundKeys()
 {
     foreach (KeyValuePair <string, ChromaHotkeyPainter.PaintKey> key in this._keys)
     {
         key.Value.Unbind();
     }
     this._keys.Clear();
     foreach (KeyValuePair <string, List <string> > keyStatu in PlayerInput.CurrentProfile.InputModes[InputMode.Keyboard].KeyStatus)
     {
         this._keys.Add(keyStatu.Key, new ChromaHotkeyPainter.PaintKey(keyStatu.Key, keyStatu.Value));
     }
     foreach (KeyValuePair <string, ChromaHotkeyPainter.PaintKey> key in this._keys)
     {
         key.Value.Bind();
     }
     this._wasdKeys = new List <ChromaHotkeyPainter.PaintKey>()
     {
         this._keys["Up"],
         this._keys["Down"],
         this._keys["Left"],
         this._keys["Right"]
     };
     this._healKey        = this._keys["QuickHeal"];
     this._mountKey       = this._keys["QuickMount"];
     this._jumpKey        = this._keys["Jump"];
     this._grappleKey     = this._keys["Grapple"];
     this._throwKey       = this._keys["Throw"];
     this._manaKey        = this._keys["QuickMana"];
     this._buffKey        = this._keys["QuickBuff"];
     this._smartCursorKey = this._keys["SmartCursor"];
     this._smartSelectKey = this._keys["SmartSelect"];
     this._reactiveKeys.Clear();
     this._xnaKeysInUse.Clear();
     foreach (KeyValuePair <string, ChromaHotkeyPainter.PaintKey> key in this._keys)
     {
         this._xnaKeysInUse.AddRange((IEnumerable <Keys>)key.Value.GetXNAKeysInUse());
     }
     this._xnaKeysInUse = this._xnaKeysInUse.Distinct <Keys>().ToList <Keys>();
 }