Ejemplo n.º 1
0
 /// <summary>Constructor for XWA</summary>
 /// <param name="index">Backdrop index, set to 0 if out of range</param>
 /// <param name="shadow">Shadow or backdrop variant, set to 0 if out of range</param>
 public BackdropDialog(int index, int shadow)
 {
     _platform = MissionFile.Platform.XWA;
     if (!platformInstalled())
     {
         throw new ArgumentException("Platform installation not found, feature unavailable.");
     }
     _index = index;
     if (_index < 0 || _index > 103)
     {
         _index = 0;
     }
     _shadow = shadow;
     if (_shadow < 0 || _shadow > 6)
     {
         _shadow = 0;
     }
     InitializeComponent();
     createThumbnails();
     vsbThumbs.Enabled   = true;
     numBackdrop.Maximum = _numBackdrops - 1;
     numBackdrop.Value   = _index;
     numShadow.Enabled   = true;
     numShadow.Value     = _shadow;
 }
Ejemplo n.º 2
0
 /// <summary>Constructor for TIE and XvT</summary>
 /// <param name="platform">May be TIE, XvT or BoP, throws ArgumentException otherwise</param>
 /// <param name="index">Backdrop index, set to 0 if out of range</param>
 /// <exception cref="ArgumentException"></exception>
 public BackdropDialog(MissionFile.Platform platform, int index)
 {
     _platform = platform;
     if (_platform == MissionFile.Platform.Invalid || _platform == MissionFile.Platform.XWA)
     {
         throw new ArgumentException("Invalid platform, must be TIE, XvT or BoP");
     }
     if (!platformInstalled())
     {
         throw new ArgumentException("Platform installation not found, feature unavailable.");
     }
     _index = index;
     if ((_platform == MissionFile.Platform.TIE || _platform == MissionFile.Platform.XvT) && (_index < 0 || _index > 7))
     {
         _index = 0;
     }
     if (_platform == MissionFile.Platform.BoP && (_index < 0 || _index > 16))
     {
         _index = 0;
     }
     InitializeComponent();
     createThumbnails();
     numBackdrop.Maximum = _numBackdrops - 1;
     numBackdrop.Value   = _index;
 }
Ejemplo n.º 3
0
 /// <summary>Constructor for TIE and XvT</summary>
 /// <param name="platform">Must be TIE, XvT or BoP</param>
 /// <param name="index">Backdrop index, set to 0 if out of range</param>
 /// <exception cref="ArgumentException">Invalid value for <paramref name="platform"/>.</exception>
 /// <exception cref="ApplicationException">The designated <paramref name="platform"/> installation is not detected.</exception>
 public BackdropDialog(MissionFile.Platform platform, int index)
 {
     _platform = platform;
     if (_platform == MissionFile.Platform.Invalid || _platform == MissionFile.Platform.XWA)
     {
         throw new ArgumentException("Invalid platform, must be TIE, XvT or BoP");
     }
     if (!platformInstalled())
     {
         throw new ApplicationException("Platform installation not found, feature unavailable.");
     }
     _index = index;
     if ((_platform == MissionFile.Platform.TIE || _platform == MissionFile.Platform.XvT) && (_index < 0 || _index > 7))
     {
         _index = 0;
     }
     if (_platform == MissionFile.Platform.BoP && (_index < 0 || _index > 16))
     {
         _index = 0;
     }
     InitializeComponent();
     try  //[JB] Added catch block
     {
         createThumbnails();
     }
     catch
     {
         MessageBox.Show("Failed to load backdrop graphics. The game's files could not be found. Check whether the game is installed and its path has been added to the platform settings.", "Error");
     }
     numBackdrop.Maximum = _numBackdrops - 1;
     numBackdrop.Value   = _index;
     numBackdrop_ValueChanged("init", new EventArgs());
 }
Ejemplo n.º 4
0
 /// <summary>Constructor for XWA</summary>
 /// <param name="index">Backdrop index, set to 0 if out of range</param>
 /// <param name="shadow">Shadow or backdrop variant, set to 0 if out of range</param>
 /// <exception cref="ApplicationException">Platform installation not found.</exception>
 public BackdropDialog(int index, int shadow, Settings config)
 {
     _platform = MissionFile.Platform.XWA;
     _index    = index;
     if (_index <= 0 || _index > 103 || _index == 25)
     {
         _index = 1;
     }
     _shadow = shadow;
     if (_shadow < 0 || _shadow > 6)
     {
         _shadow = 0;
     }
     InitializeComponent();
     if (!platformInstalled(config))
     {
         throw new ApplicationException("Platform installation not found, feature unavailable.");
     }
     createThumbnails();
     vsbThumbs.Enabled   = true;
     numBackdrop.Maximum = _numBackdrops - 1;
     numBackdrop.Value   = _index;
     numShadow.Enabled   = true;
     numShadow.Value     = _shadow;
     numBackdrop_ValueChanged("init", new EventArgs());
 }
Ejemplo n.º 5
0
 /// <summary>Constructor for XWA, Backdrop hook enabled</summary>
 /// <param name="index">Backdrop index, set to 0 if out of range</param>
 /// <param name="shadow">Shadow or backdrop variant, set to 0 if out of range</param>
 /// <param name="fileName">Name of mission for hook implementation</param>
 /// <exception cref="ApplicationException">Platform installation not found.</exception>
 public BackdropDialog(int index, int shadow, string fileName)
 {
     _platform      = MissionFile.Platform.XWA;
     _hookInstalled = true;
     _index         = index;
     if (_index < 0 || _index > 103)
     {
         _index = 0;
     }
     _shadow = shadow;
     if (_shadow < 0 || _shadow > 6)
     {
         _shadow = 0;
     }
     InitializeComponent();
     if (!platformInstalled())
     {
         throw new ApplicationException("Platform installation not found, feature unavailable.");
     }
     _fileName = Idmr.Common.StringFunctions.GetFileName(fileName, false);
     if (File.Exists(_installDirectory + "\\Missions\\" + _fileName + "_Resdata.txt"))
     {
         _fileName = _installDirectory + "\\Missions\\" + _fileName + "_Resdata.txt";
     }
     else
     {
         _fileName = _installDirectory + "\\Missions\\" + _fileName + ".ini";
     }
     createThumbnails();
     vsbThumbs.Enabled   = true;
     numBackdrop.Maximum = _numBackdrops - 1;
     numBackdrop.Value   = _index;
     numShadow.Enabled   = true;
     numShadow.Value     = _shadow;
     numBackdrop_ValueChanged("init", new EventArgs());
 }