示例#1
0
 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);
     }
 }
示例#2
0
 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;
 }
示例#3
0
 public void SetSelected(string Category, SourceRaws selected)
 {
     if (Category.ToLower() == "graphics") {
         this.SetSelectedGraphics(selected);
     } else {
         if (!(Category.ToLower() == "objects"))
             return;
         this.SetSelectedObjects(selected);
     }
 }
示例#4
0
 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";
 }
示例#5
0
 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;
     }
 }
示例#6
0
 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;
     }
 }