forked from Raphael/SCHALE.GameServer
detach SCHALE.Toolbox
This commit is contained in:
parent
b524bf0678
commit
98d737b9e2
|
@ -7,8 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SCHALE.GameServer", "SCHALE
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SCHALE.Common", "SCHALE.Common\SCHALE.Common.csproj", "{D8ED8CB5-EA39-46BE-9236-7FC1F46FE15B}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SCHALE.Common", "SCHALE.Common\SCHALE.Common.csproj", "{D8ED8CB5-EA39-46BE-9236-7FC1F46FE15B}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCHALE.Toolbox", "SCHALE.Toolbox\SCHALE.Toolbox.csproj", "{989DC049-A118-4EDB-8C21-5E56E6ADAAB0}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -23,10 +21,6 @@ Global
|
||||||
{D8ED8CB5-EA39-46BE-9236-7FC1F46FE15B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{D8ED8CB5-EA39-46BE-9236-7FC1F46FE15B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{D8ED8CB5-EA39-46BE-9236-7FC1F46FE15B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{D8ED8CB5-EA39-46BE-9236-7FC1F46FE15B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{D8ED8CB5-EA39-46BE-9236-7FC1F46FE15B}.Release|Any CPU.Build.0 = Release|Any CPU
|
{D8ED8CB5-EA39-46BE-9236-7FC1F46FE15B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{989DC049-A118-4EDB-8C21-5E56E6ADAAB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{989DC049-A118-4EDB-8C21-5E56E6ADAAB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{989DC049-A118-4EDB-8C21-5E56E6ADAAB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{989DC049-A118-4EDB-8C21-5E56E6ADAAB0}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<configuration>
|
|
||||||
<configSections>
|
|
||||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
|
||||||
<section name="SCHALE.Toolbox.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
</sectionGroup>
|
|
||||||
</configSections>
|
|
||||||
<userSettings>
|
|
||||||
<SCHALE.Toolbox.Properties.Settings>
|
|
||||||
<setting name="ExcelDirectory" serializeAs="String">
|
|
||||||
<value />
|
|
||||||
</setting>
|
|
||||||
</SCHALE.Toolbox.Properties.Settings>
|
|
||||||
</userSettings>
|
|
||||||
</configuration>
|
|
|
@ -1,194 +0,0 @@
|
||||||
namespace SCHALE.Toolbox.Forms
|
|
||||||
{
|
|
||||||
partial class ExcelEditorForm
|
|
||||||
{
|
|
||||||
/// <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()
|
|
||||||
{
|
|
||||||
downloadButton = new Button();
|
|
||||||
reloadButton = new Button();
|
|
||||||
propGrid = new PropertyGrid();
|
|
||||||
splitContainer1 = new SplitContainer();
|
|
||||||
splitContainer2 = new SplitContainer();
|
|
||||||
tableListView = new ListView();
|
|
||||||
columnHeader1 = new ColumnHeader();
|
|
||||||
itemListView = new ListView();
|
|
||||||
columnHeader2 = new ColumnHeader();
|
|
||||||
button1 = new Button();
|
|
||||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
|
||||||
splitContainer1.Panel1.SuspendLayout();
|
|
||||||
splitContainer1.Panel2.SuspendLayout();
|
|
||||||
splitContainer1.SuspendLayout();
|
|
||||||
((System.ComponentModel.ISupportInitialize)splitContainer2).BeginInit();
|
|
||||||
splitContainer2.Panel1.SuspendLayout();
|
|
||||||
splitContainer2.Panel2.SuspendLayout();
|
|
||||||
splitContainer2.SuspendLayout();
|
|
||||||
SuspendLayout();
|
|
||||||
//
|
|
||||||
// downloadButton
|
|
||||||
//
|
|
||||||
downloadButton.Location = new Point(12, 12);
|
|
||||||
downloadButton.Name = "downloadButton";
|
|
||||||
downloadButton.Size = new Size(188, 44);
|
|
||||||
downloadButton.TabIndex = 0;
|
|
||||||
downloadButton.Text = "Download Excels";
|
|
||||||
downloadButton.UseVisualStyleBackColor = true;
|
|
||||||
downloadButton.Click += downloadButton_Click;
|
|
||||||
//
|
|
||||||
// reloadButton
|
|
||||||
//
|
|
||||||
reloadButton.Location = new Point(206, 12);
|
|
||||||
reloadButton.Name = "reloadButton";
|
|
||||||
reloadButton.Size = new Size(188, 44);
|
|
||||||
reloadButton.TabIndex = 1;
|
|
||||||
reloadButton.Text = "Reload Excels";
|
|
||||||
reloadButton.UseVisualStyleBackColor = true;
|
|
||||||
reloadButton.Click += reloadButton_Click;
|
|
||||||
//
|
|
||||||
// propGrid
|
|
||||||
//
|
|
||||||
propGrid.Dock = DockStyle.Fill;
|
|
||||||
propGrid.Location = new Point(0, 0);
|
|
||||||
propGrid.Name = "propGrid";
|
|
||||||
propGrid.Size = new Size(695, 831);
|
|
||||||
propGrid.TabIndex = 4;
|
|
||||||
//
|
|
||||||
// splitContainer1
|
|
||||||
//
|
|
||||||
splitContainer1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
splitContainer1.Location = new Point(12, 62);
|
|
||||||
splitContainer1.Name = "splitContainer1";
|
|
||||||
//
|
|
||||||
// splitContainer1.Panel1
|
|
||||||
//
|
|
||||||
splitContainer1.Panel1.Controls.Add(splitContainer2);
|
|
||||||
//
|
|
||||||
// splitContainer1.Panel2
|
|
||||||
//
|
|
||||||
splitContainer1.Panel2.Controls.Add(propGrid);
|
|
||||||
splitContainer1.Size = new Size(1048, 831);
|
|
||||||
splitContainer1.SplitterDistance = 349;
|
|
||||||
splitContainer1.TabIndex = 5;
|
|
||||||
//
|
|
||||||
// splitContainer2
|
|
||||||
//
|
|
||||||
splitContainer2.Dock = DockStyle.Fill;
|
|
||||||
splitContainer2.Location = new Point(0, 0);
|
|
||||||
splitContainer2.Name = "splitContainer2";
|
|
||||||
splitContainer2.Orientation = Orientation.Horizontal;
|
|
||||||
//
|
|
||||||
// splitContainer2.Panel1
|
|
||||||
//
|
|
||||||
splitContainer2.Panel1.Controls.Add(tableListView);
|
|
||||||
//
|
|
||||||
// splitContainer2.Panel2
|
|
||||||
//
|
|
||||||
splitContainer2.Panel2.Controls.Add(itemListView);
|
|
||||||
splitContainer2.Size = new Size(349, 831);
|
|
||||||
splitContainer2.SplitterDistance = 373;
|
|
||||||
splitContainer2.TabIndex = 0;
|
|
||||||
//
|
|
||||||
// tableListView
|
|
||||||
//
|
|
||||||
tableListView.Columns.AddRange(new ColumnHeader[] { columnHeader1 });
|
|
||||||
tableListView.Dock = DockStyle.Fill;
|
|
||||||
tableListView.HeaderStyle = ColumnHeaderStyle.None;
|
|
||||||
tableListView.Location = new Point(0, 0);
|
|
||||||
tableListView.MultiSelect = false;
|
|
||||||
tableListView.Name = "tableListView";
|
|
||||||
tableListView.Size = new Size(349, 373);
|
|
||||||
tableListView.TabIndex = 0;
|
|
||||||
tableListView.UseCompatibleStateImageBehavior = false;
|
|
||||||
tableListView.View = View.Details;
|
|
||||||
tableListView.SelectedIndexChanged += tableListView_SelectedIndexChanged;
|
|
||||||
//
|
|
||||||
// columnHeader1
|
|
||||||
//
|
|
||||||
columnHeader1.Text = "";
|
|
||||||
columnHeader1.Width = 240;
|
|
||||||
//
|
|
||||||
// itemListView
|
|
||||||
//
|
|
||||||
itemListView.Columns.AddRange(new ColumnHeader[] { columnHeader2 });
|
|
||||||
itemListView.Dock = DockStyle.Fill;
|
|
||||||
itemListView.HeaderStyle = ColumnHeaderStyle.None;
|
|
||||||
itemListView.Location = new Point(0, 0);
|
|
||||||
itemListView.MultiSelect = false;
|
|
||||||
itemListView.Name = "itemListView";
|
|
||||||
itemListView.Size = new Size(349, 454);
|
|
||||||
itemListView.TabIndex = 0;
|
|
||||||
itemListView.UseCompatibleStateImageBehavior = false;
|
|
||||||
itemListView.View = View.Details;
|
|
||||||
itemListView.SelectedIndexChanged += itemListView_SelectedIndexChanged;
|
|
||||||
//
|
|
||||||
// button1
|
|
||||||
//
|
|
||||||
button1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
||||||
button1.Enabled = false;
|
|
||||||
button1.Location = new Point(872, 12);
|
|
||||||
button1.Name = "button1";
|
|
||||||
button1.Size = new Size(188, 44);
|
|
||||||
button1.TabIndex = 6;
|
|
||||||
button1.Text = "Save";
|
|
||||||
button1.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// ExcelEditorForm
|
|
||||||
//
|
|
||||||
AutoScaleDimensions = new SizeF(10F, 25F);
|
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
|
||||||
ClientSize = new Size(1072, 905);
|
|
||||||
Controls.Add(button1);
|
|
||||||
Controls.Add(splitContainer1);
|
|
||||||
Controls.Add(reloadButton);
|
|
||||||
Controls.Add(downloadButton);
|
|
||||||
Name = "ExcelEditorForm";
|
|
||||||
Text = "ExcelEditor";
|
|
||||||
Load += ExcelEditorForm_Load;
|
|
||||||
splitContainer1.Panel1.ResumeLayout(false);
|
|
||||||
splitContainer1.Panel2.ResumeLayout(false);
|
|
||||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
|
||||||
splitContainer1.ResumeLayout(false);
|
|
||||||
splitContainer2.Panel1.ResumeLayout(false);
|
|
||||||
splitContainer2.Panel2.ResumeLayout(false);
|
|
||||||
((System.ComponentModel.ISupportInitialize)splitContainer2).EndInit();
|
|
||||||
splitContainer2.ResumeLayout(false);
|
|
||||||
ResumeLayout(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private Button downloadButton;
|
|
||||||
private Button reloadButton;
|
|
||||||
private PropertyGrid propGrid;
|
|
||||||
private SplitContainer splitContainer1;
|
|
||||||
private SplitContainer splitContainer2;
|
|
||||||
private ListView tableListView;
|
|
||||||
private ListView itemListView;
|
|
||||||
private Button button1;
|
|
||||||
private ColumnHeader columnHeader1;
|
|
||||||
private ColumnHeader columnHeader2;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,170 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using Google.FlatBuffers;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Converters;
|
|
||||||
using SCHALE.GameServer.Services;
|
|
||||||
using Serilog;
|
|
||||||
using Serilog.Extensions.Logging;
|
|
||||||
using SCHALE.Common;
|
|
||||||
using SCHALE.Common.Crypto;
|
|
||||||
using SCHALE.Common.FlatData;
|
|
||||||
using Form = System.Windows.Forms.Form;
|
|
||||||
|
|
||||||
namespace SCHALE.Toolbox.Forms
|
|
||||||
{
|
|
||||||
public partial class ExcelEditorForm : Form
|
|
||||||
{
|
|
||||||
private readonly ExcelTableService _tableService;
|
|
||||||
private readonly ILogger<ExcelEditorForm> _logger;
|
|
||||||
private string _excelDirectory;
|
|
||||||
private IList? _currentExcelTable = null;
|
|
||||||
|
|
||||||
public ExcelEditorForm()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
var logFactory = new SerilogLoggerFactory(Log.Logger);
|
|
||||||
_logger = logFactory.CreateLogger<ExcelEditorForm>();
|
|
||||||
_tableService = new ExcelTableService(logFactory.CreateLogger<ExcelTableService>());
|
|
||||||
|
|
||||||
_excelDirectory = Path.Join(Path.GetDirectoryName(AppContext.BaseDirectory), "Resources/excel");
|
|
||||||
_logger.LogInformation("Set excel directory to {excelDir}", _excelDirectory);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ExcelEditorForm_Load(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void downloadButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
this.Enabled = false;
|
|
||||||
await ExcelTableService.LoadExcels(_excelDirectory);
|
|
||||||
_logger.LogInformation("Excel downloaded");
|
|
||||||
this.Enabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void reloadButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
ReloadExcels();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void tableListView_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var selectedItems = tableListView.SelectedItems;
|
|
||||||
if (selectedItems.Count < 1) return;
|
|
||||||
|
|
||||||
var type = selectedItems[0].Tag as Type;
|
|
||||||
if (type == null) return;
|
|
||||||
|
|
||||||
var fbPath = Path.Join(_excelDirectory, $"{type.Name.ToLower()}.fb");
|
|
||||||
if (!File.Exists(fbPath))
|
|
||||||
{
|
|
||||||
_logger.LogError("Decrypted flatbuffer for {Type} not found", type);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var bytes = File.ReadAllBytes(fbPath);
|
|
||||||
var inst = type.GetMethod($"GetRootAs{type.Name}", BindingFlags.Static | BindingFlags.Public,
|
|
||||||
[typeof(ByteBuffer)])!.Invoke(null, [new ByteBuffer(bytes)]);
|
|
||||||
var obj = type.GetMethod("UnPack", BindingFlags.Instance | BindingFlags.Public)!.Invoke(inst, null);
|
|
||||||
var dataList =
|
|
||||||
obj!.GetType().GetProperty("DataList", BindingFlags.Instance | BindingFlags.Public)!.GetMethod!.Invoke(obj, null)!;
|
|
||||||
Type? itemType = null;
|
|
||||||
foreach (var iType in dataList!.GetType().GetInterfaces())
|
|
||||||
{
|
|
||||||
if (iType.IsGenericType && iType.GetGenericTypeDefinition() == typeof(IList<>))
|
|
||||||
{
|
|
||||||
itemType = iType.GetGenericArguments()[0];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (itemType == null)
|
|
||||||
{
|
|
||||||
_logger.LogError("Unknown type error");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_currentExcelTable = dataList as IList;
|
|
||||||
_logger.LogInformation("{Count} {TypeName} found", _currentExcelTable!.Count, itemType.Name);
|
|
||||||
|
|
||||||
itemListView.Items.Clear();
|
|
||||||
for (var i = 0; i < _currentExcelTable!.Count; i++)
|
|
||||||
{
|
|
||||||
var listItem = new ListViewItem($"{i}");
|
|
||||||
listItem.Tag = _currentExcelTable[i];
|
|
||||||
itemListView.Items.Add(listItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
itemListView.Columns[0].Width = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void itemListView_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var selectedItems = itemListView.SelectedItems;
|
|
||||||
if (selectedItems.Count < 1) return;
|
|
||||||
|
|
||||||
var obj = selectedItems[0].Tag;
|
|
||||||
if (obj == null) return;
|
|
||||||
|
|
||||||
propGrid.SelectedObject = obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ReloadExcels()
|
|
||||||
{
|
|
||||||
var assembly = Assembly.GetAssembly(typeof(AcademyFavorScheduleExcelTable))!;
|
|
||||||
var types = assembly.GetTypes().Where(
|
|
||||||
t => t.IsAssignableTo(typeof(IFlatbufferObject)) && t.Name.EndsWith("ExcelTable"));
|
|
||||||
var validTypes = new List<Type>();
|
|
||||||
|
|
||||||
foreach (var t in types)
|
|
||||||
{
|
|
||||||
var filePath = Path.Join(_excelDirectory, $"{t.Name.ToLower()}.bytes");
|
|
||||||
var fbPath = Path.Join(_excelDirectory, $"{t.Name.ToLower()}.fb");
|
|
||||||
if (!File.Exists(filePath)) continue;
|
|
||||||
if (File.Exists(fbPath))
|
|
||||||
{
|
|
||||||
validTypes.Add(t);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var bytes = File.ReadAllBytes(filePath);
|
|
||||||
TableEncryptionService.XOR(t.Name, bytes);
|
|
||||||
|
|
||||||
// save decrypted
|
|
||||||
File.WriteAllBytes(fbPath, bytes);
|
|
||||||
_logger.LogInformation("Decrypted excel table {TableName}", t.Name);
|
|
||||||
|
|
||||||
// save json
|
|
||||||
var inst = t.GetMethod($"GetRootAs{t.Name}", BindingFlags.Static | BindingFlags.Public,
|
|
||||||
[typeof(ByteBuffer)])!.Invoke(null, [new ByteBuffer(bytes)]);
|
|
||||||
var obj = t.GetMethod("UnPack", BindingFlags.Instance | BindingFlags.Public)!.Invoke(inst, null);
|
|
||||||
var jsonPath = Path.Join(_excelDirectory, $"{t.Name.ToLower()}.json");
|
|
||||||
File.WriteAllText(jsonPath, JsonConvert.SerializeObject(obj, Formatting.Indented, new StringEnumConverter()));
|
|
||||||
}
|
|
||||||
|
|
||||||
tableListView.Items.Clear();
|
|
||||||
itemListView.Items.Clear();
|
|
||||||
|
|
||||||
foreach (var t in validTypes)
|
|
||||||
{
|
|
||||||
var item = new ListViewItem(t.Name);
|
|
||||||
item.Tag = t;
|
|
||||||
tableListView.Items.Add(item);
|
|
||||||
}
|
|
||||||
tableListView.Columns[0].Width = -1;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,120 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
</root>
|
|
|
@ -1,62 +0,0 @@
|
||||||
namespace SCHALE.Toolbox.Forms
|
|
||||||
{
|
|
||||||
partial class MainForm
|
|
||||||
{
|
|
||||||
/// <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()
|
|
||||||
{
|
|
||||||
functionListView = new ListView();
|
|
||||||
SuspendLayout();
|
|
||||||
//
|
|
||||||
// functionListView
|
|
||||||
//
|
|
||||||
functionListView.Dock = DockStyle.Fill;
|
|
||||||
functionListView.Location = new Point(0, 0);
|
|
||||||
functionListView.Name = "functionListView";
|
|
||||||
functionListView.Size = new Size(889, 751);
|
|
||||||
functionListView.TabIndex = 0;
|
|
||||||
functionListView.UseCompatibleStateImageBehavior = false;
|
|
||||||
functionListView.View = View.List;
|
|
||||||
functionListView.DoubleClick += functionListView_DoubleClick;
|
|
||||||
//
|
|
||||||
// MainForm
|
|
||||||
//
|
|
||||||
AutoScaleDimensions = new SizeF(10F, 25F);
|
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
|
||||||
ClientSize = new Size(889, 751);
|
|
||||||
Controls.Add(functionListView);
|
|
||||||
Name = "MainForm";
|
|
||||||
Text = "SCHALE Toolbox";
|
|
||||||
FormClosing += MainForm_FormClosing;
|
|
||||||
Load += MainForm_Load;
|
|
||||||
ResumeLayout(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private ListView functionListView;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace SCHALE.Toolbox.Forms
|
|
||||||
{
|
|
||||||
public partial class MainForm : Form
|
|
||||||
{
|
|
||||||
public MainForm()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
|
||||||
{
|
|
||||||
Application.Exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void MainForm_Load(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
AddFormItem<ExcelEditorForm>("Excel Editor");
|
|
||||||
AddFormItem<PlayableCharacterForm>("Playable Characters");
|
|
||||||
new ExcelEditorForm().Show();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AddFormItem<T>(string description)
|
|
||||||
{
|
|
||||||
var item = new ListViewItem();
|
|
||||||
item.Text = description;
|
|
||||||
item.Tag = typeof(T);
|
|
||||||
functionListView.Items.Add(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void functionListView_DoubleClick(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var items = functionListView.SelectedItems;
|
|
||||||
if (items.Count < 1) return;
|
|
||||||
|
|
||||||
var item = items[0];
|
|
||||||
var formType = item.Tag as Type;
|
|
||||||
if (formType == null) return;
|
|
||||||
|
|
||||||
var form = Activator.CreateInstance(formType) as Form;
|
|
||||||
if (form == null) return;
|
|
||||||
|
|
||||||
form.Show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,120 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
</root>
|
|
|
@ -1,142 +0,0 @@
|
||||||
namespace SCHALE.Toolbox.Forms
|
|
||||||
{
|
|
||||||
partial class PlayableCharacterForm
|
|
||||||
{
|
|
||||||
/// <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()
|
|
||||||
{
|
|
||||||
loadButton = new Button();
|
|
||||||
splitContainer1 = new SplitContainer();
|
|
||||||
chListView = new ListView();
|
|
||||||
columnHeader1 = new ColumnHeader();
|
|
||||||
chPropertyGrid = new PropertyGrid();
|
|
||||||
exportButton = new Button();
|
|
||||||
flowLayoutPanel1 = new FlowLayoutPanel();
|
|
||||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
|
||||||
splitContainer1.Panel1.SuspendLayout();
|
|
||||||
splitContainer1.Panel2.SuspendLayout();
|
|
||||||
splitContainer1.SuspendLayout();
|
|
||||||
flowLayoutPanel1.SuspendLayout();
|
|
||||||
SuspendLayout();
|
|
||||||
//
|
|
||||||
// loadButton
|
|
||||||
//
|
|
||||||
loadButton.Location = new Point(3, 3);
|
|
||||||
loadButton.Name = "loadButton";
|
|
||||||
loadButton.Size = new Size(280, 59);
|
|
||||||
loadButton.TabIndex = 0;
|
|
||||||
loadButton.Text = "Load from excel CharacterExcelTable";
|
|
||||||
loadButton.UseVisualStyleBackColor = true;
|
|
||||||
loadButton.Click += loadButton_Click;
|
|
||||||
//
|
|
||||||
// splitContainer1
|
|
||||||
//
|
|
||||||
splitContainer1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
splitContainer1.Location = new Point(12, 77);
|
|
||||||
splitContainer1.Name = "splitContainer1";
|
|
||||||
//
|
|
||||||
// splitContainer1.Panel1
|
|
||||||
//
|
|
||||||
splitContainer1.Panel1.Controls.Add(chListView);
|
|
||||||
//
|
|
||||||
// splitContainer1.Panel2
|
|
||||||
//
|
|
||||||
splitContainer1.Panel2.Controls.Add(chPropertyGrid);
|
|
||||||
splitContainer1.Size = new Size(1086, 901);
|
|
||||||
splitContainer1.SplitterDistance = 362;
|
|
||||||
splitContainer1.TabIndex = 1;
|
|
||||||
//
|
|
||||||
// chListView
|
|
||||||
//
|
|
||||||
chListView.Columns.AddRange(new ColumnHeader[] { columnHeader1 });
|
|
||||||
chListView.Dock = DockStyle.Fill;
|
|
||||||
chListView.HeaderStyle = ColumnHeaderStyle.None;
|
|
||||||
chListView.Location = new Point(0, 0);
|
|
||||||
chListView.MultiSelect = false;
|
|
||||||
chListView.Name = "chListView";
|
|
||||||
chListView.Size = new Size(362, 901);
|
|
||||||
chListView.TabIndex = 0;
|
|
||||||
chListView.UseCompatibleStateImageBehavior = false;
|
|
||||||
chListView.View = View.Details;
|
|
||||||
chListView.SelectedIndexChanged += chListView_SelectedIndexChanged;
|
|
||||||
//
|
|
||||||
// chPropertyGrid
|
|
||||||
//
|
|
||||||
chPropertyGrid.Dock = DockStyle.Fill;
|
|
||||||
chPropertyGrid.Location = new Point(0, 0);
|
|
||||||
chPropertyGrid.Name = "chPropertyGrid";
|
|
||||||
chPropertyGrid.Size = new Size(720, 901);
|
|
||||||
chPropertyGrid.TabIndex = 0;
|
|
||||||
//
|
|
||||||
// exportButton
|
|
||||||
//
|
|
||||||
exportButton.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
exportButton.Enabled = false;
|
|
||||||
exportButton.Location = new Point(289, 3);
|
|
||||||
exportButton.Name = "exportButton";
|
|
||||||
exportButton.Size = new Size(280, 59);
|
|
||||||
exportButton.TabIndex = 2;
|
|
||||||
exportButton.Text = "Export";
|
|
||||||
exportButton.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// flowLayoutPanel1
|
|
||||||
//
|
|
||||||
flowLayoutPanel1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
flowLayoutPanel1.Controls.Add(loadButton);
|
|
||||||
flowLayoutPanel1.Controls.Add(exportButton);
|
|
||||||
flowLayoutPanel1.Location = new Point(12, 5);
|
|
||||||
flowLayoutPanel1.Name = "flowLayoutPanel1";
|
|
||||||
flowLayoutPanel1.Size = new Size(1086, 66);
|
|
||||||
flowLayoutPanel1.TabIndex = 3;
|
|
||||||
//
|
|
||||||
// PlayableCharacterForm
|
|
||||||
//
|
|
||||||
AutoScaleDimensions = new SizeF(10F, 25F);
|
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
|
||||||
ClientSize = new Size(1110, 990);
|
|
||||||
Controls.Add(flowLayoutPanel1);
|
|
||||||
Controls.Add(splitContainer1);
|
|
||||||
Name = "PlayableCharacterForm";
|
|
||||||
Text = "PlayableCharacter";
|
|
||||||
splitContainer1.Panel1.ResumeLayout(false);
|
|
||||||
splitContainer1.Panel2.ResumeLayout(false);
|
|
||||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
|
||||||
splitContainer1.ResumeLayout(false);
|
|
||||||
flowLayoutPanel1.ResumeLayout(false);
|
|
||||||
ResumeLayout(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private Button loadButton;
|
|
||||||
private SplitContainer splitContainer1;
|
|
||||||
private ListView chListView;
|
|
||||||
private ColumnHeader columnHeader1;
|
|
||||||
private PropertyGrid chPropertyGrid;
|
|
||||||
private Button exportButton;
|
|
||||||
private FlowLayoutPanel flowLayoutPanel1;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,112 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using SCHALE.Common.FlatData;
|
|
||||||
using SCHALE.Common.Utils;
|
|
||||||
using SCHALE.GameServer.Services;
|
|
||||||
using SCHALE.Toolbox.Models.SchaleDB;
|
|
||||||
using Serilog;
|
|
||||||
using Serilog.Extensions.Logging;
|
|
||||||
using Form = System.Windows.Forms.Form;
|
|
||||||
|
|
||||||
namespace SCHALE.Toolbox.Forms
|
|
||||||
{
|
|
||||||
public partial class PlayableCharacterForm : Form
|
|
||||||
{
|
|
||||||
private readonly ExcelTableService _tableService;
|
|
||||||
private readonly ILogger<PlayableCharacterForm> _logger;
|
|
||||||
private string _excelDirectory;
|
|
||||||
private ListViewGroup _viewGroupNormal;
|
|
||||||
private ListViewGroup _viewGroupUnique;
|
|
||||||
private ListViewGroup _viewGroupEvent;
|
|
||||||
|
|
||||||
public PlayableCharacterForm()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
var logFactory = new SerilogLoggerFactory(Log.Logger);
|
|
||||||
_logger = logFactory.CreateLogger<PlayableCharacterForm>();
|
|
||||||
_tableService = new ExcelTableService(logFactory.CreateLogger<ExcelTableService>());
|
|
||||||
_viewGroupNormal = new ListViewGroup("Normal");
|
|
||||||
_viewGroupUnique = new ListViewGroup("Unique");
|
|
||||||
_viewGroupEvent = new ListViewGroup("Event");
|
|
||||||
chListView.Groups.Add(_viewGroupNormal);
|
|
||||||
chListView.Groups.Add(_viewGroupUnique);
|
|
||||||
chListView.Groups.Add(_viewGroupEvent);
|
|
||||||
|
|
||||||
_excelDirectory = Path.Join(Path.GetDirectoryName(AppContext.BaseDirectory), "Resources/excel");
|
|
||||||
_logger.LogInformation("Set excel directory to {excelDir}", _excelDirectory);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
chPropertyGrid.SelectedObject = null;
|
|
||||||
chListView.Items.Clear();
|
|
||||||
|
|
||||||
// load schaledb json
|
|
||||||
List<StudentInfo>? studentList = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
studentList = JsonConvert.DeserializeObject<List<StudentInfo>>(File.ReadAllText("Misc/students.json", Encoding.UTF8));
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogWarning("Failed to read SchaleDB student info: {ErrorMessage}", ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
var table = _tableService.GetTable<CharacterExcelTable>();
|
|
||||||
var chList = table.UnPack().DataList;
|
|
||||||
chList = chList
|
|
||||||
.Where(x =>
|
|
||||||
x is
|
|
||||||
{
|
|
||||||
IsPlayable: true,
|
|
||||||
IsPlayableCharacter: true,
|
|
||||||
IsDummy: false,
|
|
||||||
IsNPC: false,
|
|
||||||
ProductionStep: ProductionStep.Release,
|
|
||||||
})
|
|
||||||
.ToList();
|
|
||||||
var listItems = chList
|
|
||||||
.Select(x =>
|
|
||||||
{
|
|
||||||
var studentName = studentList?.FirstOrDefault(info => info.Id == x.Id)?.Name ?? "(Unknown)";
|
|
||||||
return new ListViewItem($"{x.Id} {studentName}", x.GetStudentType() switch
|
|
||||||
{
|
|
||||||
StudentType.Unique => _viewGroupUnique,
|
|
||||||
StudentType.Event => _viewGroupEvent,
|
|
||||||
_ => _viewGroupNormal,
|
|
||||||
})
|
|
||||||
{
|
|
||||||
Tag = x
|
|
||||||
};
|
|
||||||
}).ToArray();
|
|
||||||
chListView.Items.AddRange(listItems);
|
|
||||||
chListView.Columns[0].Width = -1;
|
|
||||||
|
|
||||||
_logger.LogInformation("Loaded {count} items", listItems.Length);
|
|
||||||
if (studentList?.Count > listItems.Length)
|
|
||||||
{
|
|
||||||
_logger.LogWarning("Student list has {Count} items, excel data may be outdated", studentList.Count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void chListView_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var selectedItems = chListView.SelectedItems;
|
|
||||||
if (selectedItems.Count < 1) return;
|
|
||||||
|
|
||||||
var item = selectedItems[0].Tag as CharacterExcelT;
|
|
||||||
if (item == null) return;
|
|
||||||
|
|
||||||
chPropertyGrid.SelectedObject = item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,120 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
</root>
|
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env pwsh
|
|
||||||
$schaleDbUrl = 'https://beta.schaledb.com/data/cn/students.min.json'
|
|
||||||
Invoke-WebRequest $schaleDbUrl -OutFile students.json
|
|
|
@ -1,8 +0,0 @@
|
||||||
namespace SCHALE.Toolbox.Models.SchaleDB;
|
|
||||||
|
|
||||||
public class StudentInfo
|
|
||||||
{
|
|
||||||
public int Id { get; set; } = 0;
|
|
||||||
public string DevName { get; set; } = "";
|
|
||||||
public string Name { get; set; } = "";
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
using SCHALE.Toolbox.Forms;
|
|
||||||
using Serilog;
|
|
||||||
|
|
||||||
namespace SCHALE.Toolbox
|
|
||||||
{
|
|
||||||
internal static class Program
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The main entry point for the application.
|
|
||||||
/// </summary>
|
|
||||||
[STAThread]
|
|
||||||
static void Main()
|
|
||||||
{
|
|
||||||
Log.Logger = new LoggerConfiguration()
|
|
||||||
.WriteTo.Console()
|
|
||||||
.CreateLogger();
|
|
||||||
|
|
||||||
// To customize application configuration such as set high DPI settings or default font,
|
|
||||||
// see https://aka.ms/applicationconfiguration.
|
|
||||||
ApplicationConfiguration.Initialize();
|
|
||||||
Application.Run(new MainForm());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<TargetFramework>net8.0-windows</TargetFramework>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<PackageOutputPath>$(ProjectDir)</PackageOutputPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Serilog" Version="4.0.0" />
|
|
||||||
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
|
|
||||||
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\SCHALE.Common\SCHALE.Common.csproj" />
|
|
||||||
<ProjectReference Include="..\SCHALE.GameServer\SCHALE.GameServer.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Misc\" />
|
|
||||||
<Folder Include="Properties\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Update="Misc\students.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
Loading…
Reference in New Issue