private void RefreshHUD(PlayerMana playerMp) { long mana = playerMp.Mana; long maxMana = playerMp.MaxMana; if (maxMana == 0) { mana = 1; maxMana = 1; } try { this.Invoke((MethodInvoker)delegate { RefreshHUD(mana, maxMana); }); } catch { } }
private void UpdateMana(PlayerMana playerMana) { mana = (float)playerMana.Mana / playerMana.MaxMana; this.Invalidate(); }
private void RefreshMana(PlayerMana playerMp) { manaPercentage = (float)playerMp.Mana / playerMp.MaxMana; try { this.Invoke((MethodInvoker)delegate { RefreshHUD(); }); } catch { } }
private static void UpdateMana() { bool attributesChanged = ReadMana(); attributesChanged |= ReadMaxMana(); if (attributesChanged && ManaChanged != null) { var playerMana = new PlayerMana { Mana = mana, MaxMana = maxMana }; ManaChanged(null, playerMana); } }