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

Classes

struct  ButtonPair
 
class  Callback
 
interface  ICallback
 
class  RefObject
 

Public Types

enum  BGType {
  none , stripe , line , dot ,
  dot_long , grid , thin
}
 
enum  SortMode {
  ByNone , ByNumber , ByValue , ByCategory ,
  ByEquip , ByJob , ByRace , ByLevel ,
  ByWeight , ByPrice , ByElementParent , ByName ,
  ByID , ByWeightSingle , ByWorkk , ByFeat
}
 
enum  ItemHeight { DontChange , Default }
 

Public Member Functions

void AddCollection (ICollection collection)
 
override void Add (object item)
 
int GetIndexOf (object item)
 
ButtonPair GetPair (object item)
 
GetPair< T > (object item)
 
void AddDynamic (object item)
 
void RemoveDynamic (object item)
 
override void Clear ()
 
bool OnClickFolder (UIButton b, Action< UIList > onFold, bool refresh=true)
 
void RebuildLayoutInParent ()
 
virtual void Refresh (bool highlightLast=false)
 
void NextPage ()
 
void PrevPage ()
 
void SetPage (int i)
 
void OnMove (object o, object select=null)
 
void Select (int index=0, bool invoke=false)
 
void Select (object obj, bool invoke=false)
 
void Select< T > (Func< T, bool > func, bool invoke=false)
 
void Sort ()
 
void ChangeSort (SortMode m)
 
override void NextSort ()
 
override void List ()
 
override void List (SortMode sort)
 
void List (bool refreshHighlight=false)
 
void List (SortMode m, bool refreshHighlight=false)
 
override void Redraw ()
 
void BuildLayout ()
 
GetMold< T > ()
 
void OnDestroy ()
 
void ClearChildren ()
 
- Public Member Functions inherited from BaseList
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

string langNoItem
 
int rows
 
UISelectableGroup menu
 
UIListTopbar bar
 
bool fillEmpty
 
bool buildLayout
 
UIItem paginationTop
 
UIItem paginationBottom
 
UISelectableGroup group
 
LayoutGroup _layoutItems
 
Transform moldItem
 
bool selectFirst
 
bool invokeSelected
 
bool enableGroup = true
 
bool onlyDirectChildrenButtonForGroup
 
bool usePage
 
bool usePool
 
bool disableInstaClick = true
 
bool ignoreNullObj = true
 
ItemHeight itemHeight
 
int heightFix
 
int page
 
int maxPage
 
int itemsPerPage
 
List< object > items = new List<object>()
 
List< ButtonPairbuttons = new List<ButtonPair>()
 
string idMold
 
Action SETab
 
UIList moldList
 
UIList parent
 
Dictionary< UIButton, UIListchildren = new Dictionary<UIButton, UIList>()
 
- Public Attributes inherited from BaseList
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
 

Static Public Attributes

const int HeightDefault = 34
 
static string[] strNumber
 

Protected Member Functions

virtual void OnRefresh ()
 

Properties

LayoutGroup layoutItems [get]
 
GridLayoutGroup gridLayout [get]
 
override int ItemCount [get]
 
override int RowCount [get]
 
UIList Root [get]
 
- Properties inherited from BaseList
virtual int ItemCount [get]
 
virtual int RowCount [get]
 
SkinRootStatic Skin [get]
 

Private Member Functions

UIList CreateChild (UIButton button)
 
void RemoveChild (UIButton button)
 
void KillChildren ()
 
void OnSelect (UIList activeList)
 
void AfterRefresh ()
 

Private Attributes

bool initialized
 
bool reset
 
int highlightIndex
 

Additional Inherited Members

- Protected Attributes inherited from BaseList
Transform transNoItem
 

Detailed Description

Definition at line 8 of file UIList.cs.

Member Enumeration Documentation

◆ BGType

Enumerator
none 
stripe 
line 
dot 
dot_long 
grid 
thin 

Definition at line 15 of file UIList.cs.

◆ ItemHeight

Enumerator
DontChange 
Default 

Definition at line 46 of file UIList.cs.

◆ SortMode

Enumerator
ByNone 
ByNumber 
ByValue 
ByCategory 
ByEquip 
ByJob 
ByRace 
ByLevel 
ByWeight 
ByPrice 
ByElementParent 
ByName 
ByID 
ByWeightSingle 
ByWorkk 
ByFeat 

Definition at line 26 of file UIList.cs.

Member Function Documentation

◆ Add()

override void UIList.Add ( object  item)
inlinevirtual

Reimplemented from BaseList.

Definition at line 302 of file UIList.cs.

303 {
304 if (item != null || !ignoreNullObj)
305 {
306 items.Add(item);
307 }
308 }
bool ignoreNullObj
Definition: UIList.cs:225
List< object > items
Definition: UIList.cs:241

References ignoreNullObj, item, and items.

Referenced by DropdownGrid.Activate(), ContentPopulation.Add(), AddCollection(), DropdownGrid.Build(), DropdownGrid.BuildIngredients(), DramaCustomSequence.GetListGuide(), LayerInspect.GetMenuItems(), UIDragGridInfo.Init(), UIDragGridInfo.InitFuel(), LayerEditPlaylist.ListBGM.List(), Dialog.OnAfterInit(), LayerMod.OnInit(), ContentConfigInput.OnInstantiate(), ListPeopleBed.OnList(), ListPeopleBuySlave.OnList(), ListPeopleEmbark.OnList(), ListPeopleExpedition.OnList(), ListPeopleRevive.OnList(), ContentChronicle.OnSwitchContent(), ContentKeyItem.OnSwitchContent(), ContentQuest.OnSwitchContent(), ContentStatistics.OnSwitchContent(), ContentTop.OnSwitchContent(), LayerDebug.OnSwitchContent(), WidgetCurrentTool.RebuildSlots(), LayerCollectible.Refresh(), LayerHire.Refresh(), LayerTravel.Refresh(), UIDistribution.Refresh(), UIDragGridIngredients.Refresh(), UIRecipeInfo.Refresh(), WindowCharaMini.Refresh(), LayerHome.RefreshAreas(), PartialMapMenu.RefreshCategory(), LayerNewspaper.RefreshChat(), LayerEquip.RefreshEquipment(), WidgetEquip.RefreshEquipment(), LayerFactions.RefreshFactions(), ContentFaction.RefreshFactions(), LayerHome.RefreshFeat(), LayerQuestBoard.RefreshHire(), LayerLoadGame.RefreshList(), LayerMapList.RefreshList(), UIRecipeInfo.RefreshList(), ContentHomeLog.RefreshLog(), LayerEmbark.RefreshMembers(), LayerNewspaper.RefreshNews(), ContentPolicy.RefreshPolicyList(), LayerPolicy.RefreshPolicyList(), LayerQuestBoard.RefreshQuest(), LayerQuestBoard.RefreshRanking(), UIHomeInfo.RefreshReport(), ContentHomeReport.RefreshResources(), UIHomeInfo.RefreshResources(), WindowChara.RefreshSkill(), LayerHome.RefreshSpots(), WindowChara.RefreshStatic(), LayerTech.RefreshTech(), LayerHome.RefreshTech(), LayerNewspaper.RefreshVote(), LayerNewspaper.RefreshWeather(), WidgetSearch.RefreshWords(), LayerDistribution.SetContainer(), LayerDragGrid.SetInv(), LayerList.SetList2< TValue >(), LayerList.SetListCheck< TValue >(), LayerList.SetStringList(), LayerList.Show(), LayerShippingResult.Show(), and ContentRanking.SwitchRanking().

◆ AddCollection()

void UIList.AddCollection ( ICollection  collection)
inline

Definition at line 294 of file UIList.cs.

295 {
296 foreach (object item in collection)
297 {
298 Add(item);
299 }
300 }
override void Add(object item)
Definition: UIList.cs:302

References Add(), and item.

Referenced by LayerInspect.Refresh().

◆ AddDynamic()

void UIList.AddDynamic ( object  item)
inline

Definition at line 332 of file UIList.cs.

333 {
334 }

◆ AfterRefresh()

void UIList.AfterRefresh ( )
inlineprivate

Definition at line 592 of file UIList.cs.

593 {
595 if ((bool)paginationTop)
596 {
597 paginationTop.text1.text = page + 1 + " / " + maxPage;
598 }
599 if ((bool)paginationBottom)
600 {
601 paginationBottom.text1.text = page + 1 + " / " + maxPage;
602 }
604 OnRefresh();
605 layoutItems.RebuildLayout();
607 }
void RefreshNoItem()
Definition: BaseList.cs:69
UIList.ICallback callbacks
Definition: BaseList.cs:13
void RefreshBGGrid()
Definition: BaseList.cs:89
int maxPage
Definition: UIList.cs:235
LayoutGroup layoutItems
Definition: UIList.cs:274
virtual void OnRefresh()
Definition: UIList.cs:609
UIItem paginationTop
Definition: UIList.cs:201
UIItem paginationBottom
Definition: UIList.cs:203
int page
Definition: UIList.cs:232

References BaseList.callbacks, layoutItems, maxPage, OnRefresh(), page, paginationBottom, paginationTop, BaseList.RefreshBGGrid(), and BaseList.RefreshNoItem().

Referenced by Refresh(), and RemoveDynamic().

◆ BuildLayout()

void UIList.BuildLayout ( )
inline

Definition at line 758 of file UIList.cs.

759 {
760 GridLayoutGroup gridLayoutGroup = layoutItems as GridLayoutGroup;
761 if ((bool)gridLayoutGroup && buildLayout)
762 {
763 RectTransform rectTransform = layoutItems.Rect();
764 RectTransform rectTransform2 = layoutItems.Rect();
765 Vector2 vector2 = (layoutItems.Rect().anchorMax = new Vector2(0f, 1f));
766 Vector2 pivot = (rectTransform2.anchorMin = vector2);
767 rectTransform.pivot = pivot;
768 rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, (float)rows * gridLayoutGroup.cellSize.y);
769 }
770 }
int rows
Definition: UIList.cs:191
bool buildLayout
Definition: UIList.cs:199

References buildLayout, layoutItems, and rows.

Referenced by Refresh().

◆ ChangeSort()

void UIList.ChangeSort ( SortMode  m)
inline

Definition at line 705 of file UIList.cs.

706 {
707 sortMode = m;
708 Sort();
709 Refresh();
710 }
list. Refresh()
UIList.SortMode sortMode
Definition: BaseList.cs:33
void Sort()
Definition: UIList.cs:697

References Refresh(), Sort(), and BaseList.sortMode.

Referenced by NextSort(), WindowCharaMini.Refresh(), and WindowChara.RefreshSkill().

◆ Clear()

◆ ClearChildren()

void UIList.ClearChildren ( )
inline

Definition at line 795 of file UIList.cs.

796 {
797 if (usePool)
798 {
799 foreach (ButtonPair button in buttons)
800 {
801 PoolManager.TryDespawn(button.component);
802 }
803 }
804 layoutItems.DestroyChildren();
805 }
static bool TryDespawn(Component c)
Definition: PoolManager.cs:143
List< ButtonPair > buttons
Definition: UIList.cs:244
bool usePool
Definition: UIList.cs:221

References buttons, UIList.ButtonPair.component, layoutItems, PoolManager.TryDespawn(), and usePool.

Referenced by OnDestroy(), and Refresh().

◆ CreateChild()

UIList UIList.CreateChild ( UIButton  button)
inlineprivate

Definition at line 355 of file UIList.cs.

356 {
358 uIList.transform.SetSiblingIndex(button.transform.GetSiblingIndex() + 1);
359 uIList.callbacks = callbacks;
360 uIList.parent = this;
361 children.Add(button, uIList);
362 return uIList;
363 }
Definition: UIList.cs:9
Dictionary< UIButton, UIList > children
Definition: UIList.cs:263
UIList moldList
Definition: UIList.cs:259
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References BaseList.callbacks, children, layoutItems, moldList, and Util.

Referenced by OnClickFolder().

◆ GetIndexOf()

int UIList.GetIndexOf ( object  item)
inline

Definition at line 310 of file UIList.cs.

311 {
312 return items.IndexOf(item);
313 }

References item, and items.

◆ GetMold< T >()

T UIList.GetMold< T > ( )
inline
Type Constraints
T :Component 

Definition at line 772 of file UIList.cs.

772 : Component
773 {
774 if ((bool)moldItem)
775 {
776 T component = moldItem.GetComponent<T>();
777 if ((bool)component)
778 {
779 layoutItems.DestroyChildren();
780 return component;
781 }
782 }
783 return layoutItems.CreateMold<T>(idMold);
784 }
string idMold
Definition: UIList.cs:247
Transform moldItem
Definition: UIList.cs:209

References idMold, layoutItems, and moldItem.

◆ GetPair()

ButtonPair UIList.GetPair ( object  item)
inline

Definition at line 315 of file UIList.cs.

316 {
317 foreach (ButtonPair button in buttons)
318 {
319 if (button.obj == item)
320 {
321 return button;
322 }
323 }
324 return buttons[0];
325 }

References buttons, item, and UIList.ButtonPair.obj.

Referenced by GetPair< T >(), and RemoveDynamic().

◆ GetPair< T >()

T UIList.GetPair< T > ( object  item)
inline
Type Constraints
T :Component 

Definition at line 327 of file UIList.cs.

327 : Component
328 {
329 return GetPair(item).component as T;
330 }
ButtonPair GetPair(object item)
Definition: UIList.cs:315
Component component
Definition: UIList.cs:184

References UIList.ButtonPair.component, GetPair(), and item.

◆ KillChildren()

void UIList.KillChildren ( )
inlineprivate

Definition at line 390 of file UIList.cs.

391 {
392 foreach (UIList value in children.Values)
393 {
394 value.KillChildren();
395 }
396 UnityEngine.Object.DestroyImmediate(base.gameObject);
397 }
void KillChildren()
Definition: UIList.cs:390

References children, and KillChildren().

Referenced by KillChildren().

◆ List() [1/4]

◆ List() [2/4]

void UIList.List ( bool  refreshHighlight = false)
inline

Definition at line 727 of file UIList.cs.

728 {
729 List(sortMode, refreshHighlight);
730 }

References List(), and BaseList.sortMode.

◆ List() [3/4]

void UIList.List ( SortMode  m,
bool  refreshHighlight = false 
)
inline

Definition at line 732 of file UIList.cs.

733 {
734 sortMode = m;
735 Clear();
736 callbacks.OnList(sortMode);
737 Refresh(refreshHighlight);
738 }
override void Clear()
Definition: UIList.cs:349

References BaseList.callbacks, Clear(), Refresh(), and BaseList.sortMode.

◆ List() [4/4]

override void UIList.List ( SortMode  sort)
inlinevirtual

Reimplemented from BaseList.

Definition at line 722 of file UIList.cs.

723 {
724 List(sort);
725 }

References List().

◆ NextPage()

void UIList.NextPage ( )
inline

Definition at line 613 of file UIList.cs.

614 {
615 SetPage(page + 1);
616 }
void SetPage(int i)
Definition: UIList.cs:623

References page, and SetPage().

Referenced by Refresh().

◆ NextSort()

override void UIList.NextSort ( )
inlinevirtual

Reimplemented from BaseList.

Definition at line 712 of file UIList.cs.

713 {
714 ChangeSort(sorts.NextItem(sortMode));
715 }
UIList.SortMode[] sorts
Definition: BaseList.cs:15
void ChangeSort(SortMode m)
Definition: UIList.cs:705

References ChangeSort(), BaseList.sortMode, and BaseList.sorts.

◆ OnClickFolder()

bool UIList.OnClickFolder ( UIButton  b,
Action< UIList onFold,
bool  refresh = true 
)
inline

Definition at line 365 of file UIList.cs.

366 {
367 if (children.ContainsKey(b))
368 {
369 RemoveChild(b);
370 return true;
371 }
372 UIList uIList = CreateChild(b);
373 onFold(uIList);
374 uIList.Refresh();
375 if (refresh)
376 {
377 GetComponentInParent<ScrollRect>().RebuildLayout(recursive: true);
378 }
379 return false;
380 }
UIList CreateChild(UIButton button)
Definition: UIList.cs:355
void RemoveChild(UIButton button)
Definition: UIList.cs:382
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:424

References children, CreateChild(), Refresh(), and RemoveChild().

◆ OnDestroy()

void UIList.OnDestroy ( )
inline

Definition at line 786 of file UIList.cs.

787 {
789 if ((bool)transNoItem)
790 {
791 UnityEngine.Object.DestroyImmediate(transNoItem.gameObject);
792 }
793 }
Transform transNoItem
Definition: BaseList.cs:25
void ClearChildren()
Definition: UIList.cs:795

References ClearChildren(), and BaseList.transNoItem.

◆ OnMove()

void UIList.OnMove ( object  o,
object  select = null 
)
inline

Definition at line 637 of file UIList.cs.

638 {
639 List();
640 Select(select ?? o);
641 SE.Click();
642 }
void Select(int index=0, bool invoke=false)
Definition: UIList.cs:644

References List(), and Select().

◆ OnRefresh()

virtual void UIList.OnRefresh ( )
inlineprotectedvirtual

Definition at line 609 of file UIList.cs.

610 {
611 }

Referenced by AfterRefresh().

◆ OnSelect()

void UIList.OnSelect ( UIList  activeList)
inlineprivate

Definition at line 412 of file UIList.cs.

413 {
414 foreach (UIList value in children.Values)
415 {
416 value.OnSelect(activeList);
417 }
418 if (this != activeList)
419 {
420 group.Select(-1);
421 }
422 }
void OnSelect(UIList activeList)
Definition: UIList.cs:412
UISelectableGroup group
Definition: UIList.cs:205
void Select(UIButton button, bool check=true)

References children, group, OnSelect(), and UISelectableGroup.Select().

Referenced by OnSelect(), and Refresh().

◆ PrevPage()

void UIList.PrevPage ( )
inline

Definition at line 618 of file UIList.cs.

619 {
620 SetPage(page - 1);
621 }

References page, and SetPage().

Referenced by Refresh().

◆ RebuildLayoutInParent()

void UIList.RebuildLayoutInParent ( )
inline

Definition at line 399 of file UIList.cs.

400 {
401 this.RebuildLayout();
402 if ((bool)parent)
403 {
404 parent.RebuildLayout();
405 }
406 else
407 {
408 base.transform.parent.RebuildLayout();
409 }
410 }
UIList parent
Definition: UIList.cs:261

References parent.

Referenced by RemoveChild().

◆ Redraw()

override void UIList.Redraw ( )
inlinevirtual

Reimplemented from BaseList.

Definition at line 740 of file UIList.cs.

741 {
742 if (onBeforeRedraw != null)
743 {
745 }
746 int num = 0;
747 foreach (ButtonPair button in buttons)
748 {
749 callbacks.OnRedraw(button.obj, button.component, num);
750 num++;
751 }
752 if (onAfterRedraw != null)
753 {
755 }
756 }
Action onAfterRedraw
Definition: BaseList.cs:19
Action onBeforeRedraw
Definition: BaseList.cs:17

References buttons, BaseList.callbacks, UIList.ButtonPair.component, UIList.ButtonPair.obj, BaseList.onAfterRedraw, and BaseList.onBeforeRedraw.

Referenced by WidgetEquip._Redraw(), WidgetCurrentTool.CheckDirty(), DropdownGrid.OnChangeIngredient(), WidgetCurrentTool.RebuildSlots(), DropdownGrid.Redraw(), LayerEquip.Redraw(), UIMagicChest.Redraw(), UIInventory.RefreshAllList(), and UIRecipeInfo.RefreshImages().

◆ Refresh()

virtual void UIList.Refresh ( bool  highlightLast = false)
inlinevirtual

Reimplemented in UIListEx< T >.

Definition at line 424 of file UIList.cs.

425 {
426 if (!layoutItems)
427 {
428 return;
429 }
431 if (skinType != 0)
432 {
433 SkinManager.tempSkin = SkinManager.CurrentSkin.GetSkin(skinType);
434 }
435 highlightIndex = -1;
436 if (highlightLast)
437 {
438 UIButton componentOf = InputModuleEX.GetComponentOf<UIButton>();
439 if ((bool)componentOf)
440 {
441 Component component = componentOf.transform.parent.GetComponent<UIItem>();
442 if (component == null)
443 {
444 component = componentOf;
445 }
446 for (int i = 0; i < buttons.Count; i++)
447 {
448 if (buttons[i].component == component)
449 {
450 highlightIndex = i;
451 break;
452 }
453 }
454 }
455 }
456 callbacks.SetList(this);
457 if (!enableGroup && (bool)group)
458 {
459 UnityEngine.Object.DestroyImmediate(group);
460 }
461 if (!usePage)
462 {
463 maxPage = 9999999;
464 }
465 callbacks.CreateMold();
466 if (itemHeight == ItemHeight.Default)
467 {
468 RectTransform rectTransform = callbacks.GetMold().Rect();
469 rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, 34 + heightFix);
470 }
471 if (!initialized || reset)
472 {
473 if (sortMode != 0)
474 {
475 Sort();
476 }
477 if (!initialized)
478 {
479 if ((bool)paginationTop && (bool)paginationTop.button1)
480 {
481 paginationTop.button1.onClick.AddListener(PrevPage);
482 paginationTop.button2.onClick.AddListener(NextPage);
483 }
484 if ((bool)paginationBottom && (bool)paginationBottom.button1)
485 {
486 paginationBottom.button1.onClick.AddListener(PrevPage);
487 paginationBottom.button2.onClick.AddListener(NextPage);
488 }
489 _ = (bool)bar;
490 }
491 initialized = true;
492 reset = false;
493 }
494 children.Clear();
495 buttons.Clear();
496 GridLayoutGroup gridLayoutGroup = layoutItems as GridLayoutGroup;
497 BuildLayout();
498 if (usePage)
499 {
500 if ((bool)gridLayoutGroup)
501 {
502 itemsPerPage = gridLayoutGroup.constraintCount;
503 }
504 else
505 {
507 }
508 this.Rect().RebuildLayout();
509 this.Rect().ForceUpdateRectTransforms();
510 Canvas.ForceUpdateCanvases();
511 float y = RectTransformUtility.PixelAdjustRect(this.Rect(), GetComponentInParent<Canvas>()).size.y;
512 float y2 = callbacks.GetMold().Rect().sizeDelta.y;
513 Debug.Log(y2);
514 Debug.Log(y);
515 itemsPerPage = (int)(y / y2);
516 }
517 else
518 {
519 itemsPerPage = 99999;
520 }
522 maxPage = (items.Count - 1) / itemsPerPage + 1;
523 if (usePage)
524 {
525 while (page > 0 && page * itemsPerPage >= items.Count)
526 {
527 page--;
528 }
529 }
530 for (int j = 0; j < itemsPerPage; j++)
531 {
532 int num = page * itemsPerPage + j;
533 if (num >= items.Count)
534 {
535 if (fillEmpty)
536 {
537 new GameObject().AddComponent<RectTransform>().SetParent(layoutItems.transform, worldPositionStays: false);
538 }
539 continue;
540 }
541 object item = items[num];
542 Component comp = callbacks.Instantiate(item, layoutItems.transform);
543 callbacks.OnRedraw(item, comp, j);
544 ButtonPair buttonPair = default(ButtonPair);
545 buttonPair.obj = item;
546 buttonPair.component = comp;
547 ButtonPair item2 = buttonPair;
548 UIButton uIButton = comp as UIButton;
549 if (!uIButton)
550 {
551 UIItem uIItem = comp as UIItem;
552 if ((bool)uIItem)
553 {
554 uIButton = uIItem.button1;
555 }
556 }
557 if ((bool)uIButton)
558 {
559 if (numbering && (bool)uIButton.keyText)
560 {
561 uIButton.keyText.text = strNumber[j % strNumber.Length];
562 }
563 uIButton.onClick.AddListener(delegate
564 {
565 Root.OnSelect(this);
566 callbacks.OnClick(item, comp);
567 });
568 if (highlightIndex == j)
569 {
570 uIButton.DoHighlightTransition();
571 }
572 }
573 buttons.Add(item2);
574 }
575 AfterRefresh();
576 if ((bool)group)
577 {
579 }
581 {
582 UIButton componentInChildren = layoutItems.GetComponentInChildren<UIButton>();
583 if ((bool)componentInChildren)
584 {
585 componentInChildren.onClick.Invoke();
586 }
587 }
588 isBuilt = true;
589 SkinManager.tempSkin = tempSkin;
590 }
bool isBuilt
Definition: BaseList.cs:36
bool numbering
Definition: BaseList.cs:23
SkinType skinType
Definition: BaseList.cs:27
static SkinRootStatic CurrentSkin
Definition: SkinManager.cs:82
static SkinRootStatic tempSkin
Definition: SkinManager.cs:63
SkinRootStatic GetSkin(SkinType type)
Definition: UIItem.cs:5
UIButton button1
Definition: UIItem.cs:18
UIButton button2
Definition: UIItem.cs:20
void BuildLayout()
Definition: UIList.cs:758
ItemHeight itemHeight
Definition: UIList.cs:227
void NextPage()
Definition: UIList.cs:613
bool invokeSelected
Definition: UIList.cs:213
UIListTopbar bar
Definition: UIList.cs:195
ItemHeight
Definition: UIList.cs:47
int itemsPerPage
Definition: UIList.cs:238
bool selectFirst
Definition: UIList.cs:211
bool fillEmpty
Definition: UIList.cs:197
bool usePage
Definition: UIList.cs:219
int highlightIndex
Definition: UIList.cs:272
bool onlyDirectChildrenButtonForGroup
Definition: UIList.cs:217
bool initialized
Definition: UIList.cs:255
static string[] strNumber
Definition: UIList.cs:265
bool enableGroup
Definition: UIList.cs:215
void PrevPage()
Definition: UIList.cs:618
void AfterRefresh()
Definition: UIList.cs:592
int heightFix
Definition: UIList.cs:229
UIList Root
Definition: UIList.cs:283
virtual void Init(int index=0, UnityAction< int > action=null, bool directChildren=false)

References AfterRefresh(), bar, BuildLayout(), UIItem.button1, UIItem.button2, buttons, BaseList.callbacks, children, ClearChildren(), SkinManager.CurrentSkin, Debug, UIButton.DoHighlightTransition(), enableGroup, fillEmpty, SkinRootStatic.GetSkin(), group, heightFix, highlightIndex, UISelectableGroup.Init(), initialized, invokeSelected, BaseList.isBuilt, item, itemHeight, items, itemsPerPage, UIButton.keyText, layoutItems, maxPage, NextPage(), BaseList.numbering, onlyDirectChildrenButtonForGroup, OnSelect(), page, paginationBottom, paginationTop, PrevPage(), reset, Root, rows, selectFirst, BaseList.skinType, Sort(), BaseList.sortMode, strNumber, SkinManager.tempSkin, and usePage.

Referenced by DropdownGrid.Activate(), DropdownGrid.Build(), DropdownGrid.BuildIngredients(), Dialog.OnAfterInit(), OnClickFolder(), ContentChronicle.OnSwitchContent(), ContentStatistics.OnSwitchContent(), ContentTop.OnSwitchContent(), LayerDebug.OnSwitchContent(), WidgetCurrentTool.RebuildSlots(), LayerCollectible.Refresh(), LayerHire.Refresh(), LayerInspect.Refresh(), UIDistribution.Refresh(), UIRecipeInfo.Refresh(), LayerGacha.RefreshCoin(), LayerFactions.RefreshFactions(), ContentFaction.RefreshFactions(), LayerQuestBoard.RefreshHire(), LayerLoadGame.RefreshList(), UIRecipeInfo.RefreshList(), ContentHomeLog.RefreshLog(), LayerEmbark.RefreshMembers(), LayerQuestBoard.RefreshQuest(), LayerQuestBoard.RefreshRanking(), WindowChara.RefreshStatic(), LayerDistribution.SetContainer(), LayerShippingResult.Show(), and ContentRanking.SwitchRanking().

◆ RemoveChild()

void UIList.RemoveChild ( UIButton  button)
inlineprivate

Definition at line 382 of file UIList.cs.

383 {
384 children[button].KillChildren();
385 children.Remove(button);
387 GetComponentInParent<ScrollRect>().RebuildLayout(recursive: true);
388 }
void RebuildLayoutInParent()
Definition: UIList.cs:399

References children, and RebuildLayoutInParent().

Referenced by OnClickFolder().

◆ RemoveDynamic()

void UIList.RemoveDynamic ( object  item)
inline

Definition at line 336 of file UIList.cs.

337 {
338 BaseCore.Instance.StopEventSystem(GetPair(item).component, delegate
339 {
340 items.Remove(item);
341 ButtonPair item2 = buttons.First((ButtonPair a) => a.obj == item);
342 buttons.IndexOf(item2);
343 buttons.Remove(item2);
344 UnityEngine.Object.DestroyImmediate(item2.component.gameObject);
345 AfterRefresh();
346 });
347 }
static BaseCore Instance
Definition: BaseCore.cs:11
virtual void StopEventSystem(float duration=0.2f)
Definition: BaseCore.cs:72

References AfterRefresh(), buttons, UIList.ButtonPair.component, GetPair(), BaseCore.Instance, item, items, UIList.ButtonPair.obj, and BaseCore.StopEventSystem().

Referenced by ListOwner< T1, T2 >.MoveToOther().

◆ Select() [1/2]

void UIList.Select ( int  index = 0,
bool  invoke = false 
)
inline

Definition at line 644 of file UIList.cs.

645 {
646 if (buttons.Count < 0)
647 {
648 return;
649 }
650 ButtonPair buttonPair = buttons[Mathf.Clamp(index, 0, buttons.Count - 1)];
651 UIButton uIButton = buttonPair.component as UIButton;
652 if (!uIButton)
653 {
654 uIButton = (buttonPair.component as UIItem)?.button1;
655 }
656 if ((bool)uIButton)
657 {
658 if (invoke)
659 {
660 uIButton.onClick.Invoke();
661 }
662 if ((bool)uIButton.group)
663 {
664 uIButton.group.Select(uIButton);
665 }
666 else
667 {
668 uIButton.DoHighlightTransition();
669 }
670 }
671 }
void DoHighlightTransition(bool instant=false)
Definition: UIButton.cs:526
UISelectableGroup group
Definition: UIButton.cs:126

References buttons, UIButton.DoHighlightTransition(), UIButton.group, and UISelectableGroup.Select().

Referenced by PartialMapMenu.Init(), LayerResource.OnInit(), OnMove(), ContentQuest.OnSwitchContent(), PartialMapMenu.RefreshCategory(), Select(), and Select< T >().

◆ Select() [2/2]

void UIList.Select ( object  obj,
bool  invoke = false 
)
inline

Definition at line 673 of file UIList.cs.

674 {
675 for (int i = 0; i < items.Count; i++)
676 {
677 if (obj == items[i])
678 {
679 Select(i, invoke);
680 break;
681 }
682 }
683 }

References items, and Select().

◆ Select< T >()

void UIList.Select< T > ( Func< T, bool >  func,
bool  invoke = false 
)
inline

Definition at line 685 of file UIList.cs.

686 {
687 for (int i = 0; i < items.Count; i++)
688 {
689 if (func((T)items[i]))
690 {
691 Select(i, invoke);
692 break;
693 }
694 }
695 }

References items, and Select().

◆ SetPage()

void UIList.SetPage ( int  i)
inline

Definition at line 623 of file UIList.cs.

624 {
625 if (i < 0)
626 {
627 i = maxPage - 1;
628 }
629 else if (i >= maxPage)
630 {
631 i = 0;
632 }
633 page = i;
634 Refresh();
635 }

References maxPage, page, and Refresh().

Referenced by NextPage(), and PrevPage().

◆ Sort()

void UIList.Sort ( )
inline

Definition at line 697 of file UIList.cs.

698 {
699 if (callbacks.useSort)
700 {
701 items.Sort((object a, object b) => callbacks.OnSort(b, sortMode) - callbacks.OnSort(a, sortMode));
702 }
703 }

References BaseList.callbacks, items, and BaseList.sortMode.

Referenced by ChangeSort(), DramaCustomSequence.GetListGuide(), UIDragGridIngredients.Refresh(), Refresh(), and LayerQuestBoard.RefreshRanking().

Member Data Documentation

◆ _layoutItems

LayoutGroup UIList._layoutItems

Definition at line 207 of file UIList.cs.

◆ bar

UIListTopbar UIList.bar

Definition at line 195 of file UIList.cs.

Referenced by Refresh().

◆ buildLayout

bool UIList.buildLayout

Definition at line 199 of file UIList.cs.

Referenced by BuildLayout().

◆ buttons

◆ children

Dictionary<UIButton, UIList> UIList.children = new Dictionary<UIButton, UIList>()

Definition at line 263 of file UIList.cs.

Referenced by CreateChild(), KillChildren(), OnClickFolder(), OnSelect(), Refresh(), and RemoveChild().

◆ disableInstaClick

bool UIList.disableInstaClick = true

Definition at line 223 of file UIList.cs.

Referenced by UIList.Callback< T1, T2 >.Instantiate().

◆ enableGroup

bool UIList.enableGroup = true

Definition at line 215 of file UIList.cs.

Referenced by Refresh().

◆ fillEmpty

bool UIList.fillEmpty

Definition at line 197 of file UIList.cs.

Referenced by Refresh().

◆ group

UISelectableGroup UIList.group

Definition at line 205 of file UIList.cs.

Referenced by UIRecipeInfo.OnRotate(), OnSelect(), UIRecipeInfo.Refresh(), and Refresh().

◆ HeightDefault

const int UIList.HeightDefault = 34
static

Definition at line 253 of file UIList.cs.

◆ heightFix

int UIList.heightFix

Definition at line 229 of file UIList.cs.

Referenced by Refresh().

◆ highlightIndex

int UIList.highlightIndex
private

Definition at line 272 of file UIList.cs.

Referenced by Refresh().

◆ idMold

string UIList.idMold

Definition at line 247 of file UIList.cs.

Referenced by GetMold< T >().

◆ ignoreNullObj

bool UIList.ignoreNullObj = true

Definition at line 225 of file UIList.cs.

Referenced by Add().

◆ initialized

bool UIList.initialized
private

Definition at line 255 of file UIList.cs.

Referenced by Refresh().

◆ invokeSelected

bool UIList.invokeSelected

Definition at line 213 of file UIList.cs.

Referenced by Refresh().

◆ itemHeight

ItemHeight UIList.itemHeight

Definition at line 227 of file UIList.cs.

Referenced by Refresh().

◆ items

◆ itemsPerPage

int UIList.itemsPerPage

Definition at line 238 of file UIList.cs.

Referenced by Refresh().

◆ langNoItem

string UIList.langNoItem

Definition at line 189 of file UIList.cs.

◆ maxPage

int UIList.maxPage

Definition at line 235 of file UIList.cs.

Referenced by AfterRefresh(), Refresh(), and SetPage().

◆ menu

UISelectableGroup UIList.menu

Definition at line 193 of file UIList.cs.

◆ moldItem

Transform UIList.moldItem

Definition at line 209 of file UIList.cs.

Referenced by GetMold< T >().

◆ moldList

UIList UIList.moldList

Definition at line 259 of file UIList.cs.

Referenced by CreateChild().

◆ onlyDirectChildrenButtonForGroup

bool UIList.onlyDirectChildrenButtonForGroup

Definition at line 217 of file UIList.cs.

Referenced by Refresh().

◆ page

int UIList.page

Definition at line 232 of file UIList.cs.

Referenced by AfterRefresh(), NextPage(), PrevPage(), Refresh(), and SetPage().

◆ paginationBottom

UIItem UIList.paginationBottom

Definition at line 203 of file UIList.cs.

Referenced by AfterRefresh(), and Refresh().

◆ paginationTop

UIItem UIList.paginationTop

Definition at line 201 of file UIList.cs.

Referenced by AfterRefresh(), and Refresh().

◆ parent

◆ reset

bool UIList.reset
private

Definition at line 257 of file UIList.cs.

Referenced by Clear(), and Refresh().

◆ rows

int UIList.rows

Definition at line 191 of file UIList.cs.

Referenced by BuildLayout(), and Refresh().

◆ selectFirst

bool UIList.selectFirst

Definition at line 211 of file UIList.cs.

Referenced by Refresh().

◆ SETab

Action UIList.SETab
Initial value:
= delegate
{
}

Definition at line 249 of file UIList.cs.

◆ strNumber

string [] UIList.strNumber
static
Initial value:
= new string[26]
{
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
"k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
"u", "v", "w", "x", "y", "z"
}

Definition at line 265 of file UIList.cs.

Referenced by Refresh().

◆ usePage

bool UIList.usePage

Definition at line 219 of file UIList.cs.

Referenced by Refresh().

◆ usePool

bool UIList.usePool

Definition at line 221 of file UIList.cs.

Referenced by ClearChildren().

Property Documentation

◆ gridLayout

GridLayoutGroup UIList.gridLayout
get

Definition at line 276 of file UIList.cs.

◆ ItemCount

override int UIList.ItemCount
get

Definition at line 278 of file UIList.cs.

◆ layoutItems

LayoutGroup UIList.layoutItems
get

Definition at line 274 of file UIList.cs.

Referenced by AfterRefresh(), BuildLayout(), ClearChildren(), CreateChild(), GetMold< T >(), and Refresh().

◆ Root

UIList UIList.Root
get

Definition at line 282 of file UIList.cs.

283 {
284 get
285 {
286 if (!parent)
287 {
288 return this;
289 }
290 return parent.Root;
291 }
292 }

Referenced by Refresh().

◆ RowCount

override int UIList.RowCount
get

Definition at line 280 of file UIList.cs.


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