mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
启动时错误提示
This commit is contained in:
parent
b6bb099baf
commit
d9d4151045
@ -64,7 +64,8 @@ namespace VPet_Simulator.Windows
|
|||||||
{
|
{
|
||||||
IsSteamUser = false;
|
IsSteamUser = false;
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
//加载游戏设置
|
//加载游戏设置
|
||||||
if (new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\Setting.lps").Exists)
|
if (new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\Setting.lps").Exists)
|
||||||
{
|
{
|
||||||
@ -117,12 +118,22 @@ namespace VPet_Simulator.Windows
|
|||||||
if (!modpath.Exists)
|
if (!modpath.Exists)
|
||||||
{
|
{
|
||||||
MessageBox.Show("缺少模组Core,无法启动桌宠".Translate(), "启动错误".Translate(), MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show("缺少模组Core,无法启动桌宠".Translate(), "启动错误".Translate(), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
Close();
|
Environment.Exit(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Closed += ForceClose;
|
Closed += ForceClose;
|
||||||
Task.Run(GameLoad);
|
Task.Run(GameLoad);
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
string errstr = "游戏发生错误,可能是".Translate() + (string.IsNullOrWhiteSpace(CoreMOD.NowLoading) ?
|
||||||
|
"游戏或者MOD".Translate() : $"MOD({CoreMOD.NowLoading})") +
|
||||||
|
"导致的\n如有可能请发送 错误信息截图和引发错误之前的操作 给开发者:service@exlb.net\n感谢您对游戏开发的支持\n".Translate()
|
||||||
|
+ e.ToString();
|
||||||
|
MessageBox.Show(errstr, "游戏致命性错误".Translate() + ' ' + "启动错误".Translate(), MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
Environment.Exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
public new void Close()
|
public new void Close()
|
||||||
{
|
{
|
||||||
if (Main == null)
|
if (Main == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user