Skip to content

Commit

Permalink
defect fixes for bad Special teams specification; incorrect GUI states;
Browse files Browse the repository at this point in the history
Tab index;
  • Loading branch information
BAD-AL committed May 18, 2016
1 parent fd3a920 commit f5dba49
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 21 deletions.
12 changes: 8 additions & 4 deletions GamesaveTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -634,12 +634,16 @@ public string GetSpecialTeamPosition(string team, SpecialTeamer guy)
int teamPlayerPointersStart = teamIndex * cTeamDiff + m49ersPlayerPointersStart;
List<int> playerIndexes = GetPlayerIndexesForTeam(team);
int playerIndex = GameSaveData[teamPlayerPointersStart + (int)guy];
String pos = GetPlayerPosition(playerIndexes[playerIndex]);
String pos = "ERROR";
int depth = 0;
for (int i = 0; i <= playerIndex; i++)
if (playerIndex < playerIndexes.Count)
{
if (pos == GetPlayerPosition(playerIndexes[i]))
depth++;
pos = GetPlayerPosition(playerIndexes[playerIndex]);
for (int i = 0; i <= playerIndex; i++)
{
if (pos == GetPlayerPosition(playerIndexes[i]))
depth++;
}
}
string retVal = String.Format("{0},{1}{2}", guy.ToString(), pos.ToString(), depth);
return retVal;
Expand Down
2 changes: 1 addition & 1 deletion InputParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private void SetSpecialTeamPlayer(string line)
}
catch
{
StaticUtils.AddError(string.Format("Error adding special team player {0}", line));
StaticUtils.AddError(string.Format("Team:{0} Error adding special team player {1}",mTracker.Team, line));
}
}

Expand Down
12 changes: 11 additions & 1 deletion MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ private void LoadSaveFile()
private void EnableControls(bool enable)
{
scheduleToolStripMenuItem.Enabled=
sortPlayersToolStripMenuItem.Enabled=
validateToolStripMenuItem.Enabled =
playerEditorToolStripMenuItem.Enabled =
autoUpdateDepthChartToolStripMenuItem.Enabled =
autoUpdatePBPToolStripMenuItem.Enabled =
autoUpdatePhotoToolStripMenuItem.Enabled =
Expand Down Expand Up @@ -101,14 +104,15 @@ private void mListContentsButton_Click(object sender, EventArgs e)
SetText(builder.ToString());
}

Regex mColorizeRegex = new Regex("^[A-Z]+,[A-Za-z ']+,[A-Z,a-z ']+,", RegexOptions.Multiline);
Regex mColorizeRegex = new Regex("^[A-Z]+,[A-Za-z \\.']+,[A-Z,a-z ']+,", RegexOptions.Multiline);

/// <summary>
/// Sets the text box text and colorizes the player names
/// </summary>
/// <param name="text"></param>
private void SetText( string text)
{
mTextBox.Visible = false;
mTextBox.SelectionLength = 0;
mTextBox.Text = text;
MatchCollection mc = mColorizeRegex.Matches(mTextBox.Text);
Expand All @@ -118,6 +122,7 @@ private void SetText( string text)
mTextBox.SelectionLength = m.Length - 1;
mTextBox.SelectionColor = nameColorToolStripMenuItem.ForeColor;
}
mTextBox.Visible = true;
}

private void scheduleToolStripMenuItem_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -543,5 +548,10 @@ private void listSpecialTeamsToolStripMenuItem_Click(object sender, EventArgs e)
{
listSpecialTeamsToolStripMenuItem.Checked = !listSpecialTeamsToolStripMenuItem.Checked;
}

private void playerEditorToolStripMenuItem_Click(object sender, EventArgs e)
{
EditPlayer();
}
}
}
41 changes: 26 additions & 15 deletions MainForm.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added NFL2K5Tool_CurrentPackage.zip
Binary file not shown.
Binary file modified bin/Debug/NFL2K5Tool.exe
Binary file not shown.

0 comments on commit f5dba49

Please sign in to comment.