Elin Decompiled Documentation EA 23.253 Nightly
Loading...
Searching...
No Matches
UIList.cs
Go to the documentation of this file.
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Linq;
5using UnityEngine;
6using UnityEngine.UI;
7
8public class UIList : BaseList
9{
10 public class RefObject
11 {
12 public object obj;
13 }
14
15 public enum BGType
16 {
17 none,
18 stripe,
19 line,
20 dot,
22 grid,
23 thin
24 }
25
26 public enum SortMode
27 {
28 ByNone,
30 ByValue,
32 ByEquip,
33 ByJob,
34 ByRace,
35 ByLevel,
37 ByPrice,
39 ByName,
40 ByID,
42 ByWorkk,
43 ByFeat
44 }
45
46 public enum ItemHeight
47 {
50 }
51
52 public class Callback<T1, T2> : ICallback where T2 : Component
53 {
54 public Action<T1, T2> onInstantiate;
55
56 public Action<T1, T2> onClick;
57
58 public Action<T1, T2, int> onRedraw;
59
60 public Action<SortMode> onList;
61
62 public Func<T1, SortMode, int> onSort;
63
64 public Action onRefresh;
65
66 public T2 mold;
67
68 public UIList list;
69
70 public Action<T1, int> onDragReorder;
71
72 public Func<T1, bool> canDragReorder;
73
74 public bool useSort => onSort != null;
75
76 public bool useOnClick => onClick != null;
77
78 public void SetList(UIList _list)
79 {
80 list = _list;
81 }
82
83 public void CreateMold()
84 {
85 if (!mold)
86 {
87 mold = list.GetMold<T2>();
88 }
89 }
90
91 public Component GetMold()
92 {
93 return mold;
94 }
95
96 public Component Instantiate(object obj, Transform parent)
97 {
98 T2 val = (list.usePool ? PoolManager.Spawn(mold) : UnityEngine.Object.Instantiate(mold));
99 val.SetActive(enable: true);
100 val.transform.SetParent(parent, worldPositionStays: false);
102 {
103 UIButton uIButton = (val as UIButton) ?? (val as UIItem)?.button1;
104 if ((bool)uIButton)
105 {
106 uIButton.instantClick = false;
107 }
108 }
109 if (onInstantiate != null)
110 {
111 onInstantiate((T1)obj, val);
112 }
113 if (onDragReorder != null)
114 {
115 UIListDragItem orCreate = val.GetOrCreate<UIListDragItem>();
116 orCreate.list = list;
117 orCreate.item = obj;
118 }
119 return val;
120 }
121
122 public void OnClick(object obj, Component button)
123 {
124 if (onClick != null)
125 {
126 onClick((T1)obj, (T2)button);
127 }
128 }
129
130 public void OnList(SortMode mode)
131 {
132 if (onList != null)
133 {
134 onList(mode);
135 }
136 }
137
138 public void OnRedraw(object obj, Component c, int index)
139 {
140 if (onRedraw != null)
141 {
142 onRedraw((T1)obj, (T2)c, index);
143 }
144 }
145
146 public int OnSort(object obj, SortMode mode)
147 {
148 return onSort((T1)obj, mode);
149 }
150
151 public void OnRefresh()
152 {
153 if (onRefresh != null)
154 {
155 onRefresh();
156 }
157 }
158
159 public void OnDragReorder(object obj, int a)
160 {
161 if (onDragReorder != null)
162 {
163 onDragReorder((T1)obj, a);
164 }
165 }
166
167 public bool CanDragReorder(object obj)
168 {
169 if (canDragReorder != null)
170 {
171 return canDragReorder((T1)obj);
172 }
173 return false;
174 }
175
176 public Component GetComponent(Transform t)
177 {
178 return t.GetComponent<T2>();
179 }
180 }
181
182 public interface ICallback
183 {
184 bool useSort { get; }
185
186 bool useOnClick { get; }
187
188 Component GetComponent(Transform t);
189
190 void SetList(UIList list);
191
193
194 Component Instantiate(object obj, Transform parent);
195
196 Component GetMold();
197
198 void OnClick(object obj, Component button);
199
200 void OnRedraw(object obj, Component button, int index);
201
202 void OnList(SortMode mode);
203
204 int OnSort(object obj, SortMode mode);
205
206 void OnRefresh();
207
208 void OnDragReorder(object obj, int a);
209
210 bool CanDragReorder(object obj);
211 }
212
213 public struct ButtonPair
214 {
215 public Component component;
216
217 public object obj;
218 }
219
220 public string langNoItem;
221
222 public int rows;
223
225
227
228 public bool fillEmpty;
229
230 public bool buildLayout;
231
233
235
237
238 public LayoutGroup _layoutItems;
239
240 public Transform moldItem;
241
242 public bool selectFirst;
243
244 public bool invokeSelected;
245
246 public bool enableGroup = true;
247
249
250 public bool usePage;
251
252 public bool usePool;
253
254 public bool disableInstaClick = true;
255
256 public bool ignoreNullObj = true;
257
259
260 public int heightFix;
261
262 [NonSerialized]
263 public int page;
264
265 [NonSerialized]
266 public int maxPage;
267
268 [NonSerialized]
269 public int itemsPerPage;
270
271 [NonSerialized]
272 public List<object> items = new List<object>();
273
274 [NonSerialized]
275 public List<ButtonPair> buttons = new List<ButtonPair>();
276
277 [NonSerialized]
278 public string idMold;
279
280 public Action SETab = delegate
281 {
282 };
283
284 public const int HeightDefault = 34;
285
286 private bool initialized;
287
288 private bool reset;
289
291
293
294 public Dictionary<UIButton, UIList> children = new Dictionary<UIButton, UIList>();
295
296 public static string[] strNumber = new string[26]
297 {
298 "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
299 "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
300 "u", "v", "w", "x", "y", "z"
301 };
302
303 private int highlightIndex;
304
305 private object dragTarget;
306
307 private int dragBeginIndex;
308
309 private int dragHoverIndex;
310
311 [NonSerialized]
313
314 [NonSerialized]
315 public RectTransform dragViewport;
316
317 [NonSerialized]
318 public float dragEdgeSize;
319
320 [NonSerialized]
321 public float dragScrollSpeed = 2.5f;
322
323 public LayoutGroup layoutItems => _layoutItems ?? (_layoutItems = GetComponent<LayoutGroup>());
324
325 public GridLayoutGroup gridLayout => layoutItems as GridLayoutGroup;
326
327 public override int ItemCount => items.Count;
328
329 public override int RowCount => items.Count;
330
332 {
333 get
334 {
335 if (!parent)
336 {
337 return this;
338 }
339 return parent.Root;
340 }
341 }
342
343 public bool IsDragging => dragTarget != null;
344
345 public void AddCollection(ICollection collection)
346 {
347 foreach (object item in collection)
348 {
349 Add(item);
350 }
351 }
352
353 public override void Add(object item)
354 {
355 if (item != null || !ignoreNullObj)
356 {
357 items.Add(item);
358 }
359 }
360
361 public int GetIndexOf(object item)
362 {
363 return items.IndexOf(item);
364 }
365
366 public ButtonPair GetPair(object item)
367 {
368 foreach (ButtonPair button in buttons)
369 {
370 if (button.obj == item)
371 {
372 return button;
373 }
374 }
375 return buttons[0];
376 }
377
378 public T GetPair<T>(object item) where T : Component
379 {
380 return GetPair(item).component as T;
381 }
382
383 public void AddDynamic(object item)
384 {
385 }
386
387 public void RemoveDynamic(object item)
388 {
389 BaseCore.Instance.StopEventSystem(GetPair(item).component, delegate
390 {
391 items.Remove(item);
392 ButtonPair item2 = buttons.First((ButtonPair a) => a.obj == item);
393 buttons.IndexOf(item2);
394 buttons.Remove(item2);
395 UnityEngine.Object.DestroyImmediate(item2.component.gameObject);
396 AfterRefresh();
397 });
398 }
399
400 public override void Clear()
401 {
402 items.Clear();
403 reset = true;
404 }
405
407 {
408 UIList uIList = Util.Instantiate(moldList, layoutItems);
409 uIList.transform.SetSiblingIndex(button.transform.GetSiblingIndex() + 1);
410 uIList.callbacks = callbacks;
411 uIList.parent = this;
412 children.Add(button, uIList);
413 return uIList;
414 }
415
416 public bool OnClickFolder(UIButton b, Action<UIList> onFold, bool refresh = true)
417 {
418 if (children.ContainsKey(b))
419 {
420 RemoveChild(b);
421 return true;
422 }
423 UIList uIList = CreateChild(b);
424 onFold(uIList);
425 uIList.Refresh();
426 if (refresh)
427 {
428 GetComponentInParent<ScrollRect>().RebuildLayout(recursive: true);
429 }
430 return false;
431 }
432
433 private void RemoveChild(UIButton button)
434 {
435 children[button].KillChildren();
436 children.Remove(button);
438 GetComponentInParent<ScrollRect>().RebuildLayout(recursive: true);
439 }
440
441 private void KillChildren()
442 {
443 foreach (UIList value in children.Values)
444 {
445 value.KillChildren();
446 }
447 UnityEngine.Object.DestroyImmediate(base.gameObject);
448 }
449
451 {
452 this.RebuildLayout();
453 if ((bool)parent)
454 {
455 parent.RebuildLayout();
456 }
457 else
458 {
459 base.transform.parent.RebuildLayout();
460 }
461 }
462
463 private void OnSelect(UIList activeList)
464 {
465 foreach (UIList value in children.Values)
466 {
467 value.OnSelect(activeList);
468 }
469 if (this != activeList && (bool)group)
470 {
471 group.Select(-1);
472 }
473 }
474
475 public virtual void Refresh(bool highlightLast = false)
476 {
477 if (!layoutItems)
478 {
479 return;
480 }
482 if (skinType != 0)
483 {
484 SkinManager.tempSkin = SkinManager.CurrentSkin.GetSkin(skinType);
485 }
486 highlightIndex = -1;
487 if (highlightLast)
488 {
489 UIButton componentOf = InputModuleEX.GetComponentOf<UIButton>();
490 if ((bool)componentOf)
491 {
492 Component component = componentOf.transform.parent.GetComponent<UIItem>();
493 if (component == null)
494 {
495 component = componentOf;
496 }
497 for (int i = 0; i < buttons.Count; i++)
498 {
499 if (buttons[i].component == component)
500 {
501 highlightIndex = i;
502 break;
503 }
504 }
505 }
506 }
507 callbacks.SetList(this);
508 if (!enableGroup && (bool)group)
509 {
510 UnityEngine.Object.DestroyImmediate(group);
511 }
512 if (!usePage)
513 {
514 maxPage = 9999999;
515 }
516 callbacks.CreateMold();
517 if (itemHeight == ItemHeight.Default)
518 {
519 RectTransform rectTransform = callbacks.GetMold().Rect();
520 rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, 34 + heightFix);
521 }
522 if (!initialized || reset)
523 {
524 if (sortMode != 0)
525 {
526 Sort();
527 }
528 if (!initialized)
529 {
530 if ((bool)paginationTop && (bool)paginationTop.button1)
531 {
532 paginationTop.button1.onClick.AddListener(PrevPage);
533 paginationTop.button2.onClick.AddListener(NextPage);
534 }
535 if ((bool)paginationBottom && (bool)paginationBottom.button1)
536 {
537 paginationBottom.button1.onClick.AddListener(PrevPage);
538 paginationBottom.button2.onClick.AddListener(NextPage);
539 }
540 _ = (bool)bar;
541 }
542 initialized = true;
543 reset = false;
544 }
545 children.Clear();
546 buttons.Clear();
547 GridLayoutGroup gridLayoutGroup = layoutItems as GridLayoutGroup;
548 BuildLayout();
549 if (usePage)
550 {
551 if ((bool)gridLayoutGroup)
552 {
553 itemsPerPage = gridLayoutGroup.constraintCount;
554 }
555 else
556 {
558 }
559 this.Rect().RebuildLayout();
560 this.Rect().ForceUpdateRectTransforms();
561 Canvas.ForceUpdateCanvases();
562 float y = RectTransformUtility.PixelAdjustRect(this.Rect(), GetComponentInParent<Canvas>()).size.y;
563 float y2 = callbacks.GetMold().Rect().sizeDelta.y;
564 Debug.Log(y2);
565 Debug.Log(y);
566 itemsPerPage = (int)(y / y2);
567 }
568 else
569 {
570 itemsPerPage = 99999;
571 }
573 maxPage = (items.Count - 1) / itemsPerPage + 1;
574 if (usePage)
575 {
576 while (page > 0 && page * itemsPerPage >= items.Count)
577 {
578 page--;
579 }
580 }
581 for (int j = 0; j < itemsPerPage; j++)
582 {
583 int num = page * itemsPerPage + j;
584 if (num >= items.Count)
585 {
586 if (fillEmpty)
587 {
588 new GameObject().AddComponent<RectTransform>().SetParent(layoutItems.transform, worldPositionStays: false);
589 }
590 continue;
591 }
592 object item = items[num];
593 Component comp = callbacks.Instantiate(item, layoutItems.transform);
594 callbacks.OnRedraw(item, comp, j);
595 ButtonPair buttonPair = default(ButtonPair);
596 buttonPair.obj = item;
597 buttonPair.component = comp;
598 ButtonPair item2 = buttonPair;
599 UIButton uIButton = comp as UIButton;
600 if (!uIButton)
601 {
602 UIItem uIItem = comp as UIItem;
603 if ((bool)uIItem)
604 {
605 uIButton = uIItem.button1;
606 }
607 }
608 if ((bool)uIButton)
609 {
610 if (numbering && (bool)uIButton.keyText)
611 {
612 uIButton.keyText.text = strNumber[j % strNumber.Length];
613 }
614 uIButton.onClick.AddListener(delegate
615 {
616 Root.OnSelect(this);
617 callbacks.OnClick(item, comp);
618 });
619 if (highlightIndex == j)
620 {
621 uIButton.DoHighlightTransition();
622 }
623 }
624 buttons.Add(item2);
625 }
626 AfterRefresh();
627 if ((bool)group)
628 {
630 }
632 {
633 UIButton componentInChildren = layoutItems.GetComponentInChildren<UIButton>();
634 if ((bool)componentInChildren)
635 {
636 componentInChildren.onClick.Invoke();
637 }
638 }
639 isBuilt = true;
640 SkinManager.tempSkin = tempSkin;
641 }
642
643 private void AfterRefresh()
644 {
646 if ((bool)paginationTop)
647 {
648 paginationTop.text1.text = page + 1 + " / " + maxPage;
649 }
650 if ((bool)paginationBottom)
651 {
652 paginationBottom.text1.text = page + 1 + " / " + maxPage;
653 }
655 OnRefresh();
656 layoutItems.RebuildLayout();
658 }
659
660 protected virtual void OnRefresh()
661 {
662 }
663
664 public void NextPage()
665 {
666 SetPage(page + 1);
667 }
668
669 public void PrevPage()
670 {
671 SetPage(page - 1);
672 }
673
674 public void SetPage(int i)
675 {
676 if (i < 0)
677 {
678 i = maxPage - 1;
679 }
680 else if (i >= maxPage)
681 {
682 i = 0;
683 }
684 page = i;
685 Refresh();
686 }
687
688 public void OnMove(object o, object select = null)
689 {
690 List();
691 Select(select ?? o);
692 SE.Click();
693 }
694
695 public void Select(int index = 0, bool invoke = false)
696 {
697 if (buttons.Count < 0)
698 {
699 return;
700 }
701 ButtonPair buttonPair = buttons[Mathf.Clamp(index, 0, buttons.Count - 1)];
702 UIButton uIButton = buttonPair.component as UIButton;
703 if (!uIButton)
704 {
705 uIButton = (buttonPair.component as UIItem)?.button1;
706 }
707 if ((bool)uIButton)
708 {
709 if (invoke)
710 {
711 uIButton.onClick.Invoke();
712 }
713 if ((bool)uIButton.group)
714 {
715 uIButton.group.Select(uIButton);
716 }
717 else
718 {
719 uIButton.DoHighlightTransition();
720 }
721 }
722 }
723
724 public void Select(object obj, bool invoke = false)
725 {
726 for (int i = 0; i < items.Count; i++)
727 {
728 if (obj == items[i])
729 {
730 Select(i, invoke);
731 break;
732 }
733 }
734 }
735
736 public void Select<T>(Func<T, bool> func, bool invoke = false)
737 {
738 for (int i = 0; i < items.Count; i++)
739 {
740 if (func((T)items[i]))
741 {
742 Select(i, invoke);
743 break;
744 }
745 }
746 }
747
748 public void Sort()
749 {
750 if (callbacks.useSort)
751 {
752 items.Sort((object a, object b) => callbacks.OnSort(b, sortMode) - callbacks.OnSort(a, sortMode));
753 }
754 }
755
756 public void ChangeSort(SortMode m)
757 {
758 sortMode = m;
759 Sort();
760 Refresh();
761 }
762
763 public override void NextSort()
764 {
765 ChangeSort(sorts.NextItem(sortMode));
766 }
767
768 public override void List()
769 {
770 List(sortMode);
771 }
772
773 public override void List(SortMode sort)
774 {
775 List(sort);
776 }
777
778 public void List(bool refreshHighlight = false)
779 {
780 List(sortMode, refreshHighlight);
781 }
782
783 public void List(SortMode m, bool refreshHighlight = false)
784 {
785 sortMode = m;
786 Clear();
787 callbacks.OnList(sortMode);
788 Refresh(refreshHighlight);
789 }
790
791 public override void Redraw()
792 {
793 if (onBeforeRedraw != null)
794 {
796 }
797 int num = 0;
798 foreach (ButtonPair button in buttons)
799 {
800 callbacks.OnRedraw(button.obj, button.component, num);
801 num++;
802 }
803 if (onAfterRedraw != null)
804 {
806 }
807 }
808
809 public void BuildLayout()
810 {
811 GridLayoutGroup gridLayoutGroup = layoutItems as GridLayoutGroup;
812 if ((bool)gridLayoutGroup && buildLayout)
813 {
814 RectTransform rectTransform = layoutItems.Rect();
815 RectTransform rectTransform2 = layoutItems.Rect();
816 Vector2 vector2 = (layoutItems.Rect().anchorMax = new Vector2(0f, 1f));
817 Vector2 pivot = (rectTransform2.anchorMin = vector2);
818 rectTransform.pivot = pivot;
819 rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, (float)rows * gridLayoutGroup.cellSize.y);
820 }
821 }
822
823 public T GetMold<T>() where T : Component
824 {
825 if ((bool)moldItem)
826 {
827 T component = moldItem.GetComponent<T>();
828 if ((bool)component)
829 {
830 layoutItems.DestroyChildren();
831 return component;
832 }
833 }
834 return layoutItems.CreateMold<T>(idMold);
835 }
836
837 public void OnDestroy()
838 {
840 if ((bool)transNoItem)
841 {
842 UnityEngine.Object.DestroyImmediate(transNoItem.gameObject);
843 }
844 }
845
846 public void ClearChildren()
847 {
848 if (usePool)
849 {
850 foreach (ButtonPair button in buttons)
851 {
853 }
854 }
855 layoutItems.DestroyChildren();
856 }
857
859 {
860 if (callbacks.CanDragReorder(drag.item))
861 {
862 dragTarget = drag.item;
863 dragBeginIndex = drag.transform.GetSiblingIndex();
864 }
865 }
866
867 public void EndItemDrag(UIListDragItem drag)
868 {
869 if (dragTarget != null)
870 {
871 int num = dragHoverIndex - dragBeginIndex;
872 dragTarget = null;
873 if (num != 0)
874 {
875 callbacks.OnDragReorder(drag.item, num);
876 }
877 }
878 }
879
881 {
882 if (callbacks.CanDragReorder(drag.item) && dragTarget != null && dragTarget != drag.item)
883 {
884 dragHoverIndex = drag.transform.GetSiblingIndex();
885 GetPair(dragTarget).component?.transform.SetSiblingIndex(dragHoverIndex);
886 }
887 }
888
889 private void Update()
890 {
891 if (IsDragging)
892 {
894 }
895 }
896
898 {
899 if ((bool)dragViewport && (bool)dragScrollView)
900 {
901 RectTransformUtility.ScreenPointToLocalPointInRectangle(dragViewport, Input.mousePosition, null, out var localPoint);
902 float y = localPoint.y;
903 float num = dragViewport.rect.height * 0.5f;
904 float num2 = 0f;
905 if (y < 0f - num + dragEdgeSize)
906 {
907 float num3 = Mathf.InverseLerp(0f - num + dragEdgeSize, 0f - num, y);
908 num2 = (0f - dragScrollSpeed) * num3;
909 }
910 else if (y > num - dragEdgeSize)
911 {
912 float num4 = Mathf.InverseLerp(num - dragEdgeSize, num, y);
913 num2 = dragScrollSpeed * num4;
914 }
915 if (num2 != 0f)
916 {
917 float verticalNormalizedPosition = dragScrollView.verticalNormalizedPosition;
918 dragScrollView.verticalNormalizedPosition = Mathf.Clamp01(verticalNormalizedPosition + num2 * Time.unscaledDeltaTime);
919 }
920 }
921 }
922}
list. Refresh()
static BaseCore Instance
Definition: BaseCore.cs:11
virtual void StopEventSystem(float duration=0.2f)
Definition: BaseCore.cs:72
Transform transNoItem
Definition: BaseList.cs:25
void RefreshNoItem()
Definition: BaseList.cs:69
bool isBuilt
Definition: BaseList.cs:36
UIList.SortMode[] sorts
Definition: BaseList.cs:15
UIList.ICallback callbacks
Definition: BaseList.cs:13
bool numbering
Definition: BaseList.cs:23
Action onAfterRedraw
Definition: BaseList.cs:19
SkinType skinType
Definition: BaseList.cs:27
Action onBeforeRedraw
Definition: BaseList.cs:17
UIList.SortMode sortMode
Definition: BaseList.cs:33
void RefreshBGGrid()
Definition: BaseList.cs:89
static bool TryDespawn(Component c)
Definition: PoolManager.cs:143
static Transform Spawn(string id, string path, Transform parent)
Definition: PoolManager.cs:86
static SkinRootStatic CurrentSkin
Definition: SkinManager.cs:82
static SkinRootStatic tempSkin
Definition: SkinManager.cs:63
SkinRootStatic GetSkin(SkinType type)
void DoHighlightTransition(bool instant=false)
Definition: UIButton.cs:526
UIText keyText
Definition: UIButton.cs:108
UISelectableGroup group
Definition: UIButton.cs:126
Definition: UIItem.cs:5
UIButton button1
Definition: UIItem.cs:18
UIButton button2
Definition: UIItem.cs:20
bool useOnClick
Definition: UIList.cs:76
void OnDragReorder(object obj, int a)
Definition: UIList.cs:159
Action< T1, T2, int > onRedraw
Definition: UIList.cs:58
Action< T1, T2 > onInstantiate
Definition: UIList.cs:54
int OnSort(object obj, SortMode mode)
Definition: UIList.cs:146
void OnList(SortMode mode)
Definition: UIList.cs:130
void OnRefresh()
Definition: UIList.cs:151
Component GetComponent(Transform t)
Definition: UIList.cs:176
Component GetMold()
Definition: UIList.cs:91
Action onRefresh
Definition: UIList.cs:64
Func< T1, SortMode, int > onSort
Definition: UIList.cs:62
void OnClick(object obj, Component button)
Definition: UIList.cs:122
Component Instantiate(object obj, Transform parent)
Definition: UIList.cs:96
void SetList(UIList _list)
Definition: UIList.cs:78
void OnRedraw(object obj, Component c, int index)
Definition: UIList.cs:138
Action< SortMode > onList
Definition: UIList.cs:60
bool CanDragReorder(object obj)
Definition: UIList.cs:167
Func< T1, bool > canDragReorder
Definition: UIList.cs:72
Action< T1, T2 > onClick
Definition: UIList.cs:56
UIList list
Definition: UIList.cs:68
void CreateMold()
Definition: UIList.cs:83
Action< T1, int > onDragReorder
Definition: UIList.cs:70
bool useSort
Definition: UIList.cs:74
object obj
Definition: UIList.cs:12
Definition: UIList.cs:9
T GetMold< T >()
Definition: UIList.cs:823
void BuildLayout()
Definition: UIList.cs:809
void Select< T >(Func< T, bool > func, bool invoke=false)
Definition: UIList.cs:736
bool disableInstaClick
Definition: UIList.cs:254
int maxPage
Definition: UIList.cs:266
ItemHeight itemHeight
Definition: UIList.cs:258
LayoutGroup layoutItems
Definition: UIList.cs:323
UIList CreateChild(UIButton button)
Definition: UIList.cs:406
List< ButtonPair > buttons
Definition: UIList.cs:275
void NextPage()
Definition: UIList.cs:664
override void List(SortMode sort)
Definition: UIList.cs:773
void AutoScrollWhileDragging()
Definition: UIList.cs:897
void OnSelect(UIList activeList)
Definition: UIList.cs:463
void List(bool refreshHighlight=false)
Definition: UIList.cs:778
void OnDestroy()
Definition: UIList.cs:837
UISelectableGroup group
Definition: UIList.cs:236
string langNoItem
Definition: UIList.cs:220
void UpdateItemDragHover(UIListDragItem drag)
Definition: UIList.cs:880
int GetIndexOf(object item)
Definition: UIList.cs:361
override int ItemCount
Definition: UIList.cs:327
bool OnClickFolder(UIButton b, Action< UIList > onFold, bool refresh=true)
Definition: UIList.cs:416
bool ignoreNullObj
Definition: UIList.cs:256
virtual void OnRefresh()
Definition: UIList.cs:660
void BeginItemDrag(UIListDragItem drag)
Definition: UIList.cs:858
string idMold
Definition: UIList.cs:278
GridLayoutGroup gridLayout
Definition: UIList.cs:325
List< object > items
Definition: UIList.cs:272
override void Clear()
Definition: UIList.cs:400
override void NextSort()
Definition: UIList.cs:763
bool invokeSelected
Definition: UIList.cs:244
float dragScrollSpeed
Definition: UIList.cs:321
UIItem paginationTop
Definition: UIList.cs:232
UIListTopbar bar
Definition: UIList.cs:226
UIScrollView dragScrollView
Definition: UIList.cs:312
ItemHeight
Definition: UIList.cs:47
int itemsPerPage
Definition: UIList.cs:269
bool selectFirst
Definition: UIList.cs:242
BGType
Definition: UIList.cs:16
bool usePool
Definition: UIList.cs:252
const int HeightDefault
Definition: UIList.cs:284
void Select(object obj, bool invoke=false)
Definition: UIList.cs:724
Dictionary< UIButton, UIList > children
Definition: UIList.cs:294
void EndItemDrag(UIListDragItem drag)
Definition: UIList.cs:867
void RemoveDynamic(object item)
Definition: UIList.cs:387
void ClearChildren()
Definition: UIList.cs:846
void Select(int index=0, bool invoke=false)
Definition: UIList.cs:695
int rows
Definition: UIList.cs:222
override int RowCount
Definition: UIList.cs:329
bool fillEmpty
Definition: UIList.cs:228
void Update()
Definition: UIList.cs:889
void OnMove(object o, object select=null)
Definition: UIList.cs:688
int dragBeginIndex
Definition: UIList.cs:307
void KillChildren()
Definition: UIList.cs:441
UIList parent
Definition: UIList.cs:292
void RebuildLayoutInParent()
Definition: UIList.cs:450
bool usePage
Definition: UIList.cs:250
int highlightIndex
Definition: UIList.cs:303
void SetPage(int i)
Definition: UIList.cs:674
bool onlyDirectChildrenButtonForGroup
Definition: UIList.cs:248
bool reset
Definition: UIList.cs:288
UISelectableGroup menu
Definition: UIList.cs:224
int dragHoverIndex
Definition: UIList.cs:309
SortMode
Definition: UIList.cs:27
object dragTarget
Definition: UIList.cs:305
void RemoveChild(UIButton button)
Definition: UIList.cs:433
LayoutGroup _layoutItems
Definition: UIList.cs:238
override void Add(object item)
Definition: UIList.cs:353
bool initialized
Definition: UIList.cs:286
static string[] strNumber
Definition: UIList.cs:296
UIList moldList
Definition: UIList.cs:290
bool enableGroup
Definition: UIList.cs:246
T GetPair< T >(object item)
Definition: UIList.cs:378
UIItem paginationBottom
Definition: UIList.cs:234
void List(SortMode m, bool refreshHighlight=false)
Definition: UIList.cs:783
ButtonPair GetPair(object item)
Definition: UIList.cs:366
Action SETab
Definition: UIList.cs:280
Transform moldItem
Definition: UIList.cs:240
bool buildLayout
Definition: UIList.cs:230
void AddCollection(ICollection collection)
Definition: UIList.cs:345
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:475
void AddDynamic(object item)
Definition: UIList.cs:383
void PrevPage()
Definition: UIList.cs:669
void ChangeSort(SortMode m)
Definition: UIList.cs:756
void Sort()
Definition: UIList.cs:748
float dragEdgeSize
Definition: UIList.cs:318
override void Redraw()
Definition: UIList.cs:791
bool IsDragging
Definition: UIList.cs:343
RectTransform dragViewport
Definition: UIList.cs:315
int page
Definition: UIList.cs:263
override void List()
Definition: UIList.cs:768
void AfterRefresh()
Definition: UIList.cs:643
int heightFix
Definition: UIList.cs:260
UIList Root
Definition: UIList.cs:332
void Select(UIButton button, bool check=true)
virtual void Init(int index=0, UnityAction< int > action=null, bool directChildren=false)
void OnList(SortMode mode)
int OnSort(object obj, SortMode mode)
bool useOnClick
Definition: UIList.cs:186
Component GetMold()
void SetList(UIList list)
void OnRedraw(object obj, Component button, int index)
Component GetComponent(Transform t)
void OnClick(object obj, Component button)
Component Instantiate(object obj, Transform parent)
void OnDragReorder(object obj, int a)
bool CanDragReorder(object obj)
Component component
Definition: UIList.cs:215