diff --git a/VPet-Simulator.Core/Display/MainLogic.cs b/VPet-Simulator.Core/Display/MainLogic.cs
index b63e12b..6726657 100644
--- a/VPet-Simulator.Core/Display/MainLogic.cs
+++ b/VPet-Simulator.Core/Display/MainLogic.cs
@@ -36,7 +36,7 @@ namespace VPet_Simulator.Core
/// 说话内容
public void Say(string text, GraphCore.Helper.SayType type = GraphCore.Helper.SayType.Shining)
{
- OnSay.Invoke(text);
+ OnSay?.Invoke(text);
if (type != GraphCore.Helper.SayType.None && DisplayType == GraphCore.GraphType.Default)
Display(GraphCore.Helper.Convert(type, GraphCore.Helper.AnimatType.A_Start), () =>
{
@@ -211,7 +211,7 @@ namespace VPet_Simulator.Core
/// 智能移动周期
public void SetMoveMode(bool AllowMove, bool smartMove, int SmartMoveInterval)
{
- MoveTimer.Enabled = false; ;
+ MoveTimer.Enabled = false;
if (AllowMove)
{
MoveTimer.AutoReset = true;
diff --git a/VPet-Simulator.Windows.Interface/MainPlugin.cs b/VPet-Simulator.Windows.Interface/MainPlugin.cs
index d31f4ff..c99708e 100644
--- a/VPet-Simulator.Windows.Interface/MainPlugin.cs
+++ b/VPet-Simulator.Windows.Interface/MainPlugin.cs
@@ -11,6 +11,10 @@ namespace VPet_Simulator.Windows.Interface
///
public abstract class MainPlugin
{
+ ///
+ /// 通过插件名称定位插件
+ ///
+ public abstract string PluginName { get; }
///
/// 主窗体, 主程序提供的各种功能和设置等 大部分参数和调用均在这里
///
diff --git a/VPet-Simulator.Windows.Interface/Setting.cs b/VPet-Simulator.Windows.Interface/Setting.cs
index b7c413b..1a8a38a 100644
--- a/VPet-Simulator.Windows.Interface/Setting.cs
+++ b/VPet-Simulator.Windows.Interface/Setting.cs
@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Windows;
namespace VPet_Simulator.Windows.Interface
{
@@ -283,5 +284,52 @@ namespace VPet_Simulator.Windows.Interface
get => this["gameconfig"].GetString("petgraph", "默认虚拟桌宠");
set => this["gameconfig"].SetString("petgraph", value);
}
+
+ ///
+ /// 是否记录游戏退出位置 (默认:是)
+ ///
+ public bool StartRecordLast
+ {
+ get => !this["gameconfig"].GetBool("startboot");
+ set => this["gameconfig"].SetBool("startboot", !value);
+ }
+ ///
+ /// 记录上次退出位置
+ ///
+ public Point StartRecordLastPoint
+ {
+ get
+ {
+ var line = FindLine("startrecordlast");
+ if (line == null)
+ return new Point();
+ return new Point(line.GetDouble("x", 0), line.GetDouble("y", 0));
+ }
+ set
+ {
+ var line = FindorAddLine("startrecordlast");
+ line.SetDouble("x", value.X);
+ line.SetDouble("y", value.Y);
+ }
+ }
+ ///
+ /// 设置中桌宠启动的位置
+ ///
+ public Point StartRecordPoint
+ {
+ get
+ {
+ var line = FindLine("startrecord");
+ if (line == null)
+ return StartRecordLastPoint;
+ return new Point(line.GetDouble("x", 0), line.GetDouble("y", 0));
+ }
+ set
+ {
+ var line = FindorAddLine("startrecord");
+ line.SetDouble("x", value.X);
+ line.SetDouble("y", value.Y);
+ }
+ }
}
}
diff --git a/VPet-Simulator.Windows/Function/CoreMOD.cs b/VPet-Simulator.Windows/Function/CoreMOD.cs
index 75d7e19..dd13e59 100644
--- a/VPet-Simulator.Windows/Function/CoreMOD.cs
+++ b/VPet-Simulator.Windows/Function/CoreMOD.cs
@@ -101,11 +101,11 @@ namespace VPet_Simulator.Windows
{
try
{
- var path = tmpfi.FullName;
+ var path = tmpfi.Name;
if (LoadedDLL.Contains(path))
continue;
LoadedDLL.Add(path);
- Assembly dll = Assembly.LoadFrom(path);
+ Assembly dll = Assembly.LoadFrom(tmpfi.FullName);
var v = dll.GetExportedTypes();
foreach (Type exportedType in v)
{
diff --git a/VPet-Simulator.Windows/MainWindow.xaml b/VPet-Simulator.Windows/MainWindow.xaml
index a054274..ad4e1b9 100644
--- a/VPet-Simulator.Windows/MainWindow.xaml
+++ b/VPet-Simulator.Windows/MainWindow.xaml
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" ShowInTaskbar="False"
xmlns:local="clr-namespace:VPet_Simulator.Windows" mc:Ignorable="d" WindowStyle="None" Title="MainWindow"
Height="250" Width="250" Background="{x:Null}" Topmost="True" Closed="Window_Closed"
- pu:WindowXCaption.Height="0">
+ pu:WindowXCaption.Height="0" >
diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs
index 4c9859f..60dd299 100644
--- a/VPet-Simulator.Windows/MainWindow.xaml.cs
+++ b/VPet-Simulator.Windows/MainWindow.xaml.cs
@@ -70,12 +70,26 @@ namespace VPet_Simulator.Windows
CGPTClient = ChatGPTClient.Load(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"\ChatGPTSetting.json"));
//this.Width = 400 * ZoomSlider.Value;
//this.Height = 450 * ZoomSlider.Value;
-
InitializeComponent();
this.Height = 500 * Set.ZoomLevel;
this.Width = 500 * Set.ZoomLevel;
+ if (Set.StartRecordLast)
+ {
+ var point = Set.StartRecordLastPoint;
+ if (point.X != 0 || point.Y != 0)
+ {
+ this.Left = point.X;
+ this.Top = point.Y;
+ }
+ }
+ else
+ {
+ var point = Set.StartRecordPoint;
+ Left = point.X; Top = point.Y;
+ }
+
//不存在就关掉
var modpath = new DirectoryInfo(ModPath + @"\0000_core\pet\vup");
if (!modpath.Exists)
diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml
index 791e1ec..889f276 100644
--- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml
+++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml
@@ -41,6 +41,8 @@
+
+
@@ -87,9 +89,35 @@
-
+ Style="{DynamicResource StandardComboBoxStyle}" FontSize="16" Margin="0,2,0,3" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -111,11 +139,11 @@
ToolTip="从Steam启动该游戏, 统计时长不能停" Grid.Column="1" Checked="StartUpSteamBox_Checked"
Unchecked="StartUpSteamBox_Checked" />
-
-
-
+
+
-
diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs
index f8ad757..b8ebe24 100644
--- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs
+++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs
@@ -75,6 +75,23 @@ namespace VPet_Simulator.Windows
PetBox.SelectedIndex = petboxid;
PetIntor.Text = mw.Pets[petboxid].Intor;
+ TextBoxStartUpX.Text = mw.Set.StartRecordPoint.X.ToString();
+ TextBoxStartUpY.Text = mw.Set.StartRecordPoint.Y.ToString();
+ if (mw.Set.StartRecordLast == true)
+ {
+ StartPlace.IsChecked = true;
+ TextBoxStartUpX.IsEnabled = false;
+ TextBoxStartUpY.IsEnabled = false;
+ BtnStartUpGet.IsEnabled = false;
+ }
+ else
+ {
+ StartPlace.IsChecked = false;
+ TextBoxStartUpX.IsEnabled = true;
+ TextBoxStartUpY.IsEnabled = true;
+ BtnStartUpGet.IsEnabled = true;
+ }
+
foreach (ComboBoxItem v in CBAutoSave.Items)
{
if ((int)v.Tag == mw.Set.AutoSaveInterval)
@@ -723,5 +740,42 @@ namespace VPet_Simulator.Windows
{
}
+
+ private void StartPlace_Checked(object sender, RoutedEventArgs e)
+ {
+ if (!AllowChange)
+ return;
+ if (StartPlace.IsChecked == true)
+ {
+ mw.Set.StartRecordLast = true;
+ TextBoxStartUpX.IsEnabled = false;
+ TextBoxStartUpY.IsEnabled = false;
+ BtnStartUpGet.IsEnabled = false;
+ }
+ else
+ {
+ mw.Set.StartRecordLast = false;
+ TextBoxStartUpX.IsEnabled = true;
+ TextBoxStartUpY.IsEnabled = true;
+ BtnStartUpGet.IsEnabled = true;
+ }
+ }
+
+ private void TextBoxStartUp_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (!AllowChange)
+ return;
+ if (double.TryParse(TextBoxStartUpX.Text, out double x) && double.TryParse(TextBoxStartUpY.Text, out double y))
+ mw.Set.StartRecordPoint = new Point(x, y);
+ }
+
+ private void BtnStartUpGet_Click(object sender, RoutedEventArgs e)
+ {
+ AllowChange = false;
+ TextBoxStartUpX.Text = mw.Left.ToString();
+ TextBoxStartUpY.Text = mw.Top.ToString();
+ mw.Set.StartRecordPoint = new Point(mw.Left, mw.Top);
+ AllowChange = true;
+ }
}
}
diff --git a/VPet.sln b/VPet.sln
index ef0f561..2614654 100644
--- a/VPet.sln
+++ b/VPet.sln
@@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VPet-Simulator.Windows", "V
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VPet-Simulator.Windows.Interface", "VPet-Simulator.Windows.Interface\VPet-Simulator.Windows.Interface.csproj", "{DCAD838A-1A02-4BDF-962C-FD47C6006D28}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VPet-Simulator.Windows.Interface.Demo", "VPet-Simulator.Windows.Interface.Demo\VPet-Simulator.Windows.Interface.Demo.csproj", "{4DB2457C-143A-4100-9A93-A8AD2D973BDA}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -69,6 +71,18 @@ Global
{DCAD838A-1A02-4BDF-962C-FD47C6006D28}.Release|x64.Build.0 = Release|Any CPU
{DCAD838A-1A02-4BDF-962C-FD47C6006D28}.Release|x86.ActiveCfg = Release|Any CPU
{DCAD838A-1A02-4BDF-962C-FD47C6006D28}.Release|x86.Build.0 = Release|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Debug|x64.Build.0 = Debug|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Debug|x86.Build.0 = Debug|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Release|x64.ActiveCfg = Release|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Release|x64.Build.0 = Release|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Release|x86.ActiveCfg = Release|Any CPU
+ {4DB2457C-143A-4100-9A93-A8AD2D973BDA}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE