Add Drop Editor (WIP)

This commit is contained in:
2022-10-25 23:36:30 +08:00
parent f0885a1fee
commit c860180564
9 changed files with 3682 additions and 605 deletions

View File

@ -0,0 +1,433 @@
namespace GrasscutterTools.Forms
{
partial class FormDropEditor
{
/// <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()
{
this.LblDropPathLabel = new System.Windows.Forms.Label();
this.TxtDropJsonPath = new System.Windows.Forms.TextBox();
this.BtnLoad = new System.Windows.Forms.Button();
this.BtnSave = new System.Windows.Forms.Button();
this.ListMonsters = new System.Windows.Forms.ListBox();
this.TxtMonsterFilter = new System.Windows.Forms.TextBox();
this.TxtItemFilter = new System.Windows.Forms.TextBox();
this.ListDropData = new System.Windows.Forms.ListBox();
this.GrpDropList = new System.Windows.Forms.GroupBox();
this.BtnClear = new System.Windows.Forms.Button();
this.BtnPaste = new System.Windows.Forms.Button();
this.BtnCopy = new System.Windows.Forms.Button();
this.TxtItem = new System.Windows.Forms.TextBox();
this.BtnDelete = new System.Windows.Forms.Button();
this.BtnAdd = new System.Windows.Forms.Button();
this.LblItemLabel = new System.Windows.Forms.Label();
this.LblTilde2 = new System.Windows.Forms.Label();
this.LblTilde1 = new System.Windows.Forms.Label();
this.NUDMaxWeight = new System.Windows.Forms.NumericUpDown();
this.NUDMinWeight = new System.Windows.Forms.NumericUpDown();
this.NUDMaxCount = new System.Windows.Forms.NumericUpDown();
this.NUDMinCount = new System.Windows.Forms.NumericUpDown();
this.LblWeightLabel = new System.Windows.Forms.Label();
this.LblCountLabel = new System.Windows.Forms.Label();
this.ListItems = new System.Windows.Forms.ListBox();
this.GrpMonsterList = new System.Windows.Forms.GroupBox();
this.GrpItemList = new System.Windows.Forms.GroupBox();
this.GrpDropList.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NUDMaxWeight)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUDMinWeight)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUDMaxCount)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUDMinCount)).BeginInit();
this.GrpMonsterList.SuspendLayout();
this.GrpItemList.SuspendLayout();
this.SuspendLayout();
//
// LblDropPathLabel
//
this.LblDropPathLabel.AutoSize = true;
this.LblDropPathLabel.Location = new System.Drawing.Point(17, 15);
this.LblDropPathLabel.Name = "LblDropPathLabel";
this.LblDropPathLabel.Size = new System.Drawing.Size(105, 17);
this.LblDropPathLabel.TabIndex = 0;
this.LblDropPathLabel.Text = "Drop.json 路径:";
//
// TxtDropJsonPath
//
this.TxtDropJsonPath.Location = new System.Drawing.Point(128, 12);
this.TxtDropJsonPath.Name = "TxtDropJsonPath";
this.TxtDropJsonPath.Size = new System.Drawing.Size(487, 23);
this.TxtDropJsonPath.TabIndex = 1;
//
// BtnLoad
//
this.BtnLoad.Location = new System.Drawing.Point(621, 12);
this.BtnLoad.Name = "BtnLoad";
this.BtnLoad.Size = new System.Drawing.Size(75, 23);
this.BtnLoad.TabIndex = 2;
this.BtnLoad.Text = "加载";
this.BtnLoad.UseVisualStyleBackColor = true;
this.BtnLoad.Click += new System.EventHandler(this.BtnLoad_Click);
//
// BtnSave
//
this.BtnSave.Location = new System.Drawing.Point(702, 12);
this.BtnSave.Name = "BtnSave";
this.BtnSave.Size = new System.Drawing.Size(75, 23);
this.BtnSave.TabIndex = 3;
this.BtnSave.Text = "保存";
this.BtnSave.UseVisualStyleBackColor = true;
this.BtnSave.Click += new System.EventHandler(this.BtnSave_Click);
//
// ListMonsters
//
this.ListMonsters.FormattingEnabled = true;
this.ListMonsters.ItemHeight = 17;
this.ListMonsters.Location = new System.Drawing.Point(6, 51);
this.ListMonsters.Name = "ListMonsters";
this.ListMonsters.Size = new System.Drawing.Size(238, 344);
this.ListMonsters.TabIndex = 4;
this.ListMonsters.SelectedIndexChanged += new System.EventHandler(this.ListMonsters_SelectedIndexChanged);
//
// TxtMonsterFilter
//
this.TxtMonsterFilter.Location = new System.Drawing.Point(6, 22);
this.TxtMonsterFilter.Name = "TxtMonsterFilter";
this.TxtMonsterFilter.Size = new System.Drawing.Size(238, 23);
this.TxtMonsterFilter.TabIndex = 5;
this.TxtMonsterFilter.TextChanged += new System.EventHandler(this.TxtMonsterFilter_TextChanged);
//
// TxtItemFilter
//
this.TxtItemFilter.Location = new System.Drawing.Point(6, 22);
this.TxtItemFilter.Name = "TxtItemFilter";
this.TxtItemFilter.Size = new System.Drawing.Size(238, 23);
this.TxtItemFilter.TabIndex = 6;
this.TxtItemFilter.TextChanged += new System.EventHandler(this.TxtItemFilter_TextChanged);
//
// ListDropData
//
this.ListDropData.FormattingEnabled = true;
this.ListDropData.ItemHeight = 17;
this.ListDropData.Location = new System.Drawing.Point(6, 22);
this.ListDropData.Name = "ListDropData";
this.ListDropData.Size = new System.Drawing.Size(238, 174);
this.ListDropData.TabIndex = 7;
this.ListDropData.SelectedIndexChanged += new System.EventHandler(this.ListDropData_SelectedIndexChanged);
//
// GrpDropList
//
this.GrpDropList.Controls.Add(this.BtnClear);
this.GrpDropList.Controls.Add(this.BtnPaste);
this.GrpDropList.Controls.Add(this.BtnCopy);
this.GrpDropList.Controls.Add(this.TxtItem);
this.GrpDropList.Controls.Add(this.BtnDelete);
this.GrpDropList.Controls.Add(this.BtnAdd);
this.GrpDropList.Controls.Add(this.LblItemLabel);
this.GrpDropList.Controls.Add(this.LblTilde2);
this.GrpDropList.Controls.Add(this.LblTilde1);
this.GrpDropList.Controls.Add(this.NUDMaxWeight);
this.GrpDropList.Controls.Add(this.NUDMinWeight);
this.GrpDropList.Controls.Add(this.NUDMaxCount);
this.GrpDropList.Controls.Add(this.NUDMinCount);
this.GrpDropList.Controls.Add(this.LblWeightLabel);
this.GrpDropList.Controls.Add(this.LblCountLabel);
this.GrpDropList.Controls.Add(this.ListDropData);
this.GrpDropList.Location = new System.Drawing.Point(270, 41);
this.GrpDropList.Name = "GrpDropList";
this.GrpDropList.Size = new System.Drawing.Size(250, 400);
this.GrpDropList.TabIndex = 8;
this.GrpDropList.TabStop = false;
this.GrpDropList.Text = "掉落列表";
//
// BtnClear
//
this.BtnClear.Location = new System.Drawing.Point(169, 202);
this.BtnClear.Name = "BtnClear";
this.BtnClear.Size = new System.Drawing.Size(75, 23);
this.BtnClear.TabIndex = 21;
this.BtnClear.Text = "× 清空";
this.BtnClear.UseVisualStyleBackColor = true;
//
// BtnPaste
//
this.BtnPaste.Location = new System.Drawing.Point(87, 202);
this.BtnPaste.Name = "BtnPaste";
this.BtnPaste.Size = new System.Drawing.Size(75, 23);
this.BtnPaste.TabIndex = 20;
this.BtnPaste.Text = "粘贴";
this.BtnPaste.UseVisualStyleBackColor = true;
//
// BtnCopy
//
this.BtnCopy.Location = new System.Drawing.Point(6, 202);
this.BtnCopy.Name = "BtnCopy";
this.BtnCopy.Size = new System.Drawing.Size(75, 23);
this.BtnCopy.TabIndex = 19;
this.BtnCopy.Text = "复制";
this.BtnCopy.UseVisualStyleBackColor = true;
//
// TxtItem
//
this.TxtItem.Location = new System.Drawing.Point(87, 253);
this.TxtItem.Name = "TxtItem";
this.TxtItem.Size = new System.Drawing.Size(137, 23);
this.TxtItem.TabIndex = 12;
//
// BtnDelete
//
this.BtnDelete.Location = new System.Drawing.Point(87, 360);
this.BtnDelete.Name = "BtnDelete";
this.BtnDelete.Size = new System.Drawing.Size(75, 23);
this.BtnDelete.TabIndex = 18;
this.BtnDelete.Text = "- 删除";
this.BtnDelete.UseVisualStyleBackColor = true;
//
// BtnAdd
//
this.BtnAdd.Location = new System.Drawing.Point(6, 360);
this.BtnAdd.Name = "BtnAdd";
this.BtnAdd.Size = new System.Drawing.Size(75, 23);
this.BtnAdd.TabIndex = 17;
this.BtnAdd.Text = "+ 添加";
this.BtnAdd.UseVisualStyleBackColor = true;
//
// LblItemLabel
//
this.LblItemLabel.AutoSize = true;
this.LblItemLabel.Location = new System.Drawing.Point(25, 256);
this.LblItemLabel.Name = "LblItemLabel";
this.LblItemLabel.Size = new System.Drawing.Size(56, 17);
this.LblItemLabel.TabIndex = 15;
this.LblItemLabel.Text = "掉落物:";
//
// LblTilde2
//
this.LblTilde2.AutoSize = true;
this.LblTilde2.Location = new System.Drawing.Point(141, 315);
this.LblTilde2.Name = "LblTilde2";
this.LblTilde2.Size = new System.Drawing.Size(17, 17);
this.LblTilde2.TabIndex = 14;
this.LblTilde2.Text = "~";
//
// LblTilde1
//
this.LblTilde1.AutoSize = true;
this.LblTilde1.Location = new System.Drawing.Point(141, 286);
this.LblTilde1.Name = "LblTilde1";
this.LblTilde1.Size = new System.Drawing.Size(17, 17);
this.LblTilde1.TabIndex = 14;
this.LblTilde1.Text = "~";
//
// NUDMaxWeight
//
this.NUDMaxWeight.Location = new System.Drawing.Point(164, 313);
this.NUDMaxWeight.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.NUDMaxWeight.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.NUDMaxWeight.Name = "NUDMaxWeight";
this.NUDMaxWeight.Size = new System.Drawing.Size(60, 23);
this.NUDMaxWeight.TabIndex = 13;
this.NUDMaxWeight.Value = new decimal(new int[] {
10000,
0,
0,
0});
//
// NUDMinWeight
//
this.NUDMinWeight.Location = new System.Drawing.Point(75, 315);
this.NUDMinWeight.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.NUDMinWeight.Name = "NUDMinWeight";
this.NUDMinWeight.Size = new System.Drawing.Size(60, 23);
this.NUDMinWeight.TabIndex = 12;
//
// NUDMaxCount
//
this.NUDMaxCount.Location = new System.Drawing.Point(164, 284);
this.NUDMaxCount.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.NUDMaxCount.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.NUDMaxCount.Name = "NUDMaxCount";
this.NUDMaxCount.Size = new System.Drawing.Size(60, 23);
this.NUDMaxCount.TabIndex = 11;
this.NUDMaxCount.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// NUDMinCount
//
this.NUDMinCount.Location = new System.Drawing.Point(75, 284);
this.NUDMinCount.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.NUDMinCount.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.NUDMinCount.Name = "NUDMinCount";
this.NUDMinCount.Size = new System.Drawing.Size(60, 23);
this.NUDMinCount.TabIndex = 10;
this.NUDMinCount.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// LblWeightLabel
//
this.LblWeightLabel.AutoSize = true;
this.LblWeightLabel.Location = new System.Drawing.Point(25, 317);
this.LblWeightLabel.Name = "LblWeightLabel";
this.LblWeightLabel.Size = new System.Drawing.Size(44, 17);
this.LblWeightLabel.TabIndex = 9;
this.LblWeightLabel.Text = "权重:";
//
// LblCountLabel
//
this.LblCountLabel.AutoSize = true;
this.LblCountLabel.Location = new System.Drawing.Point(25, 286);
this.LblCountLabel.Name = "LblCountLabel";
this.LblCountLabel.Size = new System.Drawing.Size(44, 17);
this.LblCountLabel.TabIndex = 8;
this.LblCountLabel.Text = "数量:";
//
// ListItems
//
this.ListItems.FormattingEnabled = true;
this.ListItems.ItemHeight = 17;
this.ListItems.Location = new System.Drawing.Point(6, 51);
this.ListItems.Name = "ListItems";
this.ListItems.Size = new System.Drawing.Size(238, 344);
this.ListItems.TabIndex = 9;
this.ListItems.SelectedIndexChanged += new System.EventHandler(this.ListItems_SelectedIndexChanged);
//
// GrpMonsterList
//
this.GrpMonsterList.Controls.Add(this.ListMonsters);
this.GrpMonsterList.Controls.Add(this.TxtMonsterFilter);
this.GrpMonsterList.Location = new System.Drawing.Point(12, 41);
this.GrpMonsterList.Name = "GrpMonsterList";
this.GrpMonsterList.Size = new System.Drawing.Size(250, 400);
this.GrpMonsterList.TabIndex = 10;
this.GrpMonsterList.TabStop = false;
this.GrpMonsterList.Text = "怪物列表";
//
// GrpItemList
//
this.GrpItemList.Controls.Add(this.TxtItemFilter);
this.GrpItemList.Controls.Add(this.ListItems);
this.GrpItemList.Location = new System.Drawing.Point(526, 41);
this.GrpItemList.Name = "GrpItemList";
this.GrpItemList.Size = new System.Drawing.Size(250, 400);
this.GrpItemList.TabIndex = 11;
this.GrpItemList.TabStop = false;
this.GrpItemList.Text = "物品列表";
//
// FormDropEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(789, 450);
this.Controls.Add(this.GrpItemList);
this.Controls.Add(this.GrpMonsterList);
this.Controls.Add(this.GrpDropList);
this.Controls.Add(this.BtnSave);
this.Controls.Add(this.BtnLoad);
this.Controls.Add(this.TxtDropJsonPath);
this.Controls.Add(this.LblDropPathLabel);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "FormDropEditor";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Drop.json Editor";
this.GrpDropList.ResumeLayout(false);
this.GrpDropList.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.NUDMaxWeight)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUDMinWeight)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUDMaxCount)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUDMinCount)).EndInit();
this.GrpMonsterList.ResumeLayout(false);
this.GrpMonsterList.PerformLayout();
this.GrpItemList.ResumeLayout(false);
this.GrpItemList.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label LblDropPathLabel;
private System.Windows.Forms.TextBox TxtDropJsonPath;
private System.Windows.Forms.Button BtnLoad;
private System.Windows.Forms.Button BtnSave;
private System.Windows.Forms.ListBox ListMonsters;
private System.Windows.Forms.TextBox TxtMonsterFilter;
private System.Windows.Forms.TextBox TxtItemFilter;
private System.Windows.Forms.ListBox ListDropData;
private System.Windows.Forms.GroupBox GrpDropList;
private System.Windows.Forms.Label LblTilde2;
private System.Windows.Forms.Label LblTilde1;
private System.Windows.Forms.NumericUpDown NUDMaxWeight;
private System.Windows.Forms.NumericUpDown NUDMinWeight;
private System.Windows.Forms.NumericUpDown NUDMaxCount;
private System.Windows.Forms.NumericUpDown NUDMinCount;
private System.Windows.Forms.Label LblWeightLabel;
private System.Windows.Forms.Label LblCountLabel;
private System.Windows.Forms.Label LblItemLabel;
private System.Windows.Forms.ListBox ListItems;
private System.Windows.Forms.GroupBox GrpMonsterList;
private System.Windows.Forms.GroupBox GrpItemList;
private System.Windows.Forms.Button BtnDelete;
private System.Windows.Forms.Button BtnAdd;
private System.Windows.Forms.TextBox TxtItem;
private System.Windows.Forms.Button BtnCopy;
private System.Windows.Forms.Button BtnPaste;
private System.Windows.Forms.Button BtnClear;
}
}

View File

@ -0,0 +1,192 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using GrasscutterTools.Game;
using GrasscutterTools.Game.Drop;
using GrasscutterTools.Properties;
using Newtonsoft.Json;
namespace GrasscutterTools.Forms
{
public partial class FormDropEditor : Form
{
public FormDropEditor()
{
InitializeComponent();
Icon = Resources.IconGrasscutter;
ListMonsters.Items.AddRange(GameData.Monsters.Lines);
ListItems.Items.AddRange(GameData.Items.Lines);
Banners = new Dictionary<int, List<DropData>>();
}
private Dictionary<int, List<DropData>> Banners;
#region - Drop.json -
/// <summary>
/// 加载按钮点击时触发
/// </summary>
private void BtnLoad_Click(object sender, EventArgs e)
{
try
{
var path = TxtDropJsonPath.Text.Trim();
if (path == string.Empty)
{
var dialog = new OpenFileDialog
{
FileName = "Drop.json",
Filter = "Drop.Json (*.json)|*.json|All files (*.*)|*.*",
};
var result = dialog.ShowDialog();
if (result == DialogResult.OK)
path = TxtDropJsonPath.Text = dialog.FileName;
else
return;
}
// 反序列化
var banners = JsonConvert.DeserializeObject<List<DropInfo>>(File.ReadAllText(path));
Banners = new Dictionary<int, List<DropData>>(banners.Count);
foreach (var item in banners)
Banners.Add(item.MonsterId, item.DropDataList);
MessageBox.Show("OK", Resources.Tips, MessageBoxButtons.OK);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
/// <summary>
/// 保存按钮点击时触发
/// </summary>
private void BtnSave_Click(object sender, EventArgs e)
{
try
{
var path = TxtDropJsonPath.Text.Trim();
if (path == string.Empty)
{
var dialog = new SaveFileDialog
{
FileName = "Drop.json",
Filter = "Drop.json (*.json)|*.json|All files (*.*)|*.*",
};
var result = dialog.ShowDialog();
if (result == DialogResult.OK)
path = TxtDropJsonPath.Text = dialog.FileName;
else
return;
}
// 序列化
var banners = new List<DropInfo>(Banners.Count);
foreach (var item in Banners)
{
banners.Add(new DropInfo
{
MonsterId = item.Key,
DropDataList = item.Value,
});
}
File.WriteAllText(path, JsonConvert.SerializeObject(banners));
MessageBox.Show("OK", Resources.Tips, MessageBoxButtons.OK);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
#endregion
#region - -
/// <summary>
/// 怪物列表过滤器文本改变时触发
/// </summary>
private void TxtMonsterFilter_TextChanged(object sender, EventArgs e)
{
var filter = TxtMonsterFilter.Text.Trim();
ListMonsters.BeginUpdate();
ListMonsters.Items.Clear();
ListMonsters.Items.AddRange(GameData.Monsters.Lines.Where(n => n.Contains(filter)).ToArray());
ListMonsters.EndUpdate();
}
/// <summary>
/// 怪物列表选中项改变时触发
/// </summary>
private void ListMonsters_SelectedIndexChanged(object sender, EventArgs e)
{
var monster = ListMonsters.SelectedItem as string;
if (string.IsNullOrEmpty(monster)) return;
var id = int.Parse(monster.Substring(0, monster.IndexOf(':')).Trim());
ListDropData.BeginUpdate();
ListDropData.Items.Clear();
if (Banners.TryGetValue(id, out List<DropData> dropList))
ListDropData.Items.AddRange(dropList.ToArray());
ListDropData.EndUpdate();
}
#endregion
#region - -
/// <summary>
/// 掉落列表选中项改变时触发
/// </summary>
private void ListDropData_SelectedIndexChanged(object sender, EventArgs e)
{
var dropData = ListDropData.SelectedItem as DropData;
if (dropData == null) return;
TxtItem.Text = dropData.ItemId.ToString();
NUDMinCount.Value = dropData.MinCount;
NUDMaxCount.Value = dropData.MaxCount;
NUDMinWeight.Value = dropData.MinWeight;
NUDMaxWeight.Value = dropData.MaxWeight;
}
#endregion
#region - -
/// <summary>
/// 物品列表过滤器文本改变时触发
/// </summary>
private void TxtItemFilter_TextChanged(object sender, EventArgs e)
{
var filter = TxtItemFilter.Text.Trim();
ListItems.BeginUpdate();
ListItems.Items.Clear();
ListItems.Items.AddRange(GameData.Items.Lines.Where(n => n.Contains(filter)).ToArray());
ListItems.EndUpdate();
}
/// <summary>
/// 物品列表选中项改变时触发
/// </summary>
private void ListItems_SelectedIndexChanged(object sender, EventArgs e)
{
var item = ListItems.SelectedItem as string;
if (string.IsNullOrEmpty(item)) return;
TxtItem.Text = item;
}
#endregion
}
}

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

@ -233,6 +233,7 @@ namespace GrasscutterTools.Forms
this.ChkIncludeUID = new System.Windows.Forms.CheckBox();
this.LblDefaultUid = new System.Windows.Forms.Label();
this.TCMain = new System.Windows.Forms.TabControl();
this.BtnOpenDropEditor = new System.Windows.Forms.Button();
this.TxtBanReason = new GrasscutterTools.Controls.TextBoxXP();
this.GrpCommand.SuspendLayout();
this.TPRemoteCall.SuspendLayout();
@ -1938,6 +1939,7 @@ namespace GrasscutterTools.Forms
//
// TPHome
//
this.TPHome.Controls.Add(this.BtnOpenDropEditor);
this.TPHome.Controls.Add(this.LnkNewVersion);
this.TPHome.Controls.Add(this.LblAbout);
this.TPHome.Controls.Add(this.BtnOpenTextMap);
@ -2070,6 +2072,13 @@ namespace GrasscutterTools.Forms
this.TCMain.Name = "TCMain";
this.TCMain.SelectedIndex = 0;
//
// BtnOpenDropEditor
//
resources.ApplyResources(this.BtnOpenDropEditor, "BtnOpenDropEditor");
this.BtnOpenDropEditor.Name = "BtnOpenDropEditor";
this.BtnOpenDropEditor.UseVisualStyleBackColor = true;
this.BtnOpenDropEditor.Click += new System.EventHandler(this.BtnOpenDropEditor_Click);
//
// TxtBanReason
//
this.TxtBanReason.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@ -2383,5 +2392,6 @@ namespace GrasscutterTools.Forms
private System.Windows.Forms.NumericUpDown NUDAvatarSkillLevel;
private System.Windows.Forms.Label LblAvatarSkillLevelLabel;
private System.Windows.Forms.Label LblAvatarSkillLevelTip;
private System.Windows.Forms.Button BtnOpenDropEditor;
}
}

View File

@ -180,11 +180,6 @@ namespace GrasscutterTools.Forms
/// </summary>
private CommandVersion CommandVersion;
/// <summary>
/// 卡池编辑器窗口实例
/// </summary>
private Form GachaBannerEditor;
/// <summary>
/// 初始化首页设置
/// </summary>
@ -222,6 +217,17 @@ namespace GrasscutterTools.Forms
CmbLanguage.SelectedIndexChanged += CmbLanguage_SelectedIndexChanged;
}
private static void ToTop(Form form)
{
form.TopMost = true;
form.TopMost = false;
}
/// <summary>
/// 卡池编辑器窗口实例
/// </summary>
private Form GachaBannerEditor;
/// <summary>
/// 点击打开卡池编辑器时触发
/// </summary>
@ -234,8 +240,7 @@ namespace GrasscutterTools.Forms
}
else
{
GachaBannerEditor.TopMost = true;
GachaBannerEditor.TopMost = false;
ToTop(GachaBannerEditor);
}
}
@ -253,8 +258,28 @@ namespace GrasscutterTools.Forms
}
else
{
TextMapBrowser.TopMost = true;
TextMapBrowser.TopMost = false;
ToTop(TextMapBrowser);
}
}
/// <summary>
/// 掉落物编辑器窗口实例
/// </summary>
private FormDropEditor DropEditor;
/// <summary>
/// 点击打开掉落物编辑器时触发
/// </summary>
private void BtnOpenDropEditor_Click(object sender, EventArgs e)
{
if (DropEditor == null || DropEditor.IsDisposed)
{
DropEditor = new FormDropEditor();
DropEditor.Show();
}
else
{
ToTop(DropEditor);
}
}
@ -2135,5 +2160,6 @@ namespace GrasscutterTools.Forms
}
#endregion - Quests -
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
using Newtonsoft.Json;
namespace GrasscutterTools.Game.Drop
{
public class DropData
{
/// <summary>
/// 物品ID
/// </summary>
[JsonProperty("itemId")]
public int ItemId { get; set; }
/// <summary>
/// 最小数量
/// </summary>
[JsonProperty("minCount")]
public int MinCount { get; set; }
/// <summary>
/// 最大数量
/// </summary>
[JsonProperty("maxCount")]
public int MaxCount { get; set; }
/// <summary>
/// 最小权重范围0~10000
/// </summary>
[JsonProperty("minWeight")]
public int MinWeight { get; set; }
/// <summary>
/// 最大权重范围0~10000
/// </summary>
[JsonProperty("maxWeight")]
public int MaxWeight { get; set; }
// 以下属性可用但没有必要
///// <summary>
///// 是否共享?
///// </summary>
//[JsonProperty("share")]
//public bool IsShare { get; set; }
///// <summary>
///// 是否直接给予
///// </summary>
//[JsonProperty("give")]
//public bool IsGive { get; set; }
public override string ToString()
{
return $"{ItemId} x{MinCount}~x{MaxCount} [{MinWeight}~{MaxWeight}]";
}
}
}

View File

@ -0,0 +1,21 @@
using System.Collections.Generic;
using Newtonsoft.Json;
namespace GrasscutterTools.Game.Drop
{
internal class DropInfo
{
/// <summary>
/// 怪物ID
/// </summary>
[JsonProperty("monsterId")]
public int MonsterId { get; set; }
/// <summary>
/// 掉落列表
/// </summary>
[JsonProperty("dropDataList")]
public List<DropData> DropDataList { get; set; } = new List<DropData>();
}
}

View File

@ -90,6 +90,12 @@
</Compile>
<Compile Include="DispatchServer\DispatchServerAPI.cs" />
<Compile Include="DispatchServer\Model\ServerStatus.cs" />
<Compile Include="Forms\FormDropEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\FormDropEditor.Designer.cs">
<DependentUpon>FormDropEditor.cs</DependentUpon>
</Compile>
<Compile Include="Forms\FormGachaBannerEditor2.cs">
<SubType>Form</SubType>
</Compile>
@ -115,6 +121,8 @@
<DependentUpon>FormTextMapBrowser.cs</DependentUpon>
</Compile>
<Compile Include="Game\CommandVersion.cs" />
<Compile Include="Game\Drop\DropData.cs" />
<Compile Include="Game\Drop\DropInfo.cs" />
<Compile Include="Game\Gacha\GachaBanner2.cs" />
<Compile Include="Game\GameCommand.cs" />
<Compile Include="Game\Gacha\BannerType.cs" />
@ -140,6 +148,9 @@
<Compile Include="Utils\ArtifactUtils.cs" />
<Compile Include="Utils\HttpHelper.cs" />
<Compile Include="Utils\ReleaseAPI.cs" />
<EmbeddedResource Include="Forms\FormDropEditor.resx">
<DependentUpon>FormDropEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\FormGachaBannerEditor2.en-us.resx">
<DependentUpon>FormGachaBannerEditor2.cs</DependentUpon>
</EmbeddedResource>