public void New() { switch (type) { case 0: gameconfig = new RSDKv5.Gameconfig(); break; case 1: stageconfig = new RSDKv5.Stageconfig(); break; } Filepath = null; refreshLists(); RefreshUI(); }
public void Open(string Filepath, int type) { switch (type) { case 0: gameconfig = new RSDKv5.Gameconfig(new RSDKv5.Reader(Filepath), true); break; case 1: stageconfig = new RSDKv5.Stageconfig(new RSDKv5.Reader(Filepath)); break; case 2: rsdkconfig = new RSDKv5.RSDKConfig(new RSDKv5.Reader(Filepath)); rsdkgameconfig = new RSDKv5.Gameconfig(new RSDKv5.Reader(Filepath.Replace(Path.GetFileName(Filepath), "Gameconfig.bin")), true); if (rsdkconfig.Variables.Count != rsdkgameconfig.ConfigMemory.Count) { MessageBox.Show("Variable Counts not Equal! Do you have a bad gameconfig?" + Environment.NewLine + "Gameconfig Variable Count: " + rsdkgameconfig.ConfigMemory.Count + Environment.NewLine + "RSDKconfig Variable Count: " + rsdkconfig.Variables.Count); while (rsdkgameconfig.ConfigMemory.Count < rsdkconfig.Variables.Count) { rsdkgameconfig.ConfigMemory.Add(new RSDKv5.Gameconfig.ConfigurableMemoryEntry()); } while (rsdkconfig.Variables.Count < rsdkgameconfig.ConfigMemory.Count) { rsdkconfig.Variables.Add(new RSDKv5.RSDKConfig.Variable("Unknown Variable", "int", "-")); } } break; default: break; } this.type = type; this.Filepath = Filepath; refreshLists(); RefreshUI(); }