@@ -24,10 +24,10 @@ public MainForm()
24
24
InitializeComponent ( ) ;
25
25
}
26
26
27
- private static void ErrorAndExit ( string errorMessage )
27
+ private static void ErrorAndExit ( dynamic errorMessage )
28
28
{
29
- MessageBox . Show ( text : errorMessage , caption : I18N . LangResource . errors . error , buttons : MessageBoxButtons . OK , icon : MessageBoxIcon . Error ) ;
30
- Trace . WriteLine ( $ "[{ DateTime . Now . ToShortTimeString ( ) } ] { errorMessage } ") ;
29
+ MessageBox . Show ( text : errorMessage . ToString ( ) , caption : I18N . LangResource . errors . error . ToString ( ) , buttons : MessageBoxButtons . OK , icon : MessageBoxIcon . Error ) ;
30
+ Trace . WriteLine ( $ "[{ DateTime . Now . ToShortTimeString ( ) } ] { errorMessage . ToString ( ) } ") ;
31
31
Application . Exit ( ) ;
32
32
}
33
33
@@ -52,7 +52,7 @@ private void Form1_Load(object sender, EventArgs e)
52
52
Configuration1 = JsonConvert . DeserializeObject < Configuration > ( raw , settings ) ;
53
53
dconfig = JsonConvert . DeserializeObject ( raw , settings ) ;
54
54
}
55
- SetDefaultSettings ( ) ;
55
+
56
56
57
57
if ( ! Directory . Exists ( I18N . I18NDir ) ) Directory . CreateDirectory ( I18N . I18NDir ) ;
58
58
@@ -80,6 +80,8 @@ private void Form1_Load(object sender, EventArgs e)
80
80
}
81
81
}
82
82
83
+
84
+
83
85
//Load language
84
86
Configuration . Lang = dconfig ? . Lang ;
85
87
if ( Configuration . Lang == null ) Configuration . Lang = "en.json" ;
@@ -93,6 +95,8 @@ private void Form1_Load(object sender, EventArgs e)
93
95
//Give error if no games.js file
94
96
if ( ! File . Exists ( "games.js" ) ) ErrorAndExit ( I18N . LangResource . errors . missing . gamesJs ) ;
95
97
98
+ SetDefaultSettings ( ) ;
99
+
96
100
DeleteOutdatedConfig ( ) ;
97
101
98
102
#region Load data from files
0 commit comments