在模组加载器中,添加了技能构造方法

This commit is contained in:
milimoe 2024-09-20 01:48:36 +08:00
parent 40dc598b62
commit 8bcddf642f
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
26 changed files with 1449 additions and 32 deletions

View File

@ -7,6 +7,7 @@
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<BaseOutputPath>..\bin\</BaseOutputPath> <BaseOutputPath>..\bin\</BaseOutputPath>
<RootNamespace>Milimoe.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@ -1,3 +1,5 @@
using Milimoe.FunGame.Testing.Desktop.Solutions;
namespace Desktop namespace Desktop
{ {
internal static class Program internal static class Program
@ -11,7 +13,8 @@ namespace Desktop
// To customize application configuration such as set high DPI settings or default font, // To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration. // see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize(); ApplicationConfiguration.Initialize();
Application.Run(new ChessBoardExample.ChessBoardExample()); //Application.Run(new ChessBoardExample.ChessBoardExample());
Application.Run(new EntityCreator());
} }
} }
} }

View File

@ -0,0 +1,37 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public class CharacterCreator
{
public Dictionary<string, Character> LoadedCharacters { get; set; } = [];
public void Load()
{
EntityModuleConfig<Character> config = new("redbud.fun.entitycreator", "charactercreator");
config.LoadConfig();
LoadedCharacters = new(config);
}
public bool Add(string name, Character character)
{
return LoadedCharacters.TryAdd(name, character);
}
public bool Remove(string name)
{
return LoadedCharacters.Remove(name);
}
public void Save()
{
EntityModuleConfig<Character> config = new("redbud.fun.entitycreator", "charactercreator");
foreach (string key in LoadedCharacters.Keys)
{
config.Add(key, LoadedCharacters[key]);
}
config.SaveConfig();
}
}
}

View File

@ -0,0 +1,301 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
partial class EntityCreator
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
= new Button();
= new Button();
= new Button();
= new Button();
= new Button();
= new Button();
= new Button();
= new Button();
= new Button();
= new GroupBox();
= new ListBox();
= new Button();
= new Button();
= new Button();
= new Button();
= new Button();
= new Button();
= new Button();
.SuspendLayout();
SuspendLayout();
//
// 查看现有角色
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(460, 103);
.Name = "查看现有角色";
.Size = new Size(98, 35);
.TabIndex = 0;
.Text = "查看现有角色";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 查看现有技能
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(460, 144);
.Name = "查看现有技能";
.Size = new Size(98, 35);
.TabIndex = 1;
.Text = "查看现有技能";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 查看现有物品
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(460, 185);
.Name = "查看现有物品";
.Size = new Size(98, 35);
.TabIndex = 2;
.Text = "查看现有物品";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 创建角色
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(564, 226);
.Name = "创建角色";
.Size = new Size(98, 35);
.TabIndex = 3;
.Text = "创建角色";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 创建技能
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(564, 267);
.Name = "创建技能";
.Size = new Size(98, 35);
.TabIndex = 4;
.Text = "创建技能";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 创建物品
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(564, 308);
.Name = "创建物品";
.Size = new Size(98, 35);
.TabIndex = 5;
.Text = "创建物品";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 删除物品
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(460, 308);
.Name = "删除物品";
.Size = new Size(98, 35);
.TabIndex = 8;
.Text = "删除物品";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 删除技能
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(460, 267);
.Name = "删除技能";
.Size = new Size(98, 35);
.TabIndex = 7;
.Text = "删除技能";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 删除角色
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(460, 226);
.Name = "删除角色";
.Size = new Size(98, 35);
.TabIndex = 6;
.Text = "删除角色";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 列表
//
.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
.Controls.Add();
.Location = new Point(16, 12);
.Name = "列表";
.Size = new Size(431, 413);
.TabIndex = 9;
.TabStop = false;
.Text = "列表";
//
// 实际列表
//
.FormattingEnabled = true;
.ItemHeight = 17;
.Location = new Point(6, 24);
.Name = "实际列表";
.Size = new Size(419, 378);
.TabIndex = 0;
.MouseDoubleClick += _MouseDoubleClick;
//
// 全部保存
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(460, 349);
.Name = "全部保存";
.Size = new Size(98, 35);
.TabIndex = 12;
.Text = "全部保存";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 保存角色
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(564, 349);
.Name = "保存角色";
.Size = new Size(98, 35);
.TabIndex = 11;
.Text = "保存角色";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 保存技能
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(460, 390);
.Name = "保存技能";
.Size = new Size(98, 35);
.TabIndex = 10;
.Text = "保存技能";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 保存物品
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(564, 390);
.Name = "保存物品";
.Size = new Size(98, 35);
.TabIndex = 13;
.Text = "保存物品";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 为角色添加技能
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Font = new Font("Microsoft YaHei UI", 8F);
.Location = new Point(564, 103);
.Name = "为角色添加技能";
.Size = new Size(98, 35);
.TabIndex = 14;
.Text = "为角色添加技能";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 为角色添加物品
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Font = new Font("Microsoft YaHei UI", 8F);
.Location = new Point(564, 144);
.Name = "为角色添加物品";
.Size = new Size(98, 35);
.TabIndex = 15;
.Text = "为角色添加物品";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 重新读取全部
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Font = new Font("Microsoft YaHei UI", 8F);
.Location = new Point(564, 185);
.Name = "重新读取全部";
.Size = new Size(98, 35);
.TabIndex = 16;
.Text = "重新读取全部";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// EntityCreator
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(674, 437);
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Name = "EntityCreator";
Text = "实体创建器";
.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private Button ;
private Button ;
private Button ;
private Button ;
private Button ;
private Button ;
private Button ;
private Button ;
private Button ;
private GroupBox ;
private Button ;
private Button ;
private Button ;
private Button ;
private ListBox ;
private Button ;
private Button ;
private Button ;
}
}

View File

@ -0,0 +1,388 @@
using Microsoft.VisualBasic;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Interface.Entity;
using Milimoe.FunGame.Core.Library.Common.Addon;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public partial class EntityCreator : Form
{
private CharacterCreator CharacterCreator { get; } = new();
private SkillCreator SkillCreator { get; } = new();
private ItemCreator ItemCreator { get; } = new();
private GameModuleLoader GameModuleLoader { get; }
private bool CheckSelectedIndex => .SelectedIndex != -1 && .SelectedIndex < .Items.Count;
private int nowClick = 0;
public EntityCreator()
{
InitializeComponent();
GameModuleLoader = LoadModules();
CharacterCreator.Load();
SkillCreator.Load();
ItemCreator.Load();
();
();
();
}
private void ()
{
.Items.Clear();
foreach (string name in CharacterCreator.LoadedCharacters.Keys)
{
.Items.Add(CharacterCreator.LoadedCharacters[name]);
}
nowClick = 0;
}
private void ()
{
.Items.Clear();
foreach (string name in SkillCreator.LoadedSkills.Keys)
{
.Items.Add(SkillCreator.LoadedSkills[name].GetIdName());
}
nowClick = 1;
}
private void ()
{
.Items.Clear();
foreach (string name in ItemCreator.LoadedItems.Keys)
{
.Items.Add(ItemCreator.LoadedItems[name].GetIdName());
}
nowClick = 2;
}
private void _Click(object sender, EventArgs e)
{
if (nowClick != 0)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
if (nowClick != 1)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
if (nowClick != 2)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
CharacterCreator.Save();
SkillCreator.Save();
ItemCreator.Save();
MessageBox.Show("保存成功!");
}
private void _Click(object sender, EventArgs e)
{
CharacterCreator.Save();
MessageBox.Show("保存成功!");
}
private void _Click(object sender, EventArgs e)
{
SkillCreator.Save();
MessageBox.Show("保存成功!");
}
private void _Click(object sender, EventArgs e)
{
ItemCreator.Save();
MessageBox.Show("保存成功!");
}
private Skill? (long id, string name)
{
foreach (SkillModule module in GameModuleLoader.Skills.Values)
{
Skill? s = module.GetSkill(id, name);
if (s != null)
{
return s;
}
}
return null;
}
private Item? (long id, string name)
{
foreach (ItemModule module in GameModuleLoader.Items.Values)
{
Item? i = module.GetItem(id, name);
if (i != null)
{
return i;
}
}
return null;
}
private void _MouseDoubleClick(object sender, EventArgs e)
{
if (CheckSelectedIndex)
{
ShowDetail d = new();
switch (nowClick)
{
case 0:
d.SetText(CharacterCreator.LoadedCharacters.Values.Where(c => c.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault()?.GetInfo() ?? "");
d.ShowDialog();
break;
case 1:
Skill? s = SkillCreator.LoadedSkills.Values.Where(c => c.GetIdName() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
if (s != null)
{
s = (s.Id, s.Name);
if (s != null)
{
d.SetText(s.ToString() ?? "");
d.ShowDialog();
}
}
break;
case 2:
Item? i = ItemCreator.LoadedItems.Values.Where(c => c.GetIdName() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
if (i != null)
{
i = (i.Id, i.Name);
if (i != null)
{
d.SetText(i.ToString() ?? "");
d.ShowDialog();
}
}
break;
default:
break;
}
d.Dispose();
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && nowClick == 0)
{
if (SkillCreator.LoadedSkills.Count != 0)
{
Showlist l = new();
l.AddListItem(SkillCreator.LoadedSkills.Values.Select(s => s.GetIdName()).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Character? c = CharacterCreator.LoadedCharacters.Values.Where(c => c.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
Skill? s = SkillCreator.LoadedSkills.Values.Where(s => s.GetIdName() == selected).FirstOrDefault();
if (c != null && s != null)
{
s = (s.Id, s.Name);
if (s != null) c.Skills.Add(s);
}
}
else
{
MessageBox.Show("技能列表为空!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && nowClick == 0)
{
if (ItemCreator.LoadedItems.Count != 0)
{
Showlist l = new();
l.AddListItem(ItemCreator.LoadedItems.Values.Select(i => i.GetIdName()).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Character? c = CharacterCreator.LoadedCharacters.Values.Where(c => c.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
Item? i = ItemCreator.LoadedItems.Values.Where(i => i.GetIdName() == selected).FirstOrDefault();
if (c != null && i != null)
{
i = (i.Id, i.Name);
if (i != null) c.Items.Add(i);
}
}
else
{
MessageBox.Show("物品列表为空!");
}
}
}
private void _Click(object sender, EventArgs e)
{
Character c = Factory.GetCharacter();
c.Name = Interaction.InputBox("输入姓", "姓", "");
c.FirstName = Interaction.InputBox("输入名", "名", "");
c.NickName = Interaction.InputBox("输入昵称", "昵称", "");
string primaryAttributeInput = Interaction.InputBox("输入核心属性 (STR, AGI, INT)", "核心属性", "None");
c.PrimaryAttribute = Enum.TryParse(primaryAttributeInput, out PrimaryAttribute primaryAttribute) ? primaryAttribute : PrimaryAttribute.None;
// 解析 double 类型的输入
c.InitialATK = double.Parse(Interaction.InputBox("输入初始攻击力", "初始攻击力", "0.0"));
c.InitialHP = double.Parse(Interaction.InputBox("输入初始生命值", "初始生命值", "1.0"));
c.InitialMP = double.Parse(Interaction.InputBox("输入初始魔法值", "初始魔法值", "0.0"));
c.InitialSTR = double.Parse(Interaction.InputBox("输入初始力量", "初始力量", "0.0"));
c.STRGrowth = double.Parse(Interaction.InputBox("输入力量成长", "力量成长", "0.0"));
c.InitialAGI = double.Parse(Interaction.InputBox("输入初始敏捷", "初始敏捷", "0.0"));
c.AGIGrowth = double.Parse(Interaction.InputBox("输入敏捷成长", "敏捷成长", "0.0"));
c.InitialINT = double.Parse(Interaction.InputBox("输入初始智力", "初始智力", "0.0"));
c.INTGrowth = double.Parse(Interaction.InputBox("输入智力成长", "智力成长", "0.0"));
c.InitialSPD = double.Parse(Interaction.InputBox("输入初始行动速度", "初始行动速度", "0.0"));
c.InitialHR = double.Parse(Interaction.InputBox("输入初始生命回复", "初始生命回复", "0.0"));
c.InitialMR = double.Parse(Interaction.InputBox("输入初始魔法回复", "初始魔法回复", "0.0"));
string name = Interaction.InputBox("输入角色代号以确认创建", "角色代号", "");
if (name != "" && c.Name != "" && CharacterCreator.Add(name, c))
{
MessageBox.Show("创建成功!");
();
ShowDetail d = new();
d.SetText(c.GetInfo());
d.ShowDialog();
d.Dispose();
}
else
{
MessageBox.Show("创建已取消。");
}
}
private void _Click(object sender, EventArgs e)
{
Skill s = Factory.GetSkill();
s.Id = long.Parse(Interaction.InputBox("输入技能编号", "技能编号", "0"));
s.Name = Interaction.InputBox("输入技能名称", "技能名称", "");
string name = Interaction.InputBox("输入技能代号以确认创建", "技能代号", "");
if (name != "" && s.Id != 0 && s.Name != "" && SkillCreator.Add(name, s))
{
MessageBox.Show("创建成功!");
();
ShowDetail d = new();
d.SetText(s.ToString());
d.ShowDialog();
d.Dispose();
}
else
{
MessageBox.Show("创建已取消。");
}
}
private void _Click(object sender, EventArgs e)
{
Item i = Factory.GetItem();
i.Id = long.Parse(Interaction.InputBox("输入物品编号", "物品编号", "0"));
i.Name = Interaction.InputBox("输入物品名称", "物品名称", "");
string name = Interaction.InputBox("输入物品代号以确认创建", "物品代号", "");
if (name != "" && i.Id != 0 && i.Name != "" && ItemCreator.Add(name, i))
{
MessageBox.Show("创建成功!");
();
ShowDetail d = new();
d.SetText(i.ToString());
d.ShowDialog();
d.Dispose();
}
else
{
MessageBox.Show("创建已取消。");
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && MessageBox.Show("是否删除", "删除", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
string name = CharacterCreator.LoadedCharacters.Where(ky => ky.Value.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault().Key ?? "";
if (CharacterCreator.Remove(name))
{
MessageBox.Show("删除成功!");
();
}
else
{
MessageBox.Show("删除失败!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && MessageBox.Show("是否删除", "删除", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
string name = SkillCreator.LoadedSkills.Where(ky => ky.Value.GetIdName() == .Items[.SelectedIndex].ToString()).FirstOrDefault().Key ?? "";
if (SkillCreator.Remove(name))
{
MessageBox.Show("删除成功!");
();
}
else
{
MessageBox.Show("删除失败!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && MessageBox.Show("是否删除", "删除", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
string name = ItemCreator.LoadedItems.Where(ky => ky.Value.GetIdName() == .Items[.SelectedIndex].ToString()).FirstOrDefault().Key ?? "";
if (ItemCreator.Remove(name))
{
MessageBox.Show("删除成功!");
();
}
else
{
MessageBox.Show("删除失败!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (MessageBox.Show("重新读取会丢失未保存的数据,是否确认重新读取全部?", "重新读取全部", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
CharacterCreator.Load();
SkillCreator.Load();
ItemCreator.Load();
();
();
();
}
}
private static GameModuleLoader LoadModules()
{
PluginLoader plugins = PluginLoader.LoadPlugins([]);
foreach (string plugin in plugins.Plugins.Keys)
{
Console.WriteLine(plugin + " is loaded.");
}
return GameModuleLoader.LoadGameModules(FunGameInfo.FunGame.FunGame_Desktop, []);
}
}
}

View File

@ -0,0 +1,120 @@
<?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

@ -0,0 +1,37 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public class ItemCreator
{
public Dictionary<string, Item> LoadedItems { get; set; } = [];
public void Load()
{
EntityModuleConfig<Item> config = new("redbud.fun.entitycreator", "itemcreator");
config.LoadConfig();
LoadedItems = new(config);
}
public bool Add(string name, Item item)
{
return LoadedItems.TryAdd(name, item);
}
public bool Remove(string name)
{
return LoadedItems.Remove(name);
}
public void Save()
{
EntityModuleConfig<Item> config = new("redbud.fun.entitycreator", "itemcreator");
foreach (string key in LoadedItems.Keys)
{
config.Add(key, LoadedItems[key]);
}
config.SaveConfig();
}
}
}

59
Desktop/Solutions/ShowDetail.Designer.cs generated Normal file
View File

@ -0,0 +1,59 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
partial class ShowDetail
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
richTextBox1 = new RichTextBox();
SuspendLayout();
//
// richTextBox1
//
richTextBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
richTextBox1.Location = new Point(12, 12);
richTextBox1.Name = "richTextBox1";
richTextBox1.ReadOnly = true;
richTextBox1.Size = new Size(622, 453);
richTextBox1.TabIndex = 0;
richTextBox1.Text = "";
//
// ShowDetail
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(646, 477);
Controls.Add(richTextBox1);
Name = "ShowDetail";
Text = "ShowDetail";
ResumeLayout(false);
}
#endregion
private RichTextBox richTextBox1;
}
}

View File

@ -0,0 +1,15 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public partial class ShowDetail : Form
{
public ShowDetail()
{
InitializeComponent();
}
public void SetText(string text)
{
richTextBox1.Text = text;
}
}
}

View File

@ -0,0 +1,120 @@
<?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>

60
Desktop/Solutions/Showlist.Designer.cs generated Normal file
View File

@ -0,0 +1,60 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
partial class Showlist
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
= new ListBox();
SuspendLayout();
//
// 选择表
//
.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
.FormattingEnabled = true;
.ItemHeight = 17;
.Location = new Point(12, 12);
.Name = "选择表";
.Size = new Size(484, 429);
.TabIndex = 0;
.MouseDoubleClick += _MouseDoubleClick;
//
// Showlist
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(508, 450);
Controls.Add();
Name = "Showlist";
Text = "Showlist";
ResumeLayout(false);
}
#endregion
private ListBox ;
}
}

View File

@ -0,0 +1,24 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public partial class Showlist : Form
{
public string SelectItem { get; set; } = "";
public Showlist()
{
InitializeComponent();
}
public void AddListItem(object[] items)
{
.Items.Clear();
.Items.AddRange(items);
}
private void _MouseDoubleClick(object sender, EventArgs e)
{
SelectItem = .SelectedItem?.ToString() ?? "";
Dispose();
}
}
}

View File

@ -0,0 +1,120 @@
<?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

@ -0,0 +1,37 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public class SkillCreator
{
public Dictionary<string, Skill> LoadedSkills { get; set; } = [];
public void Load()
{
EntityModuleConfig<Skill> config = new("redbud.fun.entitycreator", "skillcreator");
config.LoadConfig();
LoadedSkills = new(config);
}
public bool Add(string name, Skill skill)
{
return LoadedSkills.TryAdd(name, skill);
}
public bool Remove(string name)
{
return LoadedSkills.Remove(name);
}
public void Save()
{
EntityModuleConfig<Skill> config = new("redbud.fun.entitycreator", "skillcreator");
foreach (string key in LoadedSkills.Keys)
{
config.Add(key, LoadedSkills[key]);
}
config.SaveConfig();
}
}
}

View File

@ -2,9 +2,9 @@
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
namespace FunGame.Testing.Characters namespace MilimoeFunGame.Testing.Characters
{ {
public class Characters public class OshimaCharacters
{ {
public static Character Oshima public static Character Oshima
{ {

View File

@ -1,7 +1,7 @@
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
namespace FunGame.Testing.Effects namespace Milimoe.FunGame.Testing.Effects
{ {
public class : Effect public class : Effect
{ {

View File

@ -2,7 +2,7 @@
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
namespace FunGame.Testing.Effects namespace Milimoe.FunGame.Testing.Effects
{ {
public class : Effect public class : Effect
{ {

View File

@ -1,7 +1,7 @@
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
namespace FunGame.Testing.Effects namespace Milimoe.FunGame.Testing.Effects
{ {
public class : Effect public class : Effect
{ {

View File

@ -2,7 +2,7 @@
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
namespace FunGame.Testing.Effects namespace Milimoe.FunGame.Testing.Effects
{ {
public class : Effect public class : Effect
{ {

View File

@ -1,7 +1,7 @@
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
namespace FunGame.Testing.Effects namespace Milimoe.FunGame.Testing.Effects
{ {
public class : Effect public class : Effect
{ {

View File

@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<BaseOutputPath>..\bin\</BaseOutputPath> <BaseOutputPath>..\bin\</BaseOutputPath>
<RootNamespace>Milimoe.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,8 +1,8 @@
using FunGame.Testing.Effects; using Milimoe.FunGame.Testing.Effects;
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
namespace FunGame.Testing.Items namespace Milimoe.FunGame.Testing.Items
{ {
public class 10 : Item public class 10 : Item
{ {

View File

@ -1,4 +1,4 @@
using FunGame.Testing.Effects; using Milimoe.FunGame.Testing.Effects;
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;

View File

@ -1,6 +1,8 @@
using Milimoe.FunGame.Core.Api.Utility; using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Common.Addon; using Milimoe.FunGame.Core.Library.Common.Addon;
using Milimoe.FunGame.Testing.Items;
using Milimoe.FunGame.Testing.Skills;
namespace Addons namespace Addons
{ {
@ -47,10 +49,49 @@ namespace Addons
{ {
get get
{ {
Character c = Factory.GetCharacter();
List<Skill> list = []; List<Skill> list = [];
list.Add(new (c));
list.Add(new (c));
list.Add(new META马(c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
return list; return list;
} }
} }
public override Skill? GetSkill(long id, string name)
{
string str = id + "." + name;
if (Skills.Where(s => s.GetIdName() == str).FirstOrDefault() is Skill s)
{
return s;
}
return null;
}
} }
public class ExampleItemModule : ItemModule public class ExampleItemModule : ItemModule
@ -68,12 +109,19 @@ namespace Addons
get get
{ {
List<Item> list = []; List<Item> list = [];
Item i = Factory.GetItem(); list.Add(new 50());
i.Name = "Example Item";
i.Price = 20;
list.Add(i);
return list; return list;
} }
} }
public override Item? GetItem(long id, string name)
{
string str = id + "." + name;
if (Items.Where(s => s.GetIdName() == str).FirstOrDefault() is Item i)
{
return i;
}
return null;
}
} }
} }

View File

@ -1,9 +1,12 @@
using FunGame.Testing.Characters; using System.Collections.Generic;
using Milimoe.FunGame.Core.Api.Utility; using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Interface; using Milimoe.FunGame.Core.Interface;
using Milimoe.FunGame.Core.Library.Common.Addon; using Milimoe.FunGame.Core.Library.Common.Addon;
using Milimoe.FunGame.Core.Library.Common.Event; using Milimoe.FunGame.Core.Library.Common.Event;
using Milimoe.FunGame.Testing.Items;
using Milimoe.FunGame.Testing.Skills;
using MilimoeFunGame.Testing.Characters;
namespace Addons namespace Addons
{ {
@ -21,27 +24,70 @@ namespace Addons
{ {
EntityModuleConfig<Character> config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleCharacter) EntityModuleConfig<Character> config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleCharacter)
{ {
{ "Oshima", Characters.Oshima }, { "Oshima", OshimaCharacters.Oshima },
{ "Xinyin", Characters.Xinyin }, { "Xinyin", OshimaCharacters.Xinyin },
{ "Yang", Characters.Yang }, { "Yang", OshimaCharacters.Yang },
{ "NanGanyu", Characters.NanGanyu }, { "NanGanyu", OshimaCharacters.NanGanyu },
{ "NiuNan", Characters.NiuNan }, { "NiuNan", OshimaCharacters.NiuNan },
{ "Mayor", Characters.Mayor }, { "Mayor", OshimaCharacters.Mayor },
{ "马猴烧酒", Characters. }, { "马猴烧酒", OshimaCharacters. },
{ "QingXiang", Characters.QingXiang }, { "QingXiang", OshimaCharacters.QingXiang },
{ "QWQAQW", Characters.QWQAQW }, { "QWQAQW", OshimaCharacters.QWQAQW },
{ "ColdBlue", Characters.ColdBlue }, { "ColdBlue", OshimaCharacters.ColdBlue },
{ "绿拱门", Characters.绿 }, { "绿拱门", OshimaCharacters.绿 },
{ "QuDuoduo", Characters.QuDuoduo } { "QuDuoduo", OshimaCharacters.QuDuoduo }
}; };
config.SaveConfig(); config.SaveConfig();
PluginConfig config2 = new(Name, "config")
EntityModuleConfig<Skill> config2 = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleSkill);
Character c = Factory.GetCharacter();
List<Skill> listSkill = [];
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new META马(c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
listSkill.Add(new (c));
foreach (Skill s in listSkill)
{
config2.Add(s.Name, s);
}
config2.SaveConfig();
EntityModuleConfig<Item> config3 = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleItem)
{
{ "攻击之爪50", new 50() }
};
config3.SaveConfig();
PluginConfig config4 = new(Name, "config")
{ {
{ "flush", 10000 }, { "flush", 10000 },
{ "oshima", "呵呵了" } { "oshima", "呵呵了" }
}; };
config2.SaveConfig(); config4.SaveConfig();
return true; return true;
} }

View File

@ -1,5 +1,5 @@
using System.Text; using System.Text;
using FunGame.Testing.Items; using Milimoe.FunGame.Testing.Items;
using Milimoe.FunGame.Core.Api.Utility; using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Common.Addon; using Milimoe.FunGame.Core.Library.Common.Addon;