Lua Writer - faster drawing

This commit is contained in:
adelikat 2012-07-22 19:54:40 +00:00
parent f45238132e
commit e56de584e3
4 changed files with 181 additions and 156 deletions

View File

@ -357,6 +357,9 @@
<Compile Include="tools\LuaWriter.designer.cs">
<DependentUpon>LuaWriter.cs</DependentUpon>
</Compile>
<Compile Include="tools\LuaWriterBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="tools\WatchCommon.cs" />
<EmbeddedResource Include="AVOut\FFmpegWriterForm.resx">
<DependentUpon>FFmpegWriterForm.cs</DependentUpon>

View File

@ -29,7 +29,7 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.LuaText = new System.Windows.Forms.RichTextBox();
this.LuaText = new LuaWriterBox();
this.timer = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
@ -58,13 +58,14 @@
this.Controls.Add(this.LuaText);
this.Name = "LuaWriter";
this.Text = "LuaWriter";
this.Load += new System.EventHandler(this.LuaWriter_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.RichTextBox LuaText;
private LuaWriterBox LuaText;
private System.Windows.Forms.Timer timer;
}
}

View File

@ -146,7 +146,7 @@ namespace BizHawk.MultiClient
char before = ' ', after = ' ';
if (keyWordMatch.Index > 0)
if(keyWordMatch.Index > 5 && keyWordMatch.Value != "if" && LuaText.Text.Substring(keyWordMatch.Index - 4, 4) != "else")
if (keyWordMatch.Index > 5 && keyWordMatch.Value != "if" && LuaText.Text.Substring(keyWordMatch.Index - 4, 4) != "else")
before = LuaText.Text[keyWordMatch.Index - 1];
if (keyWordMatch.Index + keyWordMatch.Length != LuaText.Text.Length)
@ -161,5 +161,9 @@ namespace BizHawk.MultiClient
}
}
private void LuaWriter_Load(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace BizHawk.MultiClient
{
class LuaWriterBox : RichTextBox
{
public LuaWriterBox()
{
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
}
}
}