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 void Close() { MPQ.Archive.Compact(mpq); MPQ.Archive.Close(mpq); W3I.ShowLabel(false); opened = false; }
private void EditMapInfo_OnClick(object sender, EventArgs e) { if (editMapInfo_button.Text == "Edit") { editMapInfo_button.Text = "Save"; W3I.ShowEditBox(true); } else { W3I.Write(W3I.mapName, mapName_textBox.Text); W3I.Write(W3I.mapPlayers, mapPlayers_textBox.Text); W3I.Write(W3I.mapAutor, mapAutor_textBox.Text); W3I.Write(W3I.mapDescription, mapDescription_richTextBox.Text); editMapInfo_button.Text = "Edit"; W3I.ShowEditBox(false); } }