public void SetInformation(UIObj hovered) { if (hovered is VendorButton) { Spell viewedSpell = ((VendorButton)hovered).spell; spellName.SetText(viewedSpell.GetName()); description.SetText(viewedSpell.GetLongDescription()); infoPane.OpenTab(1); } }
public void ViewSpellTab(int pawnId) { for (int j = 0; j < viewPawnImages.Length; j++) { if (viewPawnImages[j] != null) { viewPawnImages[j].isVisible = j == pawnId; } } spellPane.OpenTab(pawnId); infoPane.OpenTab(0); PlayerPawn pawn = battle.allies[pawnId] as PlayerPawn; playerName.SetText(pawn.GetName()); string affText = ""; FastString perc = new FastString(3); double affTotal = pawn.GetAffinityTotal(); for (int i = 0; i < 6; i++) { perc.Clear(); double aff = pawn.GetAffinity(i); perc.Append((int)(aff / affTotal * 100), 2, FastString.FILL_SPACES); affText += "\n" /*+ Element.All[i].GetColorHex()*/ + pawn.GetAffinity(i) + " (" + perc + "%)"; } affinities.SetText(affText); foreach (Text text in currentItemTexts) { RemoveUIObj(text); } string[] eq = pawn.GetEquipment(); int currentY = size.height - 58; for (int i = 0; i < eq.Length; i++) { Equipment e = Equipments.Get(eq[i]); Text text = new Text(new Vector2i(5, currentY), new Vector2i(), RB.ALIGN_H_CENTER | RB.ALIGN_V_CENTER, e.GetName()); text.FitSizeToText(1); text.SetTooltip(e.GetDescription()); currentY += text.size.height + 2; AddUIObj(text); currentItemTexts.Add(text); bottomPane.AddToTab(1, text); } UpdateContext(); }