mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-02-01 22:07:01 +01:00
Fix double script icon in the editor.
This commit is contained in:
parent
0a9c9ca15e
commit
2183fe6e0f
@ -378,20 +378,19 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent, bool p_scroll
|
||||
if (!script.is_null()) {
|
||||
String additional_notes;
|
||||
Color button_color = Color(1, 1, 1);
|
||||
|
||||
// Can't set tooltip after adding button, need to do it before.
|
||||
if (script->is_tool()) {
|
||||
additional_notes += "\n" + TTR("This script is currently running in the editor.");
|
||||
button_color = get_theme_color("accent_color", "Editor");
|
||||
}
|
||||
item->add_button(0, get_theme_icon("Script", "EditorIcons"), BUTTON_SCRIPT, false, TTR("Open Script:") + " " + script->get_path());
|
||||
|
||||
if (EditorNode::get_singleton()->get_object_custom_type_base(p_node) == script ||
|
||||
ScriptServer::get_global_class_name(script->get_path()) != StringName()) {
|
||||
item->set_button_color(0, item->get_button_count(0) - 1, Color(1, 1, 1, 0.5));
|
||||
}
|
||||
if (EditorNode::get_singleton()->get_object_custom_type_base(p_node) == script) {
|
||||
additional_notes += "\n" + TTR("This script is a custom type.");
|
||||
button_color.a = 0.5;
|
||||
}
|
||||
|
||||
item->add_button(0, get_theme_icon("Script", "EditorIcons"), BUTTON_SCRIPT, false, TTR("Open Script:") + " " + script->get_path() + additional_notes);
|
||||
item->set_button_color(0, item->get_button_count(0) - 1, button_color);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user