static Core() { MKL.Lic("Stach - Core.cs", "GNU General Public License 3"); MKL.Version("Stach - Core.cs", "21.03.09"); FFS.Hello(); Debug.WriteLine($"Running on {Platform}"); Dirry.InitAltDrives(); Config = GINIE.FromFile($"{Dirry.C("$AppSupport$/Stach.ini")}"); Config.AutoSaveSource = $"{Dirry.C("$AppSupport$/Stach.ini")}"; JCR6_lzma.Init(); JCR6_jxsrcca.Init(); JCR6_zlib.Init(); new JCR_QuakePack(); new JCR_a(); new JCR_QuickLink(); JCR_JCR5.Init(); new JCR6_WAD(); new JCR_WestwoodPAK(); }
void Run() { Console.WriteLine("Kthura Convert - Coded by Jeroen P. Broks"); Console.WriteLine($"Project: {Project}"); Print("Loading Global Config"); GlobConfig = GINIE.FromFile(GlobConfigFile); Print("Workspace: ", WorkSpace); Print("Loading old project: ", OldFile); Old = GINI.ReadFromFile(OldFile); Print("Data for new project creation"); Nieuw = GINIE.FromSource($"[CONVERT]\nConvertData={DateTime.Now}"); Nieuw.AutoSaveSource = OldFile.Replace(".GINI", ".ini"); Print("- Meta data"); Nieuw["Meta", "CREATED"] = $"{DateTime.Now} -- By conversion of an old project"; Nieuw["Meta", "PROJECT"] = Old["Project"]; Print("- Meta data tags for map"); foreach (var k in Old.List("GeneralData")) { Nieuw.List("Map", "GeneralData").Add(k); } Print("- Tex convert"); Nieuw["PATHS.WINDOWS", "MAPS"] = Old["Maps"]; foreach (var i in Old.List("TEXTURESGRABFOLDERSMERGE")) { Nieuw.List("Paths.Windows", "TexMaps").Add(i); } Nieuw["PATHS.WINDOWS", "TEXMERGE"] = "YES"; //TexDir = E:/ Projects / Maps / Kthura / cpp_kthproject / Textures Print("- Custom stuff"); foreach (var c in Old.List("CSpots")) { Nieuw.List("Map", "Special").Add(c); } Print(); foreach (var mp in FileList.GetTree(Old["Maps"])) { KthuraCheck(mp); } // Last Nieuw["Meta", "CONVERTFINISH"] = $"{DateTime.Now}"; }
void Scan4Maps() { if (LstProjects.SelectedItem == null) { return; // Crash prevention } try { var prj = LstProjects.SelectedItem.ToString(); Debug.WriteLine($"Scanning project: {prj}"); var projectfile = $"{MainConfig.WorkSpace}/{prj}/{prj}.Project.ini"; var prjfile = $"{MainConfig.WorkSpace}/{prj}/{prj}.Project.GINI"; string[] maps = null; if (File.Exists(projectfile)) { GINIE PRJ = GINIE.FromFile(projectfile); maps = FileList.GetDir(PRJ[$"Paths.{MainConfig.Platform}", "Maps"]); StartTheEditor.IsEnabled = true; NieuwSysteem = true; } else if (File.Exists(prjfile)) { TGINI Project = GINI.ReadFromFile(prjfile); if (Project == null) { MessageBox.Show($"Reading {prjfile} failed!", "Project scanning error", MessageBoxButton.OK, MessageBoxImage.Error); return; } maps = FileList.GetDir(Project.C("Maps")); StartTheEditor.IsEnabled = false; NieuwSysteem = false; } LstMaps.Items.Clear(); LstMaps.Items.Add("** New Map **"); foreach (string m in maps) { LstMaps.Items.Add(m); } } catch (Exception E) { MessageBox.Show(E.Message, "Project scanning errorr", MessageBoxButton.OK, MessageBoxImage.Error); } }