Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ContentGallery Class Reference
Inheritance diagram for ContentGallery:
EContent UIContent UINote

Classes

class  Page
 

Public Member Functions

override void OnSwitchContent (int idTab)
 
void Refresh ()
 
void OnClickHelp ()
 
void ToggleMode ()
 
- Public Member Functions inherited from UIContent
virtual void OnSwitchContent (int idTab)
 
virtual void OnInstantiate ()
 
- Public Member Functions inherited from UINote
void Clear ()
 
void Build ()
 
void Space (int sizeY=0, int sizeX=1)
 
UINote AddNote (string id)
 
UIItem AddHeader (string text, Sprite sprite=null)
 
UIItem AddHeaderCard (string text, Sprite sprite=null)
 
UIItem AddHeaderTopic (string text, Sprite sprite=null)
 
UIItem AddHeader (string id, string text, Sprite sprite=null)
 
UIItem AddText (string text, FontColor color=FontColor.DontChange)
 
UIItem AddText (string id, string text, FontColor color=FontColor.DontChange)
 
UIItem AddText (string id, string text, Color color)
 
UIItem AddItem (string id)
 
UIItem AddTopic (string id, string text, string value=null)
 
UIItem AddTopic (string text, string value=null)
 
void AddImage (Sprite sprite)
 
void AddImage (string idFile)
 
UIButton AddButton (string text, Action onClick)
 
UIButton AddButtonLink (string text, string url)
 
UIDropdown AddDropdown (string id="DropdownDefault")
 
UIButton AddToggle (string idLang="", bool isOn=false, Action< bool > action=null)
 
Transform AddPrefab (string path)
 
AddExtra< T > (string path)
 

Public Attributes

Transform transBig
 
Image imageBig
 
UIBook book
 
UIText textCollected
 
GridLayoutGroup[] grids
 
Vector2[] gridSize
 
- Public Attributes inherited from UINote
RectTransform target
 
UINoteProfile prof
 
SkinType skinType
 
string idDefaultText
 
LayoutGroup layout
 
RectTransform cur
 
bool extraRebuild
 

Static Public Attributes

static int lastPage
 
static bool listMode
 

Private Member Functions

void OnDestroy ()
 

Private Attributes

bool first = true
 

Detailed Description

Definition at line 6 of file ContentGallery.cs.

Member Function Documentation

◆ OnClickHelp()

void ContentGallery.OnClickHelp ( )
inline

Definition at line 102 of file ContentGallery.cs.

103 {
104 LayerHelp.Toggle("other", "gallery");
105 }
static void Toggle(string idFile, string idTopic=null)
Definition: LayerHelp.cs:32

References LayerHelp.Toggle().

◆ OnDestroy()

void ContentGallery.OnDestroy ( )
inlineprivate

Definition at line 115 of file ContentGallery.cs.

116 {
118 }
static int lastPage
int currentPage
Definition: UIBook.cs:264

References book, UIBook.currentPage, and lastPage.

◆ OnSwitchContent()

override void ContentGallery.OnSwitchContent ( int  idTab)
inlinevirtual

Reimplemented from UIContent.

Definition at line 55 of file ContentGallery.cs.

56 {
57 if (!first)
58 {
59 return;
60 }
62 {
63 EClass.player.sketches.Clear();
64 foreach (int key in EClass.core.refs.dictSketches.Keys)
65 {
66 EClass.player.sketches.Add(key);
67 }
68 }
69 Refresh();
70 first = false;
71 }
bool allArt
Definition: CoreDebug.cs:196
UD_Int_String dictSketches
Definition: CoreRef.cs:397
CoreRef refs
Definition: Core.cs:51
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
static Player player
Definition: EClass.cs:12
static CoreDebug debug
Definition: EClass.cs:48
HashSet< int > sketches
Definition: Player.cs:871
ICollection< TKey > Keys
Definition: UDictionary.cs:25

References CoreDebug.allArt, EClass.core, EClass.debug, CoreRef.dictSketches, first, UDictionary< TKey, TValue >.Keys, EClass.player, Refresh(), Core.refs, and Player.sketches.

◆ Refresh()

void ContentGallery.Refresh ( )
inline

Definition at line 73 of file ContentGallery.cs.

74 {
75 book.pages.Clear();
76 GridLayoutGroup[] array = grids;
77 for (int i = 0; i < array.Length; i++)
78 {
79 array[i].cellSize = gridSize[listMode ? 1 : 0];
80 }
81 Page page = new Page();
82 List<int> list = EClass.player.sketches.ToList();
83 list.Sort((int a, int b) => a - b);
84 foreach (int item in list)
85 {
86 page.ids.Add(item.ToString() ?? "");
87 if (page.ids.Count >= (listMode ? 8 : 2))
88 {
89 book.AddPage(page);
90 page = new Page();
91 }
92 }
93 if (page.ids.Count > 0)
94 {
95 book.AddPage(page);
96 }
97 book.currentPage = lastPage;
98 book.Show();
99 textCollected.SetText("sketch_collected".lang((list.Count * 100 / EClass.core.refs.dictSketches.Count()).ToString() ?? ""));
100 }
static bool listMode
Vector2[] gridSize
GridLayoutGroup[] grids
UIText textCollected
void AddPage(Page page)
Definition: UIBook.cs:538
void Show(string _idFile=null, string _idTopic=null, string title=null, BookList.Item _bookItem=null)
Definition: UIBook.cs:457
List< Page > pages
Definition: UIBook.cs:266
void SetText(string s)
Definition: UIText.cs:159

References UIBook.AddPage(), book, EClass.core, UDictionary< TKey, TValue >.Count, CoreRef.dictSketches, grids, gridSize, item, lastPage, listMode, UIBook.pages, EClass.player, Core.refs, UIText.SetText(), UIBook.Show(), Player.sketches, and textCollected.

Referenced by OnSwitchContent(), and ToggleMode().

◆ ToggleMode()

void ContentGallery.ToggleMode ( )
inline

Definition at line 107 of file ContentGallery.cs.

108 {
110 lastPage = (listMode ? (book.currentPage / 4) : (book.currentPage * 4));
111 SE.Tab();
112 Refresh();
113 }

References book, UIBook.currentPage, lastPage, listMode, and Refresh().

Member Data Documentation

◆ book

UIBook ContentGallery.book

Definition at line 45 of file ContentGallery.cs.

Referenced by OnDestroy(), Refresh(), and ToggleMode().

◆ first

bool ContentGallery.first = true
private

Definition at line 53 of file ContentGallery.cs.

Referenced by OnSwitchContent().

◆ grids

GridLayoutGroup [] ContentGallery.grids

Definition at line 49 of file ContentGallery.cs.

Referenced by Refresh().

◆ gridSize

Vector2 [] ContentGallery.gridSize

Definition at line 51 of file ContentGallery.cs.

Referenced by Refresh().

◆ imageBig

Image ContentGallery.imageBig

Definition at line 43 of file ContentGallery.cs.

◆ lastPage

int ContentGallery.lastPage
static

Definition at line 37 of file ContentGallery.cs.

Referenced by OnDestroy(), Refresh(), and ToggleMode().

◆ listMode

bool ContentGallery.listMode
static

Definition at line 39 of file ContentGallery.cs.

Referenced by Refresh(), and ToggleMode().

◆ textCollected

UIText ContentGallery.textCollected

Definition at line 47 of file ContentGallery.cs.

Referenced by Refresh().

◆ transBig

Transform ContentGallery.transBig

Definition at line 41 of file ContentGallery.cs.


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