public override void set_text_color(bool useable) { change_text_color(useable ? "White" : "Grey"); string color = useable ? "Blue" : "Grey"; Uses.SetColor(Global.Content, color); Slash.SetColor(Global.Content, color); Use_Max.SetColor(Global.Content, color); }
protected virtual void set_text_color(bool useable, bool buyable) { change_text_color(useable ? "White" : "Grey"); Uses.SetColor(Global.Content, useable ? "Blue" : "Grey"); Slash.SetColor(Global.Content, buyable ? "Blue" : "Grey"); Use_Max.SetColor(Global.Content, buyable ? "Blue" : "Grey"); Convoy.SetColor(Global.Content, "Blue"); }
public void set_image(Game_Actor actor, Item_Data item_data, int active_item) { base.set_image(actor, item_data); if (!item_data.non_equipment) { Data_Equipment item = item_data.to_equipment; bool useable = false; if (active_item >= 0) { var usedItem = actor.items[active_item].to_item; bool canTarget = usedItem.can_target_item(item_data); useable = canTarget; if (usedItem.can_repair) { if (canTarget) { Arrow = new Weapon_Triangle_Arrow(); Arrow.value = WeaponTriangle.Advantage; int repairUses = item_data.RepairAmount(usedItem); int uses = item_data.UsesAfterRepair(false, repairUses); string color = uses == item_data.max_uses ? "Green" : "Blue"; Uses.SetColor(Global.Content, color); RepairUses = new TextSprite( Config.UI_FONT, Global.Content, color, Vector2.Zero, uses < 0 ? "--" : uses.ToString()); Slash.loc += new Vector2(24, 0); Use_Max.loc += new Vector2(24, 0); } } } set_text_color(useable); } }