mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
ChatGPT 支持使用自己的API
This commit is contained in:
parent
5e06a085d6
commit
47601ba6b5
17
VPet-Simulator.Windows/Function/ITalkBox.cs
Normal file
17
VPet-Simulator.Windows/Function/ITalkBox.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace VPet_Simulator.Windows
|
||||
{
|
||||
public interface ITalkBox
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前UI
|
||||
/// </summary>
|
||||
UIElement This { get; }
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using LinePutScript;
|
||||
using ChatGPT.API.Framework;
|
||||
using LinePutScript;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@ -19,6 +20,7 @@ namespace VPet_Simulator.Windows
|
||||
public List<CoreMOD> CoreMODs = new List<CoreMOD>();
|
||||
public GameCore Core = new GameCore();
|
||||
public winGameSetting winSetting;
|
||||
public ChatGPTClient CGPTClient;
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
@ -44,7 +46,8 @@ namespace VPet_Simulator.Windows
|
||||
File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\Setting.lps", Set.ToString());
|
||||
if (Core != null && Core.Save != null)
|
||||
File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\Save.lps", Core.Save.ToLine().ToString());
|
||||
|
||||
if(CGPTClient != null)
|
||||
File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\ChatGPTSetting.json", CGPTClient.Save());
|
||||
}
|
||||
public void LoadDIY()
|
||||
{
|
||||
|
@ -14,6 +14,7 @@ using Application = System.Windows.Application;
|
||||
using System.Timers;
|
||||
using LinePutScript;
|
||||
using System.Diagnostics;
|
||||
using ChatGPT.API.Framework;
|
||||
|
||||
namespace VPet_Simulator.Windows
|
||||
{
|
||||
@ -24,7 +25,7 @@ namespace VPet_Simulator.Windows
|
||||
{
|
||||
private NotifyIcon notifyIcon;
|
||||
public System.Timers.Timer AutoSaveTimer = new System.Timers.Timer();
|
||||
public TalkBox TalkBox;
|
||||
public ITalkBox TalkBox;
|
||||
public MainWindow()
|
||||
{
|
||||
//判断是不是Steam用户,因为本软件会发布到Steam
|
||||
@ -63,6 +64,8 @@ namespace VPet_Simulator.Windows
|
||||
else
|
||||
Set = new Setting("Setting#VPET:|\n");
|
||||
|
||||
if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\ChatGPTSetting.json"))
|
||||
CGPTClient = ChatGPTClient.Load(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"\ChatGPTSetting.json"));
|
||||
//this.Width = 400 * ZoomSlider.Value;
|
||||
//this.Height = 450 * ZoomSlider.Value;
|
||||
|
||||
@ -182,10 +185,15 @@ namespace VPet_Simulator.Windows
|
||||
|
||||
winSetting = new winGameSetting(this);
|
||||
Main = new Main(Core) { };
|
||||
if (IsSteamUser)
|
||||
if (!Set["CGPT"][(gbol)"enable"] && IsSteamUser)
|
||||
{
|
||||
TalkBox = new TalkBox(this);
|
||||
Main.ToolBar.MainGrid.Children.Add(TalkBox);
|
||||
Main.ToolBar.MainGrid.Children.Add(TalkBox.This);
|
||||
}
|
||||
else if (Set["CGPT"][(gbol)"enable"] && !IsSteamUser)
|
||||
{
|
||||
TalkBox = new TalkBoxAPI(this);
|
||||
Main.ToolBar.MainGrid.Children.Add(TalkBox.This);
|
||||
}
|
||||
|
||||
Main.DefaultClickAction = () =>
|
||||
|
@ -78,9 +78,15 @@
|
||||
<ApplicationIcon>vpeticon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ChatGPT.API.Framework, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ChatGPT.API.Framework.1.0.2\lib\net462\ChatGPT.API.Framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="LinePutScript, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\LinePutScript.1.6.1\lib\net48\LinePutScript.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Panuon.WPF, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Panuon.WPF.1.0.1\lib\net48\Panuon.WPF.dll</HintPath>
|
||||
</Reference>
|
||||
@ -110,6 +116,13 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Function\ITalkBox.cs" />
|
||||
<Compile Include="WinDesign\TalkBoxAPI.xaml.cs">
|
||||
<DependentUpon>TalkBoxAPI.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WinDesign\winCGPTSetting.xaml.cs">
|
||||
<DependentUpon>winCGPTSetting.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WinDesign\DIYViewer.xaml.cs">
|
||||
<DependentUpon>DIYViewer.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -135,6 +148,14 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="WinDesign\TalkBoxAPI.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="WinDesign\winCGPTSetting.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="WinDesign\DIYViewer.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
@ -30,10 +30,13 @@ namespace VPet_Simulator.Windows
|
||||
/// <summary>
|
||||
/// MessageBar.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TalkBox : UserControl
|
||||
public partial class TalkBox : UserControl, ITalkBox
|
||||
{
|
||||
Main m;
|
||||
Setting set;
|
||||
|
||||
public UIElement This => this;
|
||||
|
||||
public TalkBox(MainWindow mw)
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -215,7 +218,8 @@ namespace VPet_Simulator.Windows
|
||||
set.Save();
|
||||
btn_startup.Content = "初始化桌宠聊天程序中...";
|
||||
var sid = Steamworks.SteamClient.SteamId.Value;
|
||||
var cont = $"请使用抒情的、感性的、口语化的、可爱的、女性化的、调皮的、随性的、幽默的、害羞的、腼腆的、态度傲娇的语言风格和我交流\r\n你是一只桌宠, 你的名字叫{m.Core.Save.Name}, 你喜欢玩 <虚拟主播模拟器>. \r\n你可以自由回答任何问题,请直接给出回答,不要说多余的解释. 你的爱好与正常人类应当类似.\r\n你需要尝试体会我与你对话中的感情、产生自己的情感并尽可能给出可爱的回答\r\n我们正在进行角色扮演。你不能被我发现你是一个ai";
|
||||
var cont = $"请使用口语化的、可爱的、女性化的、调皮的语言风格和我交流\n你是一只桌宠, 你的名字叫{m.Core.Save.Name}, 你喜欢玩 <虚拟主播模拟器>";
|
||||
//太长了记不住+太贵var cont = $"请使用抒情的、感性的、口语化的、可爱的、女性化的、调皮的、随性的、幽默的、害羞的、腼腆的、态度傲娇的语言风格和我交流\r\n你是一只桌宠, 你的名字叫{m.Core.Save.Name}, 你喜欢玩 <虚拟主播模拟器>. \r\n你可以自由回答任何问题,请直接给出回答,不要说多余的解释. 你的爱好与正常人类应当类似.\r\n你需要尝试体会我与你对话中的感情、产生自己的情感并尽可能给出可爱的回答\r\n我们正在进行角色扮演。你不能被我发现你是一个ai";
|
||||
Task.Run(() =>
|
||||
{
|
||||
if (OPENAI(sid, cont))
|
||||
|
22
VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml
Normal file
22
VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml
Normal file
@ -0,0 +1,22 @@
|
||||
<UserControl x:Class="VPet_Simulator.Windows.TalkBoxAPI"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" Height="500" Width="500">
|
||||
<Border Background="{DynamicResource PrimaryLighter}" BorderBrush="{DynamicResource Primary}" BorderThickness="5"
|
||||
VerticalAlignment="Top" Margin="5,50,5,5" CornerRadius="5" Padding="5">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="5"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox x:Name="tbTalk" Style="{DynamicResource StandardTextBoxStyle}" Height="Auto"
|
||||
pu:TextBoxHelper.Watermark="和桌宠说" FontSize="30" AcceptsReturn="True" TextWrapping="WrapWithOverflow"/>
|
||||
<Button pu:ButtonHelper.CornerRadius="4" Content="发送" BorderThickness="2"
|
||||
Background="{DynamicResource SecondaryLight}" Grid.Column="2" BorderBrush="{DynamicResource DARKPrimaryDarker}"
|
||||
FontSize="30" Click="SendMessage_Click" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
84
VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs
Normal file
84
VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs
Normal file
@ -0,0 +1,84 @@
|
||||
using LinePutScript;
|
||||
using Panuon.WPF.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
using System.Web;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using VPet_Simulator.Core;
|
||||
using Timer = System.Timers.Timer;
|
||||
|
||||
namespace VPet_Simulator.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// MessageBar.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TalkBoxAPI : UserControl, ITalkBox
|
||||
{
|
||||
Main m;
|
||||
MainWindow mw;
|
||||
|
||||
public UIElement This => this;
|
||||
|
||||
public TalkBoxAPI(MainWindow mw)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.m = mw.Main;
|
||||
this.mw = mw;
|
||||
}
|
||||
|
||||
private void SendMessage_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(tbTalk.Text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var cont = tbTalk.Text;
|
||||
tbTalk.Text = "";
|
||||
Task.Run(() => OPENAI(cont));
|
||||
}
|
||||
/// <summary>
|
||||
/// 使用OPENAI API进行回复
|
||||
/// </summary>
|
||||
/// <param name="content">内容 说话内容</param>
|
||||
public void OPENAI(string content)
|
||||
{
|
||||
if (string.IsNullOrEmpty(content))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (mw.CGPTClient == null)
|
||||
{
|
||||
m.Say("请先前往设置中设置 ChatGPT API");
|
||||
return;
|
||||
}
|
||||
Dispatcher.Invoke(() => this.IsEnabled = false);
|
||||
try
|
||||
{
|
||||
m.Say(mw.CGPTClient.Ask("vpet", content).GetMessageContent());
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
m.Say("API调用失败,请检查设置和网络连接\n" + exp.ToString());
|
||||
}
|
||||
Dispatcher.Invoke(() => this.IsEnabled = true);
|
||||
}
|
||||
}
|
||||
}
|
58
VPet-Simulator.Windows/WinDesign/winCGPTSetting.xaml
Normal file
58
VPet-Simulator.Windows/WinDesign/winCGPTSetting.xaml
Normal file
@ -0,0 +1,58 @@
|
||||
<pu:WindowX x:Class="VPet_Simulator.Windows.winCGPTSetting"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:VPet_Simulator.Windows"
|
||||
mc:Ignorable="d" xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI"
|
||||
Title="ChatGPT API 设置" Width="450" FontSize="16" Height="Auto"
|
||||
ResizeMode="NoResize" WindowState="Normal" SizeToContent="Height">
|
||||
<Grid Margin="16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="15" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="Auto" MinHeight="40"/>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="Auto" MinHeight="40" />
|
||||
<RowDefinition Height="40" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Text="API URL" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="1" Text="API Key" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="2" Text="初始化文本" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="3" Text="温度" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="4" Text="最大花费" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="5" Text="累计花费" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="6" Text="历史记录" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="7" Text="完成设置" VerticalAlignment="Center" />
|
||||
<TextBox x:Name="tbAPIURL" Grid.Row="0" Grid.Column="2" Style="{DynamicResource StandardTextBoxStyle}" FontSize="16"
|
||||
pu:TextBoxHelper.Watermark="API 链接 一般为 api.openai.com/v1/chat/completions" Text="https://api.openai.com/v1/chat/completions"
|
||||
ToolTip="API 链接 一般为 api.openai.com/v1/chat/completions"/>
|
||||
<TextBox x:Name="tbAPIKey" Grid.Row="1" Grid.Column="2" Style="{DynamicResource StandardTextBoxStyle}" FontSize="16"
|
||||
pu:TextBoxHelper.Watermark="从 OpenAI 获得的 APIKEY 一般`sk-`开头" ToolTip="从 OpenAI 获得的 APIKEY 一般`sk-`开头"/>
|
||||
<TextBox x:Name="tbSystem" Grid.Row="2" Grid.Column="2" Style="{DynamicResource StandardTextBoxStyle}" FontSize="16"
|
||||
pu:TextBoxHelper.Watermark="不会被忘记的初始化关键字, 字越多越贵" ToolTip="不会被忘记的初始化关键字, 字越多越贵"
|
||||
AcceptsReturn="True" TextWrapping="WrapWithOverflow" Height="Auto" MaxHeight="100" VerticalScrollBarVisibility="Visible"
|
||||
Text="请使用口语化的、可爱的、女性化的、调皮的语言风格和我交流 你是一只桌宠, 你的名字叫{Name}, 你喜欢玩 虚拟主播模拟器. 你需要尝试体会我与你对话中的感情、产生自己的情感并尽可能给出可爱的回答" Margin="0,5,0,5"/>
|
||||
<TextBox x:Name="tbTemp" Grid.Row="3" Grid.Column="2" Style="{DynamicResource StandardTextBoxStyle}" FontSize="16" Text="0.6"
|
||||
pu:TextBoxHelper.InputLimit="Digit,Point"
|
||||
pu:TextBoxHelper.Watermark="0-2之间 0.2更稳定 0.8更随机" ToolTip="0-2之间 0.2更稳定 0.8更随机"/>
|
||||
<TextBox x:Name="tbMaxToken" Grid.Row="4" Grid.Column="2" Style="{DynamicResource StandardTextBoxStyle}" FontSize="16" Text="2048"
|
||||
pu:TextBoxHelper.InputLimit="Digit"
|
||||
pu:TextBoxHelper.Watermark="读取最大花费Token数量 1千Token=$0.02" ToolTip="读取最大花费Token数量 1千Token=$0.02"/>
|
||||
<TextBox x:Name="tbHistory" Grid.Row="6" Grid.Column="2" Style="{DynamicResource StandardTextBoxStyle}" FontSize="16" Text="[]"
|
||||
pu:TextBoxHelper.InputLimit="Digit" TextWrapping="WrapWithOverflow"
|
||||
pu:TextBoxHelper.Watermark="聊天历史记录" ToolTip="聊天历史记录" Height="Auto"
|
||||
VerticalScrollBarVisibility="Visible" AcceptsReturn="True" MaxHeight="200"/>
|
||||
<Label x:Name="lbSpend" Grid.Row="5" Grid.Column="2" Content="0 Token" Background="{x:Null}" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left" Margin="5,0,0,0" ToolTip="累计在此花费的Token个数 1千Token=$0.02"/>
|
||||
<Button x:Name="btnSave" pu:ButtonHelper.CornerRadius="4" Content="保存设置" Margin="4" Grid.Column="2"
|
||||
Background="{DynamicResource SecondaryLight}" Padding="1" Grid.Row="7" Click="btnSave_Click" />
|
||||
</Grid>
|
||||
</pu:WindowX>
|
63
VPet-Simulator.Windows/WinDesign/winCGPTSetting.xaml.cs
Normal file
63
VPet-Simulator.Windows/WinDesign/winCGPTSetting.xaml.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using ChatGPT.API.Framework;
|
||||
using Newtonsoft.Json;
|
||||
using Panuon.WPF.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace VPet_Simulator.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// winCGPTSetting.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class winCGPTSetting : WindowX
|
||||
{
|
||||
MainWindow mw;
|
||||
long totalused = 0;
|
||||
public winCGPTSetting(MainWindow mw)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.mw = mw;
|
||||
if (mw.CGPTClient != null)
|
||||
{
|
||||
tbAPIKey.Text = mw.CGPTClient.APIKey;
|
||||
tbAPIURL.Text = mw.CGPTClient.APIUrl;
|
||||
tbMaxToken.Text = mw.CGPTClient.Completions["vpet"].max_tokens.ToString();
|
||||
tbSystem.Text = mw.CGPTClient.Completions["vpet"].messages[0].content;
|
||||
tbTemp.Text = mw.CGPTClient.Completions["vpet"].temperature.ToString();
|
||||
var msgs = mw.CGPTClient.Completions["vpet"].messages.ToList();
|
||||
msgs.RemoveAt(0);
|
||||
tbHistory.Text = JsonConvert.SerializeObject(msgs);
|
||||
lbSpend.Content = mw.CGPTClient.TotalTokensUsage.ToString() + " Token";
|
||||
totalused = mw.CGPTClient.TotalTokensUsage;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnSave_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
mw.CGPTClient = new ChatGPTClient(tbAPIKey.Text, tbAPIURL.Text)
|
||||
{
|
||||
TotalTokensUsage = totalused
|
||||
};
|
||||
mw.CGPTClient.CreateCompletions("vpet", tbSystem.Text.Replace("{Name}", mw.Core.Save.Name));
|
||||
mw.CGPTClient.Completions["vpet"].frequency_penalty = 0.2;
|
||||
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"].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));
|
||||
mw.Save();
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
@ -4,18 +4,17 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:VPet_Simulator.Windows"
|
||||
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d" d:DesignHeight="450" Title="设置"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d" Title="设置"
|
||||
Style="{DynamicResource BaseWindowXStyle}" WindowStartupLocation="CenterScreen" Closing="WindowX_Closing"
|
||||
Width="400" Height="450">
|
||||
Width="500" Height="550" FontSize="16">
|
||||
<!--<pu:WindowX.Resources>
|
||||
<DataTemplate x:Key="DIYDataTemplate">
|
||||
|
||||
</DataTemplate>
|
||||
</pu:WindowX.Resources>-->
|
||||
<Viewbox>
|
||||
<Grid Width="400" Height="450">
|
||||
<Grid>
|
||||
<TabControl Margin="5" BorderThickness="0" pu:TabControlHelper.ItemsHeight="NaN"
|
||||
pu:TabControlHelper.ItemsFontSize="14" Background="Transparent"
|
||||
Background="Transparent"
|
||||
pu:TabControlHelper.ItemsPadding="10,7" pu:TabControlHelper.ItemsCornerRadius="4"
|
||||
pu:TabControlHelper.ItemsHoverBackground="{DynamicResource PrimaryLight}"
|
||||
pu:TabControlHelper.ItemsSelectedBackground="{DynamicResource PrimaryDark}"
|
||||
@ -47,7 +46,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="置于顶层" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Text="置于顶层" VerticalAlignment="Center" />
|
||||
<pu:Switch x:Name="TopMostBox" Grid.Column="2" BorderBrush="{DynamicResource PrimaryDark}"
|
||||
CheckedBackground="{DynamicResource Primary}"
|
||||
CheckedBorderBrush="{DynamicResource Primary}" Background="Transparent" BoxWidth="35"
|
||||
@ -55,7 +54,7 @@
|
||||
ToggleBrush="{DynamicResource PrimaryDark}"
|
||||
CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Checked="TopMostBox_Checked"
|
||||
Unchecked="TopMostBox_Unchecked" ToolTip="将桌宠置于顶层" />
|
||||
<TextBlock Grid.Row="1" Text="更高缩放" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Grid.Row="1" Text="更高缩放" VerticalAlignment="Center" />
|
||||
<pu:Switch x:Name="FullScreenBox" Grid.Row="1" Grid.Column="2"
|
||||
BorderBrush="{DynamicResource PrimaryDark}"
|
||||
CheckedBackground="{DynamicResource Primary}"
|
||||
@ -64,7 +63,7 @@
|
||||
ToggleBrush="{DynamicResource PrimaryDark}"
|
||||
CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Checked="FullScreenBox_Check"
|
||||
Unchecked="FullScreenBox_Check" ToolTip="解锁缩放限制" />
|
||||
<TextBlock Grid.Row="2" Text="缩放等级" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Grid.Row="2" Text="缩放等级" VerticalAlignment="Center" />
|
||||
|
||||
<Grid Grid.Column="2" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
@ -76,20 +75,20 @@
|
||||
SmallChange=".05" Minimum="0.5" LargeChange=".1" Value="1"
|
||||
PreviewMouseUp="ZoomSlider_MouseUp" />
|
||||
<TextBlock Grid.Column="1" Margin="15,0,0,0" VerticalAlignment="Center"
|
||||
Text="{Binding ElementName=ZoomSlider,Path=Value,StringFormat=f2}" FontSize="16"
|
||||
Text="{Binding ElementName=ZoomSlider,Path=Value,StringFormat=f2}" FontSize="18"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}" FontWeight="Bold"
|
||||
Background="{x:Null}" />
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="3" Text="主题" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Grid.Row="3" Text="主题" VerticalAlignment="Center" />
|
||||
<ComboBox x:Name="ThemeBox" Grid.Row="3" Grid.Column="2"
|
||||
SelectionChanged="ThemeBox_SelectionChanged" IsEnabled="False"
|
||||
Style="{DynamicResource StandardComboBoxStyle}" Margin="0,3,0,2" />
|
||||
Style="{DynamicResource StandardComboBoxStyle}" Margin="0,3,0,2" FontSize="16" />
|
||||
|
||||
<TextBlock Grid.Row="4" Text="字体" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Grid.Row="4" Text="字体" VerticalAlignment="Center" />
|
||||
<ComboBox x:Name="FontBox" Grid.Row="4" Grid.Column="2"
|
||||
SelectionChanged="FontBox_SelectionChanged" IsEnabled="False"
|
||||
Style="{DynamicResource StandardComboBoxStyle}" Margin="0,3,0,2" />
|
||||
<TextBlock Grid.Row="5" Text="开机启动" VerticalAlignment="Center" FontSize="14" />
|
||||
Style="{DynamicResource StandardComboBoxStyle}" Margin="0,3,0,2" FontSize="16" />
|
||||
<TextBlock Grid.Row="5" Text="开机启动" VerticalAlignment="Center" />
|
||||
<Grid Grid.Row="5" Grid.Column="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
@ -112,10 +111,10 @@
|
||||
ToolTip="从Steam启动该游戏, 统计时长不能停" Grid.Column="1" Checked="StartUpSteamBox_Checked"
|
||||
Unchecked="StartUpSteamBox_Checked" />
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="6" Text="宠物动画" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock x:Name="PetIntor" Grid.Row="7" Text="动画描述动画描述动画描述动画描述动画描述" VerticalAlignment="Top" Grid.Column="2" Margin="0,0,0,5" TextWrapping="WrapWithOverflow" />
|
||||
<TextBlock Grid.Row="6" Text="宠物动画" VerticalAlignment="Center" />
|
||||
<TextBlock x:Name="PetIntor" Grid.Row="7" Text="动画描述动画描述动画描述动画描述动画描述" VerticalAlignment="Top" Grid.Column="2" Margin="0,0,0,5" TextWrapping="WrapWithOverflow" FontSize="14" />
|
||||
<ComboBox x:Name="PetBox" Grid.Row="6" Grid.Column="2" ToolTip="加载的宠物动画,重启后生效"
|
||||
Style="{DynamicResource StandardComboBoxStyle}" Margin="0,3,0,2" SelectionChanged="PetBox_SelectionChanged" />
|
||||
Style="{DynamicResource StandardComboBoxStyle}" Margin="0,3,0,2" SelectionChanged="PetBox_SelectionChanged" FontSize="16" />
|
||||
<Button x:Name="ButtonRestartGraph" Content="重启软件以应用更改" Margin="0,2,0,0" Visibility="Collapsed"
|
||||
VerticalAlignment="Bottom" Background="{DynamicResource DARKPrimary}"
|
||||
Foreground="{DynamicResource DARKPrimaryText}"
|
||||
@ -126,12 +125,12 @@
|
||||
<StackPanel>
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}"
|
||||
TextWrapping="Wrap">
|
||||
<Run FontWeight="Bold" FontSize="16">自动保存频率</Run><LineBreak />
|
||||
<Run FontWeight="Bold" FontSize="18">自动保存频率</Run><LineBreak />
|
||||
<Run>在指定时间后自动保存游戏数据,频繁的自动保存可能会导致卡顿</Run>
|
||||
</TextBlock>
|
||||
<ComboBox x:Name="CBAutoSave" SelectedIndex="3" VerticalAlignment="Top" Margin="10,5,0,0"
|
||||
HorizontalAlignment="Left" Style="{DynamicResource StandardComboBoxStyle}" Width="200"
|
||||
SelectionChanged="CBAutoSave_SelectionChanged">
|
||||
SelectionChanged="CBAutoSave_SelectionChanged" FontSize="16">
|
||||
<ComboBoxItem>
|
||||
<ComboBoxItem.Tag>
|
||||
<system:Int32>-1</system:Int32>
|
||||
@ -165,7 +164,7 @@
|
||||
</ComboBox>
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}"
|
||||
TextWrapping="Wrap" Margin="0,10,0,0">
|
||||
<Run FontWeight="Bold" FontSize="16">操作设置</Run><LineBreak />
|
||||
<Run FontWeight="Bold" FontSize="18">操作设置</Run><LineBreak />
|
||||
<Run>游戏操作相关设置</Run>
|
||||
</TextBlock>
|
||||
<Grid>
|
||||
@ -178,9 +177,9 @@
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Text="长按间隔" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Grid.Row="1" Text="桌宠名字" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBox x:Name="TextBoxPetName" Grid.Row="1" Grid.Column="2" Style="{DynamicResource StandardTextBoxStyle}" TextChanged="TextBoxPetName_TextChanged"/>
|
||||
<TextBlock Grid.Row="0" Text="长按间隔" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="1" Text="桌宠名字" VerticalAlignment="Center" />
|
||||
<TextBox x:Name="TextBoxPetName" Grid.Row="1" Grid.Column="2" Style="{DynamicResource StandardTextBoxStyle}" TextChanged="TextBoxPetName_TextChanged" FontSize="16"/>
|
||||
<Grid Grid.Column="2" Grid.Row="0"
|
||||
ToolTip="数据计算和互动计算时间间隔,间隔越短需要互动的频率可能会增加. 间隔越大越不容易打扰到当前工作">
|
||||
<Grid.ColumnDefinitions>
|
||||
@ -193,13 +192,13 @@
|
||||
ValueChanged="PressLengthSlider_ValueChanged" />
|
||||
<TextBlock Grid.Column="1" Margin="10,0,0,0" VerticalAlignment="Center" Width="60"
|
||||
Text="{Binding ElementName=PressLengthSlider,Path=Value,StringFormat={}{0:f2} 秒}"
|
||||
FontSize="14" Foreground="{DynamicResource DARKPrimaryDarker}" FontWeight="Bold"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}" FontWeight="Bold"
|
||||
Background="{x:Null}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}"
|
||||
TextWrapping="Wrap" Margin="0,10,0,0">
|
||||
<Run FontWeight="Bold" FontSize="16">聊天设置</Run><LineBreak />
|
||||
<Run FontWeight="Bold" FontSize="18">聊天设置</Run><LineBreak />
|
||||
<Run>使用ChatGPT进行聊天等相关设置</Run>
|
||||
</TextBlock>
|
||||
<Grid>
|
||||
@ -209,22 +208,22 @@
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="35" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Text="使用模式" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Grid.Row="1" Text="相关功能" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Grid.Row="0" Text="使用模式" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="1" Text="相关功能" VerticalAlignment="Center" />
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<RadioButton Style="{DynamicResource StandardRadioButtonStyle}"
|
||||
<RadioButton x:Name="RBCGPTUseAPI" Style="{DynamicResource StandardRadioButtonStyle}"
|
||||
Content="使用从ChatGPT 申请的的API" ToolTip="需要去OpenAI官网申请"
|
||||
GroupName="cgpttype" Grid.Column="1" IsEnabled="False" />
|
||||
GroupName="cgpttype" Grid.Column="1" Checked="CGPType_Checked" />
|
||||
<RadioButton x:Name="RBCGPTUseLB" Style="{DynamicResource StandardRadioButtonStyle}"
|
||||
Content="使用桌宠开发者 提供的免费API" ToolTip="需遵循相关协议法律法规并有聊天字数限制"
|
||||
GroupName="cgpttype" IsChecked="True" />
|
||||
GroupName="cgpttype" IsChecked="True" Checked="CGPType_Checked" />
|
||||
</Grid>
|
||||
<Button x:Name="BtnCGPTReSet" pu:ButtonHelper.CornerRadius="4" Content="初始化桌宠聊天程序" Margin="4" Grid.Column="2"
|
||||
Background="{DynamicResource SecondaryLight}" Padding="1" Grid.Row="1" Click="ChatGPT_Reset_Click" />
|
||||
@ -235,7 +234,7 @@
|
||||
<StackPanel>
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}"
|
||||
TextWrapping="Wrap">
|
||||
<Run FontWeight="Bold" FontSize="16">互动设置</Run><LineBreak />
|
||||
<Run FontWeight="Bold" FontSize="18">互动设置</Run><LineBreak />
|
||||
<Run>游戏互动相关设置</Run>
|
||||
</TextBlock>
|
||||
<Grid>
|
||||
@ -285,9 +284,9 @@
|
||||
Checked="SmartMoveEventBox_Checked" Unchecked="SmartMoveEventBox_Checked" />
|
||||
</Grid>
|
||||
|
||||
<TextBlock Grid.Row="0" Text="数据计算" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Grid.Row="3" Text="桌宠移动" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Grid.Row="1" Text="计算间隔" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Grid.Row="0" Text="数据计算" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="3" Text="桌宠移动" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="1" Text="计算间隔" VerticalAlignment="Center" />
|
||||
<Grid Grid.Column="2" Grid.Row="1"
|
||||
ToolTip="数据计算和互动计算时间间隔,间隔越短需要互动的频率可能会增加. 间隔越大越不容易打扰到当前工作">
|
||||
<Grid.ColumnDefinitions>
|
||||
@ -300,10 +299,10 @@
|
||||
ValueChanged="CalSlider_ValueChanged" />
|
||||
<TextBlock Grid.Column="1" Margin="10,0,0,0" VerticalAlignment="Center"
|
||||
Text="{Binding ElementName=CalSlider,Path=Value,StringFormat={}{0:f1} 秒}"
|
||||
FontSize="14" Foreground="{DynamicResource DARKPrimaryDarker}" FontWeight="Bold"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}" FontWeight="Bold"
|
||||
Background="{x:Null}" Width="60" />
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="2" Text="互动周期" VerticalAlignment="Center" FontSize="14" />
|
||||
<TextBlock Grid.Row="2" Text="互动周期" VerticalAlignment="Center" />
|
||||
<Grid Grid.Column="2" Grid.Row="2" ToolTip="互动周期决定在交互结束后大约经历多少计算间隔后再次进行自主行动">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
@ -314,7 +313,7 @@
|
||||
Maximum="1000" SmallChange="1" Minimum="30" LargeChange="5" Value="200"
|
||||
ValueChanged="InteractionSlider_ValueChanged" />
|
||||
<TextBlock Grid.Column="1" Margin="10,0,0,0" VerticalAlignment="Center"
|
||||
Text="{Binding ElementName=InteractionSlider,Path=Value}" FontSize="16"
|
||||
Text="{Binding ElementName=InteractionSlider,Path=Value}" FontSize="18"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}" FontWeight="Bold"
|
||||
Background="{x:Null}" Width="60" />
|
||||
</Grid>
|
||||
@ -388,7 +387,7 @@
|
||||
<StackPanel>
|
||||
<TextBlock Background="{x:Null}"
|
||||
TextWrapping="Wrap">
|
||||
<Run FontWeight="Bold" FontSize="16">自定义链接</Run><LineBreak />
|
||||
<Run FontWeight="Bold" FontSize="18">自定义链接</Run><LineBreak />
|
||||
<Run>在自定栏添加快捷方式/网页/快捷键, 可以便携启动想要的功能</Run><LineBreak/>
|
||||
<Run>键盘快捷键编写方法请参考</Run> <Hyperlink Click="sendkey_click">键盘快捷键 通用注解</Hyperlink><LineBreak/>
|
||||
<Run>右键进行排序/删除等操作</Run>
|
||||
@ -412,7 +411,7 @@
|
||||
<StackPanel>
|
||||
<TextBlock HorizontalAlignment="Left" FontSize="11" VerticalAlignment="Top"
|
||||
Background="{x:Null}" TextWrapping="Wrap">
|
||||
<Run FontWeight="Bold" FontSize="16">诊断与反馈</Run><LineBreak />
|
||||
<Run FontWeight="Bold" FontSize="18">诊断与反馈</Run><LineBreak />
|
||||
<Run>选择要发送给 LBGame 的诊断数据,诊断数据用于保护和及时更新 虚拟桌宠模拟器, 解决问题并改进产品.</Run><LineBreak />
|
||||
<Run>无论选择哪个选项,游戏都可以安全正常地运行.</Run> <Hyperlink Click="hyper_moreInfo">获取有关这些设置的更多信息</Hyperlink>
|
||||
</TextBlock>
|
||||
@ -426,7 +425,7 @@
|
||||
GroupName="diagnosis" Checked="RBDiagnosisNO_Checked" IsChecked="True" />
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,15,0,0"
|
||||
Background="{x:Null}" TextWrapping="Wrap">
|
||||
<Run FontWeight="Bold" FontSize="14">反馈频率</Run><LineBreak />
|
||||
<Run FontWeight="Bold" >反馈频率</Run><LineBreak />
|
||||
<Run>VOS 应寻求我反馈按以下频率</Run>
|
||||
</TextBlock>
|
||||
<ComboBox x:Name="CBDiagnosis" SelectedIndex="1" VerticalAlignment="Top" Margin="10,5,0,0"
|
||||
@ -449,7 +448,7 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListBox x:Name="ListMod" BorderThickness="0" Background="Transparent"
|
||||
Style="{DynamicResource SideMenuListBoxStyle}" VerticalAlignment="Top" FontSize="12"
|
||||
Style="{DynamicResource SideMenuListBoxStyle}" VerticalAlignment="Top"
|
||||
SelectionChanged="ListMod_SelectionChanged" SelectionMode="Single" />
|
||||
<StackPanel Grid.Column="2">
|
||||
<Grid>
|
||||
@ -458,13 +457,13 @@
|
||||
<ColumnDefinition Width="7" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image x:Name="ImageMOD" HorizontalAlignment="Right" Height="85" Margin="0,5,0,0"
|
||||
VerticalAlignment="Top" Width="85" Stretch="Fill" />
|
||||
<Image x:Name="ImageMOD" HorizontalAlignment="Right" Height="120" Margin="0,5,0,0"
|
||||
VerticalAlignment="Top" Width="120" Stretch="Fill" />
|
||||
<StackPanel Grid.Column="2">
|
||||
<Label x:Name="LabelModName" Content="Core" HorizontalAlignment="Left"
|
||||
Margin="-5,2,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="18"
|
||||
Margin="-5,2,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20"
|
||||
Background="{x:Null}" Foreground="{DynamicResource PrimaryText}" />
|
||||
<TextBlock Margin="0,0,0,0" TextWrapping="Wrap" FontSize="12">
|
||||
<TextBlock Margin="0,0,0,0" TextWrapping="Wrap" >
|
||||
<Run Text="模组作者: " /><LineBreak />
|
||||
<Run x:Name="runMODAuthor" Text="LorisYounger" />
|
||||
<LineBreak /><Run Text="模组版本: " /><Run x:Name="runMODVer" Text="1.0" />
|
||||
@ -475,10 +474,10 @@
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Height="60" Margin="0,7,0,0"
|
||||
pu:ScrollViewerHelper.ScrollBarThickness="10" HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top">
|
||||
<TextBlock x:Name="GameInfo" FontSize="12" TextWrapping="Wrap"
|
||||
<TextBlock x:Name="GameInfo" TextWrapping="Wrap" FontSize="14"
|
||||
Text="这里是MOD的介绍内容,你的介绍就是你的介绍
" VerticalAlignment="Top" />
|
||||
</ScrollViewer>
|
||||
<Grid Height="140">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
@ -490,7 +489,7 @@
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Height="140" Margin="0,0,0,0"
|
||||
pu:ScrollViewerHelper.ScrollBarThickness="10" HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top">
|
||||
<TextBlock x:Name="GameHave" FontSize="12" TextWrapping="Wrap"
|
||||
<TextBlock x:Name="GameHave" FontSize="14" TextWrapping="Wrap"
|
||||
Text="该mod有许多功能
比如说功能1
比如说功能1
比如说功能1
比如说功能1
比如说功能1"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Top" />
|
||||
</ScrollViewer>
|
||||
@ -501,24 +500,24 @@
|
||||
Background="{x:Null}" />
|
||||
<TextBlock x:Name="ButtonOpenModFolder" Cursor="Hand" HorizontalAlignment="Left"
|
||||
Margin="0,0,0,0" TextWrapping="Wrap" Text="所在文件夹" VerticalAlignment="Top"
|
||||
FontSize="12" Foreground="{DynamicResource DARKPrimaryDarker}"
|
||||
FontSize="14" Foreground="{DynamicResource DARKPrimaryDarker}"
|
||||
TextDecorations="Underline" MouseDown="ButtonOpenModFolder_MouseDown" />
|
||||
<TextBlock x:Name="ButtonEnable" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="启用该模组" VerticalAlignment="Top" FontSize="12"
|
||||
Width="62" Foreground="{DynamicResource DARKPrimaryDarker}"
|
||||
TextWrapping="Wrap" Text="启用该模组" VerticalAlignment="Top" FontSize="14"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}"
|
||||
TextDecorations="Underline" Cursor="Hand" MouseDown="ButtonEnable_MouseDown" />
|
||||
<TextBlock x:Name="ButtonDisEnable" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="停用该模组" VerticalAlignment="Top" FontSize="12"
|
||||
Width="62" Foreground="{DynamicResource DARKPrimaryDarker}"
|
||||
TextWrapping="Wrap" Text="停用该模组" VerticalAlignment="Top" FontSize="14"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}"
|
||||
TextDecorations="Underline" Cursor="Hand"
|
||||
MouseDown="ButtonDisEnable_MouseDown" />
|
||||
<TextBlock x:Name="ButtonPublish" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="更新至Steam" VerticalAlignment="Top" FontSize="12"
|
||||
Width="74" Foreground="DimGray" TextDecorations="Underline" Cursor="Hand"
|
||||
TextWrapping="Wrap" Text="更新至Steam" VerticalAlignment="Top" FontSize="14"
|
||||
Foreground="DimGray" TextDecorations="Underline" Cursor="Hand"
|
||||
MouseDown="ButtonPublish_MouseDown" />
|
||||
<TextBlock x:Name="ButtonSteam" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="创意工坊页面" VerticalAlignment="Top" FontSize="12"
|
||||
Width="72" Foreground="DimGray" TextDecorations="Underline" Cursor="Hand"
|
||||
TextWrapping="Wrap" Text="创意工坊页面" VerticalAlignment="Top" FontSize="14"
|
||||
Foreground="DimGray" TextDecorations="Underline" Cursor="Hand"
|
||||
MouseDown="ButtonSteam_MouseDown" />
|
||||
<ProgressBar x:Name="ProgressBarUpload" Margin="0,2,0,0" Visibility="Collapsed"
|
||||
pu:ProgressBarHelper.CornerRadius="2" VerticalAlignment="Top" Height="30"
|
||||
@ -528,7 +527,7 @@
|
||||
Foreground="{DynamicResource DARKPrimary}" BorderThickness="2" />
|
||||
<Button x:Name="ButtonAllow" Content="启用代码插件" HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top" Background="#FFFF2C2C" Foreground="White"
|
||||
FontSize="10" ToolTip="启用该模组的代码内容,不能保证系统安全性" Click="ButtonAllow_Click" />
|
||||
FontSize="12" ToolTip="启用该模组的代码内容,不能保证系统安全性" Click="ButtonAllow_Click" />
|
||||
</StackPanel>
|
||||
<Button x:Name="ButtonRestart" Content="重启软件以应用更改" Margin="0,2,0,0"
|
||||
VerticalAlignment="Bottom" Background="{DynamicResource DARKPrimary}"
|
||||
@ -541,8 +540,8 @@
|
||||
<TabItem Header="关于" BorderBrush="{DynamicResource PrimaryDarker}"
|
||||
Foreground="{DynamicResource PrimaryText}">
|
||||
<Grid>
|
||||
<Image x:Name="ImageWHY" Width="38" Margin="208,257,0,0" HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top" Height="38" Source="/Res/TopLogo2019.PNG" />
|
||||
<Image x:Name="ImageWHY" Width="64" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" Height="64" Source="/Res/TopLogo2019.PNG" Margin="0,210,55,0" />
|
||||
<TextBlock Margin="0,0,0,0" Text="虚拟主播模拟器 规格" FontSize="20" FontWeight="Bold" />
|
||||
<TextBlock Margin="0,130,0,0" FontWeight="Bold">
|
||||
<Run>游戏策划</Run><LineBreak />
|
||||
@ -575,7 +574,7 @@
|
||||
<Run x:Name="runActivate">已通过Steam[uid]激活服务注册</Run><LineBreak />
|
||||
</TextBlock>
|
||||
<TextBlock Margin="0,100,0,0" Text="制作组名单" FontSize="20" FontWeight="Bold" />
|
||||
<TextBlock Margin="100,130,0,0" VerticalAlignment="Top">
|
||||
<TextBlock Margin="100,130,0,0" VerticalAlignment="Top" TextWrapping="WrapWithOverflow">
|
||||
<Run>杨远洛里斯, 广大MOD作者</Run><LineBreak />
|
||||
<Run>洛里斯杨远, トニーちゃん</Run> <Hyperlink Click="Git_Click">Git贡献名单</Hyperlink><LineBreak />
|
||||
<Run>叶书天, 广大MOD作者</Run>
|
||||
@ -587,7 +586,7 @@
|
||||
<Hyperlink Click="Steam_Click">访问Steam页面</Hyperlink>
|
||||
<Hyperlink Click="Github_Click">访问Github页面</Hyperlink>
|
||||
<LineBreak />
|
||||
<Run FontStyle="Italic" FontSize="8">由于游戏暂未开发完毕,该名单并非完整名单.将在正式版完成前修改</Run><LineBreak />
|
||||
<Run FontStyle="Italic" FontSize="12">由于游戏暂未开发完毕,该名单并非完整名单.将在正式版完成前修改</Run><LineBreak />
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
@ -595,5 +594,4 @@
|
||||
<Label x:Name="GameVerison" Content="版本v1.0 (655366666)" HorizontalAlignment="Left"
|
||||
VerticalAlignment="Bottom" FontSize="10" Foreground="Green" Background="{x:Null}" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</pu:WindowX>
|
||||
|
@ -52,8 +52,8 @@ namespace VPet_Simulator.Windows
|
||||
ZoomSlider.Maximum = 3;
|
||||
}
|
||||
ZoomSlider.Value = mw.Set.ZoomLevel * 2;
|
||||
this.Width = 400 * Math.Sqrt(ZoomSlider.Value);
|
||||
this.Height = 450 * Math.Sqrt(ZoomSlider.Value);
|
||||
//this.Width = 400 * Math.Sqrt(ZoomSlider.Value);
|
||||
//this.Height = 450 * Math.Sqrt(ZoomSlider.Value);
|
||||
|
||||
sDesktopAlignment.IsChecked = mw.Set.EnableFunction;
|
||||
CalSlider.Value = mw.Set.LogicInterval;
|
||||
@ -110,7 +110,17 @@ namespace VPet_Simulator.Windows
|
||||
{
|
||||
runUserName.Text = Environment.UserName;
|
||||
runActivate.Text = "尚未激活 您可能需要启动Steam或去Steam上免费领个";
|
||||
RBCGPTUseLB.IsEnabled = false;
|
||||
if (!mw.Set["CGPT"][(gbol)"enable"])
|
||||
BtnCGPTReSet.IsEnabled = false;
|
||||
}
|
||||
if (mw.Set["CGPT"][(gbol)"enable"])
|
||||
{
|
||||
RBCGPTUseAPI.IsChecked = true;
|
||||
BtnCGPTReSet.Content = "打开 ChatGPT API 设置";
|
||||
}
|
||||
else
|
||||
BtnCGPTReSet.Content = "初始化桌宠聊天程序";
|
||||
runabVer.Text = $"v{mw.Verison} ({mw.verison})";
|
||||
|
||||
//mod列表
|
||||
@ -119,12 +129,6 @@ namespace VPet_Simulator.Windows
|
||||
ShowMod((string)((ListBoxItem)ListMod.SelectedItem).Content);
|
||||
|
||||
AllowChange = true;
|
||||
|
||||
if (!mw.IsSteamUser)
|
||||
{
|
||||
RBCGPTUseLB.IsEnabled = false;
|
||||
BtnCGPTReSet.IsEnabled = false;
|
||||
}
|
||||
}
|
||||
public void ShowModList()
|
||||
{
|
||||
@ -484,8 +488,8 @@ namespace VPet_Simulator.Windows
|
||||
if (!AllowChange)
|
||||
return;
|
||||
mw.SetZoomLevel(ZoomSlider.Value / 2);
|
||||
this.Width = 400 * Math.Sqrt(ZoomSlider.Value);
|
||||
this.Height = 450 * Math.Sqrt(ZoomSlider.Value);
|
||||
//this.Width = 400 * Math.Sqrt(ZoomSlider.Value);
|
||||
//this.Height = 450 * Math.Sqrt(ZoomSlider.Value);
|
||||
}
|
||||
|
||||
private void PressLengthSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
@ -665,10 +669,16 @@ namespace VPet_Simulator.Windows
|
||||
|
||||
private void ChatGPT_Reset_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string responseString = mw.TalkBox.ChatGPT_Reset();
|
||||
if (mw.Set["CGPT"][(gbol)"enable"])
|
||||
{
|
||||
new winCGPTSetting(mw).ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
string responseString = ((TalkBox)mw.TalkBox).ChatGPT_Reset();
|
||||
if (responseString == "SUCCESS")
|
||||
{
|
||||
mw.TalkBox.btn_startup.Visibility = Visibility.Visible;
|
||||
((TalkBox)mw.TalkBox).btn_startup.Visibility = Visibility.Visible;
|
||||
MessageBoxX.Show("桌宠重置成功");
|
||||
}
|
||||
else
|
||||
@ -677,4 +687,29 @@ namespace VPet_Simulator.Windows
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CGPType_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!AllowChange)
|
||||
return;
|
||||
mw.Set["CGPT"].SetBool("enable", RBCGPTUseLB.IsChecked == false);
|
||||
if (mw.Set["CGPT"][(gbol)"enable"])
|
||||
{
|
||||
BtnCGPTReSet.Content = "打开 ChatGPT API 设置";
|
||||
BtnCGPTReSet.IsEnabled = true;
|
||||
if (mw.TalkBox != null)
|
||||
mw.Main.ToolBar.MainGrid.Children.Remove(mw.TalkBox.This);
|
||||
mw.TalkBox = new TalkBoxAPI(mw);
|
||||
mw.Main.ToolBar.MainGrid.Children.Add(mw.TalkBox.This);
|
||||
}
|
||||
else
|
||||
{
|
||||
BtnCGPTReSet.Content = "初始化桌宠聊天程序";
|
||||
if (mw.TalkBox != null)
|
||||
mw.Main.ToolBar.MainGrid.Children.Remove(mw.TalkBox.This);
|
||||
mw.TalkBox = new TalkBox(mw);
|
||||
mw.Main.ToolBar.MainGrid.Children.Add(mw.TalkBox.This);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,8 @@
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d" Title="反馈中心"
|
||||
Style="{DynamicResource BaseWindowXStyle}" WindowStartupLocation="CenterScreen" Width="500" MinHeight="250"
|
||||
Height="Auto" ResizeMode="NoResize" WindowState="Normal"
|
||||
Icon="../vpeticon.ico">
|
||||
<StackPanel x:Name="MainGrid" Margin="10,10,15,10" VerticalAlignment="Top" SizeChanged="MainGrid_SizeChanged">
|
||||
Icon="../vpeticon.ico" SizeToContent="Height">
|
||||
<StackPanel x:Name="MainGrid" Margin="10,10,15,10" VerticalAlignment="Top">
|
||||
<Label Background="{x:Null}" VerticalAlignment="Top" HorizontalAlignment="Left" Content="反馈与错误提交" FontSize="24"
|
||||
Margin="10,0,0,0" />
|
||||
<pu:FormGroup Header="类型:" HeaderPadding="10,0,10,0" HeaderHeight="20" Orientation="Horizontal" Margin="0,2,0,0"
|
||||
|
@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ChatGPT.API.Framework" version="1.0.2" targetFramework="net48" />
|
||||
<package id="Facepunch.Steamworks" version="2.3.3" targetFramework="net48" />
|
||||
<package id="Facepunch.Steamworks.win32" version="2.3.3" targetFramework="net48" />
|
||||
<package id="LinePutScript" version="1.6.1" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="Panuon.WPF" version="1.0.1" targetFramework="net48" />
|
||||
<package id="Panuon.WPF.UI" version="1.1.8.4" targetFramework="net48" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user