Skip to content

Commit

Permalink
Fixed re-occuring prompt (on whether or not to import settings from m…
Browse files Browse the repository at this point in the history
…ednafen config files) on MedLaunch start. This will only happen once now - #125
  • Loading branch information
Asnivor committed Jun 28, 2017
1 parent b510787 commit c563cdb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion MedLaunch/Models/GlobalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class GlobalSettings
public bool? bypassConfig { get; set; } // ignore GUI launcher configs and just launch with the mednafen text config files
public bool? enableNetplay { get; set; } // enable netplay
public bool? enableSnes_faust { get; set; } // use snes_faust emulation rather than SNES
public bool? enablePce_fast { get; set; } // use pce_fast emulation rather than pce
public bool? enablePce_fast { get; set; } // use pce_fast emulation rather than pce
public int? serverSelected { get; set; } // stores the currently selected server ID
public double guiZoom { get; set; } // the current GUI zoom factor as a decimal (1 = 100%)
public bool? showAllBaseSettings { get; set; } // if enabled, all settings are visible and configurable under the base configuration
Expand Down
22 changes: 17 additions & 5 deletions MedLaunch/Models/Paths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,27 @@ public static void MedPathRoutineContinued(Button btnPathMednafen, TextBox tbPat
public static void InitM()
{
MainWindow mw = Application.Current.Windows.OfType<MainWindow>().FirstOrDefault();

GlobalSettings gs = GlobalSettings.GetGlobals();

InitMednafen();

//ask to import configs
MessageBoxResult result = MessageBox.Show("Do you want to import data from any Mednafen config files in this directory?\n(This will overwrite any config data stored in MedLaunch)", "Config Import", MessageBoxButton.YesNo);
if (result == MessageBoxResult.Yes)
// check whether bypassconfig is set
if (gs.bypassConfig == false)
{
ConfigImport ci = new ConfigImport();
ci.ImportAll(null);
//ask to import configs
MessageBoxResult result = MessageBox.Show("Do you want to import data from any Mednafen config files in this directory?\n(This will overwrite any config data stored in MedLaunch)\n\nYou will only be prompted once for this, but you can control automatic import of mednafen config files from the SETTINGS tab.", "Config Import", MessageBoxButton.YesNo);
if (result == MessageBoxResult.Yes)
{
ConfigImport ci = new ConfigImport();
ci.ImportAll(null);

// set bypassconfig to 1
gs.bypassConfig = true;
GlobalSettings.SetGlobals(gs);
}
}

// if option is selected make a backup of the mednafen config file
BackupConfig.BackupMain();
// mednafen versions
Expand Down
4 changes: 2 additions & 2 deletions MedLaunch/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.6.0")]
[assembly: AssemblyFileVersion("0.5.6.0")]
[assembly: AssemblyVersion("0.5.6.1")]
[assembly: AssemblyFileVersion("0.5.6.1")]

0 comments on commit c563cdb

Please sign in to comment.