From b5fc501226e9bab6fde3542cb873a62a6156bbcd Mon Sep 17 00:00:00 2001 From: ZouJin Date: Wed, 5 Apr 2023 02:21:46 +1000 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=92=E4=BB=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=A3=8E=E6=A0=BC=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Display/Main.xaml | 5 ++--- VPet-Simulator.Core/Display/MainLogic.cs | 6 ++++-- VPet-Simulator.Core/Display/MessageBar.xaml | 5 ++--- VPet-Simulator.Core/Display/ToolBar.xaml | 4 ++-- VPet-Simulator.Core/Handle/Function.cs | 2 +- VPet-Simulator.Core/VPet-Simulator.Core.csproj | 9 +++++++-- VPet-Simulator.Windows.Interface/MainPlugin.cs | 8 +++++--- .../ResourceStyle.xaml | 3 ++- .../VPet-Simulator.Windows.Interface.csproj | 18 +++++++++++++++++- .../packages.config | 2 ++ VPet-Simulator.Windows/App.xaml | 7 +------ VPet-Simulator.Windows/MainWindow.cs | 2 +- VPet-Simulator.Windows/MainWindow.xaml.cs | 2 +- .../VPet-Simulator.Windows.csproj | 4 ---- VPet.sln | 18 ++---------------- 15 files changed, 49 insertions(+), 46 deletions(-) rename VPet-Simulator.Windows/Design/Theme/basestyle.xaml => VPet-Simulator.Windows.Interface/ResourceStyle.xaml (97%) diff --git a/VPet-Simulator.Core/Display/Main.xaml b/VPet-Simulator.Core/Display/Main.xaml index 23eea99..d4e54cb 100644 --- a/VPet-Simulator.Core/Display/Main.xaml +++ b/VPet-Simulator.Core/Display/Main.xaml @@ -6,11 +6,10 @@ + - - - + diff --git a/VPet-Simulator.Core/Display/MainLogic.cs b/VPet-Simulator.Core/Display/MainLogic.cs index 575bed1..d72a0a7 100644 --- a/VPet-Simulator.Core/Display/MainLogic.cs +++ b/VPet-Simulator.Core/Display/MainLogic.cs @@ -24,7 +24,9 @@ namespace VPet_Simulator.Core /// public event Action OnSay; - + /// + /// 事件Timer + /// public Timer EventTimer = new Timer(15000) { AutoReset = true, @@ -207,7 +209,7 @@ namespace VPet_Simulator.Core /// 设置移动模式 /// /// 允许移动 - /// 启用智能移动 + /// 启用智能移动 /// 智能移动周期 public void SetMoveMode(bool AllowMove, bool smartMove, int SmartMoveInterval) { diff --git a/VPet-Simulator.Core/Display/MessageBar.xaml b/VPet-Simulator.Core/Display/MessageBar.xaml index 9480412..ec16433 100644 --- a/VPet-Simulator.Core/Display/MessageBar.xaml +++ b/VPet-Simulator.Core/Display/MessageBar.xaml @@ -13,11 +13,10 @@ MouseLeave="Border_MouseLeave"> diff --git a/VPet-Simulator.Core/Display/ToolBar.xaml b/VPet-Simulator.Core/Display/ToolBar.xaml index c52f98a..d28a239 100644 --- a/VPet-Simulator.Core/Display/ToolBar.xaml +++ b/VPet-Simulator.Core/Display/ToolBar.xaml @@ -16,7 +16,7 @@ + MouseLeave="MenuPanel_MouseLeave" Visibility="Collapsed" x:FieldModifier="public"> @@ -115,7 +115,7 @@ - + diff --git a/VPet-Simulator.Core/Handle/Function.cs b/VPet-Simulator.Core/Handle/Function.cs index 2a1786f..f22450a 100644 --- a/VPet-Simulator.Core/Handle/Function.cs +++ b/VPet-Simulator.Core/Handle/Function.cs @@ -18,7 +18,7 @@ namespace VPet_Simulator.Core /// public static Brush ResourcesBrush(BrushType name) { - return (Brush)Application.Current.Resources.MergedDictionaries.First()[name.ToString()]; + return (Brush)Application.Current.Resources.MergedDictionaries[0][name.ToString()]; } public enum BrushType { diff --git a/VPet-Simulator.Core/VPet-Simulator.Core.csproj b/VPet-Simulator.Core/VPet-Simulator.Core.csproj index 0169d04..5c9d56f 100644 --- a/VPet-Simulator.Core/VPet-Simulator.Core.csproj +++ b/VPet-Simulator.Core/VPet-Simulator.Core.csproj @@ -24,12 +24,17 @@ 4 - pdbonly + full true bin\Release\ TRACE prompt - 4 + 3 + bin\Release\VPet-Simulator.Core.xml + false + Auto + true + CS1591 true diff --git a/VPet-Simulator.Windows.Interface/MainPlugin.cs b/VPet-Simulator.Windows.Interface/MainPlugin.cs index c99708e..8f16c1a 100644 --- a/VPet-Simulator.Windows.Interface/MainPlugin.cs +++ b/VPet-Simulator.Windows.Interface/MainPlugin.cs @@ -24,7 +24,7 @@ namespace VPet_Simulator.Windows.Interface /// /// 主窗体 /// 请不要加载游戏和玩家数据,仅用作初始化 - /// 加载数据(CORE)/游戏(SAVE),请使用 StartGame + /// 加载数据(CORE)/游戏(SAVE),请使用 LoadPlugin public MainPlugin(IMainWindow mainwin) { //此处主窗体玩家,Core等信息均为空,请不要加载游戏和玩家数据 @@ -36,9 +36,11 @@ namespace VPet_Simulator.Windows.Interface ///// 主题 //public virtual void LoadTheme(Theme theme) { } /// - /// 游戏开始 (可以读取Save存档) (如果玩家登出后重新开始游戏,将会被再次调用) + /// 初始化程序+读取存档 /// - public virtual void StartGame() { } + /// 例:添加自己的Tick到 mw.Main.EventTimer + /// 例:创建使用UI的桌面控件 + public virtual void LoadPlugin() { } /// /// 游戏结束 (可以保存或清空等,不过保存有专门的Save()) diff --git a/VPet-Simulator.Windows/Design/Theme/basestyle.xaml b/VPet-Simulator.Windows.Interface/ResourceStyle.xaml similarity index 97% rename from VPet-Simulator.Windows/Design/Theme/basestyle.xaml rename to VPet-Simulator.Windows.Interface/ResourceStyle.xaml index 5d47f92..ca05efb 100644 --- a/VPet-Simulator.Windows/Design/Theme/basestyle.xaml +++ b/VPet-Simulator.Windows.Interface/ResourceStyle.xaml @@ -3,7 +3,8 @@ xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" xmlns:pucore="clr-namespace:Panuon.WPF;assembly=Panuon.WPF"> - + + diff --git a/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj b/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj index ea4919b..f3d0296 100644 --- a/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj +++ b/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj @@ -24,12 +24,14 @@ AnyCPU - pdbonly + full true bin\Release\ TRACE prompt 4 + bin\Release\VPet-Simulator.Windows.Interface.xml + true true @@ -89,9 +91,17 @@ ..\packages\LinePutScript.1.6.1\lib\net462\LinePutScript.dll + + ..\packages\Panuon.WPF.1.0.1\lib\net462\Panuon.WPF.dll + + + ..\packages\Panuon.WPF.UI.1.1.8.5\lib\net462\Panuon.WPF.UI.dll + + + @@ -115,5 +125,11 @@ VPet-Simulator.Core + + + MSBuild:Compile + Designer + + \ No newline at end of file diff --git a/VPet-Simulator.Windows.Interface/packages.config b/VPet-Simulator.Windows.Interface/packages.config index a12e310..c15e585 100644 --- a/VPet-Simulator.Windows.Interface/packages.config +++ b/VPet-Simulator.Windows.Interface/packages.config @@ -1,4 +1,6 @@  + + \ No newline at end of file diff --git a/VPet-Simulator.Windows/App.xaml b/VPet-Simulator.Windows/App.xaml index 8c442a0..24aaffc 100644 --- a/VPet-Simulator.Windows/App.xaml +++ b/VPet-Simulator.Windows/App.xaml @@ -4,11 +4,6 @@ xmlns:local="clr-namespace:VPet_Simulator.Windows" StartupUri="MainWindow.xaml"> - - - - - - + diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index b0bf63e..3c3c361 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -73,7 +73,7 @@ namespace VPet_Simulator.Windows { //加载游戏创意工坊插件 foreach (MainPlugin mp in Plugins) - mp.StartGame(); + mp.LoadDIY(); } catch (Exception e) { diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index 60dd299..4656fd1 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -223,7 +223,7 @@ namespace VPet_Simulator.Windows { //加载游戏创意工坊插件 foreach (MainPlugin mp in Plugins) - mp.StartGame(); + mp.LoadPlugin(); } catch (Exception e) { diff --git a/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj b/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj index e3f1e53..7dcf4ad 100644 --- a/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj +++ b/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj @@ -142,10 +142,6 @@ winReport.xaml - - Designer - MSBuild:Compile - MSBuild:Compile Designer diff --git a/VPet.sln b/VPet.sln index 2614654..67230ce 100644 --- a/VPet.sln +++ b/VPet.sln @@ -11,8 +11,6 @@ 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 @@ -31,8 +29,8 @@ Global {7BD4CB1D-C8F3-4349-9BF0-CD11789130BA}.Debug|x86.Build.0 = Debug|Any CPU {7BD4CB1D-C8F3-4349-9BF0-CD11789130BA}.Release|Any CPU.ActiveCfg = Release|Any CPU {7BD4CB1D-C8F3-4349-9BF0-CD11789130BA}.Release|Any CPU.Build.0 = Release|Any CPU - {7BD4CB1D-C8F3-4349-9BF0-CD11789130BA}.Release|x64.ActiveCfg = Release|x64 - {7BD4CB1D-C8F3-4349-9BF0-CD11789130BA}.Release|x64.Build.0 = Release|x64 + {7BD4CB1D-C8F3-4349-9BF0-CD11789130BA}.Release|x64.ActiveCfg = Release|Any CPU + {7BD4CB1D-C8F3-4349-9BF0-CD11789130BA}.Release|x64.Build.0 = Release|Any CPU {7BD4CB1D-C8F3-4349-9BF0-CD11789130BA}.Release|x86.ActiveCfg = Release|x86 {7BD4CB1D-C8F3-4349-9BF0-CD11789130BA}.Release|x86.Build.0 = Release|x86 {692CE45E-01A9-4500-8B1D-AFC0FE2767FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -71,18 +69,6 @@ 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