Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Ensure MSBuildPanel buttons are instantiated #51325

Merged
merged 1 commit into from
Aug 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -57,7 +57,7 @@ private void RebuildSolution()

BuildManager.GenerateEditorScriptMetadata();

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 @@ -76,7 +76,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 @@ -113,10 +113,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 = GetIcon("Play", "EditorIcons")};
buildMenuBtn = new MenuButton { Text = "Build", Icon = GetIcon("Play", "EditorIcons") };
toolBarHBox.AddChild(buildMenuBtn);

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

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