Remove OshimaGameModule/OshimaModes

This commit is contained in:
milimoe 2026-05-20 20:42:28 +08:00
parent d59878f75a
commit 624bc5e944
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
14 changed files with 2 additions and 725 deletions

View File

@ -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

View File

@ -1,7 +0,0 @@
<Application x:Class="Oshima.FunGame.OshimaModes.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

View File

@ -1,6 +0,0 @@
namespace Oshima.FunGame.OshimaModes
{
public partial class App : System.Windows.Application
{
}
}

View File

@ -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<string, object> data)
{
try
{
string msg = (DataRequest.GetDictionaryJsonObject<string>(data, "msg") ?? "").Trim();
if (msg != "") Controller.WriteLine(msg);
}
catch (Exception ex)
{
TXTHelper.AppendErrorLog(ex.ToString());
}
}
}
}

View File

@ -1,47 +0,0 @@
<Window x:Class="Oshima.FunGame.OshimaModes.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Oshima.FunGame.OshimaModes"
Title="游戏界面" Height="943" Width="1688" ResizeMode="NoResize">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25*" />
<ColumnDefinition Width="50*" />
<ColumnDefinition Width="25*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="10*" />
<RowDefinition Height="70*" />
<RowDefinition Height="20*" />
</Grid.RowDefinitions>
<!-- 左侧玩家面板 -->
<Grid x:Name="leftTableLayoutPanel" Grid.Column="0" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
</Grid>
<!-- 中间文本框 -->
<RichTextBox x:Name="richTextBox" Grid.Column="1" Grid.Row="1" IsReadOnly="True" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
<!-- 右侧玩家面板 -->
<Grid x:Name="rightTableLayoutPanel" Grid.Column="2" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
</Grid>
</Grid>
</Window>

View File

@ -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);
}
}
}

View File

@ -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<PlayerInfo> Players { get; set; } = new ObservableCollection<PlayerInfo>();
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; }
}
}

View File

@ -1,48 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net10.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<BaseOutputPath>..\bin\</BaseOutputPath>
<RootNamespace>Oshima.FunGame.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<Authors>Oshima Studios</Authors>
<UseWPF>True</UseWPF>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;IDE0130</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>1701;1702;IDE0130</NoWarn>
</PropertyGroup>
<ItemGroup>
<Page Include="App.xaml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\FunGame.Core\FunGame.Core.csproj" />
<ProjectReference Include="..\OshimaMaps\OshimaMaps.csproj" />
<ProjectReference Include="..\OshimaModules\OshimaModules.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@ -1,63 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Oshima.FunGame.OshimaModes.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 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() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[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;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,88 +0,0 @@
<UserControl x:Class="Oshima.FunGame.OshimaModes.CharacterStatus"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Oshima.FunGame.OshimaModes"
Width="315" Height="357">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="31" />
<RowDefinition Height="223" />
<RowDefinition Height="*" />
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="21" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<!-- 角色名称 -->
<TextBlock x:Name="CharacterName"
Grid.Row="0"
Text="角色名称"
FontFamily="霞鹜文楷"
FontSize="14"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<!-- 角色头像 -->
<Image x:Name="CharacterAvatar"
Grid.Row="1"
Stretch="Uniform"
Margin="0" />
<!-- HP 进度条 -->
<ProgressBar x:Name="HPBar"
Grid.Row="3"
Height="20"
Foreground="Red"
BorderBrush="Black"
BorderThickness="1"
FontFamily="霞鹜文楷"
FontSize="10.5"
FontWeight="Bold"
Value="50"
Maximum="100" />
<!-- MP 进度条 -->
<ProgressBar x:Name="MPBar"
Grid.Row="4"
Height="20"
Foreground="Blue"
BorderBrush="Black"
BorderThickness="1"
FontFamily="霞鹜文楷"
FontSize="10.5"
FontWeight="Bold"
Value="50"
Maximum="100" />
<!-- EP 进度条 -->
<ProgressBar x:Name="EPBar"
Grid.Row="5"
Height="21"
Foreground="Yellow"
BorderBrush="Black"
BorderThickness="1"
FontFamily="霞鹜文楷"
FontSize="10.5"
FontWeight="Bold"
Value="50"
Maximum="100" />
<!-- 状态图标区域 -->
<StackPanel x:Name="flowLayoutPanel1"
Grid.Row="6"
Orientation="Horizontal"
HorizontalAlignment="Left">
<Image x:Name="pictureBox1"
Width="25"
Height="25"
Margin="3"
Stretch="Uniform" />
<Image x:Name="pictureBox2"
Width="25"
Height="25"
Margin="3"
Stretch="Uniform" />
</StackPanel>
</Grid>
</UserControl>

View File

@ -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;
}
}
}

View File

@ -1,12 +0,0 @@
<UserControl x:Class="Oshima.FunGame.OshimaModes.CustomProgressBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="20">
<ProgressBar x:Name="progressBar"
Value="50"
Minimum="0"
Maximum="100"
Height="{Binding Height, RelativeSource={RelativeSource AncestorType=UserControl}}"
BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource AncestorType=UserControl}}"
BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
</UserControl>

View File

@ -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;
}
}
}