Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
BaseList Class Reference
Inheritance diagram for BaseList:
UIDynamicList UIList UIListEx< T >

Public Member Functions

virtual void NextSort ()
 
virtual void List ()
 
virtual void List (UIList.SortMode sort)
 
virtual void Redraw ()
 
virtual void Clear ()
 
virtual void Add (object o)
 
void RefreshNoItem ()
 
void RefreshBGGrid ()
 

Public Attributes

UIList.BGType bgType
 
Vector2 bgFix
 
Vector2 bgUvFix = Vector2.one
 
UIList.ICallback callbacks
 
UIList.SortMode[] sorts
 
Action onBeforeRedraw
 
Action onAfterRedraw
 
bool useDefaultNoItem = true
 
bool numbering
 
SkinType skinType
 
RawImage bgGrid
 
UIList.SortMode sortMode
 
bool isBuilt
 

Protected Attributes

Transform transNoItem
 

Properties

virtual int ItemCount [get]
 
virtual int RowCount [get]
 
SkinRootStatic Skin [get]
 

Detailed Description

Definition at line 5 of file BaseList.cs.

Member Function Documentation

◆ Add()

virtual void BaseList.Add ( object  o)
inlinevirtual

Reimplemented in UIList, and UIDynamicList.

Definition at line 65 of file BaseList.cs.

66 {
67 }

◆ Clear()

virtual void BaseList.Clear ( )
inlinevirtual

Reimplemented in UIDynamicList, and UIList.

Definition at line 61 of file BaseList.cs.

62 {
63 }

◆ List() [1/2]

virtual void BaseList.List ( )
inlinevirtual

Reimplemented in UIDynamicList, and UIList.

Definition at line 49 of file BaseList.cs.

50 {
51 }

Referenced by NextSort().

◆ List() [2/2]

virtual void BaseList.List ( UIList::SortMode  sort)
inlinevirtual

Reimplemented in UIList, and UIDynamicList.

Definition at line 53 of file BaseList.cs.

54 {
55 }

◆ NextSort()

virtual void BaseList.NextSort ( )
inlinevirtual

Reimplemented in UIList.

Definition at line 44 of file BaseList.cs.

45 {
46 List(sorts.NextItem(sortMode));
47 }
virtual void List()
Definition: BaseList.cs:49
UIList.SortMode[] sorts
Definition: BaseList.cs:15
UIList.SortMode sortMode
Definition: BaseList.cs:33

References List(), sortMode, and sorts.

◆ Redraw()

virtual void BaseList.Redraw ( )
inlinevirtual

Reimplemented in UIDynamicList, and UIList.

Definition at line 57 of file BaseList.cs.

58 {
59 }

Referenced by InvOwner.Grab(), InvOwner.OnDrag(), and InvOwner.PutBack().

◆ RefreshBGGrid()

void BaseList.RefreshBGGrid ( )
inline

Definition at line 89 of file BaseList.cs.

90 {
91 if (bgType == UIList.BGType.none)
92 {
93 return;
94 }
95 int num = RowCount;
96 LayoutGroup component = base.transform.GetComponent<LayoutGroup>();
97 GridLayoutGroup gridLayoutGroup = component as GridLayoutGroup;
98 bool flag = bgType == UIList.BGType.stripe;
99 if (!bgGrid)
100 {
101 bgGrid = Util.Instantiate<RawImage>("UI/Element/List/BGList " + bgType, base.transform);
102 }
103 bgGrid.transform.SetAsFirstSibling();
104 if ((bool)gridLayoutGroup && gridLayoutGroup.constraint == GridLayoutGroup.Constraint.FixedColumnCount)
105 {
106 num = Mathf.CeilToInt((float)num / (float)gridLayoutGroup.constraintCount);
107 }
108 float height = num;
109 if (flag)
110 {
111 height = (float)num * 0.5f * (float)((num % 2 != 0) ? 1 : (-1));
112 }
113 float num2 = component?.padding.top ?? 0;
114 float num3 = (flag ? 0f : 1f) + bgFix.y;
115 float num4 = 0f;
116 num4 = (component as VerticalLayoutGroup)?.spacing ?? gridLayoutGroup?.spacing.y ?? 0f;
117 if (bgType == UIList.BGType.grid)
118 {
119 bgGrid.Rect().sizeDelta = new Vector2(0f, 0f);
120 bgGrid.Rect().anchoredPosition = new Vector2(0f, 0f);
121 }
122 else
123 {
124 bgGrid.Rect().sizeDelta = new Vector2(-8f, 0f - num2 + num4);
125 bgGrid.Rect().anchoredPosition = new Vector2(0f, (0f - num2) * 0.5f - num3);
126 }
127 float width = 1f;
128 float num5 = base.transform.Rect().rect.width;
129 if ((bool)gridLayoutGroup && gridLayoutGroup.constraint == GridLayoutGroup.Constraint.FixedColumnCount)
130 {
131 num5 = (float)gridLayoutGroup.constraintCount * (gridLayoutGroup.cellSize.x + gridLayoutGroup.spacing.x);
132 }
133 if (!flag)
134 {
135 int num6 = 64;
136 if (bgType == UIList.BGType.dot)
137 {
138 num6 = 60;
139 }
140 width = num5 / (float)num6 * bgUvFix.x;
141 }
142 if (bgType == UIList.BGType.grid && gridLayoutGroup.constraint == GridLayoutGroup.Constraint.FixedColumnCount)
143 {
144 width = gridLayoutGroup.constraintCount;
145 }
146 bgGrid.uvRect = new Rect(0f, 0f, width, height);
147 bgGrid.SetActive(ItemCount > 0);
148 }
Vector2 bgUvFix
Definition: BaseList.cs:11
RawImage bgGrid
Definition: BaseList.cs:30
UIList.BGType bgType
Definition: BaseList.cs:7
virtual int ItemCount
Definition: BaseList.cs:38
virtual int RowCount
Definition: BaseList.cs:40
Vector2 bgFix
Definition: BaseList.cs:9
Definition: UIList.cs:9
BGType
Definition: UIList.cs:16
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References bgFix, bgGrid, bgType, bgUvFix, ItemCount, RowCount, and Util.

Referenced by UIList.AfterRefresh(), and UIDynamicList.Refresh().

◆ RefreshNoItem()

void BaseList.RefreshNoItem ( )
inline

Definition at line 69 of file BaseList.cs.

70 {
71 if (!transNoItem)
72 {
74 {
75 UIScrollView[] componentsInParent = base.transform.GetComponentsInParent<UIScrollView>(includeInactive: true);
76 transNoItem = Util.Instantiate(ResourceCache.Load<Transform>("NoItem"), (componentsInParent.Length != 0) ? componentsInParent[0].transform : base.transform.parent);
77 }
78 else
79 {
80 transNoItem = base.transform.Find("NoItem");
81 }
82 }
83 if ((bool)transNoItem)
84 {
85 transNoItem.SetActive(ItemCount == 0);
86 }
87 }
Transform transNoItem
Definition: BaseList.cs:25
bool useDefaultNoItem
Definition: BaseList.cs:21

References ItemCount, transNoItem, useDefaultNoItem, and Util.

Referenced by UIList.AfterRefresh(), and UIDynamicList.Refresh().

Member Data Documentation

◆ bgFix

Vector2 BaseList.bgFix

Definition at line 9 of file BaseList.cs.

Referenced by RefreshBGGrid().

◆ bgGrid

RawImage BaseList.bgGrid

Definition at line 30 of file BaseList.cs.

Referenced by RefreshBGGrid().

◆ bgType

UIList.BGType BaseList.bgType

Definition at line 7 of file BaseList.cs.

Referenced by RefreshBGGrid().

◆ bgUvFix

Vector2 BaseList.bgUvFix = Vector2.one

Definition at line 11 of file BaseList.cs.

Referenced by RefreshBGGrid().

◆ callbacks

◆ isBuilt

bool BaseList.isBuilt

Definition at line 36 of file BaseList.cs.

Referenced by ContentCodex.OnSwitchContent(), UIDynamicList.Refresh(), and UIList.Refresh().

◆ numbering

bool BaseList.numbering

Definition at line 23 of file BaseList.cs.

Referenced by UIList.Refresh().

◆ onAfterRedraw

Action BaseList.onAfterRedraw

Definition at line 19 of file BaseList.cs.

Referenced by UIList.Redraw().

◆ onBeforeRedraw

Action BaseList.onBeforeRedraw

Definition at line 17 of file BaseList.cs.

Referenced by UIList.Redraw().

◆ skinType

SkinType BaseList.skinType

Definition at line 27 of file BaseList.cs.

Referenced by UIList.Refresh().

◆ sortMode

◆ sorts

UIList.SortMode [] BaseList.sorts

Definition at line 15 of file BaseList.cs.

Referenced by NextSort(), UIList.NextSort(), and LayerAbility.OnInit().

◆ transNoItem

Transform BaseList.transNoItem
protected

Definition at line 25 of file BaseList.cs.

Referenced by UIList.OnDestroy(), and RefreshNoItem().

◆ useDefaultNoItem

bool BaseList.useDefaultNoItem = true

Definition at line 21 of file BaseList.cs.

Referenced by RefreshNoItem().

Property Documentation

◆ ItemCount

virtual int BaseList.ItemCount
get

Definition at line 38 of file BaseList.cs.

Referenced by RefreshBGGrid(), and RefreshNoItem().

◆ RowCount

virtual int BaseList.RowCount
get

Definition at line 40 of file BaseList.cs.

Referenced by RefreshBGGrid().

◆ Skin

SkinRootStatic BaseList.Skin
get

Definition at line 42 of file BaseList.cs.


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