Skip to content

Commit

Permalink
GH-438 Do not show validation success dialog on play game/scene
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Jun 24, 2024
1 parent db2811e commit fe693b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/editor/script_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ bool OrchestratorScriptView::save_as(const String& p_new_file)
return false;
}

bool OrchestratorScriptView::build()
bool OrchestratorScriptView::build(bool p_show_success)
{
BuildLog log;
_orchestration->validate_and_build(log);
Expand All @@ -480,14 +480,14 @@ bool OrchestratorScriptView::build()
_build_errors_dialog->popup_centered_ratio(0.5);
return false;
}
else

if (p_show_success)
{
_build_errors_dialog->set_title("Orchestration Validation Results");
_build_errors->append_text(vformat("* [color=green]OK[/color]: Script is valid."));

_build_errors_dialog->popup_centered_ratio(0.25);
return true;
}
return true;
}

void OrchestratorScriptView::_update_components()
Expand Down Expand Up @@ -547,7 +547,7 @@ OrchestratorGraphEdit* OrchestratorScriptView::_get_or_create_tab(const StringNa
graph->connect("focus_requested", callable_mp(this, &OrchestratorScriptView::_on_graph_focus_requested));
graph->connect("collapse_selected_to_function", callable_mp(this, &OrchestratorScriptView::_collapse_selected_to_function).bind(graph));
graph->connect("expand_node", callable_mp(this, &OrchestratorScriptView::_expand_node).bind(graph));
graph->connect("validation_requested", callable_mp(this, &OrchestratorScriptView::build));
graph->connect("validation_requested", callable_mp(this, &OrchestratorScriptView::build).bind(true));

if (p_focus)
_tabs->get_tab_bar()->set_current_tab(_tabs->get_tab_count() - 1);
Expand Down
3 changes: 2 additions & 1 deletion src/editor/script_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ class OrchestratorScriptView : public HSplitContainer
bool save_as(const String& p_new_file);

/// Performs the build step
/// @param p_show_success display a success message if the build is successful
/// @return true if the build is successful, false otherwise
bool build();
bool build(bool p_show_success = false);

private:
/// Updates the components tree
Expand Down

0 comments on commit fe693b9

Please sign in to comment.