Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ContentKeyItem Class Reference
Inheritance diagram for ContentKeyItem:
EContent UIContent UINote

Public Member Functions

override void OnSwitchContent (int idTab)
 
void SelectItem (SourceKeyItem.Row q)
 
- Public Member Functions inherited from UIContent
virtual void OnSwitchContent (int idTab)
 
virtual void OnInstantiate ()
 
- Public Member Functions inherited from UINote
void Clear ()
 
void Build ()
 
void Space (int sizeY=0, int sizeX=1)
 
UINote AddNote (string id)
 
UIItem AddHeader (string text, Sprite sprite=null)
 
UIItem AddHeaderCard (string text, Sprite sprite=null)
 
UIItem AddHeaderTopic (string text, Sprite sprite=null)
 
UIItem AddHeader (string id, string text, Sprite sprite=null)
 
UIItem AddText (string text, FontColor color=FontColor.DontChange)
 
UIItem AddText (string id, string text, FontColor color=FontColor.DontChange)
 
UIItem AddText (string id, string text, Color color)
 
UIItem AddItem (string id)
 
UIItem AddTopic (string id, string text, string value=null)
 
UIItem AddTopic (string text, string value=null)
 
void AddImage (Sprite sprite)
 
void AddImage (string idFile)
 
UIButton AddButton (string text, Action onClick)
 
UIButton AddButtonLink (string text, string url)
 
UIDropdown AddDropdown (string id="DropdownDefault")
 
UIButton AddToggle (string idLang="", bool isOn=false, Action< bool > action=null)
 
Transform AddPrefab (string path)
 
AddExtra< T > (string path)
 

Public Attributes

UIList list
 
UIText textClient
 
UIText textTitle
 
UIText textDetail
 
Image imageItem
 
- Public Attributes inherited from UINote
RectTransform target
 
UINoteProfile prof
 
SkinType skinType
 
string idDefaultText
 
LayoutGroup layout
 
RectTransform cur
 
bool extraRebuild
 

Detailed Description

Definition at line 4 of file ContentKeyItem.cs.

Member Function Documentation

◆ OnSwitchContent()

override void ContentKeyItem.OnSwitchContent ( int  idTab)
inlinevirtual

Reimplemented from UIContent.

Definition at line 16 of file ContentKeyItem.cs.

17 {
18 list.sortMode = UIList.SortMode.ByValue;
19 list.callbacks = new UIList.Callback<SourceKeyItem.Row, ItemGeneral>
20 {
21 onInstantiate = delegate(SourceKeyItem.Row a, ItemGeneral b)
22 {
23 b.SetSound();
24 b.button1.mainText.SetText(a.GetName());
25 b.SetSubText(EClass.player.CountKeyItem(a.id).ToString() ?? "", 260, FontColor.Default, TextAnchor.MiddleRight);
26 },
27 onClick = delegate(SourceKeyItem.Row a, ItemGeneral b)
28 {
29 SelectItem(a);
30 },
31 onList = delegate
32 {
33 foreach (int key in EClass.player.keyItems.Keys)
34 {
35 if (EClass.player.CountKeyItem(key) > 0)
36 {
37 list.Add(EClass.sources.keyItems.map[key]);
38 }
39 }
40 }
41 };
42 list.List();
44 }
FontColor
Definition: FontColor.cs:2
void SelectItem(SourceKeyItem.Row q)
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
static Player player
Definition: EClass.cs:12
void SetSound(SoundData data=null)
Definition: ItemGeneral.cs:142
UIButton SetSubText(string lang, int x, FontColor c=FontColor.Default, TextAnchor align=TextAnchor.MiddleLeft)
Definition: ItemGeneral.cs:119
int CountKeyItem(string alias)
Definition: Player.cs:1946
Dictionary< int, int > keyItems
Definition: Player.cs:919
SourceKeyItem keyItems
UIText mainText
Definition: UIButton.cs:102
UIButton button1
Definition: UIItem.cs:18
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27
override void Add(object item)
Definition: UIList.cs:302
override void List()
Definition: UIList.cs:717
void SetText(string s)
Definition: UIText.cs:159

References UIList.Add(), UIItem.button1, Player.CountKeyItem(), Player.keyItems, SourceManager.keyItems, list, UIList.List(), UIButton.mainText, EClass.player, SelectItem(), ItemGeneral.SetSound(), ItemGeneral.SetSubText(), UIText.SetText(), and EClass.sources.

◆ SelectItem()

void ContentKeyItem.SelectItem ( SourceKeyItem::Row  q)
inline

Definition at line 46 of file ContentKeyItem.cs.

47 {
48 textTitle.SetText(q.GetName());
49 string detail = q.GetDetail();
50 textDetail.SetText(detail);
51 Sprite sprite = Resources.Load<Sprite>("Media/Graphics/Image/KeyItem/" + q.alias);
52 if ((bool)sprite)
53 {
54 imageItem.sprite = sprite;
55 }
56 imageItem.SetNativeSize();
57 imageItem.SetActive(sprite);
58 this.RebuildLayout(recursive: true);
59 }

References imageItem, UIText.SetText(), textDetail, and textTitle.

Referenced by OnSwitchContent().

Member Data Documentation

◆ imageItem

Image ContentKeyItem.imageItem

Definition at line 14 of file ContentKeyItem.cs.

Referenced by SelectItem().

◆ list

UIList ContentKeyItem.list

Definition at line 6 of file ContentKeyItem.cs.

Referenced by OnSwitchContent().

◆ textClient

UIText ContentKeyItem.textClient

Definition at line 8 of file ContentKeyItem.cs.

◆ textDetail

UIText ContentKeyItem.textDetail

Definition at line 12 of file ContentKeyItem.cs.

Referenced by SelectItem().

◆ textTitle

UIText ContentKeyItem.textTitle

Definition at line 10 of file ContentKeyItem.cs.

Referenced by SelectItem().


The documentation for this class was generated from the following file: