Elin Decompiled Documentation EA 23.265 Nightly Patch 2
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
 
static Dictionary< int, Sprite > sprites = new Dictionary<int, Sprite>()
 
static Dictionary< int, Sprite > spritesFull = new Dictionary<int, Sprite>()
 

Private Member Functions

void OnDestroy ()
 

Private Attributes

bool first = true
 

Detailed Description

Definition at line 7 of file ContentGallery.cs.

Member Function Documentation

◆ OnClickHelp()

void ContentGallery.OnClickHelp ( )
inline

Definition at line 130 of file ContentGallery.cs.

131 {
132 LayerHelp.Toggle("other", "gallery");
133 }
static void Toggle(string idFile, string idTopic=null)
Definition: LayerHelp.cs:32

References LayerHelp.Toggle().

◆ OnDestroy()

void ContentGallery.OnDestroy ( )
inlineprivate

Definition at line 143 of file ContentGallery.cs.

144 {
146 foreach (Sprite item in sprites.Values.Concat(spritesFull.Values))
147 {
148 Object.Destroy(item.texture);
149 Object.Destroy(item);
150 }
151 sprites.Clear();
152 spritesFull.Clear();
153 }
static int lastPage
static Dictionary< int, Sprite > sprites
static Dictionary< int, Sprite > spritesFull
int currentPage
Definition: UIBook.cs:264

References book, UIBook.currentPage, item, lastPage, sprites, and spritesFull.

◆ OnSwitchContent()

override void ContentGallery.OnSwitchContent ( int  idTab)
inlinevirtual

Reimplemented from UIContent.

Definition at line 83 of file ContentGallery.cs.

84 {
85 if (!first)
86 {
87 return;
88 }
90 {
91 EClass.player.sketches.Clear();
92 foreach (int key in EClass.core.refs.dictSketches2.Keys)
93 {
94 EClass.player.sketches.Add(key);
95 }
96 }
97 Refresh();
98 first = false;
99 }
bool allArt
Definition: CoreDebug.cs:197
UD_Int_String dictSketches2
Definition: CoreRef.cs:415
CoreRef refs
Definition: Core.cs:51
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7
static Player player
Definition: EClass.cs:13
static CoreDebug debug
Definition: EClass.cs:49
HashSet< int > sketches
Definition: Player.cs:1070
ICollection< TKey > Keys
Definition: UDictionary.cs:25

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

◆ Refresh()

void ContentGallery.Refresh ( )
inline

Definition at line 101 of file ContentGallery.cs.

102 {
103 book.pages.Clear();
104 GridLayoutGroup[] array = grids;
105 for (int i = 0; i < array.Length; i++)
106 {
107 array[i].cellSize = gridSize[listMode ? 1 : 0];
108 }
109 Page page = new Page();
110 List<int> list = EClass.player.sketches.ToList();
111 list.Sort((int a, int b) => a - b);
112 foreach (int item in list)
113 {
114 page.ids.Add(item.ToString() ?? "");
115 if (page.ids.Count >= (listMode ? 8 : 2))
116 {
117 book.AddPage(page);
118 page = new Page();
119 }
120 }
121 if (page.ids.Count > 0)
122 {
123 book.AddPage(page);
124 }
125 book.currentPage = lastPage;
126 book.Show();
127 textCollected.SetText("sketch_collected".lang((list.Count * 100 / EClass.core.refs.dictSketches2.Count()).ToString() ?? ""));
128 }
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.dictSketches2, 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 135 of file ContentGallery.cs.

136 {
138 lastPage = (listMode ? (book.currentPage / 4) : (book.currentPage * 4));
139 SE.Tab();
140 Refresh();
141 }

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

Member Data Documentation

◆ book

UIBook ContentGallery.book

Definition at line 73 of file ContentGallery.cs.

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

◆ first

bool ContentGallery.first = true
private

Definition at line 81 of file ContentGallery.cs.

Referenced by OnSwitchContent().

◆ grids

GridLayoutGroup [] ContentGallery.grids

Definition at line 77 of file ContentGallery.cs.

Referenced by Refresh().

◆ gridSize

Vector2 [] ContentGallery.gridSize

Definition at line 79 of file ContentGallery.cs.

Referenced by Refresh().

◆ imageBig

Image ContentGallery.imageBig

Definition at line 71 of file ContentGallery.cs.

◆ lastPage

int ContentGallery.lastPage
static

Definition at line 61 of file ContentGallery.cs.

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

◆ listMode

bool ContentGallery.listMode
static

Definition at line 63 of file ContentGallery.cs.

Referenced by Refresh(), and ToggleMode().

◆ sprites

Dictionary<int, Sprite> ContentGallery.sprites = new Dictionary<int, Sprite>()
static

Definition at line 65 of file ContentGallery.cs.

Referenced by ContentGallery.Page.BuildNote(), and OnDestroy().

◆ spritesFull

Dictionary<int, Sprite> ContentGallery.spritesFull = new Dictionary<int, Sprite>()
static

Definition at line 67 of file ContentGallery.cs.

Referenced by ContentGallery.Page.BuildNote(), and OnDestroy().

◆ textCollected

UIText ContentGallery.textCollected

Definition at line 75 of file ContentGallery.cs.

Referenced by Refresh().

◆ transBig

Transform ContentGallery.transBig

Definition at line 69 of file ContentGallery.cs.


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