public static void save(string name) { if (!DevkitWindowLayout.wasLoaded) { return; } string path = IOUtility.rootPath + "/Cloud/Layouts/" + name + ".layout"; string directoryName = Path.GetDirectoryName(path); if (!Directory.Exists(directoryName)) { Directory.CreateDirectory(directoryName); } using (StreamWriter streamWriter = new StreamWriter(path)) { IFormattedFileWriter formattedFileWriter = new KeyValueTableWriter(streamWriter); formattedFileWriter.writeKey("Root"); DevkitWindowManager.partition.write(formattedFileWriter); formattedFileWriter.writeKey("Containers"); formattedFileWriter.beginArray(); for (int i = 0; i < DevkitWindowManager.containers.Count; i++) { formattedFileWriter.beginObject(); Sleek2PopoutContainer sleek2PopoutContainer = DevkitWindowManager.containers[i]; formattedFileWriter.writeValue <Type>("Type", sleek2PopoutContainer.GetType()); formattedFileWriter.writeValue <Sleek2PopoutContainer>("Container", sleek2PopoutContainer); formattedFileWriter.endObject(); } formattedFileWriter.endArray(); } }
protected override void handleButtonClick() { Sleek2PopoutContainer sleek2PopoutContainer = DevkitWindowManager.addContainer(this.type); sleek2PopoutContainer.transform.anchorMin = new Vector2(0.25f, 0.25f); sleek2PopoutContainer.transform.anchorMax = new Vector2(0.75f, 0.75f); base.handleButtonClick(); }
// Token: 0x060010F0 RID: 4336 RVA: 0x0006E654 File Offset: 0x0006CA54 public static Sleek2PopoutContainer addContainer(Type type) { Sleek2PopoutContainer sleek2PopoutContainer = Activator.CreateInstance(type) as Sleek2PopoutContainer; sleek2PopoutContainer.transform.anchorMin = Vector2.zero; sleek2PopoutContainer.transform.anchorMax = Vector2.one; sleek2PopoutContainer.transform.pivot = Vector2.zero; sleek2PopoutContainer.transform.sizeDelta = Vector2.zero; sleek2PopoutContainer.transform.SetParent(DevkitCanvas.instance.transform, false); DevkitWindowManager.containers.Add(sleek2PopoutContainer); return(sleek2PopoutContainer); }
public static void load(string name) { DevkitWindowLayout.wasLoaded = true; DevkitWindowManager.resetLayout(); string path = IOUtility.rootPath + "/Cloud/Layouts/" + name + ".layout"; string directoryName = Path.GetDirectoryName(path); if (!Directory.Exists(directoryName)) { Directory.CreateDirectory(directoryName); } if (!File.Exists(path)) { return; } using (StreamReader streamReader = new StreamReader(path)) { IFormattedFileReader formattedFileReader = new KeyValueTableReader(streamReader); formattedFileReader.readKey("Root"); DevkitWindowManager.partition.read(formattedFileReader); int num = formattedFileReader.readArrayLength("Containers"); for (int i = 0; i < num; i++) { formattedFileReader.readArrayIndex(i); IFormattedFileReader formattedFileReader2 = formattedFileReader.readObject(); if (formattedFileReader2 != null) { Type type = formattedFileReader2.readValue <Type>("Type"); if (type != null) { Sleek2PopoutContainer sleek2PopoutContainer = DevkitWindowManager.addContainer(type); if (sleek2PopoutContainer != null) { formattedFileReader2.readKey("Container"); sleek2PopoutContainer.read(formattedFileReader2); } } } } } }
// Token: 0x060010F1 RID: 4337 RVA: 0x0006E6CF File Offset: 0x0006CACF public static void removeContainer(Sleek2PopoutContainer container) { DevkitWindowManager.containers.Remove(container); container.destroy(); }