Elin Decompiled Documentation EA 23.265 Nightly Patch 2
Loading...
Searching...
No Matches
ContentGallery.Page Class Reference
Inheritance diagram for ContentGallery.Page:
UIBook.Page

Classes

class  Item
 

Public Member Functions

override void BuildNote (UINote n, string idTopic)
 
virtual void BuildNote (UINote n, string idTopic)
 

Public Attributes

List< string > ids = new List<string>()
 
- Public Attributes inherited from UIBook.Page
UIBook book
 
int idx
 
List< string > lines = new List<string>()
 

Detailed Description

Definition at line 9 of file ContentGallery.cs.

Member Function Documentation

◆ BuildNote()

override void ContentGallery.Page.BuildNote ( UINote  n,
string  idTopic 
)
inlinevirtual

Reimplemented from UIBook.Page.

Definition at line 18 of file ContentGallery.cs.

19 {
20 foreach (string id in ids)
21 {
22 int idx = id.ToInt();
23 string path = GalleryFlattenAndRename.root + "/" + EClass.core.refs.dictSketches2[idx];
24 if (!File.Exists(path))
25 {
26 EClass.ui.Say("Full Image not found: " + path);
27 continue;
28 }
29 if (!File.Exists(path + "_t"))
30 {
31 EClass.ui.Say("Thumbnail not found: " + path);
32 continue;
33 }
34 UIItem uIItem = n.AddItem("ItemGallery");
35 Sprite sprite = sprites.TryGetValue(idx);
36 if (!sprite)
37 {
38 Texture2D texture2D = IO.LoadPNG(path + "_t");
39 sprite = Sprite.Create(texture2D, new Rect(0f, 0f, texture2D.width, texture2D.height), new Vector2(0.5f, 0.5f));
40 sprites[idx] = sprite;
41 }
42 uIItem.image1.sprite = sprite;
43 uIItem.text1.text = "#" + id;
44 uIItem.button1.SetOnClick(delegate
45 {
46 Debug.Log(path);
47 SE.Play("click_recipe");
48 Sprite sprite2 = spritesFull.TryGetValue(idx);
49 if (!sprite2)
50 {
51 Texture2D texture2D2 = IO.LoadPNG(path, FilterMode.Trilinear);
52 sprite2 = Sprite.Create(texture2D2, new Rect(0f, 0f, texture2D2.width, texture2D2.height), new Vector2(0.5f, 0.5f));
53 spritesFull[idx] = sprite2;
54 }
55 EClass.ui.AddLayer<LayerImage>().SetImage(sprite2);
56 });
57 }
58 }
List< string > ids
static Dictionary< int, Sprite > sprites
static Dictionary< int, Sprite > spritesFull
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 UI ui
Definition: EClass.cs:17
Definition: IO.cs:11
static Texture2D LoadPNG(string _path, FilterMode filter=FilterMode.Point)
Definition: IO.cs:433
int idx
Definition: UIBook.cs:35
Definition: UIItem.cs:5
UIButton button1
Definition: UIItem.cs:18
UIItem AddItem(string id)
Definition: UINote.cs:139

References UIItem.button1, EClass.core, Debug, CoreRef.dictSketches2, ContentGallery.Page.ids, UIBook.Page.idx, Core.refs, ContentGallery.sprites, ContentGallery.spritesFull, and EClass.ui.

Member Data Documentation

◆ ids

List<string> ContentGallery.Page.ids = new List<string>()

Definition at line 16 of file ContentGallery.cs.

Referenced by ContentGallery.Page.BuildNote().


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