Commit 857ccd03 authored by JoyJ's avatar JoyJ

a effect creator form(incompleted)

parent 0fa3f82a
......@@ -54,6 +54,7 @@ private void InitializeComponent()
this.menuitem_about = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_tools = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_testlua = new System.Windows.Forms.ToolStripMenuItem();
this.effectCreatorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tb_input = new System.Windows.Forms.TextBox();
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
......@@ -184,14 +185,15 @@ private void InitializeComponent()
// menuitem_about
//
this.menuitem_about.Name = "menuitem_about";
this.menuitem_about.Size = new System.Drawing.Size(180, 22);
this.menuitem_about.Size = new System.Drawing.Size(111, 22);
this.menuitem_about.Text = "About";
this.menuitem_about.Click += new System.EventHandler(this.AboutToolStripMenuItemClick);
//
// menuitem_tools
//
this.menuitem_tools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuitem_testlua});
this.menuitem_testlua,
this.effectCreatorToolStripMenuItem});
this.menuitem_tools.Name = "menuitem_tools";
this.menuitem_tools.Size = new System.Drawing.Size(67, 21);
this.menuitem_tools.Text = "Tools(&T)";
......@@ -204,6 +206,15 @@ private void InitializeComponent()
this.menuitem_testlua.Text = "Syntax Check";
this.menuitem_testlua.Click += new System.EventHandler(this.menuitem_testlua_Click);
//
// effectCreatorToolStripMenuItem
//
this.effectCreatorToolStripMenuItem.Name = "effectCreatorToolStripMenuItem";
this.effectCreatorToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F3;
this.effectCreatorToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.effectCreatorToolStripMenuItem.Text = "Effect Creator";
this.effectCreatorToolStripMenuItem.Visible = false;
this.effectCreatorToolStripMenuItem.Click += new System.EventHandler(this.effectCreatorToolStripMenuItem_Click);
//
// tb_input
//
this.tb_input.BackColor = System.Drawing.SystemColors.Control;
......@@ -300,6 +311,7 @@ private void InitializeComponent()
this.MainMenuStrip = this.mainMenu;
this.Name = "CodeEditForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.TabText = "CodeEditor";
this.Text = "CodeEditor";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.CodeEditFormFormClosing);
this.Load += new System.EventHandler(this.CodeEditFormLoad);
......@@ -333,5 +345,6 @@ private void InitializeComponent()
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.ToolStripMenuItem menuitem_tools;
private System.Windows.Forms.ToolStripMenuItem menuitem_testlua;
private System.Windows.Forms.ToolStripMenuItem effectCreatorToolStripMenuItem;
}
}
......@@ -628,5 +628,11 @@ private void menuitem_testlua_Click(object sender, EventArgs e)
MyMsg.Show(LMSG.syntaxCheckPassed);
}
}
private void effectCreatorToolStripMenuItem_Click(object sender, EventArgs e)
{
EffectCreatorForm form = new EffectCreatorForm();
form.Show();
}
}
}
......@@ -155,6 +155,12 @@
<Compile Include="DataEditForm.Designer.cs">
<DependentUpon>DataEditForm.cs</DependentUpon>
</Compile>
<Compile Include="EffectCreatorForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="EffectCreatorForm.Designer.cs">
<DependentUpon>EffectCreatorForm.cs</DependentUpon>
</Compile>
<Compile Include="Language\LanguageHelper.cs" />
<Compile Include="Language\LMsg.cs" />
<Compile Include="Language\MyMsg.cs" />
......@@ -171,6 +177,9 @@
<Content Include="changed.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="data\effect_creator_settings.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="data\mse_Chinese-Traditional.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......@@ -234,6 +243,9 @@
<EmbeddedResource Include="DataEditForm.resx">
<DependentUpon>DataEditForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="EffectCreatorForm.resx">
<DependentUpon>EffectCreatorForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
......
namespace DataEditorX
{
partial class EffectCreatorForm
{
/// <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.textBox1 = new System.Windows.Forms.TextBox();
this.listEffectCode = new System.Windows.Forms.CheckedListBox();
this.gbSpecialOptions = new System.Windows.Forms.GroupBox();
this.checkEnableReviveLimit = new System.Windows.Forms.CheckBox();
this.gbEffectType = new System.Windows.Forms.GroupBox();
this.gbSpecialOptions.SuspendLayout();
this.gbEffectType.SuspendLayout();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.Location = new System.Drawing.Point(721, 12);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(293, 441);
this.textBox1.TabIndex = 0;
//
// listEffectCode
//
this.listEffectCode.FormattingEnabled = true;
this.listEffectCode.Location = new System.Drawing.Point(6, 20);
this.listEffectCode.Name = "listEffectCode";
this.listEffectCode.Size = new System.Drawing.Size(251, 132);
this.listEffectCode.TabIndex = 1;
//
// gbSpecialOptions
//
this.gbSpecialOptions.Controls.Add(this.checkEnableReviveLimit);
this.gbSpecialOptions.Location = new System.Drawing.Point(12, 12);
this.gbSpecialOptions.Name = "gbSpecialOptions";
this.gbSpecialOptions.Size = new System.Drawing.Size(148, 54);
this.gbSpecialOptions.TabIndex = 2;
this.gbSpecialOptions.TabStop = false;
this.gbSpecialOptions.Text = "特殊选项";
//
// checkEnableReviveLimit
//
this.checkEnableReviveLimit.AutoSize = true;
this.checkEnableReviveLimit.Location = new System.Drawing.Point(6, 20);
this.checkEnableReviveLimit.Name = "checkEnableReviveLimit";
this.checkEnableReviveLimit.Size = new System.Drawing.Size(96, 16);
this.checkEnableReviveLimit.TabIndex = 0;
this.checkEnableReviveLimit.Text = "开启召唤限制";
this.checkEnableReviveLimit.UseVisualStyleBackColor = true;
//
// gbEffectType
//
this.gbEffectType.Controls.Add(this.listEffectCode);
this.gbEffectType.Location = new System.Drawing.Point(166, 12);
this.gbEffectType.Name = "gbEffectType";
this.gbEffectType.Size = new System.Drawing.Size(263, 173);
this.gbEffectType.TabIndex = 3;
this.gbEffectType.TabStop = false;
this.gbEffectType.Text = "效果种类";
//
// EffectCreatorForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1026, 465);
this.Controls.Add(this.gbEffectType);
this.Controls.Add(this.gbSpecialOptions);
this.Controls.Add(this.textBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "EffectCreatorForm";
this.TabText = "Effect Creator";
this.Text = "Effect Creator";
this.TopMost = true;
this.Load += new System.EventHandler(this.EffectCreatorForm_Load);
this.gbSpecialOptions.ResumeLayout(false);
this.gbSpecialOptions.PerformLayout();
this.gbEffectType.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.CheckedListBox listEffectCode;
private System.Windows.Forms.GroupBox gbSpecialOptions;
private System.Windows.Forms.CheckBox checkEnableReviveLimit;
private System.Windows.Forms.GroupBox gbEffectType;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.IO;
using WeifenLuo.WinFormsUI.Docking;
namespace DataEditorX
{
public partial class EffectCreatorForm : DockContent
{
public EffectCreatorForm()
{
this.InitializeComponent();
}
class EffectCreatorItem
{
public string Key;
public string Value;
public string Hint;
public EffectCreatorItem(string key, string value)
{
this.Key = key ?? throw new ArgumentNullException(nameof(key));
this.Value = value;
}
public EffectCreatorItem(string key, string value, string hint) : this(key, value)
{
this.Hint = hint;
}
public override string ToString()
{
return Value;
}
}
Dictionary<string, List<EffectCreatorItem>> itemDic = new Dictionary<string, List<EffectCreatorItem>>();
private void EffectCreatorForm_Load(object sender, EventArgs e)
{
string config = $"data{Path.DirectorySeparatorChar}effect_creator_settings.txt";
if (!File.Exists(config))
{
return;
}
char[] sepChars = new char[]{' ','\t',' '};
FileStream fs = new FileStream(config,FileMode.Open);
StreamReader sr = new StreamReader(fs);
string nowType = "";
for (string line = sr.ReadLine(); line != null; line = sr.ReadLine())
{
line = line.Trim();
if (line.StartsWith("!"))
{
nowType = line.Substring(1);
if (!itemDic.ContainsKey(nowType))
{
itemDic.Add(nowType, new List<EffectCreatorItem>());
}
continue;
}
if (line.StartsWith("#"))
{
continue;
}
string[] split = line.Split(sepChars,StringSplitOptions.RemoveEmptyEntries);
if (split.Length == 2)
{
itemDic[nowType].Add(new EffectCreatorItem(split[0], split[1]));
}
if (split.Length == 3)
{
itemDic[nowType].Add(new EffectCreatorItem(split[0], split[1], split[2]));
}
}
foreach (var item in itemDic["EFFECT_CODES"])
{
listEffectCode.Items.Add(item);
}
foreach (var item in itemDic["EVENT_CODES"])
{
listEffectCode.Items.Add(item);
}
}
}
}
<?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>
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment