private string GetVarData(InfoBarVars var) { switch (var) { case InfoBarVars.HP: return($"{World.Player.Hits}/{World.Player.HitsMax}"); case InfoBarVars.Mana: return($"{World.Player.Mana}/{World.Player.ManaMax}"); case InfoBarVars.Stamina: return($"{World.Player.Stamina}/{World.Player.StaminaMax}"); case InfoBarVars.Weight: return($"{World.Player.Weight}/{World.Player.WeightMax}"); case InfoBarVars.Followers: return($"{World.Player.Followers}/{World.Player.FollowersMax}"); case InfoBarVars.Gold: return(World.Player.Gold.ToString()); case InfoBarVars.Damage: return($"{World.Player.DamageMin}-{World.Player.DamageMax}"); case InfoBarVars.Armor: return(World.Player.PhysicalResistance.ToString()); case InfoBarVars.Luck: return(World.Player.Luck.ToString()); case InfoBarVars.FireResist: return(World.Player.FireResistance.ToString()); case InfoBarVars.ColdResist: return(World.Player.ColdResistance.ToString()); case InfoBarVars.PoisonResist: return(World.Player.PoisonResistance.ToString()); case InfoBarVars.EnergyResist: return(World.Player.EnergyResistance.ToString()); case InfoBarVars.LowerReagentCost: return(World.Player.LowerReagentCost.ToString()); case InfoBarVars.SpellDamageInc: return(World.Player.SpellDamageIncrease.ToString()); case InfoBarVars.FasterCasting: return(World.Player.FasterCasting.ToString()); case InfoBarVars.FasterCastRecovery: return(World.Player.FasterCastRecovery.ToString()); case InfoBarVars.HitChanceInc: return(World.Player.HitChanceIncrease.ToString()); case InfoBarVars.DefenseChanceInc: return(World.Player.DefenseChanceIncrease.ToString()); case InfoBarVars.LowerManaCost: return(World.Player.LowerManaCost.ToString()); case InfoBarVars.DamageChanceInc: return(World.Player.DamageIncrease.ToString()); case InfoBarVars.SwingSpeedInc: return(World.Player.SwingSpeedIncrease.ToString()); case InfoBarVars.StatsCap: return(World.Player.StatsCap.ToString()); case InfoBarVars.NameNotoriety: return(World.Player.Name); case InfoBarVars.TithingPoints: return(World.Player.TithingPoints.ToString()); default: return(""); } }
public InfoBarControl(string label, InfoBarVars var, ushort hue) { AcceptMouseInput = false; WantUpdateSize = true; CanMove = false; _label = new Label(label, true, 999) { Height = 20, Hue = hue }; _var = var; _data = new Label("", true, 999) { Height = 20, X = _label.Width, Hue = 0x0481 }; Add(_label); Add(_data); }
public InfoBarItem(string label, InfoBarVars var, ushort labelColor) { this.label = label; this.var = var; hue = labelColor; }
private ushort GetVarHue(InfoBarVars var) { float percent; switch (var) { case InfoBarVars.HP: percent = World.Player.Hits / (float)World.Player.HitsMax; if (percent <= 0.25) { return(0x0021); } else if (percent <= 0.5) { return(0x0030); } else if (percent <= 0.75) { return(0x0035); } else { return(0x0481); } case InfoBarVars.Mana: percent = World.Player.Mana / (float)World.Player.ManaMax; if (percent <= 0.25) { return(0x0021); } else if (percent <= 0.5) { return(0x0030); } else if (percent <= 0.75) { return(0x0035); } else { return(0x0481); } case InfoBarVars.Stamina: percent = World.Player.Stamina / (float)World.Player.StaminaMax; if (percent <= 0.25) { return(0x0021); } else if (percent <= 0.5) { return(0x0030); } else if (percent <= 0.75) { return(0x0035); } else { return(0x0481); } case InfoBarVars.Weight: percent = World.Player.Weight / (float)World.Player.WeightMax; if (percent >= 1) { return(0x0021); } else if (percent >= 0.75) { return(0x0030); } else if (percent >= 0.5) { return(0x0035); } else { return(0x0481); } case InfoBarVars.NameNotoriety: return(Notoriety.GetHue(World.Player.NotorietyFlag)); default: return(0x0481); } }
public InfoBarItem(string _label, InfoBarVars _var, Hue _labelColor) { label = _label; var = _var; hue = _labelColor; }