Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ItemHomeResource.cs
Go to the documentation of this file.
1using UnityEngine.UI;
2
3public class ItemHomeResource : EMono
4{
6
7 public Image imageExp;
8
10 {
11 switch (_r.Group)
12 {
13 case BaseHomeResource.ResourceGroup.Currency:
14 {
15 HomeResource homeResource = _r as HomeResource;
16 int num2 = homeResource.value - homeResource.lastValue;
17 FontColor fontColor = ((num2 == 0) ? FontColor.Passive : ((num2 > 0) ? FontColor.Good : FontColor.Bad));
18 string text3 = homeResource.value.ToString() ?? "";
19 if (homeResource.value < 0)
20 {
21 text3 = text3.TagColor(FontColor.Bad);
22 }
23 string text4 = text3;
24 button.mainText.text = text4;
25 fontColor = ((num2 == 0) ? FontColor.Passive : ((num2 > 0) ? FontColor.Good : FontColor.Bad));
26 button.subText.text = ((((num2 > 0) ? "+" : "") + num2).TagColor(fontColor) + "dailyIncome".lang()).TagSize(13);
27 break;
28 }
30 {
31 HomeResourceRate homeResourceRate = _r as HomeResourceRate;
32 int num = homeResourceRate.value - homeResourceRate.lastValue;
33 if (num != 0)
34 {
35 _ = 0;
36 }
37 string text = "";
38 if (num > 0)
39 {
40 text = "↑".TagColor(FontColor.Good);
41 }
42 else if (num < 0)
43 {
44 text = "↓".TagColor(FontColor.Bad);
45 }
46 string text2 = homeResourceRate.value + " " + text;
47 button.mainText.text = text2;
48 button.subText.SetActive(enable: false);
49 break;
50 }
51 default:
52 button.mainText.text = "Lv." + _r.value;
53 button.subText.SetActive(enable: false);
54 break;
55 }
56 imageExp.SetActive(_r.IsSkill);
57 imageExp.fillAmount = _r.ExpRatio;
58 button.icon.sprite = _r.Sprite;
59 button.tooltip.onShowTooltip = delegate(UITooltip tp)
60 {
61 _r.WriteNote(tp.note);
62 };
63 }
64}
FontColor
Definition: FontColor.cs:2
virtual void WriteNote(UINote n)
virtual ResourceGroup Group
virtual float ExpRatio
Definition: EMono.cs:4
void SetResource(BaseHomeResource _r)
UIText subText
Definition: UIButton.cs:104
UINote note
Definition: UITooltip.cs:21