Elin Modding Docs Doc
Loading...
Searching...
No Matches
ItemGachaResult.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.UI;
5
6// Token: 0x02000548 RID: 1352
7public class ItemGachaResult : EMono
8{
9 // Token: 0x060024C6 RID: 9414 RVA: 0x000CF89C File Offset: 0x000CDA9C
10 public void SetChara(Chara c, LayerGachaResult _layer)
11 {
12 this.layer = _layer;
13 this.chara = c;
14 this.portrait.SetChara(c, null);
15 if (c.IsPCC)
16 {
17 this.portrait.imageChara.transform.localScale = new Vector3(1.4f, 1.4f, 1f);
18 this.portrait.imageChara.rectTransform.anchoredPosition = new Vector2(45f, -120f);
19 }
20 this.textName.text = c.NameBraced;
21 this.textJob.text = c.job.GetName();
22 this.textBio.text = c.bio.TextBio(c);
23 using (List<Element>.Enumerator enumerator = c.elements.ListBestSkills().GetEnumerator())
24 {
25 while (enumerator.MoveNext())
26 {
27 Element e = enumerator.Current;
28 HintIcon hintIcon = Util.Instantiate<HintIcon>("UI/Element/Item/Tag Skill", this.layoutTag);
29 hintIcon.text.SetText(e.Name);
30 hintIcon.text2.SetText(e.Value.ToString() ?? "");
31 hintIcon.tooltip.onShowTooltip = delegate(UITooltip t)
32 {
33 e.WriteNote(t.note, this.chara.elements, null);
34 };
35 hintIcon.RebuildLayout(false);
36 }
37 }
38 this.textResult.SetActive(false);
39 this.buttonGet.onClick.AddListener(delegate()
40 {
41 EMono.Sound.Play("good");
42 this.Confirm(true);
43 });
44 this.buttonDump.tooltip.text = "gachaDump".lang(this.GetMedal().ToString() ?? "", null, null, null, null);
45 this.buttonDump.onClick.AddListener(delegate()
46 {
47 EMono.Sound.Play("pay");
48 this.Confirm(false);
49 });
50 this.textHobby.text = c.GetTextHobby(false);
51 this.textWork.text = c.GetTextWork(false);
52 this.textLifeStyle.text = "lifestyle".lang() + ": " + ("lifestyle_" + c.idTimeTable).lang();
53 }
54
55 // Token: 0x060024C7 RID: 9415 RVA: 0x000CFAF0 File Offset: 0x000CDCF0
56 public int GetMedal()
57 {
58 return 1;
59 }
60
61 // Token: 0x060024C8 RID: 9416 RVA: 0x000CFAF4 File Offset: 0x000CDCF4
62 public void Confirm(bool add)
63 {
64 this.textResult.SetActive(true);
65 this.textResult.SetText(add ? "Get!" : "Discarded", add ? FontColor.Good : FontColor.Bad);
66 this.buttonDump.SetActive(false);
67 this.buttonGet.SetActive(false);
68 this.layer.items.Remove(this);
69 if (add)
70 {
71 EMono.Home.AddReserve(this.chara);
72 Msg.Say("gachaAdd", this.chara, null, null, null);
73 }
74 else
75 {
76 EMono.pc.ModCurrency(this.GetMedal(), "medal");
77 }
78 if (this.layer.items.Count == 0)
79 {
80 this.layer.Close();
81 }
82 }
83
84 // Token: 0x04001443 RID: 5187
85 public UIButton buttonGet;
86
87 // Token: 0x04001444 RID: 5188
88 public UIButton buttonDump;
89
90 // Token: 0x04001445 RID: 5189
91 public Portrait portrait;
92
93 // Token: 0x04001446 RID: 5190
94 public Chara chara;
95
96 // Token: 0x04001447 RID: 5191
97 public UIText textName;
98
99 // Token: 0x04001448 RID: 5192
100 public UIText textBio;
101
102 // Token: 0x04001449 RID: 5193
103 public UIText textJob;
104
105 // Token: 0x0400144A RID: 5194
106 public UIText textDetail;
107
108 // Token: 0x0400144B RID: 5195
109 public UIText textResult;
110
111 // Token: 0x0400144C RID: 5196
112 public UIText textHobby;
113
114 // Token: 0x0400144D RID: 5197
115 public UIText textWork;
116
117 // Token: 0x0400144E RID: 5198
118 public UIText textLifeStyle;
119
120 // Token: 0x0400144F RID: 5199
121 public LayerGachaResult layer;
122
123 // Token: 0x04001450 RID: 5200
124 public LayoutGroup layoutTag;
125}
Definition Chara.cs:12
Definition EMono.cs:6
Definition Msg.cs:7