LuaWriter. Color numbers, need to make it color hexadecimals aswell.
This commit is contained in:
parent
6dfcd10575
commit
e2469328ae
|
@ -566,6 +566,8 @@ namespace BizHawk.MultiClient
|
|||
public bool LuaSymbolBold = false;
|
||||
public int LuaLibraryColor = -16711681;
|
||||
public bool LuaLibraryBold = false;
|
||||
public int LuaDecimalColor = -23296;
|
||||
public bool LuaDecimalBold = false;
|
||||
public float LuaWriterFontSize = 11;
|
||||
public string LuaWriterFont = "Courier New";
|
||||
public float LuaWriterZoom = 1;
|
||||
|
|
|
@ -87,6 +87,7 @@ namespace BizHawk.MultiClient
|
|||
LuaText.SelectionFont = new Font(LuaText.SelectionFont, FontStyle.Regular);
|
||||
|
||||
AddCommentsAndStrings();
|
||||
AddNumbers();
|
||||
AddKeyWords();
|
||||
AddLibraries();
|
||||
AddSymbols();
|
||||
|
@ -99,6 +100,29 @@ namespace BizHawk.MultiClient
|
|||
LuaText.Refresh();
|
||||
}
|
||||
|
||||
private void AddNumbers()
|
||||
{
|
||||
string temp = LuaText.Text;
|
||||
foreach (Match match in new Regex(@"(\d+\.?\d+|\.\d+|\d+)").Matches(temp))
|
||||
{
|
||||
if (!IsThisPartOfStringOrComment(match.Index))
|
||||
{
|
||||
char before = ' ', after = ' ';
|
||||
|
||||
if (match.Index > 0)
|
||||
before = LuaText.Text[match.Index - 1];
|
||||
|
||||
if (match.Index + match.Length != LuaText.Text.Length)
|
||||
after = LuaText.Text[match.Index + match.Length];
|
||||
|
||||
if (!char.IsLetter(before) && !char.IsLetter(after))
|
||||
{
|
||||
AddPosition(match.Index, match.Length, Global.Config.LuaDecimalColor, Global.Config.LuaDecimalBold, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AddCommentsAndStrings()
|
||||
{
|
||||
string temp = LuaText.Text;
|
||||
|
|
Loading…
Reference in New Issue