Skip to content

Commit

Permalink
Merge #4028 Fix exception on clicking Play before dropdown appears
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Feb 14, 2024
2 parents 6c5bf1f + 88d79f5 commit 3e56d8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.

- [Updater] Support dev builds for auto updater (#3997, #4008 by: HebaruSan)
- [GUI] Sort mods satisfying the same recommendation by download count (#4007 by: HebaruSan)
- [Multiple] Alternate game command lines and Steam refactor (#4010, #4013 by: HebaruSan)
- [Multiple] Alternate game command lines and Steam refactor (#4010, #4013, #4028 by: HebaruSan)
- [Multiple] Recommendations usability improvements (#4025 by: HebaruSan)
- [Multiple] Prompt for client upgrade when newer spec is found (#4026 by: HebaruSan)

Expand Down
2 changes: 0 additions & 2 deletions GUI/Controls/ManageMods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,6 @@ private void _MarkModForUpdate(string identifier, bool value)
private void LaunchGameToolStripMenuItem_MouseHover(object sender, EventArgs e)
{
var cmdLines = Main.Instance.configuration.CommandLines;
LaunchGameToolStripMenuItem.Tag =
LaunchGameToolStripMenuItem.ToolTipText = cmdLines.First();
LaunchGameToolStripMenuItem.DropDownItems.Clear();
LaunchGameToolStripMenuItem.DropDownItems.AddRange(
cmdLines.Select(cmdLine => (ToolStripItem)
Expand Down
8 changes: 6 additions & 2 deletions GUI/Main/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -937,11 +937,15 @@ private void openGameDirectoryToolStripMenuItem_Click(object sender, EventArgs e

private void openGameToolStripMenuItem_Click(object sender, EventArgs e)
{
LaunchGame(configuration.CommandLines.First());
LaunchGame();
}

private void LaunchGame(string command)
private void LaunchGame(string command = null)
{
if (string.IsNullOrEmpty(command))
{
command = configuration.CommandLines.First();
}
var split = command.Split(' ');
if (split.Length == 0)
{
Expand Down

0 comments on commit 3e56d8e

Please sign in to comment.