Elin Decompiled Documentation EA 23.350.1 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 [NonSerialized]
325 public Action<object> onDragBegin;
326
327 public LayoutGroup layoutItems => _layoutItems ?? (_layoutItems = GetComponent<LayoutGroup>());
328
329 public GridLayoutGroup gridLayout => layoutItems as GridLayoutGroup;
330
331 public override int ItemCount => items.Count;
332
333 public override int RowCount => items.Count;
334
336 {
337 get
338 {
339 if (!parent)
340 {
341 return this;
342 }
343 return parent.Root;
344 }
345 }
346
347 public bool IsDragging => dragTarget != null;
348
349 public void AddCollection(ICollection collection)
350 {
351 foreach (object item in collection)
352 {
353 Add(item);
354 }
355 }
356
357 public override void Add(object item)
358 {
359 if (item != null || !ignoreNullObj)
360 {
361 items.Add(item);
362 }
363 }
364
365 public int GetIndexOf(object item)
366 {
367 return items.IndexOf(item);
368 }
369
370 public ButtonPair GetPair(object item)
371 {
372 foreach (ButtonPair button in buttons)
373 {
374 if (button.obj == item)
375 {
376 return button;
377 }
378 }
379 return buttons[0];
380 }
381
382 public T GetPair<T>(object item) where T : Component
383 {
384 return GetPair(item).component as T;
385 }
386
387 public override void AddDynamic(object item)
388 {
389 }
390
391 public override void RemoveDynamic(object item)
392 {
393 BaseCore.Instance.StopEventSystem(GetPair(item).component, delegate
394 {
395 items.Remove(item);
396 ButtonPair item2 = buttons.First((ButtonPair a) => a.obj == item);
397 buttons.IndexOf(item2);
398 buttons.Remove(item2);
399 UnityEngine.Object.DestroyImmediate(item2.component.gameObject);
400 AfterRefresh();
401 });
402 }
403
404 public override void Clear()
405 {
406 items.Clear();
407 reset = true;
408 }
409
411 {
412 UIList uIList = Util.Instantiate(moldList, layoutItems);
413 uIList.transform.SetSiblingIndex(button.transform.GetSiblingIndex() + 1);
414 uIList.callbacks = callbacks;
415 uIList.parent = this;
416 children.Add(button, uIList);
417 return uIList;
418 }
419
420 public bool OnClickFolder(UIButton b, Action<UIList> onFold, bool refresh = true)
421 {
422 if (children.ContainsKey(b))
423 {
424 RemoveChild(b);
425 return true;
426 }
427 UIList uIList = CreateChild(b);
428 onFold(uIList);
429 uIList.Refresh();
430 if (refresh)
431 {
432 GetComponentInParent<ScrollRect>().RebuildLayout(recursive: true);
433 }
434 return false;
435 }
436
437 private void RemoveChild(UIButton button)
438 {
439 children[button].KillChildren();
440 children.Remove(button);
442 GetComponentInParent<ScrollRect>().RebuildLayout(recursive: true);
443 }
444
445 private void KillChildren()
446 {
447 foreach (UIList value in children.Values)
448 {
449 value.KillChildren();
450 }
451 UnityEngine.Object.DestroyImmediate(base.gameObject);
452 }
453
455 {
456 this.RebuildLayout();
457 if ((bool)parent)
458 {
459 parent.RebuildLayout();
460 }
461 else
462 {
463 base.transform.parent.RebuildLayout();
464 }
465 }
466
467 private void OnSelect(UIList activeList)
468 {
469 foreach (UIList value in children.Values)
470 {
471 value.OnSelect(activeList);
472 }
473 if (this != activeList && (bool)group)
474 {
475 group.Select(-1);
476 }
477 }
478
479 public virtual void Refresh(bool highlightLast = false)
480 {
481 if (!layoutItems)
482 {
483 return;
484 }
486 if (skinType != SkinType.Default)
487 {
488 SkinManager.tempSkin = SkinManager.CurrentSkin.GetSkin(skinType);
489 }
490 highlightIndex = -1;
491 if (highlightLast)
492 {
493 UIButton componentOf = InputModuleEX.GetComponentOf<UIButton>();
494 if ((bool)componentOf)
495 {
496 Component component = componentOf.transform.parent.GetComponent<UIItem>();
497 if (component == null)
498 {
499 component = componentOf;
500 }
501 for (int i = 0; i < buttons.Count; i++)
502 {
503 if (buttons[i].component == component)
504 {
505 highlightIndex = i;
506 break;
507 }
508 }
509 }
510 }
511 callbacks.SetList(this);
512 if (!enableGroup && (bool)group)
513 {
514 UnityEngine.Object.DestroyImmediate(group);
515 }
516 if (!usePage)
517 {
518 maxPage = 9999999;
519 }
520 callbacks.CreateMold();
521 if (itemHeight == ItemHeight.Default)
522 {
523 RectTransform rectTransform = callbacks.GetMold().Rect();
524 rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, 34 + heightFix);
525 }
526 if (!initialized || reset)
527 {
528 if (sortMode != SortMode.ByNone)
529 {
530 Sort();
531 }
532 if (!initialized)
533 {
534 if ((bool)paginationTop && (bool)paginationTop.button1)
535 {
536 paginationTop.button1.onClick.AddListener(PrevPage);
537 paginationTop.button2.onClick.AddListener(NextPage);
538 }
539 if ((bool)paginationBottom && (bool)paginationBottom.button1)
540 {
541 paginationBottom.button1.onClick.AddListener(PrevPage);
542 paginationBottom.button2.onClick.AddListener(NextPage);
543 }
544 _ = (bool)bar;
545 }
546 initialized = true;
547 reset = false;
548 }
549 children.Clear();
550 buttons.Clear();
551 GridLayoutGroup gridLayoutGroup = layoutItems as GridLayoutGroup;
552 BuildLayout();
553 if (usePage)
554 {
555 if ((bool)gridLayoutGroup)
556 {
557 itemsPerPage = gridLayoutGroup.constraintCount;
558 }
559 else
560 {
562 }
563 this.Rect().RebuildLayout();
564 this.Rect().ForceUpdateRectTransforms();
565 Canvas.ForceUpdateCanvases();
566 float y = RectTransformUtility.PixelAdjustRect(this.Rect(), GetComponentInParent<Canvas>()).size.y;
567 float y2 = callbacks.GetMold().Rect().sizeDelta.y;
568 Debug.Log(y2);
569 Debug.Log(y);
570 itemsPerPage = (int)(y / y2);
571 }
572 else
573 {
574 itemsPerPage = 99999;
575 }
577 maxPage = (items.Count - 1) / itemsPerPage + 1;
578 if (usePage)
579 {
580 while (page > 0 && page * itemsPerPage >= items.Count)
581 {
582 page--;
583 }
584 }
585 for (int j = 0; j < itemsPerPage; j++)
586 {
587 int num = page * itemsPerPage + j;
588 if (num >= items.Count)
589 {
590 if (fillEmpty)
591 {
592 new GameObject().AddComponent<RectTransform>().SetParent(layoutItems.transform, worldPositionStays: false);
593 }
594 continue;
595 }
596 object item = items[num];
597 Component comp = callbacks.Instantiate(item, layoutItems.transform);
598 callbacks.OnRedraw(item, comp, j);
599 ButtonPair item2 = new ButtonPair
600 {
601 obj = item,
602 component = comp
603 };
604 UIButton uIButton = comp as UIButton;
605 if (!uIButton)
606 {
607 UIItem uIItem = comp as UIItem;
608 if ((bool)uIItem)
609 {
610 uIButton = uIItem.button1;
611 }
612 }
613 if ((bool)uIButton)
614 {
615 if (numbering && (bool)uIButton.keyText)
616 {
617 uIButton.keyText.text = strNumber[j % strNumber.Length];
618 }
619 uIButton.onClick.AddListener(delegate
620 {
621 Root.OnSelect(this);
622 callbacks.OnClick(item, comp);
623 });
624 if (highlightIndex == j)
625 {
626 uIButton.DoHighlightTransition();
627 }
628 }
629 buttons.Add(item2);
630 }
631 AfterRefresh();
632 if ((bool)group)
633 {
635 }
637 {
638 UIButton componentInChildren = layoutItems.GetComponentInChildren<UIButton>();
639 if ((bool)componentInChildren)
640 {
641 componentInChildren.onClick.Invoke();
642 }
643 }
644 isBuilt = true;
645 SkinManager.tempSkin = tempSkin;
646 }
647
648 private void AfterRefresh()
649 {
651 if ((bool)paginationTop)
652 {
653 paginationTop.text1.text = page + 1 + " / " + maxPage;
654 }
655 if ((bool)paginationBottom)
656 {
657 paginationBottom.text1.text = page + 1 + " / " + maxPage;
658 }
660 OnRefresh();
661 layoutItems.RebuildLayout();
663 }
664
665 protected virtual void OnRefresh()
666 {
667 }
668
669 public void NextPage()
670 {
671 SetPage(page + 1);
672 }
673
674 public void PrevPage()
675 {
676 SetPage(page - 1);
677 }
678
679 public void SetPage(int i)
680 {
681 if (i < 0)
682 {
683 i = maxPage - 1;
684 }
685 else if (i >= maxPage)
686 {
687 i = 0;
688 }
689 page = i;
690 Refresh();
691 }
692
693 public override void OnMove(object o, object select = null)
694 {
695 List();
696 Select(select ?? o);
697 SE.Click();
698 }
699
700 public void Select(int index = 0, bool invoke = false)
701 {
702 if (buttons.Count < 0)
703 {
704 return;
705 }
706 ButtonPair buttonPair = buttons[Mathf.Clamp(index, 0, buttons.Count - 1)];
707 UIButton uIButton = buttonPair.component as UIButton;
708 if (!uIButton)
709 {
710 uIButton = (buttonPair.component as UIItem)?.button1;
711 }
712 if ((bool)uIButton)
713 {
714 if (invoke)
715 {
716 uIButton.onClick.Invoke();
717 }
718 if ((bool)uIButton.group)
719 {
720 uIButton.group.Select(uIButton);
721 }
722 else
723 {
724 uIButton.DoHighlightTransition();
725 }
726 }
727 }
728
729 public void Select(object obj, bool invoke = false)
730 {
731 for (int i = 0; i < items.Count; i++)
732 {
733 if (obj == items[i])
734 {
735 Select(i, invoke);
736 break;
737 }
738 }
739 }
740
741 public void Select<T>(Func<T, bool> func, bool invoke = false)
742 {
743 for (int i = 0; i < items.Count; i++)
744 {
745 if (func((T)items[i]))
746 {
747 Select(i, invoke);
748 break;
749 }
750 }
751 }
752
753 public void Sort()
754 {
755 if (callbacks.useSort)
756 {
757 items.Sort((object a, object b) => callbacks.OnSort(b, sortMode) - callbacks.OnSort(a, sortMode));
758 }
759 }
760
761 public void ChangeSort(SortMode m)
762 {
763 sortMode = m;
764 Sort();
765 Refresh();
766 }
767
768 public override void NextSort()
769 {
770 ChangeSort(sorts.NextItem(sortMode));
771 }
772
773 public override void List()
774 {
775 List(sortMode);
776 }
777
778 public override void List(SortMode sort)
779 {
780 List(sort);
781 }
782
783 public void List(bool refreshHighlight = false)
784 {
785 List(sortMode, refreshHighlight);
786 }
787
788 public void List(SortMode m, bool refreshHighlight = false)
789 {
790 sortMode = m;
791 Clear();
792 callbacks.OnList(sortMode);
793 Refresh(refreshHighlight);
794 }
795
796 public override void Redraw()
797 {
798 if (onBeforeRedraw != null)
799 {
801 }
802 int num = 0;
803 foreach (ButtonPair button in buttons)
804 {
805 callbacks.OnRedraw(button.obj, button.component, num);
806 num++;
807 }
808 if (onAfterRedraw != null)
809 {
811 }
812 }
813
814 public void BuildLayout()
815 {
816 GridLayoutGroup gridLayoutGroup = layoutItems as GridLayoutGroup;
817 if ((bool)gridLayoutGroup && buildLayout)
818 {
819 RectTransform rectTransform = layoutItems.Rect();
820 RectTransform rectTransform2 = layoutItems.Rect();
821 Vector2 vector = (layoutItems.Rect().anchorMax = new Vector2(0f, 1f));
822 Vector2 pivot = (rectTransform2.anchorMin = vector);
823 rectTransform.pivot = pivot;
824 rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, (float)rows * gridLayoutGroup.cellSize.y);
825 }
826 }
827
828 public override bool Contains(object item)
829 {
830 return items.Contains(item);
831 }
832
833 public T GetMold<T>() where T : Component
834 {
835 if ((bool)moldItem)
836 {
837 T component = moldItem.GetComponent<T>();
838 if ((bool)component)
839 {
840 layoutItems.DestroyChildren();
841 return component;
842 }
843 }
844 return layoutItems.CreateMold<T>(idMold);
845 }
846
847 public void OnDestroy()
848 {
850 if ((bool)transNoItem)
851 {
852 UnityEngine.Object.DestroyImmediate(transNoItem.gameObject);
853 }
854 }
855
856 public void ClearChildren()
857 {
858 if (usePool)
859 {
860 foreach (ButtonPair button in buttons)
861 {
863 }
864 }
865 layoutItems.DestroyChildren();
866 }
867
869 {
870 if (callbacks.CanDragReorder(drag.item))
871 {
872 dragTarget = drag.item;
873 dragBeginIndex = (dragHoverIndex = drag.transform.GetSiblingIndex());
874 onDragBegin?.Invoke(drag.item);
875 }
876 }
877
878 public void EndItemDrag(UIListDragItem drag)
879 {
880 if (dragTarget != null)
881 {
883 dragTarget = null;
884 callbacks.OnDragReorder(drag.item, a);
885 }
886 }
887
889 {
890 if (callbacks.CanDragReorder(drag.item) && dragTarget != null && dragTarget != drag.item)
891 {
892 dragHoverIndex = drag.transform.GetSiblingIndex();
893 GetPair(dragTarget).component?.transform.SetSiblingIndex(dragHoverIndex);
894 }
895 }
896
897 private void Update()
898 {
899 if (IsDragging)
900 {
902 }
903 }
904
906 {
907 if ((bool)dragViewport && (bool)dragScrollView)
908 {
909 RectTransformUtility.ScreenPointToLocalPointInRectangle(dragViewport, Input.mousePosition, null, out var localPoint);
910 float y = localPoint.y;
911 float num = dragViewport.rect.height * 0.5f;
912 float num2 = 0f;
913 if (y < 0f - num + dragEdgeSize)
914 {
915 float num3 = Mathf.InverseLerp(0f - num + dragEdgeSize, 0f - num, y);
916 num2 = (0f - dragScrollSpeed) * num3;
917 }
918 else if (y > num - dragEdgeSize)
919 {
920 float num4 = Mathf.InverseLerp(num - dragEdgeSize, num, y);
921 num2 = dragScrollSpeed * num4;
922 }
923 if (num2 != 0f)
924 {
925 float verticalNormalizedPosition = dragScrollView.verticalNormalizedPosition;
926 dragScrollView.verticalNormalizedPosition = Mathf.Clamp01(verticalNormalizedPosition + num2 * Time.unscaledDeltaTime);
927 }
928 }
929 }
930}
SkinType
Definition: SkinType.cs:2
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:833
void BuildLayout()
Definition: UIList.cs:814
void Select< T >(Func< T, bool > func, bool invoke=false)
Definition: UIList.cs:741
bool disableInstaClick
Definition: UIList.cs:255
int maxPage
Definition: UIList.cs:267
ItemHeight itemHeight
Definition: UIList.cs:259
LayoutGroup layoutItems
Definition: UIList.cs:327
UIList CreateChild(UIButton button)
Definition: UIList.cs:410
List< ButtonPair > buttons
Definition: UIList.cs:276
void NextPage()
Definition: UIList.cs:669
override void List(SortMode sort)
Definition: UIList.cs:778
void AutoScrollWhileDragging()
Definition: UIList.cs:905
void OnSelect(UIList activeList)
Definition: UIList.cs:467
void List(bool refreshHighlight=false)
Definition: UIList.cs:783
void OnDestroy()
Definition: UIList.cs:847
UISelectableGroup group
Definition: UIList.cs:237
string langNoItem
Definition: UIList.cs:221
void UpdateItemDragHover(UIListDragItem drag)
Definition: UIList.cs:888
int GetIndexOf(object item)
Definition: UIList.cs:365
override int ItemCount
Definition: UIList.cs:331
bool OnClickFolder(UIButton b, Action< UIList > onFold, bool refresh=true)
Definition: UIList.cs:420
bool ignoreNullObj
Definition: UIList.cs:257
virtual void OnRefresh()
Definition: UIList.cs:665
void BeginItemDrag(UIListDragItem drag)
Definition: UIList.cs:868
string idMold
Definition: UIList.cs:279
GridLayoutGroup gridLayout
Definition: UIList.cs:329
List< object > items
Definition: UIList.cs:273
override void Clear()
Definition: UIList.cs:404
override void NextSort()
Definition: UIList.cs:768
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:729
Dictionary< UIButton, UIList > children
Definition: UIList.cs:295
void EndItemDrag(UIListDragItem drag)
Definition: UIList.cs:878
void ClearChildren()
Definition: UIList.cs:856
void Select(int index=0, bool invoke=false)
Definition: UIList.cs:700
int rows
Definition: UIList.cs:223
override int RowCount
Definition: UIList.cs:333
bool fillEmpty
Definition: UIList.cs:229
void Update()
Definition: UIList.cs:897
int dragBeginIndex
Definition: UIList.cs:308
void KillChildren()
Definition: UIList.cs:445
UIList parent
Definition: UIList.cs:293
void RebuildLayoutInParent()
Definition: UIList.cs:454
bool usePage
Definition: UIList.cs:251
int highlightIndex
Definition: UIList.cs:304
void SetPage(int i)
Definition: UIList.cs:679
bool onlyDirectChildrenButtonForGroup
Definition: UIList.cs:249
bool reset
Definition: UIList.cs:289
override void OnMove(object o, object select=null)
Definition: UIList.cs:693
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:437
LayoutGroup _layoutItems
Definition: UIList.cs:239
Action< object > onDragBegin
Definition: UIList.cs:325
override void Add(object item)
Definition: UIList.cs:357
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:382
UIItem paginationBottom
Definition: UIList.cs:235
void List(SortMode m, bool refreshHighlight=false)
Definition: UIList.cs:788
ButtonPair GetPair(object item)
Definition: UIList.cs:370
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:387
void AddCollection(ICollection collection)
Definition: UIList.cs:349
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:479
void PrevPage()
Definition: UIList.cs:674
void ChangeSort(SortMode m)
Definition: UIList.cs:761
void Sort()
Definition: UIList.cs:753
float dragEdgeSize
Definition: UIList.cs:319
override void Redraw()
Definition: UIList.cs:796
bool IsDragging
Definition: UIList.cs:347
RectTransform dragViewport
Definition: UIList.cs:316
int page
Definition: UIList.cs:264
override void RemoveDynamic(object item)
Definition: UIList.cs:391
override void List()
Definition: UIList.cs:773
override bool Contains(object item)
Definition: UIList.cs:828
void AfterRefresh()
Definition: UIList.cs:648
int heightFix
Definition: UIList.cs:261
UIList Root
Definition: UIList.cs:336
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