修复所有反馈的bug

This commit is contained in:
ZouJin 2023-07-04 09:17:17 +10:00
parent 0749dfd382
commit 1a69c84f04
7 changed files with 31 additions and 10 deletions

View File

@ -25,7 +25,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType> <DebugType>portable</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>

View File

@ -24,7 +24,7 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType> <DebugType>portable</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>

View File

@ -18,7 +18,7 @@ namespace VPet_Simulator.Windows
{ {
"ChatGPT.API.Framework.dll","Panuon.WPF.dll","steam_api.dll","Panuon.WPF.UI.dll","steam_api64.dll", "ChatGPT.API.Framework.dll","Panuon.WPF.dll","steam_api.dll","Panuon.WPF.UI.dll","steam_api64.dll",
"LinePutScript.dll","Newtonsoft.Json.dll","Facepunch.Steamworks.Win32.dll", "Facepunch.Steamworks.Win64.dll", "LinePutScript.dll","Newtonsoft.Json.dll","Facepunch.Steamworks.Win32.dll", "Facepunch.Steamworks.Win64.dll",
"VPet-Simulator.Core.dll","VPet-Simulator.Windows.Interface.dll" "VPet-Simulator.Core.dll","VPet-Simulator.Windows.Interface.dll","LinePutScript.Localization.WPF.dll"
}; };
public static string NowLoading = null; public static string NowLoading = null;
public string Name; public string Name;

View File

@ -528,7 +528,7 @@ namespace VPet_Simulator.Windows
} }
private void WindowX_LocationChanged(object sender, EventArgs e) private void WindowX_LocationChanged(object sender, EventArgs e)
{ {
petHelper.SetLocation(); petHelper?.SetLocation();
} }
//public void DEBUGValue() //public void DEBUGValue()
//{ //{

View File

@ -48,7 +48,9 @@ namespace VPet_Simulator.Windows
mw.CGPTClient.Completions["vpet"].presence_penalty = 1; mw.CGPTClient.Completions["vpet"].presence_penalty = 1;
mw.CGPTClient.Completions["vpet"].max_tokens = Math.Min(Math.Max(int.Parse(tbMaxToken.Text), 10), 4000); mw.CGPTClient.Completions["vpet"].max_tokens = Math.Min(Math.Max(int.Parse(tbMaxToken.Text), 10), 4000);
mw.CGPTClient.Completions["vpet"].temperature = Math.Min(Math.Max(double.Parse(tbTemp.Text), 0.1), 2); mw.CGPTClient.Completions["vpet"].temperature = Math.Min(Math.Max(double.Parse(tbTemp.Text), 0.1), 2);
mw.CGPTClient.Completions["vpet"].messages.AddRange(JsonConvert.DeserializeObject<List<ChatGPT.API.Framework.Message>>(tbHistory.Text)); var l = JsonConvert.DeserializeObject<List<ChatGPT.API.Framework.Message>>(tbHistory.Text);
if (l != null)
mw.CGPTClient.Completions["vpet"].messages.AddRange(l);
mw.Save(); mw.Save();
this.Close(); this.Close();
} }

View File

@ -2,6 +2,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Timers; using System.Timers;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
@ -73,7 +74,13 @@ namespace VPet_Simulator.Windows
private void Say_Click(object sender, RoutedEventArgs e) private void Say_Click(object sender, RoutedEventArgs e)
{ {
mw.Main.Say(SayTextBox.Text, (Helper.SayType)Enum.Parse(typeof(Helper.SayType), CombSay.Text)); if (Enum.TryParse<Helper.SayType>(CombSay.Text, out var sayType))
{
mw.Main.Say(SayTextBox.Text, sayType);
}
else
mw.Main.Say("暂无该说话方法".Translate() + CombSay.Text, Helper.SayType.Serious);
} }
Timer DestanceTimer = new Timer() Timer DestanceTimer = new Timer()
{ {
@ -137,7 +144,12 @@ namespace VPet_Simulator.Windows
private void Output_No_Local(object sender, RoutedEventArgs e) private void Output_No_Local(object sender, RoutedEventArgs e)
{ {
LocalTextBox.Text = string.Join("\n", LocalizeCore.StoreTranslationList); StringBuilder sb = new StringBuilder();
foreach (var v in LocalizeCore.StoreTranslationList)
{
sb.AppendLine(v.Replace("\n", @"\n").Replace("\r", @"\r"));
}
LocalTextBox.Text = sb.ToString();
} }
//private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) //private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
//{ //{

View File

@ -379,7 +379,7 @@ namespace VPet_Simulator.Windows
return; return;
} }
mw.Set.OnModRemove(mod.Name); mw.Set.OnModRemove(mod.Name);
ShowMod((string)((ListBoxItem)ListMod.SelectedItem).Content); ShowMod(mod.Name);
ButtonRestart.Visibility = System.Windows.Visibility.Visible; ButtonRestart.Visibility = System.Windows.Visibility.Visible;
ShowModList(); ShowModList();
} }
@ -663,7 +663,14 @@ namespace VPet_Simulator.Windows
shortcut.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory; shortcut.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory;
shortcut.TargetPath = shortcutAddress; shortcut.TargetPath = shortcutAddress;
shortcut.IconLocation = AppDomain.CurrentDomain.BaseDirectory + @"vpeticon.ico"; shortcut.IconLocation = AppDomain.CurrentDomain.BaseDirectory + @"vpeticon.ico";
shortcut.Save(); try
{
shortcut.Save();
}
catch
{
MessageBox.Show("创建快捷方式失败,权限不足\n请以管理员身份运行后重试".Translate(), "权限不足".Translate());
}
} }
else else
{ {
@ -929,7 +936,7 @@ namespace VPet_Simulator.Windows
{ {
if (!AllowChange) if (!AllowChange)
return; return;
if(PetHelperBox.IsChecked == true) if (PetHelperBox.IsChecked == true)
{ {
mw.Set.PetHelper = true; mw.Set.PetHelper = true;
mw.LoadPetHelper(); mw.LoadPetHelper();