11 public override void OnSwitchContent(
int idTab)
19 EClass.player.sketches.Clear();
20 foreach (
int item
in EClass.core.refs.dictSketches.Keys)
22 EClass.player.sketches.Add(item);
32 this.book.pages.Clear();
33 GridLayoutGroup[] array = this.grids;
34 for (
int i = 0; i < array.Length; i++)
36 array[i].cellSize = this.gridSize[ContentGallery.listMode ? 1 : 0];
39 List<int> list =
EClass.player.sketches.ToList<
int>();
40 list.Sort((
int a,
int b) => a - b);
41 foreach (
int num
in list)
43 page.ids.Add(num.ToString() ??
"");
46 this.book.AddPage(page);
50 if (page.ids.Count > 0)
52 this.book.AddPage(page);
56 this.textCollected.SetText(
"sketch_collected".lang((list.Count * 100 /
EClass.core.refs.dictSketches.Count<KeyValuePair<int, string>>()).ToString() ??
"",
null,
null,
null,
null));
60 public void OnClickHelp()
66 public void ToggleMode()
69 ContentGallery.lastPage = (ContentGallery.listMode ? (this.book.currentPage / 4) : (this.book.currentPage * 4));
75 private void OnDestroy()
77 ContentGallery.lastPage = this.book.currentPage;
81 public static int lastPage;
84 public static bool listMode;
87 public Transform transBig;
90 public Image imageBig;
96 public UIText textCollected;
99 public GridLayoutGroup[] grids;
102 public Vector2[] gridSize;
105 private bool first =
true;
111 public override void BuildNote(UINote n,
string idTopic)
113 foreach (
string text
in this.ids)
115 UIItem uiitem = n.AddItem(
"ItemGallery");
116 int num = text.ToInt();
117 Sprite sprite = Resources.Load<Sprite>(
"Media/Gallery/" +
CoreRef.GetArtDir(num) +
"/" +
EClass.core.refs.dictSketches[num]);
118 uiitem.image1.sprite = sprite;
119 uiitem.text1.text =
"#" + text;
120 uiitem.button1.SetOnClick(delegate
122 SE.Play(
"click_recipe");
129 public List<string> ids =
new List<string>();
138 public Sprite sprite;