public static void Read(string filepath) { if (opened) { Close(); } opened = true; file = filepath; mpq = MPQ.Archive.OpenForUdate(file); if (listfile != null) { listfile.TrimExcess(); listfile = null; } listfile = MPQ.Archive.ListFile(mpq); Settings.Ini.Write(Settings.KeyName(new { Settings.LastMap }), file, Settings.INI_SECTION_GENERAL); Settings.LastMap = file; Jass.Read(); WTS.Read(); W3I.Read(); IMP.Read(); SLK.Read(); byte[] mapPreview = MPQ.File.Read(WAR3_PREVIEW, mpq); if (null != mapPreview) { SetPreview(Paloma.TargaImage.LoadTargaImage(new MemoryStream(mapPreview))); } }
public static string RichTextBoxFormat() { return("|c00FEBA0EName:|r " + WTS.Get(mapName) + "|n|n" + "|c00FEBA0EPlayers:|r " + WTS.Get(mapPlayers) + "|n|n" + "|c00FEBA0EAutor:|r " + WTS.Get(mapAutor) + "|n|n" + "|c00FEBA0EDescription:|r|n|n" + WTS.Get(mapDescription)); }
public static void Write(string key, string value) { //bytes = BinaryUtility.ReplaceTextInBytes(bytes, "TRIGSTR_001", "Hello???"); if (mapName == key) { WTS.Set(mapName, value); //Wc3Color.RenderText(value, Launcher.Handle.mapName_pictureBox); } else if (mapPlayers == key) { WTS.Set(mapPlayers, value); //Wc3Color.RenderText(value, Launcher.Handle.mapPlayers_pictureBox); } else if (mapAutor == key) { WTS.Set(mapAutor, value); //Wc3Color.RenderText(value, Launcher.Handle.mapAutor_pictureBox); } else if (mapDescription == key) { WTS.Set(mapDescription, value); } Tooltip.Print(Wc3Engine.This.mapDescription_richTextBox, RichTextBoxFormat(), true); }
public static void ShowEditBox(bool flag) { ShowLabel(!flag); Wc3Engine.This.mapName_textBox.Text = WTS.Get(mapName); Wc3Engine.This.mapAutor_textBox.Text = WTS.Get(mapAutor); Wc3Engine.This.mapDescription_richTextBox.Text = WTS.Get(mapDescription); Wc3Engine.This.mapPlayers_textBox.Text = WTS.Get(mapPlayers); Wc3Engine.This.mapName_textBox.Visible = flag; Wc3Engine.This.mapAutor_textBox.Visible = flag; Wc3Engine.This.mapDescription_richTextBox.Visible = flag; Wc3Engine.This.mapPlayers_textBox.Visible = flag; }