Elin Modding Docs Doc
Loading...
Searching...
No Matches
ContentKeyItem.cs
1using System;
2using UnityEngine;
3using UnityEngine.UI;
4
5// Token: 0x02000587 RID: 1415
6public class ContentKeyItem : EContent
7{
8 // Token: 0x06002702 RID: 9986 RVA: 0x000DD290 File Offset: 0x000DB490
9 public override void OnSwitchContent(int idTab)
10 {
11 this.list.sortMode = UIList.SortMode.ByValue;
12 BaseList baseList = this.list;
13 UIList.Callback<SourceKeyItem.Row, ItemGeneral> callback = new UIList.Callback<SourceKeyItem.Row, ItemGeneral>();
14 callback.onInstantiate = delegate(SourceKeyItem.Row a, ItemGeneral b)
15 {
16 b.SetSound(null);
17 b.button1.mainText.SetText(a.GetName());
18 b.SetSubText(EClass.player.CountKeyItem(a.id).ToString() ?? "", 260, FontColor.Default, TextAnchor.MiddleRight);
19 };
20 callback.onClick = delegate(SourceKeyItem.Row a, ItemGeneral b)
21 {
22 this.SelectItem(a);
23 };
24 callback.onList = delegate(UIList.SortMode m)
25 {
26 foreach (int num in EClass.player.keyItems.Keys)
27 {
28 if (EClass.player.CountKeyItem(num) > 0)
29 {
30 this.list.Add(EClass.sources.keyItems.map[num]);
31 }
32 }
33 };
34 baseList.callbacks = callback;
35 this.list.List(false);
36 this.SelectItem(EClass.sources.keyItems.rows[0]);
37 }
38
39 // Token: 0x06002703 RID: 9987 RVA: 0x000DD32C File Offset: 0x000DB52C
40 public void SelectItem(SourceKeyItem.Row q)
41 {
42 this.textTitle.SetText(q.GetName());
43 string detail = q.GetDetail();
44 this.textDetail.SetText(detail);
45 Sprite sprite = Resources.Load<Sprite>("Media/Graphics/Image/KeyItem/" + q.alias);
46 if (sprite)
47 {
48 this.imageItem.sprite = sprite;
49 }
50 this.imageItem.SetNativeSize();
51 this.imageItem.SetActive(sprite);
52 this.RebuildLayout(true);
53 }
54
55 // Token: 0x0400158A RID: 5514
56 public UIList list;
57
58 // Token: 0x0400158B RID: 5515
59 public UIText textClient;
60
61 // Token: 0x0400158C RID: 5516
62 public UIText textTitle;
63
64 // Token: 0x0400158D RID: 5517
65 public UIText textDetail;
66
67 // Token: 0x0400158E RID: 5518
68 public Image imageItem;
69}