Commit 77d7c7ae authored by keyongyu's avatar keyongyu

2.2.7.3

parent 79c92359
...@@ -40,6 +40,7 @@ public partial class CodeEditForm : DockContent ...@@ -40,6 +40,7 @@ public partial class CodeEditForm : DockContent
string title; string title;
string oldtext; string oldtext;
Dictionary<string,string> tooltipDic; Dictionary<string,string> tooltipDic;
bool tabisspaces = false;
public CodeEditForm() public CodeEditForm()
{ {
InitForm(); InitForm();
...@@ -81,10 +82,25 @@ void InitForm() ...@@ -81,10 +82,25 @@ void InitForm()
if(float.TryParse(ConfigurationManager.AppSettings["fontsize"] if(float.TryParse(ConfigurationManager.AppSettings["fontsize"]
, out fontsize)) , out fontsize))
fctb.Font=new Font(fontname,fontsize); fctb.Font=new Font(fontname,fontsize);
if(ConfigurationManager.AppSettings["IME"].ToLower()=="true") if(ReadConfig("IME").ToLower()=="true")
fctb.ImeMode=ImeMode.On; fctb.ImeMode=ImeMode.On;
if (ReadConfig("wordwrap").ToLower() == "true")
fctb.WordWrap = true;
else
fctb.WordWrap = false;
if (ReadConfig("tabisspace").ToLower() == "true")
tabisspaces = true;
else
tabisspaces = false;
} }
string ReadConfig(string key)
{
string v = ConfigurationManager.AppSettings[key];
if (string.IsNullOrEmpty(v))
return "";
else
return v;
}
public void LoadXml(string xmlfile) public void LoadXml(string xmlfile)
{ {
fctb.DescriptionFile=xmlfile; fctb.DescriptionFile=xmlfile;
...@@ -297,37 +313,35 @@ void Menuitem_replaceClick(object sender, EventArgs e) ...@@ -297,37 +313,35 @@ void Menuitem_replaceClick(object sender, EventArgs e)
{ {
fctb.ShowReplaceDialog(); fctb.ShowReplaceDialog();
} }
public void Save() bool savefile(bool saveas)
{
string alltext = fctb.Text;
if(!tabisspaces)
alltext = alltext.Replace(" ", "\t");
if (saveas)
{
using (SaveFileDialog sfdlg = new SaveFileDialog())
{
sfdlg.Filter = "Script(*.lua)|*.lua|All Files(*.*)|*.*";
if (sfdlg.ShowDialog() == DialogResult.OK)
{
nowFile = sfdlg.FileName;
SetTitle();
}
else
return false;
}
}
File.WriteAllText(nowFile, alltext, new UTF8Encoding(false));
return true;
}
public bool Save()
{ {
if(string.IsNullOrEmpty(nowFile)) return savefile(string.IsNullOrEmpty(nowFile));
{
using(SaveFileDialog sfdlg=new SaveFileDialog())
{
sfdlg.Filter="Script(*.lua)|*.lua|All Files(*.*)|*.*";
if(sfdlg.ShowDialog()==DialogResult.OK)
{
nowFile=sfdlg.FileName;
SetTitle();
}
else
return;
}
}
fctb.SaveToFile(nowFile, new UTF8Encoding(false));
} }
public void SaveAs() public bool SaveAs()
{ {
using(SaveFileDialog sfdlg=new SaveFileDialog()) return savefile(true);
{
sfdlg.Filter="Script(*.lua)|*.lua|All Files(*.*)|*.*";
if(sfdlg.ShowDialog()==DialogResult.OK)
{
nowFile=sfdlg.FileName;
}
else
return;
}
fctb.SaveToFile(nowFile, new UTF8Encoding(false));
} }
void SaveToolStripMenuItemClick(object sender, EventArgs e) void SaveToolStripMenuItemClick(object sender, EventArgs e)
......
...@@ -129,6 +129,7 @@ ...@@ -129,6 +129,7 @@
<ItemGroup> <ItemGroup>
<None Include="app.config"> <None Include="app.config">
<CopyToOutputDirectory>Never</CopyToOutputDirectory> <CopyToOutputDirectory>Never</CopyToOutputDirectory>
<SubType>Designer</SubType>
</None> </None>
<None Include="chinese\card-attribute.txt"> <None Include="chinese\card-attribute.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
......
...@@ -83,7 +83,7 @@ void Init(string datapath) ...@@ -83,7 +83,7 @@ void Init(string datapath)
public const int MAX_HISTORY=0x20; public const int MAX_HISTORY=0x20;
public static bool isScript(string file) public static bool isScript(string file)
{ {
if(file.EndsWith("lua",StringComparison.OrdinalIgnoreCase)) if(file!=null && file.EndsWith("lua",StringComparison.OrdinalIgnoreCase))
return true; return true;
return false; return false;
} }
...@@ -479,8 +479,8 @@ void Menuitem_saveClick(object sender, EventArgs e) ...@@ -479,8 +479,8 @@ void Menuitem_saveClick(object sender, EventArgs e)
CodeEditForm cf= dockPanel1.ActiveContent as CodeEditForm; CodeEditForm cf= dockPanel1.ActiveContent as CodeEditForm;
if(cf!=null) if(cf!=null)
{ {
cf.Save(); if(cf.Save())
MyMsg.Show(LMSG.SaveFileOK); MyMsg.Show(LMSG.SaveFileOK);
} }
} }
#endregion #endregion
......
...@@ -28,4 +28,4 @@ ...@@ -28,4 +28,4 @@
// //
// You can specify all the values or you can use the default the Revision and // You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below: // Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("2.2.7.2")] [assembly: AssemblyVersion("2.2.7.3")]
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
IME = false English IME = false English
--> -->
<add key="IME" value="false" /> <add key="IME" value="false" />
<add key="wordwrap" value="true" />
<add key="tabisspace" value="false" />
<add key="fontname" value="Consolas" /> <add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" /> <add key="fontsize" value="14.5" />
</appSettings> </appSettings>
......
[DataEditorX]2.2.7.2[DataEditorX] [DataEditorX]2.2.7.3[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★文件关联 ★文件关联
...@@ -58,6 +58,8 @@ Ctrl+鼠标左键 跳转到函数定义 ...@@ -58,6 +58,8 @@ Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字 Ctrl+鼠标滑轮 缩放文字
★更新历史 ★更新历史
2.2.7.3
lua编辑器,4个空格转换为tab键
2.2.7.2 2.2.7.2
打开脚本,重复的时候,显示标签 打开脚本,重复的时候,显示标签
2.2.7.1 2.2.7.1
......
No preview for this file type
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
IME = false English IME = false English
--> -->
<add key="IME" value="false" /> <add key="IME" value="false" />
<add key="wordwrap" value="true" />
<add key="tabisspace" value="false" />
<add key="fontname" value="Consolas" /> <add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" /> <add key="fontsize" value="14.5" />
</appSettings> </appSettings>
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
IME = false English IME = false English
--> -->
<add key="IME" value="false" /> <add key="IME" value="false" />
<add key="wordwrap" value="true" />
<add key="tabisspace" value="false" />
<add key="fontname" value="Consolas" /> <add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" /> <add key="fontsize" value="14.5" />
</appSettings> </appSettings>
......
# history # history
F:\games\ygopro\script\c50485594.lua
F:\games\ygopro\script\c17857780.lua F:\games\ygopro\script\c17857780.lua
F:\games\ygopro\script\c47198668.lua F:\games\ygopro\script\c27551.lua
F:\games\ygopro\cards.cdb
F:\games\ygopro\p.zip.cdb
F:\games\ygopro\script\c168917.lua F:\games\ygopro\script\c168917.lua
F:\games\ygopro\script\c47198668.lua
F:\games\ygopro\script\c50485594.lua
F:\games\ygopro\script\c65518099.lua F:\games\ygopro\script\c65518099.lua
F:\games\ygopro\p.zip.cdb
F:\games\ygopro\script\c64496451.lua F:\games\ygopro\script\c64496451.lua
F:\games\ygopro\script\c78835747.lua F:\games\ygopro\script\c78835747.lua
\ No newline at end of file
[DataEditorX]2.2.7.2[DataEditorX] [DataEditorX]2.2.7.3[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★文件关联 ★文件关联
...@@ -58,6 +58,8 @@ Ctrl+鼠标左键 跳转到函数定义 ...@@ -58,6 +58,8 @@ Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字 Ctrl+鼠标滑轮 缩放文字
★更新历史 ★更新历史
2.2.7.3
lua编辑器,4个空格转换为tab键
2.2.7.2 2.2.7.2
打开脚本,重复的时候,显示标签 打开脚本,重复的时候,显示标签
2.2.7.1 2.2.7.1
......
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