Skip to content

Commit ca2f240

Browse files
author
WGzeyu
authored
Merge pull request #6 from beatmods-top/dev
2 parents c3c1148 + 93408fc commit ca2f240

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

ModAssistant/App.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ private async void Application_Startup(object sender, StartupEventArgs e)
6969
}
7070
}
7171

72+
Utils.CheckDirValid(BeatSaberInstallDirectory);
73+
7274
options.InstallType =
7375
BeatSaberInstallType = ModAssistant.Properties.Settings.Default.StoreType;
7476
options.SaveSelection =

ModAssistant/Classes/Utils.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,17 @@ public static string GetManualDir()
455455
return null;
456456
}
457457

458+
public static void CheckDirValid(string BeatSaberInstallDirectory) {
459+
for (int i = 0; i < BeatSaberInstallDirectory.Length; ++i)
460+
{
461+
if (((int)BeatSaberInstallDirectory[i]) > 127)
462+
{
463+
MessageBox.Show((string)Application.Current.FindResource("App:InstallDirInvalid"));
464+
break;
465+
}
466+
}
467+
}
468+
458469
public static string GetManualFile(string filter = "", string title = "Open File")
459470
{
460471
var dialog = new OpenFileDialog()

ModAssistant/Localisation/en.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<!-- App -->
99
<sys:String x:Key="App:InstallDirDialog:Title">Couldn't find your Beat Saber install folder!</sys:String>
1010
<sys:String x:Key="App:InstallDirDialog:OkCancel">Press OK to try again, or Cancel to close application.</sys:String>
11+
<sys:String x:Key="App:InstallDirInvalid">The game directory path contains special character(s) (such as Chinese or Japanese characters) that may cause problems. e.g., mods cannot work properly.</sys:String>
1112
<sys:String x:Key="App:InvalidArgument">Invalid argument! '{0}' requires an option.</sys:String>
1213
<sys:String x:Key="App:UnrecognizedArgument">Unrecognized argument. Closing Mod Assistant.</sys:String>
1314
<sys:String x:Key="App:UnhandledException">An unhandled exception just occurred</sys:String>

ModAssistant/Localisation/zh.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<!-- App -->
99
<sys:String x:Key="App:InstallDirDialog:Title">找不到您的Beat Saber安装路径!</sys:String>
1010
<sys:String x:Key="App:InstallDirDialog:OkCancel">点确定重试,或点取消关闭软件。</sys:String>
11+
<sys:String x:Key="App:InstallDirInvalid">你的游戏安装路径中包含中文等特殊字符,这有可能会导致Mod出现问题。</sys:String>
1112
<sys:String x:Key="App:InvalidArgument">无效参数!'{0}'需要一个选项。</sys:String>
1213
<sys:String x:Key="App:UnrecognizedArgument">无法识别的参数。关闭Mod Assistant。</sys:String>
1314
<sys:String x:Key="App:UnhandledException">刚刚发生了一个未处理的异常</sys:String>
@@ -87,7 +88,7 @@
8788
<LineBreak/>
8889
<LineBreak/>
8990
<Bold>
90-
<Span Foreground="#FF0000">选</Span><Span Foreground="#F60009">项</Span><Span Foreground="#ED0012"></Span><Span Foreground="#E4001B"></Span><Span Foreground="#DB0024"></Span><Span Foreground="#D2002D">切</Span><Span Foreground="#C90036">换</Span><Span Foreground="#C0003F">下</Span><Span Foreground="#B70048">载</Span><Span Foreground="#AE0051">源</Span><Span Foreground="#A5005A">可</Span><Span Foreground="#9C0063">解</Span><Span Foreground="#93006C">决</Span><Span Foreground="#8A0075">加</Span><Span Foreground="#81007E">载</Span><Span Foreground="#780087">下</Span><Span Foreground="#6F0090">载</Span><Span Foreground="#660099">缓</Span><Span Foreground="#5D00A2">慢</Span><Span Foreground="#5400AB">或</Span><Span Foreground="#4B00B4">报</Span><Span Foreground="#4200BD">错</Span><Span Foreground="#3900C6">的</Span><Span Foreground="#3000CF">问</Span><Span Foreground="#2700D8">题</Span><Span Foreground="#1E00E1">!</Span>
91+
<Span Foreground="#ED0012"></Span><Span Foreground="#E4001B"></Span><Span Foreground="#DB0024"></Span><Span Foreground="#D2002D">切</Span><Span Foreground="#C90036">换</Span><Span Foreground="#C0003F">下</Span><Span Foreground="#B70048">载</Span><Span Foreground="#AE0051">源</Span><Span Foreground="#A5005A">可</Span><Span Foreground="#9C0063">解</Span><Span Foreground="#93006C">决</Span><Span Foreground="#8A0075">加</Span><Span Foreground="#81007E">载</Span><Span Foreground="#780087">下</Span><Span Foreground="#6F0090">载</Span><Span Foreground="#660099">缓</Span><Span Foreground="#5D00A2">慢</Span><Span Foreground="#5400AB">或</Span><Span Foreground="#4B00B4">报</Span><Span Foreground="#4200BD">错</Span><Span Foreground="#3900C6">的</Span><Span Foreground="#3000CF">问</Span><Span Foreground="#2700D8">题</Span><Span Foreground="#1E00E1">!</Span>
9192
</Bold>
9293
<LineBreak/>
9394
国际源/默认源是BeatMods源站,资源从BeatSaver/ModelSaber下载,无限额;

ModAssistant/Pages/Options.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public void UpdateHandlerStatus()
6161
private void SelectDirButton_Click(object sender, RoutedEventArgs e)
6262
{
6363
Utils.GetManualDir();
64+
Utils.CheckDirValid(InstallDirectory);
6465
DirectoryTextBlock.Text = InstallDirectory;
6566
GameTypeTextBlock.Text = InstallType;
6667
}

0 commit comments

Comments
 (0)