Skip to content

Commit 01b16f4

Browse files
authored
Update Program.cs
Fixed a typo that caused the first line of text to be omitted when getting the plain text from a script.
1 parent 6aa59e5 commit 01b16f4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Configuration;
55
using Microsoft.WindowsAPICodePack.Dialogs;
66

7-
namespace TF2ScriptGen
7+
namespace TF2SpamScriptGen
88
{
99
static class Program
1010
{
@@ -74,7 +74,7 @@ static void Main(string[] args)
7474

7575
static void OnLinesInputTextBoxKeyDown(object sender, KeyEventArgs e)
7676
{
77-
// allow the use of ctrl-A to select all, which usually possible by default
77+
// allow the use of ctrl+A to select all, which isn't usually possible by default
7878
if(e.Modifiers.HasFlag(Keys.Control) && e.KeyCode == Keys.A)
7979
{
8080
e.SuppressKeyPress = true;
@@ -181,14 +181,14 @@ static string[] GetInputFromScript(string scriptFilePath)
181181

182182
// modify the script line count to get the line count of the plain text.
183183
int lineCount = scriptLines.Length - 2;
184-
lineCount = (int)((float)lineCount * (5f / 6f));
184+
lineCount = (int)((float)lineCount * (5f / 6f)) + 1;
185185

186186
string[] lines = new string[lineCount];
187187

188188
for(int i = 0; i < lineCount; i++)
189189
{
190190
// turn from a script line back to just the plain text
191-
lines[i] = scriptLines[i + 2].Split('"')[1].Remove(0, 4);
191+
lines[i] = scriptLines[i + 1].Split('"')[1].Remove(0, 4);
192192
}
193193
return lines;
194194
}

0 commit comments

Comments
 (0)