Skip to content

Commit

Permalink
Merge pull request #51322 from raulsntos/fix-msbuild-exception
Browse files Browse the repository at this point in the history
Ensure MSBuildPanel buttons are instantiated
  • Loading branch information
akien-mga authored Aug 7, 2021
2 parents 3c85ef1 + f20db58 commit 35b08b7
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void RebuildSolution()
GD.PushError("Failed to setup Godot NuGet Offline Packages: " + e.Message);
}

if (!BuildManager.BuildProjectBlocking("Debug", targets: new[] {"Rebuild"}))
if (!BuildManager.BuildProjectBlocking("Debug", targets: new[] { "Rebuild" }))
return; // Build failed

// Notify running game for hot-reload
Expand All @@ -92,7 +92,7 @@ private void CleanSolution()
if (!File.Exists(GodotSharpDirs.ProjectSlnPath))
return; // No solution to build

BuildManager.BuildProjectBlocking("Debug", targets: new[] {"Clean"});
BuildManager.BuildProjectBlocking("Debug", targets: new[] { "Clean" });
}

private void ViewLogToggled(bool pressed) => BuildOutputView.LogVisible = pressed;
Expand Down Expand Up @@ -129,10 +129,10 @@ public override void _Ready()
RectMinSize = new Vector2(0, 228) * EditorScale;
SizeFlagsVertical = (int)SizeFlags.ExpandFill;

var toolBarHBox = new HBoxContainer {SizeFlagsHorizontal = (int)SizeFlags.ExpandFill};
var toolBarHBox = new HBoxContainer { SizeFlagsHorizontal = (int)SizeFlags.ExpandFill };
AddChild(toolBarHBox);

buildMenuBtn = new MenuButton {Text = "Build", Icon = GetThemeIcon("Play", "EditorIcons")};
buildMenuBtn = new MenuButton { Text = "Build", Icon = GetThemeIcon("Play", "EditorIcons") };
toolBarHBox.AddChild(buildMenuBtn);

var buildMenu = buildMenuBtn.GetPopup();
Expand Down Expand Up @@ -183,10 +183,14 @@ public override void _Notification(int what)
{
base._Notification(what);

if (what == NotificationThemeChanged) {
buildMenuBtn.Icon = GetThemeIcon("Play", "EditorIcons");
errorsBtn.Icon = GetThemeIcon("StatusError", "EditorIcons");
warningsBtn.Icon = GetThemeIcon("NodeWarning", "EditorIcons");
if (what == NotificationThemeChanged)
{
if (buildMenuBtn != null)
buildMenuBtn.Icon = GetThemeIcon("Play", "EditorIcons");
if (errorsBtn != null)
errorsBtn.Icon = GetThemeIcon("StatusError", "EditorIcons");
if (warningsBtn != null)
warningsBtn.Icon = GetThemeIcon("NodeWarning", "EditorIcons");
}
}
}
Expand Down

0 comments on commit 35b08b7

Please sign in to comment.