28 this.mainText.SetText(str + this.e.Name, FontColor.Default);
29 this.e.SetTextValue(this.subText);
33 this.mainText.SetText(str + this.e.Name +
" " +
this.e.DisplayValue.ToString(), FontColor.Default);
34 int techUpgradeCost =
EClass.Branch.GetTechUpgradeCost(this.e);
35 int currency =
EClass.pc.GetCurrency(
"money2");
36 if (
EClass.Branch.elements.ValueWithoutLink(
this.e.id) == 0 ||
this.e.source.cost[0] == 0 || techUpgradeCost == 0)
38 this.subText.SetText(
"-");
41 this.subText.SetText(techUpgradeCost.ToString() ??
"", (currency >= techUpgradeCost) ? FontColor.Good : FontColor.Bad);
49 this.mainText.SetText(this.e.FullName, FontColor.Default);
50 this.subText.text = this.e.GetDetail().SplitNewline()[0].StripLastPun();
51 this.subText2.text =
"".TagColor((
EClass.pc.feat >=
this.e.CostLearn) ?
EClass.Colors.Skin.textGood :
EClass.Colors.Skin.textBad,
this.e.CostLearn.ToString() ??
"");
55 string str2 = (this.mode ==
ButtonElement.Mode.FeatMini) ? this.e.FullName : this.e.source.GetText(
"textPhase",
false).SplitNewline().TryGet(this.e.Value - 1, -1).StripLastPun();
56 FontColor c = this.e.HasTag(
"neg") ? FontColor.Bad : FontColor.ButtonSelectable;
57 if (this.e.source.category ==
"ether")
61 this.mainText.SetText(str + str2, c);
62 this.subText.text = ((this.mode ==
ButtonElement.Mode.FeatMini) ?
"" : (this.e as
Feat).GetHint(this.owner));
64 if (this.imagePotential)
66 this.imagePotential.SetActive(
false);
71 this.mainText.SetText(str + this.e.Name, FontColor.Default);
72 this.e.SetTextValue(this.subText);
73 Mathf.Clamp((
float)this.e.Potential / 300f, 0.1f, 1f);
74 if (this.imagePotential)
76 this.imagePotential.SetActive(
false);
81 this.e.SetTextValue(this.subText);
82 this.imagePotential.SetActive(
false);
86 string text = str + this.e.Name;
87 if (this.e.HasTag(
"network") &&
EClass.Branch !=
null &&
EClass.Branch.HasNetwork)
89 text =
"feat_network".lang(text,
null,
null,
null,
null);
91 this.mainText.SetText(text +
" " + this.e.Value.ToString(), FontColor.Default);
92 this.subText.horizontalOverflow = HorizontalWrapMode.Overflow;
93 this.subText.text = this.e.GetDetail().SplitNewline()[0].StripLastPun();
94 if (this.imagePotential)
96 this.imagePotential.SetActive(
false);
102 this.mainText.SetText(str + this.e.Name, (
this.e.owner !=
null &&
this.e.IsFactionElement(
this.e.owner.Card as
Chara)) ? FontColor.Myth : FontColor.Default);
103 this.e.SetTextValue(this.subText);
104 bool enable = this.e.source.category ==
"skill";
105 if (this.imagePotential)
107 this.imagePotential.SetActive(enable);
110 if (this.imagePotential)
112 int num = (this.e.Potential - 80) / 20;
113 this.imagePotential.enabled = (this.e.Potential != 80);
114 this.imagePotential.sprite =
EClass.core.refs.spritesPotential[Mathf.Clamp(Mathf.Abs(num), 0,
EClass.core.refs.spritesPotential.Count - 1)];
115 this.imagePotential.color = ((num >= 0) ? Color.white :
new Color(1f, 0.7f, 0.7f));
117 this.e.SetImage(this.icon);
118 if (this.mode ==
ButtonElement.Mode.FeatPurchase &&
this.e.Value > 1)
121 base.SetTooltip(
"note", delegate(UITooltip tt)
123 this.e.WriteNoteWithRef(tt.note,
this.owner,
null, refEle);
127 base.SetTooltip(
"note", delegate(UITooltip tt)
129 this.e.WriteNote(tt.note,
this.owner,
null);
138 foreach (
BodySlot bodySlot
in c.body.slots)
140 if (bodySlot.elementId != 44)
142 UIItem uiitem = Util.Instantiate<UIItem>(this.moldItemResist, this.layout);
143 Thing thing = bodySlot.thing;
146 uiitem.text1.SetActive(
false);
147 uiitem.image1.color = Color.white.SetAlpha(0.5f);
149 else if (!thing.IsIdentified)
152 uiitem.text1.SetText(
"?", FontColor.Passive);
153 uiitem.image1.color = Color.white.SetAlpha(0.5f);
157 Element element = bodySlot.thing.elements.GetElement(e.id);
162 if (!element.CanLink(thing.elements) || element.IsGlobalElement)
169 uiitem.text1.SetActive(
false);
170 uiitem.image1.color = Color.white.SetAlpha(0.5f);
172 text = (e.IsFlag ?
"✓" : (Mathf.Abs(num).ToString() ??
""));
173 uiitem.text1.SetText(text, (num >= 0) ? FontColor.Good : FontColor.Bad);
182 num2 =
Element.GetResistLv(value);
185 text = Lang.GetList(
"resist")[Mathf.Min(num2, 5)];
189 text = Lang.GetList(
"resistNeg")[-num2];
192 text = text +
" (" + (flag ?
"?" : (e.IsFlag ?
"✓" : (value.ToString() ??
""))) +
")";
193 Sprite icon = e.GetIcon(
"");
194 if (icon !=
null && this.icon)
196 this.icon.sprite = icon;
198 this.mainText.SetText(e.ShortName, e.IsFactionElement(c) ? FontColor.Myth : FontColor.Default);
199 this.subText.SetText(text, (num2 == 0) ? FontColor.Default : ((num2 > 0) ? FontColor.Good : FontColor.Bad));
200 base.SetTooltip(
"note", delegate(UITooltip tt)
202 e.WriteNote(tt.note, c.elements,
null);
207 public Image imagePotential;
210 public GameObject goExp;
219 public UIButton buttonUpgrade;
222 public UIItem moldItemResist;
225 public LayoutGroup layout;
228 public ButtonElement.Mode mode;