diff --git a/OshimaGameModule.sln b/OshimaGameModule.sln index 9cc4fab..0865d68 100644 --- a/OshimaGameModule.sln +++ b/OshimaGameModule.sln @@ -1,14 +1,12 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.8.34330.188 +# Visual Studio Version 18 +VisualStudioVersion = 18.5.11723.231 stable MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OshimaModules", "OshimaModules\OshimaModules.csproj", "{497E99F9-7EA4-498C-90C5-B5751B47B2BE}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OshimaMaps", "OshimaMaps\OshimaMaps.csproj", "{27847422-7671-4DF8-95EC-975A2E2F5631}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OshimaModes", "OshimaModes\OshimaModes.csproj", "{74922E11-458E-4A91-8D11-BEC9F7758EEB}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OshimaServers", "OshimaServers\OshimaServers.csproj", "{E8C696E0-96E4-45C3-8CB4-A02145179590}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OshimaWebAPI", "OshimaWebAPI\OshimaWebAPI.csproj", "{978B06DE-2AD8-4DC4-B53A-D744781FDEA1}" @@ -17,8 +15,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OshimaCore", "OshimaCore\Os EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FunGame.Core", "..\FunGame.Core\FunGame.Core.csproj", "{4F243854-428F-4252-AE9A-81FB2D8EEBD7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FunGame.Desktop", "..\FunGame.Desktop\FunGame.Desktop\FunGame.Desktop.csproj", "{E593DA0E-DD26-4CEA-A402-09911B8C0517}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,10 +29,6 @@ Global {27847422-7671-4DF8-95EC-975A2E2F5631}.Debug|Any CPU.Build.0 = Debug|Any CPU {27847422-7671-4DF8-95EC-975A2E2F5631}.Release|Any CPU.ActiveCfg = Release|Any CPU {27847422-7671-4DF8-95EC-975A2E2F5631}.Release|Any CPU.Build.0 = Release|Any CPU - {74922E11-458E-4A91-8D11-BEC9F7758EEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {74922E11-458E-4A91-8D11-BEC9F7758EEB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {74922E11-458E-4A91-8D11-BEC9F7758EEB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {74922E11-458E-4A91-8D11-BEC9F7758EEB}.Release|Any CPU.Build.0 = Release|Any CPU {E8C696E0-96E4-45C3-8CB4-A02145179590}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E8C696E0-96E4-45C3-8CB4-A02145179590}.Debug|Any CPU.Build.0 = Debug|Any CPU {E8C696E0-96E4-45C3-8CB4-A02145179590}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -53,10 +45,6 @@ Global {4F243854-428F-4252-AE9A-81FB2D8EEBD7}.Debug|Any CPU.Build.0 = Debug|Any CPU {4F243854-428F-4252-AE9A-81FB2D8EEBD7}.Release|Any CPU.ActiveCfg = Release|Any CPU {4F243854-428F-4252-AE9A-81FB2D8EEBD7}.Release|Any CPU.Build.0 = Release|Any CPU - {E593DA0E-DD26-4CEA-A402-09911B8C0517}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E593DA0E-DD26-4CEA-A402-09911B8C0517}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E593DA0E-DD26-4CEA-A402-09911B8C0517}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E593DA0E-DD26-4CEA-A402-09911B8C0517}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OshimaModes/App.xaml b/OshimaModes/App.xaml deleted file mode 100644 index 2b40b54..0000000 --- a/OshimaModes/App.xaml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/OshimaModes/App.xaml.cs b/OshimaModes/App.xaml.cs deleted file mode 100644 index 5f88ee5..0000000 --- a/OshimaModes/App.xaml.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Oshima.FunGame.OshimaModes -{ - public partial class App : System.Windows.Application - { - } -} diff --git a/OshimaModes/FastAuto.cs b/OshimaModes/FastAuto.cs deleted file mode 100644 index 16d86ab..0000000 --- a/OshimaModes/FastAuto.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Milimoe.FunGame.Core.Api.Transmittal; -using Milimoe.FunGame.Core.Api.Utility; -using Milimoe.FunGame.Core.Interface; -using Milimoe.FunGame.Core.Library.Common.Addon; -using Milimoe.FunGame.Core.Library.Common.Event; -using Milimoe.FunGame.Core.Library.Constant; -using Milimoe.FunGame.Core.Model; -using Oshima.Core.Constant; -using Application = System.Windows.Application; - -namespace Oshima.FunGame.OshimaModes -{ - public class FastAuto : GameModule, IGamingUpdateInfoEvent - { - public override string Name => OshimaGameModuleConstant.FastAuto; - public override string Description => OshimaGameModuleConstant.Description; - public override string Version => OshimaGameModuleConstant.Version; - public override string Author => OshimaGameModuleConstant.Author; - public override string DefaultMap => OshimaGameModuleConstant.FastAutoMap; - public override GameModuleDepend GameModuleDepend => OshimaGameModuleConstant.GameModuleDepend; - public override RoomType RoomType => RoomType.FastAuto; - public override bool HideMain => false; - public override int MaxUsers => 12; - - public override void StartGame(Gaming instance, params object[] args) - { - try - { - DataRequest request = Controller.NewDataRequest(GamingType.Connect); - request.AddRequestData("un", _session.LoginUserName); - request.SendRequest(); - } - catch (Exception e) - { - TXTHelper.AppendErrorLog(e.ToString()); - } - } - - public override void StartUI(params object[] args) - { - try - { - // 确保在 UI 线程执行 - if (Application.Current != null) - { - Application.Current.Dispatcher.Invoke(() => - { - try - { - MainWindow mainWindow = new(); - mainWindow.Closed += (s, e) => - { - Controller.WriteLine("MainWindow closed"); - }; - mainWindow.Show(); - } - catch (Exception ex) - { - Controller.Error(ex); - throw; - } - }); - } - else - { - throw new InvalidOperationException("WPF Application not initialized."); - } - } - catch (Exception ex) - { - Controller.Error(ex); - throw; - } - } - - public void GamingUpdateInfoEvent(object sender, GamingEventArgs e, Dictionary data) - { - try - { - string msg = (DataRequest.GetDictionaryJsonObject(data, "msg") ?? "").Trim(); - if (msg != "") Controller.WriteLine(msg); - } - catch (Exception ex) - { - TXTHelper.AppendErrorLog(ex.ToString()); - } - } - } -} diff --git a/OshimaModes/MainWindow.xaml b/OshimaModes/MainWindow.xaml deleted file mode 100644 index 0857eef..0000000 --- a/OshimaModes/MainWindow.xaml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OshimaModes/MainWindow.xaml.cs b/OshimaModes/MainWindow.xaml.cs deleted file mode 100644 index 8f9bcc2..0000000 --- a/OshimaModes/MainWindow.xaml.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Windows; -using System.Windows.Controls; - -namespace Oshima.FunGame.OshimaModes -{ - public partial class MainWindow : Window - { - public MainWindow() - { - InitializeComponent(); - AddPlayers(7); // 初始化时添加7个玩家 - } - - // 动态添加玩家格子 - private void AddPlayers(int playerCount) - { - int leftIndex = 0; // 左侧奇数玩家计数器 - int rightIndex = 0; // 右侧偶数玩家计数器 - - for (int i = 1; i <= playerCount; i++) - { - // 使用 CharacterStatus 控件表示玩家 - CharacterStatus playerSlot = new(); - - if (i % 2 == 1) // 奇数玩家,左侧 - { - AddToLeftPanel(playerSlot, leftIndex); - leftIndex++; - } - else // 偶数玩家,右侧 - { - AddToRightPanel(playerSlot, rightIndex); - rightIndex++; - } - } - } - - // 添加奇数玩家到左侧 Grid - private void AddToLeftPanel(CharacterStatus control, int index) - { - int col = index / 3; // 每列容纳3个玩家 - int row = index % 3; // 行号从0到2 - - Grid.SetColumn(control, col); - Grid.SetRow(control, row); - leftTableLayoutPanel.Children.Add(control); - } - - // 添加偶数玩家到右侧 Grid - private void AddToRightPanel(CharacterStatus control, int index) - { - int col = (index >= 3) ? 0 : 1; // 超过3位玩家的偶数编号在第一列,否则在第二列 - int row = index % 3; // 行号从0到2 - - Grid.SetColumn(control, col); - Grid.SetRow(control, row); - rightTableLayoutPanel.Children.Add(control); - } - } -} diff --git a/OshimaModes/MainWindowViewModel.cs b/OshimaModes/MainWindowViewModel.cs deleted file mode 100644 index c1a2632..0000000 --- a/OshimaModes/MainWindowViewModel.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Windows.Media.Imaging; - -namespace Oshima.FunGame.OshimaModes -{ - public class MainWindowViewModel : INotifyPropertyChanged - { - public ObservableCollection Players { get; set; } = new ObservableCollection(); - - private string _gameInfoText; - public string GameInfoText - { - get { return _gameInfoText; } - set - { - _gameInfoText = value; - OnPropertyChanged(nameof(GameInfoText)); - } - } - - public MainWindowViewModel() - { - // 模拟添加玩家 - for (int i = 1; i <= 12; i++) - { - Players.Add(new PlayerInfo - { - PlayerName = $"Player {i}", - HP = $"{i * 10}/{i * 100}", - MP = $"{i * 5}/{i * 50}", - PlayerImage = new BitmapImage(new System.Uri("pack://application:,,,/Oshima.FunGame.WPFUI;component/Images/default_avatar.png")) // 替换为你的默认头像 - }); - } - } - - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void OnPropertyChanged(string propertyName) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } - } - - public class PlayerInfo - { - public string PlayerName { get; set; } - public string HP { get; set; } - public string MP { get; set; } - public BitmapImage PlayerImage { get; set; } - } -} diff --git a/OshimaModes/OshimaModes.csproj b/OshimaModes/OshimaModes.csproj deleted file mode 100644 index 8e45f26..0000000 --- a/OshimaModes/OshimaModes.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - WinExe - net10.0-windows7.0 - enable - true - enable - ..\bin\ - Oshima.FunGame.$(MSBuildProjectName.Replace(" ", "_")) - Oshima Studios - True - - - - 1701;1702;IDE0130 - - - - 1701;1702;IDE0130 - - - - - - - - - - - - - - - True - True - Resources.resx - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - \ No newline at end of file diff --git a/OshimaModes/Properties/Resources.Designer.cs b/OshimaModes/Properties/Resources.Designer.cs deleted file mode 100644 index c4a9dbf..0000000 --- a/OshimaModes/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -namespace Oshima.FunGame.OshimaModes.Properties { - using System; - - - /// - /// 一个强类型的资源类,用于查找本地化的字符串等。 - /// - // 此类是由 StronglyTypedResourceBuilder - // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 - // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen - // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// 返回此类使用的缓存的 ResourceManager 实例。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Oshima.FunGame.OshimaModes.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// 重写当前线程的 CurrentUICulture 属性,对 - /// 使用此强类型资源类的所有资源查找执行重写。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/OshimaModes/Properties/Resources.resx b/OshimaModes/Properties/Resources.resx deleted file mode 100644 index 1af7de1..0000000 --- a/OshimaModes/Properties/Resources.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/OshimaModes/UserControl/CharacterStatus.xaml b/OshimaModes/UserControl/CharacterStatus.xaml deleted file mode 100644 index 13d3c53..0000000 --- a/OshimaModes/UserControl/CharacterStatus.xaml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OshimaModes/UserControl/CharacterStatus.xaml.cs b/OshimaModes/UserControl/CharacterStatus.xaml.cs deleted file mode 100644 index b780071..0000000 --- a/OshimaModes/UserControl/CharacterStatus.xaml.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Windows.Media; - -namespace Oshima.FunGame.OshimaModes -{ - public partial class CharacterStatus : System.Windows.Controls.UserControl - { - public CharacterStatus() - { - InitializeComponent(); - } - - // 公开控件属性以便外部访问 - public string CharacterNameText - { - get => CharacterName.Text; - set => CharacterName.Text = value; - } - - public ImageSource CharacterAvatarSource - { - get => CharacterAvatar.Source; - set => CharacterAvatar.Source = value; - } - - public double HPBarValue - { - get => HPBar.Value; - set => HPBar.Value = value; - } - - public double HPBarMaximum - { - get => HPBar.Maximum; - set => HPBar.Maximum = value; - } - - public double MPBarValue - { - get => MPBar.Value; - set => MPBar.Value = value; - } - - public double MPBarMaximum - { - get => MPBar.Maximum; - set => MPBar.Maximum = value; - } - - public double EPBarValue - { - get => EPBar.Value; - set => EPBar.Value = value; - } - - public double EPBarMaximum - { - get => EPBar.Maximum; - set => EPBar.Maximum = value; - } - - public ImageSource PictureBox1Source - { - get => pictureBox1.Source; - set => pictureBox1.Source = value; - } - - public ImageSource PictureBox2Source - { - get => pictureBox2.Source; - set => pictureBox2.Source = value; - } - } -} diff --git a/OshimaModes/UserControl/CustomProgressBar.xaml b/OshimaModes/UserControl/CustomProgressBar.xaml deleted file mode 100644 index 88e28aa..0000000 --- a/OshimaModes/UserControl/CustomProgressBar.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/OshimaModes/UserControl/CustomProgressBar.xaml.cs b/OshimaModes/UserControl/CustomProgressBar.xaml.cs deleted file mode 100644 index 0baafdd..0000000 --- a/OshimaModes/UserControl/CustomProgressBar.xaml.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Windows; - -namespace Oshima.FunGame.OshimaModes -{ - public partial class CustomProgressBar : System.Windows.Controls.UserControl - { - public CustomProgressBar() - { - InitializeComponent(); - } - - // 进度值依赖属性 - public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( - "Value", typeof(double), typeof(CustomProgressBar), - new PropertyMetadata(0.0, OnValueChanged)); - - public double Value - { - get => (double)GetValue(ValueProperty); - set => SetValue(ValueProperty, value); - } - - private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var control = (CustomProgressBar)d; - control.progressBar.Value = (double)e.NewValue; - } - - // 最大值依赖属性 - public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register( - "Maximum", typeof(double), typeof(CustomProgressBar), - new PropertyMetadata(100.0, OnMaximumChanged)); - - public double Maximum - { - get => (double)GetValue(MaximumProperty); - set => SetValue(MaximumProperty, value); - } - - private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var control = (CustomProgressBar)d; - control.progressBar.Maximum = (double)e.NewValue; - } - } -}