Skip to content

Commit 786f76a

Browse files
author
Tudi20
authored
Merge pull request #72 from DoremyR3d/master
Fix "Could not find a part of the path ..." error
2 parents 00a640b + b0d6ceb commit 786f76a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Universal THCRAP Launcher/MainForm.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ private async void MainForm_KeyUp(object sender, KeyEventArgs e)
102102
{
103103
case Keys.F12:
104104
throw new Exception("This exception is for Debug purposes. Please don't press F12.");
105-
break;
106105
case Keys.F3:
107106
UpdateDisplayStrings();
108107
break;
@@ -468,7 +467,7 @@ private void SetDefaultSettings()
468467
$"Configuration1.LastGame has been set to {Configuration1.LastGame}");
469468
}
470469

471-
if (Configuration1.SplitterDistance == null)
470+
if (Configuration1.SplitterDistance == 0)
472471
{
473472
Configuration1.SplitterDistance = splitContainer1.SplitterDistance;
474473
log.WriteLine($"Configuration1.SplitterDistance has been set to {Configuration1.SplitterDistance}");
@@ -1129,8 +1128,15 @@ private bool InitChecks()
11291128
}
11301129

11311130
//Load language
1132-
Configuration.Lang = dconfig.Lang ?? "en.json";
1133-
Configuration.Lang = Configuration.Lang == "null" ? "en.json" : Configuration.Lang;
1131+
if (dconfig == null || string.IsNullOrEmpty(dconfig.Lang))
1132+
{
1133+
Configuration.Lang = "en.json";
1134+
}
1135+
else
1136+
{
1137+
Configuration.Lang = dconfig.Lang;
1138+
}
1139+
11341140
I18N.UpdateLangResource(I18N.I18NDir + Configuration.Lang);
11351141

11361142
/* Windows Vista style JumpList requirements. This feature has been chosen to be NOT supported by UTL.
@@ -1312,7 +1318,6 @@ private static string GetPrettyTouhouName(string id, GameNameType nameType = Gam
13121318
return id;
13131319
default:
13141320
throw new ArgumentOutOfRangeException();
1315-
break;
13161321
}
13171322
return Configuration1.ShowGameId ? id + ": " + name : name;
13181323
}

0 commit comments

Comments
 (0)