diff --git a/VPet-Simulator.Windows.Interface/ExtensionFunction.cs b/VPet-Simulator.Windows.Interface/ExtensionFunction.cs index 5af0063..c19780b 100644 --- a/VPet-Simulator.Windows.Interface/ExtensionFunction.cs +++ b/VPet-Simulator.Windows.Interface/ExtensionFunction.cs @@ -51,14 +51,12 @@ namespace VPet_Simulator.Windows.Interface /// 是否超模 public static bool IsOverLoad(this Work work) {//判断这个工作是否超模 - if (work.LevelLimit > 100) - return true; if (work.LevelLimit < 0) work.LevelLimit = 0; if (work.FinishBonus < 0) work.FinishBonus = 0; if (work.Type == Work.WorkType.Play && work.Feeling > 0) - work.Feeling *= -1; + work.Feeling *= -1;//旧版本代码兼容 if (work.Time < 10) work.Time = 10; @@ -86,12 +84,6 @@ namespace VPet_Simulator.Windows.Interface for (int i = 0; i < maxIterations; i++) { - if (work.LevelLimit > 100) - work.LevelLimit = 100; - - if (work.FinishBonus < 0) - work.FinishBonus = 0; - while (Math.Abs(work.Get()) > 1.1 * work.LevelLimit + 10) //等级获取速率限制 { work.MoneyBase /= 2; diff --git a/VPet-Simulator.Windows/Function/CoreMOD.cs b/VPet-Simulator.Windows/Function/CoreMOD.cs index aca25f0..4601703 100644 --- a/VPet-Simulator.Windows/Function/CoreMOD.cs +++ b/VPet-Simulator.Windows/Function/CoreMOD.cs @@ -374,7 +374,12 @@ namespace VPet_Simulator.Windows { try { - Process.Start(url); + var psi = new ProcessStartInfo + { + FileName = url, + UseShellExecute = true + }; + Process.Start(psi); } catch { diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index c109236..06a3cc4 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -1186,11 +1186,8 @@ namespace VPet_Simulator.Windows //看看是否超模 if (HashCheck && work.IsOverLoad()) { - double spend = work.Spend(); - double get = work.Get(); - var rel = get / spend; - if (MessageBoxX.Show("当前工作数据属性超模,是否继续工作?\n超模工作可能会导致游戏发生不可预料的错误\n超模工作不影响大部分成就解锁\n当前数据比率 {0:f2} 推荐=0.5<0.75\n盈利速度:{1:f0} 推荐<{2}" - .Translate(rel, get, (work.LevelLimit + 4) * 3), "超模工作提醒".Translate(), MessageBoxButton.YesNo) != MessageBoxResult.Yes) + if (MessageBoxX.Show("当前工作数据属性超模,是否继续工作?\n超模工作可能会导致游戏发生不可预料的错误\n超模工作不影响大部分成就解锁\n可以在设置中开启自动计算自动为工作设置合理数值" + .Translate(), "超模工作提醒".Translate(), MessageBoxButton.YesNo) != MessageBoxResult.Yes) { return false; } @@ -1614,6 +1611,8 @@ namespace VPet_Simulator.Windows { foreach (var work in Core.Graph.GraphConfig.Works) { + if (work.LevelLimit > 100)//导入的最大合理工作不能超过100级 + work.LevelLimit = 100; if (work.IsOverLoad()) { work.FixOverLoad(); diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index 20bbe4d..5a27157 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -23,6 +23,8 @@ using Steamworks.Data; using System.Windows.Controls; using ToolBar = VPet_Simulator.Core.ToolBar; using System.Security.Cryptography; +using System.Diagnostics; +using System.Reflection.Metadata; namespace VPet_Simulator.Windows { @@ -361,7 +363,14 @@ namespace VPet_Simulator.Windows catch { } Save(); if (App.MainWindows.Count == 1) - System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location); + { + var psi = new ProcessStartInfo + { + FileName = Path.ChangeExtension(System.Reflection.Assembly.GetExecutingAssembly().Location, "exe"), + UseShellExecute = true + }; + Process.Start(psi); + } else { new MainWindow(PrefixSave).Show(); diff --git a/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs b/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs index cdb2a71..cb5e4d3 100644 --- a/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs +++ b/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs @@ -190,15 +190,15 @@ public partial class MPFriends : WindowX petloader ??= Pets[0]; - //加载数据合理化:食物 - foreach (Food f in Foods) - { - if (f.IsOverLoad()) - { - f.Price = Math.Max((int)f.RealPrice, 1); - f.isoverload = false; - } - } + ////加载数据合理化:食物 + //foreach (Food f in Foods) + //{ + // if (f.IsOverLoad()) + // { + // f.Price = Math.Max((int)f.RealPrice, 1); + // f.isoverload = false; + // } + //} await Dispatcher.InvokeAsync(new Action(() => { LoadingText.Content = "尝试加载动画和生成缓存\n该步骤可能会耗时比较长\n请耐心等待".Translate(); diff --git a/VPet-Simulator.Windows/WinDesign/winCharacterPanel.xaml.cs b/VPet-Simulator.Windows/WinDesign/winCharacterPanel.xaml.cs index 300fe90..9e3b2e7 100644 --- a/VPet-Simulator.Windows/WinDesign/winCharacterPanel.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/winCharacterPanel.xaml.cs @@ -11,6 +11,7 @@ using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; +using System.Reflection.Metadata; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; @@ -255,7 +256,12 @@ namespace VPet_Simulator.Windows if (mw.IsSteamUser && cb_AgreeUpload.IsChecked == true) SteamScreenshots.AddScreenshot(path, null, image.PixelWidth, image.PixelHeight); - Process.Start(path); + var psi = new ProcessStartInfo + { + FileName = path, + UseShellExecute = true + }; + Process.Start(psi); } } diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs index 92778fa..ff91dc7 100644 --- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs @@ -547,7 +547,12 @@ namespace VPet_Simulator.Windows private void ButtonOpenModFolder_MouseDown(object sender, MouseButtonEventArgs e) { - Process.Start(mod.Path.FullName); + var psi = new ProcessStartInfo + { + FileName = mod.Path.FullName, + UseShellExecute = true + }; + Process.Start(psi); } private void ButtonEnable_MouseDown(object sender, MouseButtonEventArgs e) diff --git a/VPet-Simulator.Windows/WinDesign/winWorkMenu.xaml.cs b/VPet-Simulator.Windows/WinDesign/winWorkMenu.xaml.cs index b66242d..41bd2ac 100644 --- a/VPet-Simulator.Windows/WinDesign/winWorkMenu.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/winWorkMenu.xaml.cs @@ -31,7 +31,6 @@ public partial class winWorkMenu : Window { InitializeComponent(); this.mw = mw; - mw.Main.WorkList(out ws, out ss, out ps); if (ws.Count == 0) tbc.Items.Remove(tiw);