summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2021-08-06 22:27:57 +0200
committerRaul Santos <raulsntos@gmail.com>2021-08-06 22:30:38 +0200
commitf20db5827187c97dd6a76ac402fd48c51d87a59e (patch)
tree34415a394c20671f00f5c302cc8f157230eae0cc /modules
parentda339f8ffcf4c33bb44129d718c0adde910e391d (diff)
Ensure MSBuildPanel buttons are instantiated
Diffstat (limited to 'modules')
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs20
1 files changed, 12 insertions, 8 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs
index 897f1b2822..5f35d506de 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs
@@ -73,7 +73,7 @@ namespace GodotTools.Build
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
@@ -92,7 +92,7 @@ namespace GodotTools.Build
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;
@@ -129,10 +129,10 @@ namespace GodotTools.Build
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();
@@ -183,10 +183,14 @@ namespace GodotTools.Build
{
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");
}
}
}