mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
修复无默认项导致桌宠启动失败的错误
This commit is contained in:
parent
c7118bb566
commit
9bbd78e3f1
@ -4,6 +4,7 @@ using LinePutScript.Dictionary;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@ -268,6 +269,19 @@ namespace VPet_Simulator.Windows
|
||||
}
|
||||
public static class ExtensionSetting
|
||||
{
|
||||
|
||||
public static void StartURL(string url)
|
||||
{
|
||||
try
|
||||
{
|
||||
Process.Start(url);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Process.Start("explorer.exe", url);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 吃食物 附带倍率
|
||||
/// </summary>
|
||||
|
@ -456,7 +456,15 @@ namespace VPet_Simulator.Windows
|
||||
|
||||
m_menu = new ContextMenu();
|
||||
m_menu.MenuItems.Add(new MenuItem("鼠标穿透".Translate(), (x, y) => { SetTransparentHitThrough(); }) { });
|
||||
m_menu.MenuItems.Add(new MenuItem("操作教程".Translate(), (x, y) => { Process.Start(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html"); }));
|
||||
m_menu.MenuItems.Add(new MenuItem("操作教程".Translate(), (x, y) =>
|
||||
{
|
||||
if (LocalizeCore.CurrentCulture == "zh-Hans")
|
||||
ExtensionSetting.StartURL(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html");
|
||||
else if (LocalizeCore.CurrentCulture == "zh-Hant")
|
||||
ExtensionSetting.StartURL(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial_zht.html");
|
||||
else
|
||||
ExtensionSetting.StartURL(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial_en.html");
|
||||
}));
|
||||
m_menu.MenuItems.Add(new MenuItem("重置状态".Translate(), (x, y) =>
|
||||
{
|
||||
Main.CleanState();
|
||||
@ -498,11 +506,11 @@ namespace VPet_Simulator.Windows
|
||||
{
|
||||
Set["SingleTips"].SetDateTime("tutorial", DateTime.Now);
|
||||
if (LocalizeCore.CurrentCulture == "zh-Hans")
|
||||
Process.Start(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html");
|
||||
ExtensionSetting.StartURL(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html");
|
||||
else if (LocalizeCore.CurrentCulture == "zh-Hant")
|
||||
Process.Start(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial_zht.html");
|
||||
ExtensionSetting.StartURL(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial_zht.html");
|
||||
else
|
||||
Process.Start(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial_en.html");
|
||||
ExtensionSetting.StartURL(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial_en.html");
|
||||
}
|
||||
if (!Set["SingleTips"].GetBool("helloworld"))
|
||||
{
|
||||
|
@ -500,7 +500,7 @@ namespace VPet_Simulator.Windows
|
||||
//await result.SubmitAsync(new ProgressClass(ProgressBarUpload));
|
||||
if (MessageBoxX.Show("{0} 成功上传至WorkShop服务器\n是否跳转至创意工坊页面进行编辑详细介绍和图标?".Translate(mod.Name), "MOD上传成功".Translate(), MessageBoxButton.YesNo, MessageBoxIcon.Success) == MessageBoxResult.Yes)
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://steamcommunity.com/sharedfiles/filedetails/?id=" + r.FileId);
|
||||
ExtensionSetting.StartURL("https://steamcommunity.com/sharedfiles/filedetails/?id=" + r.FileId);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -527,7 +527,7 @@ namespace VPet_Simulator.Windows
|
||||
mod.WriteFile();
|
||||
if (MessageBoxX.Show("{0} 成功上传至WorkShop服务器\n是否跳转至创意工坊页面进行编辑新内容?".Translate(mod.Name)
|
||||
, "MOD更新成功".Translate(), MessageBoxButton.YesNo, MessageBoxIcon.Success) == MessageBoxResult.Yes)
|
||||
System.Diagnostics.Process.Start("https://steamcommunity.com/sharedfiles/filedetails/?id=" + r.FileId);
|
||||
ExtensionSetting.StartURL("https://steamcommunity.com/sharedfiles/filedetails/?id=" + r.FileId);
|
||||
}
|
||||
else
|
||||
MessageBoxX.Show("{0} 上传至WorkShop服务器失败\n请检查网络后重试\n请注意:上传和下载工坊物品可能需要良好的网络条件\n失败原因:{1}"
|
||||
@ -542,7 +542,7 @@ namespace VPet_Simulator.Windows
|
||||
{
|
||||
if (!AllowChange)
|
||||
return;
|
||||
System.Diagnostics.Process.Start("https://steamcommunity.com/sharedfiles/filedetails/?id=" + mod.ItemID);
|
||||
ExtensionSetting.StartURL("https://steamcommunity.com/sharedfiles/filedetails/?id=" + mod.ItemID);
|
||||
}
|
||||
|
||||
private void ButtonAllow_Click(object sender, RoutedEventArgs e)
|
||||
@ -567,7 +567,7 @@ namespace VPet_Simulator.Windows
|
||||
|
||||
private void hyper_moreInfo(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Process.Start("https://www.exlb.net/Diagnosis");
|
||||
ExtensionSetting.StartURL("https://www.exlb.net/Diagnosis");
|
||||
}
|
||||
|
||||
public new void Show()
|
||||
@ -633,48 +633,48 @@ namespace VPet_Simulator.Windows
|
||||
#region Link
|
||||
private void Git_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Process.Start("https://github.com/LorisYounger/VPet/graphs/contributors");
|
||||
ExtensionSetting.StartURL("https://github.com/LorisYounger/VPet/graphs/contributors");
|
||||
}
|
||||
|
||||
private void Steam_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Process.Start("https://store.steampowered.com/app/1920960/_/");
|
||||
ExtensionSetting.StartURL("https://store.steampowered.com/app/1920960/_/");
|
||||
}
|
||||
|
||||
private void Github_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Process.Start("https://github.com/LorisYounger/VPet");
|
||||
ExtensionSetting.StartURL("https://github.com/LorisYounger/VPet");
|
||||
}
|
||||
|
||||
private void LB_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Process.Start("https://www.exlb.net/VPet");
|
||||
ExtensionSetting.StartURL("https://www.exlb.net/VPet");
|
||||
}
|
||||
|
||||
private void VPET_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Process.Start("https://www.exlb.net/");
|
||||
ExtensionSetting.StartURL("https://www.exlb.net/");
|
||||
}
|
||||
private void VUP_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Process.Start("https://store.steampowered.com/app/1352140/_/");
|
||||
ExtensionSetting.StartURL("https://store.steampowered.com/app/1352140/_/");
|
||||
}
|
||||
|
||||
private void Group_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (LocalizeCore.CurrentCulture.StartsWith("zh"))
|
||||
Process.Start("https://jq.qq.com/?_wv=1027&k=zmeWNHyI");
|
||||
ExtensionSetting.StartURL("https://jq.qq.com/?_wv=1027&k=zmeWNHyI");
|
||||
else
|
||||
Process.Start("https://github.com/LorisYounger/VPet");
|
||||
ExtensionSetting.StartURL("https://github.com/LorisYounger/VPet");
|
||||
}
|
||||
private void sendkey_click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (LocalizeCore.CurrentCulture.StartsWith("zh"))
|
||||
Process.Start("https://www.exlb.net/SendKeys");
|
||||
ExtensionSetting.StartURL("https://www.exlb.net/SendKeys");
|
||||
else if (LocalizeCore.CurrentCulture == "null")
|
||||
Process.Start("https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys?view=windowsdesktop-7.0#remarks");
|
||||
ExtensionSetting.StartURL("https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys?view=windowsdesktop-7.0#remarks");
|
||||
else
|
||||
Process.Start($"https://learn.microsoft.com/{LocalizeCore.CurrentCulture}/dotnet/api/system.windows.forms.sendkeys?view=windowsdesktop-7.0#remarks");
|
||||
ExtensionSetting.StartURL($"https://learn.microsoft.com/{LocalizeCore.CurrentCulture}/dotnet/api/system.windows.forms.sendkeys?view=windowsdesktop-7.0#remarks");
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user