mirror of
https://github.com/milimoe/FunGame-Testing.git
synced 2025-04-21 19:59:34 +08:00
在模组加载器中,添加了技能构造方法
This commit is contained in:
parent
40dc598b62
commit
8bcddf642f
@ -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'">
|
||||||
|
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
37
Desktop/Solutions/CharacterCreator.cs
Normal file
37
Desktop/Solutions/CharacterCreator.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
301
Desktop/Solutions/EntityCreator.Designer.cs
generated
Normal file
301
Desktop/Solutions/EntityCreator.Designer.cs
generated
Normal 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 重新读取全部;
|
||||||
|
}
|
||||||
|
}
|
388
Desktop/Solutions/EntityCreator.cs
Normal file
388
Desktop/Solutions/EntityCreator.cs
Normal 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, []);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
Desktop/Solutions/EntityCreator.resx
Normal file
120
Desktop/Solutions/EntityCreator.resx
Normal 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>
|
37
Desktop/Solutions/ItemCreator.cs
Normal file
37
Desktop/Solutions/ItemCreator.cs
Normal 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
59
Desktop/Solutions/ShowDetail.Designer.cs
generated
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
15
Desktop/Solutions/ShowDetail.cs
Normal file
15
Desktop/Solutions/ShowDetail.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
Desktop/Solutions/ShowDetail.resx
Normal file
120
Desktop/Solutions/ShowDetail.resx
Normal 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
60
Desktop/Solutions/Showlist.Designer.cs
generated
Normal 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 选择表;
|
||||||
|
}
|
||||||
|
}
|
24
Desktop/Solutions/Showlist.cs
Normal file
24
Desktop/Solutions/Showlist.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
Desktop/Solutions/Showlist.resx
Normal file
120
Desktop/Solutions/Showlist.resx
Normal 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>
|
37
Desktop/Solutions/SkillCreator.cs
Normal file
37
Desktop/Solutions/SkillCreator.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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>
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user