From d85a6922227c438d6e00a6e7bc18ceb7bd08711b Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 14:02:27 -0400 Subject: [PATCH 01/50] Revert "Forced text buffer to process when popBold and pushBold are encountered" This reverts commit f9c8a5e7049ff6052b52e80ca71d2f2e604e971d. --- Core/Game.cs | 339 ++++++++++++++++++++++++++------------------------- 1 file changed, 172 insertions(+), 167 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 6067c31..169fc98 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -566,16 +566,21 @@ public void ParseGameRow(string sText) { m_oXMLBuffer.Append(oXMLBuffer); string buffer = m_oXMLBuffer.ToString(); - if (buffer == @"" || buffer == @"") //print before processing these ones + string sTmp = ProcessXML(buffer); + if (m_bBold) { - bCombatRow = (sTextBuffer.StartsWith("< ") | sTextBuffer.StartsWith("> ") | sTextBuffer.StartsWith("* ")); - bool argbIsPrompt = false; - WindowTarget argoWindowTarget = 0; - PrintTextWithParse(sTextBuffer, bIsPrompt: argbIsPrompt, oWindowTarget: argoWindowTarget); - sTextBuffer = string.Empty; - m_bBold = !m_bBold; + if (sTextBuffer.StartsWith("< ") | sTextBuffer.StartsWith("> ") | sTextBuffer.StartsWith("* ")) + { + m_bBold = false; + string argsText = sTextBuffer + System.Environment.NewLine; + bool argbIsPrompt = false; + WindowTarget argoWindowTarget = 0; + PrintTextWithParse(argsText, bIsPrompt: argbIsPrompt, oWindowTarget: argoWindowTarget); + m_bBold = true; + sTextBuffer = string.Empty; + bCombatRow = true; + } } - string sTmp = ProcessXML(buffer); sTextBuffer += sTmp; m_oXMLBuffer.Clear(); @@ -714,7 +719,7 @@ public void ParseGameRow(string sText) } } - + bool argbIsPrompt1 = false; WindowTarget argoWindowTarget1 = 0; PrintTextWithParse(sTextBuffer, bIsPrompt: argbIsPrompt1, oWindowTarget: argoWindowTarget1); @@ -948,202 +953,202 @@ private void ParseKeyRow(string sText) else { var oData = new ArrayList(); - foreach (string strLine in sText.Split(Conversions.ToChar(Constants.vbTab))) - oData.Add(strLine); - if (oData.Count > 0) + foreach (string strLine in sText.Split(Conversions.ToChar(Constants.vbTab))) + oData.Add(strLine); + if (oData.Count > 0) + { + var switchExpr = oData[0]; + switch (switchExpr) { - var switchExpr = oData[0]; - switch (switchExpr) - { - case "?": - { - string argtext = "Unable to get login key."; - PrintError(argtext); - m_oSocket.Disconnect(); - break; - } + case "?": + { + string argtext = "Unable to get login key."; + PrintError(argtext); + m_oSocket.Disconnect(); + break; + } - case "A": + case "A": + { + var switchExpr1 = oData[2]; + switch (switchExpr1) { - var switchExpr1 = oData[2]; - switch (switchExpr1) - { - case "KEY": - { - m_sLoginKey = Conversions.ToString(oData[3]); - m_sAccountOwner = Conversions.ToString(oData[4]); - m_oSocket.Send("G" + Constants.vbTab + m_sAccountGame.ToUpper() + System.Environment.NewLine); - break; - } - - case "NORECORD": - { - string argtext1 = "Account does not exist."; - PrintError(argtext1); - m_oSocket.Disconnect(); - break; - } + case "KEY": + { + m_sLoginKey = Conversions.ToString(oData[3]); + m_sAccountOwner = Conversions.ToString(oData[4]); + m_oSocket.Send("G" + Constants.vbTab + m_sAccountGame.ToUpper() + System.Environment.NewLine); + break; + } - case "PASSWORD": - { - string argtext2 = "Invalid password."; - PrintError(argtext2); - m_oSocket.Disconnect(); - break; - } + case "NORECORD": + { + string argtext1 = "Account does not exist."; + PrintError(argtext1); + m_oSocket.Disconnect(); + break; + } - case "REJECT": - { - string argtext3 = "Access rejected."; - PrintError(argtext3); - m_oSocket.Disconnect(); - break; - } - } + case "PASSWORD": + { + string argtext2 = "Invalid password."; + PrintError(argtext2); + m_oSocket.Disconnect(); + break; + } - break; + case "REJECT": + { + string argtext3 = "Access rejected."; + PrintError(argtext3); + m_oSocket.Disconnect(); + break; + } } - case "G": - { - m_oSocket.Send("C" + System.Environment.NewLine); - break; - } + break; + } - case "C": + case "G": + { + m_oSocket.Send("C" + System.Environment.NewLine); + break; + } + + case "C": + { + if (m_sAccountCharacter.Trim().Length == 0) { - if (m_sAccountCharacter.Trim().Length == 0) + string argtext4 = "Listing characters:"; + PrintError(argtext4); + string strUserKey = string.Empty; + // bool blnFoundMatch = false; + for (int i = 5, loopTo = oData.Count - 1; i <= loopTo; i++) { - string argtext4 = "Listing characters:"; - PrintError(argtext4); - string strUserKey = string.Empty; - // bool blnFoundMatch = false; - for (int i = 5, loopTo = oData.Count - 1; i <= loopTo; i++) + if (i % 2 == 0) { - if (i % 2 == 0) - { - _CharacterList.Clear(); - _CharacterList.Add(oData[i].ToString()); - var temp = oData[i].ToString(); - PrintError(temp); - } - else - { - strUserKey = Conversions.ToString(oData[i]); - } + _CharacterList.Clear(); + _CharacterList.Add(oData[i].ToString()); + var temp = oData[i].ToString(); + PrintError(temp); + } + else + { + strUserKey = Conversions.ToString(oData[i]); } - - m_oSocket.Disconnect(); } - else + + m_oSocket.Disconnect(); + } + else + { + string strUserKey = string.Empty; + string strUserKeyTemp = string.Empty; + bool blnFoundMatch = false; + bool bFoundBanned = false; + for (int i = 5, loopTo1 = oData.Count - 1; i <= loopTo1; i++) { - string strUserKey = string.Empty; - string strUserKeyTemp = string.Empty; - bool blnFoundMatch = false; - bool bFoundBanned = false; - for (int i = 5, loopTo1 = oData.Count - 1; i <= loopTo1; i++) - { - if (i % 2 == 0) + if (i % 2 == 0) + { + string sChar = oData[i].ToString(); + if (sChar.Contains(" ")) + sChar = sChar.Substring(0, sChar.IndexOf(' ')); + if (m_oBanned.ContainsKey(Utility.GenerateHashSHA256(sChar))) + bFoundBanned = true; + if (sChar.ToUpper().Equals(m_sAccountCharacter.ToUpper())) + { + blnFoundMatch = true; + strUserKey = strUserKeyTemp; + } + + if (blnFoundMatch == false) { - string sChar = oData[i].ToString(); - if (sChar.Contains(" ")) - sChar = sChar.Substring(0, sChar.IndexOf(' ')); - if (m_oBanned.ContainsKey(Utility.GenerateHashSHA256(sChar))) - bFoundBanned = true; - if (sChar.ToUpper().Equals(m_sAccountCharacter.ToUpper())) + if (sChar.ToUpper().StartsWith(m_sAccountCharacter.ToUpper())) { blnFoundMatch = true; strUserKey = strUserKeyTemp; } - - if (blnFoundMatch == false) - { - if (sChar.ToUpper().StartsWith(m_sAccountCharacter.ToUpper())) - { - blnFoundMatch = true; - strUserKey = strUserKeyTemp; - } - } - } - else - { - strUserKeyTemp = Conversions.ToString(oData[i]); } } - - if (bFoundBanned) + else { - m_oSocket.Disconnect(); - return; + strUserKeyTemp = Conversions.ToString(oData[i]); } + } - if (blnFoundMatch) - { - m_oSocket.Send("L" + Constants.vbTab + strUserKey + Constants.vbTab + "STORM" + Constants.vbLf); - } + if (bFoundBanned) + { + m_oSocket.Disconnect(); + return; + } - if (blnFoundMatch == false) - { - string argtext5 = "Character not found."; - PrintError(argtext5); - m_oSocket.Disconnect(); - } + if (blnFoundMatch) + { + m_oSocket.Send("L" + Constants.vbTab + strUserKey + Constants.vbTab + "STORM" + Constants.vbLf); } - break; - } - case "E": //Indicates an Error Message - { - string[] errorStrings = sText.Split("\t"); - for (int i = 1; i < errorStrings.Length; i++) + if (blnFoundMatch == false) { - PrintError(errorStrings[i]); + string argtext5 = "Character not found."; + PrintError(argtext5); + m_oSocket.Disconnect(); } - m_oSocket.Disconnect(); - break; } - case "L": + break; + } + case "E": //Indicates an Error Message + { + string[] errorStrings = sText.Split("\t"); + for(int i = 1;i < errorStrings.Length;i++) + { + PrintError(errorStrings[i]); + } + m_oSocket.Disconnect(); + break; + } + + case "L": + { + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(oData[1], "OK", false))) { - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(oData[1], "OK", false))) + foreach (string strRow in oData) { - foreach (string strRow in oData) + if (strRow.IndexOf("GAMEHOST=") > -1) { - if (strRow.IndexOf("GAMEHOST=") > -1) - { m_sConnectHost = IsLich ? m_oGlobals.Config.LichServer : strRow.Substring(9); } - else if (strRow.IndexOf("GAMEPORT=") > -1) - { + else if (strRow.IndexOf("GAMEPORT=") > -1) + { m_sConnectPort = IsLich ? m_oGlobals.Config.LichPort : int.Parse(strRow.Substring(9)); } - else if (strRow.IndexOf("KEY=") > -1) - { - m_sConnectKey = strRow.Substring(4).TrimEnd('\0'); - } - } - - if (m_sConnectKey.Length > 0) + else if (strRow.IndexOf("KEY=") > -1) { - m_oSocket.Disconnect(); - m_oConnectState = ConnectStates.ConnectingGameServer; - m_oSocket.Connect(m_sConnectHost, m_sConnectPort); + m_sConnectKey = strRow.Substring(4).TrimEnd('\0'); } } - else if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(oData[1], "PROBLEM", false))) + + if (m_sConnectKey.Length > 0) { - string argtext6 = "There is a problem with your account. Log in to play.net website for more information."; - PrintError(argtext6); m_oSocket.Disconnect(); + m_oConnectState = ConnectStates.ConnectingGameServer; + m_oSocket.Connect(m_sConnectHost, m_sConnectPort); } - - break; } - } + else if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(oData[1], "PROBLEM", false))) + { + string argtext6 = "There is a problem with your account. Log in to play.net website for more information."; + PrintError(argtext6); + m_oSocket.Disconnect(); + } + + break; + } } } } + } private bool m_bMonoOutput = false; private bool m_bPresetSpeechOutput = false; @@ -1994,7 +1999,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) } case "spelltime": { - if (m_oGlobals.VariableList["preparedspell"].ToString() == "None") + if(m_oGlobals.VariableList["preparedspell"].ToString() == "None") { if (m_oGlobals.VariableList.Contains("spellstarttime")) { @@ -2171,9 +2176,9 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) strBuffer += m_oGlobals.Config.sPrompt; bool argbIsPrompt = true; WindowTarget argoWindowTarget = 0; - - PrintTextWithParse(strBuffer, argbIsPrompt, oWindowTarget: argoWindowTarget); - + + PrintTextWithParse(strBuffer, argbIsPrompt, oWindowTarget: argoWindowTarget); + } string argkey44 = "prompt"; @@ -2416,7 +2421,7 @@ public void ResetIndicators() m_oIndicatorHash[Indicator.Webbed] = false; } - private Regex m_MonsterRegex = new Regex("([^<]*)([^,.]*)", MyRegexOptions.options); + private Regex m_MonsterRegex = new Regex("([^<]*)([^,.]*)", MyRegexOptions.options); private int CountMonsters(XmlNode oXmlNode) { @@ -2541,7 +2546,7 @@ private void DoConnect(string sHostName, int iPort) m_sEncryptionKey = string.Empty; m_oConnectState = ConnectStates.ConnectingKeyServer; m_oSocket.ConnectAndAuthenticate(sHostName, iPort); - + } private MatchCollection m_oMatchCollection; @@ -2554,7 +2559,7 @@ public void PrintTextWithParse(string sText, [Optional, DefaultParameterValue(fa public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bIsPrompt = false, WindowTarget oWindowTarget = WindowTarget.Unknown, bool bIsRoomOutput = false) { - + if (sText.Trim().Length > 0) { if (sText.Contains("You also see")) @@ -2918,7 +2923,7 @@ private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTa m_bLastRowWasPrompt = false; m_bLastRowWasBlank = false; } - + } if (targetwindow == WindowTarget.Main | targetwindow == WindowTarget.Thoughts | targetwindow == WindowTarget.Combat) @@ -3072,7 +3077,7 @@ private void GameSocket_EventConnected() m_oGlobals.VariableList.Add(argkey, argvalue, Globals.Variables.VariableType.Reserved); string argsVariable = "$connected"; VariableChanged(argsVariable); - m_bStatusPromptEnabled = false; + m_bStatusPromptEnabled = false; break; } } @@ -3105,10 +3110,10 @@ private string ParsePluginText(string sText, string sWindow) { if (m_oGlobals.PluginsEnabled == false) return sText; - + foreach (object oPlugin in m_oGlobals.PluginList) { - if (oPlugin is GeniePlugin.Interfaces.IPlugin) + if(oPlugin is GeniePlugin.Interfaces.IPlugin) { if ((oPlugin as GeniePlugin.Interfaces.IPlugin).Enabled) { @@ -3125,7 +3130,7 @@ private string ParsePluginText(string sText, string sWindow) } } } - else if (oPlugin is GeniePlugin.Plugins.IPlugin) + else if(oPlugin is GeniePlugin.Plugins.IPlugin) { if ((oPlugin as GeniePlugin.Plugins.IPlugin).Enabled) { From 486bae0f0a7d9fe60e9a04c62fc07cf358638c28 Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 18:09:31 -0400 Subject: [PATCH 02/50] added Volatile Highlights to handle presets and bolding. --- Core/Game.cs | 84 ++++++++++++------------ Forms/Components/ComponentRichTextBox.cs | 67 ++++++++++++------- Forms/FormMain.cs | 1 + Lists/Globals.cs | 1 + 4 files changed, 88 insertions(+), 65 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 169fc98..fa7b108 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -519,6 +519,7 @@ public void ParseGameRow(string sText) bool bInsideHTMLTag = false; string sHTMLBuffer = string.Empty; string sTextBuffer = string.Empty; + string sBoldBuffer = string.Empty; char cPreviousChar = Conversions.ToChar(""); bool bCombatRow = false; @@ -567,19 +568,31 @@ public void ParseGameRow(string sText) m_oXMLBuffer.Append(oXMLBuffer); string buffer = m_oXMLBuffer.ToString(); string sTmp = ProcessXML(buffer); - if (m_bBold) + if (buffer.EndsWith("")) { - if (sTextBuffer.StartsWith("< ") | sTextBuffer.StartsWith("> ") | sTextBuffer.StartsWith("* ")) + XmlDocument presetXML = new XmlDocument(); + presetXML.LoadXml(buffer); + + string presetLabel = GetAttributeData(presetXML.FirstChild, "id").ToLower(); + switch(presetLabel) { - m_bBold = false; - string argsText = sTextBuffer + System.Environment.NewLine; - bool argbIsPrompt = false; - WindowTarget argoWindowTarget = 0; - PrintTextWithParse(argsText, bIsPrompt: argbIsPrompt, oWindowTarget: argoWindowTarget); - m_bBold = true; - sTextBuffer = string.Empty; - bCombatRow = true; + case "whisper": + presetLabel = "whispers"; + break; + + case "thought": + presetLabel = "thoughts"; + break; + + default: + break; } + m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair(presetLabel, sTmp)); + } + if (buffer.EndsWith(@"")) + { + m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer)); + sBoldBuffer = string.Empty; } sTextBuffer += sTmp; @@ -604,6 +617,10 @@ public void ParseGameRow(string sText) else { sTextBuffer += Conversions.ToString(c); + if (m_bBold) + { + sBoldBuffer += c; + } } break; @@ -627,6 +644,10 @@ public void ParseGameRow(string sText) } else { + if (m_bBold) + { + sBoldBuffer += c; + } sTextBuffer += Utility.TranslateHTMLChar(sHTMLBuffer); } @@ -655,6 +676,10 @@ public void ParseGameRow(string sText) } else { + if (m_bBold) + { + sBoldBuffer += sHTMLBuffer; + } sTextBuffer += sHTMLBuffer; } @@ -668,6 +693,10 @@ public void ParseGameRow(string sText) } else { + if (m_bBold) + { + sBoldBuffer += c; + } sTextBuffer += Conversions.ToString(c); } @@ -723,6 +752,7 @@ public void ParseGameRow(string sText) bool argbIsPrompt1 = false; WindowTarget argoWindowTarget1 = 0; PrintTextWithParse(sTextBuffer, bIsPrompt: argbIsPrompt1, oWindowTarget: argoWindowTarget1); + if (bCombatRow == true) { m_bBold = false; @@ -2608,54 +2638,21 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI if (m_bPresetSpeechOutput == true) { - if (sText.Contains(", \"")) - { - color = m_oGlobals.PresetList["speech"].FgColor; - bgcolor = m_oGlobals.PresetList["speech"].BgColor; - - // Log Window - // If m_oTargetWindow = WindowTarget.Other Then - // PrintTextToWindow(sText, color, bgcolor, WindowTarget.Log) - // End If - } - m_bPresetSpeechOutput = false; } if (m_bPresetWhisperOutput == true) { - if (sText.Contains(", \"")) - { - color = m_oGlobals.PresetList["whispers"].FgColor; - bgcolor = m_oGlobals.PresetList["whispers"].BgColor; - - // Log Window - // If m_oTargetWindow = WindowTarget.Other Then - // PrintTextToWindow(sText, color, bgcolor, WindowTarget.Log) - // End If - } - m_bPresetWhisperOutput = false; } if (m_bPresetThoughtOutput == true) { - color = m_oGlobals.PresetList["thoughts"].FgColor; - bgcolor = m_oGlobals.PresetList["thoughts"].BgColor; - - // If m_oTargetWindow = WindowTarget.Main Then - // If sText.Contains(", """) Then - // Exit Sub - // End If - // End If - m_bPresetThoughtOutput = false; } if (m_bBold == true) { - color = m_oGlobals.PresetList["creatures"].FgColor; - bgcolor = m_oGlobals.PresetList["creatures"].BgColor; } // Line begins with @@ -2714,6 +2711,7 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI oWindowTarget = m_oTargetWindow; } PrintTextToWindow(sText, color, bgcolor, oWindowTarget, bIsPrompt, bIsRoomOutput); + } private Color m_oLastFgColor = default; diff --git a/Forms/Components/ComponentRichTextBox.cs b/Forms/Components/ComponentRichTextBox.cs index 4f13801..3d229ea 100644 --- a/Forms/Components/ComponentRichTextBox.cs +++ b/Forms/Components/ComponentRichTextBox.cs @@ -484,6 +484,51 @@ private void ParseHighlights() { MatchCollection oMatchCollection; + if (m_oRichTextBuffer.Text.Contains("You also see")) + { + if (!Information.IsNothing(m_oParentForm.Globals.MonsterListRegEx)) + { + oMatchCollection = (MatchCollection)m_oParentForm.Globals.MonsterListRegEx.Matches(m_oRichTextBuffer.Text); + foreach (Match oMatch in oMatchCollection) + { + m_oRichTextBuffer.SelectionStart = oMatch.Groups[1].Index; + m_oRichTextBuffer.SelectionLength = oMatch.Groups[1].Length; + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList["creatures"].FgColor, Color.Transparent, false)) + { + m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList["creatures"].FgColor; + } + + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList["creatures"].BgColor, Color.Transparent, false)) + { + m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList["creatures"].BgColor; + } + } + } + } + + // Presets and Bold + if (m_oParentForm.Globals.VolatileHighlights.Count > 0) + { + int volatilePosition = 0; + foreach (KeyValuePair highlight in m_oParentForm.Globals.VolatileHighlights.ToArray()) + { + if (m_oRichTextBuffer.Text.Substring(volatilePosition).Contains(highlight.Value)) + { + m_oRichTextBuffer.SelectionStart = m_oRichTextBuffer.Text.IndexOf(highlight.Value, volatilePosition); + m_oRichTextBuffer.SelectionLength = highlight.Value.Length; + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].FgColor, Color.Transparent, false)) + { + m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].FgColor; + } + + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].BgColor, Color.Transparent, false)) + { + m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].BgColor; + } + } + } + } + // Highlight String if (!Information.IsNothing(m_oParentForm.Globals.HighlightList.RegexString)) { @@ -556,28 +601,6 @@ private void ParseHighlights() } } } - - if (m_oRichTextBuffer.Text.Contains("You also see")) - { - if (!Information.IsNothing(m_oParentForm.Globals.MonsterListRegEx)) - { - oMatchCollection = (MatchCollection)m_oParentForm.Globals.MonsterListRegEx.Matches(m_oRichTextBuffer.Text); - foreach (Match oMatch in oMatchCollection) - { - m_oRichTextBuffer.SelectionStart = oMatch.Groups[1].Index; - m_oRichTextBuffer.SelectionLength = oMatch.Groups[1].Length; - if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList["creatures"].FgColor, Color.Transparent, false)) - { - m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList["creatures"].FgColor; - } - - if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList["creatures"].BgColor, Color.Transparent, false)) - { - m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList["creatures"].BgColor; - } - } - } - } } public FormSkin FormParent diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index 37d3f85..a877ae8 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -4937,6 +4937,7 @@ private void EndUpdate() oFormSkin = (FormSkin)oEnumerator.Current; oFormSkin.RichTextBoxOutput.EndTextUpdate(); } + m_oGlobals.VolatileHighlights.Clear(); } private void Script_EventPrintError(string sText) diff --git a/Lists/Globals.cs b/Lists/Globals.cs index 30d1f9a..7b32fdd 100644 --- a/Lists/Globals.cs +++ b/Lists/Globals.cs @@ -114,6 +114,7 @@ public void Config_ConfigChanged(Config.ConfigFieldUpdated oField) } public List MonsterList = new List(); + public List> VolatileHighlights = new List>(); public Regex MonsterListRegEx; public void UpdateMonsterListRegEx() From db6590dac26529f7ffa629c1b3202cd6f903c7b9 Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 18:21:51 -0400 Subject: [PATCH 03/50] restored combat row flagging on bold --- Core/Game.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Core/Game.cs b/Core/Game.cs index fa7b108..d059b24 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -594,6 +594,20 @@ public void ParseGameRow(string sText) m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer)); sBoldBuffer = string.Empty; } + if (m_bBold) + { + if (sTextBuffer.StartsWith("< ") | sTextBuffer.StartsWith("> ") | sTextBuffer.StartsWith("* ")) + { + m_bBold = false; + string argsText = sTextBuffer + System.Environment.NewLine; + bool argbIsPrompt = false; + WindowTarget argoWindowTarget = 0; + PrintTextWithParse(argsText, bIsPrompt: argbIsPrompt, oWindowTarget: argoWindowTarget); + m_bBold = true; + sTextBuffer = string.Empty; + bCombatRow = true; + } + } sTextBuffer += sTmp; m_oXMLBuffer.Clear(); From e1fc3847a7743fc0fc9348d1a33b85684e1f2851 Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 21:40:06 -0400 Subject: [PATCH 04/50] Tuning Bold Buffer --- Core/Game.cs | 11 ++++++++++- Forms/Components/ComponentRichTextBox.cs | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Core/Game.cs b/Core/Game.cs index d059b24..4c4c740 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -589,10 +589,13 @@ public void ParseGameRow(string sText) } m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair(presetLabel, sTmp)); } + if (buffer.EndsWith(@"")) + { + sBoldBuffer = string.Empty; + } if (buffer.EndsWith(@"")) { m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer)); - sBoldBuffer = string.Empty; } if (m_bBold) { @@ -739,10 +742,16 @@ public void ParseGameRow(string sText) if (sTextBuffer.Length > 0) { + if (bCombatRow == true) { m_bBold = true; } + else + { + m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer.Trim())); //trim because excessive whitespace seems to be breaking this + sBoldBuffer = string.Empty; + } // Fix for broke familiar XML if (m_bFamiliarLineParse) diff --git a/Forms/Components/ComponentRichTextBox.cs b/Forms/Components/ComponentRichTextBox.cs index 3d229ea..4b3e54d 100644 --- a/Forms/Components/ComponentRichTextBox.cs +++ b/Forms/Components/ComponentRichTextBox.cs @@ -525,6 +525,7 @@ private void ParseHighlights() { m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].BgColor; } + volatilePosition += highlight.Value.Length; } } } From af7fb876913b934203a26395947e0f9c5b74cc60 Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 18:28:38 -0400 Subject: [PATCH 05/50] Updated ValidateDirectory to use the UserDataDirectory as the base for relative paths --- LocalDirectory.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/LocalDirectory.cs b/LocalDirectory.cs index 03e50f6..f845660 100644 --- a/LocalDirectory.cs +++ b/LocalDirectory.cs @@ -36,6 +36,7 @@ public static string ValidateDirectory(string path) { try { + if (!System.IO.Path.IsPathRooted(path)) path = Path + "\\" + path; DirectoryInfo directory = new DirectoryInfo(path); if (!directory.Exists) { From aabd8961304c6ef8e150ba25d265b82624611e4e Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 22:03:10 -0400 Subject: [PATCH 06/50] Stopped caring about attempts to load invalid setting and just ignored them --- Lists/Config.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lists/Config.cs b/Lists/Config.cs index f00bac1..a112199 100644 --- a/Lists/Config.cs +++ b/Lists/Config.cs @@ -415,9 +415,9 @@ public bool Load(string sFileName = "settings.cfg") { SetSetting(oArgs[1].ToString(), oArgs[2].ToString(), false); } - catch (Exception ex) + catch { - throw new Exception("Failed to load setting: " + strLine + System.Environment.NewLine + ex.Message + System.Environment.NewLine); + //Settings! We got bad settings here! See? No one cares. } } From 9b8f62dc0e262069c82fcedc237c5e8792dd9a41 Mon Sep 17 00:00:00 2001 From: Djordje Date: Thu, 7 Apr 2022 17:39:20 -0400 Subject: [PATCH 07/50] added line breaks to update text --- Forms/FormMain.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index a877ae8..6dbcc8c 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -134,14 +134,14 @@ public void UpdateOnStartup() { if (Updater.ClientIsCurrent) { - AddText("You are running the latest version of Genie.", m_oGlobals.PresetList["scriptecho"].FgColor, m_oGlobals.PresetList["scriptecho"].BgColor, Genie.Game.WindowTarget.Main); + AddText("You are running the latest version of Genie.\r\n", m_oGlobals.PresetList["scriptecho"].FgColor, m_oGlobals.PresetList["scriptecho"].BgColor, Genie.Game.WindowTarget.Main); } else { - AddText("An Update is Available.", m_oGlobals.PresetList["scriptecho"].FgColor, m_oGlobals.PresetList["scriptecho"].BgColor, Genie.Game.WindowTarget.Main); + AddText("An Update is Available.\r\n", m_oGlobals.PresetList["scriptecho"].FgColor, m_oGlobals.PresetList["scriptecho"].BgColor, Genie.Game.WindowTarget.Main); if (m_oGlobals.Config.AutoUpdate) { - AddText("AutoUpdate is Enabled. Exiting and launching Updater.", m_oGlobals.PresetList["scriptecho"].FgColor, m_oGlobals.PresetList["scriptecho"].BgColor, Genie.Game.WindowTarget.Main); + AddText("AutoUpdate is Enabled. Exiting and launching Updater.\r\n", m_oGlobals.PresetList["scriptecho"].FgColor, m_oGlobals.PresetList["scriptecho"].BgColor, Genie.Game.WindowTarget.Main); Updater.RunUpdate(); System.Windows.Forms.Application.Exit(); } From dc1d9e49fe0addb5fbf50aa72cf25748e9d79525 Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 23:23:12 -0400 Subject: [PATCH 08/50] restricted special parsing of "You also see" --- Core/Game.cs | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 4c4c740..d59fd33 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -588,6 +588,11 @@ public void ParseGameRow(string sText) break; } m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair(presetLabel, sTmp)); + if(presetLabel == "roomdesc") + { + PrintTextWithParse(sTmp + Environment.NewLine, bIsPrompt: false, oWindowTarget: 0); + sTmp = string.Empty; + } } if (buffer.EndsWith(@"")) { @@ -2615,17 +2620,9 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI if (sText.Trim().Length > 0) { - if (sText.Contains("You also see")) + if (sText.StartsWith(" You also see")) { - int I = sText.IndexOf("You also see"); - if (I > 0) - { - string argsText = sText.Substring(0, I).Trim() + System.Environment.NewLine; - bool argbIsPrompt = false; - WindowTarget argoWindowTarget = 0; - PrintTextWithParse(argsText, bIsPrompt: argbIsPrompt, oWindowTarget: argoWindowTarget); - sText = sText.Substring(I); - } + sText = sText.TrimStart(); } if (m_sStyle.Length > 0) @@ -2659,24 +2656,13 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI m_sStyle = string.Empty; } - if (m_bPresetSpeechOutput == true) - { - m_bPresetSpeechOutput = false; - } - - if (m_bPresetWhisperOutput == true) - { - m_bPresetWhisperOutput = false; - } + if (m_bPresetSpeechOutput) m_bPresetSpeechOutput = false; + if (m_bPresetWhisperOutput) m_bPresetWhisperOutput = false; + if (m_bPresetThoughtOutput) m_bPresetThoughtOutput = false; - if (m_bPresetThoughtOutput == true) - { - m_bPresetThoughtOutput = false; - } - - if (m_bBold == true) - { - } + //if (m_bBold == true) + //{ + //} // Line begins with if (m_oGlobals.HighlightBeginsWithList.AcquireReaderLock()) From 47888cf75f1833de48d1ad84d38fdc1e3a52e450 Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 22:25:44 -0400 Subject: [PATCH 09/50] updated @utc@ to @unixtime@ --- Lists/Globals.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lists/Globals.cs b/Lists/Globals.cs index 7b32fdd..f8feaf3 100644 --- a/Lists/Globals.cs +++ b/Lists/Globals.cs @@ -223,7 +223,7 @@ public string ParseSpecialVariables(string sText) sText = sText.Replace("@time@", DateTime.Now.ToString("hh:mm:ss tt").Trim()); sText = sText.Replace("@date@", DateTime.Now.ToString("M/d/yyyy").Trim()); sText = sText.Replace("@datetime@", DateTime.Now.ToString("M/d/yyyy hh:mm:ss tt").Trim()); - sText = sText.Replace("@utc@", DateTimeOffset.Now.ToUnixTimeSeconds().ToString()); + sText = sText.Replace("@unixtime@", DateTimeOffset.Now.ToUnixTimeSeconds().ToString()); return sText; } From 4be9f27a3939bce584c6885f0afe3bda341ee799 Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 22:37:10 -0400 Subject: [PATCH 10/50] added saving of automapper state --- Lists/Config.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Lists/Config.cs b/Lists/Config.cs index a112199..85c975a 100644 --- a/Lists/Config.cs +++ b/Lists/Config.cs @@ -350,6 +350,7 @@ public bool Save(string sFileName = "settings.cfg") oStreamWriter.WriteLine("#config {maxrowbuffer} {" + iBufferLineSize + "}"); oStreamWriter.WriteLine("#config {spelltimer} {" + bShowSpellTimer + "}"); oStreamWriter.WriteLine("#config {autolog} {" + bAutoLog + "}"); + oStreamWriter.WriteLine("#config {automapper} {" + bAutoMapper + "}"); oStreamWriter.WriteLine("#config {editor} {" + sEditor + "}"); oStreamWriter.WriteLine("#config {prompt} {" + sPrompt + "}"); oStreamWriter.WriteLine("#config {monstercountignorelist} {" + sIgnoreMonsterList + "}"); From 12c92ed3d528d640cb1907468a7f8843a50bf577 Mon Sep 17 00:00:00 2001 From: Djordje Date: Wed, 13 Apr 2022 01:20:53 -0400 Subject: [PATCH 11/50] Added "Highlight Entire Line" setting for Presets --- Core/Game.cs | 2 +- Forms/Components/ComponentRichTextBox.cs | 17 +- Forms/ConfigPanels/UCPreset.Designer.cs | 423 ++++++----- Forms/ConfigPanels/UCPreset.cs | 12 +- Forms/ConfigPanels/UCPreset.resx | 143 ++-- Forms/FormConfig.designer.cs | 872 ++++++++++++----------- Forms/FormConfig.resx | 62 +- Lists/Globals.cs | 23 +- Properties/AssemblyInfo.cs | 4 +- 9 files changed, 801 insertions(+), 757 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index d59fd33..964134a 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -752,7 +752,7 @@ public void ParseGameRow(string sText) { m_bBold = true; } - else + else if (!string.IsNullOrWhiteSpace(sBoldBuffer)) { m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer.Trim())); //trim because excessive whitespace seems to be breaking this sBoldBuffer = string.Empty; diff --git a/Forms/Components/ComponentRichTextBox.cs b/Forms/Components/ComponentRichTextBox.cs index 4b3e54d..c256930 100644 --- a/Forms/Components/ComponentRichTextBox.cs +++ b/Forms/Components/ComponentRichTextBox.cs @@ -514,8 +514,21 @@ private void ParseHighlights() { if (m_oRichTextBuffer.Text.Substring(volatilePosition).Contains(highlight.Value)) { - m_oRichTextBuffer.SelectionStart = m_oRichTextBuffer.Text.IndexOf(highlight.Value, volatilePosition); - m_oRichTextBuffer.SelectionLength = highlight.Value.Length; + if(m_oParentForm.Globals.PresetList[highlight.Key].bHighlightLine) + { + int indexOfHighlight = m_oRichTextBuffer.Text.IndexOf(highlight.Value, volatilePosition); + int lastNewLineIndex = m_oRichTextBuffer.Text.LastIndexOf("\n", indexOfHighlight); + int nextNewLineIndex = m_oRichTextBuffer.Text.IndexOf("\n", indexOfHighlight); + if (lastNewLineIndex == -1) lastNewLineIndex = 0; + if (nextNewLineIndex == -1) nextNewLineIndex = m_oRichTextBuffer.Text.Length; + m_oRichTextBuffer.SelectionStart = lastNewLineIndex >= 0 ? lastNewLineIndex : 0; + m_oRichTextBuffer.SelectionLength = nextNewLineIndex - lastNewLineIndex; + } + else + { + m_oRichTextBuffer.SelectionStart = m_oRichTextBuffer.Text.IndexOf(highlight.Value, volatilePosition); + m_oRichTextBuffer.SelectionLength = highlight.Value.Length; + } if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].FgColor, Color.Transparent, false)) { m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].FgColor; diff --git a/Forms/ConfigPanels/UCPreset.Designer.cs b/Forms/ConfigPanels/UCPreset.Designer.cs index 8c40bf7..fd46ade 100644 --- a/Forms/ConfigPanels/UCPreset.Designer.cs +++ b/Forms/ConfigPanels/UCPreset.Designer.cs @@ -32,205 +32,235 @@ protected override void Dispose(bool disposing) [DebuggerStepThrough()] private void InitializeComponent() { - _ListViewBase = new ListView(); - _ListViewBase.KeyUp += new KeyEventHandler(ListViewBase_KeyUp); - _ListViewBase.MouseUp += new MouseEventHandler(ListViewBase_MouseUp); - _ListViewBase.SelectedIndexChanged += new EventHandler(ListViewBase_SelectedIndexChanged); - _GroupBoxBase = new GroupBox(); - _ButtonColorBg = new Button(); - _ButtonColorBg.Click += new EventHandler(ButtonColorBg_Click); - _LabelExampleColor = new Label(); - _ButtonColorFg = new Button(); - _ButtonColorFg.Click += new EventHandler(ButtonColorFg_Click); - _LabelColor = new Label(); - _TextBoxPreset = new TextBox(); - _TextBoxPreset.TextChanged += new EventHandler(TextBox_TextChanged); - _LabelAlias = new Label(); - _ButtonApply = new Button(); - _ButtonApply.Click += new EventHandler(ButtonApply_Click); - _TextBoxColor = new TextBox(); - _TextBoxColor.KeyDown += new KeyEventHandler(TextBoxColor_KeyDown); - _TextBoxColor.Leave += new EventHandler(TextBoxColor_Leave); - _TextBoxColor.TextChanged += new EventHandler(TextBox_TextChanged); - _ColorDialogPicker = new ColorDialog(); - _ToolStripMenu = new ToolStrip(); - _ToolStripButtonRefresh = new ToolStripButton(); - _ToolStripButtonRefresh.Click += new EventHandler(ToolStripButtonRefresh_Click); - _ToolStripSeparator2 = new ToolStripSeparator(); - _ToolStripButtonLoad = new ToolStripButton(); - _ToolStripButtonLoad.Click += new EventHandler(ToolStripButtonLoad_Click); - _ToolStripButtonSave = new ToolStripButton(); - _ToolStripButtonSave.Click += new EventHandler(ToolStripButtonSave_Click); - _GroupBoxBase.SuspendLayout(); - _ToolStripMenu.SuspendLayout(); - SuspendLayout(); - // - // ListViewBase - // - _ListViewBase.BackColor = Color.Black; - _ListViewBase.Dock = DockStyle.Fill; - _ListViewBase.ForeColor = Color.White; - _ListViewBase.FullRowSelect = true; - _ListViewBase.HideSelection = false; - _ListViewBase.Location = new Point(0, 25); - _ListViewBase.Name = "ListViewBase"; - _ListViewBase.ShowGroups = false; - _ListViewBase.Size = new Size(698, 312); - _ListViewBase.Sorting = SortOrder.Ascending; - _ListViewBase.TabIndex = 0; - _ListViewBase.UseCompatibleStateImageBehavior = false; - _ListViewBase.View = View.Details; - // - // GroupBoxBase - // - _GroupBoxBase.AutoSize = true; - _GroupBoxBase.Controls.Add(_ButtonColorBg); - _GroupBoxBase.Controls.Add(_LabelExampleColor); - _GroupBoxBase.Controls.Add(_ButtonColorFg); - _GroupBoxBase.Controls.Add(_LabelColor); - _GroupBoxBase.Controls.Add(_TextBoxPreset); - _GroupBoxBase.Controls.Add(_LabelAlias); - _GroupBoxBase.Controls.Add(_ButtonApply); - _GroupBoxBase.Controls.Add(_TextBoxColor); - _GroupBoxBase.Dock = DockStyle.Bottom; - _GroupBoxBase.Enabled = false; - _GroupBoxBase.Location = new Point(0, 337); - _GroupBoxBase.Name = "GroupBoxBase"; - _GroupBoxBase.Size = new Size(698, 109); - _GroupBoxBase.TabIndex = 2; - _GroupBoxBase.TabStop = false; - // - // ButtonColorBg - // - _ButtonColorBg.Image = My.Resources.Resources.preferences_desktop_locale; - _ButtonColorBg.Location = new Point(421, 31); - _ButtonColorBg.Name = "ButtonColorBg"; - _ButtonColorBg.Size = new Size(23, 23); - _ButtonColorBg.TabIndex = 12; - _ButtonColorBg.UseVisualStyleBackColor = true; - // - // LabelExampleColor - // - _LabelExampleColor.BackColor = Color.Black; - _LabelExampleColor.Font = new Font("Verdana", 9.0F, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0)); - _LabelExampleColor.ForeColor = Color.Black; - _LabelExampleColor.Location = new Point(322, 32); - _LabelExampleColor.Name = "LabelExampleColor"; - _LabelExampleColor.Size = new Size(64, 20); - _LabelExampleColor.TabIndex = 11; - _LabelExampleColor.Text = "Color"; - _LabelExampleColor.TextAlign = ContentAlignment.MiddleCenter; - // - // ButtonColorFg - // - _ButtonColorFg.Image = My.Resources.Resources.applications_graphics; - _ButtonColorFg.Location = new Point(392, 31); - _ButtonColorFg.Name = "ButtonColorFg"; - _ButtonColorFg.Size = new Size(23, 23); - _ButtonColorFg.TabIndex = 3; - _ButtonColorFg.UseVisualStyleBackColor = true; - // - // LabelColor - // - _LabelColor.AutoSize = true; - _LabelColor.Location = new Point(161, 16); - _LabelColor.Name = "LabelColor"; - _LabelColor.Size = new Size(31, 13); - _LabelColor.TabIndex = 10; - _LabelColor.Text = "Color"; - // - // TextBoxPreset - // - _TextBoxPreset.Location = new Point(6, 32); - _TextBoxPreset.Name = "TextBoxPreset"; - _TextBoxPreset.ReadOnly = true; - _TextBoxPreset.Size = new Size(152, 20); - _TextBoxPreset.TabIndex = 0; - // - // LabelAlias - // - _LabelAlias.AutoSize = true; - _LabelAlias.Location = new Point(3, 16); - _LabelAlias.Name = "LabelAlias"; - _LabelAlias.Size = new Size(37, 13); - _LabelAlias.TabIndex = 8; - _LabelAlias.Text = "Preset"; - // - // ButtonApply - // - _ButtonApply.Location = new Point(6, 67); - _ButtonApply.Name = "ButtonApply"; - _ButtonApply.Size = new Size(75, 23); - _ButtonApply.TabIndex = 2; - _ButtonApply.Text = "Apply"; - _ButtonApply.UseVisualStyleBackColor = true; - // - // TextBoxColor - // - _TextBoxColor.Location = new Point(164, 32); - _TextBoxColor.Name = "TextBoxColor"; - _TextBoxColor.Size = new Size(152, 20); - _TextBoxColor.TabIndex = 1; - // - // ColorDialogPicker - // - _ColorDialogPicker.FullOpen = true; - // - // ToolStripMenu - // - _ToolStripMenu.AllowMerge = false; - _ToolStripMenu.GripStyle = ToolStripGripStyle.Hidden; - _ToolStripMenu.Items.AddRange(new ToolStripItem[] { _ToolStripButtonRefresh, _ToolStripSeparator2, _ToolStripButtonLoad, _ToolStripButtonSave }); - _ToolStripMenu.Location = new Point(0, 0); - _ToolStripMenu.Name = "ToolStripMenu"; - _ToolStripMenu.Size = new Size(698, 25); - _ToolStripMenu.TabIndex = 6; - // - // ToolStripButtonRefresh - // - _ToolStripButtonRefresh.Image = My.Resources.Resources.view_refresh; - _ToolStripButtonRefresh.ImageTransparentColor = Color.Magenta; - _ToolStripButtonRefresh.Name = "ToolStripButtonRefresh"; - _ToolStripButtonRefresh.Size = new Size(65, 22); - _ToolStripButtonRefresh.Text = "Refresh"; - // - // ToolStripSeparator2 - // - _ToolStripSeparator2.Name = "ToolStripSeparator2"; - _ToolStripSeparator2.Size = new Size(6, 25); - // - // ToolStripButtonLoad - // - _ToolStripButtonLoad.Image = My.Resources.Resources.document_open; - _ToolStripButtonLoad.ImageTransparentColor = Color.Magenta; - _ToolStripButtonLoad.Name = "ToolStripButtonLoad"; - _ToolStripButtonLoad.Size = new Size(50, 22); - _ToolStripButtonLoad.Text = "Load"; - // - // ToolStripButtonSave - // - _ToolStripButtonSave.Image = My.Resources.Resources.document_save; - _ToolStripButtonSave.ImageTransparentColor = Color.Magenta; - _ToolStripButtonSave.Name = "ToolStripButtonSave"; - _ToolStripButtonSave.Size = new Size(51, 22); - _ToolStripButtonSave.Text = "Save"; + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UCPreset)); + this._ListViewBase = new System.Windows.Forms.ListView(); + this._GroupBoxBase = new System.Windows.Forms.GroupBox(); + this._ButtonColorBg = new System.Windows.Forms.Button(); + this._LabelExampleColor = new System.Windows.Forms.Label(); + this._ButtonColorFg = new System.Windows.Forms.Button(); + this._LabelColor = new System.Windows.Forms.Label(); + this._TextBoxPreset = new System.Windows.Forms.TextBox(); + this._LabelAlias = new System.Windows.Forms.Label(); + this._ButtonApply = new System.Windows.Forms.Button(); + this._TextBoxColor = new System.Windows.Forms.TextBox(); + this._ColorDialogPicker = new System.Windows.Forms.ColorDialog(); + this._ToolStripMenu = new System.Windows.Forms.ToolStrip(); + this._ToolStripButtonRefresh = new System.Windows.Forms.ToolStripButton(); + this._ToolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this._ToolStripButtonLoad = new System.Windows.Forms.ToolStripButton(); + this._ToolStripButtonSave = new System.Windows.Forms.ToolStripButton(); + this.chkHighlightLine = new System.Windows.Forms.CheckBox(); + this._GroupBoxBase.SuspendLayout(); + this._ToolStripMenu.SuspendLayout(); + this.SuspendLayout(); + // + // _ListViewBase + // + this._ListViewBase.BackColor = System.Drawing.Color.Black; + this._ListViewBase.Dock = System.Windows.Forms.DockStyle.Fill; + this._ListViewBase.ForeColor = System.Drawing.Color.White; + this._ListViewBase.FullRowSelect = true; + this._ListViewBase.Location = new System.Drawing.Point(0, 25); + this._ListViewBase.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._ListViewBase.Name = "_ListViewBase"; + this._ListViewBase.ShowGroups = false; + this._ListViewBase.Size = new System.Drawing.Size(814, 364); + this._ListViewBase.Sorting = System.Windows.Forms.SortOrder.Ascending; + this._ListViewBase.TabIndex = 0; + this._ListViewBase.UseCompatibleStateImageBehavior = false; + this._ListViewBase.View = System.Windows.Forms.View.Details; + this._ListViewBase.SelectedIndexChanged += new System.EventHandler(this.ListViewBase_SelectedIndexChanged); + this._ListViewBase.KeyUp += new System.Windows.Forms.KeyEventHandler(this.ListViewBase_KeyUp); + this._ListViewBase.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ListViewBase_MouseUp); + // + // _GroupBoxBase + // + this._GroupBoxBase.AutoSize = true; + this._GroupBoxBase.Controls.Add(this.chkHighlightLine); + this._GroupBoxBase.Controls.Add(this._ButtonColorBg); + this._GroupBoxBase.Controls.Add(this._LabelExampleColor); + this._GroupBoxBase.Controls.Add(this._ButtonColorFg); + this._GroupBoxBase.Controls.Add(this._LabelColor); + this._GroupBoxBase.Controls.Add(this._TextBoxPreset); + this._GroupBoxBase.Controls.Add(this._LabelAlias); + this._GroupBoxBase.Controls.Add(this._ButtonApply); + this._GroupBoxBase.Controls.Add(this._TextBoxColor); + this._GroupBoxBase.Dock = System.Windows.Forms.DockStyle.Bottom; + this._GroupBoxBase.Enabled = false; + this._GroupBoxBase.Location = new System.Drawing.Point(0, 389); + this._GroupBoxBase.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._GroupBoxBase.Name = "_GroupBoxBase"; + this._GroupBoxBase.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._GroupBoxBase.Size = new System.Drawing.Size(814, 126); + this._GroupBoxBase.TabIndex = 2; + this._GroupBoxBase.TabStop = false; + // + // _ButtonColorBg + // + this._ButtonColorBg.Image = ((System.Drawing.Image)(resources.GetObject("_ButtonColorBg.Image"))); + this._ButtonColorBg.Location = new System.Drawing.Point(491, 36); + this._ButtonColorBg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._ButtonColorBg.Name = "_ButtonColorBg"; + this._ButtonColorBg.Size = new System.Drawing.Size(27, 27); + this._ButtonColorBg.TabIndex = 12; + this._ButtonColorBg.UseVisualStyleBackColor = true; + this._ButtonColorBg.Click += new System.EventHandler(this.ButtonColorBg_Click); + // + // _LabelExampleColor + // + this._LabelExampleColor.BackColor = System.Drawing.Color.Black; + this._LabelExampleColor.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this._LabelExampleColor.ForeColor = System.Drawing.Color.Black; + this._LabelExampleColor.Location = new System.Drawing.Point(376, 37); + this._LabelExampleColor.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this._LabelExampleColor.Name = "_LabelExampleColor"; + this._LabelExampleColor.Size = new System.Drawing.Size(75, 23); + this._LabelExampleColor.TabIndex = 11; + this._LabelExampleColor.Text = "Color"; + this._LabelExampleColor.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // _ButtonColorFg + // + this._ButtonColorFg.Image = ((System.Drawing.Image)(resources.GetObject("_ButtonColorFg.Image"))); + this._ButtonColorFg.Location = new System.Drawing.Point(457, 36); + this._ButtonColorFg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._ButtonColorFg.Name = "_ButtonColorFg"; + this._ButtonColorFg.Size = new System.Drawing.Size(27, 27); + this._ButtonColorFg.TabIndex = 3; + this._ButtonColorFg.UseVisualStyleBackColor = true; + this._ButtonColorFg.Click += new System.EventHandler(this.ButtonColorFg_Click); + // + // _LabelColor + // + this._LabelColor.AutoSize = true; + this._LabelColor.Location = new System.Drawing.Point(188, 18); + this._LabelColor.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this._LabelColor.Name = "_LabelColor"; + this._LabelColor.Size = new System.Drawing.Size(36, 15); + this._LabelColor.TabIndex = 10; + this._LabelColor.Text = "Color"; + // + // _TextBoxPreset + // + this._TextBoxPreset.Location = new System.Drawing.Point(7, 37); + this._TextBoxPreset.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TextBoxPreset.Name = "_TextBoxPreset"; + this._TextBoxPreset.ReadOnly = true; + this._TextBoxPreset.Size = new System.Drawing.Size(177, 23); + this._TextBoxPreset.TabIndex = 0; + this._TextBoxPreset.TextChanged += new System.EventHandler(this.TextBox_TextChanged); + // + // _LabelAlias + // + this._LabelAlias.AutoSize = true; + this._LabelAlias.Location = new System.Drawing.Point(4, 18); + this._LabelAlias.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this._LabelAlias.Name = "_LabelAlias"; + this._LabelAlias.Size = new System.Drawing.Size(39, 15); + this._LabelAlias.TabIndex = 8; + this._LabelAlias.Text = "Preset"; + // + // _ButtonApply + // + this._ButtonApply.Location = new System.Drawing.Point(7, 77); + this._ButtonApply.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._ButtonApply.Name = "_ButtonApply"; + this._ButtonApply.Size = new System.Drawing.Size(88, 27); + this._ButtonApply.TabIndex = 2; + this._ButtonApply.Text = "Apply"; + this._ButtonApply.UseVisualStyleBackColor = true; + this._ButtonApply.Click += new System.EventHandler(this.ButtonApply_Click); + // + // _TextBoxColor + // + this._TextBoxColor.Location = new System.Drawing.Point(191, 37); + this._TextBoxColor.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TextBoxColor.Name = "_TextBoxColor"; + this._TextBoxColor.Size = new System.Drawing.Size(177, 23); + this._TextBoxColor.TabIndex = 1; + this._TextBoxColor.TextChanged += new System.EventHandler(this.TextBox_TextChanged); + this._TextBoxColor.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxColor_KeyDown); + this._TextBoxColor.Leave += new System.EventHandler(this.TextBoxColor_Leave); + // + // _ColorDialogPicker + // + this._ColorDialogPicker.FullOpen = true; + // + // _ToolStripMenu + // + this._ToolStripMenu.AllowMerge = false; + this._ToolStripMenu.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this._ToolStripMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this._ToolStripButtonRefresh, + this._ToolStripSeparator2, + this._ToolStripButtonLoad, + this._ToolStripButtonSave}); + this._ToolStripMenu.Location = new System.Drawing.Point(0, 0); + this._ToolStripMenu.Name = "_ToolStripMenu"; + this._ToolStripMenu.Size = new System.Drawing.Size(814, 25); + this._ToolStripMenu.TabIndex = 6; + // + // _ToolStripButtonRefresh + // + this._ToolStripButtonRefresh.Image = ((System.Drawing.Image)(resources.GetObject("_ToolStripButtonRefresh.Image"))); + this._ToolStripButtonRefresh.ImageTransparentColor = System.Drawing.Color.Magenta; + this._ToolStripButtonRefresh.Name = "_ToolStripButtonRefresh"; + this._ToolStripButtonRefresh.Size = new System.Drawing.Size(66, 22); + this._ToolStripButtonRefresh.Text = "Refresh"; + this._ToolStripButtonRefresh.Click += new System.EventHandler(this.ToolStripButtonRefresh_Click); + // + // _ToolStripSeparator2 + // + this._ToolStripSeparator2.Name = "_ToolStripSeparator2"; + this._ToolStripSeparator2.Size = new System.Drawing.Size(6, 25); + // + // _ToolStripButtonLoad + // + this._ToolStripButtonLoad.Image = ((System.Drawing.Image)(resources.GetObject("_ToolStripButtonLoad.Image"))); + this._ToolStripButtonLoad.ImageTransparentColor = System.Drawing.Color.Magenta; + this._ToolStripButtonLoad.Name = "_ToolStripButtonLoad"; + this._ToolStripButtonLoad.Size = new System.Drawing.Size(53, 22); + this._ToolStripButtonLoad.Text = "Load"; + this._ToolStripButtonLoad.Click += new System.EventHandler(this.ToolStripButtonLoad_Click); + // + // _ToolStripButtonSave + // + this._ToolStripButtonSave.Image = ((System.Drawing.Image)(resources.GetObject("_ToolStripButtonSave.Image"))); + this._ToolStripButtonSave.ImageTransparentColor = System.Drawing.Color.Magenta; + this._ToolStripButtonSave.Name = "_ToolStripButtonSave"; + this._ToolStripButtonSave.Size = new System.Drawing.Size(51, 22); + this._ToolStripButtonSave.Text = "Save"; + this._ToolStripButtonSave.Click += new System.EventHandler(this.ToolStripButtonSave_Click); + // + // chkHighlightLine + // + this.chkHighlightLine.AutoSize = true; + this.chkHighlightLine.Location = new System.Drawing.Point(191, 66); + this.chkHighlightLine.Name = "chkHighlightLine"; + this.chkHighlightLine.Size = new System.Drawing.Size(134, 19); + this.chkHighlightLine.TabIndex = 13; + this.chkHighlightLine.Text = "Highlight Entire Line"; + this.chkHighlightLine.UseVisualStyleBackColor = true; + this.chkHighlightLine.CheckedChanged += new System.EventHandler(this.chkHighlightLine_CheckedChanged); // // UCPreset // - AutoScaleDimensions = new SizeF(6.0F, 13.0F); - AutoScaleMode = AutoScaleMode.Font; - Controls.Add(_ListViewBase); - Controls.Add(_GroupBoxBase); - Controls.Add(_ToolStripMenu); - Name = "UCPreset"; - Size = new Size(698, 446); - _GroupBoxBase.ResumeLayout(false); - _GroupBoxBase.PerformLayout(); - _ToolStripMenu.ResumeLayout(false); - _ToolStripMenu.PerformLayout(); - Load += new EventHandler(UCWindows_Load); - ResumeLayout(false); - PerformLayout(); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this._ListViewBase); + this.Controls.Add(this._GroupBoxBase); + this.Controls.Add(this._ToolStripMenu); + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.Name = "UCPreset"; + this.Size = new System.Drawing.Size(814, 515); + this.Load += new System.EventHandler(this.UCWindows_Load); + this._GroupBoxBase.ResumeLayout(false); + this._GroupBoxBase.PerformLayout(); + this._ToolStripMenu.ResumeLayout(false); + this._ToolStripMenu.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + } private ListView _ListViewBase; @@ -618,6 +648,7 @@ internal ToolStripButton ToolStripButtonLoad } private ToolStripButton _ToolStripButtonSave; + private CheckBox chkHighlightLine; internal ToolStripButton ToolStripButtonSave { diff --git a/Forms/ConfigPanels/UCPreset.cs b/Forms/ConfigPanels/UCPreset.cs index e91df75..2c2f63a 100644 --- a/Forms/ConfigPanels/UCPreset.cs +++ b/Forms/ConfigPanels/UCPreset.cs @@ -161,6 +161,7 @@ private void PopulateList() li.Tag = de.Key.ToString(); Genie.Globals.Presets.Preset oPreset = (Genie.Globals.Presets.Preset)de.Value; li.SubItems.Add(oPreset.sColorName); + li.SubItems.Add(oPreset.bHighlightLine.ToString()); li.ForeColor = oPreset.FgColor; // MsgBox(li.BackColor.ToString) if (oPreset.BgColor != Color.Transparent) @@ -238,8 +239,10 @@ private void UpdateGroupBox() TextBoxPreset.Enabled = true; TextBoxPreset.Text = ListViewBase.SelectedItems[0].Text; TextBoxColor.Enabled = true; + chkHighlightLine.Enabled = true; TextBoxColor.Text = ListViewBase.SelectedItems[0].SubItems[1].Text; TextBoxColor.Tag = ListViewBase.SelectedItems[0].SubItems[1].Text; + chkHighlightLine.Checked = ListViewBase.SelectedItems[0].SubItems[2].Text.ToLower() == "true"; GroupBoxBase.Enabled = true; GroupBoxBase.Tag = new ArrayList(ListViewBase.SelectedItems); LabelExampleColor.ForeColor = ListViewBase.SelectedItems[0].ForeColor; @@ -252,6 +255,7 @@ private void UpdateGroupBox() TextBoxColor.Enabled = true; GroupBoxBase.Enabled = true; GroupBoxBase.Tag = new ArrayList(ListViewBase.SelectedItems); + chkHighlightLine.Enabled = true; } else { @@ -320,11 +324,12 @@ public bool ApplyChanges() li.SubItems[1].Text = TextBoxColor.Text; li.ForeColor = LabelExampleColor.ForeColor; li.BackColor = LabelExampleColor.BackColor; + li.SubItems[2].Text = chkHighlightLine.Checked.ToString(); } string argsKey = li.Text; string argsColorName = TextBoxColor.Text; - m_PresetList.Add(argsKey, argsColorName); + m_PresetList.Add(argsKey, argsColorName, true, li.SubItems[2].Text.ToLower() == "true"); m_FormMain.SafePresetChanged(li.Text.ToLower()); li.Tag = li.Text; } @@ -378,5 +383,10 @@ public bool SaveToFile() { return m_PresetList.Save(); } + + private void chkHighlightLine_CheckedChanged(object sender, EventArgs e) + { + m_ItemChanged = true; + } } } \ No newline at end of file diff --git a/Forms/ConfigPanels/UCPreset.resx b/Forms/ConfigPanels/UCPreset.resx index 03398b9..709d377 100644 --- a/Forms/ConfigPanels/UCPreset.resx +++ b/Forms/ConfigPanels/UCPreset.resx @@ -1,64 +1,4 @@ - - @@ -117,10 +57,85 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 140, 17 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADdYAAA3WAZBveZwAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwa + AAABFUlEQVQ4T2OIMU37BcT/ScFAwADDIAN+r5+6+f/hNcf+X9h3+f+5Axf/H9998v/y6av+txS2/y+M + KP2f6pr1P9+75H9FUB1uA2aXLfy/tHH1//7cqf8ro+r+J7tn/A8yD/sfbZcwlAzwm8VGKv6FYkDAbI7/ + y55n/N/wpvj/3o+d/4++m/P/3Nv1/5feKvxfdlDvf9Z+if9FJ+X+V11S+d9wUwNkwG9MA56l/Z/0zO7/ + zFce/3vuWf9vuKT/v/iY0v+0XaI0NgCUDsg1AJ4SyTIAOUoGjwGTnzn8n/XK63/vPbv/TZeM/5ccUyHO + AP9Z7GAD1r8p+r/nY/v/w29n/j/9ZtX/JbcKcKcDZAOAAiBBEjDbLwA9sG7FUXBgxgAAAABJRU5ErkJg + gg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAB70lEQVQ4T2P4//8/RRirIC6c + Z8vOjy6GwsGHs63ZjWZFihXdqJfWe1AjxAgTx1CIDadbsju3+4uceDDNfd6Tdvmkx3XC5kBDBEByWDUg + 4/qK7OiG4ri/K9pTfjycYHn8RZPY1BcdSgXnigX9u3251LFqQsY9vR1XVqxc9n/lyqX/u7ua/59tt7r5 + cpr1+smhfPOBLpPDqgmG23vaTXv7uz69f//+/5s3b/6v37Duf2dn8/+FuUbviuw5WkBqsGqE4e7ejjW7 + 9+z6+/v37/+nTp36v3z58v8LF83/195U8TvTQVgEpAarRhBubW0V7+xu+/7x48f/z549+7958+b/y1cs + +w809EtLW70dTB2GRhju6Gpr3Lpt8w+Q7QcOHPg/f8E8sOa27jZLZHUomsACDAysUlJSbU5Ojj9j42L/ + b9y48f/8+WDNnzs7W8ww1KNwGBg4hYWFt2ZkZPxvamr6b29v/19RUfF/Tl7WV6BmE2S1cD0oHAaGFRIS + Ev97e3v/r169+r+3t/d/dXX1/+LiYnOR1SFjBIOBoQyI//Py8v7X1dX97+Dg8N/Y2Pi/pKQkSDIFWRMy + hhAMDO5A/AdkAAhzc3P/FxMT+y8oKAjivwFiMXSNMAwC0UD8HYjBmqH4ORAfBeLpQCyOTSME/2cAAJFL + g2TavqCTAAAAAElFTkSuQmCC + + + + 17, 17 - - 278, 17 + + 171, 17 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAMYSURBVDhPbVNpSBRhGJ6ioLugPxX1q/5kUOherhgSUT/K + Ssof0YGSO7NHShblEdFGmEiUCgppKerOseuRR8iWZW6K5ZFaupZbHoln64W1jubqztv3fU5R0QMvzMx7 + zPM+3/NRf0IZad2hNQh5WqPQp2K42UCDdTjIKFQracspBZO9Ui4jUNJc4r6IvE3yK0WpGUuYRs/PGtIc + 3rRyJ9jqvoCttg8yKjohIvnZjEbPTStp/jSuVTI8gwaAginaSJr9owp2a428eO+xE3Jf9kBBTS9Uvh0G + h9MNLb1T8GFgGhwdo3AkrlRU67lXB2OL55QMu6iOYTeQAVqj9ZEh3eG7kvUagi/aANEHrUlYPH/H7sl/ + 7pJcQ9+ge+Q79H71QIq11dfoGoMgkzAfdCFnPRmAqHsOxBZDcLRNQglRqWOvBdDsVkWU5ZDGwLdGplSJ + rd3jMDAuwsjULIkgk9W795xlLRmgolkJCbegT2/IRcNGAmjrTpKQodJxkZhVQ5cb3rjGYXBCxAy8SNg1 + pEBBs4uhiU9uxj18tycs+cVmymxeThIIIWbHCo1BqE8tee8dRX/Gq2AGSLOFwMuFq0nR713+A6WOy8eK + H75a8iM0rmyORHzZHP4WEpG3aqmIZudRSCR0nA8zUujYBfRchb2hMuVt+TfUOnY7acbADcOTIgxPzsIQ + 2i/n6UefWi/0/2UUGWaha9ulrFYt7vEzFa0jH/GZ4r3qu8ah6dMYyGxMJCkDK46M5I7ObLx/0myvWzKS + 7E4Nw/vwAKzuEGJS2zECxxLKRHSEzYooXo1r8MBgk23yxA07PgEJ5bykGSNQL/iwWTIrnFK/e4YYpqVn + ElJL2qWj8WUi+tsCOmasvLQ/phBCE8qx0WxyOzYSJ51Jss8hm3Yev14+U9k8CE2fJ6C6fRTKmwYhv6YP + Uoo74DbfBqmlTgg08MjSrJ/cjulx2L4Z+BmpH65mhKnwW5WeJKENHthdkF3VDXdLnBCTUbeIL5xKx58l + jb+AmiwUBcvkVwqLg68wolmjMQpuFc150d5DKIr8oyy75DIEivoJX23jWSsK7A4AAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFwSURBVDhPpZHNSwJBHIb3j+rspf6CzEzENrHNb7MOEhFE + hKDVJcivVRNCNpbK6tKhoCTIMtYxpHIhiqBL0DXPbztTKqal4g8ehp1559kXhhsbH132zrrxG7tTYEzZ + Ju3cf0PDhJCOFApXsAlWGAx600+8fVweB/L5C0RjEYaYimNXznYlkthcZQJas1gsQpIkBj3sZWiOCaw2 + vqVBXVCrff4JnYbAwps7NqBBRblto6NgoAYms7GnBqpa7SwwGPWsgXVRxJCQ7YthdxpMQBvQjYL6gfPK + e0/QLL3TaEA/ctdv2DhWuxLOPUK6fG0K6g0ONMH6UZWF6Lp2WEVICwf3H7Ai32NJqiCwc4f5TBmps+fW + BhOBJJLapn+bwJ8uw5cm8KUIvBqeJIE7WYJLJHAmSnBobJ08NQXynoyw9jcacos0WPoOxkuYiSsQtFWI + KZiOKrBFFIinL9DPRTFiWchwOj6Up6Z+0fHBG/aMgw3HfQGp9opU165TRwAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIvSURBVDhPnZNbaxNBGIbzP/whFlSk4o0iguBFbyzohRG3 + OVlLD9iam3hqaTHQUltwvTJNG0zBkBKNRHOAJEs2m9gEi1mDSVpoczAniIlJXnfGuuk26oUfPDvDN+88 + zOyyqhHT+L1Lk09nTqrndAPqJ3MD6tltCZy+9fj7Bb1xd2hiyqT6Vw3qzMPXF9/MGG3CtU1+LyKkvyHw + uYBVbxrq2Redc5pHHfXU8InDeH8x9x8u3TSM4oZ+DBc1JgzeXcH5CRbPPTv4sJPHlQd2XL49Da2e6UOj + Y4wqxqBFZk8EKfFrEqGkCO0zJ8g1NrgMzFsfcXV6FYn0Ls38rnq9TiWqO2MMOp0OSqUSisUi0pkvGF/e + pIJJSxgLr3mcYeZhc/ukdSlDcqUiavXaLwF5tH+0kS8U6KajEMGQ+V1fvyBla7Ujglarhf39A4SjfhpY + 9qRgYD0yo+x7LL39RNcWrXYcSNlqtdoTNJtNKsnlcghwHllCNhI2gmnaM7+00Qy5f6VSUQrIOzgusXFZ + KjrFLMibSYZkFYJGo4FsNitLCPx2EGdH5qlo5ZWD9trtNs2QbLlc7gm63e7hx/lzkSMT8vk8pU/A8zxC + oZCCQCCgmB8nmUwqBaTJsizsdjvcbjf8fj+CwSAEQYDVakU8HpdHl8uFcDjcE0QiEfh8PqyvW+FwOOD1 + emUBx3FYs6whFotJo4WOW06nUiCKIlKplEwikaBEo9G/IgvID0Em/4NGxxh/Avz02lw1GIbVAAAAAElF + TkSuQmCC + + \ No newline at end of file diff --git a/Forms/FormConfig.designer.cs b/Forms/FormConfig.designer.cs index fb168a3..786e1ae 100644 --- a/Forms/FormConfig.designer.cs +++ b/Forms/FormConfig.designer.cs @@ -34,427 +34,463 @@ protected override void Dispose(bool disposing) [DebuggerStepThrough()] private void InitializeComponent() { - var resources = new System.ComponentModel.ComponentResourceManager(typeof(FormConfig)); - _TableLayoutPanel1 = new TableLayoutPanel(); - _Cancel_Button = new Button(); - _Cancel_Button.Click += new EventHandler(Cancel_Button_Click); - _OK_Button = new Button(); - _OK_Button.Click += new EventHandler(OK_Button_Click); - _Panel1 = new Panel(); - _TabControlMain = new TabControl(); - _TabPageWindows = new TabPage(); - _TabControlWindows = new TabControl(); - _TabPage1 = new TabPage(); - _UcWindows1 = new UCWindows(); - _TabPage2 = new TabPage(); - _UcWindowSettings1 = new UCWindowSettings(); - _TabPageHighlights = new TabPage(); - _TabControl2 = new TabControl(); - _TabPageString = new TabPage(); - _UcHighlightStrings1 = new UCHighlightStrings(); - _TabPageNames = new TabPage(); - _UcName1 = new UCName(); - _TabPagePreset = new TabPage(); - _UcPreset1 = new UCPreset(); - _TabPageTriggers = new TabPage(); - _UcTriggers1 = new UCTriggers(); - _TabPageMacros = new TabPage(); - _UcMacros1 = new UCMacros(); - _TabPageAliases = new TabPage(); - _UcAliases1 = new UCAliases(); - _TabPageSubs = new TabPage(); - _UcSubs1 = new UCSubs(); - _TabPageIgnores = new TabPage(); - _UcIgnore1 = new UCIgnore(); - _TabPageVars = new TabPage(); - _UcVariables1 = new UCVariables(); - _TabPageVariables = new TabPage(); - _TableLayoutPanel1.SuspendLayout(); - _Panel1.SuspendLayout(); - _TabControlMain.SuspendLayout(); - _TabPageWindows.SuspendLayout(); - _TabControlWindows.SuspendLayout(); - _TabPage1.SuspendLayout(); - _TabPage2.SuspendLayout(); - _TabPageHighlights.SuspendLayout(); - _TabControl2.SuspendLayout(); - _TabPageString.SuspendLayout(); - _TabPageNames.SuspendLayout(); - _TabPagePreset.SuspendLayout(); - _TabPageTriggers.SuspendLayout(); - _TabPageMacros.SuspendLayout(); - _TabPageAliases.SuspendLayout(); - _TabPageSubs.SuspendLayout(); - _TabPageIgnores.SuspendLayout(); - _TabPageVars.SuspendLayout(); - SuspendLayout(); - // - // TableLayoutPanel1 - // - _TableLayoutPanel1.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; - _TableLayoutPanel1.ColumnCount = 2; - _TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50.0F)); - _TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50.0F)); - _TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20.0F)); - _TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20.0F)); - _TableLayoutPanel1.Controls.Add(_Cancel_Button, 0, 0); - _TableLayoutPanel1.Controls.Add(_OK_Button, 0, 0); - _TableLayoutPanel1.Location = new Point(508, 3); - _TableLayoutPanel1.Name = "TableLayoutPanel1"; - _TableLayoutPanel1.RowCount = 1; - _TableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100.0F)); - _TableLayoutPanel1.Size = new Size(154, 29); - _TableLayoutPanel1.TabIndex = 1; - // - // Cancel_Button - // - _Cancel_Button.Anchor = AnchorStyles.None; - _Cancel_Button.DialogResult = DialogResult.Cancel; - _Cancel_Button.Location = new Point(82, 3); - _Cancel_Button.Name = "Cancel_Button"; - _Cancel_Button.Size = new Size(67, 23); - _Cancel_Button.TabIndex = 1; - _Cancel_Button.Text = "Cancel"; - // - // OK_Button - // - _OK_Button.Anchor = AnchorStyles.None; - _OK_Button.Location = new Point(5, 3); - _OK_Button.Name = "OK_Button"; - _OK_Button.Size = new Size(67, 23); - _OK_Button.TabIndex = 0; - _OK_Button.Text = "OK"; - // - // Panel1 - // - _Panel1.Controls.Add(_TableLayoutPanel1); - _Panel1.Dock = DockStyle.Bottom; - _Panel1.Location = new Point(0, 480); - _Panel1.Name = "Panel1"; - _Panel1.Size = new Size(665, 35); - _Panel1.TabIndex = 2; - // - // TabControlMain - // - _TabControlMain.Controls.Add(_TabPageWindows); - _TabControlMain.Controls.Add(_TabPageHighlights); - _TabControlMain.Controls.Add(_TabPageTriggers); - _TabControlMain.Controls.Add(_TabPageSubs); - _TabControlMain.Controls.Add(_TabPageIgnores); - _TabControlMain.Controls.Add(_TabPageAliases); - _TabControlMain.Controls.Add(_TabPageMacros); - _TabControlMain.Controls.Add(_TabPageVars); - _TabControlMain.Dock = DockStyle.Fill; - _TabControlMain.Location = new Point(0, 0); - _TabControlMain.Name = "TabControlMain"; - _TabControlMain.SelectedIndex = 0; - _TabControlMain.Size = new Size(665, 480); - _TabControlMain.TabIndex = 3; - // - // TabPageWindows - // - _TabPageWindows.Controls.Add(_TabControlWindows); - _TabPageWindows.Location = new Point(4, 22); - _TabPageWindows.Name = "TabPageWindows"; - _TabPageWindows.Size = new Size(657, 454); - _TabPageWindows.TabIndex = 8; - _TabPageWindows.Text = "Layout"; - _TabPageWindows.UseVisualStyleBackColor = true; - // - // TabControlWindows - // - _TabControlWindows.Controls.Add(_TabPage1); - _TabControlWindows.Controls.Add(_TabPage2); - _TabControlWindows.Dock = DockStyle.Fill; - _TabControlWindows.Location = new Point(0, 0); - _TabControlWindows.Name = "TabControlWindows"; - _TabControlWindows.SelectedIndex = 0; - _TabControlWindows.Size = new Size(657, 454); - _TabControlWindows.TabIndex = 1; - // - // TabPage1 - // - _TabPage1.Controls.Add(_UcWindows1); - _TabPage1.Location = new Point(4, 22); - _TabPage1.Name = "TabPage1"; - _TabPage1.Padding = new Padding(3); - _TabPage1.Size = new Size(649, 428); - _TabPage1.TabIndex = 0; - _TabPage1.Text = "Windows"; - _TabPage1.UseVisualStyleBackColor = true; - // - // UcWindows1 - // - _UcWindows1.Dock = DockStyle.Fill; - _UcWindows1.FormParent = null; - _UcWindows1.Location = new Point(3, 3); - _UcWindows1.Name = "UcWindows1"; - _UcWindows1.Size = new Size(643, 422); - _UcWindows1.TabIndex = 0; - // - // TabPage2 - // - _TabPage2.Controls.Add(_UcWindowSettings1); - _TabPage2.Location = new Point(4, 22); - _TabPage2.Name = "TabPage2"; - _TabPage2.Padding = new Padding(3); - _TabPage2.Size = new Size(649, 428); - _TabPage2.TabIndex = 1; - _TabPage2.Text = "Settings"; - _TabPage2.UseVisualStyleBackColor = true; - // - // UcWindowSettings1 - // - _UcWindowSettings1.Dock = DockStyle.Fill; - _UcWindowSettings1.FormParent = null; - _UcWindowSettings1.Location = new Point(3, 3); - _UcWindowSettings1.Name = "UcWindowSettings1"; - _UcWindowSettings1.Size = new Size(643, 422); - _UcWindowSettings1.TabIndex = 0; - // - // TabPageHighlights - // - _TabPageHighlights.Controls.Add(_TabControl2); - _TabPageHighlights.Location = new Point(4, 22); - _TabPageHighlights.Name = "TabPageHighlights"; - _TabPageHighlights.Padding = new Padding(3); - _TabPageHighlights.Size = new Size(657, 454); - _TabPageHighlights.TabIndex = 1; - _TabPageHighlights.Text = "Highlights"; - _TabPageHighlights.UseVisualStyleBackColor = true; - // - // TabControl2 - // - _TabControl2.Controls.Add(_TabPageString); - _TabControl2.Controls.Add(_TabPageNames); - _TabControl2.Controls.Add(_TabPagePreset); - _TabControl2.Dock = DockStyle.Fill; - _TabControl2.Location = new Point(3, 3); - _TabControl2.Name = "TabControl2"; - _TabControl2.SelectedIndex = 0; - _TabControl2.Size = new Size(651, 448); - _TabControl2.TabIndex = 0; - // - // TabPageString - // - _TabPageString.Controls.Add(_UcHighlightStrings1); - _TabPageString.Location = new Point(4, 22); - _TabPageString.Name = "TabPageString"; - _TabPageString.Size = new Size(643, 422); - _TabPageString.TabIndex = 4; - _TabPageString.Text = "Strings"; - _TabPageString.UseVisualStyleBackColor = true; - // - // UcHighlightStrings1 - // - _UcHighlightStrings1.Dock = DockStyle.Fill; - _UcHighlightStrings1.Globals = null; - _UcHighlightStrings1.HighlightLineBeginsWith = null; - _UcHighlightStrings1.HighlightList = null; - _UcHighlightStrings1.HighlightRegExp = null; - _UcHighlightStrings1.ItemChanged = false; - _UcHighlightStrings1.Location = new Point(0, 0); - _UcHighlightStrings1.Name = "UcHighlightStrings1"; - _UcHighlightStrings1.Size = new Size(643, 422); - _UcHighlightStrings1.TabIndex = 2; - // - // TabPageNames - // - _TabPageNames.Controls.Add(_UcName1); - _TabPageNames.Location = new Point(4, 22); - _TabPageNames.Name = "TabPageNames"; - _TabPageNames.Size = new Size(643, 422); - _TabPageNames.TabIndex = 2; - _TabPageNames.Text = "Names"; - _TabPageNames.UseVisualStyleBackColor = true; - // - // UcName1 - // - _UcName1.Dock = DockStyle.Fill; - _UcName1.Location = new Point(0, 0); - _UcName1.Name = "UcName1"; - _UcName1.NameList = null; - _UcName1.Size = new Size(643, 422); - _UcName1.TabIndex = 1; - // - // TabPagePreset - // - _TabPagePreset.Controls.Add(_UcPreset1); - _TabPagePreset.Location = new Point(4, 22); - _TabPagePreset.Name = "TabPagePreset"; - _TabPagePreset.Size = new Size(643, 422); - _TabPagePreset.TabIndex = 3; - _TabPagePreset.Text = "Presets"; - _TabPagePreset.UseVisualStyleBackColor = true; - // - // UcPreset1 - // - _UcPreset1.Dock = DockStyle.Fill; - _UcPreset1.FormParent = null; - _UcPreset1.Location = new Point(0, 0); - _UcPreset1.Name = "UcPreset1"; - _UcPreset1.PresetList = null; - _UcPreset1.Size = new Size(643, 422); - _UcPreset1.TabIndex = 3; - // - // TabPageTriggers - // - _TabPageTriggers.Controls.Add(_UcTriggers1); - _TabPageTriggers.Location = new Point(4, 22); - _TabPageTriggers.Name = "TabPageTriggers"; - _TabPageTriggers.Size = new Size(657, 454); - _TabPageTriggers.TabIndex = 6; - _TabPageTriggers.Text = "Triggers"; - _TabPageTriggers.UseVisualStyleBackColor = true; - // - // UcTriggers1 - // - _UcTriggers1.Dock = DockStyle.Fill; - _UcTriggers1.Location = new Point(0, 0); - _UcTriggers1.Name = "UcTriggers1"; - _UcTriggers1.Size = new Size(657, 454); - _UcTriggers1.TabIndex = 0; - _UcTriggers1.TriggerList = null; - // - // TabPageMacros - // - _TabPageMacros.Controls.Add(_UcMacros1); - _TabPageMacros.Location = new Point(4, 22); - _TabPageMacros.Name = "TabPageMacros"; - _TabPageMacros.Size = new Size(657, 454); - _TabPageMacros.TabIndex = 5; - _TabPageMacros.Text = "Macros"; - _TabPageMacros.UseVisualStyleBackColor = true; - // - // UcMacros1 - // - _UcMacros1.Dock = DockStyle.Fill; - _UcMacros1.Location = new Point(0, 0); - _UcMacros1.MacroList = null; - _UcMacros1.Name = "UcMacros1"; - _UcMacros1.Size = new Size(657, 454); - _UcMacros1.TabIndex = 0; - // - // TabPageAliases - // - _TabPageAliases.Controls.Add(_UcAliases1); - _TabPageAliases.Location = new Point(4, 22); - _TabPageAliases.Name = "TabPageAliases"; - _TabPageAliases.Size = new Size(657, 454); - _TabPageAliases.TabIndex = 4; - _TabPageAliases.Text = "Aliases"; - _TabPageAliases.UseVisualStyleBackColor = true; - // - // UcAliases1 - // - _UcAliases1.AliasList = null; - _UcAliases1.Dock = DockStyle.Fill; - _UcAliases1.Location = new Point(0, 0); - _UcAliases1.Name = "UcAliases1"; - _UcAliases1.Size = new Size(657, 454); - _UcAliases1.TabIndex = 0; - // - // TabPageSubs - // - _TabPageSubs.Controls.Add(_UcSubs1); - _TabPageSubs.Location = new Point(4, 22); - _TabPageSubs.Name = "TabPageSubs"; - _TabPageSubs.Size = new Size(657, 454); - _TabPageSubs.TabIndex = 2; - _TabPageSubs.Text = "Substitutes"; - _TabPageSubs.UseVisualStyleBackColor = true; - // - // UcSubs1 - // - _UcSubs1.Dock = DockStyle.Fill; - _UcSubs1.Location = new Point(0, 0); - _UcSubs1.Name = "UcSubs1"; - _UcSubs1.Size = new Size(657, 454); - _UcSubs1.SubstituteList = null; - _UcSubs1.TabIndex = 0; - // - // TabPageIgnores - // - _TabPageIgnores.Controls.Add(_UcIgnore1); - _TabPageIgnores.Location = new Point(4, 22); - _TabPageIgnores.Name = "TabPageIgnores"; - _TabPageIgnores.Size = new Size(657, 454); - _TabPageIgnores.TabIndex = 3; - _TabPageIgnores.Text = "Gags"; - _TabPageIgnores.UseVisualStyleBackColor = true; - // - // UcIgnore1 - // - _UcIgnore1.Dock = DockStyle.Fill; - _UcIgnore1.IgnoreList = null; - _UcIgnore1.Location = new Point(0, 0); - _UcIgnore1.Name = "UcIgnore1"; - _UcIgnore1.Size = new Size(657, 454); - _UcIgnore1.TabIndex = 1; - // - // TabPageVars - // - _TabPageVars.Controls.Add(_UcVariables1); - _TabPageVars.Location = new Point(4, 22); - _TabPageVars.Name = "TabPageVars"; - _TabPageVars.Size = new Size(657, 454); - _TabPageVars.TabIndex = 9; - _TabPageVars.Text = "Variables"; - _TabPageVars.UseVisualStyleBackColor = true; - // - // UcVariables1 - // - _UcVariables1.Dock = DockStyle.Fill; - _UcVariables1.Location = new Point(0, 0); - _UcVariables1.Name = "UcVariables1"; - _UcVariables1.Size = new Size(657, 454); - _UcVariables1.TabIndex = 0; - _UcVariables1.VariableList = null; - // - // TabPageVariables - // - _TabPageVariables.Location = new Point(4, 22); - _TabPageVariables.Name = "TabPageVariables"; - _TabPageVariables.Size = new Size(654, 378); - _TabPageVariables.TabIndex = 9; - _TabPageVariables.Text = "Variables"; - _TabPageVariables.UseVisualStyleBackColor = true; + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormConfig)); + this._TableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this._Cancel_Button = new System.Windows.Forms.Button(); + this._OK_Button = new System.Windows.Forms.Button(); + this._Panel1 = new System.Windows.Forms.Panel(); + this._TabControlMain = new System.Windows.Forms.TabControl(); + this._TabPageWindows = new System.Windows.Forms.TabPage(); + this._TabControlWindows = new System.Windows.Forms.TabControl(); + this._TabPage1 = new System.Windows.Forms.TabPage(); + this._UcWindows1 = new GenieClient.UCWindows(); + this._TabPage2 = new System.Windows.Forms.TabPage(); + this._UcWindowSettings1 = new GenieClient.UCWindowSettings(); + this._TabPageHighlights = new System.Windows.Forms.TabPage(); + this._TabControl2 = new System.Windows.Forms.TabControl(); + this._TabPageString = new System.Windows.Forms.TabPage(); + this._UcHighlightStrings1 = new GenieClient.UCHighlightStrings(); + this._TabPageNames = new System.Windows.Forms.TabPage(); + this._UcName1 = new GenieClient.UCName(); + this._TabPagePreset = new System.Windows.Forms.TabPage(); + this._UcPreset1 = new GenieClient.UCPreset(); + this._TabPageTriggers = new System.Windows.Forms.TabPage(); + this._UcTriggers1 = new GenieClient.UCTriggers(); + this._TabPageSubs = new System.Windows.Forms.TabPage(); + this._UcSubs1 = new GenieClient.UCSubs(); + this._TabPageIgnores = new System.Windows.Forms.TabPage(); + this._UcIgnore1 = new GenieClient.UCIgnore(); + this._TabPageAliases = new System.Windows.Forms.TabPage(); + this._UcAliases1 = new GenieClient.UCAliases(); + this._TabPageMacros = new System.Windows.Forms.TabPage(); + this._UcMacros1 = new GenieClient.UCMacros(); + this._TabPageVars = new System.Windows.Forms.TabPage(); + this._UcVariables1 = new GenieClient.UCVariables(); + this._TabPageVariables = new System.Windows.Forms.TabPage(); + this._TableLayoutPanel1.SuspendLayout(); + this._Panel1.SuspendLayout(); + this._TabControlMain.SuspendLayout(); + this._TabPageWindows.SuspendLayout(); + this._TabControlWindows.SuspendLayout(); + this._TabPage1.SuspendLayout(); + this._TabPage2.SuspendLayout(); + this._TabPageHighlights.SuspendLayout(); + this._TabControl2.SuspendLayout(); + this._TabPageString.SuspendLayout(); + this._TabPageNames.SuspendLayout(); + this._TabPagePreset.SuspendLayout(); + this._TabPageTriggers.SuspendLayout(); + this._TabPageSubs.SuspendLayout(); + this._TabPageIgnores.SuspendLayout(); + this._TabPageAliases.SuspendLayout(); + this._TabPageMacros.SuspendLayout(); + this._TabPageVars.SuspendLayout(); + this.SuspendLayout(); + // + // _TableLayoutPanel1 + // + this._TableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this._TableLayoutPanel1.ColumnCount = 2; + this._TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this._TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this._TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 23F)); + this._TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 23F)); + this._TableLayoutPanel1.Controls.Add(this._Cancel_Button, 0, 0); + this._TableLayoutPanel1.Controls.Add(this._OK_Button, 0, 0); + this._TableLayoutPanel1.Location = new System.Drawing.Point(593, 3); + this._TableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TableLayoutPanel1.Name = "_TableLayoutPanel1"; + this._TableLayoutPanel1.RowCount = 1; + this._TableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this._TableLayoutPanel1.Size = new System.Drawing.Size(180, 33); + this._TableLayoutPanel1.TabIndex = 1; + // + // _Cancel_Button + // + this._Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None; + this._Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this._Cancel_Button.Location = new System.Drawing.Point(96, 3); + this._Cancel_Button.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._Cancel_Button.Name = "_Cancel_Button"; + this._Cancel_Button.Size = new System.Drawing.Size(78, 27); + this._Cancel_Button.TabIndex = 1; + this._Cancel_Button.Text = "Cancel"; + this._Cancel_Button.Click += new System.EventHandler(this.Cancel_Button_Click); + // + // _OK_Button + // + this._OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None; + this._OK_Button.Location = new System.Drawing.Point(6, 3); + this._OK_Button.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._OK_Button.Name = "_OK_Button"; + this._OK_Button.Size = new System.Drawing.Size(78, 27); + this._OK_Button.TabIndex = 0; + this._OK_Button.Text = "OK"; + this._OK_Button.Click += new System.EventHandler(this.OK_Button_Click); + // + // _Panel1 + // + this._Panel1.Controls.Add(this._TableLayoutPanel1); + this._Panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this._Panel1.Location = new System.Drawing.Point(0, 554); + this._Panel1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._Panel1.Name = "_Panel1"; + this._Panel1.Size = new System.Drawing.Size(776, 40); + this._Panel1.TabIndex = 2; + // + // _TabControlMain + // + this._TabControlMain.Controls.Add(this._TabPageWindows); + this._TabControlMain.Controls.Add(this._TabPageHighlights); + this._TabControlMain.Controls.Add(this._TabPageTriggers); + this._TabControlMain.Controls.Add(this._TabPageSubs); + this._TabControlMain.Controls.Add(this._TabPageIgnores); + this._TabControlMain.Controls.Add(this._TabPageAliases); + this._TabControlMain.Controls.Add(this._TabPageMacros); + this._TabControlMain.Controls.Add(this._TabPageVars); + this._TabControlMain.Dock = System.Windows.Forms.DockStyle.Fill; + this._TabControlMain.Location = new System.Drawing.Point(0, 0); + this._TabControlMain.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabControlMain.Name = "_TabControlMain"; + this._TabControlMain.SelectedIndex = 0; + this._TabControlMain.Size = new System.Drawing.Size(776, 554); + this._TabControlMain.TabIndex = 3; + // + // _TabPageWindows + // + this._TabPageWindows.Controls.Add(this._TabControlWindows); + this._TabPageWindows.Location = new System.Drawing.Point(4, 24); + this._TabPageWindows.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageWindows.Name = "_TabPageWindows"; + this._TabPageWindows.Size = new System.Drawing.Size(768, 526); + this._TabPageWindows.TabIndex = 8; + this._TabPageWindows.Text = "Layout"; + this._TabPageWindows.UseVisualStyleBackColor = true; + // + // _TabControlWindows + // + this._TabControlWindows.Controls.Add(this._TabPage1); + this._TabControlWindows.Controls.Add(this._TabPage2); + this._TabControlWindows.Dock = System.Windows.Forms.DockStyle.Fill; + this._TabControlWindows.Location = new System.Drawing.Point(0, 0); + this._TabControlWindows.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabControlWindows.Name = "_TabControlWindows"; + this._TabControlWindows.SelectedIndex = 0; + this._TabControlWindows.Size = new System.Drawing.Size(768, 526); + this._TabControlWindows.TabIndex = 1; + // + // _TabPage1 + // + this._TabPage1.Controls.Add(this._UcWindows1); + this._TabPage1.Location = new System.Drawing.Point(4, 24); + this._TabPage1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPage1.Name = "_TabPage1"; + this._TabPage1.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPage1.Size = new System.Drawing.Size(760, 498); + this._TabPage1.TabIndex = 0; + this._TabPage1.Text = "Windows"; + this._TabPage1.UseVisualStyleBackColor = true; + // + // _UcWindows1 + // + this._UcWindows1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcWindows1.FormParent = null; + this._UcWindows1.Location = new System.Drawing.Point(4, 3); + this._UcWindows1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcWindows1.Name = "_UcWindows1"; + this._UcWindows1.Size = new System.Drawing.Size(752, 492); + this._UcWindows1.TabIndex = 0; + // + // _TabPage2 + // + this._TabPage2.Controls.Add(this._UcWindowSettings1); + this._TabPage2.Location = new System.Drawing.Point(4, 24); + this._TabPage2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPage2.Name = "_TabPage2"; + this._TabPage2.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPage2.Size = new System.Drawing.Size(758, 496); + this._TabPage2.TabIndex = 1; + this._TabPage2.Text = "Settings"; + this._TabPage2.UseVisualStyleBackColor = true; + // + // _UcWindowSettings1 + // + this._UcWindowSettings1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcWindowSettings1.FormParent = null; + this._UcWindowSettings1.Location = new System.Drawing.Point(4, 3); + this._UcWindowSettings1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcWindowSettings1.Name = "_UcWindowSettings1"; + this._UcWindowSettings1.Size = new System.Drawing.Size(750, 490); + this._UcWindowSettings1.TabIndex = 0; + // + // _TabPageHighlights + // + this._TabPageHighlights.Controls.Add(this._TabControl2); + this._TabPageHighlights.Location = new System.Drawing.Point(4, 24); + this._TabPageHighlights.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageHighlights.Name = "_TabPageHighlights"; + this._TabPageHighlights.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageHighlights.Size = new System.Drawing.Size(768, 526); + this._TabPageHighlights.TabIndex = 1; + this._TabPageHighlights.Text = "Highlights"; + this._TabPageHighlights.UseVisualStyleBackColor = true; + // + // _TabControl2 + // + this._TabControl2.Controls.Add(this._TabPageString); + this._TabControl2.Controls.Add(this._TabPageNames); + this._TabControl2.Controls.Add(this._TabPagePreset); + this._TabControl2.Dock = System.Windows.Forms.DockStyle.Fill; + this._TabControl2.Location = new System.Drawing.Point(4, 3); + this._TabControl2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabControl2.Name = "_TabControl2"; + this._TabControl2.SelectedIndex = 0; + this._TabControl2.Size = new System.Drawing.Size(760, 520); + this._TabControl2.TabIndex = 0; + // + // _TabPageString + // + this._TabPageString.Controls.Add(this._UcHighlightStrings1); + this._TabPageString.Location = new System.Drawing.Point(4, 24); + this._TabPageString.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageString.Name = "_TabPageString"; + this._TabPageString.Size = new System.Drawing.Size(752, 492); + this._TabPageString.TabIndex = 4; + this._TabPageString.Text = "Strings"; + this._TabPageString.UseVisualStyleBackColor = true; + // + // _UcHighlightStrings1 + // + this._UcHighlightStrings1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcHighlightStrings1.Globals = null; + this._UcHighlightStrings1.HighlightLineBeginsWith = null; + this._UcHighlightStrings1.HighlightList = null; + this._UcHighlightStrings1.HighlightRegExp = null; + this._UcHighlightStrings1.ItemChanged = false; + this._UcHighlightStrings1.Location = new System.Drawing.Point(0, 0); + this._UcHighlightStrings1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcHighlightStrings1.Name = "_UcHighlightStrings1"; + this._UcHighlightStrings1.Size = new System.Drawing.Size(750, 487); + this._UcHighlightStrings1.TabIndex = 2; + // + // _TabPageNames + // + this._TabPageNames.Controls.Add(this._UcName1); + this._TabPageNames.Location = new System.Drawing.Point(4, 24); + this._TabPageNames.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageNames.Name = "_TabPageNames"; + this._TabPageNames.Size = new System.Drawing.Size(752, 492); + this._TabPageNames.TabIndex = 2; + this._TabPageNames.Text = "Names"; + this._TabPageNames.UseVisualStyleBackColor = true; + // + // _UcName1 + // + this._UcName1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcName1.Location = new System.Drawing.Point(0, 0); + this._UcName1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcName1.Name = "_UcName1"; + this._UcName1.NameList = null; + this._UcName1.Size = new System.Drawing.Size(752, 492); + this._UcName1.TabIndex = 1; + // + // _TabPagePreset + // + this._TabPagePreset.Controls.Add(this._UcPreset1); + this._TabPagePreset.Location = new System.Drawing.Point(4, 24); + this._TabPagePreset.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPagePreset.Name = "_TabPagePreset"; + this._TabPagePreset.Size = new System.Drawing.Size(752, 492); + this._TabPagePreset.TabIndex = 3; + this._TabPagePreset.Text = "Presets"; + this._TabPagePreset.UseVisualStyleBackColor = true; + // + // _UcPreset1 + // + this._UcPreset1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcPreset1.FormParent = null; + this._UcPreset1.Location = new System.Drawing.Point(0, 0); + this._UcPreset1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcPreset1.Name = "_UcPreset1"; + this._UcPreset1.PresetList = null; + this._UcPreset1.Size = new System.Drawing.Size(752, 492); + this._UcPreset1.TabIndex = 3; + // + // _TabPageTriggers + // + this._TabPageTriggers.Controls.Add(this._UcTriggers1); + this._TabPageTriggers.Location = new System.Drawing.Point(4, 24); + this._TabPageTriggers.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageTriggers.Name = "_TabPageTriggers"; + this._TabPageTriggers.Size = new System.Drawing.Size(768, 526); + this._TabPageTriggers.TabIndex = 6; + this._TabPageTriggers.Text = "Triggers"; + this._TabPageTriggers.UseVisualStyleBackColor = true; + // + // _UcTriggers1 + // + this._UcTriggers1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcTriggers1.Globals = null; + this._UcTriggers1.Location = new System.Drawing.Point(0, 0); + this._UcTriggers1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcTriggers1.Name = "_UcTriggers1"; + this._UcTriggers1.Size = new System.Drawing.Size(766, 524); + this._UcTriggers1.TabIndex = 0; + this._UcTriggers1.TriggerList = null; + // + // _TabPageSubs + // + this._TabPageSubs.Controls.Add(this._UcSubs1); + this._TabPageSubs.Location = new System.Drawing.Point(4, 24); + this._TabPageSubs.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageSubs.Name = "_TabPageSubs"; + this._TabPageSubs.Size = new System.Drawing.Size(768, 526); + this._TabPageSubs.TabIndex = 2; + this._TabPageSubs.Text = "Substitutes"; + this._TabPageSubs.UseVisualStyleBackColor = true; + // + // _UcSubs1 + // + this._UcSubs1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcSubs1.Globals = null; + this._UcSubs1.Location = new System.Drawing.Point(0, 0); + this._UcSubs1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcSubs1.Name = "_UcSubs1"; + this._UcSubs1.Size = new System.Drawing.Size(766, 524); + this._UcSubs1.SubstituteList = null; + this._UcSubs1.TabIndex = 0; + // + // _TabPageIgnores + // + this._TabPageIgnores.Controls.Add(this._UcIgnore1); + this._TabPageIgnores.Location = new System.Drawing.Point(4, 24); + this._TabPageIgnores.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageIgnores.Name = "_TabPageIgnores"; + this._TabPageIgnores.Size = new System.Drawing.Size(768, 526); + this._TabPageIgnores.TabIndex = 3; + this._TabPageIgnores.Text = "Gags"; + this._TabPageIgnores.UseVisualStyleBackColor = true; + // + // _UcIgnore1 + // + this._UcIgnore1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcIgnore1.Globals = null; + this._UcIgnore1.IgnoreList = null; + this._UcIgnore1.Location = new System.Drawing.Point(0, 0); + this._UcIgnore1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcIgnore1.Name = "_UcIgnore1"; + this._UcIgnore1.Size = new System.Drawing.Size(766, 524); + this._UcIgnore1.TabIndex = 1; + // + // _TabPageAliases + // + this._TabPageAliases.Controls.Add(this._UcAliases1); + this._TabPageAliases.Location = new System.Drawing.Point(4, 24); + this._TabPageAliases.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageAliases.Name = "_TabPageAliases"; + this._TabPageAliases.Size = new System.Drawing.Size(768, 526); + this._TabPageAliases.TabIndex = 4; + this._TabPageAliases.Text = "Aliases"; + this._TabPageAliases.UseVisualStyleBackColor = true; + // + // _UcAliases1 + // + this._UcAliases1.AliasList = null; + this._UcAliases1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcAliases1.Location = new System.Drawing.Point(0, 0); + this._UcAliases1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcAliases1.Name = "_UcAliases1"; + this._UcAliases1.Size = new System.Drawing.Size(768, 526); + this._UcAliases1.TabIndex = 0; + // + // _TabPageMacros + // + this._TabPageMacros.Controls.Add(this._UcMacros1); + this._TabPageMacros.Location = new System.Drawing.Point(4, 24); + this._TabPageMacros.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageMacros.Name = "_TabPageMacros"; + this._TabPageMacros.Size = new System.Drawing.Size(768, 526); + this._TabPageMacros.TabIndex = 5; + this._TabPageMacros.Text = "Macros"; + this._TabPageMacros.UseVisualStyleBackColor = true; + // + // _UcMacros1 + // + this._UcMacros1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcMacros1.Location = new System.Drawing.Point(0, 0); + this._UcMacros1.MacroList = null; + this._UcMacros1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcMacros1.Name = "_UcMacros1"; + this._UcMacros1.Size = new System.Drawing.Size(768, 526); + this._UcMacros1.TabIndex = 0; + // + // _TabPageVars + // + this._TabPageVars.Controls.Add(this._UcVariables1); + this._TabPageVars.Location = new System.Drawing.Point(4, 24); + this._TabPageVars.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageVars.Name = "_TabPageVars"; + this._TabPageVars.Size = new System.Drawing.Size(768, 526); + this._TabPageVars.TabIndex = 9; + this._TabPageVars.Text = "Variables"; + this._TabPageVars.UseVisualStyleBackColor = true; + // + // _UcVariables1 + // + this._UcVariables1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcVariables1.Location = new System.Drawing.Point(0, 0); + this._UcVariables1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcVariables1.Name = "_UcVariables1"; + this._UcVariables1.Size = new System.Drawing.Size(768, 526); + this._UcVariables1.TabIndex = 0; + this._UcVariables1.VariableList = null; + // + // _TabPageVariables + // + this._TabPageVariables.Location = new System.Drawing.Point(4, 22); + this._TabPageVariables.Name = "_TabPageVariables"; + this._TabPageVariables.Size = new System.Drawing.Size(654, 378); + this._TabPageVariables.TabIndex = 9; + this._TabPageVariables.Text = "Variables"; + this._TabPageVariables.UseVisualStyleBackColor = true; // // FormConfig // - AutoScaleDimensions = new SizeF(6.0F, 13.0F); - AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(665, 515); - Controls.Add(_TabControlMain); - Controls.Add(_Panel1); - Icon = (Icon)resources.GetObject("$this.Icon"); - MaximizeBox = false; - MinimizeBox = false; - Name = "FormConfig"; - ShowInTaskbar = false; - StartPosition = FormStartPosition.CenterParent; - Text = "Configuration"; - TopMost = true; - _TableLayoutPanel1.ResumeLayout(false); - _Panel1.ResumeLayout(false); - _TabControlMain.ResumeLayout(false); - _TabPageWindows.ResumeLayout(false); - _TabControlWindows.ResumeLayout(false); - _TabPage1.ResumeLayout(false); - _TabPage2.ResumeLayout(false); - _TabPageHighlights.ResumeLayout(false); - _TabControl2.ResumeLayout(false); - _TabPageString.ResumeLayout(false); - _TabPageNames.ResumeLayout(false); - _TabPagePreset.ResumeLayout(false); - _TabPageTriggers.ResumeLayout(false); - _TabPageMacros.ResumeLayout(false); - _TabPageAliases.ResumeLayout(false); - _TabPageSubs.ResumeLayout(false); - _TabPageIgnores.ResumeLayout(false); - _TabPageVars.ResumeLayout(false); - Load += new EventHandler(FormConfig_Load); - ResumeLayout(false); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(776, 594); + this.Controls.Add(this._TabControlMain); + this.Controls.Add(this._Panel1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormConfig"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Configuration"; + this.TopMost = true; + this.Load += new System.EventHandler(this.FormConfig_Load); + this._TableLayoutPanel1.ResumeLayout(false); + this._Panel1.ResumeLayout(false); + this._TabControlMain.ResumeLayout(false); + this._TabPageWindows.ResumeLayout(false); + this._TabControlWindows.ResumeLayout(false); + this._TabPage1.ResumeLayout(false); + this._TabPage2.ResumeLayout(false); + this._TabPageHighlights.ResumeLayout(false); + this._TabControl2.ResumeLayout(false); + this._TabPageString.ResumeLayout(false); + this._TabPageNames.ResumeLayout(false); + this._TabPagePreset.ResumeLayout(false); + this._TabPageTriggers.ResumeLayout(false); + this._TabPageSubs.ResumeLayout(false); + this._TabPageIgnores.ResumeLayout(false); + this._TabPageAliases.ResumeLayout(false); + this._TabPageMacros.ResumeLayout(false); + this._TabPageVars.ResumeLayout(false); + this.ResumeLayout(false); + } private TableLayoutPanel _TableLayoutPanel1; diff --git a/Forms/FormConfig.resx b/Forms/FormConfig.resx index 529a5be..280798e 100644 --- a/Forms/FormConfig.resx +++ b/Forms/FormConfig.resx @@ -1,64 +1,4 @@ - - @@ -117,7 +57,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAABAAQAEBAAAAEACABoBQAARgAAABAQAAABACAAaAQAAK4FAAAgIAAAAQAIAKgIAAAWCgAAICAAAAEA diff --git a/Lists/Globals.cs b/Lists/Globals.cs index f8feaf3..c2eeece 100644 --- a/Lists/Globals.cs +++ b/Lists/Globals.cs @@ -310,19 +310,21 @@ public class Preset public Color FgColor; public Color BgColor; public string sColorName; + public bool bHighlightLine = false; public bool bSaveToFile = true; - public Preset(string sKey, Color oColor, Color oBgColor, string sColorName, string _bSaveToFile) + public Preset(string sKey, Color oColor, Color oBgColor, string sColorName, string _bSaveToFile, bool highlightLine) { this.sKey = sKey; FgColor = oColor; BgColor = oBgColor; this.sColorName = sColorName; bSaveToFile = Conversions.ToBoolean(_bSaveToFile); + bHighlightLine = highlightLine; } } - public void Add(string sKey, string sColorName, bool bSaveToFile = true) + public void Add(string sKey, string sColorName, bool bSaveToFile = true, bool highlightLine = false) { Color oColor; Color oBgcolor; @@ -340,7 +342,7 @@ public void Add(string sKey, string sColorName, bool bSaveToFile = true) } string arg_bSaveToFile = Conversions.ToString(bSaveToFile); - var oVar = new Preset(sKey, oColor, oBgcolor, sColorName, arg_bSaveToFile); + var oVar = new Preset(sKey, oColor, oBgcolor, sColorName, arg_bSaveToFile, highlightLine); if (base.ContainsKey(sKey.ToLower()) == true) { base[sKey.ToLower()] = oVar; @@ -430,9 +432,11 @@ private void LoadRow(string sText) var oArgs = Utility.ParseArgs(sText); if (oArgs.Count == 3) { - var arg1 = oArgs[1].ToString(); - var arg2 = oArgs[2].ToString(); - Add(arg1, arg2); + Add(oArgs[1].ToString(), oArgs[2].ToString()); + } + else if (oArgs.Count == 4) + { + Add(oArgs[1].ToString(), oArgs[2].ToString(), default, oArgs[3].ToString().ToLower() == "true"); } } @@ -445,11 +449,6 @@ public bool Save(string sFileName = "presets.cfg") sFileName = LocalDirectory.Path + @"\Config\" + sFileName; } - if (File.Exists(sFileName) == true) - { - Utility.DeleteFile(sFileName); - } - if (AcquireReaderLock()) { try @@ -459,7 +458,7 @@ public bool Save(string sFileName = "presets.cfg") { if (ov.bSaveToFile == true) { - oStreamWriter.WriteLine("#preset {" + ov.sKey + "} {" + ov.sColorName + "}"); + oStreamWriter.WriteLine("#preset {" + ov.sKey + "} {" + ov.sColorName + "} {" + ov.bHighlightLine + "}"); } } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0f1d0b8..d163643 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ // by using the '*' as shown below: // -[assembly: AssemblyVersion("4.0.2.302")] -[assembly: AssemblyFileVersion("4.0.2.302")] +[assembly: AssemblyVersion("4.0.2.310")] +[assembly: AssemblyFileVersion("4.0.2.310")] From 20f012575b353a4cf99e1c68facb539bd4c10a0e Mon Sep 17 00:00:00 2001 From: Djordje Date: Wed, 13 Apr 2022 01:25:49 -0400 Subject: [PATCH 12/50] Moved generation of NewLine --- Core/Game.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/Game.cs b/Core/Game.cs index 964134a..2d02be6 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -590,7 +590,7 @@ public void ParseGameRow(string sText) m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair(presetLabel, sTmp)); if(presetLabel == "roomdesc") { - PrintTextWithParse(sTmp + Environment.NewLine, bIsPrompt: false, oWindowTarget: 0); + PrintTextWithParse(sTmp, bIsPrompt: false, oWindowTarget: 0); sTmp = string.Empty; } } @@ -2622,6 +2622,7 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI { if (sText.StartsWith(" You also see")) { + PrintTextWithParse("\r\n", color, bgcolor); sText = sText.TrimStart(); } From 5111da70e9c90583f44076c7dc7c605b47dc24c4 Mon Sep 17 00:00:00 2001 From: Djordje Date: Thu, 14 Apr 2022 15:12:13 -0400 Subject: [PATCH 13/50] modified a check that was causing FormMain to be created a second time during Closing --- Forms/FormSkin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Forms/FormSkin.cs b/Forms/FormSkin.cs index ebe3986..0a28d66 100644 --- a/Forms/FormSkin.cs +++ b/Forms/FormSkin.cs @@ -722,7 +722,7 @@ public void Unload() protected override void OnClosing(CancelEventArgs e) { - if (Information.IsNothing(My.MyProject.Forms.FormMain)) + if (this.MdiParent == null) { return; } From daadfb9692cd22e646a88d30cc28fc545679f9a0 Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 14:02:27 -0400 Subject: [PATCH 14/50] Revert "Forced text buffer to process when popBold and pushBold are encountered" This reverts commit f9c8a5e7049ff6052b52e80ca71d2f2e604e971d. --- Core/Game.cs | 339 ++++++++++++++++++++++++++------------------------- 1 file changed, 172 insertions(+), 167 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 6067c31..169fc98 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -566,16 +566,21 @@ public void ParseGameRow(string sText) { m_oXMLBuffer.Append(oXMLBuffer); string buffer = m_oXMLBuffer.ToString(); - if (buffer == @"" || buffer == @"") //print before processing these ones + string sTmp = ProcessXML(buffer); + if (m_bBold) { - bCombatRow = (sTextBuffer.StartsWith("< ") | sTextBuffer.StartsWith("> ") | sTextBuffer.StartsWith("* ")); - bool argbIsPrompt = false; - WindowTarget argoWindowTarget = 0; - PrintTextWithParse(sTextBuffer, bIsPrompt: argbIsPrompt, oWindowTarget: argoWindowTarget); - sTextBuffer = string.Empty; - m_bBold = !m_bBold; + if (sTextBuffer.StartsWith("< ") | sTextBuffer.StartsWith("> ") | sTextBuffer.StartsWith("* ")) + { + m_bBold = false; + string argsText = sTextBuffer + System.Environment.NewLine; + bool argbIsPrompt = false; + WindowTarget argoWindowTarget = 0; + PrintTextWithParse(argsText, bIsPrompt: argbIsPrompt, oWindowTarget: argoWindowTarget); + m_bBold = true; + sTextBuffer = string.Empty; + bCombatRow = true; + } } - string sTmp = ProcessXML(buffer); sTextBuffer += sTmp; m_oXMLBuffer.Clear(); @@ -714,7 +719,7 @@ public void ParseGameRow(string sText) } } - + bool argbIsPrompt1 = false; WindowTarget argoWindowTarget1 = 0; PrintTextWithParse(sTextBuffer, bIsPrompt: argbIsPrompt1, oWindowTarget: argoWindowTarget1); @@ -948,202 +953,202 @@ private void ParseKeyRow(string sText) else { var oData = new ArrayList(); - foreach (string strLine in sText.Split(Conversions.ToChar(Constants.vbTab))) - oData.Add(strLine); - if (oData.Count > 0) + foreach (string strLine in sText.Split(Conversions.ToChar(Constants.vbTab))) + oData.Add(strLine); + if (oData.Count > 0) + { + var switchExpr = oData[0]; + switch (switchExpr) { - var switchExpr = oData[0]; - switch (switchExpr) - { - case "?": - { - string argtext = "Unable to get login key."; - PrintError(argtext); - m_oSocket.Disconnect(); - break; - } + case "?": + { + string argtext = "Unable to get login key."; + PrintError(argtext); + m_oSocket.Disconnect(); + break; + } - case "A": + case "A": + { + var switchExpr1 = oData[2]; + switch (switchExpr1) { - var switchExpr1 = oData[2]; - switch (switchExpr1) - { - case "KEY": - { - m_sLoginKey = Conversions.ToString(oData[3]); - m_sAccountOwner = Conversions.ToString(oData[4]); - m_oSocket.Send("G" + Constants.vbTab + m_sAccountGame.ToUpper() + System.Environment.NewLine); - break; - } - - case "NORECORD": - { - string argtext1 = "Account does not exist."; - PrintError(argtext1); - m_oSocket.Disconnect(); - break; - } + case "KEY": + { + m_sLoginKey = Conversions.ToString(oData[3]); + m_sAccountOwner = Conversions.ToString(oData[4]); + m_oSocket.Send("G" + Constants.vbTab + m_sAccountGame.ToUpper() + System.Environment.NewLine); + break; + } - case "PASSWORD": - { - string argtext2 = "Invalid password."; - PrintError(argtext2); - m_oSocket.Disconnect(); - break; - } + case "NORECORD": + { + string argtext1 = "Account does not exist."; + PrintError(argtext1); + m_oSocket.Disconnect(); + break; + } - case "REJECT": - { - string argtext3 = "Access rejected."; - PrintError(argtext3); - m_oSocket.Disconnect(); - break; - } - } + case "PASSWORD": + { + string argtext2 = "Invalid password."; + PrintError(argtext2); + m_oSocket.Disconnect(); + break; + } - break; + case "REJECT": + { + string argtext3 = "Access rejected."; + PrintError(argtext3); + m_oSocket.Disconnect(); + break; + } } - case "G": - { - m_oSocket.Send("C" + System.Environment.NewLine); - break; - } + break; + } - case "C": + case "G": + { + m_oSocket.Send("C" + System.Environment.NewLine); + break; + } + + case "C": + { + if (m_sAccountCharacter.Trim().Length == 0) { - if (m_sAccountCharacter.Trim().Length == 0) + string argtext4 = "Listing characters:"; + PrintError(argtext4); + string strUserKey = string.Empty; + // bool blnFoundMatch = false; + for (int i = 5, loopTo = oData.Count - 1; i <= loopTo; i++) { - string argtext4 = "Listing characters:"; - PrintError(argtext4); - string strUserKey = string.Empty; - // bool blnFoundMatch = false; - for (int i = 5, loopTo = oData.Count - 1; i <= loopTo; i++) + if (i % 2 == 0) { - if (i % 2 == 0) - { - _CharacterList.Clear(); - _CharacterList.Add(oData[i].ToString()); - var temp = oData[i].ToString(); - PrintError(temp); - } - else - { - strUserKey = Conversions.ToString(oData[i]); - } + _CharacterList.Clear(); + _CharacterList.Add(oData[i].ToString()); + var temp = oData[i].ToString(); + PrintError(temp); + } + else + { + strUserKey = Conversions.ToString(oData[i]); } - - m_oSocket.Disconnect(); } - else + + m_oSocket.Disconnect(); + } + else + { + string strUserKey = string.Empty; + string strUserKeyTemp = string.Empty; + bool blnFoundMatch = false; + bool bFoundBanned = false; + for (int i = 5, loopTo1 = oData.Count - 1; i <= loopTo1; i++) { - string strUserKey = string.Empty; - string strUserKeyTemp = string.Empty; - bool blnFoundMatch = false; - bool bFoundBanned = false; - for (int i = 5, loopTo1 = oData.Count - 1; i <= loopTo1; i++) - { - if (i % 2 == 0) + if (i % 2 == 0) + { + string sChar = oData[i].ToString(); + if (sChar.Contains(" ")) + sChar = sChar.Substring(0, sChar.IndexOf(' ')); + if (m_oBanned.ContainsKey(Utility.GenerateHashSHA256(sChar))) + bFoundBanned = true; + if (sChar.ToUpper().Equals(m_sAccountCharacter.ToUpper())) + { + blnFoundMatch = true; + strUserKey = strUserKeyTemp; + } + + if (blnFoundMatch == false) { - string sChar = oData[i].ToString(); - if (sChar.Contains(" ")) - sChar = sChar.Substring(0, sChar.IndexOf(' ')); - if (m_oBanned.ContainsKey(Utility.GenerateHashSHA256(sChar))) - bFoundBanned = true; - if (sChar.ToUpper().Equals(m_sAccountCharacter.ToUpper())) + if (sChar.ToUpper().StartsWith(m_sAccountCharacter.ToUpper())) { blnFoundMatch = true; strUserKey = strUserKeyTemp; } - - if (blnFoundMatch == false) - { - if (sChar.ToUpper().StartsWith(m_sAccountCharacter.ToUpper())) - { - blnFoundMatch = true; - strUserKey = strUserKeyTemp; - } - } - } - else - { - strUserKeyTemp = Conversions.ToString(oData[i]); } } - - if (bFoundBanned) + else { - m_oSocket.Disconnect(); - return; + strUserKeyTemp = Conversions.ToString(oData[i]); } + } - if (blnFoundMatch) - { - m_oSocket.Send("L" + Constants.vbTab + strUserKey + Constants.vbTab + "STORM" + Constants.vbLf); - } + if (bFoundBanned) + { + m_oSocket.Disconnect(); + return; + } - if (blnFoundMatch == false) - { - string argtext5 = "Character not found."; - PrintError(argtext5); - m_oSocket.Disconnect(); - } + if (blnFoundMatch) + { + m_oSocket.Send("L" + Constants.vbTab + strUserKey + Constants.vbTab + "STORM" + Constants.vbLf); } - break; - } - case "E": //Indicates an Error Message - { - string[] errorStrings = sText.Split("\t"); - for (int i = 1; i < errorStrings.Length; i++) + if (blnFoundMatch == false) { - PrintError(errorStrings[i]); + string argtext5 = "Character not found."; + PrintError(argtext5); + m_oSocket.Disconnect(); } - m_oSocket.Disconnect(); - break; } - case "L": + break; + } + case "E": //Indicates an Error Message + { + string[] errorStrings = sText.Split("\t"); + for(int i = 1;i < errorStrings.Length;i++) + { + PrintError(errorStrings[i]); + } + m_oSocket.Disconnect(); + break; + } + + case "L": + { + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(oData[1], "OK", false))) { - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(oData[1], "OK", false))) + foreach (string strRow in oData) { - foreach (string strRow in oData) + if (strRow.IndexOf("GAMEHOST=") > -1) { - if (strRow.IndexOf("GAMEHOST=") > -1) - { m_sConnectHost = IsLich ? m_oGlobals.Config.LichServer : strRow.Substring(9); } - else if (strRow.IndexOf("GAMEPORT=") > -1) - { + else if (strRow.IndexOf("GAMEPORT=") > -1) + { m_sConnectPort = IsLich ? m_oGlobals.Config.LichPort : int.Parse(strRow.Substring(9)); } - else if (strRow.IndexOf("KEY=") > -1) - { - m_sConnectKey = strRow.Substring(4).TrimEnd('\0'); - } - } - - if (m_sConnectKey.Length > 0) + else if (strRow.IndexOf("KEY=") > -1) { - m_oSocket.Disconnect(); - m_oConnectState = ConnectStates.ConnectingGameServer; - m_oSocket.Connect(m_sConnectHost, m_sConnectPort); + m_sConnectKey = strRow.Substring(4).TrimEnd('\0'); } } - else if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(oData[1], "PROBLEM", false))) + + if (m_sConnectKey.Length > 0) { - string argtext6 = "There is a problem with your account. Log in to play.net website for more information."; - PrintError(argtext6); m_oSocket.Disconnect(); + m_oConnectState = ConnectStates.ConnectingGameServer; + m_oSocket.Connect(m_sConnectHost, m_sConnectPort); } - - break; } - } + else if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(oData[1], "PROBLEM", false))) + { + string argtext6 = "There is a problem with your account. Log in to play.net website for more information."; + PrintError(argtext6); + m_oSocket.Disconnect(); + } + + break; + } } } } + } private bool m_bMonoOutput = false; private bool m_bPresetSpeechOutput = false; @@ -1994,7 +1999,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) } case "spelltime": { - if (m_oGlobals.VariableList["preparedspell"].ToString() == "None") + if(m_oGlobals.VariableList["preparedspell"].ToString() == "None") { if (m_oGlobals.VariableList.Contains("spellstarttime")) { @@ -2171,9 +2176,9 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) strBuffer += m_oGlobals.Config.sPrompt; bool argbIsPrompt = true; WindowTarget argoWindowTarget = 0; - - PrintTextWithParse(strBuffer, argbIsPrompt, oWindowTarget: argoWindowTarget); - + + PrintTextWithParse(strBuffer, argbIsPrompt, oWindowTarget: argoWindowTarget); + } string argkey44 = "prompt"; @@ -2416,7 +2421,7 @@ public void ResetIndicators() m_oIndicatorHash[Indicator.Webbed] = false; } - private Regex m_MonsterRegex = new Regex("([^<]*)([^,.]*)", MyRegexOptions.options); + private Regex m_MonsterRegex = new Regex("([^<]*)([^,.]*)", MyRegexOptions.options); private int CountMonsters(XmlNode oXmlNode) { @@ -2541,7 +2546,7 @@ private void DoConnect(string sHostName, int iPort) m_sEncryptionKey = string.Empty; m_oConnectState = ConnectStates.ConnectingKeyServer; m_oSocket.ConnectAndAuthenticate(sHostName, iPort); - + } private MatchCollection m_oMatchCollection; @@ -2554,7 +2559,7 @@ public void PrintTextWithParse(string sText, [Optional, DefaultParameterValue(fa public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bIsPrompt = false, WindowTarget oWindowTarget = WindowTarget.Unknown, bool bIsRoomOutput = false) { - + if (sText.Trim().Length > 0) { if (sText.Contains("You also see")) @@ -2918,7 +2923,7 @@ private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTa m_bLastRowWasPrompt = false; m_bLastRowWasBlank = false; } - + } if (targetwindow == WindowTarget.Main | targetwindow == WindowTarget.Thoughts | targetwindow == WindowTarget.Combat) @@ -3072,7 +3077,7 @@ private void GameSocket_EventConnected() m_oGlobals.VariableList.Add(argkey, argvalue, Globals.Variables.VariableType.Reserved); string argsVariable = "$connected"; VariableChanged(argsVariable); - m_bStatusPromptEnabled = false; + m_bStatusPromptEnabled = false; break; } } @@ -3105,10 +3110,10 @@ private string ParsePluginText(string sText, string sWindow) { if (m_oGlobals.PluginsEnabled == false) return sText; - + foreach (object oPlugin in m_oGlobals.PluginList) { - if (oPlugin is GeniePlugin.Interfaces.IPlugin) + if(oPlugin is GeniePlugin.Interfaces.IPlugin) { if ((oPlugin as GeniePlugin.Interfaces.IPlugin).Enabled) { @@ -3125,7 +3130,7 @@ private string ParsePluginText(string sText, string sWindow) } } } - else if (oPlugin is GeniePlugin.Plugins.IPlugin) + else if(oPlugin is GeniePlugin.Plugins.IPlugin) { if ((oPlugin as GeniePlugin.Plugins.IPlugin).Enabled) { From 3681ec41108242ea18109130b8e6f53aff599895 Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 18:09:31 -0400 Subject: [PATCH 15/50] added Volatile Highlights to handle presets and bolding. --- Core/Game.cs | 84 ++++++++++++------------ Forms/Components/ComponentRichTextBox.cs | 67 ++++++++++++------- Forms/FormMain.cs | 1 + Lists/Globals.cs | 1 + 4 files changed, 88 insertions(+), 65 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 169fc98..fa7b108 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -519,6 +519,7 @@ public void ParseGameRow(string sText) bool bInsideHTMLTag = false; string sHTMLBuffer = string.Empty; string sTextBuffer = string.Empty; + string sBoldBuffer = string.Empty; char cPreviousChar = Conversions.ToChar(""); bool bCombatRow = false; @@ -567,19 +568,31 @@ public void ParseGameRow(string sText) m_oXMLBuffer.Append(oXMLBuffer); string buffer = m_oXMLBuffer.ToString(); string sTmp = ProcessXML(buffer); - if (m_bBold) + if (buffer.EndsWith("")) { - if (sTextBuffer.StartsWith("< ") | sTextBuffer.StartsWith("> ") | sTextBuffer.StartsWith("* ")) + XmlDocument presetXML = new XmlDocument(); + presetXML.LoadXml(buffer); + + string presetLabel = GetAttributeData(presetXML.FirstChild, "id").ToLower(); + switch(presetLabel) { - m_bBold = false; - string argsText = sTextBuffer + System.Environment.NewLine; - bool argbIsPrompt = false; - WindowTarget argoWindowTarget = 0; - PrintTextWithParse(argsText, bIsPrompt: argbIsPrompt, oWindowTarget: argoWindowTarget); - m_bBold = true; - sTextBuffer = string.Empty; - bCombatRow = true; + case "whisper": + presetLabel = "whispers"; + break; + + case "thought": + presetLabel = "thoughts"; + break; + + default: + break; } + m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair(presetLabel, sTmp)); + } + if (buffer.EndsWith(@"")) + { + m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer)); + sBoldBuffer = string.Empty; } sTextBuffer += sTmp; @@ -604,6 +617,10 @@ public void ParseGameRow(string sText) else { sTextBuffer += Conversions.ToString(c); + if (m_bBold) + { + sBoldBuffer += c; + } } break; @@ -627,6 +644,10 @@ public void ParseGameRow(string sText) } else { + if (m_bBold) + { + sBoldBuffer += c; + } sTextBuffer += Utility.TranslateHTMLChar(sHTMLBuffer); } @@ -655,6 +676,10 @@ public void ParseGameRow(string sText) } else { + if (m_bBold) + { + sBoldBuffer += sHTMLBuffer; + } sTextBuffer += sHTMLBuffer; } @@ -668,6 +693,10 @@ public void ParseGameRow(string sText) } else { + if (m_bBold) + { + sBoldBuffer += c; + } sTextBuffer += Conversions.ToString(c); } @@ -723,6 +752,7 @@ public void ParseGameRow(string sText) bool argbIsPrompt1 = false; WindowTarget argoWindowTarget1 = 0; PrintTextWithParse(sTextBuffer, bIsPrompt: argbIsPrompt1, oWindowTarget: argoWindowTarget1); + if (bCombatRow == true) { m_bBold = false; @@ -2608,54 +2638,21 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI if (m_bPresetSpeechOutput == true) { - if (sText.Contains(", \"")) - { - color = m_oGlobals.PresetList["speech"].FgColor; - bgcolor = m_oGlobals.PresetList["speech"].BgColor; - - // Log Window - // If m_oTargetWindow = WindowTarget.Other Then - // PrintTextToWindow(sText, color, bgcolor, WindowTarget.Log) - // End If - } - m_bPresetSpeechOutput = false; } if (m_bPresetWhisperOutput == true) { - if (sText.Contains(", \"")) - { - color = m_oGlobals.PresetList["whispers"].FgColor; - bgcolor = m_oGlobals.PresetList["whispers"].BgColor; - - // Log Window - // If m_oTargetWindow = WindowTarget.Other Then - // PrintTextToWindow(sText, color, bgcolor, WindowTarget.Log) - // End If - } - m_bPresetWhisperOutput = false; } if (m_bPresetThoughtOutput == true) { - color = m_oGlobals.PresetList["thoughts"].FgColor; - bgcolor = m_oGlobals.PresetList["thoughts"].BgColor; - - // If m_oTargetWindow = WindowTarget.Main Then - // If sText.Contains(", """) Then - // Exit Sub - // End If - // End If - m_bPresetThoughtOutput = false; } if (m_bBold == true) { - color = m_oGlobals.PresetList["creatures"].FgColor; - bgcolor = m_oGlobals.PresetList["creatures"].BgColor; } // Line begins with @@ -2714,6 +2711,7 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI oWindowTarget = m_oTargetWindow; } PrintTextToWindow(sText, color, bgcolor, oWindowTarget, bIsPrompt, bIsRoomOutput); + } private Color m_oLastFgColor = default; diff --git a/Forms/Components/ComponentRichTextBox.cs b/Forms/Components/ComponentRichTextBox.cs index 4f13801..3d229ea 100644 --- a/Forms/Components/ComponentRichTextBox.cs +++ b/Forms/Components/ComponentRichTextBox.cs @@ -484,6 +484,51 @@ private void ParseHighlights() { MatchCollection oMatchCollection; + if (m_oRichTextBuffer.Text.Contains("You also see")) + { + if (!Information.IsNothing(m_oParentForm.Globals.MonsterListRegEx)) + { + oMatchCollection = (MatchCollection)m_oParentForm.Globals.MonsterListRegEx.Matches(m_oRichTextBuffer.Text); + foreach (Match oMatch in oMatchCollection) + { + m_oRichTextBuffer.SelectionStart = oMatch.Groups[1].Index; + m_oRichTextBuffer.SelectionLength = oMatch.Groups[1].Length; + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList["creatures"].FgColor, Color.Transparent, false)) + { + m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList["creatures"].FgColor; + } + + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList["creatures"].BgColor, Color.Transparent, false)) + { + m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList["creatures"].BgColor; + } + } + } + } + + // Presets and Bold + if (m_oParentForm.Globals.VolatileHighlights.Count > 0) + { + int volatilePosition = 0; + foreach (KeyValuePair highlight in m_oParentForm.Globals.VolatileHighlights.ToArray()) + { + if (m_oRichTextBuffer.Text.Substring(volatilePosition).Contains(highlight.Value)) + { + m_oRichTextBuffer.SelectionStart = m_oRichTextBuffer.Text.IndexOf(highlight.Value, volatilePosition); + m_oRichTextBuffer.SelectionLength = highlight.Value.Length; + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].FgColor, Color.Transparent, false)) + { + m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].FgColor; + } + + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].BgColor, Color.Transparent, false)) + { + m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].BgColor; + } + } + } + } + // Highlight String if (!Information.IsNothing(m_oParentForm.Globals.HighlightList.RegexString)) { @@ -556,28 +601,6 @@ private void ParseHighlights() } } } - - if (m_oRichTextBuffer.Text.Contains("You also see")) - { - if (!Information.IsNothing(m_oParentForm.Globals.MonsterListRegEx)) - { - oMatchCollection = (MatchCollection)m_oParentForm.Globals.MonsterListRegEx.Matches(m_oRichTextBuffer.Text); - foreach (Match oMatch in oMatchCollection) - { - m_oRichTextBuffer.SelectionStart = oMatch.Groups[1].Index; - m_oRichTextBuffer.SelectionLength = oMatch.Groups[1].Length; - if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList["creatures"].FgColor, Color.Transparent, false)) - { - m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList["creatures"].FgColor; - } - - if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList["creatures"].BgColor, Color.Transparent, false)) - { - m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList["creatures"].BgColor; - } - } - } - } } public FormSkin FormParent diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index 6e43cb8..ae553b3 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -4940,6 +4940,7 @@ private void EndUpdate() oFormSkin = (FormSkin)oEnumerator.Current; oFormSkin.RichTextBoxOutput.EndTextUpdate(); } + m_oGlobals.VolatileHighlights.Clear(); } private void Script_EventPrintError(string sText) diff --git a/Lists/Globals.cs b/Lists/Globals.cs index 79cd891..f8feaf3 100644 --- a/Lists/Globals.cs +++ b/Lists/Globals.cs @@ -114,6 +114,7 @@ public void Config_ConfigChanged(Config.ConfigFieldUpdated oField) } public List MonsterList = new List(); + public List> VolatileHighlights = new List>(); public Regex MonsterListRegEx; public void UpdateMonsterListRegEx() From e32e590f957450c7e44b72aa306af8501a843073 Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 18:21:51 -0400 Subject: [PATCH 16/50] restored combat row flagging on bold --- Core/Game.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Core/Game.cs b/Core/Game.cs index fa7b108..d059b24 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -594,6 +594,20 @@ public void ParseGameRow(string sText) m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer)); sBoldBuffer = string.Empty; } + if (m_bBold) + { + if (sTextBuffer.StartsWith("< ") | sTextBuffer.StartsWith("> ") | sTextBuffer.StartsWith("* ")) + { + m_bBold = false; + string argsText = sTextBuffer + System.Environment.NewLine; + bool argbIsPrompt = false; + WindowTarget argoWindowTarget = 0; + PrintTextWithParse(argsText, bIsPrompt: argbIsPrompt, oWindowTarget: argoWindowTarget); + m_bBold = true; + sTextBuffer = string.Empty; + bCombatRow = true; + } + } sTextBuffer += sTmp; m_oXMLBuffer.Clear(); From ab59afef349640bd27dae182bb2fbf872f24b225 Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 21:40:06 -0400 Subject: [PATCH 17/50] Tuning Bold Buffer --- Core/Game.cs | 11 ++++++++++- Forms/Components/ComponentRichTextBox.cs | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Core/Game.cs b/Core/Game.cs index d059b24..4c4c740 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -589,10 +589,13 @@ public void ParseGameRow(string sText) } m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair(presetLabel, sTmp)); } + if (buffer.EndsWith(@"")) + { + sBoldBuffer = string.Empty; + } if (buffer.EndsWith(@"")) { m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer)); - sBoldBuffer = string.Empty; } if (m_bBold) { @@ -739,10 +742,16 @@ public void ParseGameRow(string sText) if (sTextBuffer.Length > 0) { + if (bCombatRow == true) { m_bBold = true; } + else + { + m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer.Trim())); //trim because excessive whitespace seems to be breaking this + sBoldBuffer = string.Empty; + } // Fix for broke familiar XML if (m_bFamiliarLineParse) diff --git a/Forms/Components/ComponentRichTextBox.cs b/Forms/Components/ComponentRichTextBox.cs index 3d229ea..4b3e54d 100644 --- a/Forms/Components/ComponentRichTextBox.cs +++ b/Forms/Components/ComponentRichTextBox.cs @@ -525,6 +525,7 @@ private void ParseHighlights() { m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].BgColor; } + volatilePosition += highlight.Value.Length; } } } From 3b6fc8f3c0f1465b885aae2bebd0e275aa39f44b Mon Sep 17 00:00:00 2001 From: Djordje Date: Mon, 11 Apr 2022 23:23:12 -0400 Subject: [PATCH 18/50] restricted special parsing of "You also see" --- Core/Game.cs | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 4c4c740..d59fd33 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -588,6 +588,11 @@ public void ParseGameRow(string sText) break; } m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair(presetLabel, sTmp)); + if(presetLabel == "roomdesc") + { + PrintTextWithParse(sTmp + Environment.NewLine, bIsPrompt: false, oWindowTarget: 0); + sTmp = string.Empty; + } } if (buffer.EndsWith(@"")) { @@ -2615,17 +2620,9 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI if (sText.Trim().Length > 0) { - if (sText.Contains("You also see")) + if (sText.StartsWith(" You also see")) { - int I = sText.IndexOf("You also see"); - if (I > 0) - { - string argsText = sText.Substring(0, I).Trim() + System.Environment.NewLine; - bool argbIsPrompt = false; - WindowTarget argoWindowTarget = 0; - PrintTextWithParse(argsText, bIsPrompt: argbIsPrompt, oWindowTarget: argoWindowTarget); - sText = sText.Substring(I); - } + sText = sText.TrimStart(); } if (m_sStyle.Length > 0) @@ -2659,24 +2656,13 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI m_sStyle = string.Empty; } - if (m_bPresetSpeechOutput == true) - { - m_bPresetSpeechOutput = false; - } - - if (m_bPresetWhisperOutput == true) - { - m_bPresetWhisperOutput = false; - } + if (m_bPresetSpeechOutput) m_bPresetSpeechOutput = false; + if (m_bPresetWhisperOutput) m_bPresetWhisperOutput = false; + if (m_bPresetThoughtOutput) m_bPresetThoughtOutput = false; - if (m_bPresetThoughtOutput == true) - { - m_bPresetThoughtOutput = false; - } - - if (m_bBold == true) - { - } + //if (m_bBold == true) + //{ + //} // Line begins with if (m_oGlobals.HighlightBeginsWithList.AcquireReaderLock()) From 7d8e7d300cadd743918d94fdecc4aa099d9dccae Mon Sep 17 00:00:00 2001 From: Djordje Date: Wed, 13 Apr 2022 01:20:53 -0400 Subject: [PATCH 19/50] Added "Highlight Entire Line" setting for Presets --- Core/Game.cs | 2 +- Forms/Components/ComponentRichTextBox.cs | 17 +- Forms/ConfigPanels/UCPreset.Designer.cs | 423 ++++++----- Forms/ConfigPanels/UCPreset.cs | 12 +- Forms/ConfigPanels/UCPreset.resx | 143 ++-- Forms/FormConfig.designer.cs | 872 ++++++++++++----------- Forms/FormConfig.resx | 62 +- Lists/Globals.cs | 23 +- Properties/AssemblyInfo.cs | 4 +- 9 files changed, 801 insertions(+), 757 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index d59fd33..964134a 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -752,7 +752,7 @@ public void ParseGameRow(string sText) { m_bBold = true; } - else + else if (!string.IsNullOrWhiteSpace(sBoldBuffer)) { m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer.Trim())); //trim because excessive whitespace seems to be breaking this sBoldBuffer = string.Empty; diff --git a/Forms/Components/ComponentRichTextBox.cs b/Forms/Components/ComponentRichTextBox.cs index 4b3e54d..c256930 100644 --- a/Forms/Components/ComponentRichTextBox.cs +++ b/Forms/Components/ComponentRichTextBox.cs @@ -514,8 +514,21 @@ private void ParseHighlights() { if (m_oRichTextBuffer.Text.Substring(volatilePosition).Contains(highlight.Value)) { - m_oRichTextBuffer.SelectionStart = m_oRichTextBuffer.Text.IndexOf(highlight.Value, volatilePosition); - m_oRichTextBuffer.SelectionLength = highlight.Value.Length; + if(m_oParentForm.Globals.PresetList[highlight.Key].bHighlightLine) + { + int indexOfHighlight = m_oRichTextBuffer.Text.IndexOf(highlight.Value, volatilePosition); + int lastNewLineIndex = m_oRichTextBuffer.Text.LastIndexOf("\n", indexOfHighlight); + int nextNewLineIndex = m_oRichTextBuffer.Text.IndexOf("\n", indexOfHighlight); + if (lastNewLineIndex == -1) lastNewLineIndex = 0; + if (nextNewLineIndex == -1) nextNewLineIndex = m_oRichTextBuffer.Text.Length; + m_oRichTextBuffer.SelectionStart = lastNewLineIndex >= 0 ? lastNewLineIndex : 0; + m_oRichTextBuffer.SelectionLength = nextNewLineIndex - lastNewLineIndex; + } + else + { + m_oRichTextBuffer.SelectionStart = m_oRichTextBuffer.Text.IndexOf(highlight.Value, volatilePosition); + m_oRichTextBuffer.SelectionLength = highlight.Value.Length; + } if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].FgColor, Color.Transparent, false)) { m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].FgColor; diff --git a/Forms/ConfigPanels/UCPreset.Designer.cs b/Forms/ConfigPanels/UCPreset.Designer.cs index 8c40bf7..fd46ade 100644 --- a/Forms/ConfigPanels/UCPreset.Designer.cs +++ b/Forms/ConfigPanels/UCPreset.Designer.cs @@ -32,205 +32,235 @@ protected override void Dispose(bool disposing) [DebuggerStepThrough()] private void InitializeComponent() { - _ListViewBase = new ListView(); - _ListViewBase.KeyUp += new KeyEventHandler(ListViewBase_KeyUp); - _ListViewBase.MouseUp += new MouseEventHandler(ListViewBase_MouseUp); - _ListViewBase.SelectedIndexChanged += new EventHandler(ListViewBase_SelectedIndexChanged); - _GroupBoxBase = new GroupBox(); - _ButtonColorBg = new Button(); - _ButtonColorBg.Click += new EventHandler(ButtonColorBg_Click); - _LabelExampleColor = new Label(); - _ButtonColorFg = new Button(); - _ButtonColorFg.Click += new EventHandler(ButtonColorFg_Click); - _LabelColor = new Label(); - _TextBoxPreset = new TextBox(); - _TextBoxPreset.TextChanged += new EventHandler(TextBox_TextChanged); - _LabelAlias = new Label(); - _ButtonApply = new Button(); - _ButtonApply.Click += new EventHandler(ButtonApply_Click); - _TextBoxColor = new TextBox(); - _TextBoxColor.KeyDown += new KeyEventHandler(TextBoxColor_KeyDown); - _TextBoxColor.Leave += new EventHandler(TextBoxColor_Leave); - _TextBoxColor.TextChanged += new EventHandler(TextBox_TextChanged); - _ColorDialogPicker = new ColorDialog(); - _ToolStripMenu = new ToolStrip(); - _ToolStripButtonRefresh = new ToolStripButton(); - _ToolStripButtonRefresh.Click += new EventHandler(ToolStripButtonRefresh_Click); - _ToolStripSeparator2 = new ToolStripSeparator(); - _ToolStripButtonLoad = new ToolStripButton(); - _ToolStripButtonLoad.Click += new EventHandler(ToolStripButtonLoad_Click); - _ToolStripButtonSave = new ToolStripButton(); - _ToolStripButtonSave.Click += new EventHandler(ToolStripButtonSave_Click); - _GroupBoxBase.SuspendLayout(); - _ToolStripMenu.SuspendLayout(); - SuspendLayout(); - // - // ListViewBase - // - _ListViewBase.BackColor = Color.Black; - _ListViewBase.Dock = DockStyle.Fill; - _ListViewBase.ForeColor = Color.White; - _ListViewBase.FullRowSelect = true; - _ListViewBase.HideSelection = false; - _ListViewBase.Location = new Point(0, 25); - _ListViewBase.Name = "ListViewBase"; - _ListViewBase.ShowGroups = false; - _ListViewBase.Size = new Size(698, 312); - _ListViewBase.Sorting = SortOrder.Ascending; - _ListViewBase.TabIndex = 0; - _ListViewBase.UseCompatibleStateImageBehavior = false; - _ListViewBase.View = View.Details; - // - // GroupBoxBase - // - _GroupBoxBase.AutoSize = true; - _GroupBoxBase.Controls.Add(_ButtonColorBg); - _GroupBoxBase.Controls.Add(_LabelExampleColor); - _GroupBoxBase.Controls.Add(_ButtonColorFg); - _GroupBoxBase.Controls.Add(_LabelColor); - _GroupBoxBase.Controls.Add(_TextBoxPreset); - _GroupBoxBase.Controls.Add(_LabelAlias); - _GroupBoxBase.Controls.Add(_ButtonApply); - _GroupBoxBase.Controls.Add(_TextBoxColor); - _GroupBoxBase.Dock = DockStyle.Bottom; - _GroupBoxBase.Enabled = false; - _GroupBoxBase.Location = new Point(0, 337); - _GroupBoxBase.Name = "GroupBoxBase"; - _GroupBoxBase.Size = new Size(698, 109); - _GroupBoxBase.TabIndex = 2; - _GroupBoxBase.TabStop = false; - // - // ButtonColorBg - // - _ButtonColorBg.Image = My.Resources.Resources.preferences_desktop_locale; - _ButtonColorBg.Location = new Point(421, 31); - _ButtonColorBg.Name = "ButtonColorBg"; - _ButtonColorBg.Size = new Size(23, 23); - _ButtonColorBg.TabIndex = 12; - _ButtonColorBg.UseVisualStyleBackColor = true; - // - // LabelExampleColor - // - _LabelExampleColor.BackColor = Color.Black; - _LabelExampleColor.Font = new Font("Verdana", 9.0F, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0)); - _LabelExampleColor.ForeColor = Color.Black; - _LabelExampleColor.Location = new Point(322, 32); - _LabelExampleColor.Name = "LabelExampleColor"; - _LabelExampleColor.Size = new Size(64, 20); - _LabelExampleColor.TabIndex = 11; - _LabelExampleColor.Text = "Color"; - _LabelExampleColor.TextAlign = ContentAlignment.MiddleCenter; - // - // ButtonColorFg - // - _ButtonColorFg.Image = My.Resources.Resources.applications_graphics; - _ButtonColorFg.Location = new Point(392, 31); - _ButtonColorFg.Name = "ButtonColorFg"; - _ButtonColorFg.Size = new Size(23, 23); - _ButtonColorFg.TabIndex = 3; - _ButtonColorFg.UseVisualStyleBackColor = true; - // - // LabelColor - // - _LabelColor.AutoSize = true; - _LabelColor.Location = new Point(161, 16); - _LabelColor.Name = "LabelColor"; - _LabelColor.Size = new Size(31, 13); - _LabelColor.TabIndex = 10; - _LabelColor.Text = "Color"; - // - // TextBoxPreset - // - _TextBoxPreset.Location = new Point(6, 32); - _TextBoxPreset.Name = "TextBoxPreset"; - _TextBoxPreset.ReadOnly = true; - _TextBoxPreset.Size = new Size(152, 20); - _TextBoxPreset.TabIndex = 0; - // - // LabelAlias - // - _LabelAlias.AutoSize = true; - _LabelAlias.Location = new Point(3, 16); - _LabelAlias.Name = "LabelAlias"; - _LabelAlias.Size = new Size(37, 13); - _LabelAlias.TabIndex = 8; - _LabelAlias.Text = "Preset"; - // - // ButtonApply - // - _ButtonApply.Location = new Point(6, 67); - _ButtonApply.Name = "ButtonApply"; - _ButtonApply.Size = new Size(75, 23); - _ButtonApply.TabIndex = 2; - _ButtonApply.Text = "Apply"; - _ButtonApply.UseVisualStyleBackColor = true; - // - // TextBoxColor - // - _TextBoxColor.Location = new Point(164, 32); - _TextBoxColor.Name = "TextBoxColor"; - _TextBoxColor.Size = new Size(152, 20); - _TextBoxColor.TabIndex = 1; - // - // ColorDialogPicker - // - _ColorDialogPicker.FullOpen = true; - // - // ToolStripMenu - // - _ToolStripMenu.AllowMerge = false; - _ToolStripMenu.GripStyle = ToolStripGripStyle.Hidden; - _ToolStripMenu.Items.AddRange(new ToolStripItem[] { _ToolStripButtonRefresh, _ToolStripSeparator2, _ToolStripButtonLoad, _ToolStripButtonSave }); - _ToolStripMenu.Location = new Point(0, 0); - _ToolStripMenu.Name = "ToolStripMenu"; - _ToolStripMenu.Size = new Size(698, 25); - _ToolStripMenu.TabIndex = 6; - // - // ToolStripButtonRefresh - // - _ToolStripButtonRefresh.Image = My.Resources.Resources.view_refresh; - _ToolStripButtonRefresh.ImageTransparentColor = Color.Magenta; - _ToolStripButtonRefresh.Name = "ToolStripButtonRefresh"; - _ToolStripButtonRefresh.Size = new Size(65, 22); - _ToolStripButtonRefresh.Text = "Refresh"; - // - // ToolStripSeparator2 - // - _ToolStripSeparator2.Name = "ToolStripSeparator2"; - _ToolStripSeparator2.Size = new Size(6, 25); - // - // ToolStripButtonLoad - // - _ToolStripButtonLoad.Image = My.Resources.Resources.document_open; - _ToolStripButtonLoad.ImageTransparentColor = Color.Magenta; - _ToolStripButtonLoad.Name = "ToolStripButtonLoad"; - _ToolStripButtonLoad.Size = new Size(50, 22); - _ToolStripButtonLoad.Text = "Load"; - // - // ToolStripButtonSave - // - _ToolStripButtonSave.Image = My.Resources.Resources.document_save; - _ToolStripButtonSave.ImageTransparentColor = Color.Magenta; - _ToolStripButtonSave.Name = "ToolStripButtonSave"; - _ToolStripButtonSave.Size = new Size(51, 22); - _ToolStripButtonSave.Text = "Save"; + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UCPreset)); + this._ListViewBase = new System.Windows.Forms.ListView(); + this._GroupBoxBase = new System.Windows.Forms.GroupBox(); + this._ButtonColorBg = new System.Windows.Forms.Button(); + this._LabelExampleColor = new System.Windows.Forms.Label(); + this._ButtonColorFg = new System.Windows.Forms.Button(); + this._LabelColor = new System.Windows.Forms.Label(); + this._TextBoxPreset = new System.Windows.Forms.TextBox(); + this._LabelAlias = new System.Windows.Forms.Label(); + this._ButtonApply = new System.Windows.Forms.Button(); + this._TextBoxColor = new System.Windows.Forms.TextBox(); + this._ColorDialogPicker = new System.Windows.Forms.ColorDialog(); + this._ToolStripMenu = new System.Windows.Forms.ToolStrip(); + this._ToolStripButtonRefresh = new System.Windows.Forms.ToolStripButton(); + this._ToolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this._ToolStripButtonLoad = new System.Windows.Forms.ToolStripButton(); + this._ToolStripButtonSave = new System.Windows.Forms.ToolStripButton(); + this.chkHighlightLine = new System.Windows.Forms.CheckBox(); + this._GroupBoxBase.SuspendLayout(); + this._ToolStripMenu.SuspendLayout(); + this.SuspendLayout(); + // + // _ListViewBase + // + this._ListViewBase.BackColor = System.Drawing.Color.Black; + this._ListViewBase.Dock = System.Windows.Forms.DockStyle.Fill; + this._ListViewBase.ForeColor = System.Drawing.Color.White; + this._ListViewBase.FullRowSelect = true; + this._ListViewBase.Location = new System.Drawing.Point(0, 25); + this._ListViewBase.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._ListViewBase.Name = "_ListViewBase"; + this._ListViewBase.ShowGroups = false; + this._ListViewBase.Size = new System.Drawing.Size(814, 364); + this._ListViewBase.Sorting = System.Windows.Forms.SortOrder.Ascending; + this._ListViewBase.TabIndex = 0; + this._ListViewBase.UseCompatibleStateImageBehavior = false; + this._ListViewBase.View = System.Windows.Forms.View.Details; + this._ListViewBase.SelectedIndexChanged += new System.EventHandler(this.ListViewBase_SelectedIndexChanged); + this._ListViewBase.KeyUp += new System.Windows.Forms.KeyEventHandler(this.ListViewBase_KeyUp); + this._ListViewBase.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ListViewBase_MouseUp); + // + // _GroupBoxBase + // + this._GroupBoxBase.AutoSize = true; + this._GroupBoxBase.Controls.Add(this.chkHighlightLine); + this._GroupBoxBase.Controls.Add(this._ButtonColorBg); + this._GroupBoxBase.Controls.Add(this._LabelExampleColor); + this._GroupBoxBase.Controls.Add(this._ButtonColorFg); + this._GroupBoxBase.Controls.Add(this._LabelColor); + this._GroupBoxBase.Controls.Add(this._TextBoxPreset); + this._GroupBoxBase.Controls.Add(this._LabelAlias); + this._GroupBoxBase.Controls.Add(this._ButtonApply); + this._GroupBoxBase.Controls.Add(this._TextBoxColor); + this._GroupBoxBase.Dock = System.Windows.Forms.DockStyle.Bottom; + this._GroupBoxBase.Enabled = false; + this._GroupBoxBase.Location = new System.Drawing.Point(0, 389); + this._GroupBoxBase.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._GroupBoxBase.Name = "_GroupBoxBase"; + this._GroupBoxBase.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._GroupBoxBase.Size = new System.Drawing.Size(814, 126); + this._GroupBoxBase.TabIndex = 2; + this._GroupBoxBase.TabStop = false; + // + // _ButtonColorBg + // + this._ButtonColorBg.Image = ((System.Drawing.Image)(resources.GetObject("_ButtonColorBg.Image"))); + this._ButtonColorBg.Location = new System.Drawing.Point(491, 36); + this._ButtonColorBg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._ButtonColorBg.Name = "_ButtonColorBg"; + this._ButtonColorBg.Size = new System.Drawing.Size(27, 27); + this._ButtonColorBg.TabIndex = 12; + this._ButtonColorBg.UseVisualStyleBackColor = true; + this._ButtonColorBg.Click += new System.EventHandler(this.ButtonColorBg_Click); + // + // _LabelExampleColor + // + this._LabelExampleColor.BackColor = System.Drawing.Color.Black; + this._LabelExampleColor.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this._LabelExampleColor.ForeColor = System.Drawing.Color.Black; + this._LabelExampleColor.Location = new System.Drawing.Point(376, 37); + this._LabelExampleColor.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this._LabelExampleColor.Name = "_LabelExampleColor"; + this._LabelExampleColor.Size = new System.Drawing.Size(75, 23); + this._LabelExampleColor.TabIndex = 11; + this._LabelExampleColor.Text = "Color"; + this._LabelExampleColor.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // _ButtonColorFg + // + this._ButtonColorFg.Image = ((System.Drawing.Image)(resources.GetObject("_ButtonColorFg.Image"))); + this._ButtonColorFg.Location = new System.Drawing.Point(457, 36); + this._ButtonColorFg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._ButtonColorFg.Name = "_ButtonColorFg"; + this._ButtonColorFg.Size = new System.Drawing.Size(27, 27); + this._ButtonColorFg.TabIndex = 3; + this._ButtonColorFg.UseVisualStyleBackColor = true; + this._ButtonColorFg.Click += new System.EventHandler(this.ButtonColorFg_Click); + // + // _LabelColor + // + this._LabelColor.AutoSize = true; + this._LabelColor.Location = new System.Drawing.Point(188, 18); + this._LabelColor.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this._LabelColor.Name = "_LabelColor"; + this._LabelColor.Size = new System.Drawing.Size(36, 15); + this._LabelColor.TabIndex = 10; + this._LabelColor.Text = "Color"; + // + // _TextBoxPreset + // + this._TextBoxPreset.Location = new System.Drawing.Point(7, 37); + this._TextBoxPreset.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TextBoxPreset.Name = "_TextBoxPreset"; + this._TextBoxPreset.ReadOnly = true; + this._TextBoxPreset.Size = new System.Drawing.Size(177, 23); + this._TextBoxPreset.TabIndex = 0; + this._TextBoxPreset.TextChanged += new System.EventHandler(this.TextBox_TextChanged); + // + // _LabelAlias + // + this._LabelAlias.AutoSize = true; + this._LabelAlias.Location = new System.Drawing.Point(4, 18); + this._LabelAlias.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this._LabelAlias.Name = "_LabelAlias"; + this._LabelAlias.Size = new System.Drawing.Size(39, 15); + this._LabelAlias.TabIndex = 8; + this._LabelAlias.Text = "Preset"; + // + // _ButtonApply + // + this._ButtonApply.Location = new System.Drawing.Point(7, 77); + this._ButtonApply.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._ButtonApply.Name = "_ButtonApply"; + this._ButtonApply.Size = new System.Drawing.Size(88, 27); + this._ButtonApply.TabIndex = 2; + this._ButtonApply.Text = "Apply"; + this._ButtonApply.UseVisualStyleBackColor = true; + this._ButtonApply.Click += new System.EventHandler(this.ButtonApply_Click); + // + // _TextBoxColor + // + this._TextBoxColor.Location = new System.Drawing.Point(191, 37); + this._TextBoxColor.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TextBoxColor.Name = "_TextBoxColor"; + this._TextBoxColor.Size = new System.Drawing.Size(177, 23); + this._TextBoxColor.TabIndex = 1; + this._TextBoxColor.TextChanged += new System.EventHandler(this.TextBox_TextChanged); + this._TextBoxColor.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxColor_KeyDown); + this._TextBoxColor.Leave += new System.EventHandler(this.TextBoxColor_Leave); + // + // _ColorDialogPicker + // + this._ColorDialogPicker.FullOpen = true; + // + // _ToolStripMenu + // + this._ToolStripMenu.AllowMerge = false; + this._ToolStripMenu.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this._ToolStripMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this._ToolStripButtonRefresh, + this._ToolStripSeparator2, + this._ToolStripButtonLoad, + this._ToolStripButtonSave}); + this._ToolStripMenu.Location = new System.Drawing.Point(0, 0); + this._ToolStripMenu.Name = "_ToolStripMenu"; + this._ToolStripMenu.Size = new System.Drawing.Size(814, 25); + this._ToolStripMenu.TabIndex = 6; + // + // _ToolStripButtonRefresh + // + this._ToolStripButtonRefresh.Image = ((System.Drawing.Image)(resources.GetObject("_ToolStripButtonRefresh.Image"))); + this._ToolStripButtonRefresh.ImageTransparentColor = System.Drawing.Color.Magenta; + this._ToolStripButtonRefresh.Name = "_ToolStripButtonRefresh"; + this._ToolStripButtonRefresh.Size = new System.Drawing.Size(66, 22); + this._ToolStripButtonRefresh.Text = "Refresh"; + this._ToolStripButtonRefresh.Click += new System.EventHandler(this.ToolStripButtonRefresh_Click); + // + // _ToolStripSeparator2 + // + this._ToolStripSeparator2.Name = "_ToolStripSeparator2"; + this._ToolStripSeparator2.Size = new System.Drawing.Size(6, 25); + // + // _ToolStripButtonLoad + // + this._ToolStripButtonLoad.Image = ((System.Drawing.Image)(resources.GetObject("_ToolStripButtonLoad.Image"))); + this._ToolStripButtonLoad.ImageTransparentColor = System.Drawing.Color.Magenta; + this._ToolStripButtonLoad.Name = "_ToolStripButtonLoad"; + this._ToolStripButtonLoad.Size = new System.Drawing.Size(53, 22); + this._ToolStripButtonLoad.Text = "Load"; + this._ToolStripButtonLoad.Click += new System.EventHandler(this.ToolStripButtonLoad_Click); + // + // _ToolStripButtonSave + // + this._ToolStripButtonSave.Image = ((System.Drawing.Image)(resources.GetObject("_ToolStripButtonSave.Image"))); + this._ToolStripButtonSave.ImageTransparentColor = System.Drawing.Color.Magenta; + this._ToolStripButtonSave.Name = "_ToolStripButtonSave"; + this._ToolStripButtonSave.Size = new System.Drawing.Size(51, 22); + this._ToolStripButtonSave.Text = "Save"; + this._ToolStripButtonSave.Click += new System.EventHandler(this.ToolStripButtonSave_Click); + // + // chkHighlightLine + // + this.chkHighlightLine.AutoSize = true; + this.chkHighlightLine.Location = new System.Drawing.Point(191, 66); + this.chkHighlightLine.Name = "chkHighlightLine"; + this.chkHighlightLine.Size = new System.Drawing.Size(134, 19); + this.chkHighlightLine.TabIndex = 13; + this.chkHighlightLine.Text = "Highlight Entire Line"; + this.chkHighlightLine.UseVisualStyleBackColor = true; + this.chkHighlightLine.CheckedChanged += new System.EventHandler(this.chkHighlightLine_CheckedChanged); // // UCPreset // - AutoScaleDimensions = new SizeF(6.0F, 13.0F); - AutoScaleMode = AutoScaleMode.Font; - Controls.Add(_ListViewBase); - Controls.Add(_GroupBoxBase); - Controls.Add(_ToolStripMenu); - Name = "UCPreset"; - Size = new Size(698, 446); - _GroupBoxBase.ResumeLayout(false); - _GroupBoxBase.PerformLayout(); - _ToolStripMenu.ResumeLayout(false); - _ToolStripMenu.PerformLayout(); - Load += new EventHandler(UCWindows_Load); - ResumeLayout(false); - PerformLayout(); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this._ListViewBase); + this.Controls.Add(this._GroupBoxBase); + this.Controls.Add(this._ToolStripMenu); + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.Name = "UCPreset"; + this.Size = new System.Drawing.Size(814, 515); + this.Load += new System.EventHandler(this.UCWindows_Load); + this._GroupBoxBase.ResumeLayout(false); + this._GroupBoxBase.PerformLayout(); + this._ToolStripMenu.ResumeLayout(false); + this._ToolStripMenu.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + } private ListView _ListViewBase; @@ -618,6 +648,7 @@ internal ToolStripButton ToolStripButtonLoad } private ToolStripButton _ToolStripButtonSave; + private CheckBox chkHighlightLine; internal ToolStripButton ToolStripButtonSave { diff --git a/Forms/ConfigPanels/UCPreset.cs b/Forms/ConfigPanels/UCPreset.cs index e91df75..2c2f63a 100644 --- a/Forms/ConfigPanels/UCPreset.cs +++ b/Forms/ConfigPanels/UCPreset.cs @@ -161,6 +161,7 @@ private void PopulateList() li.Tag = de.Key.ToString(); Genie.Globals.Presets.Preset oPreset = (Genie.Globals.Presets.Preset)de.Value; li.SubItems.Add(oPreset.sColorName); + li.SubItems.Add(oPreset.bHighlightLine.ToString()); li.ForeColor = oPreset.FgColor; // MsgBox(li.BackColor.ToString) if (oPreset.BgColor != Color.Transparent) @@ -238,8 +239,10 @@ private void UpdateGroupBox() TextBoxPreset.Enabled = true; TextBoxPreset.Text = ListViewBase.SelectedItems[0].Text; TextBoxColor.Enabled = true; + chkHighlightLine.Enabled = true; TextBoxColor.Text = ListViewBase.SelectedItems[0].SubItems[1].Text; TextBoxColor.Tag = ListViewBase.SelectedItems[0].SubItems[1].Text; + chkHighlightLine.Checked = ListViewBase.SelectedItems[0].SubItems[2].Text.ToLower() == "true"; GroupBoxBase.Enabled = true; GroupBoxBase.Tag = new ArrayList(ListViewBase.SelectedItems); LabelExampleColor.ForeColor = ListViewBase.SelectedItems[0].ForeColor; @@ -252,6 +255,7 @@ private void UpdateGroupBox() TextBoxColor.Enabled = true; GroupBoxBase.Enabled = true; GroupBoxBase.Tag = new ArrayList(ListViewBase.SelectedItems); + chkHighlightLine.Enabled = true; } else { @@ -320,11 +324,12 @@ public bool ApplyChanges() li.SubItems[1].Text = TextBoxColor.Text; li.ForeColor = LabelExampleColor.ForeColor; li.BackColor = LabelExampleColor.BackColor; + li.SubItems[2].Text = chkHighlightLine.Checked.ToString(); } string argsKey = li.Text; string argsColorName = TextBoxColor.Text; - m_PresetList.Add(argsKey, argsColorName); + m_PresetList.Add(argsKey, argsColorName, true, li.SubItems[2].Text.ToLower() == "true"); m_FormMain.SafePresetChanged(li.Text.ToLower()); li.Tag = li.Text; } @@ -378,5 +383,10 @@ public bool SaveToFile() { return m_PresetList.Save(); } + + private void chkHighlightLine_CheckedChanged(object sender, EventArgs e) + { + m_ItemChanged = true; + } } } \ No newline at end of file diff --git a/Forms/ConfigPanels/UCPreset.resx b/Forms/ConfigPanels/UCPreset.resx index 03398b9..709d377 100644 --- a/Forms/ConfigPanels/UCPreset.resx +++ b/Forms/ConfigPanels/UCPreset.resx @@ -1,64 +1,4 @@ - - @@ -117,10 +57,85 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 140, 17 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADdYAAA3WAZBveZwAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwa + AAABFUlEQVQ4T2OIMU37BcT/ScFAwADDIAN+r5+6+f/hNcf+X9h3+f+5Axf/H9998v/y6av+txS2/y+M + KP2f6pr1P9+75H9FUB1uA2aXLfy/tHH1//7cqf8ro+r+J7tn/A8yD/sfbZcwlAzwm8VGKv6FYkDAbI7/ + y55n/N/wpvj/3o+d/4++m/P/3Nv1/5feKvxfdlDvf9Z+if9FJ+X+V11S+d9wUwNkwG9MA56l/Z/0zO7/ + zFce/3vuWf9vuKT/v/iY0v+0XaI0NgCUDsg1AJ4SyTIAOUoGjwGTnzn8n/XK63/vPbv/TZeM/5ccUyHO + AP9Z7GAD1r8p+r/nY/v/w29n/j/9ZtX/JbcKcKcDZAOAAiBBEjDbLwA9sG7FUXBgxgAAAABJRU5ErkJg + gg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAB70lEQVQ4T2P4//8/RRirIC6c + Z8vOjy6GwsGHs63ZjWZFihXdqJfWe1AjxAgTx1CIDadbsju3+4uceDDNfd6Tdvmkx3XC5kBDBEByWDUg + 4/qK7OiG4ri/K9pTfjycYHn8RZPY1BcdSgXnigX9u3251LFqQsY9vR1XVqxc9n/lyqX/u7ua/59tt7r5 + cpr1+smhfPOBLpPDqgmG23vaTXv7uz69f//+/5s3b/6v37Duf2dn8/+FuUbviuw5WkBqsGqE4e7ejjW7 + 9+z6+/v37/+nTp36v3z58v8LF83/195U8TvTQVgEpAarRhBubW0V7+xu+/7x48f/z549+7958+b/y1cs + +w809EtLW70dTB2GRhju6Gpr3Lpt8w+Q7QcOHPg/f8E8sOa27jZLZHUomsACDAysUlJSbU5Ojj9j42L/ + b9y48f/8+WDNnzs7W8ww1KNwGBg4hYWFt2ZkZPxvamr6b29v/19RUfF/Tl7WV6BmE2S1cD0oHAaGFRIS + Ev97e3v/r169+r+3t/d/dXX1/+LiYnOR1SFjBIOBoQyI//Py8v7X1dX97+Dg8N/Y2Pi/pKQkSDIFWRMy + hhAMDO5A/AdkAAhzc3P/FxMT+y8oKAjivwFiMXSNMAwC0UD8HYjBmqH4ORAfBeLpQCyOTSME/2cAAJFL + g2TavqCTAAAAAElFTkSuQmCC + + + + 17, 17 - - 278, 17 + + 171, 17 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAMYSURBVDhPbVNpSBRhGJ6ioLugPxX1q/5kUOherhgSUT/K + Ssof0YGSO7NHShblEdFGmEiUCgppKerOseuRR8iWZW6K5ZFaupZbHoln64W1jubqztv3fU5R0QMvzMx7 + zPM+3/NRf0IZad2hNQh5WqPQp2K42UCDdTjIKFQracspBZO9Ui4jUNJc4r6IvE3yK0WpGUuYRs/PGtIc + 3rRyJ9jqvoCttg8yKjohIvnZjEbPTStp/jSuVTI8gwaAginaSJr9owp2a428eO+xE3Jf9kBBTS9Uvh0G + h9MNLb1T8GFgGhwdo3AkrlRU67lXB2OL55QMu6iOYTeQAVqj9ZEh3eG7kvUagi/aANEHrUlYPH/H7sl/ + 7pJcQ9+ge+Q79H71QIq11dfoGoMgkzAfdCFnPRmAqHsOxBZDcLRNQglRqWOvBdDsVkWU5ZDGwLdGplSJ + rd3jMDAuwsjULIkgk9W795xlLRmgolkJCbegT2/IRcNGAmjrTpKQodJxkZhVQ5cb3rjGYXBCxAy8SNg1 + pEBBs4uhiU9uxj18tycs+cVmymxeThIIIWbHCo1BqE8tee8dRX/Gq2AGSLOFwMuFq0nR713+A6WOy8eK + H75a8iM0rmyORHzZHP4WEpG3aqmIZudRSCR0nA8zUujYBfRchb2hMuVt+TfUOnY7acbADcOTIgxPzsIQ + 2i/n6UefWi/0/2UUGWaha9ulrFYt7vEzFa0jH/GZ4r3qu8ah6dMYyGxMJCkDK46M5I7ObLx/0myvWzKS + 7E4Nw/vwAKzuEGJS2zECxxLKRHSEzYooXo1r8MBgk23yxA07PgEJ5bykGSNQL/iwWTIrnFK/e4YYpqVn + ElJL2qWj8WUi+tsCOmasvLQ/phBCE8qx0WxyOzYSJ51Jss8hm3Yev14+U9k8CE2fJ6C6fRTKmwYhv6YP + Uoo74DbfBqmlTgg08MjSrJ/cjulx2L4Z+BmpH65mhKnwW5WeJKENHthdkF3VDXdLnBCTUbeIL5xKx58l + jb+AmiwUBcvkVwqLg68wolmjMQpuFc150d5DKIr8oyy75DIEivoJX23jWSsK7A4AAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFwSURBVDhPpZHNSwJBHIb3j+rspf6CzEzENrHNb7MOEhFE + hKDVJcivVRNCNpbK6tKhoCTIMtYxpHIhiqBL0DXPbztTKqal4g8ehp1559kXhhsbH132zrrxG7tTYEzZ + Ju3cf0PDhJCOFApXsAlWGAx600+8fVweB/L5C0RjEYaYimNXznYlkthcZQJas1gsQpIkBj3sZWiOCaw2 + vqVBXVCrff4JnYbAwps7NqBBRblto6NgoAYms7GnBqpa7SwwGPWsgXVRxJCQ7YthdxpMQBvQjYL6gfPK + e0/QLL3TaEA/ctdv2DhWuxLOPUK6fG0K6g0ONMH6UZWF6Lp2WEVICwf3H7Ai32NJqiCwc4f5TBmps+fW + BhOBJJLapn+bwJ8uw5cm8KUIvBqeJIE7WYJLJHAmSnBobJ08NQXynoyw9jcacos0WPoOxkuYiSsQtFWI + KZiOKrBFFIinL9DPRTFiWchwOj6Up6Z+0fHBG/aMgw3HfQGp9opU165TRwAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIvSURBVDhPnZNbaxNBGIbzP/whFlSk4o0iguBFbyzohRG3 + OVlLD9iam3hqaTHQUltwvTJNG0zBkBKNRHOAJEs2m9gEi1mDSVpoczAniIlJXnfGuuk26oUfPDvDN+88 + zOyyqhHT+L1Lk09nTqrndAPqJ3MD6tltCZy+9fj7Bb1xd2hiyqT6Vw3qzMPXF9/MGG3CtU1+LyKkvyHw + uYBVbxrq2Redc5pHHfXU8InDeH8x9x8u3TSM4oZ+DBc1JgzeXcH5CRbPPTv4sJPHlQd2XL49Da2e6UOj + Y4wqxqBFZk8EKfFrEqGkCO0zJ8g1NrgMzFsfcXV6FYn0Ls38rnq9TiWqO2MMOp0OSqUSisUi0pkvGF/e + pIJJSxgLr3mcYeZhc/ukdSlDcqUiavXaLwF5tH+0kS8U6KajEMGQ+V1fvyBla7Ujglarhf39A4SjfhpY + 9qRgYD0yo+x7LL39RNcWrXYcSNlqtdoTNJtNKsnlcghwHllCNhI2gmnaM7+00Qy5f6VSUQrIOzgusXFZ + KjrFLMibSYZkFYJGo4FsNitLCPx2EGdH5qlo5ZWD9trtNs2QbLlc7gm63e7hx/lzkSMT8vk8pU/A8zxC + oZCCQCCgmB8nmUwqBaTJsizsdjvcbjf8fj+CwSAEQYDVakU8HpdHl8uFcDjcE0QiEfh8PqyvW+FwOOD1 + emUBx3FYs6whFotJo4WOW06nUiCKIlKplEwikaBEo9G/IgvID0Em/4NGxxh/Avz02lw1GIbVAAAAAElF + TkSuQmCC + + \ No newline at end of file diff --git a/Forms/FormConfig.designer.cs b/Forms/FormConfig.designer.cs index fb168a3..786e1ae 100644 --- a/Forms/FormConfig.designer.cs +++ b/Forms/FormConfig.designer.cs @@ -34,427 +34,463 @@ protected override void Dispose(bool disposing) [DebuggerStepThrough()] private void InitializeComponent() { - var resources = new System.ComponentModel.ComponentResourceManager(typeof(FormConfig)); - _TableLayoutPanel1 = new TableLayoutPanel(); - _Cancel_Button = new Button(); - _Cancel_Button.Click += new EventHandler(Cancel_Button_Click); - _OK_Button = new Button(); - _OK_Button.Click += new EventHandler(OK_Button_Click); - _Panel1 = new Panel(); - _TabControlMain = new TabControl(); - _TabPageWindows = new TabPage(); - _TabControlWindows = new TabControl(); - _TabPage1 = new TabPage(); - _UcWindows1 = new UCWindows(); - _TabPage2 = new TabPage(); - _UcWindowSettings1 = new UCWindowSettings(); - _TabPageHighlights = new TabPage(); - _TabControl2 = new TabControl(); - _TabPageString = new TabPage(); - _UcHighlightStrings1 = new UCHighlightStrings(); - _TabPageNames = new TabPage(); - _UcName1 = new UCName(); - _TabPagePreset = new TabPage(); - _UcPreset1 = new UCPreset(); - _TabPageTriggers = new TabPage(); - _UcTriggers1 = new UCTriggers(); - _TabPageMacros = new TabPage(); - _UcMacros1 = new UCMacros(); - _TabPageAliases = new TabPage(); - _UcAliases1 = new UCAliases(); - _TabPageSubs = new TabPage(); - _UcSubs1 = new UCSubs(); - _TabPageIgnores = new TabPage(); - _UcIgnore1 = new UCIgnore(); - _TabPageVars = new TabPage(); - _UcVariables1 = new UCVariables(); - _TabPageVariables = new TabPage(); - _TableLayoutPanel1.SuspendLayout(); - _Panel1.SuspendLayout(); - _TabControlMain.SuspendLayout(); - _TabPageWindows.SuspendLayout(); - _TabControlWindows.SuspendLayout(); - _TabPage1.SuspendLayout(); - _TabPage2.SuspendLayout(); - _TabPageHighlights.SuspendLayout(); - _TabControl2.SuspendLayout(); - _TabPageString.SuspendLayout(); - _TabPageNames.SuspendLayout(); - _TabPagePreset.SuspendLayout(); - _TabPageTriggers.SuspendLayout(); - _TabPageMacros.SuspendLayout(); - _TabPageAliases.SuspendLayout(); - _TabPageSubs.SuspendLayout(); - _TabPageIgnores.SuspendLayout(); - _TabPageVars.SuspendLayout(); - SuspendLayout(); - // - // TableLayoutPanel1 - // - _TableLayoutPanel1.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; - _TableLayoutPanel1.ColumnCount = 2; - _TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50.0F)); - _TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50.0F)); - _TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20.0F)); - _TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20.0F)); - _TableLayoutPanel1.Controls.Add(_Cancel_Button, 0, 0); - _TableLayoutPanel1.Controls.Add(_OK_Button, 0, 0); - _TableLayoutPanel1.Location = new Point(508, 3); - _TableLayoutPanel1.Name = "TableLayoutPanel1"; - _TableLayoutPanel1.RowCount = 1; - _TableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100.0F)); - _TableLayoutPanel1.Size = new Size(154, 29); - _TableLayoutPanel1.TabIndex = 1; - // - // Cancel_Button - // - _Cancel_Button.Anchor = AnchorStyles.None; - _Cancel_Button.DialogResult = DialogResult.Cancel; - _Cancel_Button.Location = new Point(82, 3); - _Cancel_Button.Name = "Cancel_Button"; - _Cancel_Button.Size = new Size(67, 23); - _Cancel_Button.TabIndex = 1; - _Cancel_Button.Text = "Cancel"; - // - // OK_Button - // - _OK_Button.Anchor = AnchorStyles.None; - _OK_Button.Location = new Point(5, 3); - _OK_Button.Name = "OK_Button"; - _OK_Button.Size = new Size(67, 23); - _OK_Button.TabIndex = 0; - _OK_Button.Text = "OK"; - // - // Panel1 - // - _Panel1.Controls.Add(_TableLayoutPanel1); - _Panel1.Dock = DockStyle.Bottom; - _Panel1.Location = new Point(0, 480); - _Panel1.Name = "Panel1"; - _Panel1.Size = new Size(665, 35); - _Panel1.TabIndex = 2; - // - // TabControlMain - // - _TabControlMain.Controls.Add(_TabPageWindows); - _TabControlMain.Controls.Add(_TabPageHighlights); - _TabControlMain.Controls.Add(_TabPageTriggers); - _TabControlMain.Controls.Add(_TabPageSubs); - _TabControlMain.Controls.Add(_TabPageIgnores); - _TabControlMain.Controls.Add(_TabPageAliases); - _TabControlMain.Controls.Add(_TabPageMacros); - _TabControlMain.Controls.Add(_TabPageVars); - _TabControlMain.Dock = DockStyle.Fill; - _TabControlMain.Location = new Point(0, 0); - _TabControlMain.Name = "TabControlMain"; - _TabControlMain.SelectedIndex = 0; - _TabControlMain.Size = new Size(665, 480); - _TabControlMain.TabIndex = 3; - // - // TabPageWindows - // - _TabPageWindows.Controls.Add(_TabControlWindows); - _TabPageWindows.Location = new Point(4, 22); - _TabPageWindows.Name = "TabPageWindows"; - _TabPageWindows.Size = new Size(657, 454); - _TabPageWindows.TabIndex = 8; - _TabPageWindows.Text = "Layout"; - _TabPageWindows.UseVisualStyleBackColor = true; - // - // TabControlWindows - // - _TabControlWindows.Controls.Add(_TabPage1); - _TabControlWindows.Controls.Add(_TabPage2); - _TabControlWindows.Dock = DockStyle.Fill; - _TabControlWindows.Location = new Point(0, 0); - _TabControlWindows.Name = "TabControlWindows"; - _TabControlWindows.SelectedIndex = 0; - _TabControlWindows.Size = new Size(657, 454); - _TabControlWindows.TabIndex = 1; - // - // TabPage1 - // - _TabPage1.Controls.Add(_UcWindows1); - _TabPage1.Location = new Point(4, 22); - _TabPage1.Name = "TabPage1"; - _TabPage1.Padding = new Padding(3); - _TabPage1.Size = new Size(649, 428); - _TabPage1.TabIndex = 0; - _TabPage1.Text = "Windows"; - _TabPage1.UseVisualStyleBackColor = true; - // - // UcWindows1 - // - _UcWindows1.Dock = DockStyle.Fill; - _UcWindows1.FormParent = null; - _UcWindows1.Location = new Point(3, 3); - _UcWindows1.Name = "UcWindows1"; - _UcWindows1.Size = new Size(643, 422); - _UcWindows1.TabIndex = 0; - // - // TabPage2 - // - _TabPage2.Controls.Add(_UcWindowSettings1); - _TabPage2.Location = new Point(4, 22); - _TabPage2.Name = "TabPage2"; - _TabPage2.Padding = new Padding(3); - _TabPage2.Size = new Size(649, 428); - _TabPage2.TabIndex = 1; - _TabPage2.Text = "Settings"; - _TabPage2.UseVisualStyleBackColor = true; - // - // UcWindowSettings1 - // - _UcWindowSettings1.Dock = DockStyle.Fill; - _UcWindowSettings1.FormParent = null; - _UcWindowSettings1.Location = new Point(3, 3); - _UcWindowSettings1.Name = "UcWindowSettings1"; - _UcWindowSettings1.Size = new Size(643, 422); - _UcWindowSettings1.TabIndex = 0; - // - // TabPageHighlights - // - _TabPageHighlights.Controls.Add(_TabControl2); - _TabPageHighlights.Location = new Point(4, 22); - _TabPageHighlights.Name = "TabPageHighlights"; - _TabPageHighlights.Padding = new Padding(3); - _TabPageHighlights.Size = new Size(657, 454); - _TabPageHighlights.TabIndex = 1; - _TabPageHighlights.Text = "Highlights"; - _TabPageHighlights.UseVisualStyleBackColor = true; - // - // TabControl2 - // - _TabControl2.Controls.Add(_TabPageString); - _TabControl2.Controls.Add(_TabPageNames); - _TabControl2.Controls.Add(_TabPagePreset); - _TabControl2.Dock = DockStyle.Fill; - _TabControl2.Location = new Point(3, 3); - _TabControl2.Name = "TabControl2"; - _TabControl2.SelectedIndex = 0; - _TabControl2.Size = new Size(651, 448); - _TabControl2.TabIndex = 0; - // - // TabPageString - // - _TabPageString.Controls.Add(_UcHighlightStrings1); - _TabPageString.Location = new Point(4, 22); - _TabPageString.Name = "TabPageString"; - _TabPageString.Size = new Size(643, 422); - _TabPageString.TabIndex = 4; - _TabPageString.Text = "Strings"; - _TabPageString.UseVisualStyleBackColor = true; - // - // UcHighlightStrings1 - // - _UcHighlightStrings1.Dock = DockStyle.Fill; - _UcHighlightStrings1.Globals = null; - _UcHighlightStrings1.HighlightLineBeginsWith = null; - _UcHighlightStrings1.HighlightList = null; - _UcHighlightStrings1.HighlightRegExp = null; - _UcHighlightStrings1.ItemChanged = false; - _UcHighlightStrings1.Location = new Point(0, 0); - _UcHighlightStrings1.Name = "UcHighlightStrings1"; - _UcHighlightStrings1.Size = new Size(643, 422); - _UcHighlightStrings1.TabIndex = 2; - // - // TabPageNames - // - _TabPageNames.Controls.Add(_UcName1); - _TabPageNames.Location = new Point(4, 22); - _TabPageNames.Name = "TabPageNames"; - _TabPageNames.Size = new Size(643, 422); - _TabPageNames.TabIndex = 2; - _TabPageNames.Text = "Names"; - _TabPageNames.UseVisualStyleBackColor = true; - // - // UcName1 - // - _UcName1.Dock = DockStyle.Fill; - _UcName1.Location = new Point(0, 0); - _UcName1.Name = "UcName1"; - _UcName1.NameList = null; - _UcName1.Size = new Size(643, 422); - _UcName1.TabIndex = 1; - // - // TabPagePreset - // - _TabPagePreset.Controls.Add(_UcPreset1); - _TabPagePreset.Location = new Point(4, 22); - _TabPagePreset.Name = "TabPagePreset"; - _TabPagePreset.Size = new Size(643, 422); - _TabPagePreset.TabIndex = 3; - _TabPagePreset.Text = "Presets"; - _TabPagePreset.UseVisualStyleBackColor = true; - // - // UcPreset1 - // - _UcPreset1.Dock = DockStyle.Fill; - _UcPreset1.FormParent = null; - _UcPreset1.Location = new Point(0, 0); - _UcPreset1.Name = "UcPreset1"; - _UcPreset1.PresetList = null; - _UcPreset1.Size = new Size(643, 422); - _UcPreset1.TabIndex = 3; - // - // TabPageTriggers - // - _TabPageTriggers.Controls.Add(_UcTriggers1); - _TabPageTriggers.Location = new Point(4, 22); - _TabPageTriggers.Name = "TabPageTriggers"; - _TabPageTriggers.Size = new Size(657, 454); - _TabPageTriggers.TabIndex = 6; - _TabPageTriggers.Text = "Triggers"; - _TabPageTriggers.UseVisualStyleBackColor = true; - // - // UcTriggers1 - // - _UcTriggers1.Dock = DockStyle.Fill; - _UcTriggers1.Location = new Point(0, 0); - _UcTriggers1.Name = "UcTriggers1"; - _UcTriggers1.Size = new Size(657, 454); - _UcTriggers1.TabIndex = 0; - _UcTriggers1.TriggerList = null; - // - // TabPageMacros - // - _TabPageMacros.Controls.Add(_UcMacros1); - _TabPageMacros.Location = new Point(4, 22); - _TabPageMacros.Name = "TabPageMacros"; - _TabPageMacros.Size = new Size(657, 454); - _TabPageMacros.TabIndex = 5; - _TabPageMacros.Text = "Macros"; - _TabPageMacros.UseVisualStyleBackColor = true; - // - // UcMacros1 - // - _UcMacros1.Dock = DockStyle.Fill; - _UcMacros1.Location = new Point(0, 0); - _UcMacros1.MacroList = null; - _UcMacros1.Name = "UcMacros1"; - _UcMacros1.Size = new Size(657, 454); - _UcMacros1.TabIndex = 0; - // - // TabPageAliases - // - _TabPageAliases.Controls.Add(_UcAliases1); - _TabPageAliases.Location = new Point(4, 22); - _TabPageAliases.Name = "TabPageAliases"; - _TabPageAliases.Size = new Size(657, 454); - _TabPageAliases.TabIndex = 4; - _TabPageAliases.Text = "Aliases"; - _TabPageAliases.UseVisualStyleBackColor = true; - // - // UcAliases1 - // - _UcAliases1.AliasList = null; - _UcAliases1.Dock = DockStyle.Fill; - _UcAliases1.Location = new Point(0, 0); - _UcAliases1.Name = "UcAliases1"; - _UcAliases1.Size = new Size(657, 454); - _UcAliases1.TabIndex = 0; - // - // TabPageSubs - // - _TabPageSubs.Controls.Add(_UcSubs1); - _TabPageSubs.Location = new Point(4, 22); - _TabPageSubs.Name = "TabPageSubs"; - _TabPageSubs.Size = new Size(657, 454); - _TabPageSubs.TabIndex = 2; - _TabPageSubs.Text = "Substitutes"; - _TabPageSubs.UseVisualStyleBackColor = true; - // - // UcSubs1 - // - _UcSubs1.Dock = DockStyle.Fill; - _UcSubs1.Location = new Point(0, 0); - _UcSubs1.Name = "UcSubs1"; - _UcSubs1.Size = new Size(657, 454); - _UcSubs1.SubstituteList = null; - _UcSubs1.TabIndex = 0; - // - // TabPageIgnores - // - _TabPageIgnores.Controls.Add(_UcIgnore1); - _TabPageIgnores.Location = new Point(4, 22); - _TabPageIgnores.Name = "TabPageIgnores"; - _TabPageIgnores.Size = new Size(657, 454); - _TabPageIgnores.TabIndex = 3; - _TabPageIgnores.Text = "Gags"; - _TabPageIgnores.UseVisualStyleBackColor = true; - // - // UcIgnore1 - // - _UcIgnore1.Dock = DockStyle.Fill; - _UcIgnore1.IgnoreList = null; - _UcIgnore1.Location = new Point(0, 0); - _UcIgnore1.Name = "UcIgnore1"; - _UcIgnore1.Size = new Size(657, 454); - _UcIgnore1.TabIndex = 1; - // - // TabPageVars - // - _TabPageVars.Controls.Add(_UcVariables1); - _TabPageVars.Location = new Point(4, 22); - _TabPageVars.Name = "TabPageVars"; - _TabPageVars.Size = new Size(657, 454); - _TabPageVars.TabIndex = 9; - _TabPageVars.Text = "Variables"; - _TabPageVars.UseVisualStyleBackColor = true; - // - // UcVariables1 - // - _UcVariables1.Dock = DockStyle.Fill; - _UcVariables1.Location = new Point(0, 0); - _UcVariables1.Name = "UcVariables1"; - _UcVariables1.Size = new Size(657, 454); - _UcVariables1.TabIndex = 0; - _UcVariables1.VariableList = null; - // - // TabPageVariables - // - _TabPageVariables.Location = new Point(4, 22); - _TabPageVariables.Name = "TabPageVariables"; - _TabPageVariables.Size = new Size(654, 378); - _TabPageVariables.TabIndex = 9; - _TabPageVariables.Text = "Variables"; - _TabPageVariables.UseVisualStyleBackColor = true; + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormConfig)); + this._TableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this._Cancel_Button = new System.Windows.Forms.Button(); + this._OK_Button = new System.Windows.Forms.Button(); + this._Panel1 = new System.Windows.Forms.Panel(); + this._TabControlMain = new System.Windows.Forms.TabControl(); + this._TabPageWindows = new System.Windows.Forms.TabPage(); + this._TabControlWindows = new System.Windows.Forms.TabControl(); + this._TabPage1 = new System.Windows.Forms.TabPage(); + this._UcWindows1 = new GenieClient.UCWindows(); + this._TabPage2 = new System.Windows.Forms.TabPage(); + this._UcWindowSettings1 = new GenieClient.UCWindowSettings(); + this._TabPageHighlights = new System.Windows.Forms.TabPage(); + this._TabControl2 = new System.Windows.Forms.TabControl(); + this._TabPageString = new System.Windows.Forms.TabPage(); + this._UcHighlightStrings1 = new GenieClient.UCHighlightStrings(); + this._TabPageNames = new System.Windows.Forms.TabPage(); + this._UcName1 = new GenieClient.UCName(); + this._TabPagePreset = new System.Windows.Forms.TabPage(); + this._UcPreset1 = new GenieClient.UCPreset(); + this._TabPageTriggers = new System.Windows.Forms.TabPage(); + this._UcTriggers1 = new GenieClient.UCTriggers(); + this._TabPageSubs = new System.Windows.Forms.TabPage(); + this._UcSubs1 = new GenieClient.UCSubs(); + this._TabPageIgnores = new System.Windows.Forms.TabPage(); + this._UcIgnore1 = new GenieClient.UCIgnore(); + this._TabPageAliases = new System.Windows.Forms.TabPage(); + this._UcAliases1 = new GenieClient.UCAliases(); + this._TabPageMacros = new System.Windows.Forms.TabPage(); + this._UcMacros1 = new GenieClient.UCMacros(); + this._TabPageVars = new System.Windows.Forms.TabPage(); + this._UcVariables1 = new GenieClient.UCVariables(); + this._TabPageVariables = new System.Windows.Forms.TabPage(); + this._TableLayoutPanel1.SuspendLayout(); + this._Panel1.SuspendLayout(); + this._TabControlMain.SuspendLayout(); + this._TabPageWindows.SuspendLayout(); + this._TabControlWindows.SuspendLayout(); + this._TabPage1.SuspendLayout(); + this._TabPage2.SuspendLayout(); + this._TabPageHighlights.SuspendLayout(); + this._TabControl2.SuspendLayout(); + this._TabPageString.SuspendLayout(); + this._TabPageNames.SuspendLayout(); + this._TabPagePreset.SuspendLayout(); + this._TabPageTriggers.SuspendLayout(); + this._TabPageSubs.SuspendLayout(); + this._TabPageIgnores.SuspendLayout(); + this._TabPageAliases.SuspendLayout(); + this._TabPageMacros.SuspendLayout(); + this._TabPageVars.SuspendLayout(); + this.SuspendLayout(); + // + // _TableLayoutPanel1 + // + this._TableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this._TableLayoutPanel1.ColumnCount = 2; + this._TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this._TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this._TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 23F)); + this._TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 23F)); + this._TableLayoutPanel1.Controls.Add(this._Cancel_Button, 0, 0); + this._TableLayoutPanel1.Controls.Add(this._OK_Button, 0, 0); + this._TableLayoutPanel1.Location = new System.Drawing.Point(593, 3); + this._TableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TableLayoutPanel1.Name = "_TableLayoutPanel1"; + this._TableLayoutPanel1.RowCount = 1; + this._TableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this._TableLayoutPanel1.Size = new System.Drawing.Size(180, 33); + this._TableLayoutPanel1.TabIndex = 1; + // + // _Cancel_Button + // + this._Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None; + this._Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this._Cancel_Button.Location = new System.Drawing.Point(96, 3); + this._Cancel_Button.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._Cancel_Button.Name = "_Cancel_Button"; + this._Cancel_Button.Size = new System.Drawing.Size(78, 27); + this._Cancel_Button.TabIndex = 1; + this._Cancel_Button.Text = "Cancel"; + this._Cancel_Button.Click += new System.EventHandler(this.Cancel_Button_Click); + // + // _OK_Button + // + this._OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None; + this._OK_Button.Location = new System.Drawing.Point(6, 3); + this._OK_Button.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._OK_Button.Name = "_OK_Button"; + this._OK_Button.Size = new System.Drawing.Size(78, 27); + this._OK_Button.TabIndex = 0; + this._OK_Button.Text = "OK"; + this._OK_Button.Click += new System.EventHandler(this.OK_Button_Click); + // + // _Panel1 + // + this._Panel1.Controls.Add(this._TableLayoutPanel1); + this._Panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this._Panel1.Location = new System.Drawing.Point(0, 554); + this._Panel1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._Panel1.Name = "_Panel1"; + this._Panel1.Size = new System.Drawing.Size(776, 40); + this._Panel1.TabIndex = 2; + // + // _TabControlMain + // + this._TabControlMain.Controls.Add(this._TabPageWindows); + this._TabControlMain.Controls.Add(this._TabPageHighlights); + this._TabControlMain.Controls.Add(this._TabPageTriggers); + this._TabControlMain.Controls.Add(this._TabPageSubs); + this._TabControlMain.Controls.Add(this._TabPageIgnores); + this._TabControlMain.Controls.Add(this._TabPageAliases); + this._TabControlMain.Controls.Add(this._TabPageMacros); + this._TabControlMain.Controls.Add(this._TabPageVars); + this._TabControlMain.Dock = System.Windows.Forms.DockStyle.Fill; + this._TabControlMain.Location = new System.Drawing.Point(0, 0); + this._TabControlMain.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabControlMain.Name = "_TabControlMain"; + this._TabControlMain.SelectedIndex = 0; + this._TabControlMain.Size = new System.Drawing.Size(776, 554); + this._TabControlMain.TabIndex = 3; + // + // _TabPageWindows + // + this._TabPageWindows.Controls.Add(this._TabControlWindows); + this._TabPageWindows.Location = new System.Drawing.Point(4, 24); + this._TabPageWindows.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageWindows.Name = "_TabPageWindows"; + this._TabPageWindows.Size = new System.Drawing.Size(768, 526); + this._TabPageWindows.TabIndex = 8; + this._TabPageWindows.Text = "Layout"; + this._TabPageWindows.UseVisualStyleBackColor = true; + // + // _TabControlWindows + // + this._TabControlWindows.Controls.Add(this._TabPage1); + this._TabControlWindows.Controls.Add(this._TabPage2); + this._TabControlWindows.Dock = System.Windows.Forms.DockStyle.Fill; + this._TabControlWindows.Location = new System.Drawing.Point(0, 0); + this._TabControlWindows.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabControlWindows.Name = "_TabControlWindows"; + this._TabControlWindows.SelectedIndex = 0; + this._TabControlWindows.Size = new System.Drawing.Size(768, 526); + this._TabControlWindows.TabIndex = 1; + // + // _TabPage1 + // + this._TabPage1.Controls.Add(this._UcWindows1); + this._TabPage1.Location = new System.Drawing.Point(4, 24); + this._TabPage1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPage1.Name = "_TabPage1"; + this._TabPage1.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPage1.Size = new System.Drawing.Size(760, 498); + this._TabPage1.TabIndex = 0; + this._TabPage1.Text = "Windows"; + this._TabPage1.UseVisualStyleBackColor = true; + // + // _UcWindows1 + // + this._UcWindows1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcWindows1.FormParent = null; + this._UcWindows1.Location = new System.Drawing.Point(4, 3); + this._UcWindows1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcWindows1.Name = "_UcWindows1"; + this._UcWindows1.Size = new System.Drawing.Size(752, 492); + this._UcWindows1.TabIndex = 0; + // + // _TabPage2 + // + this._TabPage2.Controls.Add(this._UcWindowSettings1); + this._TabPage2.Location = new System.Drawing.Point(4, 24); + this._TabPage2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPage2.Name = "_TabPage2"; + this._TabPage2.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPage2.Size = new System.Drawing.Size(758, 496); + this._TabPage2.TabIndex = 1; + this._TabPage2.Text = "Settings"; + this._TabPage2.UseVisualStyleBackColor = true; + // + // _UcWindowSettings1 + // + this._UcWindowSettings1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcWindowSettings1.FormParent = null; + this._UcWindowSettings1.Location = new System.Drawing.Point(4, 3); + this._UcWindowSettings1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcWindowSettings1.Name = "_UcWindowSettings1"; + this._UcWindowSettings1.Size = new System.Drawing.Size(750, 490); + this._UcWindowSettings1.TabIndex = 0; + // + // _TabPageHighlights + // + this._TabPageHighlights.Controls.Add(this._TabControl2); + this._TabPageHighlights.Location = new System.Drawing.Point(4, 24); + this._TabPageHighlights.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageHighlights.Name = "_TabPageHighlights"; + this._TabPageHighlights.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageHighlights.Size = new System.Drawing.Size(768, 526); + this._TabPageHighlights.TabIndex = 1; + this._TabPageHighlights.Text = "Highlights"; + this._TabPageHighlights.UseVisualStyleBackColor = true; + // + // _TabControl2 + // + this._TabControl2.Controls.Add(this._TabPageString); + this._TabControl2.Controls.Add(this._TabPageNames); + this._TabControl2.Controls.Add(this._TabPagePreset); + this._TabControl2.Dock = System.Windows.Forms.DockStyle.Fill; + this._TabControl2.Location = new System.Drawing.Point(4, 3); + this._TabControl2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabControl2.Name = "_TabControl2"; + this._TabControl2.SelectedIndex = 0; + this._TabControl2.Size = new System.Drawing.Size(760, 520); + this._TabControl2.TabIndex = 0; + // + // _TabPageString + // + this._TabPageString.Controls.Add(this._UcHighlightStrings1); + this._TabPageString.Location = new System.Drawing.Point(4, 24); + this._TabPageString.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageString.Name = "_TabPageString"; + this._TabPageString.Size = new System.Drawing.Size(752, 492); + this._TabPageString.TabIndex = 4; + this._TabPageString.Text = "Strings"; + this._TabPageString.UseVisualStyleBackColor = true; + // + // _UcHighlightStrings1 + // + this._UcHighlightStrings1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcHighlightStrings1.Globals = null; + this._UcHighlightStrings1.HighlightLineBeginsWith = null; + this._UcHighlightStrings1.HighlightList = null; + this._UcHighlightStrings1.HighlightRegExp = null; + this._UcHighlightStrings1.ItemChanged = false; + this._UcHighlightStrings1.Location = new System.Drawing.Point(0, 0); + this._UcHighlightStrings1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcHighlightStrings1.Name = "_UcHighlightStrings1"; + this._UcHighlightStrings1.Size = new System.Drawing.Size(750, 487); + this._UcHighlightStrings1.TabIndex = 2; + // + // _TabPageNames + // + this._TabPageNames.Controls.Add(this._UcName1); + this._TabPageNames.Location = new System.Drawing.Point(4, 24); + this._TabPageNames.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageNames.Name = "_TabPageNames"; + this._TabPageNames.Size = new System.Drawing.Size(752, 492); + this._TabPageNames.TabIndex = 2; + this._TabPageNames.Text = "Names"; + this._TabPageNames.UseVisualStyleBackColor = true; + // + // _UcName1 + // + this._UcName1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcName1.Location = new System.Drawing.Point(0, 0); + this._UcName1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcName1.Name = "_UcName1"; + this._UcName1.NameList = null; + this._UcName1.Size = new System.Drawing.Size(752, 492); + this._UcName1.TabIndex = 1; + // + // _TabPagePreset + // + this._TabPagePreset.Controls.Add(this._UcPreset1); + this._TabPagePreset.Location = new System.Drawing.Point(4, 24); + this._TabPagePreset.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPagePreset.Name = "_TabPagePreset"; + this._TabPagePreset.Size = new System.Drawing.Size(752, 492); + this._TabPagePreset.TabIndex = 3; + this._TabPagePreset.Text = "Presets"; + this._TabPagePreset.UseVisualStyleBackColor = true; + // + // _UcPreset1 + // + this._UcPreset1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcPreset1.FormParent = null; + this._UcPreset1.Location = new System.Drawing.Point(0, 0); + this._UcPreset1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcPreset1.Name = "_UcPreset1"; + this._UcPreset1.PresetList = null; + this._UcPreset1.Size = new System.Drawing.Size(752, 492); + this._UcPreset1.TabIndex = 3; + // + // _TabPageTriggers + // + this._TabPageTriggers.Controls.Add(this._UcTriggers1); + this._TabPageTriggers.Location = new System.Drawing.Point(4, 24); + this._TabPageTriggers.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageTriggers.Name = "_TabPageTriggers"; + this._TabPageTriggers.Size = new System.Drawing.Size(768, 526); + this._TabPageTriggers.TabIndex = 6; + this._TabPageTriggers.Text = "Triggers"; + this._TabPageTriggers.UseVisualStyleBackColor = true; + // + // _UcTriggers1 + // + this._UcTriggers1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcTriggers1.Globals = null; + this._UcTriggers1.Location = new System.Drawing.Point(0, 0); + this._UcTriggers1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcTriggers1.Name = "_UcTriggers1"; + this._UcTriggers1.Size = new System.Drawing.Size(766, 524); + this._UcTriggers1.TabIndex = 0; + this._UcTriggers1.TriggerList = null; + // + // _TabPageSubs + // + this._TabPageSubs.Controls.Add(this._UcSubs1); + this._TabPageSubs.Location = new System.Drawing.Point(4, 24); + this._TabPageSubs.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageSubs.Name = "_TabPageSubs"; + this._TabPageSubs.Size = new System.Drawing.Size(768, 526); + this._TabPageSubs.TabIndex = 2; + this._TabPageSubs.Text = "Substitutes"; + this._TabPageSubs.UseVisualStyleBackColor = true; + // + // _UcSubs1 + // + this._UcSubs1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcSubs1.Globals = null; + this._UcSubs1.Location = new System.Drawing.Point(0, 0); + this._UcSubs1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcSubs1.Name = "_UcSubs1"; + this._UcSubs1.Size = new System.Drawing.Size(766, 524); + this._UcSubs1.SubstituteList = null; + this._UcSubs1.TabIndex = 0; + // + // _TabPageIgnores + // + this._TabPageIgnores.Controls.Add(this._UcIgnore1); + this._TabPageIgnores.Location = new System.Drawing.Point(4, 24); + this._TabPageIgnores.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageIgnores.Name = "_TabPageIgnores"; + this._TabPageIgnores.Size = new System.Drawing.Size(768, 526); + this._TabPageIgnores.TabIndex = 3; + this._TabPageIgnores.Text = "Gags"; + this._TabPageIgnores.UseVisualStyleBackColor = true; + // + // _UcIgnore1 + // + this._UcIgnore1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcIgnore1.Globals = null; + this._UcIgnore1.IgnoreList = null; + this._UcIgnore1.Location = new System.Drawing.Point(0, 0); + this._UcIgnore1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcIgnore1.Name = "_UcIgnore1"; + this._UcIgnore1.Size = new System.Drawing.Size(766, 524); + this._UcIgnore1.TabIndex = 1; + // + // _TabPageAliases + // + this._TabPageAliases.Controls.Add(this._UcAliases1); + this._TabPageAliases.Location = new System.Drawing.Point(4, 24); + this._TabPageAliases.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageAliases.Name = "_TabPageAliases"; + this._TabPageAliases.Size = new System.Drawing.Size(768, 526); + this._TabPageAliases.TabIndex = 4; + this._TabPageAliases.Text = "Aliases"; + this._TabPageAliases.UseVisualStyleBackColor = true; + // + // _UcAliases1 + // + this._UcAliases1.AliasList = null; + this._UcAliases1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcAliases1.Location = new System.Drawing.Point(0, 0); + this._UcAliases1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcAliases1.Name = "_UcAliases1"; + this._UcAliases1.Size = new System.Drawing.Size(768, 526); + this._UcAliases1.TabIndex = 0; + // + // _TabPageMacros + // + this._TabPageMacros.Controls.Add(this._UcMacros1); + this._TabPageMacros.Location = new System.Drawing.Point(4, 24); + this._TabPageMacros.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageMacros.Name = "_TabPageMacros"; + this._TabPageMacros.Size = new System.Drawing.Size(768, 526); + this._TabPageMacros.TabIndex = 5; + this._TabPageMacros.Text = "Macros"; + this._TabPageMacros.UseVisualStyleBackColor = true; + // + // _UcMacros1 + // + this._UcMacros1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcMacros1.Location = new System.Drawing.Point(0, 0); + this._UcMacros1.MacroList = null; + this._UcMacros1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcMacros1.Name = "_UcMacros1"; + this._UcMacros1.Size = new System.Drawing.Size(768, 526); + this._UcMacros1.TabIndex = 0; + // + // _TabPageVars + // + this._TabPageVars.Controls.Add(this._UcVariables1); + this._TabPageVars.Location = new System.Drawing.Point(4, 24); + this._TabPageVars.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this._TabPageVars.Name = "_TabPageVars"; + this._TabPageVars.Size = new System.Drawing.Size(768, 526); + this._TabPageVars.TabIndex = 9; + this._TabPageVars.Text = "Variables"; + this._TabPageVars.UseVisualStyleBackColor = true; + // + // _UcVariables1 + // + this._UcVariables1.Dock = System.Windows.Forms.DockStyle.Fill; + this._UcVariables1.Location = new System.Drawing.Point(0, 0); + this._UcVariables1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + this._UcVariables1.Name = "_UcVariables1"; + this._UcVariables1.Size = new System.Drawing.Size(768, 526); + this._UcVariables1.TabIndex = 0; + this._UcVariables1.VariableList = null; + // + // _TabPageVariables + // + this._TabPageVariables.Location = new System.Drawing.Point(4, 22); + this._TabPageVariables.Name = "_TabPageVariables"; + this._TabPageVariables.Size = new System.Drawing.Size(654, 378); + this._TabPageVariables.TabIndex = 9; + this._TabPageVariables.Text = "Variables"; + this._TabPageVariables.UseVisualStyleBackColor = true; // // FormConfig // - AutoScaleDimensions = new SizeF(6.0F, 13.0F); - AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(665, 515); - Controls.Add(_TabControlMain); - Controls.Add(_Panel1); - Icon = (Icon)resources.GetObject("$this.Icon"); - MaximizeBox = false; - MinimizeBox = false; - Name = "FormConfig"; - ShowInTaskbar = false; - StartPosition = FormStartPosition.CenterParent; - Text = "Configuration"; - TopMost = true; - _TableLayoutPanel1.ResumeLayout(false); - _Panel1.ResumeLayout(false); - _TabControlMain.ResumeLayout(false); - _TabPageWindows.ResumeLayout(false); - _TabControlWindows.ResumeLayout(false); - _TabPage1.ResumeLayout(false); - _TabPage2.ResumeLayout(false); - _TabPageHighlights.ResumeLayout(false); - _TabControl2.ResumeLayout(false); - _TabPageString.ResumeLayout(false); - _TabPageNames.ResumeLayout(false); - _TabPagePreset.ResumeLayout(false); - _TabPageTriggers.ResumeLayout(false); - _TabPageMacros.ResumeLayout(false); - _TabPageAliases.ResumeLayout(false); - _TabPageSubs.ResumeLayout(false); - _TabPageIgnores.ResumeLayout(false); - _TabPageVars.ResumeLayout(false); - Load += new EventHandler(FormConfig_Load); - ResumeLayout(false); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(776, 594); + this.Controls.Add(this._TabControlMain); + this.Controls.Add(this._Panel1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormConfig"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Configuration"; + this.TopMost = true; + this.Load += new System.EventHandler(this.FormConfig_Load); + this._TableLayoutPanel1.ResumeLayout(false); + this._Panel1.ResumeLayout(false); + this._TabControlMain.ResumeLayout(false); + this._TabPageWindows.ResumeLayout(false); + this._TabControlWindows.ResumeLayout(false); + this._TabPage1.ResumeLayout(false); + this._TabPage2.ResumeLayout(false); + this._TabPageHighlights.ResumeLayout(false); + this._TabControl2.ResumeLayout(false); + this._TabPageString.ResumeLayout(false); + this._TabPageNames.ResumeLayout(false); + this._TabPagePreset.ResumeLayout(false); + this._TabPageTriggers.ResumeLayout(false); + this._TabPageSubs.ResumeLayout(false); + this._TabPageIgnores.ResumeLayout(false); + this._TabPageAliases.ResumeLayout(false); + this._TabPageMacros.ResumeLayout(false); + this._TabPageVars.ResumeLayout(false); + this.ResumeLayout(false); + } private TableLayoutPanel _TableLayoutPanel1; diff --git a/Forms/FormConfig.resx b/Forms/FormConfig.resx index 529a5be..280798e 100644 --- a/Forms/FormConfig.resx +++ b/Forms/FormConfig.resx @@ -1,64 +1,4 @@ - - @@ -117,7 +57,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAABAAQAEBAAAAEACABoBQAARgAAABAQAAABACAAaAQAAK4FAAAgIAAAAQAIAKgIAAAWCgAAICAAAAEA diff --git a/Lists/Globals.cs b/Lists/Globals.cs index f8feaf3..c2eeece 100644 --- a/Lists/Globals.cs +++ b/Lists/Globals.cs @@ -310,19 +310,21 @@ public class Preset public Color FgColor; public Color BgColor; public string sColorName; + public bool bHighlightLine = false; public bool bSaveToFile = true; - public Preset(string sKey, Color oColor, Color oBgColor, string sColorName, string _bSaveToFile) + public Preset(string sKey, Color oColor, Color oBgColor, string sColorName, string _bSaveToFile, bool highlightLine) { this.sKey = sKey; FgColor = oColor; BgColor = oBgColor; this.sColorName = sColorName; bSaveToFile = Conversions.ToBoolean(_bSaveToFile); + bHighlightLine = highlightLine; } } - public void Add(string sKey, string sColorName, bool bSaveToFile = true) + public void Add(string sKey, string sColorName, bool bSaveToFile = true, bool highlightLine = false) { Color oColor; Color oBgcolor; @@ -340,7 +342,7 @@ public void Add(string sKey, string sColorName, bool bSaveToFile = true) } string arg_bSaveToFile = Conversions.ToString(bSaveToFile); - var oVar = new Preset(sKey, oColor, oBgcolor, sColorName, arg_bSaveToFile); + var oVar = new Preset(sKey, oColor, oBgcolor, sColorName, arg_bSaveToFile, highlightLine); if (base.ContainsKey(sKey.ToLower()) == true) { base[sKey.ToLower()] = oVar; @@ -430,9 +432,11 @@ private void LoadRow(string sText) var oArgs = Utility.ParseArgs(sText); if (oArgs.Count == 3) { - var arg1 = oArgs[1].ToString(); - var arg2 = oArgs[2].ToString(); - Add(arg1, arg2); + Add(oArgs[1].ToString(), oArgs[2].ToString()); + } + else if (oArgs.Count == 4) + { + Add(oArgs[1].ToString(), oArgs[2].ToString(), default, oArgs[3].ToString().ToLower() == "true"); } } @@ -445,11 +449,6 @@ public bool Save(string sFileName = "presets.cfg") sFileName = LocalDirectory.Path + @"\Config\" + sFileName; } - if (File.Exists(sFileName) == true) - { - Utility.DeleteFile(sFileName); - } - if (AcquireReaderLock()) { try @@ -459,7 +458,7 @@ public bool Save(string sFileName = "presets.cfg") { if (ov.bSaveToFile == true) { - oStreamWriter.WriteLine("#preset {" + ov.sKey + "} {" + ov.sColorName + "}"); + oStreamWriter.WriteLine("#preset {" + ov.sKey + "} {" + ov.sColorName + "} {" + ov.bHighlightLine + "}"); } } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0f1d0b8..d163643 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ // by using the '*' as shown below: // -[assembly: AssemblyVersion("4.0.2.302")] -[assembly: AssemblyFileVersion("4.0.2.302")] +[assembly: AssemblyVersion("4.0.2.310")] +[assembly: AssemblyFileVersion("4.0.2.310")] From a1937cc37dc997fe3ca530b1b65653b8480ffbe8 Mon Sep 17 00:00:00 2001 From: Djordje Date: Wed, 13 Apr 2022 01:25:49 -0400 Subject: [PATCH 20/50] Moved generation of NewLine --- Core/Game.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/Game.cs b/Core/Game.cs index 964134a..2d02be6 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -590,7 +590,7 @@ public void ParseGameRow(string sText) m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair(presetLabel, sTmp)); if(presetLabel == "roomdesc") { - PrintTextWithParse(sTmp + Environment.NewLine, bIsPrompt: false, oWindowTarget: 0); + PrintTextWithParse(sTmp, bIsPrompt: false, oWindowTarget: 0); sTmp = string.Empty; } } @@ -2622,6 +2622,7 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI { if (sText.StartsWith(" You also see")) { + PrintTextWithParse("\r\n", color, bgcolor); sText = sText.TrimStart(); } From 0d13a47d4490c8387df963e45ad025bef2a227b7 Mon Sep 17 00:00:00 2001 From: Djordje Date: Thu, 14 Apr 2022 15:12:13 -0400 Subject: [PATCH 21/50] modified a check that was causing FormMain to be created a second time during Closing --- Forms/FormSkin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Forms/FormSkin.cs b/Forms/FormSkin.cs index ebe3986..0a28d66 100644 --- a/Forms/FormSkin.cs +++ b/Forms/FormSkin.cs @@ -722,7 +722,7 @@ public void Unload() protected override void OnClosing(CancelEventArgs e) { - if (Information.IsNothing(My.MyProject.Forms.FormMain)) + if (this.MdiParent == null) { return; } From 44ec8c1cdbefe4ee9fb5d1ffc8c5ffcd350efc4c Mon Sep 17 00:00:00 2001 From: Djordje Date: Thu, 7 Apr 2022 18:39:43 -0400 Subject: [PATCH 22/50] added promptbreak and condensed display modes --- Core/Command.cs | 2 ++ Forms/FormMain.cs | 6 +++--- Lists/Config.cs | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/Core/Command.cs b/Core/Command.cs index 3deb82d..0f17a67 100644 --- a/Core/Command.cs +++ b/Core/Command.cs @@ -2836,6 +2836,8 @@ private void ListSettings() EchoText("mycommandchar=" + oGlobals.Config.cMyCommandChar.ToString() + System.Environment.NewLine); EchoText("parsegameonly=" + oGlobals.Config.bParseGameOnly.ToString() + System.Environment.NewLine); EchoText("prompt=" + oGlobals.Config.sPrompt + System.Environment.NewLine); + EchoText("promptbreak=" + oGlobals.Config.PromptBreak + System.Environment.NewLine); + EchoText("condensed=" + oGlobals.Config.Condensed + System.Environment.NewLine); EchoText("reconnect=" + oGlobals.Config.bReconnect.ToString() + System.Environment.NewLine); EchoText("roundtimeoffset=" + oGlobals.Config.dRTOffset + System.Environment.NewLine); EchoText("showlinks=" + oGlobals.Config.bShowLinks.ToString() + System.Environment.NewLine); diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index ae553b3..22d9fd6 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -4521,6 +4521,7 @@ private void AddText(string sText, [Optional, DefaultParameterValue(Genie.Game.W private void AddText(string sText, Color oColor, Color oBgColor, FormSkin oTargetWindow, bool bNoCache = true, bool bMono = false, bool bPrompt = false, bool bInput = false) { + if (sText == "\r\n" && m_oGlobals.Config.Condensed) return; bPrompt = false; if (IsDisposed) @@ -4550,13 +4551,12 @@ private void AddText(string sText, Color oColor, Color oBgColor, FormSkin oTarge { if (!bInput) { - if (sText.StartsWith(System.Environment.NewLine) == false) + if (sText.StartsWith(System.Environment.NewLine) == false && m_oGlobals.Config.PromptBreak) { sText = System.Environment.NewLine + sText; } } - - m_oGame.LastRowWasPrompt = false; + } } } diff --git a/Lists/Config.cs b/Lists/Config.cs index 85c975a..11e831d 100644 --- a/Lists/Config.cs +++ b/Lists/Config.cs @@ -48,6 +48,8 @@ public class Config public bool bShowLinks = false; public string sLogDir = "Logs"; + public bool PromptBreak { get; set; } = true; + public bool Condensed { get; set; } = false; public bool CheckForUpdates { get; set; } = true; public bool AutoUpdate { get; set; } = false; @@ -353,6 +355,8 @@ public bool Save(string sFileName = "settings.cfg") oStreamWriter.WriteLine("#config {automapper} {" + bAutoMapper + "}"); oStreamWriter.WriteLine("#config {editor} {" + sEditor + "}"); oStreamWriter.WriteLine("#config {prompt} {" + sPrompt + "}"); + oStreamWriter.WriteLine("#config {promptbreak} {" + PromptBreak + "}"); + oStreamWriter.WriteLine("#config {condensed} {" + Condensed + "}"); oStreamWriter.WriteLine("#config {monstercountignorelist} {" + sIgnoreMonsterList + "}"); oStreamWriter.WriteLine("#config {scripttimeout} {" + iScriptTimeout + "}"); oStreamWriter.WriteLine("#config {maxgosubdepth} {" + iMaxGoSubDepth + "}"); @@ -659,6 +663,48 @@ public List SetSetting(string sKey, string sValue = "", bool bShowExcept break; } + case "promptbreak": + { + switch (sValue.ToLower()) + { + case "on": + case "true": + case "1": + { + PromptBreak = true; + break; + } + + default: + { + PromptBreak = false; + break; + } + } + break; + } + + case "condensed": + { + switch (sValue.ToLower()) + { + case "on": + case "true": + case "1": + { + Condensed = true; + break; + } + + default: + { + Condensed = false; + break; + } + } + break; + } + case "monstercountignorelist": { if (sValue.Length > 0) From 93aef494000f08e2ceacfa7213a8c6125b6d0b87 Mon Sep 17 00:00:00 2001 From: Djordje Date: Thu, 7 Apr 2022 20:19:41 -0400 Subject: [PATCH 23/50] added PromptForce setting --- Core/Command.cs | 1 + Core/Game.cs | 5 +++++ Lists/Config.cs | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/Core/Command.cs b/Core/Command.cs index 0f17a67..6a28802 100644 --- a/Core/Command.cs +++ b/Core/Command.cs @@ -2837,6 +2837,7 @@ private void ListSettings() EchoText("parsegameonly=" + oGlobals.Config.bParseGameOnly.ToString() + System.Environment.NewLine); EchoText("prompt=" + oGlobals.Config.sPrompt + System.Environment.NewLine); EchoText("promptbreak=" + oGlobals.Config.PromptBreak + System.Environment.NewLine); + EchoText("promptforce=" + oGlobals.Config.PromptForce + System.Environment.NewLine); EchoText("condensed=" + oGlobals.Config.Condensed + System.Environment.NewLine); EchoText("reconnect=" + oGlobals.Config.bReconnect.ToString() + System.Environment.NewLine); EchoText("roundtimeoffset=" + oGlobals.Config.dRTOffset + System.Environment.NewLine); diff --git a/Core/Game.cs b/Core/Game.cs index 2d02be6..39e074a 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -785,6 +785,11 @@ public void ParseGameRow(string sText) { m_bBold = false; } + + if (m_oGlobals.Config.PromptForce && m_oTargetWindow == WindowTarget.Main) + { + PrintTextWithParse(m_oGlobals.Config.sPrompt, true, 0); + } } } diff --git a/Lists/Config.cs b/Lists/Config.cs index 11e831d..be4fd76 100644 --- a/Lists/Config.cs +++ b/Lists/Config.cs @@ -49,6 +49,7 @@ public class Config public string sLogDir = "Logs"; public bool PromptBreak { get; set; } = true; + public bool PromptForce { get; set; } = false; public bool Condensed { get; set; } = false; public bool CheckForUpdates { get; set; } = true; public bool AutoUpdate { get; set; } = false; @@ -356,6 +357,7 @@ public bool Save(string sFileName = "settings.cfg") oStreamWriter.WriteLine("#config {editor} {" + sEditor + "}"); oStreamWriter.WriteLine("#config {prompt} {" + sPrompt + "}"); oStreamWriter.WriteLine("#config {promptbreak} {" + PromptBreak + "}"); + oStreamWriter.WriteLine("#config {promptforce} {" + PromptForce + "}"); oStreamWriter.WriteLine("#config {condensed} {" + Condensed + "}"); oStreamWriter.WriteLine("#config {monstercountignorelist} {" + sIgnoreMonsterList + "}"); oStreamWriter.WriteLine("#config {scripttimeout} {" + iScriptTimeout + "}"); @@ -683,7 +685,26 @@ public List SetSetting(string sKey, string sValue = "", bool bShowExcept } break; } + case "promptforce": + { + switch (sValue.ToLower()) + { + case "on": + case "true": + case "1": + { + PromptForce = true; + break; + } + default: + { + PromptForce = false; + break; + } + } + break; + } case "condensed": { switch (sValue.ToLower()) From 575e53cd3d7d5d8e5e494c2829773277232ec680 Mon Sep 17 00:00:00 2001 From: Djordje Date: Thu, 7 Apr 2022 22:35:56 -0400 Subject: [PATCH 24/50] Changed method for inserting prompt to populate prompt with data --- Core/Game.cs | 189 +++++++++++++++++++++++++++++++++++++++++++--- Forms/FormMain.cs | 8 +- 2 files changed, 181 insertions(+), 16 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 39e074a..bbe9890 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -522,6 +522,7 @@ public void ParseGameRow(string sText) string sBoldBuffer = string.Empty; char cPreviousChar = Conversions.ToChar(""); bool bCombatRow = false; + bool bPromptRow = false; // Fix for DR html encoding problems if (sText.StartsWith("< ")) @@ -618,6 +619,13 @@ public void ParseGameRow(string sText) } sTextBuffer += sTmp; + if (buffer.EndsWith("")) + { + XmlDocument doc = new XmlDocument(); + doc.LoadXml(buffer); + CreatePrompt(doc.DocumentElement); + } + m_oXMLBuffer.Clear(); oXMLBuffer.Clear(); } @@ -786,8 +794,9 @@ public void ParseGameRow(string sText) m_bBold = false; } - if (m_oGlobals.Config.PromptForce && m_oTargetWindow == WindowTarget.Main) + if (bPromptRow && m_oGlobals.Config.PromptForce && m_oTargetWindow == WindowTarget.Main) { + bPromptRow = false; PrintTextWithParse(m_oGlobals.Config.sPrompt, true, 0); } } @@ -2092,7 +2101,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) case "prompt": { string strBuffer = GetTextFromXML(oXmlNode); - if (m_bStatusPromptEnabled == false) + if (m_bStatusPromptEnabled) { if ((strBuffer ?? "") != ">") { @@ -2230,18 +2239,17 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) string argvalue18 = "0"; m_oGlobals.VariableList.Add(argkey43, argvalue18, Globals.Variables.VariableType.Reserved); } - string argsVariable40 = "$roundtime"; VariableChanged(argsVariable40); - if (m_oGlobals.Config.sPrompt.Length > 0) + + if (m_oGlobals.Config.sPrompt.Length > 0 && !m_bLastRowWasPrompt) { - strBuffer = strBuffer.Replace(">", ""); + strBuffer = strBuffer.Replace(m_oGlobals.Config.sPrompt.Trim(), ""); strBuffer += m_oGlobals.Config.sPrompt; bool argbIsPrompt = true; WindowTarget argoWindowTarget = 0; - - PrintTextWithParse(strBuffer, argbIsPrompt, oWindowTarget: argoWindowTarget); - + + PrintTextWithParse(strBuffer, argbIsPrompt, oWindowTarget: argoWindowTarget); } string argkey44 = "prompt"; @@ -2469,6 +2477,168 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) return sReturn; } + public void CreatePrompt(XmlNode oXmlNode) + { + string strBuffer = GetTextFromXML(oXmlNode); + if (m_bStatusPromptEnabled) + { + if ((strBuffer ?? "") != ">") + { + m_bStatusPromptEnabled = true; + + // Fix for Joined and Bleeding + if (strBuffer.Contains("J") == false) + { + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oGlobals.VariableList["joined"], "1", false))) + { + string argkey37 = "joined"; + string argvalue13 = "0"; + m_oGlobals.VariableList.Add(argkey37, argvalue13, Globals.Variables.VariableType.Reserved); + string argsVariable35 = "$joined"; + VariableChanged(argsVariable35); + } + } + + if (strBuffer.Contains("!") == false) + { + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oGlobals.VariableList["bleeding"], "1", false))) + { + string argkey38 = "bleeding"; + string argvalue14 = "0"; + m_oGlobals.VariableList.Add(argkey38, argvalue14, Globals.Variables.VariableType.Reserved); + string argsVariable36 = "$bleeding"; + VariableChanged(argsVariable36); + } + } + } + else if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Dead], true, false))) + { + strBuffer += "DEAD"; + } + else + { + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Kneeling], true, false))) + { + strBuffer += "K"; + } + + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Sitting], true, false))) + { + strBuffer += "s"; + } + + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Prone], true, false))) + { + strBuffer += "P"; + } + + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Stunned], true, false))) + { + strBuffer += "S"; + } + + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Hidden], true, false))) + { + strBuffer += "H"; + } + + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Invisible], true, false))) + { + strBuffer += "I"; + } + + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Webbed], true, false))) + { + strBuffer += "W"; + } + + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Bleeding], true, false))) + { + strBuffer += "!"; + } + + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Joined], true, false))) + { + strBuffer += "J"; + } + } + } + else + { + // Fix for Joined and Bleeding + if (strBuffer.Contains("J") == false) + { + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oGlobals.VariableList["joined"], "1", false))) + { + string argkey39 = "joined"; + string argvalue15 = "0"; + m_oGlobals.VariableList.Add(argkey39, argvalue15, Globals.Variables.VariableType.Reserved); + string argsVariable37 = "$joined"; + VariableChanged(argsVariable37); + } + } + + if (strBuffer.Contains("!") == false) + { + if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oGlobals.VariableList["bleeding"], "1", false))) + { + string argkey40 = "bleeding"; + string argvalue16 = "0"; + m_oGlobals.VariableList.Add(argkey40, argvalue16, Globals.Variables.VariableType.Reserved); + string argsVariable38 = "$bleeding"; + VariableChanged(argsVariable38); + } + } + } + + // Dim strBuffer As String = String.Empty + + string argstrAttributeName25 = "time"; + if (int.TryParse(GetAttributeData(oXmlNode, argstrAttributeName25), out m_iGameTime)) + { + string argkey41 = "gametime"; + string argvalue17 = m_iGameTime.ToString(); + m_oGlobals.VariableList.Add(argkey41, argvalue17, Globals.Variables.VariableType.Reserved); + string argsVariable39 = "$gametime"; + VariableChanged(argsVariable39); + int rt = m_iRoundTime - m_iGameTime; + if (rt > 0) + { + SetRoundTime(rt); + if (m_bStatusPromptEnabled == false) + strBuffer += "R"; + rt += Convert.ToInt32(m_oGlobals.Config.dRTOffset); + var rtString = rt.ToString(); + string argkey42 = "roundtime"; + m_oGlobals.VariableList.Add(argkey42, rtString, Globals.Variables.VariableType.Reserved); + } + else + { + string argkey43 = "roundtime"; + string argvalue18 = "0"; + m_oGlobals.VariableList.Add(argkey43, argvalue18, Globals.Variables.VariableType.Reserved); + } + string argsVariable40 = "$roundtime"; + VariableChanged(argsVariable40); + + if (m_oGlobals.Config.sPrompt.Length > 0 && !m_bLastRowWasPrompt) + { + strBuffer = strBuffer.Replace(m_oGlobals.Config.sPrompt.Trim(), ""); + strBuffer += m_oGlobals.Config.sPrompt; + bool argbIsPrompt = true; + WindowTarget argoWindowTarget = 0; + + PrintTextWithParse(strBuffer, argbIsPrompt, oWindowTarget: argoWindowTarget); + } + + string argkey44 = "prompt"; + m_oGlobals.VariableList.Add(argkey44, strBuffer, Globals.Variables.VariableType.Reserved); + string argsVariable41 = "$prompt"; + VariableChanged(argsVariable41); + EventTriggerPrompt?.Invoke(); + } + } + public void ResetIndicators() { m_oIndicatorHash[Indicator.Bleeding] = false; @@ -2923,8 +3093,9 @@ private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTa m_bLastRowWasBlank = true; } - else if (Regex.IsMatch(text, @"^.*\" + m_oGlobals.Config.sPrompt + "?$")) + else if (Regex.IsMatch(text, @"^.*\" + m_oGlobals.Config.sPrompt + "?$") && !m_oGlobals.Config.PromptForce) { + m_bLastRowWasPrompt = true; if (m_bLastRowWasBlank) { return; diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index 22d9fd6..c1be968 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -4522,7 +4522,6 @@ private void AddText(string sText, [Optional, DefaultParameterValue(Genie.Game.W private void AddText(string sText, Color oColor, Color oBgColor, FormSkin oTargetWindow, bool bNoCache = true, bool bMono = false, bool bPrompt = false, bool bInput = false) { if (sText == "\r\n" && m_oGlobals.Config.Condensed) return; - bPrompt = false; if (IsDisposed) { @@ -4538,17 +4537,13 @@ private void AddText(string sText, Color oColor, Color oBgColor, FormSkin oTarge { if (bPrompt == true) { - if (m_oGame.LastRowWasPrompt) - { - return; - } - m_oGame.LastRowWasPrompt = true; } else if (sText.Trim().Length > 0) { if (m_oGame.LastRowWasPrompt == true) { + m_oGame.LastRowWasPrompt = false; if (!bInput) { if (sText.StartsWith(System.Environment.NewLine) == false && m_oGlobals.Config.PromptBreak) @@ -4556,7 +4551,6 @@ private void AddText(string sText, Color oColor, Color oBgColor, FormSkin oTarge sText = System.Environment.NewLine + sText; } } - } } } From 64a4a6d24d900b0496829e87ee9cc06353859596 Mon Sep 17 00:00:00 2001 From: Djordje Date: Thu, 7 Apr 2022 17:34:31 -0400 Subject: [PATCH 25/50] updated placement and flow of status prompt - should feel more like G3.6 --- Core/Game.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index bbe9890..627c2b4 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -3086,11 +3086,10 @@ private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTa { if (text.Trim().Length == 0) { - if (m_bLastRowWasBlank == true || m_bLastRowWasPrompt == true) + if (m_bLastRowWasBlank == true) { return; } - m_bLastRowWasBlank = true; } else if (Regex.IsMatch(text, @"^.*\" + m_oGlobals.Config.sPrompt + "?$") && !m_oGlobals.Config.PromptForce) @@ -3100,7 +3099,6 @@ private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTa { return; } - m_bLastRowWasPrompt = true; } else { From b05613fdce18e690b49154057715d8b5a21a8008 Mon Sep 17 00:00:00 2001 From: LaegotKit <100539902+LaegotKit@users.noreply.github.com> Date: Sun, 15 May 2022 22:40:30 -0400 Subject: [PATCH 26/50] Prompt, script/action, alias fixes --- Core/Game.cs | 39 ++++++++++++++------------------- Forms/ConfigPanels/UCAliases.cs | 2 +- Forms/FormMain.cs | 16 +++++++++----- Script/Script.cs | 4 ++++ 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 627c2b4..8aabc9e 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -601,7 +601,10 @@ public void ParseGameRow(string sText) } if (buffer.EndsWith(@"")) { - m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer)); + if (sBoldBuffer != "") + { + m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer)); + } } if (m_bBold) { @@ -619,7 +622,7 @@ public void ParseGameRow(string sText) } sTextBuffer += sTmp; - if (buffer.EndsWith("")) + if (buffer.EndsWith("<&/prompt>")) { XmlDocument doc = new XmlDocument(); doc.LoadXml(buffer); @@ -794,7 +797,7 @@ public void ParseGameRow(string sText) m_bBold = false; } - if (bPromptRow && m_oGlobals.Config.PromptForce && m_oTargetWindow == WindowTarget.Main) + if (bPromptRow && m_oGlobals.Config.PromptForce && m_oTargetWindow == WindowTarget.Main) //prompforce { bPromptRow = false; PrintTextWithParse(m_oGlobals.Config.sPrompt, true, 0); @@ -1231,7 +1234,7 @@ private void ParseKeyRow(string sText) private string ProcessXMLNodeElement(XmlNode oXmlNode) { string sReturn = string.Empty; - Debug.WriteLine(oXmlNode.Name); + // Debug.WriteLine(oXmlNode.Name); if (oXmlNode.NodeType == XmlNodeType.Element) { var switchExpr = oXmlNode.Name; @@ -2226,7 +2229,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) if (rt > 0) { SetRoundTime(rt); - if (m_bStatusPromptEnabled == false) + if (m_bStatusPromptEnabled == true) strBuffer += "R"; rt += Convert.ToInt32(m_oGlobals.Config.dRTOffset); var rtString = rt.ToString(); @@ -2248,7 +2251,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) strBuffer += m_oGlobals.Config.sPrompt; bool argbIsPrompt = true; WindowTarget argoWindowTarget = 0; - + //prompting here PrintTextWithParse(strBuffer, argbIsPrompt, oWindowTarget: argoWindowTarget); } @@ -2480,7 +2483,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) public void CreatePrompt(XmlNode oXmlNode) { string strBuffer = GetTextFromXML(oXmlNode); - if (m_bStatusPromptEnabled) + if (!m_bStatusPromptEnabled) { if ((strBuffer ?? "") != ">") { @@ -2797,7 +2800,6 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI { if (sText.StartsWith(" You also see")) { - PrintTextWithParse("\r\n", color, bgcolor); sText = sText.TrimStart(); } @@ -2904,7 +2906,7 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTarget targetwindow = WindowTarget.Main, bool isprompt = false, bool isroomoutput = false) { - if (text.Length == 0) + if (text.Length == 0 || (m_oGlobals.Config.Condensed && text.Trim().Length == 0)) { return; } @@ -2988,6 +2990,7 @@ private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTa case WindowTarget.Other: { + // Debug.Write("Target Window is " + targetwindow.ToString()); sTargetWindowString = m_sTargetWindow.ToLower(); break; } @@ -3086,26 +3089,17 @@ private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTa { if (text.Trim().Length == 0) { - if (m_bLastRowWasBlank == true) + if (m_bLastRowWasBlank == true | m_bLastRowWasPrompt == true) { return; } + m_bLastRowWasBlank = true; } - else if (Regex.IsMatch(text, @"^.*\" + m_oGlobals.Config.sPrompt + "?$") && !m_oGlobals.Config.PromptForce) - { - m_bLastRowWasPrompt = true; - if (m_bLastRowWasBlank) - { - return; - } - } else { - m_bLastRowWasPrompt = false; m_bLastRowWasBlank = false; } - } if (targetwindow == WindowTarget.Main | targetwindow == WindowTarget.Thoughts | targetwindow == WindowTarget.Combat) @@ -3183,7 +3177,8 @@ private void PrintInputText(string sText, Color oColor, Color oBgColor) var trueVar = true; var falseVar = false; - EventPrintText?.Invoke(sText, oColor, oBgColor, windowVar, emptyVar, m_bMonoOutput, trueVar, falseVar); + // EventPrintText?.Invoke(sText, oColor, oBgColor, windowVar, emptyVar, m_bMonoOutput, trueVar, falseVar); + EventPrintText?.Invoke(sText, oColor, oBgColor, windowVar, emptyVar, m_bMonoOutput, falseVar, trueVar); } private void ClearWindow(string sWindow) @@ -3259,7 +3254,7 @@ private void GameSocket_EventConnected() m_oGlobals.VariableList.Add(argkey, argvalue, Globals.Variables.VariableType.Reserved); string argsVariable = "$connected"; VariableChanged(argsVariable); - m_bStatusPromptEnabled = false; + m_bStatusPromptEnabled = true; break; } } diff --git a/Forms/ConfigPanels/UCAliases.cs b/Forms/ConfigPanels/UCAliases.cs index 21dab38..0ddc385 100644 --- a/Forms/ConfigPanels/UCAliases.cs +++ b/Forms/ConfigPanels/UCAliases.cs @@ -182,7 +182,7 @@ public bool ApplyChanges() if (!Information.IsNothing(GroupBoxBase.Tag)) { - foreach (ListViewItem li in (Genie.Collections.ArrayList)GroupBoxBase.Tag) + foreach (ListViewItem li in (ArrayList)GroupBoxBase.Tag) { if (TextBoxAlias.Enabled == true) // Single edit { diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index c1be968..cb93023 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -4519,9 +4519,9 @@ private void AddText(string sText, [Optional, DefaultParameterValue(Genie.Game.W AddText(sText, argoColor, argoBgColor, oTargetWindow, argsTargetWindow, bMono, bPrompt, bInput); } - private void AddText(string sText, Color oColor, Color oBgColor, FormSkin oTargetWindow, bool bNoCache = true, bool bMono = false, bool bPrompt = false, bool bInput = false) + private void AddText(string sText, Color oColor, Color oBgColor, FormSkin oTargetWindow, bool bNoCache = true, bool bMono = false, bool bPrompt = false, bool bInput = false) { - if (sText == "\r\n" && m_oGlobals.Config.Condensed) return; + // bPrompt = false; if (IsDisposed) { @@ -4537,20 +4537,26 @@ private void AddText(string sText, Color oColor, Color oBgColor, FormSkin oTarge { if (bPrompt == true) { + if (m_oGame.LastRowWasPrompt) + { + return; + } + m_oGame.LastRowWasPrompt = true; } else if (sText.Trim().Length > 0) { if (m_oGame.LastRowWasPrompt == true) { - m_oGame.LastRowWasPrompt = false; if (!bInput) { - if (sText.StartsWith(System.Environment.NewLine) == false && m_oGlobals.Config.PromptBreak) + if (sText.StartsWith(Constants.vbNewLine) == false && m_oGlobals.Config.PromptBreak) { - sText = System.Environment.NewLine + sText; + sText = Constants.vbNewLine + sText; } } + + m_oGame.LastRowWasPrompt = false; } } } diff --git a/Script/Script.cs b/Script/Script.cs index 1b2b5d3..048befc 100644 --- a/Script/Script.cs +++ b/Script/Script.cs @@ -2966,6 +2966,10 @@ private void EvalAction(string sText, int iFileId, int iFileRow) case "remove": { string argsText2 = Utility.GetArgumentString(sText); + if (argsText2.ToLower().StartsWith("eval ") == false) + { + argsText2 = ParseVariables(argsText2); + } m_oActions.Remove(argsText2); return; } From a4d019febdec8277c3476aca65638efcdeff0208 Mon Sep 17 00:00:00 2001 From: LaegotKit <100539902+LaegotKit@users.noreply.github.com> Date: Tue, 24 May 2022 13:21:26 -0400 Subject: [PATCH 27/50] Added comments for prompt tracking --- Core/Game.cs | 4 ++-- Script/Eval.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 8aabc9e..154b4df 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -797,7 +797,7 @@ public void ParseGameRow(string sText) m_bBold = false; } - if (bPromptRow && m_oGlobals.Config.PromptForce && m_oTargetWindow == WindowTarget.Main) //prompforce + if (bPromptRow && m_oGlobals.Config.PromptForce && m_oTargetWindow == WindowTarget.Main) //Prompforce , but bPromptRow has no way to be set to true { bPromptRow = false; PrintTextWithParse(m_oGlobals.Config.sPrompt, true, 0); @@ -2251,7 +2251,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) strBuffer += m_oGlobals.Config.sPrompt; bool argbIsPrompt = true; WindowTarget argoWindowTarget = 0; - //prompting here + //Status prompt set from the XML printing to main/game PrintTextWithParse(strBuffer, argbIsPrompt, oWindowTarget: argoWindowTarget); } diff --git a/Script/Eval.cs b/Script/Eval.cs index ceb5778..50ba862 100644 --- a/Script/Eval.cs +++ b/Script/Eval.cs @@ -267,7 +267,7 @@ private void Parse(string sText) } // Parse the oSections object - ShowQueue(); + //ShowQueue(); // ShowQueue(); //additional debug info for evals also uncomment the debug line in this method if its needed. Commented out for better clarity for debugging new issues. ParseQueue(); // ShowQueue() @@ -637,7 +637,7 @@ private bool ParseCompare(int iArgLeft, int iArgRight, int iComparer, bool bSkip { sLeftValue = ((Sections)oSections[iArgLeft]).sBlock; sRightValue = ((Sections)oSections[iArgRight]).sBlock; - Debug.Print("Compare Left: " + sLeftValue + ", Compare Right: " + sRightValue); + //Debug.Print("Compare Left: " + sLeftValue + ", Compare Right: " + sRightValue); //additional debug info for evals. Commented out for better clarity for debugging new issues. } if (bSkipAndOr == true) From a3b190837c26f30338bc271070f6dd0818ddadaf Mon Sep 17 00:00:00 2001 From: Djordje Date: Tue, 24 May 2022 21:22:58 -0400 Subject: [PATCH 28/50] Reverted ArrayList changes --- Core/Command.cs | 12 +++--- Core/Game.cs | 1 - Forms/Components/ComponentTextBox.cs | 2 +- Forms/FormMain.cs | 10 ++--- Forms/FormPlugins.cs | 4 +- Lists/Classes.cs | 4 +- Lists/Globals.cs | 16 ++++---- Lists/Highlights.cs | 6 +-- Lists/Names.cs | 2 +- Script/Eval.cs | 2 +- Script/MathEval.cs | 4 +- Script/Script.cs | 22 +++++----- Utility/PluginServices.cs | 6 +-- Utility/Utility.cs | 61 ++++++++++++++++++++++++---- 14 files changed, 99 insertions(+), 53 deletions(-) diff --git a/Core/Command.cs b/Core/Command.cs index 6a28802..094cb64 100644 --- a/Core/Command.cs +++ b/Core/Command.cs @@ -246,7 +246,7 @@ public string ParseCommand(string sText, bool bSendToGame = false, bool bUserInp if (sRow.Trim().StartsWith(Conversions.ToString(oGlobals.Config.cCommandChar))) { // Get result from function then send result to game - var oArgs = new Genie.Collections.ArrayList(); + var oArgs = new ArrayList(); oArgs = Utility.ParseArgs(sRow); if (oArgs.Count > 0) { @@ -2483,7 +2483,7 @@ public string ParseCommand(string sText, bool bSendToGame = false, bool bUserInp return sResult; } - private void Do(Genie.Collections.ArrayList oArgs) + private void Do(ArrayList oArgs) { if (oArgs.Count > 1) { @@ -2522,7 +2522,7 @@ private void Do(Genie.Collections.ArrayList oArgs) } } } - private void Send(Genie.Collections.ArrayList oArgs) + private void Send(ArrayList oArgs) { if (oArgs.Count > 1) { @@ -2561,7 +2561,7 @@ private void Send(Genie.Collections.ArrayList oArgs) } } } - private void Connect(Genie.Collections.ArrayList args, bool isLich = false) + private void Connect(ArrayList args, bool isLich = false) { if (args.Count == 1) { @@ -2666,7 +2666,7 @@ private string GetArgumentString(string strRow) private string ParseAlias(string sText) { string sResult = ""; - var oArgs = new Genie.Collections.ArrayList(); + var oArgs = new ArrayList(); oArgs = Utility.ParseArgs(sText); string sKey = GetKeywordString(sText); if (oGlobals.AliasList.ContainsKey(sKey) == true) @@ -2774,7 +2774,7 @@ private void SendTextToGame(string sText, [Optional, DefaultParameterValue(false // Return sResult // End Function - private string ParseAllArgs(Genie.Collections.ArrayList oList, int iStartIndex = 1, bool bParseQuickSend = true) + private string ParseAllArgs(ArrayList oList, int iStartIndex = 1, bool bParseQuickSend = true) { string sResult = string.Empty; string sCommand = string.Empty; diff --git a/Core/Game.cs b/Core/Game.cs index 154b4df..d9f8bf3 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -3287,7 +3287,6 @@ private string ParsePluginText(string sText, string sWindow) { if (m_oGlobals.PluginsEnabled == false) return sText; - foreach (object oPlugin in m_oGlobals.PluginList) { if(oPlugin is GeniePlugin.Interfaces.IPlugin) diff --git a/Forms/Components/ComponentTextBox.cs b/Forms/Components/ComponentTextBox.cs index e69f24a..e577385 100644 --- a/Forms/Components/ComponentTextBox.cs +++ b/Forms/Components/ComponentTextBox.cs @@ -25,7 +25,7 @@ public ComponentTextBox() public delegate void PageDownEventHandler(); - private Genie.Collections.ArrayList HistoryArray = new Genie.Collections.ArrayList(); + private ArrayList HistoryArray = new ArrayList(); private int HistoryPos = -1; private int HistorySize = 20; private int HistoryMinLenght = 3; diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index cb93023..56ee0d2 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -36,7 +36,7 @@ public FormMain() // Add any initialization after the InitializeComponent() call. LocalDirectory.CheckUserDirectory(); bool bCustomConfigFile = false; - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); al = Utility.ParseArgs(Interaction.Command()); foreach (string cmd in al) { @@ -513,7 +513,7 @@ private FormSkin m_oOutputMain // Private WithEvents m_oWorker As New System.ComponentModel.BackgroundWorker // Private m_bRunWorker As Boolean = True - public Genie.Collections.ArrayList FormList + public ArrayList FormList { get { @@ -2901,7 +2901,7 @@ private void AddScriptToToolStrip(Script oScript) } } - private Script LoadScript(string sScriptName, Genie.Collections.ArrayList oArgList) + private Script LoadScript(string sScriptName, ArrayList oArgList) { if (m_oGlobals.Config.bAbortDupeScript == true) { @@ -4135,7 +4135,7 @@ private void ClassCommand_RunScript(string sText) { try { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); al = Utility.ParseArgs(sText, true); string ScriptName = Conversions.ToString(al[0].ToString().ToLower().Trim().Substring(1)); if (ScriptName.EndsWith(".cmd") == false) @@ -6550,7 +6550,7 @@ private void Config_ConfigChanged(Genie.Config.ConfigFieldUpdated oField) private void Command_EventClassChange() { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); if (m_oGlobals.ClassList.AcquireReaderLock()) { try diff --git a/Forms/FormPlugins.cs b/Forms/FormPlugins.cs index fe9edfd..f94776e 100644 --- a/Forms/FormPlugins.cs +++ b/Forms/FormPlugins.cs @@ -13,7 +13,7 @@ public FormPlugins() InitializeComponent(); } - public FormPlugins(ref Genie.Collections.ArrayList pluginList) + public FormPlugins(ref ArrayList pluginList) { // This call is required by the designer. InitializeComponent(); @@ -54,7 +54,7 @@ public void ReloadList() } } - private Genie.Collections.ArrayList m_PluginList; + private ArrayList m_PluginList; private void PopulatePluginList() { diff --git a/Lists/Classes.cs b/Lists/Classes.cs index b625993..00d9043 100644 --- a/Lists/Classes.cs +++ b/Lists/Classes.cs @@ -10,7 +10,7 @@ public class Classes : Collections.SortedList { public void ActivateAll() { - var oList = new Genie.Collections.ArrayList(); + var oList = new ArrayList(); if (AcquireReaderLock()) { try @@ -33,7 +33,7 @@ public void ActivateAll() public void InActivateAll() { - var oList = new Genie.Collections.ArrayList(); + var oList = new ArrayList(); if (AcquireReaderLock()) { try diff --git a/Lists/Globals.cs b/Lists/Globals.cs index c2eeece..2402186 100644 --- a/Lists/Globals.cs +++ b/Lists/Globals.cs @@ -63,7 +63,7 @@ public Config Config public GagRegExp GagList = new GagRegExp(); public string GenieKey = string.Empty; public string GenieAccount = string.Empty; - public Collections.ArrayList PluginList = new Collections.ArrayList(); + public ArrayList PluginList = new ArrayList(); public bool PluginsEnabled = true; public Hashtable PluginVerifiedKeyList = new Hashtable(); public Hashtable PluginPremiumKeyList = new Hashtable(); @@ -605,7 +605,7 @@ public void ClearUser() { if (AcquireReaderLock()) { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); try { foreach (string s in base.Keys) @@ -928,7 +928,7 @@ public void ToggleClass(string ClassName, bool Value) { if (AcquireReaderLock()) { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); try { foreach (string s in base.Keys) @@ -1171,7 +1171,7 @@ public void ToggleClass(string ClassName, bool Value) { if (AcquireReaderLock()) { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); try { foreach (string s in base.Keys) @@ -1289,7 +1289,7 @@ public void ToggleClass(string ClassName, bool Value) { if (AcquireReaderLock()) { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); try { foreach (string s in base.Keys) @@ -1437,7 +1437,7 @@ public void ToggleClass(string ClassName, bool Value) { if (AcquireReaderLock()) { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); try { for (int I = 0, loopTo = base.Count - 1; I <= loopTo; I++) @@ -1665,7 +1665,7 @@ public void ToggleClass(string ClassName, bool Value) { if (AcquireReaderLock()) { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); try { for (int I = 0, loopTo = base.Count - 1; I <= loopTo; I++) @@ -1976,7 +1976,7 @@ public bool LoadHighlights(string sFileName = "highlights.cfg") private void AddHighlight(string sLine) { - var oArgs = new Genie.Collections.ArrayList(); + var oArgs = new ArrayList(); oArgs = Utility.ParseArgs(sLine); if (oArgs.Count > 0) { diff --git a/Lists/Highlights.cs b/Lists/Highlights.cs index b7c0fb9..d3fb833 100644 --- a/Lists/Highlights.cs +++ b/Lists/Highlights.cs @@ -40,7 +40,7 @@ public void ToggleClass(string ClassName, bool Value) { if (AcquireReaderLock()) { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); try { foreach (string s in base.Keys) @@ -145,7 +145,7 @@ public void RebuildStringIndex() { try { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); foreach (string s in base.Keys) { if (((Highlight)base[s]).IsActive == true) @@ -193,7 +193,7 @@ public void RebuildLineIndex() { try { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); foreach (string s in base.Keys) { if (((Highlight)base[s]).IsActive == true) diff --git a/Lists/Names.cs b/Lists/Names.cs index d09d0f0..84c6586 100644 --- a/Lists/Names.cs +++ b/Lists/Names.cs @@ -90,7 +90,7 @@ public int Remove(string sKey) public void RebuildIndex() { - var al = new Genie.Collections.ArrayList(); + var al = new ArrayList(); foreach (string s in base.Keys) al.Add(s); al.Sort(); diff --git a/Script/Eval.cs b/Script/Eval.cs index 50ba862..5b6c172 100644 --- a/Script/Eval.cs +++ b/Script/Eval.cs @@ -873,7 +873,7 @@ private void ParseFunction(int iStart, int iEnd) throw new Exception("Invalid argument to ParseFunction()"); } - Genie.Collections.ArrayList args; + ArrayList args; args = BuildArgs(iStart, iEnd); var switchExpr = ((Sections)oSections[iStart]).sBlock.ToLower(); switch (switchExpr) diff --git a/Script/MathEval.cs b/Script/MathEval.cs index c8004ee..b1bbd63 100644 --- a/Script/MathEval.cs +++ b/Script/MathEval.cs @@ -63,13 +63,13 @@ private enum TOKENCLASS private string[] m_funcs = new[] { "sin", "cos", "tan", "arcsin", "arccos", "arctan", "sqrt", "max", "min", "floor", "ceiling", "log", "log10", "ln", "round", "abs", "neg", "pos" }; - private Genie.Collections.ArrayList m_operators; + private ArrayList m_operators; private Stack m_stack = new Stack(); private void init_operators() { ClassSymbol op; - m_operators = new Genie.Collections.ArrayList(); + m_operators = new ArrayList(); op = new ClassSymbol(); op.Token = "-"; op.Cls = TOKENCLASS.OPERATORTOKEN; diff --git a/Script/Script.cs b/Script/Script.cs index 048befc..717777f 100644 --- a/Script/Script.cs +++ b/Script/Script.cs @@ -35,12 +35,12 @@ private class Line public int iIndex = 0; public bool bSkipBlock = false; public int iBlockDepth = 0; - public Genie.Collections.ArrayList oBlockList = new Genie.Collections.ArrayList(); - public Genie.Collections.ArrayList oArgList = new Genie.Collections.ArrayList(); + public ArrayList oBlockList = new ArrayList(); + public ArrayList oArgList = new ArrayList(); public bool bLastRowWasEvaluation = false; } - private Genie.Collections.ArrayList oLineList = new Genie.Collections.ArrayList(); + private ArrayList oLineList = new ArrayList(); public enum BlockState { @@ -79,7 +79,7 @@ public bool RemoveBlock() } } - public Genie.Collections.ArrayList ArgList + public ArrayList ArgList { get { @@ -481,7 +481,7 @@ public void SetClass(string name, bool status) } } - public class ClassMatchList : Genie.Collections.ArrayList + public class ClassMatchList : ArrayList { public class Match { @@ -641,8 +641,8 @@ public enum ScriptState private Genie.Script.Eval m_oEval = new Genie.Script.Eval(); private Genie.Script.MathEval m_oEvalMath = new Genie.Script.MathEval(); - private Genie.Collections.ArrayList m_oScript = new Genie.Collections.ArrayList(); - private Genie.Collections.ArrayList m_oScriptFiles = new Genie.Collections.ArrayList(); + private ArrayList m_oScript = new ArrayList(); + private ArrayList m_oScriptFiles = new ArrayList(); private Hashtable m_oScriptLabels = new Hashtable(); private Dictionary> ScriptInternalLabels; private CurrentLine m_oCurrentLine = new CurrentLine(); @@ -1287,7 +1287,7 @@ public void TriggerParse(string text, bool bBufferWait = true) m_oRegMatch = ((ClassActionList.Action)de.Value).oRegExp.Match(text); if (m_oRegMatch.Success) { - var ActionRegExpArg = new Genie.Collections.ArrayList(); + var ActionRegExpArg = new ArrayList(); if (m_oRegMatch.Groups.Count > 0) { int J; @@ -1385,7 +1385,7 @@ public void TriggerVariableChanged(string sVariableName) // When variables chang if (s.Length > 0 & (s ?? "") != "0") { - ParseAction(de.Key.ToString(), new Genie.Collections.ArrayList(), sVariableName); + ParseAction(de.Key.ToString(), new ArrayList(), sVariableName); if (m_oActions.Count == 0) // Script Aborted { return; @@ -1951,7 +1951,7 @@ public bool LoadFile(string sFile, bool bClear = true) return default; } - public bool LoadFile(string strFile, Genie.Collections.ArrayList al) + public bool LoadFile(string strFile, ArrayList al) { if (Monitor.TryEnter(m_oThreadLock, m_iDefaultTimeout)) { @@ -2006,7 +2006,7 @@ private string GetFileName(int index = 0) return string.Empty; } - private void ParseAction(string sKey, Genie.Collections.ArrayList oArgs, string sTriggerText) + private void ParseAction(string sKey, ArrayList oArgs, string sTriggerText) { if (m_oActions.ContainsKey(sKey) == false) { diff --git a/Utility/PluginServices.cs b/Utility/PluginServices.cs index 0f20673..780f40e 100644 --- a/Utility/PluginServices.cs +++ b/Utility/PluginServices.cs @@ -26,7 +26,7 @@ public static class Interfaces public static AvailablePlugin[] FindPlugins(string strPath) { - var Plugins = new Genie.Collections.ArrayList(); + var Plugins = new ArrayList(); string[] strDLLs; int intIndex; Assembly objDLL; @@ -77,7 +77,7 @@ public static AvailablePlugin FindPlugin(string strFile, string strInterface) object strKey = Utility.GenerateKeyHash(argsText); var readAllBytes = File.ReadAllBytes(strFile); objDLL = Assembly.Load(readAllBytes); - var Plugins = new Genie.Collections.ArrayList(); + var Plugins = new ArrayList(); ExamineAssembly(objDLL, strFile, Conversions.ToString(strKey), Plugins); if (Plugins.Count != 0) { @@ -101,7 +101,7 @@ public static string GetMD5HashFromFile(string fileName) return sb.ToString(); } - private static void ExamineAssembly(Assembly objDLL, string AssemblyPath, string strKey, Genie.Collections.ArrayList Plugins) + private static void ExamineAssembly(Assembly objDLL, string AssemblyPath, string strKey, ArrayList Plugins) { Type objInterface; AvailablePlugin Plugin; diff --git a/Utility/Utility.cs b/Utility/Utility.cs index 9514e8d..ce6ae9a 100644 --- a/Utility/Utility.cs +++ b/Utility/Utility.cs @@ -304,7 +304,54 @@ public static double GetTimeDiffInMilliseconds(DateTime oDateStart, DateTime oDa return span.TotalMilliseconds; } - public static string ArrayToString(Genie.Collections.ArrayList oList) + // Public Shared Function SafeSplit(BysInput As String, BycSplitChar As Char) As ArrayList + // Dim oList As New ArrayList() + + // Dim bInsideString As Boolean = False + // Dim cInsideStringChar As Char + // Dim iBracketDepth As Integer = 0 + // Dim bPreviousWasEscapeChar As Boolean = False + + // Dim ch As Char + // Dim l As Integer = 0 + // Dim sp As Integer = 0 + + // For cp As Integer = 0 To sInput.Length - 1 + // ch = sInput.Chars(cp) + + // If bInsideString = True Then + // If ch = cInsideStringChar Then + // bInsideString = False + // End If + // ElseIf (ch = """"c) And bPreviousWasEscapeChar = False Then ' Or ch = "'"c + // bInsideString = True + // cInsideStringChar = ch + // ElseIf ch = cSplitChar And bPreviousWasEscapeChar = False Then + // If iBracketDepth = 0 Then + // l = (cp - sp) + // If l > 0 Then + // oList.Add(sInput.Substring(sp, l)) + // End If + // sp = cp + 1 ' +1 So we don't get the split char + // End If + // End If + + // If ch = "\"c Then + // bPreviousWasEscapeChar = Not bPreviousWasEscapeChar + // Else + // bPreviousWasEscapeChar = False + // End If + // Next + + // l = (sInput.Length - sp) + // If l > 0 Then + // oList.Add(sInput.Substring(sp)) + // End If + + // Return oList + // End Function + + public static string ArrayToString(ArrayList oList) { string sReturnText = string.Empty; foreach (string sText in oList) @@ -331,9 +378,9 @@ public static string GenerateAccountHashSecond(string sText) return GenerateHashSHA512(argsText); } - public static Genie.Collections.ArrayList ParseArgs(string sText, bool bTreatUnderscoreAsSpace = false) + public static ArrayList ParseArgs(string sText, bool bTreatUnderscoreAsSpace = false) { - var oList = new Genie.Collections.ArrayList(); + var oList = new ArrayList(); try { bool bInsideString = false; @@ -435,7 +482,7 @@ public static Genie.Collections.ArrayList ParseArgs(string sText, bool bTreatUnd return oList; } - public static void AddArrayItem(Genie.Collections.ArrayList oList, string sText, bool bTreatUnderscoreAsSpace = false) + public static void AddArrayItem(ArrayList oList, string sText, bool bTreatUnderscoreAsSpace = false) { if (sText.StartsWith("\"")) { @@ -652,7 +699,7 @@ public static DateTime AssemblyBuildDate(System.Reflection.Assembly a) } } - public static string ArrayToString(Genie.Collections.ArrayList oList, int iStartIndex) + public static string ArrayToString(ArrayList oList, int iStartIndex) { // This is for small strings. For large strings we would use StringBuilder string sReturnText = string.Empty; @@ -668,9 +715,9 @@ public static string ArrayToString(Genie.Collections.ArrayList oList, int iStart return sReturnText.Trim(); } - public static Genie.Collections.ArrayList SafeSplit(string sInput, char cSplitChar) + public static ArrayList SafeSplit(string sInput, char cSplitChar) { - var oList = new Genie.Collections.ArrayList(); + var oList = new ArrayList(); bool bInsideString = false; var cInsideStringChar = default(char); int iBracketDepth = 0; From fbfb3689c7e4703cc1aa200e2407904e5dc3b3ef Mon Sep 17 00:00:00 2001 From: Djordje Date: Tue, 24 May 2022 21:37:12 -0400 Subject: [PATCH 29/50] Converted ArrayList Properties to Genie.Collection.ArrayLists --- Core/Command.cs | 2 +- Core/Game.cs | 4 ++-- Forms/Components/ComponentTextBox.cs | 2 +- Forms/FormMain.cs | 2 +- Forms/FormPlugins.cs | 4 ++-- Lists/Globals.cs | 2 +- Script/Script.cs | 12 ++++++------ 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Core/Command.cs b/Core/Command.cs index 094cb64..8844d64 100644 --- a/Core/Command.cs +++ b/Core/Command.cs @@ -196,7 +196,7 @@ public class Command public event ListPluginsEventHandler ListPlugins; public delegate void ListPluginsEventHandler(); - + private Script.Eval m_oEval = new Script.Eval(); private Script.MathEval m_oMathEval = new Script.MathEval(); private Globals oGlobals; diff --git a/Core/Game.cs b/Core/Game.cs index d9f8bf3..8c8c6d3 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -1005,9 +1005,9 @@ private void ParseRow(string sText) } } - private ArrayList _CharacterList = new ArrayList(); + private Genie.Collections.ArrayList _CharacterList = new Genie.Collections.ArrayList(); - public ArrayList CharacterList + public Genie.Collections.ArrayList CharacterList { get { diff --git a/Forms/Components/ComponentTextBox.cs b/Forms/Components/ComponentTextBox.cs index e577385..e69f24a 100644 --- a/Forms/Components/ComponentTextBox.cs +++ b/Forms/Components/ComponentTextBox.cs @@ -25,7 +25,7 @@ public ComponentTextBox() public delegate void PageDownEventHandler(); - private ArrayList HistoryArray = new ArrayList(); + private Genie.Collections.ArrayList HistoryArray = new Genie.Collections.ArrayList(); private int HistoryPos = -1; private int HistorySize = 20; private int HistoryMinLenght = 3; diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index 56ee0d2..5823510 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -513,7 +513,7 @@ private FormSkin m_oOutputMain // Private WithEvents m_oWorker As New System.ComponentModel.BackgroundWorker // Private m_bRunWorker As Boolean = True - public ArrayList FormList + public Genie.Collections.ArrayList FormList { get { diff --git a/Forms/FormPlugins.cs b/Forms/FormPlugins.cs index f94776e..fe9edfd 100644 --- a/Forms/FormPlugins.cs +++ b/Forms/FormPlugins.cs @@ -13,7 +13,7 @@ public FormPlugins() InitializeComponent(); } - public FormPlugins(ref ArrayList pluginList) + public FormPlugins(ref Genie.Collections.ArrayList pluginList) { // This call is required by the designer. InitializeComponent(); @@ -54,7 +54,7 @@ public void ReloadList() } } - private ArrayList m_PluginList; + private Genie.Collections.ArrayList m_PluginList; private void PopulatePluginList() { diff --git a/Lists/Globals.cs b/Lists/Globals.cs index 2402186..9874e40 100644 --- a/Lists/Globals.cs +++ b/Lists/Globals.cs @@ -63,7 +63,7 @@ public Config Config public GagRegExp GagList = new GagRegExp(); public string GenieKey = string.Empty; public string GenieAccount = string.Empty; - public ArrayList PluginList = new ArrayList(); + public Genie.Collections.ArrayList PluginList = new Genie.Collections.ArrayList(); public bool PluginsEnabled = true; public Hashtable PluginVerifiedKeyList = new Hashtable(); public Hashtable PluginPremiumKeyList = new Hashtable(); diff --git a/Script/Script.cs b/Script/Script.cs index 717777f..4e2de4e 100644 --- a/Script/Script.cs +++ b/Script/Script.cs @@ -35,12 +35,12 @@ private class Line public int iIndex = 0; public bool bSkipBlock = false; public int iBlockDepth = 0; - public ArrayList oBlockList = new ArrayList(); - public ArrayList oArgList = new ArrayList(); + public Genie.Collections.ArrayList oBlockList = new Genie.Collections.ArrayList(); + public Genie.Collections.ArrayList oArgList = new Genie.Collections.ArrayList(); public bool bLastRowWasEvaluation = false; } - private ArrayList oLineList = new ArrayList(); + private Genie.Collections.ArrayList oLineList = new Genie.Collections.ArrayList(); public enum BlockState { @@ -79,7 +79,7 @@ public bool RemoveBlock() } } - public ArrayList ArgList + public Genie.Collections.ArrayList ArgList { get { @@ -641,8 +641,8 @@ public enum ScriptState private Genie.Script.Eval m_oEval = new Genie.Script.Eval(); private Genie.Script.MathEval m_oEvalMath = new Genie.Script.MathEval(); - private ArrayList m_oScript = new ArrayList(); - private ArrayList m_oScriptFiles = new ArrayList(); + private Genie.Collections.ArrayList m_oScript = new Genie.Collections.ArrayList(); + private Genie.Collections.ArrayList m_oScriptFiles = new Genie.Collections.ArrayList(); private Hashtable m_oScriptLabels = new Hashtable(); private Dictionary> ScriptInternalLabels; private CurrentLine m_oCurrentLine = new CurrentLine(); From 6911a491fe68c785a5b6b7faa02554753facdfc5 Mon Sep 17 00:00:00 2001 From: Djordje Date: Tue, 24 May 2022 21:37:35 -0400 Subject: [PATCH 30/50] Incremented Build Number --- Properties/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index d163643..ef2af44 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ // by using the '*' as shown below: // -[assembly: AssemblyVersion("4.0.2.310")] -[assembly: AssemblyFileVersion("4.0.2.310")] +[assembly: AssemblyVersion("4.0.2.311")] +[assembly: AssemblyFileVersion("4.0.2.311")] From 042bfdf13f228607f76e3bbf843f37d35e8d0134 Mon Sep 17 00:00:00 2001 From: Djordje Date: Wed, 25 May 2022 00:35:39 -0400 Subject: [PATCH 31/50] Injected a linebreak to the start of "You also see" when it is the only text at the beginning of a line --- Core/Game.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Core/Game.cs b/Core/Game.cs index 8c8c6d3..9b7e933 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -2800,7 +2800,9 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI { if (sText.StartsWith(" You also see")) { + PrintTextToWindow(Environment.NewLine, color, bgcolor); sText = sText.TrimStart(); + } if (m_sStyle.Length > 0) From 41fe9f4a0d859ef1ab55d730f1e17f2245bb5c3e Mon Sep 17 00:00:00 2001 From: LaegotKit <100539902+LaegotKit@users.noreply.github.com> Date: Fri, 27 May 2022 15:36:23 -0400 Subject: [PATCH 32/50] Volatile Highlights with subs Fix for Volatile Highlights with subs where it wont highlight subbed text --- Core/Game.cs | 55 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 8c8c6d3..efa4c28 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -588,6 +588,7 @@ public void ParseGameRow(string sText) default: break; } + sTmp = ParseSubstrings(sTmp); m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair(presetLabel, sTmp)); if(presetLabel == "roomdesc") { @@ -601,8 +602,9 @@ public void ParseGameRow(string sText) } if (buffer.EndsWith(@"")) { - if (sBoldBuffer != "") + if (!string.IsNullOrWhiteSpace(sBoldBuffer)) { + sBoldBuffer = ParseSubstrings(sBoldBuffer); m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer)); } } @@ -765,6 +767,7 @@ public void ParseGameRow(string sText) } else if (!string.IsNullOrWhiteSpace(sBoldBuffer)) { + sBoldBuffer = ParseSubstrings(sBoldBuffer); m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer.Trim())); //trim because excessive whitespace seems to be breaking this sBoldBuffer = string.Empty; } @@ -2800,7 +2803,7 @@ public void PrintTextWithParse(string sText, Color color, Color bgcolor, bool bI { if (sText.StartsWith(" You also see")) { - sText = sText.TrimStart(); + sText = System.Environment.NewLine + sText.TrimStart(); } if (m_sStyle.Length > 0) @@ -3045,9 +3048,10 @@ private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTa } } - if (text.Trim().Length > 0) + text = ParseSubstrings(text); + if (0 == 1)//(text.Trim().Length > 0) { - // Substitute Lists + // Substitute Lists Switch this to text = ParseSubstrings(text) so theres only one place subs are processed at if (m_oGlobals.SubstituteList.AcquireReaderLock()) { try @@ -3150,7 +3154,50 @@ private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTa var tempVar = false; EventPrintText?.Invoke(text, color, bgcolor, targetwindow, targetwindowstring, m_bMonoOutput, isprompt, tempVar); } + private String ParseSubstrings(string text) + { + if (text.Trim().Length > 0) + { + // Substitute Lists + if (m_oGlobals.SubstituteList.AcquireReaderLock()) + { + try + { + foreach (Globals.SubstituteRegExp.Substitute sl in m_oGlobals.SubstituteList) + { + if (sl.IsActive && !Information.IsNothing(sl.SubstituteRegex)) + { + if (sl.SubstituteRegex.Match(Utility.Trim(text)).Success) + { + bool bNewLineStart = text.StartsWith(System.Environment.NewLine); + bool bNewLineEnd = text.EndsWith(System.Environment.NewLine); + text = sl.SubstituteRegex.Replace(Utility.Trim(text), sl.sReplaceBy.ToString()); + if (bNewLineStart == true) + { + text = System.Environment.NewLine + text; + } + if (bNewLineEnd == true) + { + text += System.Environment.NewLine; + } + } + } + } + } + finally + { + m_oGlobals.SubstituteList.ReleaseReaderLock(); + } + } + else + { + GenieError.Error("PrintTextToWindow", "Unable to aquire reader lock."); + } + } + + return text; + } private void VariableChanged(string sVariable) { EventVariableChanged?.Invoke(sVariable); From bf633a268c80bc542d47be11841cce2bd17405eb Mon Sep 17 00:00:00 2001 From: Djordje Date: Fri, 27 May 2022 20:00:02 -0400 Subject: [PATCH 33/50] Added RoomObjectHighlights --- Lists/Globals.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Lists/Globals.cs b/Lists/Globals.cs index 9874e40..c732732 100644 --- a/Lists/Globals.cs +++ b/Lists/Globals.cs @@ -115,6 +115,7 @@ public void Config_ConfigChanged(Config.ConfigFieldUpdated oField) public List MonsterList = new List(); public List> VolatileHighlights = new List>(); + public List> RoomObjectHighlights = new List>(); public Regex MonsterListRegEx; public void UpdateMonsterListRegEx() From 3729d11f12c67a6da27e2dd2da3936340ee5c2ae Mon Sep 17 00:00:00 2001 From: Djordje Date: Fri, 27 May 2022 20:00:47 -0400 Subject: [PATCH 34/50] moved clearing of VolatileHighlights to Game class in SetBufferEnd --- Forms/FormMain.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index 5823510..7038917 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -4940,7 +4940,6 @@ private void EndUpdate() oFormSkin = (FormSkin)oEnumerator.Current; oFormSkin.RichTextBoxOutput.EndTextUpdate(); } - m_oGlobals.VolatileHighlights.Clear(); } private void Script_EventPrintError(string sText) From 56dff1eeeaf046e800678488a907e4aa9c4118a1 Mon Sep 17 00:00:00 2001 From: Djordje Date: Fri, 27 May 2022 20:02:00 -0400 Subject: [PATCH 35/50] Added logic to persist highlight information for Room Objects --- Core/Game.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Core/Game.cs b/Core/Game.cs index e20b45e..6c8adbb 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.Runtime.CompilerServices; @@ -889,6 +890,7 @@ public void SetBufferEnd() m_bUpdatingRoom = false; UpdateRoom(); } + m_oGlobals.VolatileHighlights.Clear(); } finally { @@ -934,6 +936,18 @@ public void UpdateRoom() if (Strings.Len(m_sRoomObjs) > 0) { + List> persistedRoomObjects = new List>(); + m_oGlobals.RoomObjectHighlights.AddRange(m_oGlobals.VolatileHighlights); + foreach (KeyValuePair roomObjectHighlight in m_oGlobals.RoomObjectHighlights.ToArray()) + { + Regex roomObjectRegex = new Regex(Regex.Escape(roomObjectHighlight.Value)); + foreach(Match volatileObject in roomObjectRegex.Matches(m_sRoomObjs)) + { + persistedRoomObjects.Add(roomObjectHighlight); + } + } + m_oGlobals.RoomObjectHighlights.Clear(); + m_oGlobals.RoomObjectHighlights.AddRange(persistedRoomObjects); string argsText3 = m_sRoomObjs + System.Environment.NewLine; bool argbIsRoomOutput3 = true; PrintTextWithParse(argsText3, default, default, false, targetRoom, argbIsRoomOutput3); From d4f19a68804bf7fd5eac9baebde8afb34bcda70c Mon Sep 17 00:00:00 2001 From: Djordje Date: Fri, 27 May 2022 20:02:45 -0400 Subject: [PATCH 36/50] rewrote logic to apply volatile highlights and room object highlights --- Forms/Components/ComponentRichTextBox.cs | 43 +++++++++--------------- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/Forms/Components/ComponentRichTextBox.cs b/Forms/Components/ComponentRichTextBox.cs index c256930..5d10f1d 100644 --- a/Forms/Components/ComponentRichTextBox.cs +++ b/Forms/Components/ComponentRichTextBox.cs @@ -484,23 +484,24 @@ private void ParseHighlights() { MatchCollection oMatchCollection; - if (m_oRichTextBuffer.Text.Contains("You also see")) + if (m_oRichTextBuffer.Text.Contains("You also see") && m_oParentForm.Globals.RoomObjectHighlights.Count > 0) { - if (!Information.IsNothing(m_oParentForm.Globals.MonsterListRegEx)) + foreach (KeyValuePair highlight in m_oParentForm.Globals.RoomObjectHighlights.ToArray()) { - oMatchCollection = (MatchCollection)m_oParentForm.Globals.MonsterListRegEx.Matches(m_oRichTextBuffer.Text); + Regex volatileRegex = new Regex(Regex.Escape(highlight.Value)); + oMatchCollection = volatileRegex.Matches(m_oRichTextBuffer.Text); foreach (Match oMatch in oMatchCollection) { - m_oRichTextBuffer.SelectionStart = oMatch.Groups[1].Index; - m_oRichTextBuffer.SelectionLength = oMatch.Groups[1].Length; - if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList["creatures"].FgColor, Color.Transparent, false)) + m_oRichTextBuffer.SelectionStart = oMatch.Groups[0].Index; + m_oRichTextBuffer.SelectionLength = oMatch.Groups[0].Length; + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].FgColor, Color.Transparent, false)) { - m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList["creatures"].FgColor; + m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].FgColor; } - if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList["creatures"].BgColor, Color.Transparent, false)) + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].BgColor, Color.Transparent, false)) { - m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList["creatures"].BgColor; + m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].BgColor; } } } @@ -509,26 +510,14 @@ private void ParseHighlights() // Presets and Bold if (m_oParentForm.Globals.VolatileHighlights.Count > 0) { - int volatilePosition = 0; foreach (KeyValuePair highlight in m_oParentForm.Globals.VolatileHighlights.ToArray()) { - if (m_oRichTextBuffer.Text.Substring(volatilePosition).Contains(highlight.Value)) + Regex volatileRegex = new Regex(Regex.Escape(highlight.Value)); + oMatchCollection = volatileRegex.Matches(m_oRichTextBuffer.Text); + foreach (Match oMatch in oMatchCollection) { - if(m_oParentForm.Globals.PresetList[highlight.Key].bHighlightLine) - { - int indexOfHighlight = m_oRichTextBuffer.Text.IndexOf(highlight.Value, volatilePosition); - int lastNewLineIndex = m_oRichTextBuffer.Text.LastIndexOf("\n", indexOfHighlight); - int nextNewLineIndex = m_oRichTextBuffer.Text.IndexOf("\n", indexOfHighlight); - if (lastNewLineIndex == -1) lastNewLineIndex = 0; - if (nextNewLineIndex == -1) nextNewLineIndex = m_oRichTextBuffer.Text.Length; - m_oRichTextBuffer.SelectionStart = lastNewLineIndex >= 0 ? lastNewLineIndex : 0; - m_oRichTextBuffer.SelectionLength = nextNewLineIndex - lastNewLineIndex; - } - else - { - m_oRichTextBuffer.SelectionStart = m_oRichTextBuffer.Text.IndexOf(highlight.Value, volatilePosition); - m_oRichTextBuffer.SelectionLength = highlight.Value.Length; - } + m_oRichTextBuffer.SelectionStart = oMatch.Groups[0].Index; + m_oRichTextBuffer.SelectionLength = oMatch.Groups[0].Length; if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].FgColor, Color.Transparent, false)) { m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].FgColor; @@ -538,7 +527,6 @@ private void ParseHighlights() { m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].BgColor; } - volatilePosition += highlight.Value.Length; } } } @@ -615,6 +603,7 @@ private void ParseHighlights() } } } + } public FormSkin FormParent From 2ba18c72b6f685cad576874ca08604b72fb972aa Mon Sep 17 00:00:00 2001 From: Djordje Date: Fri, 27 May 2022 21:26:25 -0400 Subject: [PATCH 37/50] Fixed name of ParseSubstitutions, added it to the Room Objects Highlight persistence logic --- Core/Game.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 6c8adbb..e14c8e7 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -589,7 +589,7 @@ public void ParseGameRow(string sText) default: break; } - sTmp = ParseSubstrings(sTmp); + sTmp = ParseSubstitutions(sTmp); m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair(presetLabel, sTmp)); if(presetLabel == "roomdesc") { @@ -605,7 +605,7 @@ public void ParseGameRow(string sText) { if (!string.IsNullOrWhiteSpace(sBoldBuffer)) { - sBoldBuffer = ParseSubstrings(sBoldBuffer); + sBoldBuffer = ParseSubstitutions(sBoldBuffer); m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer)); } } @@ -768,7 +768,7 @@ public void ParseGameRow(string sText) } else if (!string.IsNullOrWhiteSpace(sBoldBuffer)) { - sBoldBuffer = ParseSubstrings(sBoldBuffer); + sBoldBuffer = ParseSubstitutions(sBoldBuffer); m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair("creatures", sBoldBuffer.Trim())); //trim because excessive whitespace seems to be breaking this sBoldBuffer = string.Empty; } @@ -941,7 +941,7 @@ public void UpdateRoom() foreach (KeyValuePair roomObjectHighlight in m_oGlobals.RoomObjectHighlights.ToArray()) { Regex roomObjectRegex = new Regex(Regex.Escape(roomObjectHighlight.Value)); - foreach(Match volatileObject in roomObjectRegex.Matches(m_sRoomObjs)) + foreach(Match volatileObject in roomObjectRegex.Matches(ParseSubstitutions(m_sRoomObjs))) { persistedRoomObjects.Add(roomObjectHighlight); } @@ -3063,7 +3063,7 @@ private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTa } } - text = ParseSubstrings(text); + text = ParseSubstitutions(text); if (0 == 1)//(text.Trim().Length > 0) { // Substitute Lists Switch this to text = ParseSubstrings(text) so theres only one place subs are processed at @@ -3169,7 +3169,7 @@ private void PrintTextToWindow(string text, Color color, Color bgcolor, WindowTa var tempVar = false; EventPrintText?.Invoke(text, color, bgcolor, targetwindow, targetwindowstring, m_bMonoOutput, isprompt, tempVar); } - private String ParseSubstrings(string text) + private String ParseSubstitutions(string text) { if (text.Trim().Length > 0) { From 84011aa6e3c3add4c8a2066a96b1872bfa9f14c9 Mon Sep 17 00:00:00 2001 From: Djordje Date: Fri, 27 May 2022 22:25:30 -0400 Subject: [PATCH 38/50] renamed RoomObjectHighlights to RoomObjects --- Forms/Components/ComponentRichTextBox.cs | 4 ++-- Lists/Globals.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Forms/Components/ComponentRichTextBox.cs b/Forms/Components/ComponentRichTextBox.cs index 5d10f1d..2b5b4e1 100644 --- a/Forms/Components/ComponentRichTextBox.cs +++ b/Forms/Components/ComponentRichTextBox.cs @@ -484,9 +484,9 @@ private void ParseHighlights() { MatchCollection oMatchCollection; - if (m_oRichTextBuffer.Text.Contains("You also see") && m_oParentForm.Globals.RoomObjectHighlights.Count > 0) + if (m_oRichTextBuffer.Text.Contains("You also see") && m_oParentForm.Globals.RoomObjects.Count > 0) { - foreach (KeyValuePair highlight in m_oParentForm.Globals.RoomObjectHighlights.ToArray()) + foreach (KeyValuePair highlight in m_oParentForm.Globals.RoomObjects.ToArray()) { Regex volatileRegex = new Regex(Regex.Escape(highlight.Value)); oMatchCollection = volatileRegex.Matches(m_oRichTextBuffer.Text); diff --git a/Lists/Globals.cs b/Lists/Globals.cs index c732732..df25812 100644 --- a/Lists/Globals.cs +++ b/Lists/Globals.cs @@ -115,7 +115,7 @@ public void Config_ConfigChanged(Config.ConfigFieldUpdated oField) public List MonsterList = new List(); public List> VolatileHighlights = new List>(); - public List> RoomObjectHighlights = new List>(); + public List> RoomObjects = new List>(); public Regex MonsterListRegEx; public void UpdateMonsterListRegEx() From 2337e935a10c45cfe3837abd710d27b7a5b6b1a5 Mon Sep 17 00:00:00 2001 From: Djordje Date: Fri, 27 May 2022 22:25:54 -0400 Subject: [PATCH 39/50] changed method for tracking room objects --- Core/Game.cs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index e14c8e7..ae8dd00 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -936,18 +936,6 @@ public void UpdateRoom() if (Strings.Len(m_sRoomObjs) > 0) { - List> persistedRoomObjects = new List>(); - m_oGlobals.RoomObjectHighlights.AddRange(m_oGlobals.VolatileHighlights); - foreach (KeyValuePair roomObjectHighlight in m_oGlobals.RoomObjectHighlights.ToArray()) - { - Regex roomObjectRegex = new Regex(Regex.Escape(roomObjectHighlight.Value)); - foreach(Match volatileObject in roomObjectRegex.Matches(ParseSubstitutions(m_sRoomObjs))) - { - persistedRoomObjects.Add(roomObjectHighlight); - } - } - m_oGlobals.RoomObjectHighlights.Clear(); - m_oGlobals.RoomObjectHighlights.AddRange(persistedRoomObjects); string argsText3 = m_sRoomObjs + System.Environment.NewLine; bool argbIsRoomOutput3 = true; PrintTextWithParse(argsText3, default, default, false, targetRoom, argbIsRoomOutput3); @@ -1665,6 +1653,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) case "room objs": { m_sRoomObjs = GetTextFromXML(oXmlNode).TrimStart(); + SetRoomObjects(oXmlNode); string argkey5 = "monstercount"; string argvalue4 = CountMonsters(oXmlNode).ToString(); m_oGlobals.VariableList.Add(argkey5, argvalue4, Globals.Variables.VariableType.Reserved); // $monstercount @@ -2675,7 +2664,16 @@ public void ResetIndicators() } private Regex m_MonsterRegex = new Regex("([^<]*)([^,.]*)", MyRegexOptions.options); + private Regex m_RoomObjectsRegex = new Regex("([^<]*)"); + private void SetRoomObjects(XmlNode oXmlNode) + { + m_oGlobals.RoomObjects.Clear(); + foreach (Match roomObject in m_RoomObjectsRegex.Matches(oXmlNode.InnerXml.Replace(" and ", ", ").Replace(" and ", ", "))) + { + m_oGlobals.RoomObjects.Add(new KeyValuePair("creatures", ParseSubstitutions(roomObject.Groups[1].Value))); + } + } private int CountMonsters(XmlNode oXmlNode) { int iMonsterCount = 0; From a3c5f39741fc7c98bb43eb7b0eb3ed9e8247c2ac Mon Sep 17 00:00:00 2001 From: Djordje Date: Sat, 28 May 2022 00:06:31 -0400 Subject: [PATCH 40/50] set SaveToFile to True on presets loaded from presets.cfg --- Lists/Globals.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lists/Globals.cs b/Lists/Globals.cs index df25812..2b9403c 100644 --- a/Lists/Globals.cs +++ b/Lists/Globals.cs @@ -433,11 +433,12 @@ private void LoadRow(string sText) var oArgs = Utility.ParseArgs(sText); if (oArgs.Count == 3) { - Add(oArgs[1].ToString(), oArgs[2].ToString()); + //preserve this for loading configs which predate new parameters + Add(oArgs[1].ToString(), oArgs[2].ToString(), true, false); } else if (oArgs.Count == 4) { - Add(oArgs[1].ToString(), oArgs[2].ToString(), default, oArgs[3].ToString().ToLower() == "true"); + Add(oArgs[1].ToString(), oArgs[2].ToString(), true, oArgs[3].ToString().ToLower() == "true"); } } From 9c86b5963163da67b5b0d92d72711443c02931c2 Mon Sep 17 00:00:00 2001 From: Djordje Date: Sat, 28 May 2022 00:51:17 -0400 Subject: [PATCH 41/50] added ScriptExtension config option --- Core/Command.cs | 1 + Lists/Config.cs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Core/Command.cs b/Core/Command.cs index 8844d64..bda1fec 100644 --- a/Core/Command.cs +++ b/Core/Command.cs @@ -2848,6 +2848,7 @@ private void ListSettings() EchoText("mapdir=" + oGlobals.Config.sMapDir + System.Environment.NewLine); EchoText("scriptdir=" + oGlobals.Config.sScriptDir + System.Environment.NewLine); EchoText("scriptchar=" + oGlobals.Config.ScriptChar.ToString() + System.Environment.NewLine); + EchoText("scriptextension=" + oGlobals.Config.ScriptExtension + System.Environment.NewLine); EchoText("scripttimeout=" + oGlobals.Config.iScriptTimeout.ToString() + System.Environment.NewLine); EchoText("separatorchar=" + oGlobals.Config.cSeparatorChar.ToString() + System.Environment.NewLine); EchoText("spelltimer=" + oGlobals.Config.bShowSpellTimer.ToString() + System.Environment.NewLine); diff --git a/Lists/Config.cs b/Lists/Config.cs index be4fd76..905ba20 100644 --- a/Lists/Config.cs +++ b/Lists/Config.cs @@ -64,6 +64,7 @@ public class Config public int LichPort { get; set; } = 11024; public int LichStartPause { get; set; } = 5; public string ConnectScript { get; set; } = string.Empty; + public string ScriptExtension { get; set; } = "cmd"; public string ScriptDir { @@ -391,6 +392,7 @@ public bool Save(string sFileName = "settings.cfg") oStreamWriter.WriteLine($"#config {{connectscript}} {{{ConnectScript}}}"); oStreamWriter.WriteLine($"#config {{autoupdate}} {{{AutoUpdate}}}"); oStreamWriter.WriteLine($"#config {{checkforupdates}} {{{CheckForUpdates}}}"); + oStreamWriter.WriteLine($"#config {{scriptextension}} {{{ScriptExtension}}}"); oStreamWriter.Close(); return true; } @@ -460,6 +462,12 @@ public List SetSetting(string sKey, string sValue = "", bool bShowExcept break; } + case "scriptextension": + { + ScriptExtension = sValue ?? "cmd"; + break; + } + case "triggeroninput": { var switchExpr1 = sValue.ToLower(); From 1c6ad440802b25c1e9a56b846217b91f4db8f1c0 Mon Sep 17 00:00:00 2001 From: Djordje Date: Sat, 28 May 2022 01:05:52 -0400 Subject: [PATCH 42/50] converted hard coded .cmd file extensions to reference the new ScriptExtension config --- Core/Command.cs | 4 ++-- Forms/DialogScriptName.cs | 7 ------- Forms/FormMain.cs | 16 ++++++++-------- Script/Script.cs | 2 +- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/Core/Command.cs b/Core/Command.cs index bda1fec..3b38659 100644 --- a/Core/Command.cs +++ b/Core/Command.cs @@ -2028,9 +2028,9 @@ public string ParseCommand(string sText, bool bSendToGame = false, bool bUserInp if (oArgs.Count > 1) { string sFile = oGlobals.ParseGlobalVars(Utility.ArrayToString(oArgs, 1)); - if (sFile.ToLower().EndsWith(".cmd") == false & sFile.ToLower().EndsWith(".js") == false) + if (sFile.ToLower().EndsWith($".{oGlobals.Config.ScriptExtension}") == false & sFile.ToLower().EndsWith(".js") == false) { - sFile += ".cmd"; + sFile += $".{oGlobals.Config.ScriptExtension}"; } if (sFile.IndexOf(@"\") == -1) diff --git a/Forms/DialogScriptName.cs b/Forms/DialogScriptName.cs index c783f3c..20d7a61 100644 --- a/Forms/DialogScriptName.cs +++ b/Forms/DialogScriptName.cs @@ -26,14 +26,7 @@ public string ScriptName { get { - if (TextBoxName.Text.ToLower().EndsWith(".cmd") | TextBoxName.Text.ToLower().EndsWith(".inc")) - { return TextBoxName.Text; - } - else - { - return TextBoxName.Text + ".cmd"; - } } set diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index 7038917..4ba4fed 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -1504,7 +1504,7 @@ private void TextBoxInput_KeyDown(object sender, KeyEventArgs e) { if (m_bLastKeyWasTab == true) { - ListScripts(TextBoxInput.Text.Substring(1) + "*.cmd"); + ListScripts(TextBoxInput.Text.Substring(1) + $"*.{m_oGlobals.Config.ScriptExtension}"); m_bLastKeyWasTab = false; } else if (TextBoxInput.Text.Length > 1) @@ -1534,7 +1534,7 @@ private void TextBoxInput_KeyDown(object sender, KeyEventArgs e) { if (m_bLastKeyWasTab == true) { - ListScripts(TextBoxInput.Text.Substring(6) + "*.cmd"); + ListScripts(TextBoxInput.Text.Substring(6) + $"*.{m_oGlobals.Config.ScriptExtension}"); m_bLastKeyWasTab = false; } else if (TextBoxInput.Text.Length > 1) @@ -1715,7 +1715,7 @@ public string FindScript(string sPattern) } } - sDir = FileSystem.Dir(sPattern + "*.cmd", Constants.vbArchive); + sDir = FileSystem.Dir(sPattern + $"*.{m_oGlobals.Config.ScriptExtension}", Constants.vbArchive); while (!string.IsNullOrEmpty(sDir)) { i += 1; @@ -1726,7 +1726,7 @@ public string FindScript(string sPattern) if (i == 1) { - return sFile.ToLower().Replace(".cmd", "") + " "; + return sFile.ToLower().Replace($".{m_oGlobals.Config.ScriptExtension}", "") + " "; } else if (Strings.Len(sMin) > 0) { @@ -3144,9 +3144,9 @@ private void ScriptButtonEdit_Click(object sender, EventArgs e) if (!Information.IsNothing(oButton.Tag)) { string sTemp = ((Script)oButton.Tag).FileName; - if (sTemp.ToLower().EndsWith(".cmd") == false) + if (sTemp.ToLower().EndsWith($".{m_oGlobals.Config.ScriptExtension}") == false) { - sTemp += ".cmd"; + sTemp += $".{m_oGlobals.Config.ScriptExtension}"; } if (sTemp.IndexOf(@"\") == -1) @@ -4138,9 +4138,9 @@ private void ClassCommand_RunScript(string sText) var al = new ArrayList(); al = Utility.ParseArgs(sText, true); string ScriptName = Conversions.ToString(al[0].ToString().ToLower().Trim().Substring(1)); - if (ScriptName.EndsWith(".cmd") == false) + if (ScriptName.EndsWith($".{m_oGlobals.Config.ScriptExtension}") == false) { - ScriptName += ".cmd"; + ScriptName += $".{m_oGlobals.Config.ScriptExtension}"; } Script oScript = null; diff --git a/Script/Script.cs b/Script/Script.cs index 4e2de4e..31c4d5b 100644 --- a/Script/Script.cs +++ b/Script/Script.cs @@ -1919,7 +1919,7 @@ public bool LoadFile(string sFile, bool bClear = true) if (AppendFile(sFile)) { m_sFileName = sFile; - if (m_sFileName.ToLower().EndsWith(".cmd")) + if (m_sFileName.ToLower().EndsWith($".{m_oGlobals.Config.ScriptExtension}")) { m_oLocalVarList["scriptname"] = m_sFileName.Substring(0, m_sFileName.Length - 4); } From d0187235f1a33054d1876f9975b82227d5d38f38 Mon Sep 17 00:00:00 2001 From: Djordje Date: Sat, 28 May 2022 02:01:25 -0400 Subject: [PATCH 43/50] added Castbar toggling to SetMagicPanels --- Forms/FormMain.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index 4ba4fed..6728faf 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -6876,6 +6876,7 @@ private void MagicPanelsToolStripMenuItem_Click(object sender, EventArgs e) private void SetMagicPanels(bool bVisible) { ComponentBarsMana.Visible = bVisible; + Castbar.Visible = bVisible; LabelSpell.Visible = bVisible; LabelSpellC.Visible = bVisible; if (bVisible == true) From 039db1e6a04a41343aaf2d205fe7c3532008fa66 Mon Sep 17 00:00:00 2001 From: Djordje Date: Sun, 29 May 2022 17:17:50 -0400 Subject: [PATCH 44/50] Restored code to use Highlight Entire Line for presets --- Forms/Components/ComponentRichTextBox.cs | 33 +++++++++++++++++------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/Forms/Components/ComponentRichTextBox.cs b/Forms/Components/ComponentRichTextBox.cs index 2b5b4e1..f546415 100644 --- a/Forms/Components/ComponentRichTextBox.cs +++ b/Forms/Components/ComponentRichTextBox.cs @@ -514,18 +514,33 @@ private void ParseHighlights() { Regex volatileRegex = new Regex(Regex.Escape(highlight.Value)); oMatchCollection = volatileRegex.Matches(m_oRichTextBuffer.Text); - foreach (Match oMatch in oMatchCollection) { - m_oRichTextBuffer.SelectionStart = oMatch.Groups[0].Index; - m_oRichTextBuffer.SelectionLength = oMatch.Groups[0].Length; - if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].FgColor, Color.Transparent, false)) + foreach (Match oMatch in oMatchCollection) { - m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].FgColor; - } + if (m_oParentForm.Globals.PresetList[highlight.Key].bHighlightLine) + { + int indexOfHighlight = m_oRichTextBuffer.Text.IndexOf(highlight.Value); + int lastNewLineIndex = m_oRichTextBuffer.Text.LastIndexOf("\n", indexOfHighlight); + int nextNewLineIndex = m_oRichTextBuffer.Text.IndexOf("\n", indexOfHighlight); + if (lastNewLineIndex == -1) lastNewLineIndex = 0; + if (nextNewLineIndex == -1) nextNewLineIndex = m_oRichTextBuffer.Text.Length; + m_oRichTextBuffer.SelectionStart = lastNewLineIndex >= 0 ? lastNewLineIndex : 0; + m_oRichTextBuffer.SelectionLength = nextNewLineIndex - lastNewLineIndex; + } + else + { + m_oRichTextBuffer.SelectionStart = oMatch.Groups[0].Index; + m_oRichTextBuffer.SelectionLength = oMatch.Groups[0].Length; + } + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].FgColor, Color.Transparent, false)) + { + m_oRichTextBuffer.SelectionColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].FgColor; + } - if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].BgColor, Color.Transparent, false)) - { - m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].BgColor; + if (!Operators.ConditionalCompareObjectEqual(m_oParentForm.Globals.PresetList[highlight.Key].BgColor, Color.Transparent, false)) + { + m_oRichTextBuffer.SelectionBackColor = (Color)m_oParentForm.Globals.PresetList[highlight.Key].BgColor; + } } } } From 98be38b140f9bd28cf318da11929f18d24b3c33a Mon Sep 17 00:00:00 2001 From: Djordje Date: Tue, 31 May 2022 22:01:11 -0400 Subject: [PATCH 45/50] Added default file extension from config ScriptExtension if no file extension is provided for creating a New Script --- Forms/ScriptExplorer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Forms/ScriptExplorer.cs b/Forms/ScriptExplorer.cs index 9faa093..72f06d1 100644 --- a/Forms/ScriptExplorer.cs +++ b/Forms/ScriptExplorer.cs @@ -239,7 +239,9 @@ private void ToolStripButtonNew_Click(object sender, EventArgs e) if (My.MyProject.Forms.DialogScriptName.ShowDialog(Parent) == DialogResult.OK) { - var tnFile = new TreeNode(My.MyProject.Forms.DialogScriptName.ScriptName, 2, 2); + string scriptName = My.MyProject.Forms.DialogScriptName.ScriptName; + if (!Path.HasExtension(scriptName)) scriptName += $".{m_oGlobals.Config.ScriptExtension}"; + var tnFile = new TreeNode(scriptName, 2, 2); tnFile.Tag = "File"; // Add the new child node to the parent node if (!Information.IsNothing(oParent)) @@ -251,7 +253,7 @@ private void ToolStripButtonNew_Click(object sender, EventArgs e) TreeView.Nodes.Add(tnFile); } - Interaction.Shell("\"" + m_oGlobals.Config.sEditor + "\" \"" + sLocation + My.MyProject.Forms.DialogScriptName.ScriptName + "\"", AppWinStyle.NormalFocus, false); + Interaction.Shell("\"" + m_oGlobals.Config.sEditor + "\" \"" + sLocation + scriptName + "\"", AppWinStyle.NormalFocus, false); } My.MyProject.Forms.DialogScriptName.ScriptName = string.Empty; From 4f182e9d083d9c9d53598413bd1439aaf32aa40a Mon Sep 17 00:00:00 2001 From: LaegotKit <100539902+LaegotKit@users.noreply.github.com> Date: Wed, 1 Jun 2022 11:08:33 -0400 Subject: [PATCH 46/50] Added error handling to #lich Connect Added error handling to #Lich Connect to tell you the reason why you can't connect --- Core/Command.cs | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Core/Command.cs b/Core/Command.cs index 8844d64..78efa00 100644 --- a/Core/Command.cs +++ b/Core/Command.cs @@ -384,17 +384,28 @@ public string ParseCommand(string sText, bool bSendToGame = false, bool bUserInp case "lconnect": case "lichconnect": { - EchoText("Starting Lich Server\n"); - string lichLaunch = $"/C {oGlobals.Config.RubyPath} {oGlobals.Config.LichPath} {oGlobals.Config.LichArguments}"; - - Utility.ExecuteProcess(oGlobals.Config.CmdPath, lichLaunch, false); - int count = 0; - while (count < oGlobals.Config.LichStartPause) + string failure = string.Empty; + if (!File.Exists(oGlobals.Config.CmdPath)) failure += "CMD not found at Path:\t" + oGlobals.Config.CmdPath + System.Environment.NewLine; + if (!File.Exists(oGlobals.Config.RubyPath)) failure += "Ruby not found at Path:\t" + oGlobals.Config.RubyPath + System.Environment.NewLine; + if (!File.Exists(oGlobals.Config.LichPath)) failure += "Lich not found at Path:\t" + oGlobals.Config.LichPath + System.Environment.NewLine; + if (string.IsNullOrWhiteSpace(failure)) + { + EchoText("Starting Lich Server\n"); + string lichLaunch = $"/C {oGlobals.Config.RubyPath} {oGlobals.Config.LichPath} {oGlobals.Config.LichArguments}"; + Utility.ExecuteProcess(oGlobals.Config.CmdPath, lichLaunch, false); + int count = 0; + while (count < oGlobals.Config.LichStartPause) + { + Thread.Sleep(1000); + count++; + } + Connect(oArgs, true); + } + else { - Thread.Sleep(1000); - count++; + failure = "Fix the following file paths in your #Config" + System.Environment.NewLine + failure; + EchoColorText(failure, Color.OrangeRed, Color.Transparent); } - Connect(oArgs, true); break; } From 9912f2fdd1f77524089fc7f2ebc5b3eecadc7c2a Mon Sep 17 00:00:00 2001 From: Djordje Date: Wed, 1 Jun 2022 11:43:03 -0400 Subject: [PATCH 47/50] assigned character name and instance code to game object when passed as parameters --- Forms/FormMain.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Forms/FormMain.cs b/Forms/FormMain.cs index 6728faf..cd4304f 100644 --- a/Forms/FormMain.cs +++ b/Forms/FormMain.cs @@ -186,8 +186,10 @@ public void DirectConnect(string[] ConnectionParameters) PrintError("Invalid Startup Parameters detected."); return; } - m_sCurrentProfileFile = string.Empty; - SafeLoadProfile(character + game + ".xml", false); + m_sCurrentProfileFile = character + game + ".xml"; + m_oGame.AccountCharacter = character; + m_oGame.AccountGame = game; + SafeLoadProfile(m_sCurrentProfileFile, false); m_oGame.DirectConnect(character, game, host, port); } } From f4b4350860fe40ed7e6a6a2d3292f72ae33dc965 Mon Sep 17 00:00:00 2001 From: LaegotKit <100539902+LaegotKit@users.noreply.github.com> Date: Thu, 2 Jun 2022 15:48:06 -0400 Subject: [PATCH 48/50] Fix for Icons not displaying properly Fix for Icons not displaying properly --- Core/Game.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index e20b45e..0f2b180 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -2107,7 +2107,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) case "prompt": { string strBuffer = GetTextFromXML(oXmlNode); - if (m_bStatusPromptEnabled) + if (m_bStatusPromptEnabled == false) { if ((strBuffer ?? "") != ">") { @@ -2232,7 +2232,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) if (rt > 0) { SetRoundTime(rt); - if (m_bStatusPromptEnabled == true) + if (m_bStatusPromptEnabled == false) strBuffer += "R"; rt += Convert.ToInt32(m_oGlobals.Config.dRTOffset); var rtString = rt.ToString(); @@ -3302,7 +3302,7 @@ private void GameSocket_EventConnected() m_oGlobals.VariableList.Add(argkey, argvalue, Globals.Variables.VariableType.Reserved); string argsVariable = "$connected"; VariableChanged(argsVariable); - m_bStatusPromptEnabled = true; + m_bStatusPromptEnabled = false; break; } } From bb7a53349e4940b6984c1eee11af8d010f601772 Mon Sep 17 00:00:00 2001 From: LaegotKit <100539902+LaegotKit@users.noreply.github.com> Date: Thu, 2 Jun 2022 17:06:47 -0400 Subject: [PATCH 49/50] Convert Config PromptForce to toggle prompt on and off Convert #Config PromptForce to toggle prompt on and off --- Core/Game.cs | 10 ++-------- Lists/Config.cs | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 0f2b180..011d8ec 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -799,12 +799,6 @@ public void ParseGameRow(string sText) { m_bBold = false; } - - if (bPromptRow && m_oGlobals.Config.PromptForce && m_oTargetWindow == WindowTarget.Main) //Prompforce , but bPromptRow has no way to be set to true - { - bPromptRow = false; - PrintTextWithParse(m_oGlobals.Config.sPrompt, true, 0); - } } } @@ -2142,7 +2136,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) { strBuffer += "DEAD"; } - else + else if (m_oGlobals.Config.PromptForce == true) { if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Kneeling], true, false))) { @@ -2232,7 +2226,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) if (rt > 0) { SetRoundTime(rt); - if (m_bStatusPromptEnabled == false) + if (m_bStatusPromptEnabled == false && (m_oGlobals.Config.PromptForce == true)) strBuffer += "R"; rt += Convert.ToInt32(m_oGlobals.Config.dRTOffset); var rtString = rt.ToString(); diff --git a/Lists/Config.cs b/Lists/Config.cs index be4fd76..7f79bc0 100644 --- a/Lists/Config.cs +++ b/Lists/Config.cs @@ -49,7 +49,7 @@ public class Config public string sLogDir = "Logs"; public bool PromptBreak { get; set; } = true; - public bool PromptForce { get; set; } = false; + public bool PromptForce { get; set; } = true; public bool Condensed { get; set; } = false; public bool CheckForUpdates { get; set; } = true; public bool AutoUpdate { get; set; } = false; From f574c6876a0cc1122f94ee94ce361144e688aaa3 Mon Sep 17 00:00:00 2001 From: LaegotKit <100539902+LaegotKit@users.noreply.github.com> Date: Thu, 2 Jun 2022 17:12:56 -0400 Subject: [PATCH 50/50] Code cleanup Removed extra unused Create prompt Method --- Core/Game.cs | 170 +-------------------------------------------------- 1 file changed, 1 insertion(+), 169 deletions(-) diff --git a/Core/Game.cs b/Core/Game.cs index 011d8ec..d72bed6 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -624,12 +624,6 @@ public void ParseGameRow(string sText) } sTextBuffer += sTmp; - if (buffer.EndsWith("<&/prompt>")) - { - XmlDocument doc = new XmlDocument(); - doc.LoadXml(buffer); - CreatePrompt(doc.DocumentElement); - } m_oXMLBuffer.Clear(); oXMLBuffer.Clear(); @@ -2477,169 +2471,7 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) return sReturn; } - public void CreatePrompt(XmlNode oXmlNode) - { - string strBuffer = GetTextFromXML(oXmlNode); - if (!m_bStatusPromptEnabled) - { - if ((strBuffer ?? "") != ">") - { - m_bStatusPromptEnabled = true; - - // Fix for Joined and Bleeding - if (strBuffer.Contains("J") == false) - { - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oGlobals.VariableList["joined"], "1", false))) - { - string argkey37 = "joined"; - string argvalue13 = "0"; - m_oGlobals.VariableList.Add(argkey37, argvalue13, Globals.Variables.VariableType.Reserved); - string argsVariable35 = "$joined"; - VariableChanged(argsVariable35); - } - } - - if (strBuffer.Contains("!") == false) - { - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oGlobals.VariableList["bleeding"], "1", false))) - { - string argkey38 = "bleeding"; - string argvalue14 = "0"; - m_oGlobals.VariableList.Add(argkey38, argvalue14, Globals.Variables.VariableType.Reserved); - string argsVariable36 = "$bleeding"; - VariableChanged(argsVariable36); - } - } - } - else if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Dead], true, false))) - { - strBuffer += "DEAD"; - } - else - { - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Kneeling], true, false))) - { - strBuffer += "K"; - } - - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Sitting], true, false))) - { - strBuffer += "s"; - } - - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Prone], true, false))) - { - strBuffer += "P"; - } - - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Stunned], true, false))) - { - strBuffer += "S"; - } - - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Hidden], true, false))) - { - strBuffer += "H"; - } - - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Invisible], true, false))) - { - strBuffer += "I"; - } - - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Webbed], true, false))) - { - strBuffer += "W"; - } - - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Bleeding], true, false))) - { - strBuffer += "!"; - } - - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oIndicatorHash[Indicator.Joined], true, false))) - { - strBuffer += "J"; - } - } - } - else - { - // Fix for Joined and Bleeding - if (strBuffer.Contains("J") == false) - { - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oGlobals.VariableList["joined"], "1", false))) - { - string argkey39 = "joined"; - string argvalue15 = "0"; - m_oGlobals.VariableList.Add(argkey39, argvalue15, Globals.Variables.VariableType.Reserved); - string argsVariable37 = "$joined"; - VariableChanged(argsVariable37); - } - } - - if (strBuffer.Contains("!") == false) - { - if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(m_oGlobals.VariableList["bleeding"], "1", false))) - { - string argkey40 = "bleeding"; - string argvalue16 = "0"; - m_oGlobals.VariableList.Add(argkey40, argvalue16, Globals.Variables.VariableType.Reserved); - string argsVariable38 = "$bleeding"; - VariableChanged(argsVariable38); - } - } - } - - // Dim strBuffer As String = String.Empty - - string argstrAttributeName25 = "time"; - if (int.TryParse(GetAttributeData(oXmlNode, argstrAttributeName25), out m_iGameTime)) - { - string argkey41 = "gametime"; - string argvalue17 = m_iGameTime.ToString(); - m_oGlobals.VariableList.Add(argkey41, argvalue17, Globals.Variables.VariableType.Reserved); - string argsVariable39 = "$gametime"; - VariableChanged(argsVariable39); - int rt = m_iRoundTime - m_iGameTime; - if (rt > 0) - { - SetRoundTime(rt); - if (m_bStatusPromptEnabled == false) - strBuffer += "R"; - rt += Convert.ToInt32(m_oGlobals.Config.dRTOffset); - var rtString = rt.ToString(); - string argkey42 = "roundtime"; - m_oGlobals.VariableList.Add(argkey42, rtString, Globals.Variables.VariableType.Reserved); - } - else - { - string argkey43 = "roundtime"; - string argvalue18 = "0"; - m_oGlobals.VariableList.Add(argkey43, argvalue18, Globals.Variables.VariableType.Reserved); - } - string argsVariable40 = "$roundtime"; - VariableChanged(argsVariable40); - - if (m_oGlobals.Config.sPrompt.Length > 0 && !m_bLastRowWasPrompt) - { - strBuffer = strBuffer.Replace(m_oGlobals.Config.sPrompt.Trim(), ""); - strBuffer += m_oGlobals.Config.sPrompt; - bool argbIsPrompt = true; - WindowTarget argoWindowTarget = 0; - - PrintTextWithParse(strBuffer, argbIsPrompt, oWindowTarget: argoWindowTarget); - } - - string argkey44 = "prompt"; - m_oGlobals.VariableList.Add(argkey44, strBuffer, Globals.Variables.VariableType.Reserved); - string argsVariable41 = "$prompt"; - VariableChanged(argsVariable41); - EventTriggerPrompt?.Invoke(); - } - } - - public void ResetIndicators() + public void ResetIndicators() { m_oIndicatorHash[Indicator.Bleeding] = false; m_oIndicatorHash[Indicator.Dead] = false;