public void Install(string Category, SourceRaws raws) { if (Category.ToLower() == "graphics") { this.Graphics.Install(raws, true); this.LoadCurrentGraphics(); this.SetSelectedGraphics(raws); } else { if (!(Category.ToLower() == "objects")) return; this.Objects.Install(raws, false); this.LoadCurrentObjects(); this.SetSelectedObjects(raws); } }
public bool Install(SourceRaws Source, bool clearDirectory = false) { try { if (File.Exists(Source.ZipFilename())) { if (clearDirectory) SavegameRaws.ClearDirectory(this.Location, false); new FastZip().ExtractZip(Source.ZipFilename(), this.Location, FastZip.Overwrite.Always, (FastZip.ConfirmOverwriteDelegate)null, (string)null, (string)null, true); File.Copy(Source.VersionFilename(), this.VersionFilename(), true); this.Name = Source.Name; this.Version = Source.Version; return true; } } catch { } return false; }
public void SetSelected(string Category, SourceRaws selected) { if (Category.ToLower() == "graphics") { this.SetSelectedGraphics(selected); } else { if (!(Category.ToLower() == "objects")) return; this.SetSelectedObjects(selected); } }
private static string GetRelativePrefix(SourceRaws sourceRaws, SavegameRaws savegameRaws) { if (!(sourceRaws.Name == savegameRaws.Name)) return "Install"; int num = string.Compare(sourceRaws.Version, savegameRaws.Version, true); if (num > 0) return "Upgrade"; return num < 0 ? "Retrograde" : "Re-install"; }
public void SetSelectedObjects(SourceRaws selected) { this.ObjectsSource = selected; if (selected != null) { this.ObjectsButton.Text = Savegame.GetRelativePrefix(this.ObjectsSource, this.Objects) + " " + selected.Name + " Tileset Raws"; this.ObjectsButton.Enabled = true; } else { this.ObjectsButton.Text = "Select some Tileset Raws"; this.ObjectsButton.Enabled = false; } }
public void SetSelectedGraphics(SourceRaws selected) { this.GraphicsSource = selected; if (selected != null) { this.GraphicsButton.Text = Savegame.GetRelativePrefix(this.GraphicsSource, this.Graphics) + " " + selected.Name + " Unit Graphics"; this.GraphicsButton.Enabled = true; } else { this.GraphicsButton.Text = "Select some Unit Graphics"; this.GraphicsButton.Enabled = false; } }