Skip to content

Commit

Permalink
GH-632 Add new function call node color variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Aug 1, 2024
1 parent beb964c commit 6e33e12
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/common/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ void OrchestratorSettings::_register_settings()
_settings.emplace_back(COLOR_NO_ALPHA_SETTING("ui/node_colors/events", Color(0.467, 0.0, 0.0)));
_settings.emplace_back(COLOR_NO_ALPHA_SETTING("ui/node_colors/flow_control", Color(0.132, 0.258, 0.266)));
_settings.emplace_back(COLOR_NO_ALPHA_SETTING("ui/node_colors/function_call", Color(0.0, 0.2, 0.396)));
_settings.emplace_back(COLOR_NO_ALPHA_SETTING("ui/node_colors/orchestration_function_call", Color(0.0, 0.316, 0.601)));
_settings.emplace_back(COLOR_NO_ALPHA_SETTING("ui/node_colors/other_script_function_call", Color(0.027, 0.341, 0.504)));
_settings.emplace_back(COLOR_NO_ALPHA_SETTING("ui/node_colors/pure_function_call", Color(0.133, 0.302, 0.114)));
_settings.emplace_back(COLOR_NO_ALPHA_SETTING("ui/node_colors/function_terminator", Color(0.294, 0.0, 0.506)));
_settings.emplace_back(COLOR_NO_ALPHA_SETTING("ui/node_colors/function_result", Color(1.0, 0.65, 0.4)));
Expand Down
8 changes: 8 additions & 0 deletions src/script/nodes/functions/call_member_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ String OScriptNodeCallMemberFunction::get_node_title() const
return super::get_node_title();
}

String OScriptNodeCallMemberFunction::get_node_title_color_name() const
{
if (!ClassDB::class_exists(_reference.target_class_name))
return "other_script_function_call";

return "function_call";
}

String OScriptNodeCallMemberFunction::get_help_topic() const
{
#if GODOT_VERSION >= 0x040300
Expand Down
2 changes: 1 addition & 1 deletion src/script/nodes/functions/call_member_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class OScriptNodeCallMemberFunction : public OScriptNodeCallFunction
//~ Begin OScriptNode Interface
String get_tooltip_text() const override;
String get_node_title() const override;
String get_node_title_color_name() const override { return "function_call"; }
String get_node_title_color_name() const override;
String get_help_topic() const override;
void initialize(const OScriptNodeInitContext& p_context) override;
void validate_node_during_build(BuildLog& p_log) const override;
Expand Down
2 changes: 1 addition & 1 deletion src/script/nodes/functions/call_script_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class OScriptNodeCallScriptFunction : public OScriptNodeCallFunction
void post_placed_new_node() override;
String get_tooltip_text() const override;
String get_node_title() const override;
String get_node_title_color_name() const override { return "function_call"; }
String get_node_title_color_name() const override { return "orchestration_function_call"; }
Object* get_jump_target_for_double_click() const override;
bool can_jump_to_definition() const override;
void validate_node_during_build(BuildLog& p_log) const override;
Expand Down

0 comments on commit 6e33e12

Please sign in to comment.