Commit dedd2c08 authored by keyongyu's avatar keyongyu

2.2.3.2

parent 3d80188e
......@@ -48,6 +48,7 @@ private void InitializeComponent()
this.menuitem_showinput = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_find = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_replace = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_setcard = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_help = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_about = new System.Windows.Forms.ToolStripMenuItem();
this.fctb = new FastColoredTextBoxNS.FastColoredTextBoxEx();
......@@ -122,7 +123,8 @@ private void InitializeComponent()
this.menuitem_showmap,
this.menuitem_showinput,
this.menuitem_find,
this.menuitem_replace});
this.menuitem_replace,
this.menuitem_setcard});
this.menuitem_setting.Name = "menuitem_setting";
this.menuitem_setting.Size = new System.Drawing.Size(67, 21);
this.menuitem_setting.Text = "Tools(&S)";
......@@ -159,6 +161,12 @@ private void InitializeComponent()
this.menuitem_replace.Text = "Replace";
this.menuitem_replace.Click += new System.EventHandler(this.Menuitem_replaceClick);
//
// menuitem_setcard
//
this.menuitem_setcard.Name = "menuitem_setcard";
this.menuitem_setcard.Size = new System.Drawing.Size(168, 22);
this.menuitem_setcard.Text = "Set Cards";
//
// menuitem_help
//
this.menuitem_help.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
......@@ -176,6 +184,9 @@ private void InitializeComponent()
//
// fctb
//
this.fctb.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.fctb.AutoCompleteBracketsList = new char[] {
'(',
')',
......@@ -198,7 +209,6 @@ private void InitializeComponent()
this.fctb.CommentPrefix = "--";
this.fctb.Cursor = System.Windows.Forms.Cursors.IBeam;
this.fctb.DisabledColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(180)))), ((int)(((byte)(180)))));
this.fctb.Dock = System.Windows.Forms.DockStyle.Fill;
this.fctb.Font = new System.Drawing.Font("Consolas", 14.25F);
this.fctb.ForeColor = System.Drawing.Color.GhostWhite;
this.fctb.IndentBackColor = System.Drawing.SystemColors.WindowFrame;
......@@ -208,12 +218,13 @@ private void InitializeComponent()
this.fctb.LeftBracket2 = '{';
this.fctb.LineNumberColor = System.Drawing.Color.Gainsboro;
this.fctb.Location = new System.Drawing.Point(0, 25);
this.fctb.Margin = new System.Windows.Forms.Padding(0);
this.fctb.Name = "fctb";
this.fctb.Paddings = new System.Windows.Forms.Padding(0);
this.fctb.RightBracket = ')';
this.fctb.RightBracket2 = '}';
this.fctb.SelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))));
this.fctb.Size = new System.Drawing.Size(498, 390);
this.fctb.Size = new System.Drawing.Size(695, 369);
this.fctb.TabIndex = 0;
this.fctb.WordWrap = true;
this.fctb.Zoom = 100;
......@@ -227,9 +238,9 @@ private void InitializeComponent()
this.documentMap1.BackColor = System.Drawing.Color.DimGray;
this.documentMap1.Dock = System.Windows.Forms.DockStyle.Right;
this.documentMap1.ForeColor = System.Drawing.Color.Maroon;
this.documentMap1.Location = new System.Drawing.Point(498, 25);
this.documentMap1.Location = new System.Drawing.Point(504, 25);
this.documentMap1.Name = "documentMap1";
this.documentMap1.Size = new System.Drawing.Size(197, 390);
this.documentMap1.Size = new System.Drawing.Size(191, 369);
this.documentMap1.TabIndex = 5;
this.documentMap1.Target = this.fctb;
this.documentMap1.Text = "documentMap1";
......@@ -240,8 +251,9 @@ private void InitializeComponent()
this.tb_input.BackColor = System.Drawing.SystemColors.Control;
this.tb_input.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tb_input.Location = new System.Drawing.Point(0, 394);
this.tb_input.Margin = new System.Windows.Forms.Padding(0);
this.tb_input.Name = "tb_input";
this.tb_input.Size = new System.Drawing.Size(498, 21);
this.tb_input.Size = new System.Drawing.Size(695, 21);
this.tb_input.TabIndex = 1;
this.tb_input.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Tb_inputKeyDown);
//
......@@ -249,9 +261,9 @@ private void InitializeComponent()
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(695, 415);
this.Controls.Add(this.documentMap1);
this.Controls.Add(this.tb_input);
this.Controls.Add(this.fctb);
this.Controls.Add(this.documentMap1);
this.Controls.Add(this.menuStrip1);
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.MainMenuStrip = this.menuStrip1;
......@@ -267,6 +279,7 @@ private void InitializeComponent()
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.ToolStripMenuItem menuitem_setcard;
private System.Windows.Forms.ToolStripMenuItem menuitem_replace;
private System.Windows.Forms.ToolStripMenuItem menuitem_find;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
......
......@@ -15,6 +15,8 @@
using FastColoredTextBoxNS;
using DataEditorX.Language;
using System.Text.RegularExpressions;
using DataEditorX.Core;
using System.Configuration;
namespace DataEditorX
{
......@@ -24,6 +26,7 @@ namespace DataEditorX
public partial class CodeEditForm : DockContent
{
#region Style
SortedDictionary<long,string> cardlist;
MarkerStyle SameWordsStyle = new MarkerStyle(new SolidBrush(Color.FromArgb(40, Color.White)));
#endregion
......@@ -47,6 +50,7 @@ public CodeEditForm(string file)
}
void InitForm()
{
cardlist=new SortedDictionary<long, string>();
tooltipDic=new Dictionary<string, string>();
InitializeComponent();
Font ft=new Font(fctb.Font.Name,fctb.Font.Size/1.2f,FontStyle.Regular);
......@@ -75,6 +79,13 @@ void InitForm()
popupMenu_find.Items.Width = 300;
title=this.Text;
fctb.SyntaxHighlighter=new MySyntaxHighlighter();
string fontname=ConfigurationManager.AppSettings["fontname"];
float fontsize=0;
if(float.TryParse(ConfigurationManager.AppSettings["fontsize"]
, out fontsize))
fctb.Font=new Font(fontname,fontsize);
}
public void LoadXml(string xmlfile)
......@@ -95,6 +106,10 @@ public void Open(string file)
fs.Close();
}
nowFile=file;
string cdb=Path.Combine(
Path.GetDirectoryName(file),"../cards.cdb");
if(File.Exists(cdb))
SetCards(cdb);
fctb.OpenFile(nowFile, new UTF8Encoding(false));
oldtext=fctb.Text;
SetTitle();
......@@ -104,6 +119,8 @@ void HideMenu()
{
if(this.MdiParent ==null)
return;
fctb.Location=new Point(0,0);
fctb.Height -= 14;
menuStrip1.Visible=false;
menuitem_file.Visible=false;
menuitem_file.Enabled=false;
......@@ -123,9 +140,11 @@ void ShowMapToolStripMenuItemClick(object sender, EventArgs e)
{
documentMap1.Visible=false;
menuitem_showmap.Checked=false;
fctb.Width += documentMap1.Width;
}else{
documentMap1.Visible=true;
menuitem_showmap.Checked=true;
fctb.Width -= documentMap1.Width;
}
}
#endregion
......@@ -216,7 +235,21 @@ void FctbToolTipNeeded(object sender, ToolTipNeededEventArgs e)
{
if (!string.IsNullOrEmpty(e.HoveredWord))
{
string desc=FindTooltip(e.HoveredWord);
long tl=0;
string name=e.HoveredWord;
string desc="";
if(!name.StartsWith("0x") && name.Length<=9)
{
name=name.Replace("c","");
long.TryParse(name, out tl);
}
if(tl>0){
if(cardlist.ContainsKey(tl))
desc=cardlist[tl];
}
else
desc=FindTooltip(e.HoveredWord);
if(!string.IsNullOrEmpty(desc))
{
e.ToolTipTitle = e.HoveredWord;
......@@ -381,10 +414,6 @@ void Tb_inputKeyDown(object sender, KeyEventArgs e)
}
#endregion
public void SetIMEMode(ImeMode im)
{
fctb.ImeMode=im;
}
void CodeEditFormFormClosing(object sender, FormClosingEventArgs e)
{
if(!string.IsNullOrEmpty(oldtext))
......@@ -399,5 +428,61 @@ void CodeEditFormFormClosing(object sender, FormClosingEventArgs e)
}
}
public void SetCDBList(string[] cdbs)
{
if(cdbs == null)
return;
foreach(string cdb in cdbs)
{
if(".cdb"==Path.GetExtension(cdb).ToLower())
{
ToolStripMenuItem tsmi=new ToolStripMenuItem(cdb);
tsmi.Click+=MenuItem_Click;
menuitem_setcard.DropDownItems.Add(tsmi);
}
}
}
void MenuItem_Click(object sender, EventArgs e)
{
ToolStripMenuItem tsmi=sender as ToolStripMenuItem;
if(tsmi!=null){
string file=tsmi.Text;
SetCards(file);
}
}
public void SetCards(string name)
{
SetCards(DataBase.Read(name, true,""));
}
public void SetCards(Card[] cards)
{
if(cards ==null)
return;
cardlist.Clear();
foreach(Card c in cards)
{
cardlist.Add(c.id,c.ToString());
}
}
/*
void UseIMEToolStripMenuItemClick(object sender, EventArgs e)
{
ToolStripMenuItem tsmi =sender as ToolStripMenuItem;
if(tsmi!=null)
{
if(tsmi.Checked)
{
fctb.ImeMode= ImeMode.Inherit;
}
else{
fctb.ImeMode= ImeMode.On;
}
tsmi.Checked=!tsmi.Checked;
fctb.Invalidate();
}
}
*/
}
}
/*
* 由SharpDevelop创建。
* 用户: Acer
* 日期: 2014-10-25
* 时间: 21:30
*
*/
using System;
using System.Runtime.InteropServices;
namespace System
{
/// <summary>
/// Description of User32.
/// </summary>
public class User32
{
[DllImport("User32.dll", EntryPoint = "SendMessage")]
public static extern int SendMessage(IntPtr hWnd, int msg, uint wParam, uint lParam);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int Width, int Height, int flags);
/// <summary>
/// 得到当前活动的窗口
/// </summary>
/// <returns></returns>
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern System.IntPtr GetForegroundWindow();
public static void WindowToTop()
{
}
}
}
......@@ -86,7 +86,30 @@ public override bool Equals(object obj)
/// </summary>
public override string ToString()
{
return string.Format("{0} [{1}]", idString, name);
if(IsType(CardType.TYPE_MONSTER))
return string.Format("{0}[{1}]\nType: 0x{2}\n{3}{4}/{5}\n {6}",
name, idString,type.ToString("x"),
levelString(),atk,def,redesc());
return string.Format("{0}[{1}]\nType: 0x{2}\n{3}",
name, idString,type.ToString("x"),redesc());
}
string levelString()
{
string star="";
long i=0,j=level&0xff;
for(i=0;i<j;i++)
star +="★";
return star+Environment.NewLine;
}
string redesc()
{
return desc
.Replace(",",",\n")
.Replace("。","。\n")
.Replace("?","?\n")
.Replace(",",",\n")
.Replace(".",".\n")
.Replace("?","?\n");
}
public bool EqualsData(Card other)
{
......
......@@ -106,7 +106,7 @@ void DataEditFormLoad(object sender, EventArgs e)
datacfg=new DataConfig(datapath);
datacfg.Init();
}
tasker=new TaskHelper(datapath, bgWorker1,
tasker=new TaskHelper(datapath, bgWorker1,
datacfg.dicCardTypes,
datacfg.dicCardRaces);
......@@ -1296,6 +1296,8 @@ void Tb_setcode1TextChanged(object sender, EventArgs e)
#region 复制卡片
public Card[] getCardList(bool onlyselect){
if(!Check())
return null;
List<Card> cards=new List<Card>();
if(onlyselect)
{
......
......@@ -70,6 +70,7 @@
<Compile Include="Common\FastColoredTextBoxEx.cs" />
<Compile Include="Common\MySyntaxHighlighter.cs" />
<Compile Include="Common\MyBitmap.cs" />
<Compile Include="Common\User32.cs" />
<Compile Include="Common\ZipStorer.cs" />
<Compile Include="Core\Card.cs" />
<Compile Include="Core\CardAttribute.cs" />
......
......@@ -56,6 +56,7 @@ private void InitializeComponent()
this.menuitem_open = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_new = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_save = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_findluafunc = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_copyselect = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_copyall = new System.Windows.Forms.ToolStripMenuItem();
......@@ -74,7 +75,6 @@ private void InitializeComponent()
this.menuitem_close = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_closeother = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_closeall = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_findluafunc = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
......@@ -191,6 +191,13 @@ private void InitializeComponent()
this.menuitem_save.Text = "Save";
this.menuitem_save.Click += new System.EventHandler(this.Menuitem_saveClick);
//
// menuitem_findluafunc
//
this.menuitem_findluafunc.Name = "menuitem_findluafunc";
this.menuitem_findluafunc.Size = new System.Drawing.Size(261, 22);
this.menuitem_findluafunc.Text = "Find LuaFunctons";
this.menuitem_findluafunc.Click += new System.EventHandler(this.Menuitem_findluafuncClick);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
......@@ -318,13 +325,6 @@ private void InitializeComponent()
this.menuitem_closeall.Text = "Close All";
this.menuitem_closeall.Click += new System.EventHandler(this.CloseAllToolStripMenuItemClick);
//
// menuitem_findluafunc
//
this.menuitem_findluafunc.Name = "menuitem_findluafunc";
this.menuitem_findluafunc.Size = new System.Drawing.Size(261, 22);
this.menuitem_findluafunc.Text = "Find LuaFunctons";
this.menuitem_findluafunc.Click += new System.EventHandler(this.Menuitem_findluafuncClick);
//
// MainForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......
......@@ -186,6 +186,7 @@ protected override void DefWndProc(ref System.Windows.Forms.Message m)
case MainForm.WM_OPEN://处理消息
file=Path.Combine(Application.StartupPath, MainForm.TMPFILE);
if(File.Exists(file)){
this.Activate();
Open(File.ReadAllText(file));
File.Delete(file);
}
......@@ -193,6 +194,7 @@ protected override void DefWndProc(ref System.Windows.Forms.Message m)
case MainForm.WM_OPEN_SCRIPT:
file=Path.Combine(Application.StartupPath, MainForm.TMPFILE);
if(File.Exists(file)){
this.Activate();
OpenScript(File.ReadAllText(file));
File.Delete(file);
}
......@@ -219,6 +221,7 @@ public void OpenScript(string file)
isInitAuto=true;
InitCodeEditor(funtxt, conlua);
}
cf.SetCDBList(cdblist.ToArray());
cf.InitTooltip(tooltipDic, funList.ToArray(), conList.ToArray());
//cf.SetIMEMode(ImeMode.Inherit);
cf.Show(dockPanel1, DockState.Document);
......
......@@ -6,13 +6,11 @@
*
*/
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Configuration;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
namespace DataEditorX
{
......@@ -21,8 +19,7 @@ namespace DataEditorX
/// </summary>
internal sealed class Program
{
[DllImport("User32.dll", EntryPoint = "SendMessage")]
private static extern int SendMessage(IntPtr hWnd, int msg, uint wParam, uint lParam);
/// <summary>
/// <summary>
/// Program entry point.
......@@ -46,7 +43,7 @@ private static void Main(string[] args)
if(MainForm.isScript(arg))
msg=MainForm.WM_OPEN_SCRIPT;
File.WriteAllText(Path.Combine(Application.StartupPath, MainForm.TMPFILE), arg);
SendMessage(instance.MainWindowHandle, msg, 0 ,0);
User32.SendMessage(instance.MainWindowHandle, msg, 0 ,0);
//Thread.Sleep(1000);
Environment.Exit(1);
}
......
......@@ -28,4 +28,4 @@
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("2.2.3.1")]
[assembly: AssemblyVersion("2.2.3.2")]
......@@ -22,5 +22,8 @@
<add key="image_other" value="25,54,128,128" />
<add key="image_xyz" value="24,51,128,128" />
<add key="image_pendulum" value="14,46,149,120" />
<!-- CodeEdiotr -->
<add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" />
</appSettings>
</configuration>
\ No newline at end of file
......@@ -7,6 +7,7 @@ CodeEditForm->menuitem_quit 退出
CodeEditForm->menuitem_setting 设置(&S)
CodeEditForm->menuitem_showmap 显示缩略图
CodeEditForm->menuitem_showinput 显示文本框
CodeEditForm->menuitem_setcard 设置卡片库
CodeEditForm->menuitem_find 查找
CodeEditForm->menuitem_replace 替换
CodeEditForm->menuitem_help 帮助(&H)
......
......@@ -7,6 +7,7 @@ CodeEditForm->menuitem_quit Quit
CodeEditForm->menuitem_setting Tools(&S)
CodeEditForm->menuitem_showmap Show/Hide Map
CodeEditForm->menuitem_showinput Show/Hide TextBox
CodeEditForm->menuitem_setcard Set Cards
CodeEditForm->menuitem_find Find
CodeEditForm->menuitem_replace Replace
CodeEditForm->menuitem_help Help(&H)
......
[DataEditorX]2.2.3.1[DataEditorX]
[DataEditorX]2.2.3.2[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
......@@ -71,6 +71,10 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史
2.2.3.2
lua编辑器,
设置卡片库,鼠标悬停在密码时,提示卡片信息
在config可以设置lua编辑器的字体和大小
2.2.3.1
lua编辑器的函数提示带所属名
2.2.3.0
......
No preview for this file type
......@@ -22,5 +22,8 @@
<add key="image_other" value="25,54,128,128" />
<add key="image_xyz" value="24,51,128,128" />
<add key="image_pendulum" value="14,46,149,120" />
<!-- CodeEdiotr -->
<add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" />
</appSettings>
</configuration>
\ No newline at end of file
# history
F:\games\ygocore\cards (2).cdb
F:\games\ygopro\script\c126218.lua
F:\games\ygocore\script\c99995595.lua
F:\games\ygopro\script\c32864.lua
F:\games\ygocore\script\c131182.lua
F:\games\ygocore\script\c900787.lua
F:\games\ygopro\script\c168917.lua
F:\games\ygopro\script\c191749.lua
E:\github\DataEditorX\DataEditorX\chinese\constant.lua
F:\games\ygocore\script\constant.lua
F:\games\ygocore\script\utility.lua
F:\games\ygocore\script\c126218.lua
F:\games\ygocore\single\[sample]BerserkDragon.lua
F:\games\ygocore\script\c99995595.lua
F:\games\ygopro\cards.cdb
F:\games\ygocore\single\[sample]BerserkDragon.lua
\ No newline at end of file
F:\games\ygocore\script\c126218.lua
F:\games\ygopro\script\c191749.lua
F:\games\ygopro\script\c102380.lua
F:\games\ygocore\script\c900787.lua
F:\games\ygopro\script\c123709.lua
F:\games\ygocore\script\c131182.lua
F:\games\ygopro\script\c126218.lua
F:\games\ygopro\script\c168917.lua
F:\games\ygocore\script\c135598.lua
F:\games\ygocore\script\c114932.lua
\ No newline at end of file
......@@ -7,6 +7,7 @@ CodeEditForm->menuitem_quit 退出
CodeEditForm->menuitem_setting 设置(&S)
CodeEditForm->menuitem_showmap 显示缩略图
CodeEditForm->menuitem_showinput 显示文本框
CodeEditForm->menuitem_setcard 设置卡片库
CodeEditForm->menuitem_find 查找
CodeEditForm->menuitem_replace 替换
CodeEditForm->menuitem_help 帮助(&H)
......
......@@ -7,6 +7,7 @@ CodeEditForm->menuitem_quit Quit
CodeEditForm->menuitem_setting Tools(&S)
CodeEditForm->menuitem_showmap Show/Hide Map
CodeEditForm->menuitem_showinput Show/Hide TextBox
CodeEditForm->menuitem_setcard Set Cards
CodeEditForm->menuitem_find Find
CodeEditForm->menuitem_replace Replace
CodeEditForm->menuitem_help Help(&H)
......
[DataEditorX]2.2.3.1[DataEditorX]
[DataEditorX]2.2.3.2[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
......@@ -71,6 +71,10 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史
2.2.3.2
lua编辑器,
设置卡片库,鼠标悬停在密码时,提示卡片信息
在config可以设置lua编辑器的字体和大小
2.2.3.1
lua编辑器的函数提示带所属名
2.2.3.0
......
No preview for this file type
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