Skip to content

Commit

Permalink
Improve the Mono build log appearance
Browse files Browse the repository at this point in the history
Co-authored-by: Raul Santos <[email protected]>
  • Loading branch information
YuriSizov and raulsntos committed Sep 29, 2021
1 parent c78880f commit ac9db4c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
3 changes: 2 additions & 1 deletion editor/editor_themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme =
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#a5b7f3", "#3d64dd"); // 2d
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#708cea", "#1a3eac"); // 2d dark
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#a5efac", "#2fa139"); // control
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffdd65", "#ca8a04"); // node warning

// rainbow
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff7070", "#ff2929"); // red
Expand Down Expand Up @@ -229,7 +230,6 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme =
exceptions.insert("StatusError");
exceptions.insert("StatusSuccess");
exceptions.insert("StatusWarning");
exceptions.insert("NodeWarning");
exceptions.insert("OverbrightIndicator");
}

Expand Down Expand Up @@ -956,6 +956,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_icon("folded", "TextEdit", theme->get_icon("GuiTreeArrowRight", "EditorIcons"));
theme->set_icon("fold", "TextEdit", theme->get_icon("GuiTreeArrowDown", "EditorIcons"));
theme->set_color("font_color", "TextEdit", font_color);
theme->set_color("font_color_readonly", "TextEdit", font_color_readonly);
theme->set_color("caret_color", "TextEdit", font_color);
theme->set_color("selection_color", "TextEdit", font_color_selection);

Expand Down
24 changes: 20 additions & 4 deletions modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class MSBuildPanel : VBoxContainer
{
public BuildOutputView BuildOutputView { get; private set; }

private MenuButton buildMenuBtn;
private Button errorsBtn;
private Button warningsBtn;
private Button viewLogBtn;
Expand Down Expand Up @@ -56,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 @@ -75,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 @@ -112,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);

var 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 @@ -161,5 +162,20 @@ public override void _Ready()
BuildOutputView = new BuildOutputView();
AddChild(BuildOutputView);
}

public override void _Notification(int what)
{
base._Notification(what);

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");
}
}
}
}

0 comments on commit ac9db4c

Please sign in to comment.