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