Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname. * Subsequent usages use the cached version. * Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time. * Replaced all theme usages by this new macro. * Replace all signal emission usages by this new macro. * Replace all call_deferred usages by this new macro. This is part of ongoing work to optimize GUI and the editor.
This commit is contained in:
parent
b76dfde329
commit
6631f66c2a
|
@ -438,7 +438,7 @@ void Input::joy_connection_changed(int p_idx, bool p_connected, String p_name, S
|
|||
}
|
||||
joy_names[p_idx] = js;
|
||||
|
||||
emit_signal("joy_connection_changed", p_idx, p_connected);
|
||||
emit_signal(SNAME("joy_connection_changed"), p_idx, p_connected);
|
||||
}
|
||||
|
||||
Vector3 Input::get_gravity() const {
|
||||
|
|
|
@ -941,7 +941,7 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, uint16_t p_rpc_id, const
|
|||
void MultiplayerAPI::_add_peer(int p_id) {
|
||||
connected_peers.insert(p_id);
|
||||
path_get_cache.insert(p_id, PathGetCache());
|
||||
emit_signal("network_peer_connected", p_id);
|
||||
emit_signal(SNAME("network_peer_connected"), p_id);
|
||||
}
|
||||
|
||||
void MultiplayerAPI::_del_peer(int p_id) {
|
||||
|
@ -956,19 +956,19 @@ void MultiplayerAPI::_del_peer(int p_id) {
|
|||
PathSentCache *psc = path_send_cache.getptr(E->get());
|
||||
psc->confirmed_peers.erase(p_id);
|
||||
}
|
||||
emit_signal("network_peer_disconnected", p_id);
|
||||
emit_signal(SNAME("network_peer_disconnected"), p_id);
|
||||
}
|
||||
|
||||
void MultiplayerAPI::_connected_to_server() {
|
||||
emit_signal("connected_to_server");
|
||||
emit_signal(SNAME("connected_to_server"));
|
||||
}
|
||||
|
||||
void MultiplayerAPI::_connection_failed() {
|
||||
emit_signal("connection_failed");
|
||||
emit_signal(SNAME("connection_failed"));
|
||||
}
|
||||
|
||||
void MultiplayerAPI::_server_disconnected() {
|
||||
emit_signal("server_disconnected");
|
||||
emit_signal(SNAME("server_disconnected"));
|
||||
}
|
||||
|
||||
void MultiplayerAPI::rpcp(Node *p_node, int p_peer_id, bool p_unreliable, const StringName &p_method, const Variant **p_arg, int p_argcount) {
|
||||
|
@ -1059,7 +1059,7 @@ void MultiplayerAPI::_process_raw(int p_from, const uint8_t *p_packet, int p_pac
|
|||
uint8_t *w = out.ptrw();
|
||||
memcpy(&w[0], &p_packet[1], len);
|
||||
}
|
||||
emit_signal("network_peer_packet", p_from, out);
|
||||
emit_signal(SNAME("network_peer_packet"), p_from, out);
|
||||
}
|
||||
|
||||
int MultiplayerAPI::get_network_unique_id() const {
|
||||
|
|
|
@ -65,7 +65,7 @@ bool UndoRedo::_redo(bool p_execute) {
|
|||
_process_operation_list(actions.write[current_action].do_ops.front());
|
||||
}
|
||||
version++;
|
||||
emit_signal("version_changed");
|
||||
emit_signal(SNAME("version_changed"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ bool UndoRedo::undo() {
|
|||
_process_operation_list(actions.write[current_action].undo_ops.front());
|
||||
current_action--;
|
||||
version--;
|
||||
emit_signal("version_changed");
|
||||
emit_signal(SNAME("version_changed"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ void UndoRedo::clear_history(bool p_increase_version) {
|
|||
|
||||
if (p_increase_version) {
|
||||
version++;
|
||||
emit_signal("version_changed");
|
||||
emit_signal(SNAME("version_changed"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,8 +41,8 @@ StaticCString StaticCString::create(const char *p_ptr) {
|
|||
|
||||
StringName::_Data *StringName::_table[STRING_TABLE_LEN];
|
||||
|
||||
StringName _scs_create(const char *p_chr) {
|
||||
return (p_chr[0] ? StringName(StaticCString::create(p_chr)) : StringName());
|
||||
StringName _scs_create(const char *p_chr, bool p_static) {
|
||||
return (p_chr[0] ? StringName(StaticCString::create(p_chr), p_static) : StringName());
|
||||
}
|
||||
|
||||
bool StringName::configured = false;
|
||||
|
@ -64,7 +64,7 @@ void StringName::cleanup() {
|
|||
while (_table[i]) {
|
||||
_Data *d = _table[i];
|
||||
lost_strings++;
|
||||
if (OS::get_singleton()->is_stdout_verbose()) {
|
||||
if (d->static_count.get() != d->refcount.get() && OS::get_singleton()->is_stdout_verbose()) {
|
||||
if (d->cname) {
|
||||
print_line("Orphan StringName: " + String(d->cname));
|
||||
} else {
|
||||
|
@ -79,6 +79,7 @@ void StringName::cleanup() {
|
|||
if (lost_strings) {
|
||||
print_verbose("StringName: " + itos(lost_strings) + " unclaimed string names at exit.");
|
||||
}
|
||||
configured = false;
|
||||
}
|
||||
|
||||
void StringName::unref() {
|
||||
|
@ -87,6 +88,13 @@ void StringName::unref() {
|
|||
if (_data && _data->refcount.unref()) {
|
||||
MutexLock lock(mutex);
|
||||
|
||||
if (_data->static_count.get() > 0) {
|
||||
if (_data->cname) {
|
||||
ERR_PRINT("BUG: Unreferenced static string to 0: " + String(_data->cname));
|
||||
} else {
|
||||
ERR_PRINT("BUG: Unreferenced static string to 0: " + String(_data->name));
|
||||
}
|
||||
}
|
||||
if (_data->prev) {
|
||||
_data->prev->next = _data->next;
|
||||
} else {
|
||||
|
@ -153,7 +161,7 @@ StringName::StringName(const StringName &p_name) {
|
|||
}
|
||||
}
|
||||
|
||||
StringName::StringName(const char *p_name) {
|
||||
StringName::StringName(const char *p_name, bool p_static) {
|
||||
_data = nullptr;
|
||||
|
||||
ERR_FAIL_COND(!configured);
|
||||
|
@ -181,6 +189,9 @@ StringName::StringName(const char *p_name) {
|
|||
if (_data) {
|
||||
if (_data->refcount.ref()) {
|
||||
// exists
|
||||
if (p_static) {
|
||||
_data->static_count.increment();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -188,6 +199,7 @@ StringName::StringName(const char *p_name) {
|
|||
_data = memnew(_Data);
|
||||
_data->name = p_name;
|
||||
_data->refcount.init();
|
||||
_data->static_count.set(p_static ? 1 : 0);
|
||||
_data->hash = hash;
|
||||
_data->idx = idx;
|
||||
_data->cname = nullptr;
|
||||
|
@ -199,7 +211,7 @@ StringName::StringName(const char *p_name) {
|
|||
_table[idx] = _data;
|
||||
}
|
||||
|
||||
StringName::StringName(const StaticCString &p_static_string) {
|
||||
StringName::StringName(const StaticCString &p_static_string, bool p_static) {
|
||||
_data = nullptr;
|
||||
|
||||
ERR_FAIL_COND(!configured);
|
||||
|
@ -225,6 +237,9 @@ StringName::StringName(const StaticCString &p_static_string) {
|
|||
if (_data) {
|
||||
if (_data->refcount.ref()) {
|
||||
// exists
|
||||
if (p_static) {
|
||||
_data->static_count.increment();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -232,6 +247,7 @@ StringName::StringName(const StaticCString &p_static_string) {
|
|||
_data = memnew(_Data);
|
||||
|
||||
_data->refcount.init();
|
||||
_data->static_count.set(p_static ? 1 : 0);
|
||||
_data->hash = hash;
|
||||
_data->idx = idx;
|
||||
_data->cname = p_static_string.ptr;
|
||||
|
@ -243,7 +259,7 @@ StringName::StringName(const StaticCString &p_static_string) {
|
|||
_table[idx] = _data;
|
||||
}
|
||||
|
||||
StringName::StringName(const String &p_name) {
|
||||
StringName::StringName(const String &p_name, bool p_static) {
|
||||
_data = nullptr;
|
||||
|
||||
ERR_FAIL_COND(!configured);
|
||||
|
@ -269,6 +285,9 @@ StringName::StringName(const String &p_name) {
|
|||
if (_data) {
|
||||
if (_data->refcount.ref()) {
|
||||
// exists
|
||||
if (p_static) {
|
||||
_data->static_count.increment();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -276,6 +295,7 @@ StringName::StringName(const String &p_name) {
|
|||
_data = memnew(_Data);
|
||||
_data->name = p_name;
|
||||
_data->refcount.init();
|
||||
_data->static_count.set(p_static ? 1 : 0);
|
||||
_data->hash = hash;
|
||||
_data->idx = idx;
|
||||
_data->cname = nullptr;
|
||||
|
@ -374,10 +394,6 @@ StringName StringName::search(const String &p_name) {
|
|||
return StringName(); //does not exist
|
||||
}
|
||||
|
||||
StringName::~StringName() {
|
||||
unref();
|
||||
}
|
||||
|
||||
bool operator==(const String &p_name, const StringName &p_string_name) {
|
||||
return p_name == p_string_name.operator String();
|
||||
}
|
||||
|
|
|
@ -44,13 +44,15 @@ struct StaticCString {
|
|||
|
||||
class StringName {
|
||||
enum {
|
||||
STRING_TABLE_BITS = 12,
|
||||
STRING_TABLE_BITS = 16,
|
||||
STRING_TABLE_LEN = 1 << STRING_TABLE_BITS,
|
||||
STRING_TABLE_MASK = STRING_TABLE_LEN - 1
|
||||
};
|
||||
|
||||
struct _Data {
|
||||
SafeRefCount refcount;
|
||||
SafeNumeric<uint32_t> static_count;
|
||||
SafeRefCount static_refcount;
|
||||
const char *cname = nullptr;
|
||||
String name;
|
||||
|
||||
|
@ -146,12 +148,16 @@ public:
|
|||
};
|
||||
|
||||
void operator=(const StringName &p_name);
|
||||
StringName(const char *p_name);
|
||||
StringName(const char *p_name, bool p_static = false);
|
||||
StringName(const StringName &p_name);
|
||||
StringName(const String &p_name);
|
||||
StringName(const StaticCString &p_static_string);
|
||||
StringName(const String &p_name, bool p_static = false);
|
||||
StringName(const StaticCString &p_static_string, bool p_static = false);
|
||||
StringName() {}
|
||||
~StringName();
|
||||
_FORCE_INLINE_ ~StringName() {
|
||||
if (likely(configured) && _data) { //only free if configured
|
||||
unref();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
bool operator==(const String &p_name, const StringName &p_string_name);
|
||||
|
@ -159,6 +165,8 @@ bool operator!=(const String &p_name, const StringName &p_string_name);
|
|||
bool operator==(const char *p_name, const StringName &p_string_name);
|
||||
bool operator!=(const char *p_name, const StringName &p_string_name);
|
||||
|
||||
StringName _scs_create(const char *p_chr);
|
||||
StringName _scs_create(const char *p_chr, bool p_static = false);
|
||||
|
||||
#define SNAME(m_arg) ([]() { static StringName sname = _scs_create(m_arg, true); return sname; })()
|
||||
|
||||
#endif // STRING_NAME_H
|
||||
|
|
|
@ -200,7 +200,7 @@ void InputEventConfigurationDialog::_tab_selected(int p_tab) {
|
|||
if (is_connected("window_input", signal_method)) {
|
||||
disconnect("window_input", signal_method);
|
||||
}
|
||||
input_list_tree->call_deferred("ensure_cursor_is_visible");
|
||||
input_list_tree->call_deferred(SNAME("ensure_cursor_is_visible"));
|
||||
if (input_list_tree->get_selected() == nullptr) {
|
||||
// If nothing selected, scroll to top.
|
||||
input_list_tree->scroll_to_item(input_list_tree->get_root());
|
||||
|
@ -532,14 +532,14 @@ void InputEventConfigurationDialog::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
input_list_search->set_right_icon(input_list_search->get_theme_icon("Search", "EditorIcons"));
|
||||
input_list_search->set_right_icon(input_list_search->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
|
||||
physical_key_checkbox->set_icon(get_theme_icon("KeyboardPhysical", "EditorIcons"));
|
||||
physical_key_checkbox->set_icon(get_theme_icon(SNAME("KeyboardPhysical"), SNAME("EditorIcons")));
|
||||
|
||||
icon_cache.keyboard = get_theme_icon("Keyboard", "EditorIcons");
|
||||
icon_cache.mouse = get_theme_icon("Mouse", "EditorIcons");
|
||||
icon_cache.joypad_button = get_theme_icon("JoyButton", "EditorIcons");
|
||||
icon_cache.joypad_axis = get_theme_icon("JoyAxis", "EditorIcons");
|
||||
icon_cache.keyboard = get_theme_icon(SNAME("Keyboard"), SNAME("EditorIcons"));
|
||||
icon_cache.mouse = get_theme_icon(SNAME("Mouse"), SNAME("EditorIcons"));
|
||||
icon_cache.joypad_button = get_theme_icon(SNAME("JoyButton"), SNAME("EditorIcons"));
|
||||
icon_cache.joypad_axis = get_theme_icon(SNAME("JoyAxis"), SNAME("EditorIcons"));
|
||||
|
||||
_update_input_list();
|
||||
} break;
|
||||
|
@ -724,7 +724,7 @@ void ActionMapEditor::_event_config_confirmed() {
|
|||
}
|
||||
|
||||
new_action["events"] = events;
|
||||
emit_signal("action_edited", current_action_name, new_action);
|
||||
emit_signal(SNAME("action_edited"), current_action_name, new_action);
|
||||
}
|
||||
|
||||
void ActionMapEditor::_add_action_pressed() {
|
||||
|
@ -738,7 +738,7 @@ void ActionMapEditor::_add_action(const String &p_name) {
|
|||
}
|
||||
|
||||
add_edit->clear();
|
||||
emit_signal("action_added", p_name);
|
||||
emit_signal(SNAME("action_added"), p_name);
|
||||
}
|
||||
|
||||
void ActionMapEditor::_action_edited() {
|
||||
|
@ -762,7 +762,7 @@ void ActionMapEditor::_action_edited() {
|
|||
return;
|
||||
}
|
||||
|
||||
emit_signal("action_renamed", old_name, new_name);
|
||||
emit_signal(SNAME("action_renamed"), old_name, new_name);
|
||||
} else if (action_tree->get_selected_column() == 1) {
|
||||
// Deadzone Edited
|
||||
String name = ti->get_meta("__name");
|
||||
|
@ -771,7 +771,7 @@ void ActionMapEditor::_action_edited() {
|
|||
new_action["deadzone"] = ti->get_range(1);
|
||||
|
||||
// Call deferred so that input can finish propagating through tree, allowing re-making of tree to occur.
|
||||
call_deferred("emit_signal", "action_edited", name, new_action);
|
||||
call_deferred(SNAME("emit_signal"), "action_edited", name, new_action);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -808,7 +808,7 @@ void ActionMapEditor::_tree_button_pressed(Object *p_item, int p_column, int p_i
|
|||
case ActionMapEditor::BUTTON_REMOVE_ACTION: {
|
||||
// Send removed action name
|
||||
String name = item->get_meta("__name");
|
||||
emit_signal("action_removed", name);
|
||||
emit_signal(SNAME("action_removed"), name);
|
||||
} break;
|
||||
case ActionMapEditor::BUTTON_REMOVE_EVENT: {
|
||||
// Remove event and send updated action
|
||||
|
@ -821,7 +821,7 @@ void ActionMapEditor::_tree_button_pressed(Object *p_item, int p_column, int p_i
|
|||
events.remove(event_index);
|
||||
action["events"] = events;
|
||||
|
||||
emit_signal("action_edited", action_name, action);
|
||||
emit_signal(SNAME("action_edited"), action_name, action);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
|
@ -922,7 +922,7 @@ void ActionMapEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data,
|
|||
// Change action order.
|
||||
String relative_to = target->get_meta("__name");
|
||||
String action_name = selected->get_meta("__name");
|
||||
emit_signal("action_reordered", action_name, relative_to, drop_above);
|
||||
emit_signal(SNAME("action_reordered"), action_name, relative_to, drop_above);
|
||||
|
||||
} else if (d["input_type"] == "event") {
|
||||
// Change event order
|
||||
|
@ -956,7 +956,7 @@ void ActionMapEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data,
|
|||
}
|
||||
|
||||
new_action["events"] = new_events;
|
||||
emit_signal("action_edited", selected->get_parent()->get_meta("__name"), new_action);
|
||||
emit_signal(SNAME("action_edited"), selected->get_parent()->get_meta("__name"), new_action);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -964,7 +964,7 @@ void ActionMapEditor::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
action_list_search->set_right_icon(get_theme_icon("Search", "EditorIcons"));
|
||||
action_list_search->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1038,11 +1038,11 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info
|
|||
action_item->set_range(1, deadzone);
|
||||
|
||||
// Third column - buttons
|
||||
action_item->add_button(2, action_tree->get_theme_icon("Add", "EditorIcons"), BUTTON_ADD_EVENT, false, TTR("Add Event"));
|
||||
action_item->add_button(2, action_tree->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_ACTION, !action_info.editable, action_info.editable ? "Remove Action" : "Cannot Remove Action");
|
||||
action_item->add_button(2, action_tree->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")), BUTTON_ADD_EVENT, false, TTR("Add Event"));
|
||||
action_item->add_button(2, action_tree->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_ACTION, !action_info.editable, action_info.editable ? "Remove Action" : "Cannot Remove Action");
|
||||
|
||||
action_item->set_custom_bg_color(0, action_tree->get_theme_color("prop_subsection", "Editor"));
|
||||
action_item->set_custom_bg_color(1, action_tree->get_theme_color("prop_subsection", "Editor"));
|
||||
action_item->set_custom_bg_color(0, action_tree->get_theme_color(SNAME("prop_subsection"), SNAME("Editor")));
|
||||
action_item->set_custom_bg_color(1, action_tree->get_theme_color(SNAME("prop_subsection"), SNAME("Editor")));
|
||||
|
||||
for (int evnt_idx = 0; evnt_idx < events.size(); evnt_idx++) {
|
||||
Ref<InputEvent> event = events[evnt_idx];
|
||||
|
@ -1058,8 +1058,8 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info
|
|||
event_item->set_meta("__index", evnt_idx);
|
||||
|
||||
// Third Column - Buttons
|
||||
event_item->add_button(2, action_tree->get_theme_icon("Edit", "EditorIcons"), BUTTON_EDIT_EVENT, false, TTR("Edit Event"));
|
||||
event_item->add_button(2, action_tree->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_EVENT, false, TTR("Remove Event"));
|
||||
event_item->add_button(2, action_tree->get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), BUTTON_EDIT_EVENT, false, TTR("Edit Event"));
|
||||
event_item->add_button(2, action_tree->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_EVENT, false, TTR("Remove Event"));
|
||||
event_item->set_button_color(2, 0, Color(1, 1, 1, 0.75));
|
||||
event_item->set_button_color(2, 1, Color(1, 1, 1, 0.75));
|
||||
}
|
||||
|
|
|
@ -217,19 +217,19 @@ void AnimationBezierTrackEdit::_draw_line_clipped(const Vector2 &p_from, const V
|
|||
|
||||
void AnimationBezierTrackEdit::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) {
|
||||
bezier_icon = get_theme_icon("KeyBezierPoint", "EditorIcons");
|
||||
bezier_handle_icon = get_theme_icon("KeyBezierHandle", "EditorIcons");
|
||||
selected_icon = get_theme_icon("KeyBezierSelected", "EditorIcons");
|
||||
bezier_icon = get_theme_icon(SNAME("KeyBezierPoint"), SNAME("EditorIcons"));
|
||||
bezier_handle_icon = get_theme_icon(SNAME("KeyBezierHandle"), SNAME("EditorIcons"));
|
||||
selected_icon = get_theme_icon(SNAME("KeyBezierSelected"), SNAME("EditorIcons"));
|
||||
if (handle_mode_option->get_item_count() == 0) {
|
||||
handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesFree", "EditorIcons"), TTR("Free"), HANDLE_MODE_FREE);
|
||||
handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesBalanced", "EditorIcons"), TTR("Balanced"), HANDLE_MODE_BALANCED);
|
||||
handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesMirror", "EditorIcons"), TTR("Mirror"), HANDLE_MODE_MIRROR);
|
||||
handle_mode_option->add_icon_item(get_theme_icon(SNAME("BezierHandlesFree"), SNAME("EditorIcons")), TTR("Free"), HANDLE_MODE_FREE);
|
||||
handle_mode_option->add_icon_item(get_theme_icon(SNAME("BezierHandlesBalanced"), SNAME("EditorIcons")), TTR("Balanced"), HANDLE_MODE_BALANCED);
|
||||
handle_mode_option->add_icon_item(get_theme_icon(SNAME("BezierHandlesMirror"), SNAME("EditorIcons")), TTR("Mirror"), HANDLE_MODE_MIRROR);
|
||||
}
|
||||
}
|
||||
if (p_what == NOTIFICATION_RESIZED) {
|
||||
int right_limit = get_size().width - timeline->get_buttons_width();
|
||||
int hsep = get_theme_constant("hseparation", "ItemList");
|
||||
int vsep = get_theme_constant("vseparation", "ItemList");
|
||||
int hsep = get_theme_constant(SNAME("hseparation"), SNAME("ItemList"));
|
||||
int vsep = get_theme_constant(SNAME("vseparation"), SNAME("ItemList"));
|
||||
|
||||
handle_mode_option->set_position(Vector2(right_limit + hsep, get_size().height - handle_mode_option->get_combined_minimum_size().height - vsep));
|
||||
handle_mode_option->set_size(Vector2(timeline->get_buttons_width() - hsep * 2, handle_mode_option->get_combined_minimum_size().height));
|
||||
|
@ -242,16 +242,16 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
|
|||
int limit = timeline->get_name_limit();
|
||||
|
||||
if (has_focus()) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
accent.a *= 0.7;
|
||||
draw_rect(Rect2(Point2(), get_size()), accent, false);
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
int hsep = get_theme_constant("hseparation", "ItemList");
|
||||
int vsep = get_theme_constant("vseparation", "ItemList");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
int hsep = get_theme_constant(SNAME("hseparation"), SNAME("ItemList"));
|
||||
int vsep = get_theme_constant(SNAME("vseparation"), SNAME("ItemList"));
|
||||
Color linecolor = color;
|
||||
linecolor.a = 0.2;
|
||||
|
||||
|
@ -261,7 +261,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
|
|||
|
||||
draw_line(Point2(right_limit, 0), Point2(right_limit, get_size().height), linecolor);
|
||||
|
||||
Ref<Texture2D> close_icon = get_theme_icon("Close", "EditorIcons");
|
||||
Ref<Texture2D> close_icon = get_theme_icon(SNAME("Close"), SNAME("EditorIcons"));
|
||||
|
||||
close_icon_rect.position = Vector2(get_size().width - close_icon->get_width() - hsep, hsep);
|
||||
close_icon_rect.size = close_icon->get_size();
|
||||
|
@ -349,7 +349,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
|
|||
|
||||
subtracks[i] = rect;
|
||||
} else {
|
||||
Color ac = get_theme_color("accent_color", "Editor");
|
||||
Color ac = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
ac.a = 0.5;
|
||||
draw_rect(rect, ac);
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
|
|||
vofs += text_buf.get_size().y + vsep;
|
||||
}
|
||||
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
|
||||
{ //guides
|
||||
float min_left_scale = font->get_height(font_size) + vsep;
|
||||
|
@ -401,7 +401,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
|
|||
{ //draw OTHER curves
|
||||
|
||||
float scale = timeline->get_zoom_scale();
|
||||
Ref<Texture2D> point = get_theme_icon("KeyValue", "EditorIcons");
|
||||
Ref<Texture2D> point = get_theme_icon(SNAME("KeyValue"), SNAME("EditorIcons"));
|
||||
for (Map<int, Color>::Element *E = subtrack_colors.front(); E; E = E->next()) {
|
||||
_draw_track(E->key(), E->get());
|
||||
|
||||
|
@ -418,7 +418,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
|
|||
}
|
||||
|
||||
//draw edited curve
|
||||
const Color highlight = get_theme_color("highlight_color", "Editor");
|
||||
const Color highlight = get_theme_color(SNAME("highlight_color"), SNAME("Editor"));
|
||||
_draw_track(track, highlight);
|
||||
}
|
||||
|
||||
|
@ -547,7 +547,7 @@ void AnimationBezierTrackEdit::_play_position_draw() {
|
|||
int px = (-timeline->get_value() + play_position_pos) * scale + timeline->get_name_limit();
|
||||
|
||||
if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) {
|
||||
Color color = get_theme_color("accent_color", "Editor");
|
||||
Color color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(2 * EDSCALE));
|
||||
}
|
||||
}
|
||||
|
@ -576,7 +576,7 @@ String AnimationBezierTrackEdit::get_tooltip(const Point2 &p_pos) const {
|
|||
|
||||
void AnimationBezierTrackEdit::_clear_selection() {
|
||||
selection.clear();
|
||||
emit_signal("clear_selection");
|
||||
emit_signal(SNAME("clear_selection"));
|
||||
update();
|
||||
}
|
||||
|
||||
|
@ -597,7 +597,7 @@ void AnimationBezierTrackEdit::_select_at_anim(const Ref<Animation> &p_anim, int
|
|||
ERR_FAIL_COND(idx < 0);
|
||||
|
||||
selection.insert(idx);
|
||||
emit_signal("select_key", idx, true);
|
||||
emit_signal(SNAME("select_key"), idx, true);
|
||||
update();
|
||||
}
|
||||
|
||||
|
@ -663,9 +663,9 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
menu->add_icon_item(bezier_icon, TTR("Insert Key Here"), MENU_KEY_INSERT);
|
||||
if (selection.size()) {
|
||||
menu->add_separator();
|
||||
menu->add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), TTR("Duplicate Selected Key(s)"), MENU_KEY_DUPLICATE);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("Duplicate"), SNAME("EditorIcons")), TTR("Duplicate Selected Key(s)"), MENU_KEY_DUPLICATE);
|
||||
menu->add_separator();
|
||||
menu->add_icon_item(get_theme_icon("Remove", "EditorIcons"), TTR("Delete Selected Key(s)"), MENU_KEY_DELETE);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Delete Selected Key(s)"), MENU_KEY_DELETE);
|
||||
}
|
||||
|
||||
menu->set_as_minsize();
|
||||
|
@ -676,7 +676,7 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
|
||||
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MOUSE_BUTTON_LEFT) {
|
||||
if (close_icon_rect.has_point(mb->get_position())) {
|
||||
emit_signal("close_request");
|
||||
emit_signal(SNAME("close_request"));
|
||||
return;
|
||||
}
|
||||
for (Map<int, Rect2>::Element *E = subtracks.front(); E; E = E->next()) {
|
||||
|
|
|
@ -1290,7 +1290,7 @@ public:
|
|||
void AnimationTimelineEdit::_zoom_changed(double) {
|
||||
update();
|
||||
play_position->update();
|
||||
emit_signal("zoom_changed");
|
||||
emit_signal(SNAME("zoom_changed"));
|
||||
}
|
||||
|
||||
float AnimationTimelineEdit::get_zoom_scale() const {
|
||||
|
@ -1321,7 +1321,7 @@ void AnimationTimelineEdit::_anim_length_changed(double p_new_len) {
|
|||
editing = false;
|
||||
update();
|
||||
|
||||
emit_signal("length_changed", p_new_len);
|
||||
emit_signal(SNAME("length_changed"), p_new_len);
|
||||
}
|
||||
|
||||
void AnimationTimelineEdit::_anim_loop_pressed() {
|
||||
|
@ -1332,11 +1332,11 @@ void AnimationTimelineEdit::_anim_loop_pressed() {
|
|||
}
|
||||
|
||||
int AnimationTimelineEdit::get_buttons_width() const {
|
||||
Ref<Texture2D> interp_mode = get_theme_icon("TrackContinuous", "EditorIcons");
|
||||
Ref<Texture2D> interp_type = get_theme_icon("InterpRaw", "EditorIcons");
|
||||
Ref<Texture2D> loop_type = get_theme_icon("InterpWrapClamp", "EditorIcons");
|
||||
Ref<Texture2D> remove_icon = get_theme_icon("Remove", "EditorIcons");
|
||||
Ref<Texture2D> down_icon = get_theme_icon("select_arrow", "Tree");
|
||||
Ref<Texture2D> interp_mode = get_theme_icon(SNAME("TrackContinuous"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> interp_type = get_theme_icon(SNAME("InterpRaw"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> loop_type = get_theme_icon(SNAME("InterpWrapClamp"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> remove_icon = get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> down_icon = get_theme_icon(SNAME("select_arrow"), SNAME("Tree"));
|
||||
|
||||
int total_w = interp_mode->get_width() + interp_type->get_width() + loop_type->get_width() + remove_icon->get_width();
|
||||
total_w += (down_icon->get_width() + 4 * EDSCALE) * 4;
|
||||
|
@ -1345,7 +1345,7 @@ int AnimationTimelineEdit::get_buttons_width() const {
|
|||
}
|
||||
|
||||
int AnimationTimelineEdit::get_name_limit() const {
|
||||
Ref<Texture2D> hsize_icon = get_theme_icon("Hsize", "EditorIcons");
|
||||
Ref<Texture2D> hsize_icon = get_theme_icon(SNAME("Hsize"), SNAME("EditorIcons"));
|
||||
|
||||
int limit = MAX(name_limit, add_track->get_minimum_size().width + hsize_icon->get_width());
|
||||
|
||||
|
@ -1356,17 +1356,17 @@ int AnimationTimelineEdit::get_name_limit() const {
|
|||
|
||||
void AnimationTimelineEdit::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
add_track->set_icon(get_theme_icon("Add", "EditorIcons"));
|
||||
loop->set_icon(get_theme_icon("Loop", "EditorIcons"));
|
||||
time_icon->set_texture(get_theme_icon("Time", "EditorIcons"));
|
||||
add_track->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
loop->set_icon(get_theme_icon(SNAME("Loop"), SNAME("EditorIcons")));
|
||||
time_icon->set_texture(get_theme_icon(SNAME("Time"), SNAME("EditorIcons")));
|
||||
|
||||
add_track->get_popup()->clear();
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon("KeyValue", "EditorIcons"), TTR("Property Track"));
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon("KeyXform", "EditorIcons"), TTR("3D Transform Track"));
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon("KeyCall", "EditorIcons"), TTR("Call Method Track"));
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon("KeyBezier", "EditorIcons"), TTR("Bezier Curve Track"));
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon("KeyAudio", "EditorIcons"), TTR("Audio Playback Track"));
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon("KeyAnimation", "EditorIcons"), TTR("Animation Playback Track"));
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon(SNAME("KeyValue"), SNAME("EditorIcons")), TTR("Property Track"));
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon(SNAME("KeyXform"), SNAME("EditorIcons")), TTR("3D Transform Track"));
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon(SNAME("KeyCall"), SNAME("EditorIcons")), TTR("Call Method Track"));
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon(SNAME("KeyBezier"), SNAME("EditorIcons")), TTR("Bezier Curve Track"));
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon(SNAME("KeyAudio"), SNAME("EditorIcons")), TTR("Audio Playback Track"));
|
||||
add_track->get_popup()->add_icon_item(get_theme_icon(SNAME("KeyAnimation"), SNAME("EditorIcons")), TTR("Animation Playback Track"));
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_RESIZED) {
|
||||
|
@ -1381,9 +1381,9 @@ void AnimationTimelineEdit::_notification(int p_what) {
|
|||
return;
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
|
||||
int zoomw = key_range;
|
||||
float scale = get_zoom_scale();
|
||||
|
@ -1394,7 +1394,7 @@ void AnimationTimelineEdit::_notification(int p_what) {
|
|||
l = 0.001; //avoid crashor
|
||||
}
|
||||
|
||||
Ref<Texture2D> hsize_icon = get_theme_icon("Hsize", "EditorIcons");
|
||||
Ref<Texture2D> hsize_icon = get_theme_icon(SNAME("Hsize"), SNAME("EditorIcons"));
|
||||
hsize_rect = Rect2(get_name_limit() - hsize_icon->get_width() - 2 * EDSCALE, (get_size().height - hsize_icon->get_height()) / 2, hsize_icon->get_width(), hsize_icon->get_height());
|
||||
draw_texture(hsize_icon, hsize_rect.position);
|
||||
|
||||
|
@ -1443,7 +1443,7 @@ void AnimationTimelineEdit::_notification(int p_what) {
|
|||
|
||||
int end_px = (l - get_value()) * scale;
|
||||
int begin_px = -get_value() * scale;
|
||||
Color notimecol = get_theme_color("dark_color_2", "Editor");
|
||||
Color notimecol = get_theme_color(SNAME("dark_color_2"), SNAME("Editor"));
|
||||
Color timecolor = color;
|
||||
timecolor.a = 0.2;
|
||||
Color linecolor = color;
|
||||
|
@ -1568,10 +1568,10 @@ void AnimationTimelineEdit::set_animation(const Ref<Animation> &p_animation) {
|
|||
|
||||
Size2 AnimationTimelineEdit::get_minimum_size() const {
|
||||
Size2 ms = add_track->get_minimum_size();
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
ms.height = MAX(ms.height, font->get_height(font_size));
|
||||
ms.width = get_buttons_width() + add_track->get_minimum_size().width + get_theme_icon("Hsize", "EditorIcons")->get_width() + 2;
|
||||
ms.width = get_buttons_width() + add_track->get_minimum_size().width + get_theme_icon(SNAME("Hsize"), SNAME("EditorIcons"))->get_width() + 2;
|
||||
return ms;
|
||||
}
|
||||
|
||||
|
@ -1633,11 +1633,11 @@ void AnimationTimelineEdit::_play_position_draw() {
|
|||
int px = (-get_value() + play_position_pos) * scale + get_name_limit();
|
||||
|
||||
if (px >= get_name_limit() && px < (play_position->get_size().width - get_buttons_width())) {
|
||||
Color color = get_theme_color("accent_color", "Editor");
|
||||
Color color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(2 * EDSCALE));
|
||||
play_position->draw_texture(
|
||||
get_theme_icon("TimelineIndicator", "EditorIcons"),
|
||||
Point2(px - get_theme_icon("TimelineIndicator", "EditorIcons")->get_width() * 0.5, 0),
|
||||
get_theme_icon(SNAME("TimelineIndicator"), SNAME("EditorIcons")),
|
||||
Point2(px - get_theme_icon(SNAME("TimelineIndicator"), SNAME("EditorIcons"))->get_width() * 0.5, 0),
|
||||
color);
|
||||
}
|
||||
}
|
||||
|
@ -1685,7 +1685,7 @@ void AnimationTimelineEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
int x = mb->get_position().x - get_name_limit();
|
||||
|
||||
float ofs = x / get_zoom_scale() + get_value();
|
||||
emit_signal("timeline_changed", ofs, false, Input::get_singleton()->is_key_pressed(KEY_ALT));
|
||||
emit_signal(SNAME("timeline_changed"), ofs, false, Input::get_singleton()->is_key_pressed(KEY_ALT));
|
||||
dragging_timeline = true;
|
||||
}
|
||||
if (!dragging_timeline && mb->get_button_index() == MOUSE_BUTTON_MIDDLE) {
|
||||
|
@ -1718,13 +1718,13 @@ void AnimationTimelineEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
int ofs = mm->get_position().x - dragging_hsize_from;
|
||||
name_limit = dragging_hsize_at + ofs;
|
||||
update();
|
||||
emit_signal("name_limit_changed");
|
||||
emit_signal(SNAME("name_limit_changed"));
|
||||
play_position->update();
|
||||
}
|
||||
if (dragging_timeline) {
|
||||
int x = mm->get_position().x - get_name_limit();
|
||||
float ofs = x / get_zoom_scale() + get_value();
|
||||
emit_signal("timeline_changed", ofs, false, Input::get_singleton()->is_key_pressed(KEY_ALT));
|
||||
emit_signal(SNAME("timeline_changed"), ofs, false, Input::get_singleton()->is_key_pressed(KEY_ALT));
|
||||
}
|
||||
if (panning_timeline) {
|
||||
int x = mm->get_position().x - get_name_limit();
|
||||
|
@ -1750,7 +1750,7 @@ void AnimationTimelineEdit::set_hscroll(HScrollBar *p_hscroll) {
|
|||
}
|
||||
|
||||
void AnimationTimelineEdit::_track_added(int p_track) {
|
||||
emit_signal("track_added", p_track);
|
||||
emit_signal(SNAME("track_added"), p_track);
|
||||
}
|
||||
|
||||
void AnimationTimelineEdit::_bind_methods() {
|
||||
|
@ -1832,31 +1832,31 @@ void AnimationTrackEdit::_notification(int p_what) {
|
|||
int limit = timeline->get_name_limit();
|
||||
|
||||
if (has_focus()) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
accent.a *= 0.7;
|
||||
// Offside so the horizontal sides aren't cutoff.
|
||||
draw_rect(Rect2(Point2(1 * EDSCALE, 0), get_size() - Size2(1 * EDSCALE, 0)), accent, false);
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
Ref<Texture2D> type_icons[6] = {
|
||||
get_theme_icon("KeyValue", "EditorIcons"),
|
||||
get_theme_icon("KeyXform", "EditorIcons"),
|
||||
get_theme_icon("KeyCall", "EditorIcons"),
|
||||
get_theme_icon("KeyBezier", "EditorIcons"),
|
||||
get_theme_icon("KeyAudio", "EditorIcons"),
|
||||
get_theme_icon("KeyAnimation", "EditorIcons")
|
||||
get_theme_icon(SNAME("KeyValue"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("KeyXform"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("KeyCall"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("KeyBezier"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("KeyAudio"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("KeyAnimation"), SNAME("EditorIcons"))
|
||||
};
|
||||
int hsep = get_theme_constant("hseparation", "ItemList");
|
||||
int hsep = get_theme_constant(SNAME("hseparation"), SNAME("ItemList"));
|
||||
Color linecolor = color;
|
||||
linecolor.a = 0.2;
|
||||
|
||||
// NAMES AND ICONS //
|
||||
|
||||
{
|
||||
Ref<Texture2D> check = animation->track_is_enabled(track) ? get_theme_icon("checked", "CheckBox") : get_theme_icon("unchecked", "CheckBox");
|
||||
Ref<Texture2D> check = animation->track_is_enabled(track) ? get_theme_icon(SNAME("checked"), SNAME("CheckBox")) : get_theme_icon(SNAME("unchecked"), SNAME("CheckBox"));
|
||||
|
||||
int ofs = in_group ? check->get_width() : 0; //not the best reference for margin but..
|
||||
|
||||
|
@ -1877,7 +1877,7 @@ void AnimationTrackEdit::_notification(int p_what) {
|
|||
String text;
|
||||
Color text_color = color;
|
||||
if (node && EditorNode::get_singleton()->get_editor_selection()->is_selected(node)) {
|
||||
text_color = get_theme_color("accent_color", "Editor");
|
||||
text_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
}
|
||||
|
||||
if (in_group) {
|
||||
|
@ -1952,25 +1952,25 @@ void AnimationTrackEdit::_notification(int p_what) {
|
|||
|
||||
{
|
||||
Ref<Texture2D> wrap_icon[2] = {
|
||||
get_theme_icon("InterpWrapClamp", "EditorIcons"),
|
||||
get_theme_icon("InterpWrapLoop", "EditorIcons"),
|
||||
get_theme_icon(SNAME("InterpWrapClamp"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("InterpWrapLoop"), SNAME("EditorIcons")),
|
||||
};
|
||||
|
||||
Ref<Texture2D> interp_icon[3] = {
|
||||
get_theme_icon("InterpRaw", "EditorIcons"),
|
||||
get_theme_icon("InterpLinear", "EditorIcons"),
|
||||
get_theme_icon("InterpCubic", "EditorIcons")
|
||||
get_theme_icon(SNAME("InterpRaw"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("InterpLinear"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("InterpCubic"), SNAME("EditorIcons"))
|
||||
};
|
||||
Ref<Texture2D> cont_icon[4] = {
|
||||
get_theme_icon("TrackContinuous", "EditorIcons"),
|
||||
get_theme_icon("TrackDiscrete", "EditorIcons"),
|
||||
get_theme_icon("TrackTrigger", "EditorIcons"),
|
||||
get_theme_icon("TrackCapture", "EditorIcons")
|
||||
get_theme_icon(SNAME("TrackContinuous"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("TrackDiscrete"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("TrackTrigger"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("TrackCapture"), SNAME("EditorIcons"))
|
||||
};
|
||||
|
||||
int ofs = get_size().width - timeline->get_buttons_width();
|
||||
|
||||
Ref<Texture2D> down_icon = get_theme_icon("select_arrow", "Tree");
|
||||
Ref<Texture2D> down_icon = get_theme_icon(SNAME("select_arrow"), SNAME("Tree"));
|
||||
|
||||
draw_line(Point2(ofs, 0), Point2(ofs, get_size().height), linecolor, Math::round(EDSCALE));
|
||||
|
||||
|
@ -2007,7 +2007,7 @@ void AnimationTrackEdit::_notification(int p_what) {
|
|||
update_mode_rect.size.x += down_icon->get_width();
|
||||
bezier_edit_rect = Rect2();
|
||||
} else if (animation->track_get_type(track) == Animation::TYPE_BEZIER) {
|
||||
Ref<Texture2D> bezier_icon = get_theme_icon("EditBezier", "EditorIcons");
|
||||
Ref<Texture2D> bezier_icon = get_theme_icon(SNAME("EditBezier"), SNAME("EditorIcons"));
|
||||
update_mode_rect.size.x += down_icon->get_width();
|
||||
bezier_edit_rect.position = update_mode_rect.position + (update_mode_rect.size - bezier_icon->get_size()) / 2;
|
||||
bezier_edit_rect.size = bezier_icon->get_size();
|
||||
|
@ -2092,7 +2092,7 @@ void AnimationTrackEdit::_notification(int p_what) {
|
|||
{
|
||||
//erase
|
||||
|
||||
Ref<Texture2D> icon = get_theme_icon("Remove", "EditorIcons");
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"));
|
||||
|
||||
remove_rect.position.x = ofs + ((get_size().width - ofs) - icon->get_width()) / 2;
|
||||
remove_rect.position.y = int(get_size().height - icon->get_height()) / 2;
|
||||
|
@ -2109,7 +2109,7 @@ void AnimationTrackEdit::_notification(int p_what) {
|
|||
}
|
||||
|
||||
if (dropping_at != 0) {
|
||||
Color drop_color = get_theme_color("accent_color", "Editor");
|
||||
Color drop_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
if (dropping_at < 0) {
|
||||
draw_line(Vector2(0, 0), Vector2(get_size().width, 0), drop_color, Math::round(EDSCALE));
|
||||
} else {
|
||||
|
@ -2161,7 +2161,7 @@ void AnimationTrackEdit::draw_key_link(int p_index, float p_pixels_sec, int p_x,
|
|||
return;
|
||||
}
|
||||
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
color.a = 0.5;
|
||||
|
||||
int from_x = MAX(p_x, p_clip_left);
|
||||
|
@ -2186,16 +2186,16 @@ void AnimationTrackEdit::draw_key(int p_index, float p_pixels_sec, int p_x, bool
|
|||
const Variant &v = animation->track_get_key_value(track, p_index);
|
||||
Variant::Type valid_type = Variant::NIL;
|
||||
if (!_is_value_key_valid(v, valid_type)) {
|
||||
icon_to_draw = get_theme_icon("KeyInvalid", "EditorIcons");
|
||||
icon_to_draw = get_theme_icon(SNAME("KeyInvalid"), SNAME("EditorIcons"));
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 ofs(p_x - icon_to_draw->get_width() / 2, int(get_size().height - icon_to_draw->get_height()) / 2);
|
||||
|
||||
if (animation->track_get_type(track) == Animation::TYPE_METHOD) {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
color.a = 0.5;
|
||||
|
||||
Dictionary d = animation->track_get_key_value(track, p_index);
|
||||
|
@ -2298,19 +2298,19 @@ void AnimationTrackEdit::set_animation_and_track(const Ref<Animation> &p_animati
|
|||
update();
|
||||
|
||||
Ref<Texture2D> type_icons[6] = {
|
||||
get_theme_icon("KeyValue", "EditorIcons"),
|
||||
get_theme_icon("KeyXform", "EditorIcons"),
|
||||
get_theme_icon("KeyCall", "EditorIcons"),
|
||||
get_theme_icon("KeyBezier", "EditorIcons"),
|
||||
get_theme_icon("KeyAudio", "EditorIcons"),
|
||||
get_theme_icon("KeyAnimation", "EditorIcons")
|
||||
get_theme_icon(SNAME("KeyValue"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("KeyXform"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("KeyCall"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("KeyBezier"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("KeyAudio"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("KeyAnimation"), SNAME("EditorIcons"))
|
||||
};
|
||||
|
||||
ERR_FAIL_INDEX(track, animation->get_track_count());
|
||||
|
||||
node_path = animation->track_get_path(p_track);
|
||||
type_icon = type_icons[animation->track_get_type(track)];
|
||||
selected_icon = get_theme_icon("KeySelected", "EditorIcons");
|
||||
selected_icon = get_theme_icon(SNAME("KeySelected"), SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
NodePath AnimationTrackEdit::get_path() const {
|
||||
|
@ -2318,10 +2318,10 @@ NodePath AnimationTrackEdit::get_path() const {
|
|||
}
|
||||
|
||||
Size2 AnimationTrackEdit::get_minimum_size() const {
|
||||
Ref<Texture2D> texture = get_theme_icon("Object", "EditorIcons");
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
int separation = get_theme_constant("vseparation", "ItemList");
|
||||
Ref<Texture2D> texture = get_theme_icon(SNAME("Object"), SNAME("EditorIcons"));
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int separation = get_theme_constant(SNAME("vseparation"), SNAME("ItemList"));
|
||||
|
||||
int max_h = MAX(texture->get_height(), font->get_height(font_size));
|
||||
max_h = MAX(max_h, get_key_height());
|
||||
|
@ -2355,7 +2355,7 @@ void AnimationTrackEdit::_play_position_draw() {
|
|||
int px = (-timeline->get_value() + play_position_pos) * scale + timeline->get_name_limit();
|
||||
|
||||
if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) {
|
||||
Color color = get_theme_color("accent_color", "Editor");
|
||||
Color color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(2 * EDSCALE));
|
||||
}
|
||||
}
|
||||
|
@ -2556,17 +2556,17 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
|
||||
if (p_event->is_pressed()) {
|
||||
if (ED_GET_SHORTCUT("animation_editor/duplicate_selection")->is_shortcut(p_event)) {
|
||||
emit_signal("duplicate_request");
|
||||
emit_signal(SNAME("duplicate_request"));
|
||||
accept_event();
|
||||
}
|
||||
|
||||
if (ED_GET_SHORTCUT("animation_editor/duplicate_selection_transposed")->is_shortcut(p_event)) {
|
||||
emit_signal("duplicate_transpose_request");
|
||||
emit_signal(SNAME("duplicate_transpose_request"));
|
||||
accept_event();
|
||||
}
|
||||
|
||||
if (ED_GET_SHORTCUT("animation_editor/delete_selection")->is_shortcut(p_event)) {
|
||||
emit_signal("delete_request");
|
||||
emit_signal(SNAME("delete_request"));
|
||||
accept_event();
|
||||
}
|
||||
}
|
||||
|
@ -2597,10 +2597,10 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
menu->connect("id_pressed", callable_mp(this, &AnimationTrackEdit::_menu_selected));
|
||||
}
|
||||
menu->clear();
|
||||
menu->add_icon_item(get_theme_icon("TrackContinuous", "EditorIcons"), TTR("Continuous"), MENU_CALL_MODE_CONTINUOUS);
|
||||
menu->add_icon_item(get_theme_icon("TrackDiscrete", "EditorIcons"), TTR("Discrete"), MENU_CALL_MODE_DISCRETE);
|
||||
menu->add_icon_item(get_theme_icon("TrackTrigger", "EditorIcons"), TTR("Trigger"), MENU_CALL_MODE_TRIGGER);
|
||||
menu->add_icon_item(get_theme_icon("TrackCapture", "EditorIcons"), TTR("Capture"), MENU_CALL_MODE_CAPTURE);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("TrackContinuous"), SNAME("EditorIcons")), TTR("Continuous"), MENU_CALL_MODE_CONTINUOUS);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("TrackDiscrete"), SNAME("EditorIcons")), TTR("Discrete"), MENU_CALL_MODE_DISCRETE);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("TrackTrigger"), SNAME("EditorIcons")), TTR("Trigger"), MENU_CALL_MODE_TRIGGER);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("TrackCapture"), SNAME("EditorIcons")), TTR("Capture"), MENU_CALL_MODE_CAPTURE);
|
||||
menu->set_as_minsize();
|
||||
|
||||
Vector2 popup_pos = get_screen_position() + update_mode_rect.position + Vector2(0, update_mode_rect.size.height);
|
||||
|
@ -2616,9 +2616,9 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
menu->connect("id_pressed", callable_mp(this, &AnimationTrackEdit::_menu_selected));
|
||||
}
|
||||
menu->clear();
|
||||
menu->add_icon_item(get_theme_icon("InterpRaw", "EditorIcons"), TTR("Nearest"), MENU_INTERPOLATION_NEAREST);
|
||||
menu->add_icon_item(get_theme_icon("InterpLinear", "EditorIcons"), TTR("Linear"), MENU_INTERPOLATION_LINEAR);
|
||||
menu->add_icon_item(get_theme_icon("InterpCubic", "EditorIcons"), TTR("Cubic"), MENU_INTERPOLATION_CUBIC);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("InterpRaw"), SNAME("EditorIcons")), TTR("Nearest"), MENU_INTERPOLATION_NEAREST);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("InterpLinear"), SNAME("EditorIcons")), TTR("Linear"), MENU_INTERPOLATION_LINEAR);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("InterpCubic"), SNAME("EditorIcons")), TTR("Cubic"), MENU_INTERPOLATION_CUBIC);
|
||||
menu->set_as_minsize();
|
||||
|
||||
Vector2 popup_pos = get_screen_position() + interp_mode_rect.position + Vector2(0, interp_mode_rect.size.height);
|
||||
|
@ -2634,8 +2634,8 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
menu->connect("id_pressed", callable_mp(this, &AnimationTrackEdit::_menu_selected));
|
||||
}
|
||||
menu->clear();
|
||||
menu->add_icon_item(get_theme_icon("InterpWrapClamp", "EditorIcons"), TTR("Clamp Loop Interp"), MENU_LOOP_CLAMP);
|
||||
menu->add_icon_item(get_theme_icon("InterpWrapLoop", "EditorIcons"), TTR("Wrap Loop Interp"), MENU_LOOP_WRAP);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("InterpWrapClamp"), SNAME("EditorIcons")), TTR("Clamp Loop Interp"), MENU_LOOP_CLAMP);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("InterpWrapLoop"), SNAME("EditorIcons")), TTR("Wrap Loop Interp"), MENU_LOOP_WRAP);
|
||||
menu->set_as_minsize();
|
||||
|
||||
Vector2 popup_pos = get_screen_position() + loop_mode_rect.position + Vector2(0, loop_mode_rect.size.height);
|
||||
|
@ -2645,13 +2645,13 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
}
|
||||
|
||||
if (remove_rect.has_point(pos)) {
|
||||
emit_signal("remove_request", track);
|
||||
emit_signal(SNAME("remove_request"), track);
|
||||
accept_event();
|
||||
return;
|
||||
}
|
||||
|
||||
if (bezier_edit_rect.has_point(pos)) {
|
||||
emit_signal("bezier_edit");
|
||||
emit_signal(SNAME("bezier_edit"));
|
||||
accept_event();
|
||||
}
|
||||
|
||||
|
@ -2692,16 +2692,16 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
if (key_idx != -1) {
|
||||
if (mb->is_command_pressed() || mb->is_shift_pressed()) {
|
||||
if (editor->is_key_selected(track, key_idx)) {
|
||||
emit_signal("deselect_key", key_idx);
|
||||
emit_signal(SNAME("deselect_key"), key_idx);
|
||||
} else {
|
||||
emit_signal("select_key", key_idx, false);
|
||||
emit_signal(SNAME("select_key"), key_idx, false);
|
||||
moving_selection_attempt = true;
|
||||
select_single_attempt = -1;
|
||||
moving_selection_from_ofs = (mb->get_position().x - limit) / timeline->get_zoom_scale();
|
||||
}
|
||||
} else {
|
||||
if (!editor->is_key_selected(track, key_idx)) {
|
||||
emit_signal("select_key", key_idx, true);
|
||||
emit_signal(SNAME("select_key"), key_idx, true);
|
||||
select_single_attempt = -1;
|
||||
} else {
|
||||
select_single_attempt = key_idx;
|
||||
|
@ -2727,12 +2727,12 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
}
|
||||
|
||||
menu->clear();
|
||||
menu->add_icon_item(get_theme_icon("Key", "EditorIcons"), TTR("Insert Key"), MENU_KEY_INSERT);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("Key"), SNAME("EditorIcons")), TTR("Insert Key"), MENU_KEY_INSERT);
|
||||
if (editor->is_selection_active()) {
|
||||
menu->add_separator();
|
||||
menu->add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), TTR("Duplicate Key(s)"), MENU_KEY_DUPLICATE);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("Duplicate"), SNAME("EditorIcons")), TTR("Duplicate Key(s)"), MENU_KEY_DUPLICATE);
|
||||
menu->add_separator();
|
||||
menu->add_icon_item(get_theme_icon("Remove", "EditorIcons"), TTR("Delete Key(s)"), MENU_KEY_DELETE);
|
||||
menu->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Delete Key(s)"), MENU_KEY_DELETE);
|
||||
}
|
||||
menu->set_as_minsize();
|
||||
|
||||
|
@ -2757,7 +2757,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
}
|
||||
|
||||
path->set_text(animation->track_get_path(track));
|
||||
Vector2 theme_ofs = path->get_theme_stylebox("normal", "LineEdit")->get_offset();
|
||||
Vector2 theme_ofs = path->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"))->get_offset();
|
||||
path_popup->set_position(get_screen_position() + path_rect.position - theme_ofs);
|
||||
path_popup->set_size(path_rect.size);
|
||||
path_popup->popup();
|
||||
|
@ -2770,9 +2770,9 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
if (!mb->is_pressed() && mb->get_button_index() == MOUSE_BUTTON_LEFT) {
|
||||
moving_selection_attempt = false;
|
||||
if (moving_selection) {
|
||||
emit_signal("move_selection_commit");
|
||||
emit_signal(SNAME("move_selection_commit"));
|
||||
} else if (select_single_attempt != -1) {
|
||||
emit_signal("select_key", select_single_attempt, true);
|
||||
emit_signal(SNAME("select_key"), select_single_attempt, true);
|
||||
}
|
||||
moving_selection = false;
|
||||
select_single_attempt = -1;
|
||||
|
@ -2781,7 +2781,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
if (moving_selection && mb->is_pressed() && mb->get_button_index() == MOUSE_BUTTON_RIGHT) {
|
||||
moving_selection_attempt = false;
|
||||
moving_selection = false;
|
||||
emit_signal("move_selection_cancel");
|
||||
emit_signal(SNAME("move_selection_cancel"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2789,11 +2789,11 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
if (mm.is_valid() && mm->get_button_mask() & MOUSE_BUTTON_MASK_LEFT && moving_selection_attempt) {
|
||||
if (!moving_selection) {
|
||||
moving_selection = true;
|
||||
emit_signal("move_selection_begin");
|
||||
emit_signal(SNAME("move_selection_begin"));
|
||||
}
|
||||
|
||||
float new_ofs = (mm->get_position().x - timeline->get_name_limit()) / timeline->get_zoom_scale();
|
||||
emit_signal("move_selection", new_ofs - moving_selection_from_ofs);
|
||||
emit_signal(SNAME("move_selection"), new_ofs - moving_selection_from_ofs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2847,7 +2847,7 @@ bool AnimationTrackEdit::can_drop_data(const Point2 &p_point, const Variant &p_d
|
|||
}
|
||||
|
||||
const_cast<AnimationTrackEdit *>(this)->update();
|
||||
const_cast<AnimationTrackEdit *>(this)->emit_signal("drop_attempted", track);
|
||||
const_cast<AnimationTrackEdit *>(this)->emit_signal(SNAME("drop_attempted"), track);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2875,9 +2875,9 @@ void AnimationTrackEdit::drop_data(const Point2 &p_point, const Variant &p_data)
|
|||
int from_track = d["index"];
|
||||
|
||||
if (dropping_at < 0) {
|
||||
emit_signal("dropped", from_track, track);
|
||||
emit_signal(SNAME("dropped"), from_track, track);
|
||||
} else {
|
||||
emit_signal("dropped", from_track, track + 1);
|
||||
emit_signal(SNAME("dropped"), from_track, track + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2916,14 +2916,14 @@ void AnimationTrackEdit::_menu_selected(int p_index) {
|
|||
|
||||
} break;
|
||||
case MENU_KEY_INSERT: {
|
||||
emit_signal("insert_key", insert_at_pos);
|
||||
emit_signal(SNAME("insert_key"), insert_at_pos);
|
||||
} break;
|
||||
case MENU_KEY_DUPLICATE: {
|
||||
emit_signal("duplicate_request");
|
||||
emit_signal(SNAME("duplicate_request"));
|
||||
|
||||
} break;
|
||||
case MENU_KEY_DELETE: {
|
||||
emit_signal("delete_request");
|
||||
emit_signal(SNAME("delete_request"));
|
||||
|
||||
} break;
|
||||
}
|
||||
|
@ -2956,9 +2956,9 @@ void AnimationTrackEdit::append_to_selection(const Rect2 &p_box, bool p_deselect
|
|||
|
||||
if (select_rect.intersects(rect)) {
|
||||
if (p_deselection) {
|
||||
emit_signal("deselect_key", i);
|
||||
emit_signal(SNAME("deselect_key"), i);
|
||||
} else {
|
||||
emit_signal("select_key", i, false);
|
||||
emit_signal(SNAME("select_key"), i, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3057,19 +3057,19 @@ AnimationTrackEdit *AnimationTrackEditPlugin::create_animation_track_edit(Object
|
|||
|
||||
void AnimationTrackEditGroup::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_DRAW) {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
int separation = get_theme_constant("hseparation", "ItemList");
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int separation = get_theme_constant(SNAME("hseparation"), SNAME("ItemList"));
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
|
||||
if (root && root->has_node(node)) {
|
||||
Node *n = root->get_node(node);
|
||||
if (n && EditorNode::get_singleton()->get_editor_selection()->is_selected(n)) {
|
||||
color = get_theme_color("accent_color", "Editor");
|
||||
color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
}
|
||||
}
|
||||
|
||||
Color bgcol = get_theme_color("dark_color_2", "Editor");
|
||||
Color bgcol = get_theme_color(SNAME("dark_color_2"), SNAME("Editor"));
|
||||
bgcol.a *= 0.6;
|
||||
draw_rect(Rect2(Point2(), get_size()), bgcol);
|
||||
Color linecolor = color;
|
||||
|
@ -3087,7 +3087,7 @@ void AnimationTrackEditGroup::_notification(int p_what) {
|
|||
int px = (-timeline->get_value() + timeline->get_play_position()) * timeline->get_zoom_scale() + timeline->get_name_limit();
|
||||
|
||||
if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_line(Point2(px, 0), Point2(px, get_size().height), accent, Math::round(2 * EDSCALE));
|
||||
}
|
||||
}
|
||||
|
@ -3102,9 +3102,9 @@ void AnimationTrackEditGroup::set_type_and_name(const Ref<Texture2D> &p_type, co
|
|||
}
|
||||
|
||||
Size2 AnimationTrackEditGroup::get_minimum_size() const {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
int separation = get_theme_constant("vseparation", "ItemList");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int separation = get_theme_constant(SNAME("vseparation"), SNAME("ItemList"));
|
||||
|
||||
return Vector2(0, MAX(font->get_height(font_size), icon->get_height()) + separation);
|
||||
}
|
||||
|
@ -3226,7 +3226,7 @@ void AnimationTrackEditor::update_keying() {
|
|||
|
||||
keying = keying_enabled;
|
||||
|
||||
emit_signal("keying_changed");
|
||||
emit_signal(SNAME("keying_changed"));
|
||||
}
|
||||
|
||||
bool AnimationTrackEditor::has_keying() const {
|
||||
|
@ -3283,7 +3283,7 @@ void AnimationTrackEditor::_name_limit_changed() {
|
|||
}
|
||||
|
||||
void AnimationTrackEditor::_timeline_changed(float p_new_pos, bool p_drag, bool p_timeline_only) {
|
||||
emit_signal("timeline_changed", p_new_pos, p_drag, p_timeline_only);
|
||||
emit_signal(SNAME("timeline_changed"), p_new_pos, p_drag, p_timeline_only);
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_track_remove_request(int p_track) {
|
||||
|
@ -3430,14 +3430,14 @@ void AnimationTrackEditor::_query_insert(const InsertData &p_id) {
|
|||
insert_confirm->popup_centered();
|
||||
insert_query = true;
|
||||
} else {
|
||||
call_deferred("_insert_delay", reset_allowed && EDITOR_GET("editors/animation/default_create_reset_tracks"), all_bezier && EDITOR_GET("editors/animation/default_create_bezier_tracks"));
|
||||
call_deferred(SNAME("_insert_delay"), reset_allowed && EDITOR_GET("editors/animation/default_create_reset_tracks"), all_bezier && EDITOR_GET("editors/animation/default_create_bezier_tracks"));
|
||||
insert_queue = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!insert_query && !insert_queue) {
|
||||
// Create Beziers wouldn't make sense in this case, where no tracks are being created
|
||||
call_deferred("_insert_delay", reset_allowed && EDITOR_GET("editors/animation/default_create_reset_tracks"), false);
|
||||
call_deferred(SNAME("_insert_delay"), reset_allowed && EDITOR_GET("editors/animation/default_create_reset_tracks"), false);
|
||||
insert_queue = true;
|
||||
}
|
||||
}
|
||||
|
@ -3482,7 +3482,7 @@ void AnimationTrackEditor::_insert_delay(bool p_create_reset, bool p_create_bezi
|
|||
pos = animation->get_length();
|
||||
}
|
||||
set_anim_pos(pos);
|
||||
emit_signal("timeline_changed", pos, true);
|
||||
emit_signal(SNAME("timeline_changed"), pos, true);
|
||||
}
|
||||
insert_queue = false;
|
||||
}
|
||||
|
@ -4166,7 +4166,7 @@ void AnimationTrackEditor::_update_tracks() {
|
|||
|
||||
if (!group_sort.has(base_path)) {
|
||||
AnimationTrackEditGroup *g = memnew(AnimationTrackEditGroup);
|
||||
Ref<Texture2D> icon = get_theme_icon("Node", "EditorIcons");
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("Node"), SNAME("EditorIcons"));
|
||||
String name = base_path;
|
||||
String tooltip;
|
||||
if (root && root->has_node(base_path)) {
|
||||
|
@ -4245,7 +4245,7 @@ void AnimationTrackEditor::_animation_changed() {
|
|||
}
|
||||
|
||||
animation_changing_awaiting_update = true;
|
||||
call_deferred("_animation_update");
|
||||
call_deferred(SNAME("_animation_update"));
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_snap_mode_changed(int p_mode) {
|
||||
|
@ -4313,8 +4313,8 @@ void AnimationTrackEditor::_animation_update() {
|
|||
bezier_edit->update();
|
||||
|
||||
_update_step_spinbox();
|
||||
emit_signal("animation_step_changed", animation->get_step());
|
||||
emit_signal("animation_len_changed", animation->get_length());
|
||||
emit_signal(SNAME("animation_step_changed"), animation->get_step());
|
||||
emit_signal(SNAME("animation_len_changed"), animation->get_length());
|
||||
|
||||
animation_changing_awaiting_update = false;
|
||||
}
|
||||
|
@ -4325,13 +4325,13 @@ MenuButton *AnimationTrackEditor::get_edit_menu() {
|
|||
|
||||
void AnimationTrackEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) {
|
||||
zoom_icon->set_texture(get_theme_icon("Zoom", "EditorIcons"));
|
||||
snap->set_icon(get_theme_icon("Snap", "EditorIcons"));
|
||||
zoom_icon->set_texture(get_theme_icon(SNAME("Zoom"), SNAME("EditorIcons")));
|
||||
snap->set_icon(get_theme_icon(SNAME("Snap"), SNAME("EditorIcons")));
|
||||
view_group->set_icon(get_theme_icon(view_group->is_pressed() ? "AnimationTrackList" : "AnimationTrackGroup", "EditorIcons"));
|
||||
selected_filter->set_icon(get_theme_icon("AnimationFilter", "EditorIcons"));
|
||||
imported_anim_warning->set_icon(get_theme_icon("NodeWarning", "EditorIcons"));
|
||||
main_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree"));
|
||||
edit->get_popup()->set_item_icon(edit->get_popup()->get_item_index(EDIT_APPLY_RESET), get_theme_icon("Reload", "EditorIcons"));
|
||||
selected_filter->set_icon(get_theme_icon(SNAME("AnimationFilter"), SNAME("EditorIcons")));
|
||||
imported_anim_warning->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons")));
|
||||
main_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
edit->get_popup()->set_item_icon(edit->get_popup()->get_item_index(EDIT_APPLY_RESET), get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_READY) {
|
||||
|
@ -4341,7 +4341,7 @@ void AnimationTrackEditor::_notification(int p_what) {
|
|||
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
update_keying();
|
||||
EditorNode::get_singleton()->update_keying();
|
||||
emit_signal("keying_changed");
|
||||
emit_signal(SNAME("keying_changed"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4367,11 +4367,11 @@ void AnimationTrackEditor::_update_step(double p_new_step) {
|
|||
step->set_block_signals(true);
|
||||
undo_redo->commit_action();
|
||||
step->set_block_signals(false);
|
||||
emit_signal("animation_step_changed", step_value);
|
||||
emit_signal(SNAME("animation_step_changed"), step_value);
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_update_length(double p_new_len) {
|
||||
emit_signal("animation_len_changed", p_new_len);
|
||||
emit_signal(SNAME("animation_len_changed"), p_new_len);
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_dropped_track(int p_from_track, int p_to_track) {
|
||||
|
@ -4980,8 +4980,8 @@ float AnimationTrackEditor::get_moving_selection_offset() const {
|
|||
|
||||
void AnimationTrackEditor::_box_selection_draw() {
|
||||
const Rect2 selection_rect = Rect2(Point2(), box_selection->get_size());
|
||||
box_selection->draw_rect(selection_rect, get_theme_color("box_selection_fill_color", "Editor"));
|
||||
box_selection->draw_rect(selection_rect, get_theme_color("box_selection_stroke_color", "Editor"), false, Math::round(EDSCALE));
|
||||
box_selection->draw_rect(selection_rect, get_theme_color(SNAME("box_selection_fill_color"), SNAME("Editor")));
|
||||
box_selection->draw_rect(selection_rect, get_theme_color(SNAME("box_selection_stroke_color"), SNAME("Editor")), false, Math::round(EDSCALE));
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_scroll_input(const Ref<InputEvent> &p_event) {
|
||||
|
@ -5201,7 +5201,7 @@ void AnimationTrackEditor::goto_prev_step(bool p_from_mouse_event) {
|
|||
pos = 0;
|
||||
}
|
||||
set_anim_pos(pos);
|
||||
emit_signal("timeline_changed", pos, true);
|
||||
emit_signal(SNAME("timeline_changed"), pos, true);
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::goto_next_step(bool p_from_mouse_event) {
|
||||
|
@ -5228,7 +5228,7 @@ void AnimationTrackEditor::goto_next_step(bool p_from_mouse_event) {
|
|||
}
|
||||
set_anim_pos(pos);
|
||||
|
||||
emit_signal("timeline_changed", pos, true);
|
||||
emit_signal(SNAME("timeline_changed"), pos, true);
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
|
||||
|
@ -5247,7 +5247,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
|
|||
}
|
||||
|
||||
String text;
|
||||
Ref<Texture2D> icon = get_theme_icon("Node", "EditorIcons");
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("Node"), SNAME("EditorIcons"));
|
||||
if (node) {
|
||||
if (has_theme_icon(node->get_class(), "EditorIcons")) {
|
||||
icon = get_theme_icon(node->get_class(), "EditorIcons");
|
||||
|
|
|
@ -42,12 +42,12 @@
|
|||
|
||||
/// BOOL ///
|
||||
int AnimationTrackEditBool::get_key_height() const {
|
||||
Ref<Texture2D> checked = get_theme_icon("checked", "CheckBox");
|
||||
Ref<Texture2D> checked = get_theme_icon(SNAME("checked"), SNAME("CheckBox"));
|
||||
return checked->get_height();
|
||||
}
|
||||
|
||||
Rect2 AnimationTrackEditBool::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
Ref<Texture2D> checked = get_theme_icon("checked", "CheckBox");
|
||||
Ref<Texture2D> checked = get_theme_icon(SNAME("checked"), SNAME("CheckBox"));
|
||||
return Rect2(-checked->get_width() / 2, 0, checked->get_width(), get_size().height);
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ void AnimationTrackEditBool::draw_key(int p_index, float p_pixels_sec, int p_x,
|
|||
draw_texture(icon, ofs);
|
||||
|
||||
if (p_selected) {
|
||||
Color color = get_theme_color("accent_color", "Editor");
|
||||
Color color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_rect_clipped(Rect2(ofs, icon->get_size()), color, false);
|
||||
}
|
||||
}
|
||||
|
@ -80,14 +80,14 @@ void AnimationTrackEditBool::draw_key(int p_index, float p_pixels_sec, int p_x,
|
|||
/// COLOR ///
|
||||
|
||||
int AnimationTrackEditColor::get_key_height() const {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
return font->get_height(font_size) * 0.8;
|
||||
}
|
||||
|
||||
Rect2 AnimationTrackEditColor::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int fh = font->get_height(font_size) * 0.8;
|
||||
return Rect2(-fh / 2, 0, fh, get_size().height);
|
||||
}
|
||||
|
@ -97,8 +97,8 @@ bool AnimationTrackEditColor::is_key_selectable_by_distance() const {
|
|||
}
|
||||
|
||||
void AnimationTrackEditColor::draw_key_link(int p_index, float p_pixels_sec, int p_x, int p_next_x, int p_clip_left, int p_clip_right) {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int fh = (font->get_height(font_size) * 0.8);
|
||||
|
||||
fh /= 3;
|
||||
|
@ -167,8 +167,8 @@ void AnimationTrackEditColor::draw_key_link(int p_index, float p_pixels_sec, int
|
|||
void AnimationTrackEditColor::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) {
|
||||
Color color = get_animation()->track_get_key_value(get_track(), p_index);
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int fh = font->get_height(font_size) * 0.8;
|
||||
|
||||
Rect2 rect(Vector2(p_x - fh / 2, int(get_size().height - fh) / 2), Size2(fh, fh));
|
||||
|
@ -180,7 +180,7 @@ void AnimationTrackEditColor::draw_key(int p_index, float p_pixels_sec, int p_x,
|
|||
draw_rect_clipped(rect, color);
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_rect_clipped(rect, accent, false);
|
||||
}
|
||||
}
|
||||
|
@ -206,8 +206,8 @@ int AnimationTrackEditAudio::get_key_height() const {
|
|||
return AnimationTrackEdit::get_key_height();
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
return int(font->get_height(font_size) * 1.5);
|
||||
}
|
||||
|
||||
|
@ -239,8 +239,8 @@ Rect2 AnimationTrackEditAudio::get_key_rect(int p_index, float p_pixels_sec) {
|
|||
|
||||
return Rect2(0, 0, len * p_pixels_sec, get_size().height);
|
||||
} else {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int fh = font->get_height(font_size) * 0.8;
|
||||
return Rect2(0, 0, fh, get_size().height);
|
||||
}
|
||||
|
@ -303,8 +303,8 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x,
|
|||
return;
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
float fh = int(font->get_height(font_size) * 1.5);
|
||||
Rect2 rect = Rect2(from_x, (get_size().height - fh) / 2, to_x - from_x, fh);
|
||||
draw_rect(rect, Color(0.25, 0.25, 0.25));
|
||||
|
@ -330,20 +330,20 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x,
|
|||
RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color);
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_rect(rect, accent, false);
|
||||
}
|
||||
} else {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int fh = font->get_height(font_size) * 0.8;
|
||||
Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh));
|
||||
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
draw_rect(rect, color);
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_rect(rect, accent, false);
|
||||
}
|
||||
}
|
||||
|
@ -367,8 +367,8 @@ int AnimationTrackEditSpriteFrame::get_key_height() const {
|
|||
return AnimationTrackEdit::get_key_height();
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
return int(font->get_height(font_size) * 2);
|
||||
}
|
||||
|
||||
|
@ -435,8 +435,8 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se
|
|||
|
||||
size = size.floor();
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int height = int(font->get_height(font_size) * 2);
|
||||
int width = height * size.width / size.height;
|
||||
|
||||
|
@ -526,8 +526,8 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
|
|||
region.size = texture->get_size();
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int height = int(font->get_height(font_size) * 2);
|
||||
|
||||
int width = height * region.size.width / region.size.height;
|
||||
|
@ -542,7 +542,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
|
|||
return;
|
||||
}
|
||||
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color bg = accent;
|
||||
bg.a = 0.15;
|
||||
|
||||
|
@ -570,8 +570,8 @@ int AnimationTrackEditSubAnim::get_key_height() const {
|
|||
return AnimationTrackEdit::get_key_height();
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
return int(font->get_height(font_size) * 1.5);
|
||||
}
|
||||
|
||||
|
@ -599,8 +599,8 @@ Rect2 AnimationTrackEditSubAnim::get_key_rect(int p_index, float p_pixels_sec) {
|
|||
|
||||
return Rect2(0, 0, len * p_pixels_sec, get_size().height);
|
||||
} else {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int fh = font->get_height(font_size) * 0.8;
|
||||
return Rect2(0, 0, fh, get_size().height);
|
||||
}
|
||||
|
@ -654,13 +654,13 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_
|
|||
return;
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int fh = font->get_height(font_size) * 1.5;
|
||||
|
||||
Rect2 rect(from_x, int(get_size().height - fh) / 2, to_x - from_x, fh);
|
||||
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
Color bg = color;
|
||||
bg.r = 1 - color.r;
|
||||
bg.g = 1 - color.g;
|
||||
|
@ -703,20 +703,20 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_
|
|||
}
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_rect(rect, accent, false);
|
||||
}
|
||||
} else {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int fh = font->get_height(font_size) * 0.8;
|
||||
Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh));
|
||||
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
draw_rect(rect, color);
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_rect(rect, accent, false);
|
||||
}
|
||||
}
|
||||
|
@ -729,12 +729,12 @@ void AnimationTrackEditSubAnim::set_node(Object *p_object) {
|
|||
//// VOLUME DB ////
|
||||
|
||||
int AnimationTrackEditVolumeDB::get_key_height() const {
|
||||
Ref<Texture2D> volume_texture = get_theme_icon("ColorTrackVu", "EditorIcons");
|
||||
Ref<Texture2D> volume_texture = get_theme_icon(SNAME("ColorTrackVu"), SNAME("EditorIcons"));
|
||||
return volume_texture->get_height() * 1.2;
|
||||
}
|
||||
|
||||
void AnimationTrackEditVolumeDB::draw_bg(int p_clip_left, int p_clip_right) {
|
||||
Ref<Texture2D> volume_texture = get_theme_icon("ColorTrackVu", "EditorIcons");
|
||||
Ref<Texture2D> volume_texture = get_theme_icon(SNAME("ColorTrackVu"), SNAME("EditorIcons"));
|
||||
int tex_h = volume_texture->get_height();
|
||||
|
||||
int y_from = (get_size().height - tex_h) / 2;
|
||||
|
@ -745,7 +745,7 @@ void AnimationTrackEditVolumeDB::draw_bg(int p_clip_left, int p_clip_right) {
|
|||
}
|
||||
|
||||
void AnimationTrackEditVolumeDB::draw_fg(int p_clip_left, int p_clip_right) {
|
||||
Ref<Texture2D> volume_texture = get_theme_icon("ColorTrackVu", "EditorIcons");
|
||||
Ref<Texture2D> volume_texture = get_theme_icon(SNAME("ColorTrackVu"), SNAME("EditorIcons"));
|
||||
int tex_h = volume_texture->get_height();
|
||||
int y_from = (get_size().height - tex_h) / 2;
|
||||
int db0 = y_from + (24 / 80.0) * tex_h;
|
||||
|
@ -780,12 +780,12 @@ void AnimationTrackEditVolumeDB::draw_key_link(int p_index, float p_pixels_sec,
|
|||
to_x = p_clip_right;
|
||||
}
|
||||
|
||||
Ref<Texture2D> volume_texture = get_theme_icon("ColorTrackVu", "EditorIcons");
|
||||
Ref<Texture2D> volume_texture = get_theme_icon(SNAME("ColorTrackVu"), SNAME("EditorIcons"));
|
||||
int tex_h = volume_texture->get_height();
|
||||
|
||||
int y_from = (get_size().height - tex_h) / 2;
|
||||
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
color.a *= 0.7;
|
||||
|
||||
draw_line(Point2(from_x, y_from + h * tex_h), Point2(to_x, y_from + h_n * tex_h), color, 2);
|
||||
|
@ -806,8 +806,8 @@ void AnimationTrackEditTypeAudio::_preview_changed(ObjectID p_which) {
|
|||
}
|
||||
|
||||
int AnimationTrackEditTypeAudio::get_key_height() const {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
return int(font->get_height(font_size) * 1.5);
|
||||
}
|
||||
|
||||
|
@ -871,8 +871,8 @@ void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int
|
|||
}
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
float fh = int(font->get_height(font_size) * 1.5);
|
||||
|
||||
float len = stream->get_length();
|
||||
|
@ -947,7 +947,7 @@ void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int
|
|||
|
||||
RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color);
|
||||
|
||||
Color cut_color = get_theme_color("accent_color", "Editor");
|
||||
Color cut_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
cut_color.a = 0.7;
|
||||
if (start_ofs > 0 && pixel_begin > p_clip_left) {
|
||||
draw_rect(Rect2(pixel_begin, rect.position.y, 1, rect.size.y), cut_color);
|
||||
|
@ -957,7 +957,7 @@ void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int
|
|||
}
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_rect(rect, accent, false);
|
||||
}
|
||||
}
|
||||
|
@ -1143,8 +1143,8 @@ int AnimationTrackEditTypeAnimation::get_key_height() const {
|
|||
return AnimationTrackEdit::get_key_height();
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
return int(font->get_height(font_size) * 1.5);
|
||||
}
|
||||
|
||||
|
@ -1172,8 +1172,8 @@ Rect2 AnimationTrackEditTypeAnimation::get_key_rect(int p_index, float p_pixels_
|
|||
|
||||
return Rect2(0, 0, len * p_pixels_sec, get_size().height);
|
||||
} else {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int fh = font->get_height(font_size) * 0.8;
|
||||
return Rect2(0, 0, fh, get_size().height);
|
||||
}
|
||||
|
@ -1227,13 +1227,13 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec,
|
|||
return;
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int fh = font->get_height(font_size) * 1.5;
|
||||
|
||||
Rect2 rect(from_x, int(get_size().height - fh) / 2, to_x - from_x, fh);
|
||||
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
Color bg = color;
|
||||
bg.r = 1 - color.r;
|
||||
bg.g = 1 - color.g;
|
||||
|
@ -1276,20 +1276,20 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec,
|
|||
}
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_rect(rect, accent, false);
|
||||
}
|
||||
} else {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
int fh = font->get_height(font_size) * 0.8;
|
||||
Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh));
|
||||
|
||||
Color color = get_theme_color("font_color", "Label");
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
draw_rect(rect, color);
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_rect(rect, accent, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ AudioStreamPreview::AudioStreamPreview() {
|
|||
////
|
||||
|
||||
void AudioStreamPreviewGenerator::_update_emit(ObjectID p_id) {
|
||||
emit_signal("preview_updated", p_id);
|
||||
emit_signal(SNAME("preview_updated"), p_id);
|
||||
}
|
||||
|
||||
void AudioStreamPreviewGenerator::_preview_thread(void *p_preview) {
|
||||
|
@ -150,7 +150,7 @@ void AudioStreamPreviewGenerator::_preview_thread(void *p_preview) {
|
|||
}
|
||||
|
||||
frames_todo -= to_read;
|
||||
singleton->call_deferred("_update_emit", preview->id);
|
||||
singleton->call_deferred(SNAME("_update_emit"), preview->id);
|
||||
}
|
||||
|
||||
preview->playback->stop();
|
||||
|
|
|
@ -88,23 +88,23 @@ GotoLineDialog::GotoLineDialog() {
|
|||
|
||||
void FindReplaceBar::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_READY) {
|
||||
find_prev->set_icon(get_theme_icon("MoveUp", "EditorIcons"));
|
||||
find_next->set_icon(get_theme_icon("MoveDown", "EditorIcons"));
|
||||
hide_button->set_normal_texture(get_theme_icon("Close", "EditorIcons"));
|
||||
hide_button->set_hover_texture(get_theme_icon("Close", "EditorIcons"));
|
||||
hide_button->set_pressed_texture(get_theme_icon("Close", "EditorIcons"));
|
||||
find_prev->set_icon(get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons")));
|
||||
find_next->set_icon(get_theme_icon(SNAME("MoveDown"), SNAME("EditorIcons")));
|
||||
hide_button->set_normal_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
hide_button->set_hover_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
hide_button->set_pressed_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size());
|
||||
} else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
set_process_unhandled_input(is_visible_in_tree());
|
||||
} else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||
find_prev->set_icon(get_theme_icon("MoveUp", "EditorIcons"));
|
||||
find_next->set_icon(get_theme_icon("MoveDown", "EditorIcons"));
|
||||
hide_button->set_normal_texture(get_theme_icon("Close", "EditorIcons"));
|
||||
hide_button->set_hover_texture(get_theme_icon("Close", "EditorIcons"));
|
||||
hide_button->set_pressed_texture(get_theme_icon("Close", "EditorIcons"));
|
||||
find_prev->set_icon(get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons")));
|
||||
find_next->set_icon(get_theme_icon(SNAME("MoveDown"), SNAME("EditorIcons")));
|
||||
hide_button->set_normal_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
hide_button->set_hover_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
hide_button->set_pressed_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size());
|
||||
} else if (p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor"));
|
||||
matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
} else if (p_what == NOTIFICATION_PREDELETE) {
|
||||
if (base_text_editor) {
|
||||
base_text_editor->remove_find_replace_bar();
|
||||
|
@ -304,10 +304,10 @@ void FindReplaceBar::_replace_all() {
|
|||
}
|
||||
|
||||
text_editor->set_v_scroll(vsval);
|
||||
matches_label->add_theme_color_override("font_color", rc > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor"));
|
||||
matches_label->add_theme_color_override("font_color", rc > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
matches_label->set_text(vformat(TTR("%d replaced."), rc));
|
||||
|
||||
text_editor->call_deferred("connect", "text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed));
|
||||
text_editor->call_deferred(SNAME("connect"), "text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed));
|
||||
results_count = -1;
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ void FindReplaceBar::_update_matches_label() {
|
|||
} else {
|
||||
matches_label->show();
|
||||
|
||||
matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor"));
|
||||
matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count));
|
||||
}
|
||||
}
|
||||
|
@ -480,10 +480,10 @@ void FindReplaceBar::_show_search(bool p_focus_replace, bool p_show_only) {
|
|||
|
||||
if (p_focus_replace) {
|
||||
search_text->deselect();
|
||||
replace_text->call_deferred("grab_focus");
|
||||
replace_text->call_deferred(SNAME("grab_focus"));
|
||||
} else {
|
||||
replace_text->deselect();
|
||||
search_text->call_deferred("grab_focus");
|
||||
search_text->call_deferred(SNAME("grab_focus"));
|
||||
}
|
||||
|
||||
if (text_editor->is_selection_active() && !selection_only->is_pressed()) {
|
||||
|
@ -585,7 +585,7 @@ bool FindReplaceBar::is_selection_only() const {
|
|||
}
|
||||
|
||||
void FindReplaceBar::set_error(const String &p_label) {
|
||||
emit_signal("error", p_label);
|
||||
emit_signal(SNAME("error"), p_label);
|
||||
}
|
||||
|
||||
void FindReplaceBar::set_text_edit(CodeTextEditor *p_text_editor) {
|
||||
|
@ -760,10 +760,10 @@ void CodeTextEditor::_text_editor_gui_input(const Ref<InputEvent> &p_event) {
|
|||
|
||||
Ref<InputEventMagnifyGesture> magnify_gesture = p_event;
|
||||
if (magnify_gesture.is_valid()) {
|
||||
font_size = text_editor->get_theme_font_size("font_size");
|
||||
font_size = text_editor->get_theme_font_size(SNAME("font_size"));
|
||||
font_size *= powf(magnify_gesture->get_factor(), 0.25);
|
||||
|
||||
_add_font_size((int)font_size - text_editor->get_theme_font_size("font_size"));
|
||||
_add_font_size((int)font_size - text_editor->get_theme_font_size(SNAME("font_size")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -875,38 +875,38 @@ Ref<Texture2D> CodeTextEditor::_get_completion_icon(const ScriptCodeCompletionOp
|
|||
if (has_theme_icon(p_option.display, "EditorIcons")) {
|
||||
tex = get_theme_icon(p_option.display, "EditorIcons");
|
||||
} else {
|
||||
tex = get_theme_icon("Object", "EditorIcons");
|
||||
tex = get_theme_icon(SNAME("Object"), SNAME("EditorIcons"));
|
||||
}
|
||||
} break;
|
||||
case ScriptCodeCompletionOption::KIND_ENUM:
|
||||
tex = get_theme_icon("Enum", "EditorIcons");
|
||||
tex = get_theme_icon(SNAME("Enum"), SNAME("EditorIcons"));
|
||||
break;
|
||||
case ScriptCodeCompletionOption::KIND_FILE_PATH:
|
||||
tex = get_theme_icon("File", "EditorIcons");
|
||||
tex = get_theme_icon(SNAME("File"), SNAME("EditorIcons"));
|
||||
break;
|
||||
case ScriptCodeCompletionOption::KIND_NODE_PATH:
|
||||
tex = get_theme_icon("NodePath", "EditorIcons");
|
||||
tex = get_theme_icon(SNAME("NodePath"), SNAME("EditorIcons"));
|
||||
break;
|
||||
case ScriptCodeCompletionOption::KIND_VARIABLE:
|
||||
tex = get_theme_icon("Variant", "EditorIcons");
|
||||
tex = get_theme_icon(SNAME("Variant"), SNAME("EditorIcons"));
|
||||
break;
|
||||
case ScriptCodeCompletionOption::KIND_CONSTANT:
|
||||
tex = get_theme_icon("MemberConstant", "EditorIcons");
|
||||
tex = get_theme_icon(SNAME("MemberConstant"), SNAME("EditorIcons"));
|
||||
break;
|
||||
case ScriptCodeCompletionOption::KIND_MEMBER:
|
||||
tex = get_theme_icon("MemberProperty", "EditorIcons");
|
||||
tex = get_theme_icon(SNAME("MemberProperty"), SNAME("EditorIcons"));
|
||||
break;
|
||||
case ScriptCodeCompletionOption::KIND_SIGNAL:
|
||||
tex = get_theme_icon("MemberSignal", "EditorIcons");
|
||||
tex = get_theme_icon(SNAME("MemberSignal"), SNAME("EditorIcons"));
|
||||
break;
|
||||
case ScriptCodeCompletionOption::KIND_FUNCTION:
|
||||
tex = get_theme_icon("MemberMethod", "EditorIcons");
|
||||
tex = get_theme_icon(SNAME("MemberMethod"), SNAME("EditorIcons"));
|
||||
break;
|
||||
case ScriptCodeCompletionOption::KIND_PLAIN_TEXT:
|
||||
tex = get_theme_icon("BoxMesh", "EditorIcons");
|
||||
tex = get_theme_icon(SNAME("BoxMesh"), SNAME("EditorIcons"));
|
||||
break;
|
||||
default:
|
||||
tex = get_theme_icon("String", "EditorIcons");
|
||||
tex = get_theme_icon(SNAME("String"), SNAME("EditorIcons"));
|
||||
break;
|
||||
}
|
||||
return tex;
|
||||
|
@ -919,7 +919,7 @@ void CodeTextEditor::_font_resize_timeout() {
|
|||
}
|
||||
|
||||
bool CodeTextEditor::_add_font_size(int p_delta) {
|
||||
int old_size = text_editor->get_theme_font_size("font_size");
|
||||
int old_size = text_editor->get_theme_font_size(SNAME("font_size"));
|
||||
int new_size = CLAMP(old_size + p_delta, 8 * EDSCALE, 96 * EDSCALE);
|
||||
|
||||
if (new_size != old_size) {
|
||||
|
@ -1411,19 +1411,19 @@ void CodeTextEditor::toggle_inline_comment(const String &delimiter) {
|
|||
void CodeTextEditor::goto_line(int p_line) {
|
||||
text_editor->deselect();
|
||||
text_editor->unfold_line(p_line);
|
||||
text_editor->call_deferred("cursor_set_line", p_line);
|
||||
text_editor->call_deferred(SNAME("cursor_set_line"), p_line);
|
||||
}
|
||||
|
||||
void CodeTextEditor::goto_line_selection(int p_line, int p_begin, int p_end) {
|
||||
text_editor->unfold_line(p_line);
|
||||
text_editor->call_deferred("cursor_set_line", p_line);
|
||||
text_editor->call_deferred("cursor_set_column", p_begin);
|
||||
text_editor->call_deferred(SNAME("cursor_set_line"), p_line);
|
||||
text_editor->call_deferred(SNAME("cursor_set_column"), p_begin);
|
||||
text_editor->select(p_line, p_begin, p_line, p_end);
|
||||
}
|
||||
|
||||
void CodeTextEditor::goto_line_centered(int p_line) {
|
||||
goto_line(p_line);
|
||||
text_editor->call_deferred("center_viewport_to_cursor");
|
||||
text_editor->call_deferred(SNAME("center_viewport_to_cursor"));
|
||||
}
|
||||
|
||||
void CodeTextEditor::set_executing_line(int p_line) {
|
||||
|
@ -1542,20 +1542,20 @@ void CodeTextEditor::_update_text_editor_theme() {
|
|||
text_editor->add_theme_color_override("search_result_color", EDITOR_GET("text_editor/highlighting/search_result_color"));
|
||||
text_editor->add_theme_color_override("search_result_border_color", EDITOR_GET("text_editor/highlighting/search_result_border_color"));
|
||||
text_editor->add_theme_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 6));
|
||||
emit_signal("load_theme_settings");
|
||||
emit_signal(SNAME("load_theme_settings"));
|
||||
_load_theme_settings();
|
||||
}
|
||||
|
||||
void CodeTextEditor::_update_font() {
|
||||
text_editor->add_theme_font_override("font", get_theme_font("source", "EditorFonts"));
|
||||
text_editor->add_theme_font_size_override("font_size", get_theme_font_size("source_size", "EditorFonts"));
|
||||
text_editor->add_theme_font_override("font", get_theme_font(SNAME("source"), SNAME("EditorFonts")));
|
||||
text_editor->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts")));
|
||||
|
||||
error->add_theme_font_override("font", get_theme_font("status_source", "EditorFonts"));
|
||||
error->add_theme_font_size_override("font_size", get_theme_font_size("status_source_size", "EditorFonts"));
|
||||
error->add_theme_color_override("font_color", get_theme_color("error_color", "Editor"));
|
||||
error->add_theme_font_override("font", get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
|
||||
error->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
|
||||
error->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
|
||||
Ref<Font> status_bar_font = get_theme_font("status_source", "EditorFonts");
|
||||
int status_bar_font_size = get_theme_font_size("status_source_size", "EditorFonts");
|
||||
Ref<Font> status_bar_font = get_theme_font(SNAME("status_source"), SNAME("EditorFonts"));
|
||||
int status_bar_font_size = get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"));
|
||||
error->add_theme_font_override("font", status_bar_font);
|
||||
error->add_theme_font_size_override("font_size", status_bar_font_size);
|
||||
int count = status_bar->get_child_count();
|
||||
|
@ -1614,7 +1614,7 @@ void CodeTextEditor::_on_settings_change() {
|
|||
|
||||
void CodeTextEditor::_text_changed_idle_timeout() {
|
||||
_validate_script();
|
||||
emit_signal("validate_script");
|
||||
emit_signal(SNAME("validate_script"));
|
||||
}
|
||||
|
||||
void CodeTextEditor::validate_script() {
|
||||
|
@ -1633,19 +1633,19 @@ void CodeTextEditor::_warning_button_pressed() {
|
|||
|
||||
void CodeTextEditor::_set_show_errors_panel(bool p_show) {
|
||||
is_errors_panel_opened = p_show;
|
||||
emit_signal("show_errors_panel", p_show);
|
||||
emit_signal(SNAME("show_errors_panel"), p_show);
|
||||
}
|
||||
|
||||
void CodeTextEditor::_set_show_warnings_panel(bool p_show) {
|
||||
is_warnings_panel_opened = p_show;
|
||||
emit_signal("show_warnings_panel", p_show);
|
||||
emit_signal(SNAME("show_warnings_panel"), p_show);
|
||||
}
|
||||
|
||||
void CodeTextEditor::_toggle_scripts_pressed() {
|
||||
if (is_layout_rtl()) {
|
||||
toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->toggle_scripts_panel() ? get_theme_icon("Forward", "EditorIcons") : get_theme_icon("Back", "EditorIcons"));
|
||||
toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->toggle_scripts_panel() ? get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")) : get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->toggle_scripts_panel() ? get_theme_icon("Back", "EditorIcons") : get_theme_icon("Forward", "EditorIcons"));
|
||||
toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->toggle_scripts_panel() ? get_theme_icon(SNAME("Back"), SNAME("EditorIcons")) : get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1666,8 +1666,8 @@ void CodeTextEditor::_notification(int p_what) {
|
|||
_update_font();
|
||||
} break;
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
error_button->set_icon(get_theme_icon("StatusError", "EditorIcons"));
|
||||
warning_button->set_icon(get_theme_icon("NodeWarning", "EditorIcons"));
|
||||
error_button->set_icon(get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons")));
|
||||
warning_button->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons")));
|
||||
add_theme_constant_override("separation", 4 * EDSCALE);
|
||||
} break;
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
|
@ -1779,9 +1779,9 @@ void CodeTextEditor::show_toggle_scripts_button() {
|
|||
|
||||
void CodeTextEditor::update_toggle_scripts_button() {
|
||||
if (is_layout_rtl()) {
|
||||
toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->is_scripts_panel_toggled() ? get_theme_icon("Forward", "EditorIcons") : get_theme_icon("Back", "EditorIcons"));
|
||||
toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->is_scripts_panel_toggled() ? get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")) : get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->is_scripts_panel_toggled() ? get_theme_icon("Back", "EditorIcons") : get_theme_icon("Forward", "EditorIcons"));
|
||||
toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->is_scripts_panel_toggled() ? get_theme_icon(SNAME("Back"), SNAME("EditorIcons")) : get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
}
|
||||
toggle_scripts_button->set_tooltip(TTR("Toggle Scripts Panel") + " (" + ED_GET_SHORTCUT("script_editor/toggle_scripts_panel")->get_as_text() + ")");
|
||||
}
|
||||
|
@ -1871,9 +1871,9 @@ CodeTextEditor::CodeTextEditor() {
|
|||
error_button->connect("pressed", callable_mp(this, &CodeTextEditor::_error_button_pressed));
|
||||
error_button->set_tooltip(TTR("Errors"));
|
||||
|
||||
error_button->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("error_color", "Editor"));
|
||||
error_button->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("status_source", "EditorFonts"));
|
||||
error_button->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size("status_source_size", "EditorFonts"));
|
||||
error_button->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
error_button->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
|
||||
error_button->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
|
||||
|
||||
is_errors_panel_opened = false;
|
||||
set_error_count(0);
|
||||
|
@ -1887,9 +1887,9 @@ CodeTextEditor::CodeTextEditor() {
|
|||
warning_button->connect("pressed", callable_mp(this, &CodeTextEditor::_warning_button_pressed));
|
||||
warning_button->set_tooltip(TTR("Warnings"));
|
||||
|
||||
warning_button->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("warning_color", "Editor"));
|
||||
warning_button->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("status_source", "EditorFonts"));
|
||||
warning_button->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size("status_source_size", "EditorFonts"));
|
||||
warning_button->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
warning_button->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
|
||||
warning_button->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
|
||||
|
||||
is_warnings_panel_opened = false;
|
||||
set_warning_count(0);
|
||||
|
@ -1898,8 +1898,8 @@ CodeTextEditor::CodeTextEditor() {
|
|||
line_and_col_txt = memnew(Label);
|
||||
status_bar->add_child(line_and_col_txt);
|
||||
line_and_col_txt->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER);
|
||||
line_and_col_txt->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("status_source", "EditorFonts"));
|
||||
line_and_col_txt->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size("status_source_size", "EditorFonts"));
|
||||
line_and_col_txt->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
|
||||
line_and_col_txt->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
|
||||
line_and_col_txt->set_tooltip(TTR("Line and column numbers."));
|
||||
line_and_col_txt->set_mouse_filter(MOUSE_FILTER_STOP);
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ void ConnectDialog::ok_pressed() {
|
|||
return;
|
||||
}
|
||||
}
|
||||
emit_signal("connected");
|
||||
emit_signal(SNAME("connected"));
|
||||
hide();
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ void ConnectDialog::init(ConnectionData c, bool bEdit) {
|
|||
|
||||
void ConnectDialog::popup_dialog(const String &p_for_signal) {
|
||||
from_signal->set_text(p_for_signal);
|
||||
error_label->add_theme_color_override("font_color", error_label->get_theme_color("error_color", "Editor"));
|
||||
error_label->add_theme_color_override("font_color", error_label->get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
if (!advanced->is_pressed()) {
|
||||
error_label->set_visible(!_find_first_script(get_tree()->get_edited_scene_root(), get_tree()->get_edited_scene_root()));
|
||||
}
|
||||
|
@ -509,13 +509,13 @@ ConnectDialog::~ConnectDialog() {
|
|||
// Originally copied and adapted from EditorProperty, try to keep style in sync.
|
||||
Control *ConnectionsDockTree::make_custom_tooltip(const String &p_text) const {
|
||||
EditorHelpBit *help_bit = memnew(EditorHelpBit);
|
||||
help_bit->add_theme_style_override("panel", get_theme_stylebox("panel", "TooltipPanel"));
|
||||
help_bit->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TooltipPanel")));
|
||||
help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE);
|
||||
|
||||
String text = TTR("Signal:") + " [u][b]" + p_text.get_slice("::", 0) + "[/b][/u]";
|
||||
text += p_text.get_slice("::", 1).strip_edges() + "\n";
|
||||
text += p_text.get_slice("::", 2).strip_edges();
|
||||
help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene
|
||||
help_bit->call_deferred(SNAME("set_text"), text); //hack so it uses proper theme once inside scene
|
||||
return help_bit;
|
||||
}
|
||||
|
||||
|
@ -591,7 +591,7 @@ void ConnectionsDock::_make_or_edit_connection() {
|
|||
it = nullptr;
|
||||
|
||||
if (add_script_function) {
|
||||
editor->emit_signal("script_add_function_request", target, cToMake.method, script_function_args);
|
||||
editor->emit_signal(SNAME("script_add_function_request"), target, cToMake.method, script_function_args);
|
||||
hide();
|
||||
}
|
||||
|
||||
|
@ -921,14 +921,14 @@ void ConnectionsDock::update_tree() {
|
|||
}
|
||||
} else {
|
||||
ClassDB::get_signal_list(base, &node_signals2, true);
|
||||
if (has_theme_icon(base, "EditorIcons")) {
|
||||
icon = get_theme_icon(base, "EditorIcons");
|
||||
if (has_theme_icon(base, SNAME("EditorIcons"))) {
|
||||
icon = get_theme_icon(base, SNAME("EditorIcons"));
|
||||
}
|
||||
name = base;
|
||||
}
|
||||
|
||||
if (!icon.is_valid()) {
|
||||
icon = get_theme_icon("Object", "EditorIcons");
|
||||
icon = get_theme_icon(SNAME("Object"), SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
TreeItem *section_item = nullptr;
|
||||
|
@ -940,7 +940,7 @@ void ConnectionsDock::update_tree() {
|
|||
section_item->set_icon(0, icon);
|
||||
section_item->set_selectable(0, false);
|
||||
section_item->set_editable(0, false);
|
||||
section_item->set_custom_bg_color(0, get_theme_color("prop_subsection", "Editor"));
|
||||
section_item->set_custom_bg_color(0, get_theme_color(SNAME("prop_subsection"), SNAME("Editor")));
|
||||
node_signals2.sort();
|
||||
}
|
||||
|
||||
|
@ -982,7 +982,7 @@ void ConnectionsDock::update_tree() {
|
|||
sinfo["name"] = signal_name;
|
||||
sinfo["args"] = argnames;
|
||||
signal_item->set_metadata(0, sinfo);
|
||||
signal_item->set_icon(0, get_theme_icon("Signal", "EditorIcons"));
|
||||
signal_item->set_icon(0, get_theme_icon(SNAME("Signal"), SNAME("EditorIcons")));
|
||||
|
||||
// Set tooltip with the signal's documentation.
|
||||
{
|
||||
|
@ -1059,7 +1059,7 @@ void ConnectionsDock::update_tree() {
|
|||
connection_item->set_text(0, path);
|
||||
Connection cd = c;
|
||||
connection_item->set_metadata(0, cd);
|
||||
connection_item->set_icon(0, get_theme_icon("Slot", "EditorIcons"));
|
||||
connection_item->set_icon(0, get_theme_icon(SNAME("Slot"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1083,7 +1083,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) {
|
|||
search_box = memnew(LineEdit);
|
||||
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
search_box->set_placeholder(TTR("Filter signals"));
|
||||
search_box->set_right_icon(get_theme_icon("Search", "EditorIcons"));
|
||||
search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
search_box->set_clear_button_enabled(true);
|
||||
search_box->connect("text_changed", callable_mp(this, &ConnectionsDock::_filter_changed));
|
||||
vbc->add_child(search_box);
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const String &p_select_type) {
|
||||
_fill_type_list();
|
||||
|
||||
icon_fallback = search_options->has_theme_icon(base_type, "EditorIcons") ? base_type : "Object";
|
||||
icon_fallback = search_options->has_theme_icon(base_type, SNAME("EditorIcons")) ? base_type : "Object";
|
||||
|
||||
if (p_dont_clear) {
|
||||
search_box->select_all();
|
||||
|
@ -168,7 +168,7 @@ void CreateDialog::_update_search() {
|
|||
|
||||
TreeItem *root = search_options->create_item();
|
||||
root->set_text(0, base_type);
|
||||
root->set_icon(0, search_options->get_theme_icon(icon_fallback, "EditorIcons"));
|
||||
root->set_icon(0, search_options->get_theme_icon(icon_fallback, SNAME("EditorIcons")));
|
||||
search_options_types[base_type] = root;
|
||||
_configure_search_option_item(root, base_type, ClassDB::class_exists(base_type));
|
||||
|
||||
|
@ -236,7 +236,7 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String
|
|||
|
||||
bool can_instantiate = (p_cpp_type && ClassDB::can_instantiate(p_type)) || !p_cpp_type;
|
||||
if (!can_instantiate) {
|
||||
r_item->set_custom_color(0, search_options->get_theme_color("disabled_font_color", "Editor"));
|
||||
r_item->set_custom_color(0, search_options->get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
|
||||
r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, "NodeDisabled"));
|
||||
r_item->set_selectable(0, false);
|
||||
} else {
|
||||
|
@ -338,7 +338,7 @@ void CreateDialog::_confirmed() {
|
|||
memdelete(f);
|
||||
}
|
||||
|
||||
emit_signal("create");
|
||||
emit_signal(SNAME("create"));
|
||||
hide();
|
||||
_cleanup();
|
||||
}
|
||||
|
@ -366,16 +366,16 @@ void CreateDialog::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
connect("confirmed", callable_mp(this, &CreateDialog::_confirmed));
|
||||
search_box->set_right_icon(search_options->get_theme_icon("Search", "EditorIcons"));
|
||||
search_box->set_right_icon(search_options->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
search_box->set_clear_button_enabled(true);
|
||||
favorite->set_icon(search_options->get_theme_icon("Favorites", "EditorIcons"));
|
||||
favorite->set_icon(search_options->get_theme_icon(SNAME("Favorites"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
disconnect("confirmed", callable_mp(this, &CreateDialog::_confirmed));
|
||||
} break;
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
if (is_visible()) {
|
||||
search_box->call_deferred("grab_focus"); // still not visible
|
||||
search_box->call_deferred(SNAME("grab_focus")); // still not visible
|
||||
search_box->select_all();
|
||||
} else {
|
||||
EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "create_new_node", Rect2(get_position(), get_size()));
|
||||
|
@ -607,7 +607,7 @@ void CreateDialog::_save_and_update_favorite_list() {
|
|||
memdelete(f);
|
||||
}
|
||||
|
||||
emit_signal("favorites_updated");
|
||||
emit_signal(SNAME("favorites_updated"));
|
||||
}
|
||||
|
||||
void CreateDialog::_load_favorites_and_history() {
|
||||
|
|
|
@ -41,7 +41,7 @@ bool EditorDebuggerRemoteObject::_set(const StringName &p_name, const Variant &p
|
|||
}
|
||||
|
||||
prop_values[p_name] = p_value;
|
||||
emit_signal("value_edited", remote_object_id, p_name, p_value);
|
||||
emit_signal(SNAME("value_edited"), remote_object_id, p_name, p_value);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -114,11 +114,11 @@ void EditorDebuggerInspector::_notification(int p_what) {
|
|||
}
|
||||
|
||||
void EditorDebuggerInspector::_object_edited(ObjectID p_id, const String &p_prop, const Variant &p_value) {
|
||||
emit_signal("object_edited", p_id, p_prop, p_value);
|
||||
emit_signal(SNAME("object_edited"), p_id, p_prop, p_value);
|
||||
}
|
||||
|
||||
void EditorDebuggerInspector::_object_selected(ObjectID p_object) {
|
||||
emit_signal("object_selected", p_object);
|
||||
emit_signal(SNAME("object_selected"), p_object);
|
||||
}
|
||||
|
||||
ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) {
|
||||
|
@ -190,7 +190,7 @@ ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) {
|
|||
if (old_prop_size == debugObj->prop_list.size() && new_props_added == 0) {
|
||||
//only some may have changed, if so, then update those, if exist
|
||||
for (Set<String>::Element *E = changed.front(); E; E = E->next()) {
|
||||
emit_signal("object_property_updated", debugObj->remote_object_id, E->get());
|
||||
emit_signal(SNAME("object_property_updated"), debugObj->remote_object_id, E->get());
|
||||
}
|
||||
} else {
|
||||
//full update, because props were added or removed
|
||||
|
|
|
@ -55,8 +55,8 @@ EditorDebuggerNode::EditorDebuggerNode() {
|
|||
singleton = this;
|
||||
}
|
||||
|
||||
add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(SIDE_LEFT));
|
||||
add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(SIDE_RIGHT));
|
||||
add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT));
|
||||
add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT));
|
||||
|
||||
tabs = memnew(TabContainer);
|
||||
tabs->set_tab_align(TabContainer::ALIGN_LEFT);
|
||||
|
@ -112,7 +112,7 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() {
|
|||
if (tabs->get_tab_count() > 1) {
|
||||
node->clear_style();
|
||||
tabs->set_tabs_visible(true);
|
||||
tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("DebuggerPanel", "EditorStyles"));
|
||||
tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles")));
|
||||
}
|
||||
|
||||
if (!debugger_plugins.is_empty()) {
|
||||
|
@ -135,7 +135,7 @@ void EditorDebuggerNode::_stack_frame_selected(int p_debugger) {
|
|||
|
||||
void EditorDebuggerNode::_error_selected(const String &p_file, int p_line, int p_debugger) {
|
||||
Ref<Script> s = ResourceLoader::load(p_file);
|
||||
emit_signal("goto_script_line", s, p_line - 1);
|
||||
emit_signal(SNAME("goto_script_line"), s, p_line - 1);
|
||||
}
|
||||
|
||||
void EditorDebuggerNode::_text_editor_stack_goto(const ScriptEditorDebugger *p_debugger) {
|
||||
|
@ -145,8 +145,8 @@ void EditorDebuggerNode::_text_editor_stack_goto(const ScriptEditorDebugger *p_d
|
|||
}
|
||||
stack_script = ResourceLoader::load(file);
|
||||
const int line = p_debugger->get_stack_script_line() - 1;
|
||||
emit_signal("goto_script_line", stack_script, line);
|
||||
emit_signal("set_execution", stack_script, line);
|
||||
emit_signal(SNAME("goto_script_line"), stack_script, line);
|
||||
emit_signal(SNAME("set_execution"), stack_script, line);
|
||||
stack_script.unref(); // Why?!?
|
||||
}
|
||||
|
||||
|
@ -226,10 +226,10 @@ void EditorDebuggerNode::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
if (tabs->get_tab_count() > 1) {
|
||||
add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(SIDE_LEFT));
|
||||
add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(SIDE_RIGHT));
|
||||
add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT));
|
||||
add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT));
|
||||
|
||||
tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("DebuggerPanel", "EditorStyles"));
|
||||
tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles")));
|
||||
}
|
||||
} break;
|
||||
case NOTIFICATION_READY: {
|
||||
|
@ -268,11 +268,11 @@ void EditorDebuggerNode::_notification(int p_what) {
|
|||
} else {
|
||||
debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")");
|
||||
if (error_count >= 1 && warning_count >= 1) {
|
||||
debugger_button->set_icon(get_theme_icon("ErrorWarning", "EditorIcons"));
|
||||
debugger_button->set_icon(get_theme_icon(SNAME("ErrorWarning"), SNAME("EditorIcons")));
|
||||
} else if (error_count >= 1) {
|
||||
debugger_button->set_icon(get_theme_icon("Error", "EditorIcons"));
|
||||
debugger_button->set_icon(get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
debugger_button->set_icon(get_theme_icon("Warning", "EditorIcons"));
|
||||
debugger_button->set_icon(get_theme_icon(SNAME("Warning"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
last_error_count = error_count;
|
||||
|
@ -359,7 +359,7 @@ void EditorDebuggerNode::_debugger_wants_stop(int p_id) {
|
|||
// Ask editor to kill PID.
|
||||
int pid = get_debugger(p_id)->get_remote_pid();
|
||||
if (pid) {
|
||||
EditorNode::get_singleton()->call_deferred("stop_child_process", pid);
|
||||
EditorNode::get_singleton()->call_deferred(SNAME("stop_child_process"), pid);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -475,7 +475,7 @@ void EditorDebuggerNode::_breaked(bool p_breaked, bool p_can_debug, int p_debugg
|
|||
}
|
||||
_break_state_changed();
|
||||
EditorNode::get_singleton()->get_pause_button()->set_pressed(p_breaked);
|
||||
emit_signal("breaked", p_breaked, p_can_debug);
|
||||
emit_signal(SNAME("breaked"), p_breaked, p_can_debug);
|
||||
}
|
||||
|
||||
bool EditorDebuggerNode::is_skip_breakpoints() const {
|
||||
|
|
|
@ -123,7 +123,7 @@ protected:
|
|||
void _save_node_requested(ObjectID p_id, const String &p_file, int p_debugger);
|
||||
|
||||
void _clear_execution(REF p_script) {
|
||||
emit_signal("clear_execution", p_script);
|
||||
emit_signal(SNAME("clear_execution"), p_script);
|
||||
}
|
||||
|
||||
void _text_editor_stack_goto(const ScriptEditorDebugger *p_debugger);
|
||||
|
|
|
@ -75,7 +75,7 @@ void EditorDebuggerTree::_scene_tree_selected() {
|
|||
|
||||
inspected_object_id = uint64_t(item->get_metadata(0));
|
||||
|
||||
emit_signal("object_selected", inspected_object_id, debugger_id);
|
||||
emit_signal(SNAME("object_selected"), inspected_object_id, debugger_id);
|
||||
}
|
||||
|
||||
void EditorDebuggerTree::_scene_tree_folded(Object *p_obj) {
|
||||
|
@ -105,8 +105,8 @@ void EditorDebuggerTree::_scene_tree_rmb_selected(const Vector2 &p_position) {
|
|||
item->select(0);
|
||||
|
||||
item_menu->clear();
|
||||
item_menu->add_icon_item(get_theme_icon("CreateNewSceneFrom", "EditorIcons"), TTR("Save Branch as Scene"), ITEM_MENU_SAVE_REMOTE_NODE);
|
||||
item_menu->add_icon_item(get_theme_icon("CopyNodePath", "EditorIcons"), TTR("Copy Node Path"), ITEM_MENU_COPY_NODE_PATH);
|
||||
item_menu->add_icon_item(get_theme_icon(SNAME("CreateNewSceneFrom"), SNAME("EditorIcons")), TTR("Save Branch as Scene"), ITEM_MENU_SAVE_REMOTE_NODE);
|
||||
item_menu->add_icon_item(get_theme_icon(SNAME("CopyNodePath"), SNAME("EditorIcons")), TTR("Copy Node Path"), ITEM_MENU_COPY_NODE_PATH);
|
||||
item_menu->set_position(get_screen_transform().xform(get_local_mouse_position()));
|
||||
item_menu->popup();
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int
|
|||
}
|
||||
debugger_id = p_debugger; // Needed by hook, could be avoided if every debugger had its own tree
|
||||
if (scroll_item) {
|
||||
call_deferred("scroll_to_item", scroll_item);
|
||||
call_deferred(SNAME("scroll_to_item"), scroll_item);
|
||||
}
|
||||
last_filter = filter;
|
||||
updating_scene_tree = false;
|
||||
|
@ -279,5 +279,5 @@ void EditorDebuggerTree::_file_selected(const String &p_file) {
|
|||
if (inspected_object_id.is_null()) {
|
||||
return;
|
||||
}
|
||||
emit_signal("save_node", inspected_object_id, p_file, debugger_id);
|
||||
emit_signal(SNAME("save_node"), inspected_object_id, p_file, debugger_id);
|
||||
}
|
||||
|
|
|
@ -40,14 +40,14 @@ void EditorNetworkProfiler::_bind_methods() {
|
|||
|
||||
void EditorNetworkProfiler::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
activate->set_icon(get_theme_icon("Play", "EditorIcons"));
|
||||
clear_button->set_icon(get_theme_icon("Clear", "EditorIcons"));
|
||||
incoming_bandwidth_text->set_right_icon(get_theme_icon("ArrowDown", "EditorIcons"));
|
||||
outgoing_bandwidth_text->set_right_icon(get_theme_icon("ArrowUp", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
|
||||
clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")));
|
||||
incoming_bandwidth_text->set_right_icon(get_theme_icon(SNAME("ArrowDown"), SNAME("EditorIcons")));
|
||||
outgoing_bandwidth_text->set_right_icon(get_theme_icon(SNAME("ArrowUp"), SNAME("EditorIcons")));
|
||||
|
||||
// This needs to be done here to set the faded color when the profiler is first opened
|
||||
incoming_bandwidth_text->add_theme_color_override("font_uneditable_color", get_theme_color("font_color", "Editor") * Color(1, 1, 1, 0.5));
|
||||
outgoing_bandwidth_text->add_theme_color_override("font_uneditable_color", get_theme_color("font_color", "Editor") * Color(1, 1, 1, 0.5));
|
||||
incoming_bandwidth_text->add_theme_color_override("font_uneditable_color", get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.5));
|
||||
outgoing_bandwidth_text->add_theme_color_override("font_uneditable_color", get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.5));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,13 +73,13 @@ void EditorNetworkProfiler::_update_frame() {
|
|||
|
||||
void EditorNetworkProfiler::_activate_pressed() {
|
||||
if (activate->is_pressed()) {
|
||||
activate->set_icon(get_theme_icon("Stop", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons")));
|
||||
activate->set_text(TTR("Stop"));
|
||||
} else {
|
||||
activate->set_icon(get_theme_icon("Play", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
|
||||
activate->set_text(TTR("Start"));
|
||||
}
|
||||
emit_signal("enable_profiling", activate->is_pressed());
|
||||
emit_signal(SNAME("enable_profiling"), activate->is_pressed());
|
||||
}
|
||||
|
||||
void EditorNetworkProfiler::_clear_pressed() {
|
||||
|
@ -114,10 +114,10 @@ void EditorNetworkProfiler::set_bandwidth(int p_incoming, int p_outgoing) {
|
|||
// Make labels more prominent when the bandwidth is greater than 0 to attract user attention
|
||||
incoming_bandwidth_text->add_theme_color_override(
|
||||
"font_uneditable_color",
|
||||
get_theme_color("font_color", "Editor") * Color(1, 1, 1, p_incoming > 0 ? 1 : 0.5));
|
||||
get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, p_incoming > 0 ? 1 : 0.5));
|
||||
outgoing_bandwidth_text->add_theme_color_override(
|
||||
"font_uneditable_color",
|
||||
get_theme_color("font_color", "Editor") * Color(1, 1, 1, p_outgoing > 0 ? 1 : 0.5));
|
||||
get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, p_outgoing > 0 ? 1 : 0.5));
|
||||
}
|
||||
|
||||
bool EditorNetworkProfiler::is_profiling() {
|
||||
|
|
|
@ -109,9 +109,9 @@ void EditorPerformanceProfiler::_monitor_draw() {
|
|||
|
||||
info_message->hide();
|
||||
|
||||
Ref<StyleBox> graph_style_box = get_theme_stylebox("normal", "TextEdit");
|
||||
Ref<Font> graph_font = get_theme_font("font", "TextEdit");
|
||||
int font_size = get_theme_font_size("font_size", "TextEdit");
|
||||
Ref<StyleBox> graph_style_box = get_theme_stylebox(SNAME("normal"), SNAME("TextEdit"));
|
||||
Ref<Font> graph_font = get_theme_font(SNAME("font"), SNAME("TextEdit"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("TextEdit"));
|
||||
|
||||
int columns = int(Math::ceil(Math::sqrt(float(active.size()))));
|
||||
int rows = int(Math::ceil(float(active.size()) / float(columns)));
|
||||
|
@ -130,7 +130,7 @@ void EditorPerformanceProfiler::_monitor_draw() {
|
|||
|
||||
rect.position += graph_style_box->get_offset();
|
||||
rect.size -= graph_style_box->get_minimum_size();
|
||||
Color draw_color = get_theme_color("accent_color", "Editor");
|
||||
Color draw_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_color.set_hsv(Math::fmod(hue_shift * float(current.frame_index), 0.9f), draw_color.get_s() * 0.9f, draw_color.get_v() * value_multiplier, 0.6f);
|
||||
monitor_draw->draw_string(graph_font, rect.position + Point2(0, graph_font->get_ascent(font_size)), current.item->get_text(0), HALIGN_LEFT, rect.size.x, font_size, draw_color);
|
||||
|
||||
|
@ -271,7 +271,7 @@ void EditorPerformanceProfiler::_marker_input(const Ref<InputEvent> &p_event) {
|
|||
} else {
|
||||
marker_key = "";
|
||||
}
|
||||
Ref<StyleBox> graph_style_box = get_theme_stylebox("normal", "TextEdit");
|
||||
Ref<StyleBox> graph_style_box = get_theme_stylebox(SNAME("normal"), SNAME("TextEdit"));
|
||||
rect.position += graph_style_box->get_offset();
|
||||
rect.size -= graph_style_box->get_minimum_size();
|
||||
Vector2 point = mb->get_position() - rect.position;
|
||||
|
|
|
@ -135,11 +135,11 @@ String EditorProfiler::_get_time_as_text(const Metric &m, float p_time, int p_ca
|
|||
}
|
||||
|
||||
Color EditorProfiler::_get_color_from_signature(const StringName &p_signature) const {
|
||||
Color bc = get_theme_color("error_color", "Editor");
|
||||
Color bc = get_theme_color(SNAME("error_color"), SNAME("Editor"));
|
||||
double rot = ABS(double(p_signature.hash()) / double(0x7FFFFFFF));
|
||||
Color c;
|
||||
c.set_hsv(rot, bc.get_s(), bc.get_v());
|
||||
return c.lerp(get_theme_color("base_color", "Editor"), 0.07);
|
||||
return c.lerp(get_theme_color(SNAME("base_color"), SNAME("Editor")), 0.07);
|
||||
}
|
||||
|
||||
void EditorProfiler::_item_edited() {
|
||||
|
@ -180,7 +180,7 @@ void EditorProfiler::_update_plot() {
|
|||
}
|
||||
|
||||
uint8_t *wr = graph_image.ptrw();
|
||||
const Color background_color = get_theme_color("dark_color_2", "Editor");
|
||||
const Color background_color = get_theme_color(SNAME("dark_color_2"), SNAME("Editor"));
|
||||
|
||||
// Clear the previous frame and set the background color.
|
||||
for (int i = 0; i < desired_len; i += 4) {
|
||||
|
@ -376,14 +376,14 @@ void EditorProfiler::_update_frame() {
|
|||
|
||||
void EditorProfiler::_activate_pressed() {
|
||||
if (activate->is_pressed()) {
|
||||
activate->set_icon(get_theme_icon("Stop", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons")));
|
||||
activate->set_text(TTR("Stop"));
|
||||
_clear_pressed();
|
||||
} else {
|
||||
activate->set_icon(get_theme_icon("Play", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
|
||||
activate->set_text(TTR("Start"));
|
||||
}
|
||||
emit_signal("enable_profiling", activate->is_pressed());
|
||||
emit_signal(SNAME("enable_profiling"), activate->is_pressed());
|
||||
}
|
||||
|
||||
void EditorProfiler::_clear_pressed() {
|
||||
|
@ -394,8 +394,8 @@ void EditorProfiler::_clear_pressed() {
|
|||
|
||||
void EditorProfiler::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_LAYOUT_DIRECTION_CHANGED || p_what == NOTIFICATION_TRANSLATION_CHANGED) {
|
||||
activate->set_icon(get_theme_icon("Play", "EditorIcons"));
|
||||
clear_button->set_icon(get_theme_icon("Clear", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
|
||||
clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -462,7 +462,7 @@ void EditorProfiler::_graph_tex_input(const Ref<InputEvent> &p_ev) {
|
|||
|
||||
if (activate->is_pressed()) {
|
||||
if (!seeking) {
|
||||
emit_signal("break_request");
|
||||
emit_signal(SNAME("break_request"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -123,11 +123,11 @@ String EditorVisualProfiler::_get_time_as_text(float p_time) {
|
|||
}
|
||||
|
||||
Color EditorVisualProfiler::_get_color_from_signature(const StringName &p_signature) const {
|
||||
Color bc = get_theme_color("error_color", "Editor");
|
||||
Color bc = get_theme_color(SNAME("error_color"), SNAME("Editor"));
|
||||
double rot = ABS(double(p_signature.hash()) / double(0x7FFFFFFF));
|
||||
Color c;
|
||||
c.set_hsv(rot, bc.get_s(), bc.get_v());
|
||||
return c.lerp(get_theme_color("base_color", "Editor"), 0.07);
|
||||
return c.lerp(get_theme_color(SNAME("base_color"), SNAME("Editor")), 0.07);
|
||||
}
|
||||
|
||||
void EditorVisualProfiler::_item_selected() {
|
||||
|
@ -318,7 +318,7 @@ void EditorVisualProfiler::_update_plot() {
|
|||
void EditorVisualProfiler::_update_frame(bool p_focus_selected) {
|
||||
int cursor_metric = _get_cursor_index();
|
||||
|
||||
Ref<Texture> track_icon = get_theme_icon("TrackColor", "EditorIcons");
|
||||
Ref<Texture> track_icon = get_theme_icon(SNAME("TrackColor"), SNAME("EditorIcons"));
|
||||
|
||||
ERR_FAIL_INDEX(cursor_metric, frame_metrics.size());
|
||||
|
||||
|
@ -407,14 +407,14 @@ void EditorVisualProfiler::_update_frame(bool p_focus_selected) {
|
|||
|
||||
void EditorVisualProfiler::_activate_pressed() {
|
||||
if (activate->is_pressed()) {
|
||||
activate->set_icon(get_theme_icon("Stop", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons")));
|
||||
activate->set_text(TTR("Stop"));
|
||||
_clear_pressed(); //always clear on start
|
||||
} else {
|
||||
activate->set_icon(get_theme_icon("Play", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
|
||||
activate->set_text(TTR("Start"));
|
||||
}
|
||||
emit_signal("enable_profiling", activate->is_pressed());
|
||||
emit_signal(SNAME("enable_profiling"), activate->is_pressed());
|
||||
}
|
||||
|
||||
void EditorVisualProfiler::_clear_pressed() {
|
||||
|
@ -425,11 +425,11 @@ void EditorVisualProfiler::_clear_pressed() {
|
|||
void EditorVisualProfiler::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_LAYOUT_DIRECTION_CHANGED || p_what == NOTIFICATION_TRANSLATION_CHANGED) {
|
||||
if (is_layout_rtl()) {
|
||||
activate->set_icon(get_theme_icon("PlayBackwards", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon(SNAME("PlayBackwards"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
activate->set_icon(get_theme_icon("Play", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
|
||||
}
|
||||
clear_button->set_icon(get_theme_icon("Clear", "EditorIcons"));
|
||||
clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -437,8 +437,8 @@ void EditorVisualProfiler::_graph_tex_draw() {
|
|||
if (last_metric < 0) {
|
||||
return;
|
||||
}
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
if (seeking) {
|
||||
int max_frames = frame_metrics.size();
|
||||
int frame = cursor_metric_edit->get_value() - (frame_metrics[last_metric].frame_number - max_frames + 1);
|
||||
|
|
|
@ -87,9 +87,9 @@ void ScriptEditorDebugger::debug_copy() {
|
|||
void ScriptEditorDebugger::debug_skip_breakpoints() {
|
||||
skip_breakpoints_value = !skip_breakpoints_value;
|
||||
if (skip_breakpoints_value) {
|
||||
skip_breakpoints->set_icon(get_theme_icon("DebugSkipBreakpointsOn", "EditorIcons"));
|
||||
skip_breakpoints->set_icon(get_theme_icon(SNAME("DebugSkipBreakpointsOn"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
skip_breakpoints->set_icon(get_theme_icon("DebugSkipBreakpointsOff", "EditorIcons"));
|
||||
skip_breakpoints->set_icon(get_theme_icon(SNAME("DebugSkipBreakpointsOff"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
Array msg;
|
||||
|
@ -136,11 +136,11 @@ void ScriptEditorDebugger::update_tabs() {
|
|||
} else {
|
||||
errors_tab->set_name(TTR("Errors") + " (" + itos(error_count + warning_count) + ")");
|
||||
if (error_count >= 1 && warning_count >= 1) {
|
||||
tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("ErrorWarning", "EditorIcons"));
|
||||
tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon(SNAME("ErrorWarning"), SNAME("EditorIcons")));
|
||||
} else if (error_count >= 1) {
|
||||
tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("Error", "EditorIcons"));
|
||||
tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("Warning", "EditorIcons"));
|
||||
tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon(SNAME("Warning"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ Object *ScriptEditorDebugger::get_remote_object(ObjectID p_id) {
|
|||
}
|
||||
|
||||
void ScriptEditorDebugger::_remote_object_selected(ObjectID p_id) {
|
||||
emit_signal("remote_object_requested", p_id);
|
||||
emit_signal(SNAME("remote_object_requested"), p_id);
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::_remote_object_edited(ObjectID p_id, const String &p_prop, const Variant &p_value) {
|
||||
|
@ -273,7 +273,7 @@ void ScriptEditorDebugger::_remote_object_edited(ObjectID p_id, const String &p_
|
|||
}
|
||||
|
||||
void ScriptEditorDebugger::_remote_object_property_updated(ObjectID p_id, const String &p_property) {
|
||||
emit_signal("remote_object_property_updated", p_id, p_property);
|
||||
emit_signal(SNAME("remote_object_property_updated"), p_id, p_property);
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::_video_mem_request() {
|
||||
|
@ -305,7 +305,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
|||
can_debug = can_continue;
|
||||
_update_buttons_state();
|
||||
_set_reason_text(error, MESSAGE_ERROR);
|
||||
emit_signal("breaked", true, can_continue);
|
||||
emit_signal(SNAME("breaked"), true, can_continue);
|
||||
DisplayServer::get_singleton()->window_move_to_foreground();
|
||||
if (error != "") {
|
||||
tabs->set_current_tab(0);
|
||||
|
@ -319,7 +319,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
|||
_clear_execution();
|
||||
_update_buttons_state();
|
||||
_set_reason_text(TTR("Execution resumed."), MESSAGE_SUCCESS);
|
||||
emit_signal("breaked", false, false);
|
||||
emit_signal(SNAME("breaked"), false, false);
|
||||
profiler->set_enabled(true);
|
||||
profiler->disable_seeking();
|
||||
} else if (p_msg == "set_pid") {
|
||||
|
@ -332,12 +332,12 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
|||
} else if (p_msg == "scene:scene_tree") {
|
||||
scene_tree->nodes.clear();
|
||||
scene_tree->deserialize(p_data);
|
||||
emit_signal("remote_tree_updated");
|
||||
emit_signal(SNAME("remote_tree_updated"));
|
||||
_update_buttons_state();
|
||||
} else if (p_msg == "scene:inspect_object") {
|
||||
ObjectID id = inspector->add_object(p_data);
|
||||
if (id.is_valid()) {
|
||||
emit_signal("remote_object_updated", id);
|
||||
emit_signal(SNAME("remote_object_updated"), id);
|
||||
}
|
||||
} else if (p_msg == "memory:usage") {
|
||||
vmem_tree->clear();
|
||||
|
@ -357,8 +357,8 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
|||
it->set_text(3, String::humanize_size(bytes));
|
||||
total += bytes;
|
||||
|
||||
if (has_theme_icon(type, "EditorIcons")) {
|
||||
it->set_icon(0, get_theme_icon(type, "EditorIcons"));
|
||||
if (has_theme_icon(type, SNAME("EditorIcons"))) {
|
||||
it->set_icon(0, get_theme_icon(type, SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -698,7 +698,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
|||
network_profiler->set_bandwidth(p_data[0], p_data[1]);
|
||||
|
||||
} else if (p_msg == "request_quit") {
|
||||
emit_signal("stop_requested");
|
||||
emit_signal(SNAME("stop_requested"));
|
||||
_stop_and_notify();
|
||||
|
||||
} else if (p_msg == "performance:profile_names") {
|
||||
|
@ -739,13 +739,13 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
|||
void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType p_type) {
|
||||
switch (p_type) {
|
||||
case MESSAGE_ERROR:
|
||||
reason->add_theme_color_override("font_color", get_theme_color("error_color", "Editor"));
|
||||
reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
break;
|
||||
case MESSAGE_WARNING:
|
||||
reason->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor"));
|
||||
reason->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
break;
|
||||
default:
|
||||
reason->add_theme_color_override("font_color", get_theme_color("success_color", "Editor"));
|
||||
reason->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), SNAME("Editor")));
|
||||
}
|
||||
reason->set_text(p_reason);
|
||||
reason->set_tooltip(p_reason.word_wrap(80));
|
||||
|
@ -754,21 +754,21 @@ void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType
|
|||
void ScriptEditorDebugger::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
skip_breakpoints->set_icon(get_theme_icon("DebugSkipBreakpointsOff", "EditorIcons"));
|
||||
copy->set_icon(get_theme_icon("ActionCopy", "EditorIcons"));
|
||||
skip_breakpoints->set_icon(get_theme_icon(SNAME("DebugSkipBreakpointsOff"), SNAME("EditorIcons")));
|
||||
copy->set_icon(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")));
|
||||
|
||||
step->set_icon(get_theme_icon("DebugStep", "EditorIcons"));
|
||||
next->set_icon(get_theme_icon("DebugNext", "EditorIcons"));
|
||||
dobreak->set_icon(get_theme_icon("Pause", "EditorIcons"));
|
||||
docontinue->set_icon(get_theme_icon("DebugContinue", "EditorIcons"));
|
||||
step->set_icon(get_theme_icon(SNAME("DebugStep"), SNAME("EditorIcons")));
|
||||
next->set_icon(get_theme_icon(SNAME("DebugNext"), SNAME("EditorIcons")));
|
||||
dobreak->set_icon(get_theme_icon(SNAME("Pause"), SNAME("EditorIcons")));
|
||||
docontinue->set_icon(get_theme_icon(SNAME("DebugContinue"), SNAME("EditorIcons")));
|
||||
le_set->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_live_edit_set));
|
||||
le_clear->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_live_edit_clear));
|
||||
error_tree->connect("item_selected", callable_mp(this, &ScriptEditorDebugger::_error_selected));
|
||||
error_tree->connect("item_activated", callable_mp(this, &ScriptEditorDebugger::_error_activated));
|
||||
vmem_refresh->set_icon(get_theme_icon("Reload", "EditorIcons"));
|
||||
vmem_export->set_icon(get_theme_icon("Save", "EditorIcons"));
|
||||
vmem_refresh->set_icon(get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")));
|
||||
vmem_export->set_icon(get_theme_icon(SNAME("Save"), SNAME("EditorIcons")));
|
||||
|
||||
reason->add_theme_color_override("font_color", get_theme_color("error_color", "Editor"));
|
||||
reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
|
||||
} break;
|
||||
case NOTIFICATION_PROCESS: {
|
||||
|
@ -831,16 +831,16 @@ void ScriptEditorDebugger::_notification(int p_what) {
|
|||
} break;
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
if (tabs->has_theme_stylebox_override("panel")) {
|
||||
tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("DebuggerPanel", "EditorStyles"));
|
||||
tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles")));
|
||||
}
|
||||
|
||||
copy->set_icon(get_theme_icon("ActionCopy", "EditorIcons"));
|
||||
step->set_icon(get_theme_icon("DebugStep", "EditorIcons"));
|
||||
next->set_icon(get_theme_icon("DebugNext", "EditorIcons"));
|
||||
dobreak->set_icon(get_theme_icon("Pause", "EditorIcons"));
|
||||
docontinue->set_icon(get_theme_icon("DebugContinue", "EditorIcons"));
|
||||
vmem_refresh->set_icon(get_theme_icon("Reload", "EditorIcons"));
|
||||
vmem_export->set_icon(get_theme_icon("Save", "EditorIcons"));
|
||||
copy->set_icon(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")));
|
||||
step->set_icon(get_theme_icon(SNAME("DebugStep"), SNAME("EditorIcons")));
|
||||
next->set_icon(get_theme_icon(SNAME("DebugNext"), SNAME("EditorIcons")));
|
||||
dobreak->set_icon(get_theme_icon(SNAME("Pause"), SNAME("EditorIcons")));
|
||||
docontinue->set_icon(get_theme_icon(SNAME("DebugContinue"), SNAME("EditorIcons")));
|
||||
vmem_refresh->set_icon(get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")));
|
||||
vmem_export->set_icon(get_theme_icon(SNAME("Save"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
@ -854,7 +854,7 @@ void ScriptEditorDebugger::_clear_execution() {
|
|||
Dictionary d = ti->get_metadata(0);
|
||||
|
||||
stack_script = ResourceLoader::load(d["file"]);
|
||||
emit_signal("clear_execution", stack_script);
|
||||
emit_signal(SNAME("clear_execution"), stack_script);
|
||||
stack_script.unref();
|
||||
stack_dump->clear();
|
||||
inspector->clear_stack_variables();
|
||||
|
@ -878,7 +878,7 @@ void ScriptEditorDebugger::start(Ref<RemoteDebuggerPeer> p_peer) {
|
|||
tabs->set_current_tab(0);
|
||||
_set_reason_text(TTR("Debug session started."), MESSAGE_SUCCESS);
|
||||
_update_buttons_state();
|
||||
emit_signal("started");
|
||||
emit_signal(SNAME("started"));
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::_update_buttons_state() {
|
||||
|
@ -896,7 +896,7 @@ void ScriptEditorDebugger::_update_buttons_state() {
|
|||
|
||||
void ScriptEditorDebugger::_stop_and_notify() {
|
||||
stop();
|
||||
emit_signal("stopped");
|
||||
emit_signal(SNAME("stopped"));
|
||||
_set_reason_text(TTR("Debug session closed."), MESSAGE_WARNING);
|
||||
}
|
||||
|
||||
|
@ -959,7 +959,7 @@ void ScriptEditorDebugger::_profiler_seeked() {
|
|||
}
|
||||
|
||||
void ScriptEditorDebugger::_stack_dump_frame_selected() {
|
||||
emit_signal("stack_frame_selected");
|
||||
emit_signal(SNAME("stack_frame_selected"));
|
||||
|
||||
int frame = get_stack_script_frame();
|
||||
|
||||
|
@ -1332,7 +1332,7 @@ void ScriptEditorDebugger::_error_selected() {
|
|||
return;
|
||||
}
|
||||
|
||||
emit_signal("error_selected", String(meta[0]), int(meta[1]));
|
||||
emit_signal(SNAME("error_selected"), String(meta[0]), int(meta[1]));
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::_expand_errors_list() {
|
||||
|
@ -1373,8 +1373,8 @@ void ScriptEditorDebugger::_error_tree_item_rmb_selected(const Vector2 &p_pos) {
|
|||
item_menu->set_size(Size2(1, 1));
|
||||
|
||||
if (error_tree->is_anything_selected()) {
|
||||
item_menu->add_icon_item(get_theme_icon("ActionCopy", "EditorIcons"), TTR("Copy Error"), ACTION_COPY_ERROR);
|
||||
item_menu->add_icon_item(get_theme_icon("Instance", "EditorIcons"), TTR("Open C++ Source on GitHub"), ACTION_OPEN_SOURCE);
|
||||
item_menu->add_icon_item(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")), TTR("Copy Error"), ACTION_COPY_ERROR);
|
||||
item_menu->add_icon_item(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), TTR("Open C++ Source on GitHub"), ACTION_OPEN_SOURCE);
|
||||
}
|
||||
|
||||
if (item_menu->get_item_count() > 0) {
|
||||
|
@ -1393,9 +1393,9 @@ void ScriptEditorDebugger::_item_menu_id_pressed(int p_option) {
|
|||
|
||||
String type;
|
||||
|
||||
if (ti->get_icon(0) == get_theme_icon("Warning", "EditorIcons")) {
|
||||
if (ti->get_icon(0) == get_theme_icon(SNAME("Warning"), SNAME("EditorIcons"))) {
|
||||
type = "W ";
|
||||
} else if (ti->get_icon(0) == get_theme_icon("Error", "EditorIcons")) {
|
||||
} else if (ti->get_icon(0) == get_theme_icon(SNAME("Error"), SNAME("EditorIcons"))) {
|
||||
type = "E ";
|
||||
}
|
||||
|
||||
|
@ -1518,7 +1518,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
|
|||
|
||||
tabs = memnew(TabContainer);
|
||||
tabs->set_tab_align(TabContainer::ALIGN_LEFT);
|
||||
tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("DebuggerPanel", "EditorStyles"));
|
||||
tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles")));
|
||||
tabs->connect("tab_changed", callable_mp(this, &ScriptEditorDebugger::_tab_changed));
|
||||
|
||||
add_child(tabs);
|
||||
|
|
|
@ -162,7 +162,7 @@ void DependencyEditor::_update_list() {
|
|||
|
||||
TreeItem *root = tree->create_item();
|
||||
|
||||
Ref<Texture2D> folder = tree->get_theme_icon("folder", "FileDialog");
|
||||
Ref<Texture2D> folder = tree->get_theme_icon(SNAME("folder"), SNAME("FileDialog"));
|
||||
|
||||
bool broken = false;
|
||||
|
||||
|
@ -278,7 +278,7 @@ void DependencyEditorOwners::_select_file(int p_idx) {
|
|||
if (ResourceLoader::get_resource_type(fpath) == "PackedScene") {
|
||||
editor->open_request(fpath);
|
||||
hide();
|
||||
emit_signal("confirmed");
|
||||
emit_signal(SNAME("confirmed"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -412,17 +412,17 @@ void DependencyRemoveDialog::_build_removed_dependency_tree(const Vector<Removed
|
|||
if (!tree_items.has(rd.dependency_folder)) {
|
||||
TreeItem *folder_item = owners->create_item(owners->get_root());
|
||||
folder_item->set_text(0, rd.dependency_folder);
|
||||
folder_item->set_icon(0, owners->get_theme_icon("Folder", "EditorIcons"));
|
||||
folder_item->set_icon(0, owners->get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
tree_items[rd.dependency_folder] = folder_item;
|
||||
}
|
||||
TreeItem *dependency_item = owners->create_item(tree_items[rd.dependency_folder]);
|
||||
dependency_item->set_text(0, rd.dependency);
|
||||
dependency_item->set_icon(0, owners->get_theme_icon("Warning", "EditorIcons"));
|
||||
dependency_item->set_icon(0, owners->get_theme_icon(SNAME("Warning"), SNAME("EditorIcons")));
|
||||
tree_items[rd.dependency] = dependency_item;
|
||||
} else {
|
||||
TreeItem *dependency_item = owners->create_item(owners->get_root());
|
||||
dependency_item->set_text(0, rd.dependency);
|
||||
dependency_item->set_icon(0, owners->get_theme_icon("Warning", "EditorIcons"));
|
||||
dependency_item->set_icon(0, owners->get_theme_icon(SNAME("Warning"), SNAME("EditorIcons")));
|
||||
tree_items[rd.dependency] = dependency_item;
|
||||
}
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ void DependencyRemoveDialog::ok_pressed() {
|
|||
if (err != OK) {
|
||||
EditorNode::get_singleton()->add_io_error(TTR("Cannot remove:") + "\n" + files_to_delete[i] + "\n");
|
||||
} else {
|
||||
emit_signal("file_removed", files_to_delete[i]);
|
||||
emit_signal(SNAME("file_removed"), files_to_delete[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -525,7 +525,7 @@ void DependencyRemoveDialog::ok_pressed() {
|
|||
if (err != OK) {
|
||||
EditorNode::get_singleton()->add_io_error(TTR("Cannot remove:") + "\n" + dirs_to_delete[i] + "\n");
|
||||
} else {
|
||||
emit_signal("folder_removed", dirs_to_delete[i]);
|
||||
emit_signal(SNAME("folder_removed"), dirs_to_delete[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -665,7 +665,7 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa
|
|||
if (p_parent) {
|
||||
dir_item = files->create_item(p_parent);
|
||||
dir_item->set_text(0, efsd->get_subdir(i)->get_name());
|
||||
dir_item->set_icon(0, files->get_theme_icon("folder", "FileDialog"));
|
||||
dir_item->set_icon(0, files->get_theme_icon(SNAME("folder"), SNAME("FileDialog")));
|
||||
}
|
||||
bool children = _fill_owners(efsd->get_subdir(i), refs, dir_item);
|
||||
|
||||
|
@ -701,7 +701,7 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa
|
|||
int ds = efsd->get_file_deps(i).size();
|
||||
ti->set_text(1, itos(ds));
|
||||
if (ds) {
|
||||
ti->add_button(1, files->get_theme_icon("GuiVisibilityVisible", "EditorIcons"), -1, false, TTR("Show Dependencies"));
|
||||
ti->add_button(1, files->get_theme_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons")), -1, false, TTR("Show Dependencies"));
|
||||
}
|
||||
ti->set_metadata(0, path);
|
||||
has_children = true;
|
||||
|
|
|
@ -41,15 +41,15 @@
|
|||
static const String META_TEXT_TO_COPY = "text_to_copy";
|
||||
|
||||
void EditorAbout::_theme_changed() {
|
||||
const Ref<Font> font = get_theme_font("source", "EditorFonts");
|
||||
const int font_size = get_theme_font_size("source_size", "EditorFonts");
|
||||
const Ref<Font> font = get_theme_font(SNAME("source"), SNAME("EditorFonts"));
|
||||
const int font_size = get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts"));
|
||||
_tpl_text->add_theme_font_override("normal_font", font);
|
||||
_tpl_text->add_theme_font_size_override("normal_font_size", font_size);
|
||||
_tpl_text->add_theme_constant_override("line_separation", 6 * EDSCALE);
|
||||
_license_text->add_theme_font_override("normal_font", font);
|
||||
_license_text->add_theme_font_size_override("normal_font_size", font_size);
|
||||
_license_text->add_theme_constant_override("line_separation", 6 * EDSCALE);
|
||||
_logo->set_texture(get_theme_icon("Logo", "EditorIcons"));
|
||||
_logo->set_texture(get_theme_icon(SNAME("Logo"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
void EditorAbout::_notification(int p_what) {
|
||||
|
|
|
@ -132,57 +132,57 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
|
|||
|
||||
Map<String, Ref<Texture2D>> extension_guess;
|
||||
{
|
||||
extension_guess["bmp"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
|
||||
extension_guess["dds"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
|
||||
extension_guess["exr"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
|
||||
extension_guess["hdr"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
|
||||
extension_guess["jpg"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
|
||||
extension_guess["jpeg"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
|
||||
extension_guess["png"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
|
||||
extension_guess["svg"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
|
||||
extension_guess["svgz"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
|
||||
extension_guess["tga"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
|
||||
extension_guess["webp"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
|
||||
extension_guess["bmp"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons"));
|
||||
extension_guess["dds"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons"));
|
||||
extension_guess["exr"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons"));
|
||||
extension_guess["hdr"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons"));
|
||||
extension_guess["jpg"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons"));
|
||||
extension_guess["jpeg"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons"));
|
||||
extension_guess["png"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons"));
|
||||
extension_guess["svg"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons"));
|
||||
extension_guess["svgz"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons"));
|
||||
extension_guess["tga"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons"));
|
||||
extension_guess["webp"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons"));
|
||||
|
||||
extension_guess["wav"] = tree->get_theme_icon("AudioStreamSample", "EditorIcons");
|
||||
extension_guess["ogg"] = tree->get_theme_icon("AudioStreamOGGVorbis", "EditorIcons");
|
||||
extension_guess["mp3"] = tree->get_theme_icon("AudioStreamMP3", "EditorIcons");
|
||||
extension_guess["wav"] = tree->get_theme_icon(SNAME("AudioStreamSample"), SNAME("EditorIcons"));
|
||||
extension_guess["ogg"] = tree->get_theme_icon(SNAME("AudioStreamOGGVorbis"), SNAME("EditorIcons"));
|
||||
extension_guess["mp3"] = tree->get_theme_icon(SNAME("AudioStreamMP3"), SNAME("EditorIcons"));
|
||||
|
||||
extension_guess["scn"] = tree->get_theme_icon("PackedScene", "EditorIcons");
|
||||
extension_guess["tscn"] = tree->get_theme_icon("PackedScene", "EditorIcons");
|
||||
extension_guess["escn"] = tree->get_theme_icon("PackedScene", "EditorIcons");
|
||||
extension_guess["dae"] = tree->get_theme_icon("PackedScene", "EditorIcons");
|
||||
extension_guess["gltf"] = tree->get_theme_icon("PackedScene", "EditorIcons");
|
||||
extension_guess["glb"] = tree->get_theme_icon("PackedScene", "EditorIcons");
|
||||
extension_guess["scn"] = tree->get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons"));
|
||||
extension_guess["tscn"] = tree->get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons"));
|
||||
extension_guess["escn"] = tree->get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons"));
|
||||
extension_guess["dae"] = tree->get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons"));
|
||||
extension_guess["gltf"] = tree->get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons"));
|
||||
extension_guess["glb"] = tree->get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons"));
|
||||
|
||||
extension_guess["gdshader"] = tree->get_theme_icon("Shader", "EditorIcons");
|
||||
extension_guess["gd"] = tree->get_theme_icon("GDScript", "EditorIcons");
|
||||
extension_guess["gdshader"] = tree->get_theme_icon(SNAME("Shader"), SNAME("EditorIcons"));
|
||||
extension_guess["gd"] = tree->get_theme_icon(SNAME("GDScript"), SNAME("EditorIcons"));
|
||||
if (Engine::get_singleton()->has_singleton("GodotSharp")) {
|
||||
extension_guess["cs"] = tree->get_theme_icon("CSharpScript", "EditorIcons");
|
||||
extension_guess["cs"] = tree->get_theme_icon(SNAME("CSharpScript"), SNAME("EditorIcons"));
|
||||
} else {
|
||||
// Mark C# support as unavailable.
|
||||
extension_guess["cs"] = tree->get_theme_icon("ImportFail", "EditorIcons");
|
||||
extension_guess["cs"] = tree->get_theme_icon(SNAME("ImportFail"), SNAME("EditorIcons"));
|
||||
}
|
||||
extension_guess["vs"] = tree->get_theme_icon("VisualScript", "EditorIcons");
|
||||
extension_guess["vs"] = tree->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons"));
|
||||
|
||||
extension_guess["res"] = tree->get_theme_icon("Resource", "EditorIcons");
|
||||
extension_guess["tres"] = tree->get_theme_icon("Resource", "EditorIcons");
|
||||
extension_guess["atlastex"] = tree->get_theme_icon("AtlasTexture", "EditorIcons");
|
||||
extension_guess["res"] = tree->get_theme_icon(SNAME("Resource"), SNAME("EditorIcons"));
|
||||
extension_guess["tres"] = tree->get_theme_icon(SNAME("Resource"), SNAME("EditorIcons"));
|
||||
extension_guess["atlastex"] = tree->get_theme_icon(SNAME("AtlasTexture"), SNAME("EditorIcons"));
|
||||
// By default, OBJ files are imported as Mesh resources rather than PackedScenes.
|
||||
extension_guess["obj"] = tree->get_theme_icon("Mesh", "EditorIcons");
|
||||
extension_guess["obj"] = tree->get_theme_icon(SNAME("Mesh"), SNAME("EditorIcons"));
|
||||
|
||||
extension_guess["txt"] = tree->get_theme_icon("TextFile", "EditorIcons");
|
||||
extension_guess["md"] = tree->get_theme_icon("TextFile", "EditorIcons");
|
||||
extension_guess["rst"] = tree->get_theme_icon("TextFile", "EditorIcons");
|
||||
extension_guess["json"] = tree->get_theme_icon("TextFile", "EditorIcons");
|
||||
extension_guess["yml"] = tree->get_theme_icon("TextFile", "EditorIcons");
|
||||
extension_guess["yaml"] = tree->get_theme_icon("TextFile", "EditorIcons");
|
||||
extension_guess["toml"] = tree->get_theme_icon("TextFile", "EditorIcons");
|
||||
extension_guess["cfg"] = tree->get_theme_icon("TextFile", "EditorIcons");
|
||||
extension_guess["ini"] = tree->get_theme_icon("TextFile", "EditorIcons");
|
||||
extension_guess["txt"] = tree->get_theme_icon(SNAME("TextFile"), SNAME("EditorIcons"));
|
||||
extension_guess["md"] = tree->get_theme_icon(SNAME("TextFile"), SNAME("EditorIcons"));
|
||||
extension_guess["rst"] = tree->get_theme_icon(SNAME("TextFile"), SNAME("EditorIcons"));
|
||||
extension_guess["json"] = tree->get_theme_icon(SNAME("TextFile"), SNAME("EditorIcons"));
|
||||
extension_guess["yml"] = tree->get_theme_icon(SNAME("TextFile"), SNAME("EditorIcons"));
|
||||
extension_guess["yaml"] = tree->get_theme_icon(SNAME("TextFile"), SNAME("EditorIcons"));
|
||||
extension_guess["toml"] = tree->get_theme_icon(SNAME("TextFile"), SNAME("EditorIcons"));
|
||||
extension_guess["cfg"] = tree->get_theme_icon(SNAME("TextFile"), SNAME("EditorIcons"));
|
||||
extension_guess["ini"] = tree->get_theme_icon(SNAME("TextFile"), SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
Ref<Texture2D> generic_extension = tree->get_theme_icon("Object", "EditorIcons");
|
||||
Ref<Texture2D> generic_extension = tree->get_theme_icon(SNAME("Object"), SNAME("EditorIcons"));
|
||||
|
||||
unzClose(pkg);
|
||||
|
||||
|
@ -191,7 +191,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
|
|||
TreeItem *root = tree->create_item();
|
||||
root->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
|
||||
root->set_checked(0, true);
|
||||
root->set_icon(0, tree->get_theme_icon("folder", "FileDialog"));
|
||||
root->set_icon(0, tree->get_theme_icon(SNAME("folder"), SNAME("FileDialog")));
|
||||
root->set_text(0, "res://");
|
||||
root->set_editable(0, true);
|
||||
Map<String, TreeItem *> dir_map;
|
||||
|
@ -242,7 +242,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
|
|||
if (isdir) {
|
||||
dir_map[path] = ti;
|
||||
ti->set_text(0, path.get_file() + "/");
|
||||
ti->set_icon(0, tree->get_theme_icon("folder", "FileDialog"));
|
||||
ti->set_icon(0, tree->get_theme_icon(SNAME("folder"), SNAME("FileDialog")));
|
||||
ti->set_metadata(0, String());
|
||||
} else {
|
||||
String file = path.get_file();
|
||||
|
@ -257,7 +257,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
|
|||
String res_path = "res://" + path;
|
||||
if (FileAccess::exists(res_path)) {
|
||||
num_file_conflicts += 1;
|
||||
ti->set_custom_color(0, tree->get_theme_color("error_color", "Editor"));
|
||||
ti->set_custom_color(0, tree->get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
ti->set_tooltip(0, vformat(TTR("%s (already exists)"), res_path));
|
||||
ti->set_checked(0, false);
|
||||
} else {
|
||||
|
|
|
@ -64,42 +64,42 @@ void EditorAudioBus::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_READY: {
|
||||
for (int i = 0; i < CHANNELS_MAX; i++) {
|
||||
channel[i].vu_l->set_under_texture(get_theme_icon("BusVuEmpty", "EditorIcons"));
|
||||
channel[i].vu_l->set_progress_texture(get_theme_icon("BusVuFull", "EditorIcons"));
|
||||
channel[i].vu_r->set_under_texture(get_theme_icon("BusVuEmpty", "EditorIcons"));
|
||||
channel[i].vu_r->set_progress_texture(get_theme_icon("BusVuFull", "EditorIcons"));
|
||||
channel[i].vu_l->set_under_texture(get_theme_icon(SNAME("BusVuEmpty"), SNAME("EditorIcons")));
|
||||
channel[i].vu_l->set_progress_texture(get_theme_icon(SNAME("BusVuFull"), SNAME("EditorIcons")));
|
||||
channel[i].vu_r->set_under_texture(get_theme_icon(SNAME("BusVuEmpty"), SNAME("EditorIcons")));
|
||||
channel[i].vu_r->set_progress_texture(get_theme_icon(SNAME("BusVuFull"), SNAME("EditorIcons")));
|
||||
channel[i].prev_active = true;
|
||||
}
|
||||
|
||||
disabled_vu = get_theme_icon("BusVuFrozen", "EditorIcons");
|
||||
disabled_vu = get_theme_icon(SNAME("BusVuFrozen"), SNAME("EditorIcons"));
|
||||
|
||||
Color solo_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(1.0, 0.89, 0.22) : Color(1.0, 0.92, 0.44);
|
||||
Color mute_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(1.0, 0.16, 0.16) : Color(1.0, 0.44, 0.44);
|
||||
Color bypass_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(0.13, 0.8, 1.0) : Color(0.44, 0.87, 1.0);
|
||||
|
||||
solo->set_icon(get_theme_icon("AudioBusSolo", "EditorIcons"));
|
||||
solo->set_icon(get_theme_icon(SNAME("AudioBusSolo"), SNAME("EditorIcons")));
|
||||
solo->add_theme_color_override("icon_pressed_color", solo_color);
|
||||
mute->set_icon(get_theme_icon("AudioBusMute", "EditorIcons"));
|
||||
mute->set_icon(get_theme_icon(SNAME("AudioBusMute"), SNAME("EditorIcons")));
|
||||
mute->add_theme_color_override("icon_pressed_color", mute_color);
|
||||
bypass->set_icon(get_theme_icon("AudioBusBypass", "EditorIcons"));
|
||||
bypass->set_icon(get_theme_icon(SNAME("AudioBusBypass"), SNAME("EditorIcons")));
|
||||
bypass->add_theme_color_override("icon_pressed_color", bypass_color);
|
||||
|
||||
bus_options->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons"));
|
||||
bus_options->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||
|
||||
update_bus();
|
||||
set_process(true);
|
||||
} break;
|
||||
case NOTIFICATION_DRAW: {
|
||||
if (is_master) {
|
||||
draw_style_box(get_theme_stylebox("disabled", "Button"), Rect2(Vector2(), get_size()));
|
||||
draw_style_box(get_theme_stylebox(SNAME("disabled"), SNAME("Button")), Rect2(Vector2(), get_size()));
|
||||
} else if (has_focus()) {
|
||||
draw_style_box(get_theme_stylebox("focus", "Button"), Rect2(Vector2(), get_size()));
|
||||
draw_style_box(get_theme_stylebox(SNAME("focus"), SNAME("Button")), Rect2(Vector2(), get_size()));
|
||||
} else {
|
||||
draw_style_box(get_theme_stylebox("panel", "TabContainer"), Rect2(Vector2(), get_size()));
|
||||
draw_style_box(get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")), Rect2(Vector2(), get_size()));
|
||||
}
|
||||
|
||||
if (get_index() != 0 && hovering_drop) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
accent.a *= 0.7;
|
||||
draw_rect(Rect2(Point2(), get_size()), accent, false);
|
||||
}
|
||||
|
@ -159,23 +159,23 @@ void EditorAudioBus::_notification(int p_what) {
|
|||
} break;
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
for (int i = 0; i < CHANNELS_MAX; i++) {
|
||||
channel[i].vu_l->set_under_texture(get_theme_icon("BusVuEmpty", "EditorIcons"));
|
||||
channel[i].vu_l->set_progress_texture(get_theme_icon("BusVuFull", "EditorIcons"));
|
||||
channel[i].vu_r->set_under_texture(get_theme_icon("BusVuEmpty", "EditorIcons"));
|
||||
channel[i].vu_r->set_progress_texture(get_theme_icon("BusVuFull", "EditorIcons"));
|
||||
channel[i].vu_l->set_under_texture(get_theme_icon(SNAME("BusVuEmpty"), SNAME("EditorIcons")));
|
||||
channel[i].vu_l->set_progress_texture(get_theme_icon(SNAME("BusVuFull"), SNAME("EditorIcons")));
|
||||
channel[i].vu_r->set_under_texture(get_theme_icon(SNAME("BusVuEmpty"), SNAME("EditorIcons")));
|
||||
channel[i].vu_r->set_progress_texture(get_theme_icon(SNAME("BusVuFull"), SNAME("EditorIcons")));
|
||||
channel[i].prev_active = true;
|
||||
}
|
||||
|
||||
disabled_vu = get_theme_icon("BusVuFrozen", "EditorIcons");
|
||||
disabled_vu = get_theme_icon(SNAME("BusVuFrozen"), SNAME("EditorIcons"));
|
||||
|
||||
solo->set_icon(get_theme_icon("AudioBusSolo", "EditorIcons"));
|
||||
mute->set_icon(get_theme_icon("AudioBusMute", "EditorIcons"));
|
||||
bypass->set_icon(get_theme_icon("AudioBusBypass", "EditorIcons"));
|
||||
solo->set_icon(get_theme_icon(SNAME("AudioBusSolo"), SNAME("EditorIcons")));
|
||||
mute->set_icon(get_theme_icon(SNAME("AudioBusMute"), SNAME("EditorIcons")));
|
||||
bypass->set_icon(get_theme_icon(SNAME("AudioBusBypass"), SNAME("EditorIcons")));
|
||||
|
||||
bus_options->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons"));
|
||||
bus_options->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||
|
||||
audio_value_preview_box->add_theme_color_override("font_color", get_theme_color("font_color", "TooltipLabel"));
|
||||
audio_value_preview_box->add_theme_style_override("panel", get_theme_stylebox("panel", "TooltipPanel"));
|
||||
audio_value_preview_box->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), SNAME("TooltipLabel")));
|
||||
audio_value_preview_box->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TooltipPanel")));
|
||||
} break;
|
||||
case NOTIFICATION_MOUSE_EXIT:
|
||||
case NOTIFICATION_DRAG_END: {
|
||||
|
@ -567,12 +567,12 @@ void EditorAudioBus::_effects_gui_input(Ref<InputEvent> p_event) {
|
|||
void EditorAudioBus::_bus_popup_pressed(int p_option) {
|
||||
if (p_option == 2) {
|
||||
// Reset volume
|
||||
emit_signal("vol_reset_request");
|
||||
emit_signal(SNAME("vol_reset_request"));
|
||||
} else if (p_option == 1) {
|
||||
emit_signal("delete_request");
|
||||
emit_signal(SNAME("delete_request"));
|
||||
} else if (p_option == 0) {
|
||||
//duplicate
|
||||
emit_signal("duplicate_request", get_index());
|
||||
emit_signal(SNAME("duplicate_request"), get_index());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -585,7 +585,7 @@ Variant EditorAudioBus::get_drag_data(const Point2 &p_point) {
|
|||
Panel *p = memnew(Panel);
|
||||
c->add_child(p);
|
||||
p->set_modulate(Color(1, 1, 1, 0.7));
|
||||
p->add_theme_style_override("panel", get_theme_stylebox("focus", "Button"));
|
||||
p->add_theme_style_override("panel", get_theme_stylebox(SNAME("focus"), SNAME("Button")));
|
||||
p->set_size(get_size());
|
||||
p->set_position(-p_point);
|
||||
set_drag_preview(c);
|
||||
|
@ -594,7 +594,7 @@ Variant EditorAudioBus::get_drag_data(const Point2 &p_point) {
|
|||
d["index"] = get_index();
|
||||
|
||||
if (get_index() < AudioServer::get_singleton()->get_bus_count() - 1) {
|
||||
emit_signal("drop_end_request");
|
||||
emit_signal(SNAME("drop_end_request"));
|
||||
}
|
||||
|
||||
return d;
|
||||
|
@ -616,7 +616,7 @@ bool EditorAudioBus::can_drop_data(const Point2 &p_point, const Variant &p_data)
|
|||
|
||||
void EditorAudioBus::drop_data(const Point2 &p_point, const Variant &p_data) {
|
||||
Dictionary d = p_data;
|
||||
emit_signal("dropped", d["index"], get_index());
|
||||
emit_signal(SNAME("dropped"), d["index"], get_index());
|
||||
}
|
||||
|
||||
Variant EditorAudioBus::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
|
||||
|
@ -842,13 +842,13 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
audio_value_preview_label->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
audio_value_preview_label->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
audio_value_preview_label->set_mouse_filter(MOUSE_FILTER_PASS);
|
||||
audio_value_preview_box->add_theme_color_override("font_color", get_theme_color("font_color", "TooltipLabel"));
|
||||
audio_value_preview_box->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), SNAME("TooltipLabel")));
|
||||
|
||||
audioprev_hbc->add_child(audio_value_preview_label);
|
||||
|
||||
slider->add_child(audio_value_preview_box);
|
||||
audio_value_preview_box->set_as_top_level(true);
|
||||
audio_value_preview_box->add_theme_style_override("panel", get_theme_stylebox("panel", "TooltipPanel"));
|
||||
audio_value_preview_box->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TooltipPanel")));
|
||||
audio_value_preview_box->set_mouse_filter(MOUSE_FILTER_PASS);
|
||||
audio_value_preview_box->hide();
|
||||
|
||||
|
@ -955,10 +955,10 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
void EditorAudioBusDrop::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_DRAW: {
|
||||
draw_style_box(get_theme_stylebox("normal", "Button"), Rect2(Vector2(), get_size()));
|
||||
draw_style_box(get_theme_stylebox(SNAME("normal"), SNAME("Button")), Rect2(Vector2(), get_size()));
|
||||
|
||||
if (hovering_drop) {
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
accent.a *= 0.7;
|
||||
draw_rect(Rect2(Point2(), get_size()), accent, false);
|
||||
}
|
||||
|
@ -986,7 +986,7 @@ bool EditorAudioBusDrop::can_drop_data(const Point2 &p_point, const Variant &p_d
|
|||
|
||||
void EditorAudioBusDrop::drop_data(const Point2 &p_point, const Variant &p_data) {
|
||||
Dictionary d = p_data;
|
||||
emit_signal("dropped", d["index"], AudioServer::get_singleton()->get_bus_count());
|
||||
emit_signal(SNAME("dropped"), d["index"], AudioServer::get_singleton()->get_bus_count());
|
||||
}
|
||||
|
||||
void EditorAudioBusDrop::_bind_methods() {
|
||||
|
@ -1026,7 +1026,7 @@ void EditorAudioBuses::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
bus_scroll->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree"));
|
||||
bus_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
} break;
|
||||
case NOTIFICATION_READY: {
|
||||
_update_buses();
|
||||
|
@ -1217,7 +1217,7 @@ void EditorAudioBuses::_load_default_layout() {
|
|||
AudioServer::get_singleton()->set_bus_layout(state);
|
||||
_update_buses();
|
||||
EditorNode::get_singleton()->get_undo_redo()->clear_history();
|
||||
call_deferred("_select_layout");
|
||||
call_deferred(SNAME("_select_layout"));
|
||||
}
|
||||
|
||||
void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
|
||||
|
@ -1233,7 +1233,7 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
|
|||
AudioServer::get_singleton()->set_bus_layout(state);
|
||||
_update_buses();
|
||||
EditorNode::get_singleton()->get_undo_redo()->clear_history();
|
||||
call_deferred("_select_layout");
|
||||
call_deferred(SNAME("_select_layout"));
|
||||
|
||||
} else if (file_dialog->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) {
|
||||
if (new_layout) {
|
||||
|
@ -1253,7 +1253,7 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
|
|||
file->set_text(String(TTR("Layout")) + ": " + p_string.get_file());
|
||||
_update_buses();
|
||||
EditorNode::get_singleton()->get_undo_redo()->clear_history();
|
||||
call_deferred("_select_layout");
|
||||
call_deferred(SNAME("_select_layout"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1354,7 +1354,7 @@ void EditorAudioBuses::open_layout(const String &p_path) {
|
|||
AudioServer::get_singleton()->set_bus_layout(state);
|
||||
_update_buses();
|
||||
EditorNode::get_singleton()->get_undo_redo()->clear_history();
|
||||
call_deferred("_select_layout");
|
||||
call_deferred(SNAME("_select_layout"));
|
||||
}
|
||||
|
||||
void AudioBusesEditorPlugin::edit(Object *p_node) {
|
||||
|
@ -1385,8 +1385,8 @@ void EditorAudioMeterNotches::add_notch(float p_normalized_offset, float p_db_va
|
|||
}
|
||||
|
||||
Size2 EditorAudioMeterNotches::get_minimum_size() const {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
float font_height = font->get_height(font_size);
|
||||
|
||||
float width = 0;
|
||||
|
@ -1411,7 +1411,7 @@ void EditorAudioMeterNotches::_bind_methods() {
|
|||
void EditorAudioMeterNotches::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
notch_color = get_theme_color("font_color", "Editor");
|
||||
notch_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
|
||||
} break;
|
||||
case NOTIFICATION_DRAW: {
|
||||
_draw_audio_notches();
|
||||
|
@ -1420,8 +1420,8 @@ void EditorAudioMeterNotches::_notification(int p_what) {
|
|||
}
|
||||
|
||||
void EditorAudioMeterNotches::_draw_audio_notches() {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
float font_height = font->get_height(font_size);
|
||||
|
||||
for (int i = 0; i < notches.size(); i++) {
|
||||
|
@ -1443,5 +1443,5 @@ void EditorAudioMeterNotches::_draw_audio_notches() {
|
|||
}
|
||||
|
||||
EditorAudioMeterNotches::EditorAudioMeterNotches() {
|
||||
notch_color = get_theme_color("font_color", "Editor");
|
||||
notch_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
|
||||
}
|
||||
|
|
|
@ -53,12 +53,12 @@ void EditorAutoloadSettings::_notification(int p_what) {
|
|||
for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) {
|
||||
AutoLoadInfo &info = E->get();
|
||||
if (info.node && info.in_editor) {
|
||||
get_tree()->get_root()->call_deferred("add_child", info.node);
|
||||
get_tree()->get_root()->call_deferred(SNAME("add_child"), info.node);
|
||||
}
|
||||
}
|
||||
browse_button->set_icon(get_theme_icon("Folder", "EditorIcons"));
|
||||
browse_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
} else if (p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
browse_button->set_icon(get_theme_icon("Folder", "EditorIcons"));
|
||||
browse_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -453,10 +453,10 @@ void EditorAutoloadSettings::update_autoload() {
|
|||
item->set_editable(2, true);
|
||||
item->set_text(2, TTR("Enable"));
|
||||
item->set_checked(2, info.is_singleton);
|
||||
item->add_button(3, get_theme_icon("Load", "EditorIcons"), BUTTON_OPEN);
|
||||
item->add_button(3, get_theme_icon("MoveUp", "EditorIcons"), BUTTON_MOVE_UP);
|
||||
item->add_button(3, get_theme_icon("MoveDown", "EditorIcons"), BUTTON_MOVE_DOWN);
|
||||
item->add_button(3, get_theme_icon("Remove", "EditorIcons"), BUTTON_DELETE);
|
||||
item->add_button(3, get_theme_icon(SNAME("Load"), SNAME("EditorIcons")), BUTTON_OPEN);
|
||||
item->add_button(3, get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons")), BUTTON_MOVE_UP);
|
||||
item->add_button(3, get_theme_icon(SNAME("MoveDown"), SNAME("EditorIcons")), BUTTON_MOVE_DOWN);
|
||||
item->add_button(3, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_DELETE);
|
||||
item->set_selectable(3, false);
|
||||
}
|
||||
|
||||
|
@ -470,7 +470,7 @@ void EditorAutoloadSettings::update_autoload() {
|
|||
}
|
||||
if (info.in_editor) {
|
||||
ERR_CONTINUE(!info.node);
|
||||
get_tree()->get_root()->call_deferred("remove_child", info.node);
|
||||
get_tree()->get_root()->call_deferred(SNAME("remove_child"), info.node);
|
||||
}
|
||||
|
||||
if (info.node) {
|
||||
|
@ -914,7 +914,7 @@ EditorAutoloadSettings::~EditorAutoloadSettings() {
|
|||
|
||||
void EditorAutoloadSettings::_set_autoload_add_path(const String &p_text) {
|
||||
autoload_add_path->set_text(p_text);
|
||||
autoload_add_path->emit_signal("text_submitted", p_text);
|
||||
autoload_add_path->emit_signal(SNAME("text_submitted"), p_text);
|
||||
}
|
||||
|
||||
void EditorAutoloadSettings::_browse_autoload_add_path() {
|
||||
|
|
|
@ -1048,7 +1048,7 @@ void EditorSelection::add_node(Node *p_node) {
|
|||
|
||||
p_node->connect("tree_exiting", callable_mp(this, &EditorSelection::_node_removed), varray(p_node), CONNECT_ONESHOT);
|
||||
|
||||
//emit_signal("selection_changed");
|
||||
//emit_signal(SNAME("selection_changed"));
|
||||
}
|
||||
|
||||
void EditorSelection::remove_node(Node *p_node) {
|
||||
|
@ -1066,7 +1066,7 @@ void EditorSelection::remove_node(Node *p_node) {
|
|||
}
|
||||
selection.erase(p_node);
|
||||
p_node->disconnect("tree_exiting", callable_mp(this, &EditorSelection::_node_removed));
|
||||
//emit_signal("selection_changed");
|
||||
//emit_signal(SNAME("selection_changed"));
|
||||
}
|
||||
|
||||
bool EditorSelection::is_selected(Node *p_node) const {
|
||||
|
@ -1144,12 +1144,12 @@ void EditorSelection::update() {
|
|||
changed = false;
|
||||
if (!emitted) {
|
||||
emitted = true;
|
||||
call_deferred("_emit_change");
|
||||
call_deferred(SNAME("_emit_change"));
|
||||
}
|
||||
}
|
||||
|
||||
void EditorSelection::_emit_change() {
|
||||
emit_signal("selection_changed");
|
||||
emit_signal(SNAME("selection_changed"));
|
||||
emitted = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p
|
|||
String path = p_dir->get_path();
|
||||
|
||||
p_item->set_metadata(0, p_dir->get_path());
|
||||
p_item->set_icon(0, tree->get_theme_icon("Folder", "EditorIcons"));
|
||||
p_item->set_icon(0, tree->get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
|
||||
if (!p_item->get_parent()) {
|
||||
p_item->set_text(0, "res://");
|
||||
|
@ -129,7 +129,7 @@ void EditorDirDialog::ok_pressed() {
|
|||
}
|
||||
|
||||
String dir = ti->get_metadata(0);
|
||||
emit_signal("dir_selected", dir);
|
||||
emit_signal(SNAME("dir_selected"), dir);
|
||||
hide();
|
||||
}
|
||||
|
||||
|
|
|
@ -497,7 +497,7 @@ void EditorFeatureProfileManager::_fill_classes_from(TreeItem *p_parent, const S
|
|||
bool disabled_editor = edited->is_class_editor_disabled(p_class);
|
||||
bool disabled_properties = edited->has_class_properties_disabled(p_class);
|
||||
if (disabled) {
|
||||
class_item->set_custom_color(0, class_list->get_theme_color("disabled_font_color", "Editor"));
|
||||
class_item->set_custom_color(0, class_list->get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
|
||||
} else if (disabled_editor && disabled_properties) {
|
||||
text += " " + TTR("(Editor Disabled, Properties Disabled)");
|
||||
} else if (disabled_properties) {
|
||||
|
@ -834,7 +834,7 @@ void EditorFeatureProfileManager::_save_and_update() {
|
|||
}
|
||||
|
||||
void EditorFeatureProfileManager::_emit_current_profile_changed() {
|
||||
emit_signal("current_feature_profile_changed");
|
||||
emit_signal(SNAME("current_feature_profile_changed"));
|
||||
}
|
||||
|
||||
void EditorFeatureProfileManager::notify_changed() {
|
||||
|
|
|
@ -61,22 +61,22 @@ VBoxContainer *EditorFileDialog::get_vbox() {
|
|||
void EditorFileDialog::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_READY || p_what == NOTIFICATION_THEME_CHANGED || p_what == Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED || p_what == NOTIFICATION_TRANSLATION_CHANGED) {
|
||||
// Update icons.
|
||||
mode_thumbnails->set_icon(item_list->get_theme_icon("FileThumbnail", "EditorIcons"));
|
||||
mode_list->set_icon(item_list->get_theme_icon("FileList", "EditorIcons"));
|
||||
mode_thumbnails->set_icon(item_list->get_theme_icon(SNAME("FileThumbnail"), SNAME("EditorIcons")));
|
||||
mode_list->set_icon(item_list->get_theme_icon(SNAME("FileList"), SNAME("EditorIcons")));
|
||||
if (is_layout_rtl()) {
|
||||
dir_prev->set_icon(item_list->get_theme_icon("Forward", "EditorIcons"));
|
||||
dir_next->set_icon(item_list->get_theme_icon("Back", "EditorIcons"));
|
||||
dir_prev->set_icon(item_list->get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
dir_next->set_icon(item_list->get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
dir_prev->set_icon(item_list->get_theme_icon("Back", "EditorIcons"));
|
||||
dir_next->set_icon(item_list->get_theme_icon("Forward", "EditorIcons"));
|
||||
dir_prev->set_icon(item_list->get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
dir_next->set_icon(item_list->get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
}
|
||||
dir_up->set_icon(item_list->get_theme_icon("ArrowUp", "EditorIcons"));
|
||||
refresh->set_icon(item_list->get_theme_icon("Reload", "EditorIcons"));
|
||||
favorite->set_icon(item_list->get_theme_icon("Favorites", "EditorIcons"));
|
||||
show_hidden->set_icon(item_list->get_theme_icon("GuiVisibilityVisible", "EditorIcons"));
|
||||
dir_up->set_icon(item_list->get_theme_icon(SNAME("ArrowUp"), SNAME("EditorIcons")));
|
||||
refresh->set_icon(item_list->get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")));
|
||||
favorite->set_icon(item_list->get_theme_icon(SNAME("Favorites"), SNAME("EditorIcons")));
|
||||
show_hidden->set_icon(item_list->get_theme_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons")));
|
||||
|
||||
fav_up->set_icon(item_list->get_theme_icon("MoveUp", "EditorIcons"));
|
||||
fav_down->set_icon(item_list->get_theme_icon("MoveDown", "EditorIcons"));
|
||||
fav_up->set_icon(item_list->get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons")));
|
||||
fav_down->set_icon(item_list->get_theme_icon(SNAME("MoveDown"), SNAME("EditorIcons")));
|
||||
|
||||
} else if (p_what == NOTIFICATION_PROCESS) {
|
||||
if (preview_waiting) {
|
||||
|
@ -100,21 +100,21 @@ void EditorFileDialog::_notification(int p_what) {
|
|||
set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("filesystem/file_dialog/display_mode").operator int());
|
||||
|
||||
// Update icons.
|
||||
mode_thumbnails->set_icon(item_list->get_theme_icon("FileThumbnail", "EditorIcons"));
|
||||
mode_list->set_icon(item_list->get_theme_icon("FileList", "EditorIcons"));
|
||||
mode_thumbnails->set_icon(item_list->get_theme_icon(SNAME("FileThumbnail"), SNAME("EditorIcons")));
|
||||
mode_list->set_icon(item_list->get_theme_icon(SNAME("FileList"), SNAME("EditorIcons")));
|
||||
if (is_layout_rtl()) {
|
||||
dir_prev->set_icon(item_list->get_theme_icon("Forward", "EditorIcons"));
|
||||
dir_next->set_icon(item_list->get_theme_icon("Back", "EditorIcons"));
|
||||
dir_prev->set_icon(item_list->get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
dir_next->set_icon(item_list->get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
dir_prev->set_icon(item_list->get_theme_icon("Back", "EditorIcons"));
|
||||
dir_next->set_icon(item_list->get_theme_icon("Forward", "EditorIcons"));
|
||||
dir_prev->set_icon(item_list->get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
dir_next->set_icon(item_list->get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
}
|
||||
dir_up->set_icon(item_list->get_theme_icon("ArrowUp", "EditorIcons"));
|
||||
refresh->set_icon(item_list->get_theme_icon("Reload", "EditorIcons"));
|
||||
favorite->set_icon(item_list->get_theme_icon("Favorites", "EditorIcons"));
|
||||
dir_up->set_icon(item_list->get_theme_icon(SNAME("ArrowUp"), SNAME("EditorIcons")));
|
||||
refresh->set_icon(item_list->get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")));
|
||||
favorite->set_icon(item_list->get_theme_icon(SNAME("Favorites"), SNAME("EditorIcons")));
|
||||
|
||||
fav_up->set_icon(item_list->get_theme_icon("MoveUp", "EditorIcons"));
|
||||
fav_down->set_icon(item_list->get_theme_icon("MoveDown", "EditorIcons"));
|
||||
fav_up->set_icon(item_list->get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons")));
|
||||
fav_down->set_icon(item_list->get_theme_icon(SNAME("MoveDown"), SNAME("EditorIcons")));
|
||||
// DO NOT CALL UPDATE FILE LIST HERE, ALL HUNDREDS OF HIDDEN DIALOGS WILL RESPOND, CALL INVALIDATE INSTEAD
|
||||
invalidate();
|
||||
} else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
|
@ -245,7 +245,7 @@ void EditorFileDialog::_save_confirm_pressed() {
|
|||
String f = dir_access->get_current_dir().plus_file(file->get_text());
|
||||
_save_to_recent();
|
||||
hide();
|
||||
emit_signal("file_selected", f);
|
||||
emit_signal(SNAME("file_selected"), f);
|
||||
}
|
||||
|
||||
void EditorFileDialog::_post_popup() {
|
||||
|
@ -279,8 +279,8 @@ void EditorFileDialog::_post_popup() {
|
|||
}
|
||||
|
||||
if (is_visible()) {
|
||||
Ref<Texture2D> folder = item_list->get_theme_icon("folder", "FileDialog");
|
||||
const Color folder_color = item_list->get_theme_color("folder_icon_modulate", "FileDialog");
|
||||
Ref<Texture2D> folder = item_list->get_theme_icon(SNAME("folder"), SNAME("FileDialog"));
|
||||
const Color folder_color = item_list->get_theme_color(SNAME("folder_icon_modulate"), SNAME("FileDialog"));
|
||||
recent->clear();
|
||||
|
||||
bool res = access == ACCESS_RESOURCES;
|
||||
|
@ -379,7 +379,7 @@ void EditorFileDialog::_action_pressed() {
|
|||
if (files.size()) {
|
||||
_save_to_recent();
|
||||
hide();
|
||||
emit_signal("files_selected", files);
|
||||
emit_signal(SNAME("files_selected"), files);
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -390,7 +390,7 @@ void EditorFileDialog::_action_pressed() {
|
|||
if ((mode == FILE_MODE_OPEN_ANY || mode == FILE_MODE_OPEN_FILE) && dir_access->file_exists(f)) {
|
||||
_save_to_recent();
|
||||
hide();
|
||||
emit_signal("file_selected", f);
|
||||
emit_signal(SNAME("file_selected"), f);
|
||||
} else if (mode == FILE_MODE_OPEN_ANY || mode == FILE_MODE_OPEN_DIR) {
|
||||
String path = dir_access->get_current_dir();
|
||||
|
||||
|
@ -409,7 +409,7 @@ void EditorFileDialog::_action_pressed() {
|
|||
|
||||
_save_to_recent();
|
||||
hide();
|
||||
emit_signal("dir_selected", path);
|
||||
emit_signal(SNAME("dir_selected"), path);
|
||||
}
|
||||
|
||||
if (mode == FILE_MODE_SAVE_FILE) {
|
||||
|
@ -474,7 +474,7 @@ void EditorFileDialog::_action_pressed() {
|
|||
} else {
|
||||
_save_to_recent();
|
||||
hide();
|
||||
emit_signal("file_selected", f);
|
||||
emit_signal(SNAME("file_selected"), f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -563,8 +563,8 @@ void EditorFileDialog::_item_dc_selected(int p_item) {
|
|||
|
||||
if (d["dir"]) {
|
||||
dir_access->change_dir(d["name"]);
|
||||
call_deferred("_update_file_list");
|
||||
call_deferred("_update_dir");
|
||||
call_deferred(SNAME("_update_file_list"));
|
||||
call_deferred(SNAME("_update_dir"));
|
||||
|
||||
_push_history();
|
||||
|
||||
|
@ -595,16 +595,16 @@ void EditorFileDialog::_item_list_item_rmb_selected(int p_item, const Vector2 &p
|
|||
}
|
||||
|
||||
if (single_item_selected) {
|
||||
item_menu->add_icon_item(item_list->get_theme_icon("ActionCopy", "EditorIcons"), TTR("Copy Path"), ITEM_MENU_COPY_PATH);
|
||||
item_menu->add_icon_item(item_list->get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")), TTR("Copy Path"), ITEM_MENU_COPY_PATH);
|
||||
}
|
||||
if (allow_delete) {
|
||||
item_menu->add_icon_item(item_list->get_theme_icon("Remove", "EditorIcons"), TTR("Delete"), ITEM_MENU_DELETE, KEY_DELETE);
|
||||
item_menu->add_icon_item(item_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Delete"), ITEM_MENU_DELETE, KEY_DELETE);
|
||||
}
|
||||
if (single_item_selected) {
|
||||
item_menu->add_separator();
|
||||
Dictionary item_meta = item_list->get_item_metadata(p_item);
|
||||
String item_text = item_meta["dir"] ? TTR("Open in File Manager") : TTR("Show in File Manager");
|
||||
item_menu->add_icon_item(item_list->get_theme_icon("Filesystem", "EditorIcons"), item_text, ITEM_MENU_SHOW_IN_EXPLORER);
|
||||
item_menu->add_icon_item(item_list->get_theme_icon(SNAME("Filesystem"), SNAME("EditorIcons")), item_text, ITEM_MENU_SHOW_IN_EXPLORER);
|
||||
}
|
||||
|
||||
if (item_menu->get_item_count() > 0) {
|
||||
|
@ -623,11 +623,11 @@ void EditorFileDialog::_item_list_rmb_clicked(const Vector2 &p_pos) {
|
|||
item_menu->set_size(Size2(1, 1));
|
||||
|
||||
if (can_create_dir) {
|
||||
item_menu->add_icon_item(item_list->get_theme_icon("folder", "FileDialog"), TTR("New Folder..."), ITEM_MENU_NEW_FOLDER, KEY_MASK_CMD | KEY_N);
|
||||
item_menu->add_icon_item(item_list->get_theme_icon(SNAME("folder"), SNAME("FileDialog")), TTR("New Folder..."), ITEM_MENU_NEW_FOLDER, KEY_MASK_CMD | KEY_N);
|
||||
}
|
||||
item_menu->add_icon_item(item_list->get_theme_icon("Reload", "EditorIcons"), TTR("Refresh"), ITEM_MENU_REFRESH, KEY_F5);
|
||||
item_menu->add_icon_item(item_list->get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")), TTR("Refresh"), ITEM_MENU_REFRESH, KEY_F5);
|
||||
item_menu->add_separator();
|
||||
item_menu->add_icon_item(item_list->get_theme_icon("Filesystem", "EditorIcons"), TTR("Open in File Manager"), ITEM_MENU_SHOW_IN_EXPLORER);
|
||||
item_menu->add_icon_item(item_list->get_theme_icon(SNAME("Filesystem"), SNAME("EditorIcons")), TTR("Open in File Manager"), ITEM_MENU_SHOW_IN_EXPLORER);
|
||||
|
||||
item_menu->set_position(item_list->get_global_position() + p_pos);
|
||||
item_menu->popup();
|
||||
|
@ -731,11 +731,11 @@ void EditorFileDialog::update_file_list() {
|
|||
item_list->set_fixed_icon_size(Size2(thumbnail_size, thumbnail_size));
|
||||
|
||||
if (thumbnail_size < 64) {
|
||||
folder_thumbnail = item_list->get_theme_icon("FolderMediumThumb", "EditorIcons");
|
||||
file_thumbnail = item_list->get_theme_icon("FileMediumThumb", "EditorIcons");
|
||||
folder_thumbnail = item_list->get_theme_icon(SNAME("FolderMediumThumb"), SNAME("EditorIcons"));
|
||||
file_thumbnail = item_list->get_theme_icon(SNAME("FileMediumThumb"), SNAME("EditorIcons"));
|
||||
} else {
|
||||
folder_thumbnail = item_list->get_theme_icon("FolderBigThumb", "EditorIcons");
|
||||
file_thumbnail = item_list->get_theme_icon("FileBigThumb", "EditorIcons");
|
||||
folder_thumbnail = item_list->get_theme_icon(SNAME("FolderBigThumb"), SNAME("EditorIcons"));
|
||||
file_thumbnail = item_list->get_theme_icon(SNAME("FileBigThumb"), SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
preview_vb->hide();
|
||||
|
@ -755,8 +755,8 @@ void EditorFileDialog::update_file_list() {
|
|||
|
||||
dir_access->list_dir_begin();
|
||||
|
||||
Ref<Texture2D> folder = item_list->get_theme_icon("folder", "FileDialog");
|
||||
const Color folder_color = item_list->get_theme_color("folder_icon_modulate", "FileDialog");
|
||||
Ref<Texture2D> folder = item_list->get_theme_icon(SNAME("folder"), SNAME("FileDialog"));
|
||||
const Color folder_color = item_list->get_theme_color(SNAME("folder_icon_modulate"), SNAME("FileDialog"));
|
||||
List<String> files;
|
||||
List<String> dirs;
|
||||
|
||||
|
@ -1206,8 +1206,8 @@ void EditorFileDialog::_update_favorites() {
|
|||
bool res = access == ACCESS_RESOURCES;
|
||||
|
||||
String current = get_current_dir();
|
||||
Ref<Texture2D> folder_icon = item_list->get_theme_icon("Folder", "EditorIcons");
|
||||
const Color folder_color = item_list->get_theme_color("folder_icon_modulate", "FileDialog");
|
||||
Ref<Texture2D> folder_icon = item_list->get_theme_icon(SNAME("Folder"), SNAME("EditorIcons"));
|
||||
const Color folder_color = item_list->get_theme_color(SNAME("folder_icon_modulate"), SNAME("FileDialog"));
|
||||
favorites->clear();
|
||||
|
||||
favorite->set_pressed(false);
|
||||
|
|
|
@ -592,7 +592,7 @@ bool EditorFileSystem::_update_scan_actions() {
|
|||
}
|
||||
|
||||
if (reloads.size()) {
|
||||
emit_signal("resources_reload", reloads);
|
||||
emit_signal(SNAME("resources_reload"), reloads);
|
||||
}
|
||||
scan_actions.clear();
|
||||
|
||||
|
@ -623,8 +623,8 @@ void EditorFileSystem::scan() {
|
|||
new_filesystem = nullptr;
|
||||
_update_scan_actions();
|
||||
scanning = false;
|
||||
emit_signal("filesystem_changed");
|
||||
emit_signal("sources_changed", sources_changed.size() > 0);
|
||||
emit_signal(SNAME("filesystem_changed"));
|
||||
emit_signal(SNAME("sources_changed"), sources_changed.size() > 0);
|
||||
_queue_update_script_classes();
|
||||
first_scan = false;
|
||||
} else {
|
||||
|
@ -1073,12 +1073,12 @@ void EditorFileSystem::scan_changes() {
|
|||
scan_total = 0;
|
||||
_scan_fs_changes(filesystem, sp);
|
||||
if (_update_scan_actions()) {
|
||||
emit_signal("filesystem_changed");
|
||||
emit_signal(SNAME("filesystem_changed"));
|
||||
}
|
||||
}
|
||||
scanning_changes = false;
|
||||
scanning_changes_done = true;
|
||||
emit_signal("sources_changed", sources_changed.size() > 0);
|
||||
emit_signal(SNAME("sources_changed"), sources_changed.size() > 0);
|
||||
} else {
|
||||
ERR_FAIL_COND(thread_sources.is_started());
|
||||
set_process(true);
|
||||
|
@ -1092,7 +1092,7 @@ void EditorFileSystem::scan_changes() {
|
|||
void EditorFileSystem::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
call_deferred("scan"); //this should happen after every editor node entered the tree
|
||||
call_deferred(SNAME("scan")); //this should happen after every editor node entered the tree
|
||||
|
||||
} break;
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
|
@ -1128,9 +1128,9 @@ void EditorFileSystem::_notification(int p_what) {
|
|||
|
||||
thread_sources.wait_to_finish();
|
||||
if (_update_scan_actions()) {
|
||||
emit_signal("filesystem_changed");
|
||||
emit_signal(SNAME("filesystem_changed"));
|
||||
}
|
||||
emit_signal("sources_changed", sources_changed.size() > 0);
|
||||
emit_signal(SNAME("sources_changed"), sources_changed.size() > 0);
|
||||
_queue_update_script_classes();
|
||||
first_scan = false;
|
||||
}
|
||||
|
@ -1144,8 +1144,8 @@ void EditorFileSystem::_notification(int p_what) {
|
|||
new_filesystem = nullptr;
|
||||
thread.wait_to_finish();
|
||||
_update_scan_actions();
|
||||
emit_signal("filesystem_changed");
|
||||
emit_signal("sources_changed", sources_changed.size() > 0);
|
||||
emit_signal(SNAME("filesystem_changed"));
|
||||
emit_signal(SNAME("sources_changed"), sources_changed.size() > 0);
|
||||
_queue_update_script_classes();
|
||||
first_scan = false;
|
||||
}
|
||||
|
@ -1445,7 +1445,7 @@ void EditorFileSystem::_queue_update_script_classes() {
|
|||
}
|
||||
|
||||
update_script_classes_queued.set();
|
||||
call_deferred("update_script_classes");
|
||||
call_deferred(SNAME("update_script_classes"));
|
||||
}
|
||||
|
||||
void EditorFileSystem::update_file(const String &p_file) {
|
||||
|
@ -1466,7 +1466,7 @@ void EditorFileSystem::update_file(const String &p_file) {
|
|||
fs->files.remove(cpos);
|
||||
}
|
||||
|
||||
call_deferred("emit_signal", "filesystem_changed"); //update later
|
||||
call_deferred(SNAME("emit_signal"), "filesystem_changed"); //update later
|
||||
_queue_update_script_classes();
|
||||
return;
|
||||
}
|
||||
|
@ -1513,7 +1513,7 @@ void EditorFileSystem::update_file(const String &p_file) {
|
|||
// Update preview
|
||||
EditorResourcePreview::get_singleton()->check_for_invalidation(p_file);
|
||||
|
||||
call_deferred("emit_signal", "filesystem_changed"); //update later
|
||||
call_deferred(SNAME("emit_signal"), "filesystem_changed"); //update later
|
||||
_queue_update_script_classes();
|
||||
}
|
||||
|
||||
|
@ -2026,10 +2026,10 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
|
|||
_save_filesystem_cache();
|
||||
importing = false;
|
||||
if (!is_scanning()) {
|
||||
emit_signal("filesystem_changed");
|
||||
emit_signal(SNAME("filesystem_changed"));
|
||||
}
|
||||
|
||||
emit_signal("resources_reimported", p_files);
|
||||
emit_signal(SNAME("resources_reimported"), p_files);
|
||||
}
|
||||
|
||||
Error EditorFileSystem::_resource_import(const String &p_path) {
|
||||
|
|
|
@ -43,16 +43,16 @@
|
|||
DocTools *EditorHelp::doc = nullptr;
|
||||
|
||||
void EditorHelp::_init_colors() {
|
||||
title_color = get_theme_color("accent_color", "Editor");
|
||||
text_color = get_theme_color("default_color", "RichTextLabel");
|
||||
headline_color = get_theme_color("headline_color", "EditorHelp");
|
||||
title_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
text_color = get_theme_color(SNAME("default_color"), SNAME("RichTextLabel"));
|
||||
headline_color = get_theme_color(SNAME("headline_color"), SNAME("EditorHelp"));
|
||||
base_type_color = title_color.lerp(text_color, 0.5);
|
||||
comment_color = text_color * Color(1, 1, 1, 0.6);
|
||||
symbol_color = comment_color;
|
||||
value_color = text_color * Color(1, 1, 1, 0.6);
|
||||
qualifier_color = text_color * Color(1, 1, 1, 0.8);
|
||||
type_color = get_theme_color("accent_color", "Editor").lerp(text_color, 0.5);
|
||||
class_desc->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
|
||||
type_color = get_theme_color(SNAME("accent_color"), SNAME("Editor")).lerp(text_color, 0.5);
|
||||
class_desc->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4));
|
||||
class_desc->add_theme_constant_override("line_separation", Math::round(5 * EDSCALE));
|
||||
}
|
||||
|
||||
|
@ -78,10 +78,10 @@ void EditorHelp::_class_desc_select(const String &p_select) {
|
|||
} else {
|
||||
class_name = "@GlobalScope";
|
||||
}
|
||||
emit_signal("go_to_help", "class_enum:" + class_name + ":" + select);
|
||||
emit_signal(SNAME("go_to_help"), "class_enum:" + class_name + ":" + select);
|
||||
return;
|
||||
} else if (p_select.begins_with("#")) {
|
||||
emit_signal("go_to_help", "class_name:" + p_select.substr(1, p_select.length()));
|
||||
emit_signal(SNAME("go_to_help"), "class_name:" + p_select.substr(1, p_select.length()));
|
||||
return;
|
||||
} else if (p_select.begins_with("@")) {
|
||||
int tag_end = p_select.find(" ");
|
||||
|
@ -112,7 +112,7 @@ void EditorHelp::_class_desc_select(const String &p_select) {
|
|||
}
|
||||
|
||||
if (link.find(".") != -1) {
|
||||
emit_signal("go_to_help", topic + ":" + link.get_slice(".", 0) + ":" + link.get_slice(".", 1));
|
||||
emit_signal(SNAME("go_to_help"), topic + ":" + link.get_slice(".", 0) + ":" + link.get_slice(".", 1));
|
||||
} else {
|
||||
if (table->has(link)) {
|
||||
// Found in the current page
|
||||
|
@ -125,7 +125,7 @@ void EditorHelp::_class_desc_select(const String &p_select) {
|
|||
for (int i = 0; i < cd.constants.size(); i++) {
|
||||
if (cd.constants[i].enumeration == link) {
|
||||
// Found in @GlobalScope
|
||||
emit_signal("go_to_help", topic + ":@GlobalScope:" + link);
|
||||
emit_signal(SNAME("go_to_help"), topic + ":@GlobalScope:" + link);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ void EditorHelp::_class_desc_select(const String &p_select) {
|
|||
for (int i = 0; i < cd.constants.size(); i++) {
|
||||
if (cd.constants[i].name == link) {
|
||||
// Found in @GlobalScope
|
||||
emit_signal("go_to_help", topic + ":@GlobalScope:" + link);
|
||||
emit_signal(SNAME("go_to_help"), topic + ":@GlobalScope:" + link);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -154,12 +154,12 @@ void EditorHelp::_class_desc_input(const Ref<InputEvent> &p_input) {
|
|||
void EditorHelp::_class_desc_resized() {
|
||||
// Add extra horizontal margins for better readability.
|
||||
// The margins increase as the width of the editor help container increases.
|
||||
Ref<Font> doc_code_font = get_theme_font("doc_source", "EditorFonts");
|
||||
int font_size = get_theme_font_size("doc_source_size", "EditorFonts");
|
||||
Ref<Font> doc_code_font = get_theme_font(SNAME("doc_source"), SNAME("EditorFonts"));
|
||||
int font_size = get_theme_font_size(SNAME("doc_source_size"), SNAME("EditorFonts"));
|
||||
real_t char_width = doc_code_font->get_char_size('x', 0, font_size).width;
|
||||
const int display_margin = MAX(30 * EDSCALE, get_parent_anchorable_rect().size.width - char_width * 120 * EDSCALE) * 0.5;
|
||||
|
||||
Ref<StyleBox> class_desc_stylebox = EditorNode::get_singleton()->get_theme_base()->get_theme_stylebox("normal", "RichTextLabel")->duplicate();
|
||||
Ref<StyleBox> class_desc_stylebox = EditorNode::get_singleton()->get_theme_base()->get_theme_stylebox(SNAME("normal"), SNAME("RichTextLabel"))->duplicate();
|
||||
class_desc_stylebox->set_default_margin(SIDE_LEFT, display_margin);
|
||||
class_desc_stylebox->set_default_margin(SIDE_RIGHT, display_margin);
|
||||
class_desc->add_theme_style_override("normal", class_desc_stylebox);
|
||||
|
@ -179,8 +179,8 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum) {
|
|||
t = p_enum.get_slice(".", 0);
|
||||
}
|
||||
}
|
||||
const Color text_color = get_theme_color("default_color", "RichTextLabel");
|
||||
const Color type_color = get_theme_color("accent_color", "Editor").lerp(text_color, 0.5);
|
||||
const Color text_color = get_theme_color(SNAME("default_color"), SNAME("RichTextLabel"));
|
||||
const Color type_color = get_theme_color(SNAME("accent_color"), SNAME("Editor")).lerp(text_color, 0.5);
|
||||
class_desc->push_color(type_color);
|
||||
bool add_array = false;
|
||||
if (can_ref) {
|
||||
|
@ -344,10 +344,10 @@ void EditorHelp::_update_doc() {
|
|||
|
||||
DocData::ClassDoc cd = doc->class_list[edited_class]; //make a copy, so we can sort without worrying
|
||||
|
||||
Ref<Font> doc_font = get_theme_font("doc", "EditorFonts");
|
||||
Ref<Font> doc_bold_font = get_theme_font("doc_bold", "EditorFonts");
|
||||
Ref<Font> doc_title_font = get_theme_font("doc_title", "EditorFonts");
|
||||
Ref<Font> doc_code_font = get_theme_font("doc_source", "EditorFonts");
|
||||
Ref<Font> doc_font = get_theme_font(SNAME("doc"), SNAME("EditorFonts"));
|
||||
Ref<Font> doc_bold_font = get_theme_font(SNAME("doc_bold"), SNAME("EditorFonts"));
|
||||
Ref<Font> doc_title_font = get_theme_font(SNAME("doc_title"), SNAME("EditorFonts"));
|
||||
Ref<Font> doc_code_font = get_theme_font(SNAME("doc_source"), SNAME("EditorFonts"));
|
||||
String link_color_text = title_color.to_html(false);
|
||||
|
||||
// Class name
|
||||
|
@ -1177,7 +1177,7 @@ void EditorHelp::_update_doc() {
|
|||
if (!cd.properties[i].description.strip_edges().is_empty()) {
|
||||
_add_text(DTR(cd.properties[i].description));
|
||||
} else {
|
||||
class_desc->add_image(get_theme_icon("Error", "EditorIcons"));
|
||||
class_desc->add_image(get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
|
||||
class_desc->add_text(" ");
|
||||
class_desc->push_color(comment_color);
|
||||
if (cd.is_script_doc) {
|
||||
|
@ -1232,7 +1232,7 @@ void EditorHelp::_update_doc() {
|
|||
if (!methods_filtered[i].description.strip_edges().is_empty()) {
|
||||
_add_text(DTR(methods_filtered[i].description));
|
||||
} else {
|
||||
class_desc->add_image(get_theme_icon("Error", "EditorIcons"));
|
||||
class_desc->add_image(get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
|
||||
class_desc->add_text(" ");
|
||||
class_desc->push_color(comment_color);
|
||||
if (cd.is_script_doc) {
|
||||
|
@ -1319,21 +1319,21 @@ void EditorHelp::_help_callback(const String &p_topic) {
|
|||
}
|
||||
}
|
||||
|
||||
class_desc->call_deferred("scroll_to_line", line);
|
||||
class_desc->call_deferred(SNAME("scroll_to_line"), line);
|
||||
}
|
||||
|
||||
static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
|
||||
DocTools *doc = EditorHelp::get_doc_data();
|
||||
String base_path;
|
||||
|
||||
Ref<Font> doc_font = p_rt->get_theme_font("doc", "EditorFonts");
|
||||
Ref<Font> doc_bold_font = p_rt->get_theme_font("doc_bold", "EditorFonts");
|
||||
Ref<Font> doc_code_font = p_rt->get_theme_font("doc_source", "EditorFonts");
|
||||
Ref<Font> doc_kbd_font = p_rt->get_theme_font("doc_keyboard", "EditorFonts");
|
||||
Ref<Font> doc_font = p_rt->get_theme_font(SNAME("doc"), SNAME("EditorFonts"));
|
||||
Ref<Font> doc_bold_font = p_rt->get_theme_font(SNAME("doc_bold"), SNAME("EditorFonts"));
|
||||
Ref<Font> doc_code_font = p_rt->get_theme_font(SNAME("doc_source"), SNAME("EditorFonts"));
|
||||
Ref<Font> doc_kbd_font = p_rt->get_theme_font(SNAME("doc_keyboard"), SNAME("EditorFonts"));
|
||||
|
||||
Color headline_color = p_rt->get_theme_color("headline_color", "EditorHelp");
|
||||
Color accent_color = p_rt->get_theme_color("accent_color", "Editor");
|
||||
Color property_color = p_rt->get_theme_color("property_color", "Editor");
|
||||
Color headline_color = p_rt->get_theme_color(SNAME("headline_color"), SNAME("EditorHelp"));
|
||||
Color accent_color = p_rt->get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color property_color = p_rt->get_theme_color(SNAME("property_color"), SNAME("Editor"));
|
||||
Color link_color = accent_color.lerp(headline_color, 0.8);
|
||||
Color code_color = accent_color.lerp(headline_color, 0.6);
|
||||
Color kbd_color = accent_color.lerp(property_color, 0.6);
|
||||
|
@ -1667,7 +1667,7 @@ EditorHelp::EditorHelp() {
|
|||
class_desc = memnew(RichTextLabel);
|
||||
add_child(class_desc);
|
||||
class_desc->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
class_desc->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
|
||||
class_desc->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4));
|
||||
|
||||
class_desc->connect("meta_clicked", callable_mp(this, &EditorHelp::_class_desc_select));
|
||||
class_desc->connect("gui_input", callable_mp(this, &EditorHelp::_class_desc_input));
|
||||
|
@ -1693,7 +1693,7 @@ EditorHelp::~EditorHelp() {
|
|||
void EditorHelpBit::_go_to_help(String p_what) {
|
||||
EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);
|
||||
ScriptEditor::get_singleton()->goto_help(p_what);
|
||||
emit_signal("request_hide");
|
||||
emit_signal(SNAME("request_hide"));
|
||||
}
|
||||
|
||||
void EditorHelpBit::_meta_clicked(String p_select) {
|
||||
|
@ -1733,7 +1733,7 @@ void EditorHelpBit::_notification(int p_what) {
|
|||
|
||||
} break;
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
rich_text->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
|
||||
rich_text->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4));
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1750,7 +1750,7 @@ EditorHelpBit::EditorHelpBit() {
|
|||
rich_text = memnew(RichTextLabel);
|
||||
add_child(rich_text);
|
||||
rich_text->connect("meta_clicked", callable_mp(this, &EditorHelpBit::_meta_clicked));
|
||||
rich_text->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
|
||||
rich_text->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4));
|
||||
rich_text->set_override_selected_font_color(false);
|
||||
set_custom_minimum_size(Size2(0, 70 * EDSCALE));
|
||||
}
|
||||
|
@ -1812,13 +1812,13 @@ void FindBar::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
find_prev->set_icon(get_theme_icon("MoveUp", "EditorIcons"));
|
||||
find_next->set_icon(get_theme_icon("MoveDown", "EditorIcons"));
|
||||
hide_button->set_normal_texture(get_theme_icon("Close", "EditorIcons"));
|
||||
hide_button->set_hover_texture(get_theme_icon("Close", "EditorIcons"));
|
||||
hide_button->set_pressed_texture(get_theme_icon("Close", "EditorIcons"));
|
||||
find_prev->set_icon(get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons")));
|
||||
find_next->set_icon(get_theme_icon(SNAME("MoveDown"), SNAME("EditorIcons")));
|
||||
hide_button->set_normal_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
hide_button->set_hover_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
hide_button->set_pressed_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size());
|
||||
matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor"));
|
||||
matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
} break;
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
set_process_unhandled_input(is_visible_in_tree());
|
||||
|
@ -1891,7 +1891,7 @@ void FindBar::_update_matches_label() {
|
|||
} else {
|
||||
matches_label->show();
|
||||
|
||||
matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor"));
|
||||
matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,11 +36,11 @@
|
|||
#include "editor_scale.h"
|
||||
|
||||
void EditorHelpSearch::_update_icons() {
|
||||
search_box->set_right_icon(results_tree->get_theme_icon("Search", "EditorIcons"));
|
||||
search_box->set_right_icon(results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
search_box->set_clear_button_enabled(true);
|
||||
search_box->add_theme_icon_override("right_icon", results_tree->get_theme_icon("Search", "EditorIcons"));
|
||||
case_sensitive_button->set_icon(results_tree->get_theme_icon("MatchCase", "EditorIcons"));
|
||||
hierarchy_button->set_icon(results_tree->get_theme_icon("ClassList", "EditorIcons"));
|
||||
search_box->add_theme_icon_override("right_icon", results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
case_sensitive_button->set_icon(results_tree->get_theme_icon(SNAME("MatchCase"), SNAME("EditorIcons")));
|
||||
hierarchy_button->set_icon(results_tree->get_theme_icon(SNAME("ClassList"), SNAME("EditorIcons")));
|
||||
|
||||
if (is_visible()) {
|
||||
_update_results();
|
||||
|
@ -95,7 +95,7 @@ void EditorHelpSearch::_confirmed() {
|
|||
// Activate the script editor and emit the signal with the documentation link to display.
|
||||
EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);
|
||||
|
||||
emit_signal("go_to_help", item->get_metadata(0));
|
||||
emit_signal(SNAME("go_to_help"), item->get_metadata(0));
|
||||
|
||||
hide();
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ void EditorHelpSearch::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
if (!is_visible()) {
|
||||
results_tree->call_deferred("clear"); // Wait for the Tree's mouse event propagation.
|
||||
results_tree->call_deferred(SNAME("clear")); // Wait for the Tree's mouse event propagation.
|
||||
get_ok_button()->set_disabled(true);
|
||||
EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "search_help", Rect2(get_position(), get_size()));
|
||||
}
|
||||
|
@ -506,7 +506,7 @@ TreeItem *EditorHelpSearch::Runner::_create_class_item(TreeItem *p_parent, const
|
|||
if (ui_service->has_theme_icon(p_doc->name, "EditorIcons")) {
|
||||
icon = ui_service->get_theme_icon(p_doc->name, "EditorIcons");
|
||||
} else if (ClassDB::class_exists(p_doc->name) && ClassDB::is_parent_class(p_doc->name, "Object")) {
|
||||
icon = ui_service->get_theme_icon("Object", "EditorIcons");
|
||||
icon = ui_service->get_theme_icon(SNAME("Object"), SNAME("EditorIcons"));
|
||||
}
|
||||
String tooltip = p_doc->brief_description.strip_edges();
|
||||
|
||||
|
@ -580,10 +580,10 @@ TreeItem *EditorHelpSearch::Runner::_create_member_item(TreeItem *p_parent, cons
|
|||
Ref<Texture2D> icon;
|
||||
String text;
|
||||
if (search_flags & SEARCH_SHOW_HIERARCHY) {
|
||||
icon = ui_service->get_theme_icon(p_icon, "EditorIcons");
|
||||
icon = ui_service->get_theme_icon(p_icon, SNAME("EditorIcons"));
|
||||
text = p_text;
|
||||
} else {
|
||||
icon = ui_service->get_theme_icon(p_icon, "EditorIcons");
|
||||
icon = ui_service->get_theme_icon(p_icon, SNAME("EditorIcons"));
|
||||
/*// In flat mode, show the class icon.
|
||||
if (ui_service->has_icon(p_class_name, "EditorIcons"))
|
||||
icon = ui_service->get_icon(p_class_name, "EditorIcons");
|
||||
|
@ -621,6 +621,6 @@ EditorHelpSearch::Runner::Runner(Control *p_icon_service, Tree *p_results_tree,
|
|||
results_tree(p_results_tree),
|
||||
term((p_search_flags & SEARCH_CASE_SENSITIVE) == 0 ? p_term.strip_edges().to_lower() : p_term.strip_edges()),
|
||||
search_flags(p_search_flags),
|
||||
empty_icon(ui_service->get_theme_icon("ArrowRight", "EditorIcons")),
|
||||
disabled_color(ui_service->get_theme_color("disabled_font_color", "Editor")) {
|
||||
empty_icon(ui_service->get_theme_icon(SNAME("ArrowRight"), SNAME("EditorIcons"))),
|
||||
disabled_color(ui_service->get_theme_color(SNAME("disabled_font_color"), SNAME("Editor"))) {
|
||||
}
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
|
||||
Size2 EditorProperty::get_minimum_size() const {
|
||||
Size2 ms;
|
||||
Ref<Font> font = get_theme_font("font", "Tree");
|
||||
int font_size = get_theme_font_size("font_size", "Tree");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
|
||||
ms.height = font->get_height(font_size);
|
||||
|
||||
for (int i = 0; i < get_child_count(); i++) {
|
||||
|
@ -66,22 +66,22 @@ Size2 EditorProperty::get_minimum_size() const {
|
|||
}
|
||||
|
||||
if (keying) {
|
||||
Ref<Texture2D> key = get_theme_icon("Key", "EditorIcons");
|
||||
ms.width += key->get_width() + get_theme_constant("hseparator", "Tree");
|
||||
Ref<Texture2D> key = get_theme_icon(SNAME("Key"), SNAME("EditorIcons"));
|
||||
ms.width += key->get_width() + get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
}
|
||||
|
||||
if (deletable) {
|
||||
Ref<Texture2D> key = get_theme_icon("Close", "EditorIcons");
|
||||
ms.width += key->get_width() + get_theme_constant("hseparator", "Tree");
|
||||
Ref<Texture2D> key = get_theme_icon(SNAME("Close"), SNAME("EditorIcons"));
|
||||
ms.width += key->get_width() + get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
}
|
||||
|
||||
if (checkable) {
|
||||
Ref<Texture2D> check = get_theme_icon("checked", "CheckBox");
|
||||
ms.width += check->get_width() + get_theme_constant("hseparation", "CheckBox") + get_theme_constant("hseparator", "Tree");
|
||||
Ref<Texture2D> check = get_theme_icon(SNAME("checked"), SNAME("CheckBox"));
|
||||
ms.width += check->get_width() + get_theme_constant(SNAME("hseparation"), SNAME("CheckBox")) + get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
}
|
||||
|
||||
if (bottom_editor != nullptr && bottom_editor->is_visible()) {
|
||||
ms.height += get_theme_constant("vseparation");
|
||||
ms.height += get_theme_constant(SNAME("vseparation"));
|
||||
Size2 bems = bottom_editor->get_combined_minimum_size();
|
||||
//bems.width += get_constant("item_margin", "Tree");
|
||||
ms.height += bems.height;
|
||||
|
@ -96,7 +96,7 @@ void EditorProperty::emit_changed(const StringName &p_property, const Variant &p
|
|||
const Variant *argptrs[4] = { &args[0], &args[1], &args[2], &args[3] };
|
||||
|
||||
cache[p_property] = p_value;
|
||||
emit_signal("property_changed", (const Variant **)argptrs, 4);
|
||||
emit_signal(SNAME("property_changed"), (const Variant **)argptrs, 4);
|
||||
}
|
||||
|
||||
void EditorProperty::_notification(int p_what) {
|
||||
|
@ -110,8 +110,8 @@ void EditorProperty::_notification(int p_what) {
|
|||
|
||||
{
|
||||
int child_room = size.width * (1.0 - split_ratio);
|
||||
Ref<Font> font = get_theme_font("font", "Tree");
|
||||
int font_size = get_theme_font_size("font_size", "Tree");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
|
||||
int height = font->get_height(font_size);
|
||||
bool no_children = true;
|
||||
|
||||
|
@ -149,21 +149,21 @@ void EditorProperty::_notification(int p_what) {
|
|||
if (bottom_editor) {
|
||||
int m = 0; //get_constant("item_margin", "Tree");
|
||||
|
||||
bottom_rect = Rect2(m, rect.size.height + get_theme_constant("vseparation"), size.width - m, bottom_editor->get_combined_minimum_size().height);
|
||||
bottom_rect = Rect2(m, rect.size.height + get_theme_constant(SNAME("vseparation")), size.width - m, bottom_editor->get_combined_minimum_size().height);
|
||||
}
|
||||
|
||||
if (keying) {
|
||||
Ref<Texture2D> key;
|
||||
|
||||
if (use_keying_next()) {
|
||||
key = get_theme_icon("KeyNext", "EditorIcons");
|
||||
key = get_theme_icon(SNAME("KeyNext"), SNAME("EditorIcons"));
|
||||
} else {
|
||||
key = get_theme_icon("Key", "EditorIcons");
|
||||
key = get_theme_icon(SNAME("Key"), SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
rect.size.x -= key->get_width() + get_theme_constant("hseparator", "Tree");
|
||||
rect.size.x -= key->get_width() + get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
if (is_layout_rtl()) {
|
||||
rect.position.x += key->get_width() + get_theme_constant("hseparator", "Tree");
|
||||
rect.position.x += key->get_width() + get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
}
|
||||
|
||||
if (no_children) {
|
||||
|
@ -174,12 +174,12 @@ void EditorProperty::_notification(int p_what) {
|
|||
if (deletable) {
|
||||
Ref<Texture2D> close;
|
||||
|
||||
close = get_theme_icon("Close", "EditorIcons");
|
||||
close = get_theme_icon(SNAME("Close"), SNAME("EditorIcons"));
|
||||
|
||||
rect.size.x -= close->get_width() + get_theme_constant("hseparator", "Tree");
|
||||
rect.size.x -= close->get_width() + get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
|
||||
if (is_layout_rtl()) {
|
||||
rect.position.x += close->get_width() + get_theme_constant("hseparator", "Tree");
|
||||
rect.position.x += close->get_width() + get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
}
|
||||
|
||||
if (no_children) {
|
||||
|
@ -214,9 +214,9 @@ void EditorProperty::_notification(int p_what) {
|
|||
}
|
||||
|
||||
if (p_what == NOTIFICATION_DRAW) {
|
||||
Ref<Font> font = get_theme_font("font", "Tree");
|
||||
int font_size = get_theme_font_size("font_size", "Tree");
|
||||
Color dark_color = get_theme_color("dark_color_2", "Editor");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
|
||||
Color dark_color = get_theme_color(SNAME("dark_color_2"), SNAME("Editor"));
|
||||
bool rtl = is_layout_rtl();
|
||||
|
||||
Size2 size = get_size();
|
||||
|
@ -228,9 +228,9 @@ void EditorProperty::_notification(int p_what) {
|
|||
|
||||
Ref<StyleBox> sb;
|
||||
if (selected) {
|
||||
sb = get_theme_stylebox("bg_selected");
|
||||
sb = get_theme_stylebox(SNAME("bg_selected"));
|
||||
} else {
|
||||
sb = get_theme_stylebox("bg");
|
||||
sb = get_theme_stylebox(SNAME("bg"));
|
||||
}
|
||||
|
||||
draw_style_box(sb, Rect2(Vector2(), size));
|
||||
|
@ -244,23 +244,23 @@ void EditorProperty::_notification(int p_what) {
|
|||
|
||||
Color color;
|
||||
if (draw_red) {
|
||||
color = get_theme_color("error_color");
|
||||
color = get_theme_color(SNAME("error_color"));
|
||||
} else {
|
||||
color = get_theme_color("property_color");
|
||||
color = get_theme_color(SNAME("property_color"));
|
||||
}
|
||||
if (label.find(".") != -1) {
|
||||
color.a = 0.5; //this should be un-hacked honestly, as it's used for editor overrides
|
||||
}
|
||||
|
||||
int ofs = get_theme_constant("font_offset");
|
||||
int ofs = get_theme_constant(SNAME("font_offset"));
|
||||
int text_limit = text_size;
|
||||
|
||||
if (checkable) {
|
||||
Ref<Texture2D> checkbox;
|
||||
if (checked) {
|
||||
checkbox = get_theme_icon("GuiChecked", "EditorIcons");
|
||||
checkbox = get_theme_icon(SNAME("GuiChecked"), SNAME("EditorIcons"));
|
||||
} else {
|
||||
checkbox = get_theme_icon("GuiUnchecked", "EditorIcons");
|
||||
checkbox = get_theme_icon(SNAME("GuiUnchecked"), SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
Color color2(1, 1, 1);
|
||||
|
@ -275,16 +275,16 @@ void EditorProperty::_notification(int p_what) {
|
|||
} else {
|
||||
draw_texture(checkbox, check_rect.position, color2);
|
||||
}
|
||||
ofs += get_theme_constant("hseparator", "Tree") + checkbox->get_width() + get_theme_constant("hseparation", "CheckBox");
|
||||
ofs += get_theme_constant(SNAME("hseparator"), SNAME("Tree")) + checkbox->get_width() + get_theme_constant(SNAME("hseparation"), SNAME("CheckBox"));
|
||||
text_limit -= ofs;
|
||||
} else {
|
||||
check_rect = Rect2();
|
||||
}
|
||||
|
||||
if (can_revert) {
|
||||
Ref<Texture2D> reload_icon = get_theme_icon("ReloadSmall", "EditorIcons");
|
||||
text_limit -= reload_icon->get_width() + get_theme_constant("hseparator", "Tree") * 2;
|
||||
revert_rect = Rect2(text_limit + get_theme_constant("hseparator", "Tree"), (size.height - reload_icon->get_height()) / 2, reload_icon->get_width(), reload_icon->get_height());
|
||||
Ref<Texture2D> reload_icon = get_theme_icon(SNAME("ReloadSmall"), SNAME("EditorIcons"));
|
||||
text_limit -= reload_icon->get_width() + get_theme_constant(SNAME("hseparator"), SNAME("Tree")) * 2;
|
||||
revert_rect = Rect2(text_limit + get_theme_constant(SNAME("hseparator"), SNAME("Tree")), (size.height - reload_icon->get_height()) / 2, reload_icon->get_width(), reload_icon->get_height());
|
||||
|
||||
Color color2(1, 1, 1);
|
||||
if (revert_hover) {
|
||||
|
@ -312,12 +312,12 @@ void EditorProperty::_notification(int p_what) {
|
|||
Ref<Texture2D> key;
|
||||
|
||||
if (use_keying_next()) {
|
||||
key = get_theme_icon("KeyNext", "EditorIcons");
|
||||
key = get_theme_icon(SNAME("KeyNext"), SNAME("EditorIcons"));
|
||||
} else {
|
||||
key = get_theme_icon("Key", "EditorIcons");
|
||||
key = get_theme_icon(SNAME("Key"), SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
ofs = size.width - key->get_width() - get_theme_constant("hseparator", "Tree");
|
||||
ofs = size.width - key->get_width() - get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
|
||||
Color color2(1, 1, 1);
|
||||
if (keying_hover) {
|
||||
|
@ -339,9 +339,9 @@ void EditorProperty::_notification(int p_what) {
|
|||
if (deletable) {
|
||||
Ref<Texture2D> close;
|
||||
|
||||
close = get_theme_icon("Close", "EditorIcons");
|
||||
close = get_theme_icon(SNAME("Close"), SNAME("EditorIcons"));
|
||||
|
||||
ofs = size.width - close->get_width() - get_theme_constant("hseparator", "Tree");
|
||||
ofs = size.width - close->get_width() - get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
|
||||
Color color2(1, 1, 1);
|
||||
if (delete_hover) {
|
||||
|
@ -646,7 +646,7 @@ void EditorProperty::_focusable_focused(int p_index) {
|
|||
selected_focusable = p_index;
|
||||
update();
|
||||
if (!already_selected && selected) {
|
||||
emit_signal("selected", property, selected_focusable);
|
||||
emit_signal(SNAME("selected"), property, selected_focusable);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -667,7 +667,7 @@ void EditorProperty::select(int p_focusable) {
|
|||
}
|
||||
|
||||
if (!already_selected && selected) {
|
||||
emit_signal("selected", property, selected_focusable);
|
||||
emit_signal(SNAME("selected"), property, selected_focusable);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -732,12 +732,12 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
|
||||
if (!selected && selectable) {
|
||||
selected = true;
|
||||
emit_signal("selected", property, -1);
|
||||
emit_signal(SNAME("selected"), property, -1);
|
||||
update();
|
||||
}
|
||||
|
||||
if (keying_rect.has_point(mpos)) {
|
||||
emit_signal("property_keyed", property, use_keying_next());
|
||||
emit_signal(SNAME("property_keyed"), property, use_keying_next());
|
||||
|
||||
if (use_keying_next()) {
|
||||
if (property == "frame_coords" && (object->is_class("Sprite2D") || object->is_class("Sprite3D"))) {
|
||||
|
@ -748,16 +748,16 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
new_coords.y++;
|
||||
}
|
||||
|
||||
call_deferred("emit_changed", property, new_coords, "", false);
|
||||
call_deferred(SNAME("emit_changed"), property, new_coords, "", false);
|
||||
} else {
|
||||
call_deferred("emit_changed", property, object->get(property).operator int64_t() + 1, "", false);
|
||||
call_deferred(SNAME("emit_changed"), property, object->get(property).operator int64_t() + 1, "", false);
|
||||
}
|
||||
|
||||
call_deferred("_update_property");
|
||||
call_deferred(SNAME("_update_property"));
|
||||
}
|
||||
}
|
||||
if (delete_rect.has_point(mpos)) {
|
||||
emit_signal("property_deleted", property);
|
||||
emit_signal(SNAME("property_deleted"), property);
|
||||
}
|
||||
|
||||
if (revert_rect.has_point(mpos)) {
|
||||
|
@ -799,7 +799,7 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
if (check_rect.has_point(mpos)) {
|
||||
checked = !checked;
|
||||
update();
|
||||
emit_signal("property_checked", property, checked);
|
||||
emit_signal(SNAME("property_checked"), property, checked);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -889,7 +889,7 @@ void EditorProperty::set_object_and_property(Object *p_object, const StringName
|
|||
Control *EditorProperty::make_custom_tooltip(const String &p_text) const {
|
||||
tooltip_text = p_text;
|
||||
EditorHelpBit *help_bit = memnew(EditorHelpBit);
|
||||
//help_bit->add_theme_style_override("panel", get_theme_stylebox("panel", "TooltipPanel"));
|
||||
//help_bit->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TooltipPanel")));
|
||||
help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE);
|
||||
|
||||
String text;
|
||||
|
@ -1076,14 +1076,14 @@ void EditorInspectorPlugin::_bind_methods() {
|
|||
|
||||
void EditorInspectorCategory::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_DRAW) {
|
||||
Ref<StyleBox> sb = get_theme_stylebox("prop_category_style", "Editor");
|
||||
Ref<StyleBox> sb = get_theme_stylebox(SNAME("prop_category_style"), SNAME("Editor"));
|
||||
|
||||
draw_style_box(sb, Rect2(Vector2(), get_size()));
|
||||
|
||||
Ref<Font> font = get_theme_font("bold", "EditorFonts");
|
||||
int font_size = get_theme_font_size("bold_size", "EditorFonts");
|
||||
Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts"));
|
||||
int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts"));
|
||||
|
||||
int hs = get_theme_constant("hseparation", "Tree");
|
||||
int hs = get_theme_constant(SNAME("hseparation"), SNAME("Tree"));
|
||||
|
||||
int w = font->get_string_size(label, font_size).width;
|
||||
if (icon.is_valid()) {
|
||||
|
@ -1097,7 +1097,7 @@ void EditorInspectorCategory::_notification(int p_what) {
|
|||
ofs += hs + icon->get_width();
|
||||
}
|
||||
|
||||
Color color = get_theme_color("font_color", "Tree");
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Tree"));
|
||||
draw_string(font, Point2(ofs, font->get_ascent(font_size) + (get_size().height - font->get_height(font_size)) / 2).floor(), label, HALIGN_LEFT, get_size().width, font_size, color);
|
||||
}
|
||||
}
|
||||
|
@ -1105,7 +1105,7 @@ void EditorInspectorCategory::_notification(int p_what) {
|
|||
Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) const {
|
||||
tooltip_text = p_text;
|
||||
EditorHelpBit *help_bit = memnew(EditorHelpBit);
|
||||
help_bit->add_theme_style_override("panel", get_theme_stylebox("panel", "TooltipPanel"));
|
||||
help_bit->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TooltipPanel")));
|
||||
help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE);
|
||||
|
||||
PackedStringArray slices = p_text.split("::", false);
|
||||
|
@ -1126,8 +1126,8 @@ Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) cons
|
|||
}
|
||||
|
||||
Size2 EditorInspectorCategory::get_minimum_size() const {
|
||||
Ref<Font> font = get_theme_font("font", "Tree");
|
||||
int font_size = get_theme_font_size("font_size", "Tree");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
|
||||
|
||||
Size2 ms;
|
||||
ms.width = 1;
|
||||
|
@ -1135,7 +1135,7 @@ Size2 EditorInspectorCategory::get_minimum_size() const {
|
|||
if (icon.is_valid()) {
|
||||
ms.height = MAX(icon->get_height(), ms.height);
|
||||
}
|
||||
ms.height += get_theme_constant("vseparation", "Tree");
|
||||
ms.height += get_theme_constant(SNAME("vseparation"), SNAME("Tree"));
|
||||
|
||||
return ms;
|
||||
}
|
||||
|
@ -1163,19 +1163,19 @@ void EditorInspectorSection::_test_unfold() {
|
|||
|
||||
void EditorInspectorSection::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_SORT_CHILDREN) {
|
||||
Ref<Font> font = get_theme_font("bold", "EditorFonts");
|
||||
int font_size = get_theme_font_size("bold_size", "EditorFonts");
|
||||
Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts"));
|
||||
int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts"));
|
||||
|
||||
Ref<Texture2D> arrow;
|
||||
|
||||
if (foldable) {
|
||||
if (object->editor_is_section_unfolded(section)) {
|
||||
arrow = get_theme_icon("arrow", "Tree");
|
||||
arrow = get_theme_icon(SNAME("arrow"), SNAME("Tree"));
|
||||
} else {
|
||||
if (is_layout_rtl()) {
|
||||
arrow = get_theme_icon("arrow_collapsed_mirrored", "Tree");
|
||||
arrow = get_theme_icon(SNAME("arrow_collapsed_mirrored"), SNAME("Tree"));
|
||||
} else {
|
||||
arrow = get_theme_icon("arrow_collapsed", "Tree");
|
||||
arrow = get_theme_icon(SNAME("arrow_collapsed"), SNAME("Tree"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1188,11 +1188,11 @@ void EditorInspectorSection::_notification(int p_what) {
|
|||
offset.y = MAX(offset.y, arrow->get_height());
|
||||
}
|
||||
|
||||
offset.y += get_theme_constant("vseparation", "Tree");
|
||||
offset.y += get_theme_constant(SNAME("vseparation"), SNAME("Tree"));
|
||||
if (is_layout_rtl()) {
|
||||
rect = Rect2(offset, size - offset - Vector2(get_theme_constant("inspector_margin", "Editor"), 0));
|
||||
rect = Rect2(offset, size - offset - Vector2(get_theme_constant(SNAME("inspector_margin"), SNAME("Editor")), 0));
|
||||
} else {
|
||||
offset.x += get_theme_constant("inspector_margin", "Editor");
|
||||
offset.x += get_theme_constant(SNAME("inspector_margin"), SNAME("Editor"));
|
||||
rect = Rect2(offset, size - offset);
|
||||
}
|
||||
|
||||
|
@ -1221,24 +1221,24 @@ void EditorInspectorSection::_notification(int p_what) {
|
|||
|
||||
if (foldable) {
|
||||
if (object->editor_is_section_unfolded(section)) {
|
||||
arrow = get_theme_icon("arrow", "Tree");
|
||||
arrow = get_theme_icon(SNAME("arrow"), SNAME("Tree"));
|
||||
} else {
|
||||
if (is_layout_rtl()) {
|
||||
arrow = get_theme_icon("arrow_collapsed_mirrored", "Tree");
|
||||
arrow = get_theme_icon(SNAME("arrow_collapsed_mirrored"), SNAME("Tree"));
|
||||
} else {
|
||||
arrow = get_theme_icon("arrow_collapsed", "Tree");
|
||||
arrow = get_theme_icon(SNAME("arrow_collapsed"), SNAME("Tree"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("bold", "EditorFonts");
|
||||
int font_size = get_theme_font_size("bold_size", "EditorFonts");
|
||||
Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts"));
|
||||
int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts"));
|
||||
|
||||
int h = font->get_height(font_size);
|
||||
if (arrow.is_valid()) {
|
||||
h = MAX(h, arrow->get_height());
|
||||
}
|
||||
h += get_theme_constant("vseparation", "Tree");
|
||||
h += get_theme_constant(SNAME("vseparation"), SNAME("Tree"));
|
||||
|
||||
Color c = bg_color;
|
||||
c.a *= 0.4;
|
||||
|
@ -1246,7 +1246,7 @@ void EditorInspectorSection::_notification(int p_what) {
|
|||
|
||||
const int arrow_margin = 2;
|
||||
const int arrow_width = arrow.is_valid() ? arrow->get_width() : 0;
|
||||
Color color = get_theme_color("font_color");
|
||||
Color color = get_theme_color(SNAME("font_color"));
|
||||
float text_width = get_size().width - Math::round(arrow_width + arrow_margin * EDSCALE);
|
||||
draw_string(font, Point2(rtl ? 0 : Math::round(arrow_width + arrow_margin * EDSCALE), font->get_ascent(font_size) + (h - font->get_height(font_size)) / 2).floor(), label, rtl ? HALIGN_RIGHT : HALIGN_LEFT, text_width, font_size, color);
|
||||
|
||||
|
@ -1259,7 +1259,7 @@ void EditorInspectorSection::_notification(int p_what) {
|
|||
}
|
||||
|
||||
if (dropping && !vbox->is_visible_in_tree()) {
|
||||
Color accent_color = get_theme_color("accent_color", "Editor");
|
||||
Color accent_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
draw_rect(Rect2(Point2(), get_size()), accent_color, false);
|
||||
}
|
||||
}
|
||||
|
@ -1319,10 +1319,10 @@ Size2 EditorInspectorSection::get_minimum_size() const {
|
|||
ms.height = MAX(ms.height, minsize.height);
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Tree");
|
||||
int font_size = get_theme_font_size("font_size", "Tree");
|
||||
ms.height += font->get_height(font_size) + get_theme_constant("vseparation", "Tree");
|
||||
ms.width += get_theme_constant("inspector_margin", "Editor");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
|
||||
ms.height += font->get_height(font_size) + get_theme_constant(SNAME("vseparation"), SNAME("Tree"));
|
||||
ms.width += get_theme_constant(SNAME("inspector_margin"), SNAME("Editor"));
|
||||
|
||||
return ms;
|
||||
}
|
||||
|
@ -1358,8 +1358,8 @@ void EditorInspectorSection::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
|
||||
Ref<InputEventMouseButton> mb = p_event;
|
||||
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MOUSE_BUTTON_LEFT) {
|
||||
Ref<Font> font = get_theme_font("font", "Tree");
|
||||
int font_size = get_theme_font_size("font_size", "Tree");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
|
||||
if (mb->get_position().y > font->get_height(font_size)) { //clicked outside
|
||||
return;
|
||||
}
|
||||
|
@ -1646,7 +1646,7 @@ void EditorInspector::update_tree() {
|
|||
|
||||
item_path[""] = main_vbox;
|
||||
|
||||
Color sscolor = get_theme_color("prop_subsection", "Editor");
|
||||
Color sscolor = get_theme_color(SNAME("prop_subsection"), SNAME("Editor"));
|
||||
|
||||
for (List<Ref<EditorInspectorPlugin>>::Element *E = valid_plugins.front(); E; E = E->next()) {
|
||||
Ref<EditorInspectorPlugin> ped = E->get();
|
||||
|
@ -1720,8 +1720,8 @@ void EditorInspector::update_tree() {
|
|||
}
|
||||
s = s->get_base_script();
|
||||
}
|
||||
if (category->icon.is_null() && has_theme_icon(base_type, "EditorIcons")) {
|
||||
category->icon = get_theme_icon(base_type, "EditorIcons");
|
||||
if (category->icon.is_null() && has_theme_icon(base_type, SNAME("EditorIcons"))) {
|
||||
category->icon = get_theme_icon(base_type, SNAME("EditorIcons"));
|
||||
}
|
||||
}
|
||||
if (category->icon.is_null()) {
|
||||
|
@ -2205,7 +2205,7 @@ void EditorInspector::_update_inspector_bg() {
|
|||
count_subinspectors = MIN(15, count_subinspectors);
|
||||
add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg" + itos(count_subinspectors), "Editor"));
|
||||
} else {
|
||||
add_theme_style_override("bg", get_theme_stylebox("bg", "Tree"));
|
||||
add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
}
|
||||
}
|
||||
void EditorInspector::set_sub_inspector(bool p_enable) {
|
||||
|
@ -2328,7 +2328,7 @@ void EditorInspector::_property_changed(const String &p_path, const Variant &p_v
|
|||
}
|
||||
|
||||
if (restart_request_props.has(p_path)) {
|
||||
emit_signal("restart_requested");
|
||||
emit_signal(SNAME("restart_requested"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2350,7 +2350,7 @@ void EditorInspector::_multiple_properties_changed(Vector<String> p_paths, Array
|
|||
for (int i = 0; i < p_paths.size(); i++) {
|
||||
_edit_set(p_paths[i], p_values[i], false, "");
|
||||
if (restart_request_props.has(p_paths[i])) {
|
||||
emit_signal("restart_requested");
|
||||
emit_signal(SNAME("restart_requested"));
|
||||
}
|
||||
}
|
||||
changing++;
|
||||
|
@ -2363,7 +2363,7 @@ void EditorInspector::_property_keyed(const String &p_path, bool p_advance) {
|
|||
return;
|
||||
}
|
||||
|
||||
emit_signal("property_keyed", p_path, object->get(p_path), p_advance); //second param is deprecated
|
||||
emit_signal(SNAME("property_keyed"), p_path, object->get(p_path), p_advance); //second param is deprecated
|
||||
}
|
||||
|
||||
void EditorInspector::_property_deleted(const String &p_path) {
|
||||
|
@ -2372,7 +2372,7 @@ void EditorInspector::_property_deleted(const String &p_path) {
|
|||
return;
|
||||
}
|
||||
|
||||
emit_signal("property_deleted", p_path); //second param is deprecated
|
||||
emit_signal(SNAME("property_deleted"), p_path); //second param is deprecated
|
||||
}
|
||||
|
||||
void EditorInspector::_property_keyed_with_value(const String &p_path, const Variant &p_value, bool p_advance) {
|
||||
|
@ -2380,7 +2380,7 @@ void EditorInspector::_property_keyed_with_value(const String &p_path, const Var
|
|||
return;
|
||||
}
|
||||
|
||||
emit_signal("property_keyed", p_path, p_value, p_advance); //second param is deprecated
|
||||
emit_signal(SNAME("property_keyed"), p_path, p_value, p_advance); //second param is deprecated
|
||||
}
|
||||
|
||||
void EditorInspector::_property_checked(const String &p_path, bool p_checked) {
|
||||
|
@ -2415,7 +2415,7 @@ void EditorInspector::_property_checked(const String &p_path, bool p_checked) {
|
|||
}
|
||||
|
||||
} else {
|
||||
emit_signal("property_toggled", p_path, p_checked);
|
||||
emit_signal(SNAME("property_toggled"), p_path, p_checked);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2434,15 +2434,15 @@ void EditorInspector::_property_selected(const String &p_path, int p_focusable)
|
|||
}
|
||||
}
|
||||
|
||||
emit_signal("property_selected", p_path);
|
||||
emit_signal(SNAME("property_selected"), p_path);
|
||||
}
|
||||
|
||||
void EditorInspector::_object_id_selected(const String &p_path, ObjectID p_id) {
|
||||
emit_signal("object_id_selected", p_id);
|
||||
emit_signal(SNAME("object_id_selected"), p_id);
|
||||
}
|
||||
|
||||
void EditorInspector::_resource_selected(const String &p_path, RES p_resource) {
|
||||
emit_signal("resource_selected", p_resource, p_path);
|
||||
emit_signal(SNAME("resource_selected"), p_resource, p_path);
|
||||
}
|
||||
|
||||
void EditorInspector::_node_removed(Node *p_node) {
|
||||
|
@ -2479,7 +2479,7 @@ void EditorInspector::_notification(int p_what) {
|
|||
|
||||
if (p_what == NOTIFICATION_PROCESS) {
|
||||
if (update_scroll_request >= 0) {
|
||||
get_v_scrollbar()->call_deferred("set_value", update_scroll_request);
|
||||
get_v_scrollbar()->call_deferred(SNAME("set_value"), update_scroll_request);
|
||||
update_scroll_request = -1;
|
||||
}
|
||||
if (refresh_countdown > 0) {
|
||||
|
|
|
@ -70,10 +70,10 @@ void EditorLayoutsDialog::ok_pressed() {
|
|||
if (layout_names->is_anything_selected()) {
|
||||
Vector<int> const selected_items = layout_names->get_selected_items();
|
||||
for (int i = 0; i < selected_items.size(); ++i) {
|
||||
emit_signal("name_confirmed", layout_names->get_item_text(selected_items[i]));
|
||||
emit_signal(SNAME("name_confirmed"), layout_names->get_item_text(selected_items[i]));
|
||||
}
|
||||
} else if (name->is_visible() && name->get_text() != "") {
|
||||
emit_signal("name_confirmed", name->get_text());
|
||||
emit_signal(SNAME("name_confirmed"), name->get_text());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,30 +60,30 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f
|
|||
void EditorLog::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
//button->set_icon(get_icon("Console","EditorIcons"));
|
||||
log->add_theme_font_override("normal_font", get_theme_font("output_source", "EditorFonts"));
|
||||
log->add_theme_font_size_override("normal_font_size", get_theme_font_size("output_source_size", "EditorFonts"));
|
||||
log->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
|
||||
log->add_theme_font_override("bold_font", get_theme_font("bold", "EditorFonts"));
|
||||
log->add_theme_font_override("normal_font", get_theme_font(SNAME("output_source"), SNAME("EditorFonts")));
|
||||
log->add_theme_font_size_override("normal_font_size", get_theme_font_size(SNAME("output_source_size"), SNAME("EditorFonts")));
|
||||
log->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4));
|
||||
log->add_theme_font_override("bold_font", get_theme_font(SNAME("bold"), SNAME("EditorFonts")));
|
||||
|
||||
type_filter_map[MSG_TYPE_STD]->toggle_button->set_icon(get_theme_icon("Popup", "EditorIcons"));
|
||||
type_filter_map[MSG_TYPE_ERROR]->toggle_button->set_icon(get_theme_icon("StatusError", "EditorIcons"));
|
||||
type_filter_map[MSG_TYPE_WARNING]->toggle_button->set_icon(get_theme_icon("StatusWarning", "EditorIcons"));
|
||||
type_filter_map[MSG_TYPE_EDITOR]->toggle_button->set_icon(get_theme_icon("Edit", "EditorIcons"));
|
||||
type_filter_map[MSG_TYPE_STD]->toggle_button->set_icon(get_theme_icon(SNAME("Popup"), SNAME("EditorIcons")));
|
||||
type_filter_map[MSG_TYPE_ERROR]->toggle_button->set_icon(get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons")));
|
||||
type_filter_map[MSG_TYPE_WARNING]->toggle_button->set_icon(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
|
||||
type_filter_map[MSG_TYPE_EDITOR]->toggle_button->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
|
||||
clear_button->set_icon(get_theme_icon("Clear", "EditorIcons"));
|
||||
copy_button->set_icon(get_theme_icon("ActionCopy", "EditorIcons"));
|
||||
collapse_button->set_icon(get_theme_icon("CombineLines", "EditorIcons"));
|
||||
show_search_button->set_icon(get_theme_icon("Search", "EditorIcons"));
|
||||
clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")));
|
||||
copy_button->set_icon(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")));
|
||||
collapse_button->set_icon(get_theme_icon(SNAME("CombineLines"), SNAME("EditorIcons")));
|
||||
show_search_button->set_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
|
||||
_load_state();
|
||||
|
||||
} else if (p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Ref<Font> df_output_code = get_theme_font("output_source", "EditorFonts");
|
||||
Ref<Font> df_output_code = get_theme_font(SNAME("output_source"), SNAME("EditorFonts"));
|
||||
if (df_output_code.is_valid()) {
|
||||
if (log != nullptr) {
|
||||
log->add_theme_font_override("normal_font", get_theme_font("output_source", "EditorFonts"));
|
||||
log->add_theme_font_size_override("normal_font_size", get_theme_font_size("output_source_size", "EditorFonts"));
|
||||
log->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
|
||||
log->add_theme_font_override("normal_font", get_theme_font(SNAME("output_source"), SNAME("EditorFonts")));
|
||||
log->add_theme_font_size_override("normal_font_size", get_theme_font_size(SNAME("output_source_size"), SNAME("EditorFonts")));
|
||||
log->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -242,22 +242,22 @@ void EditorLog::_add_log_line(LogMessage &p_message, bool p_replace_previous) {
|
|||
case MSG_TYPE_STD: {
|
||||
} break;
|
||||
case MSG_TYPE_ERROR: {
|
||||
log->push_color(get_theme_color("error_color", "Editor"));
|
||||
Ref<Texture2D> icon = get_theme_icon("Error", "EditorIcons");
|
||||
log->push_color(get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("Error"), SNAME("EditorIcons"));
|
||||
log->add_image(icon);
|
||||
log->add_text(" ");
|
||||
tool_button->set_icon(icon);
|
||||
} break;
|
||||
case MSG_TYPE_WARNING: {
|
||||
log->push_color(get_theme_color("warning_color", "Editor"));
|
||||
Ref<Texture2D> icon = get_theme_icon("Warning", "EditorIcons");
|
||||
log->push_color(get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("Warning"), SNAME("EditorIcons"));
|
||||
log->add_image(icon);
|
||||
log->add_text(" ");
|
||||
tool_button->set_icon(icon);
|
||||
} break;
|
||||
case MSG_TYPE_EDITOR: {
|
||||
// Distinguish editor messages from messages printed by the project
|
||||
log->push_color(get_theme_color("font_color", "Editor") * Color(1, 1, 1, 0.6));
|
||||
log->push_color(get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.6));
|
||||
} break;
|
||||
}
|
||||
|
||||
|
@ -336,7 +336,7 @@ EditorLog::EditorLog() {
|
|||
search_box = memnew(LineEdit);
|
||||
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
search_box->set_placeholder(TTR("Filter messages"));
|
||||
search_box->set_right_icon(get_theme_icon("Search", "EditorIcons"));
|
||||
search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
search_box->set_clear_button_enabled(true);
|
||||
search_box->set_visible(true);
|
||||
search_box->connect("text_changed", callable_mp(this, &EditorLog::_search_changed));
|
||||
|
|
|
@ -316,7 +316,7 @@ void EditorNode::_update_scene_tabs() {
|
|||
disambiguate_filenames(full_path_names, disambiguated_scene_names);
|
||||
|
||||
scene_tabs->clear_tabs();
|
||||
Ref<Texture2D> script_icon = gui_base->get_theme_icon("Script", "EditorIcons");
|
||||
Ref<Texture2D> script_icon = gui_base->get_theme_icon(SNAME("Script"), SNAME("EditorIcons"));
|
||||
for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
|
||||
Node *type_node = editor_data.get_edited_scene_root(i);
|
||||
Ref<Texture2D> icon;
|
||||
|
@ -427,7 +427,7 @@ void EditorNode::_unhandled_input(const Ref<InputEvent> &p_event) {
|
|||
} else if (ED_IS_SHORTCUT("editor/editor_script", p_event)) {
|
||||
_editor_select(EDITOR_SCRIPT);
|
||||
} else if (ED_IS_SHORTCUT("editor/editor_help", p_event)) {
|
||||
emit_signal("request_help_search", "");
|
||||
emit_signal(SNAME("request_help_search"), "");
|
||||
} else if (ED_IS_SHORTCUT("editor/editor_assetlib", p_event) && StreamPeerSSL::is_available()) {
|
||||
_editor_select(EDITOR_ASSETLIB);
|
||||
} else if (ED_IS_SHORTCUT("editor/editor_next", p_event)) {
|
||||
|
@ -553,7 +553,7 @@ void EditorNode::_notification(int p_what) {
|
|||
if (settings_changed) {
|
||||
_update_from_settings();
|
||||
settings_changed = false;
|
||||
emit_signal("project_settings_changed");
|
||||
emit_signal(SNAME("project_settings_changed"));
|
||||
}
|
||||
} break;
|
||||
|
||||
|
@ -642,17 +642,17 @@ void EditorNode::_notification(int p_what) {
|
|||
theme_base->set_theme(theme);
|
||||
gui_base->set_theme(theme);
|
||||
|
||||
gui_base->add_theme_style_override("panel", gui_base->get_theme_stylebox("Background", "EditorStyles"));
|
||||
scene_root_parent->add_theme_style_override("panel", gui_base->get_theme_stylebox("Content", "EditorStyles"));
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("panel", "TabContainer"));
|
||||
scene_tabs->add_theme_style_override("tab_selected", gui_base->get_theme_stylebox("SceneTabFG", "EditorStyles"));
|
||||
scene_tabs->add_theme_style_override("tab_unselected", gui_base->get_theme_stylebox("SceneTabBG", "EditorStyles"));
|
||||
gui_base->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles")));
|
||||
scene_root_parent->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Content"), SNAME("EditorStyles")));
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")));
|
||||
scene_tabs->add_theme_style_override("tab_selected", gui_base->get_theme_stylebox(SNAME("SceneTabFG"), SNAME("EditorStyles")));
|
||||
scene_tabs->add_theme_style_override("tab_unselected", gui_base->get_theme_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles")));
|
||||
|
||||
file_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles"));
|
||||
project_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles"));
|
||||
debug_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles"));
|
||||
settings_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles"));
|
||||
help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles"));
|
||||
file_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
|
||||
project_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
|
||||
debug_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
|
||||
settings_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
|
||||
help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
|
||||
|
||||
if (EDITOR_GET("interface/scene_tabs/resize_if_many_tabs")) {
|
||||
scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE);
|
||||
|
@ -665,7 +665,7 @@ void EditorNode::_notification(int p_what) {
|
|||
|
||||
// debugger area
|
||||
if (EditorDebuggerNode::get_singleton()->is_visible()) {
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles"));
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles")));
|
||||
}
|
||||
|
||||
// update_icons
|
||||
|
@ -683,17 +683,17 @@ void EditorNode::_notification(int p_what) {
|
|||
|
||||
_build_icon_type_cache();
|
||||
|
||||
play_button->set_icon(gui_base->get_theme_icon("MainPlay", "EditorIcons"));
|
||||
play_scene_button->set_icon(gui_base->get_theme_icon("PlayScene", "EditorIcons"));
|
||||
play_custom_scene_button->set_icon(gui_base->get_theme_icon("PlayCustom", "EditorIcons"));
|
||||
pause_button->set_icon(gui_base->get_theme_icon("Pause", "EditorIcons"));
|
||||
stop_button->set_icon(gui_base->get_theme_icon("Stop", "EditorIcons"));
|
||||
play_button->set_icon(gui_base->get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons")));
|
||||
play_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayScene"), SNAME("EditorIcons")));
|
||||
play_custom_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayCustom"), SNAME("EditorIcons")));
|
||||
pause_button->set_icon(gui_base->get_theme_icon(SNAME("Pause"), SNAME("EditorIcons")));
|
||||
stop_button->set_icon(gui_base->get_theme_icon(SNAME("Stop"), SNAME("EditorIcons")));
|
||||
|
||||
prev_scene->set_icon(gui_base->get_theme_icon("PrevScene", "EditorIcons"));
|
||||
distraction_free->set_icon(gui_base->get_theme_icon("DistractionFree", "EditorIcons"));
|
||||
scene_tab_add->set_icon(gui_base->get_theme_icon("Add", "EditorIcons"));
|
||||
prev_scene->set_icon(gui_base->get_theme_icon(SNAME("PrevScene"), SNAME("EditorIcons")));
|
||||
distraction_free->set_icon(gui_base->get_theme_icon(SNAME("DistractionFree"), SNAME("EditorIcons")));
|
||||
scene_tab_add->set_icon(gui_base->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
|
||||
bottom_panel_raise->set_icon(gui_base->get_theme_icon("ExpandBottomDock", "EditorIcons"));
|
||||
bottom_panel_raise->set_icon(gui_base->get_theme_icon(SNAME("ExpandBottomDock"), SNAME("EditorIcons")));
|
||||
|
||||
// clear_button->set_icon(gui_base->get_icon("Close", "EditorIcons")); don't have access to that node. needs to become a class property
|
||||
if (gui_base->is_layout_rtl()) {
|
||||
|
@ -705,19 +705,19 @@ void EditorNode::_notification(int p_what) {
|
|||
}
|
||||
|
||||
PopupMenu *p = help_menu->get_popup();
|
||||
p->set_item_icon(p->get_item_index(HELP_SEARCH), gui_base->get_theme_icon("HelpSearch", "EditorIcons"));
|
||||
p->set_item_icon(p->get_item_index(HELP_DOCS), gui_base->get_theme_icon("Instance", "EditorIcons"));
|
||||
p->set_item_icon(p->get_item_index(HELP_QA), gui_base->get_theme_icon("Instance", "EditorIcons"));
|
||||
p->set_item_icon(p->get_item_index(HELP_REPORT_A_BUG), gui_base->get_theme_icon("Instance", "EditorIcons"));
|
||||
p->set_item_icon(p->get_item_index(HELP_SUGGEST_A_FEATURE), gui_base->get_theme_icon("Instance", "EditorIcons"));
|
||||
p->set_item_icon(p->get_item_index(HELP_SEND_DOCS_FEEDBACK), gui_base->get_theme_icon("Instance", "EditorIcons"));
|
||||
p->set_item_icon(p->get_item_index(HELP_COMMUNITY), gui_base->get_theme_icon("Instance", "EditorIcons"));
|
||||
p->set_item_icon(p->get_item_index(HELP_ABOUT), gui_base->get_theme_icon("Godot", "EditorIcons"));
|
||||
p->set_item_icon(p->get_item_index(HELP_SUPPORT_GODOT_DEVELOPMENT), gui_base->get_theme_icon("Heart", "EditorIcons"));
|
||||
p->set_item_icon(p->get_item_index(HELP_SEARCH), gui_base->get_theme_icon(SNAME("HelpSearch"), SNAME("EditorIcons")));
|
||||
p->set_item_icon(p->get_item_index(HELP_DOCS), gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
p->set_item_icon(p->get_item_index(HELP_QA), gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
p->set_item_icon(p->get_item_index(HELP_REPORT_A_BUG), gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
p->set_item_icon(p->get_item_index(HELP_SUGGEST_A_FEATURE), gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
p->set_item_icon(p->get_item_index(HELP_SEND_DOCS_FEEDBACK), gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
p->set_item_icon(p->get_item_index(HELP_COMMUNITY), gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
p->set_item_icon(p->get_item_index(HELP_ABOUT), gui_base->get_theme_icon(SNAME("Godot"), SNAME("EditorIcons")));
|
||||
p->set_item_icon(p->get_item_index(HELP_SUPPORT_GODOT_DEVELOPMENT), gui_base->get_theme_icon(SNAME("Heart"), SNAME("EditorIcons")));
|
||||
|
||||
for (int i = 0; i < main_editor_buttons.size(); i++) {
|
||||
main_editor_buttons.write[i]->add_theme_font_override("font", gui_base->get_theme_font("main_button_font", "EditorFonts"));
|
||||
main_editor_buttons.write[i]->add_theme_font_size_override("font_size", gui_base->get_theme_font_size("main_button_font_size", "EditorFonts"));
|
||||
main_editor_buttons.write[i]->add_theme_font_override("font", gui_base->get_theme_font(SNAME("main_button_font"), SNAME("EditorFonts")));
|
||||
main_editor_buttons.write[i]->add_theme_font_size_override("font_size", gui_base->get_theme_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts")));
|
||||
}
|
||||
|
||||
_update_update_spinner();
|
||||
|
@ -972,7 +972,7 @@ void EditorNode::_scan_external_changes() {
|
|||
}
|
||||
|
||||
if (need_reload) {
|
||||
disk_changed->call_deferred("popup_centered_ratio", 0.5);
|
||||
disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1105,7 +1105,7 @@ void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const St
|
|||
}
|
||||
|
||||
((Resource *)p_resource.ptr())->set_path(path);
|
||||
emit_signal("resource_saved", p_resource);
|
||||
emit_signal(SNAME("resource_saved"), p_resource);
|
||||
editor_data.notify_resource_saved(p_resource);
|
||||
}
|
||||
|
||||
|
@ -2217,11 +2217,11 @@ void EditorNode::_run(bool p_current, const String &p_custom) {
|
|||
}
|
||||
|
||||
play_button->set_pressed(false);
|
||||
play_button->set_icon(gui_base->get_theme_icon("MainPlay", "EditorIcons"));
|
||||
play_button->set_icon(gui_base->get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons")));
|
||||
play_scene_button->set_pressed(false);
|
||||
play_scene_button->set_icon(gui_base->get_theme_icon("PlayScene", "EditorIcons"));
|
||||
play_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayScene"), SNAME("EditorIcons")));
|
||||
play_custom_scene_button->set_pressed(false);
|
||||
play_custom_scene_button->set_icon(gui_base->get_theme_icon("PlayCustom", "EditorIcons"));
|
||||
play_custom_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayCustom"), SNAME("EditorIcons")));
|
||||
|
||||
String run_filename;
|
||||
String args;
|
||||
|
@ -2294,17 +2294,17 @@ void EditorNode::_run(bool p_current, const String &p_custom) {
|
|||
return;
|
||||
}
|
||||
|
||||
emit_signal("play_pressed");
|
||||
emit_signal(SNAME("play_pressed"));
|
||||
if (p_current) {
|
||||
play_scene_button->set_pressed(true);
|
||||
play_scene_button->set_icon(gui_base->get_theme_icon("Reload", "EditorIcons"));
|
||||
play_scene_button->set_icon(gui_base->get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")));
|
||||
} else if (p_custom != "") {
|
||||
run_custom_filename = p_custom;
|
||||
play_custom_scene_button->set_pressed(true);
|
||||
play_custom_scene_button->set_icon(gui_base->get_theme_icon("Reload", "EditorIcons"));
|
||||
play_custom_scene_button->set_icon(gui_base->get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
play_button->set_pressed(true);
|
||||
play_button->set_icon(gui_base->get_theme_icon("Reload", "EditorIcons"));
|
||||
play_button->set_icon(gui_base->get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")));
|
||||
}
|
||||
stop_button->set_disabled(false);
|
||||
|
||||
|
@ -2324,7 +2324,7 @@ void EditorNode::_run_native(const Ref<EditorExportPreset> &p_preset) {
|
|||
}
|
||||
|
||||
EditorDebuggerNode::get_singleton()->start(p_preset->get_platform()->get_debug_protocol());
|
||||
emit_signal("play_pressed");
|
||||
emit_signal(SNAME("play_pressed"));
|
||||
editor_run.run_native_notify();
|
||||
}
|
||||
}
|
||||
|
@ -2639,11 +2639,11 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||
editor_run.stop();
|
||||
run_custom_filename.clear();
|
||||
play_button->set_pressed(false);
|
||||
play_button->set_icon(gui_base->get_theme_icon("MainPlay", "EditorIcons"));
|
||||
play_button->set_icon(gui_base->get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons")));
|
||||
play_scene_button->set_pressed(false);
|
||||
play_scene_button->set_icon(gui_base->get_theme_icon("PlayScene", "EditorIcons"));
|
||||
play_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayScene"), SNAME("EditorIcons")));
|
||||
play_custom_scene_button->set_pressed(false);
|
||||
play_custom_scene_button->set_icon(gui_base->get_theme_icon("PlayCustom", "EditorIcons"));
|
||||
play_custom_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayCustom"), SNAME("EditorIcons")));
|
||||
stop_button->set_disabled(true);
|
||||
|
||||
if (bool(EDITOR_GET("run/output/always_close_output_on_stop"))) {
|
||||
|
@ -2655,7 +2655,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||
}
|
||||
}
|
||||
EditorDebuggerNode::get_singleton()->stop();
|
||||
emit_signal("stop_pressed");
|
||||
emit_signal(SNAME("stop_pressed"));
|
||||
|
||||
} break;
|
||||
|
||||
|
@ -2793,7 +2793,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||
|
||||
} break;
|
||||
case HELP_SEARCH: {
|
||||
emit_signal("request_help_search", "");
|
||||
emit_signal(SNAME("request_help_search"), "");
|
||||
} break;
|
||||
case HELP_DOCS: {
|
||||
OS::get_singleton()->shell_open("https://docs.godotengine.org/");
|
||||
|
@ -3067,8 +3067,8 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed
|
|||
tb->set_icon(singleton->gui_base->get_theme_icon(p_editor->get_name(), "EditorIcons"));
|
||||
}
|
||||
|
||||
tb->add_theme_font_override("font", singleton->gui_base->get_theme_font("main_button_font", "EditorFonts"));
|
||||
tb->add_theme_font_size_override("font_size", singleton->gui_base->get_theme_font_size("main_button_font_size", "EditorFonts"));
|
||||
tb->add_theme_font_override("font", singleton->gui_base->get_theme_font(SNAME("main_button_font"), SNAME("EditorFonts")));
|
||||
tb->add_theme_font_size_override("font_size", singleton->gui_base->get_theme_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts")));
|
||||
|
||||
tb->set_name(p_editor->get_name());
|
||||
singleton->main_editor_buttons.push_back(tb);
|
||||
|
@ -3366,7 +3366,7 @@ void EditorNode::set_current_scene(int p_idx) {
|
|||
editor_folding.load_scene_folding(editor_data.get_edited_scene_root(p_idx), editor_data.get_scene_path(p_idx));
|
||||
}
|
||||
|
||||
call_deferred("_clear_undo_history");
|
||||
call_deferred(SNAME("_clear_undo_history"));
|
||||
}
|
||||
|
||||
changing_scene = true;
|
||||
|
@ -3403,7 +3403,7 @@ void EditorNode::set_current_scene(int p_idx) {
|
|||
|
||||
_update_title();
|
||||
|
||||
call_deferred("_set_main_scene_state", state, get_edited_scene()); //do after everything else is done setting up
|
||||
call_deferred(SNAME("_set_main_scene_state"), state, get_edited_scene()); //do after everything else is done setting up
|
||||
}
|
||||
|
||||
bool EditorNode::is_scene_open(const String &p_path) {
|
||||
|
@ -3650,7 +3650,7 @@ void EditorNode::_add_to_recent_scenes(const String &p_scene) {
|
|||
void EditorNode::_open_recent_scene(int p_idx) {
|
||||
if (p_idx == recent_scenes->get_item_count() - 1) {
|
||||
EditorSettings::get_singleton()->set_project_metadata("recent_files", "scenes", Array());
|
||||
call_deferred("_update_recent_scenes");
|
||||
call_deferred(SNAME("_update_recent_scenes"));
|
||||
} else {
|
||||
Array rc = EditorSettings::get_singleton()->get_project_metadata("recent_files", "scenes", Array());
|
||||
ERR_FAIL_INDEX(p_idx, rc.size());
|
||||
|
@ -3712,7 +3712,7 @@ void EditorNode::add_io_error(const String &p_error) {
|
|||
|
||||
void EditorNode::_load_error_notify(void *p_ud, const String &p_text) {
|
||||
EditorNode *en = (EditorNode *)p_ud;
|
||||
en->load_errors->add_image(en->gui_base->get_theme_icon("Error", "EditorIcons"));
|
||||
en->load_errors->add_image(en->gui_base->get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
|
||||
en->load_errors->add_text(p_text + "\n");
|
||||
en->load_error_dialog->popup_centered_ratio(0.5);
|
||||
}
|
||||
|
@ -3939,7 +3939,7 @@ Ref<Texture2D> EditorNode::get_object_icon(const Object *p_object, const String
|
|||
}
|
||||
|
||||
if (p_fallback.length()) {
|
||||
return gui_base->get_theme_icon(p_fallback, "EditorIcons");
|
||||
return gui_base->get_theme_icon(p_fallback, SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
@ -3980,12 +3980,12 @@ Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p
|
|||
}
|
||||
}
|
||||
|
||||
if (gui_base->has_theme_icon(p_class, "EditorIcons")) {
|
||||
return gui_base->get_theme_icon(p_class, "EditorIcons");
|
||||
if (gui_base->has_theme_icon(p_class, SNAME("EditorIcons"))) {
|
||||
return gui_base->get_theme_icon(p_class, SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
if (p_fallback.length() && gui_base->has_theme_icon(p_fallback, "EditorIcons")) {
|
||||
return gui_base->get_theme_icon(p_fallback, "EditorIcons");
|
||||
if (p_fallback.length() && gui_base->has_theme_icon(p_fallback, SNAME("EditorIcons"))) {
|
||||
return gui_base->get_theme_icon(p_fallback, SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
@ -4289,7 +4289,7 @@ void EditorNode::_dock_select_draw() {
|
|||
|
||||
Color used = Color(0.6, 0.6, 0.6, 0.8);
|
||||
Color used_selected = Color(0.8, 0.8, 0.8, 0.8);
|
||||
Color tab_selected = theme_base->get_theme_color("mono_color", "Editor");
|
||||
Color tab_selected = theme_base->get_theme_color(SNAME("mono_color"), SNAME("Editor"));
|
||||
Color unused = used;
|
||||
unused.a = 0.4;
|
||||
Color unusable = unused;
|
||||
|
@ -5052,9 +5052,9 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) {
|
|||
bottom_panel_items[i].control->set_visible(i == p_idx);
|
||||
}
|
||||
if (EditorDebuggerNode::get_singleton() == bottom_panel_items[p_idx].control) { // this is the debug panel which uses tabs, so the top section should be smaller
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles"));
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles")));
|
||||
} else {
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("panel", "TabContainer"));
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")));
|
||||
}
|
||||
center_split->set_dragger_visibility(SplitContainer::DRAGGER_VISIBLE);
|
||||
center_split->set_collapsed(false);
|
||||
|
@ -5064,7 +5064,7 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) {
|
|||
bottom_panel_raise->show();
|
||||
|
||||
} else {
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("panel", "TabContainer"));
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")));
|
||||
bottom_panel_items[p_idx].button->set_pressed(false);
|
||||
bottom_panel_items[p_idx].control->set_visible(false);
|
||||
center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN);
|
||||
|
@ -5153,7 +5153,7 @@ Variant EditorNode::drag_resource(const Ref<Resource> &p_res, Control *p_from) {
|
|||
|
||||
{
|
||||
//todo make proper previews
|
||||
Ref<ImageTexture> texture = gui_base->get_theme_icon("FileBigThumb", "EditorIcons");
|
||||
Ref<ImageTexture> texture = gui_base->get_theme_icon(SNAME("FileBigThumb"), SNAME("EditorIcons"));
|
||||
Ref<Image> img = texture->get_image();
|
||||
img = img->duplicate();
|
||||
img->resize(48, 48); //meh
|
||||
|
@ -5205,10 +5205,10 @@ Variant EditorNode::drag_files_and_dirs(const Vector<String> &p_paths, Control *
|
|||
|
||||
if (p_paths[i].ends_with("/")) {
|
||||
label->set_text(p_paths[i].substr(0, p_paths[i].length() - 1).get_file());
|
||||
icon->set_texture(gui_base->get_theme_icon("Folder", "EditorIcons"));
|
||||
icon->set_texture(gui_base->get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
label->set_text(p_paths[i].get_file());
|
||||
icon->set_texture(gui_base->get_theme_icon("File", "EditorIcons"));
|
||||
icon->set_texture(gui_base->get_theme_icon(SNAME("File"), SNAME("EditorIcons")));
|
||||
}
|
||||
icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
|
||||
icon->set_size(Size2(16, 16));
|
||||
|
@ -5480,7 +5480,7 @@ void EditorNode::_update_video_driver_color() {
|
|||
if (video_driver->get_text() == "GLES2") {
|
||||
video_driver->add_theme_color_override("font_color", Color::hex(0x5586a4ff));
|
||||
} else if (video_driver->get_text() == "Vulkan") {
|
||||
video_driver->add_theme_color_override("font_color", theme_base->get_theme_color("vulkan_color", "Editor"));
|
||||
video_driver->add_theme_color_override("font_color", theme_base->get_theme_color(SNAME("vulkan_color"), SNAME("Editor")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5910,7 +5910,7 @@ EditorNode::EditorNode() {
|
|||
|
||||
theme_base->set_theme(theme);
|
||||
gui_base->set_theme(theme);
|
||||
gui_base->add_theme_style_override("panel", gui_base->get_theme_stylebox("Background", "EditorStyles"));
|
||||
gui_base->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles")));
|
||||
|
||||
resource_preview = memnew(EditorResourcePreview);
|
||||
add_child(resource_preview);
|
||||
|
@ -6091,8 +6091,8 @@ EditorNode::EditorNode() {
|
|||
tab_preview_panel->add_child(tab_preview);
|
||||
|
||||
scene_tabs = memnew(Tabs);
|
||||
scene_tabs->add_theme_style_override("tab_selected", gui_base->get_theme_stylebox("SceneTabFG", "EditorStyles"));
|
||||
scene_tabs->add_theme_style_override("tab_unselected", gui_base->get_theme_stylebox("SceneTabBG", "EditorStyles"));
|
||||
scene_tabs->add_theme_style_override("tab_selected", gui_base->get_theme_stylebox(SNAME("SceneTabFG"), SNAME("EditorStyles")));
|
||||
scene_tabs->add_theme_style_override("tab_unselected", gui_base->get_theme_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles")));
|
||||
scene_tabs->set_select_with_rmb(true);
|
||||
scene_tabs->add_tab("unsaved");
|
||||
scene_tabs->set_tab_align(Tabs::ALIGN_LEFT);
|
||||
|
@ -6126,7 +6126,7 @@ EditorNode::EditorNode() {
|
|||
#endif
|
||||
distraction_free->set_tooltip(TTR("Toggle distraction-free mode."));
|
||||
distraction_free->connect("pressed", callable_mp(this, &EditorNode::_toggle_distraction_free_mode));
|
||||
distraction_free->set_icon(gui_base->get_theme_icon("DistractionFree", "EditorIcons"));
|
||||
distraction_free->set_icon(gui_base->get_theme_icon(SNAME("DistractionFree"), SNAME("EditorIcons")));
|
||||
distraction_free->set_toggle_mode(true);
|
||||
|
||||
scene_tab_add = memnew(Button);
|
||||
|
@ -6134,13 +6134,13 @@ EditorNode::EditorNode() {
|
|||
tabbar_container->add_child(scene_tab_add);
|
||||
tabbar_container->add_child(distraction_free);
|
||||
scene_tab_add->set_tooltip(TTR("Add a new scene."));
|
||||
scene_tab_add->set_icon(gui_base->get_theme_icon("Add", "EditorIcons"));
|
||||
scene_tab_add->set_icon(gui_base->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
scene_tab_add->add_theme_color_override("icon_normal_color", Color(0.6f, 0.6f, 0.6f, 0.8f));
|
||||
scene_tab_add->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(FILE_NEW_SCENE));
|
||||
|
||||
scene_root_parent = memnew(PanelContainer);
|
||||
scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE);
|
||||
scene_root_parent->add_theme_style_override("panel", gui_base->get_theme_stylebox("Content", "EditorStyles"));
|
||||
scene_root_parent->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Content"), SNAME("EditorStyles")));
|
||||
scene_root_parent->set_draw_behind_parent(true);
|
||||
srt->add_child(scene_root_parent);
|
||||
scene_root_parent->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
|
@ -6164,12 +6164,12 @@ EditorNode::EditorNode() {
|
|||
file_menu->set_flat(false);
|
||||
file_menu->set_switch_on_hover(true);
|
||||
file_menu->set_text(TTR("Scene"));
|
||||
file_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles"));
|
||||
file_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
|
||||
left_menu_hb->add_child(file_menu);
|
||||
|
||||
prev_scene = memnew(Button);
|
||||
prev_scene->set_flat(true);
|
||||
prev_scene->set_icon(gui_base->get_theme_icon("PrevScene", "EditorIcons"));
|
||||
prev_scene->set_icon(gui_base->get_theme_icon(SNAME("PrevScene"), SNAME("EditorIcons")));
|
||||
prev_scene->set_tooltip(TTR("Go to previously opened scene."));
|
||||
prev_scene->set_disabled(true);
|
||||
prev_scene->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(FILE_OPEN_PREV));
|
||||
|
@ -6268,7 +6268,7 @@ EditorNode::EditorNode() {
|
|||
project_menu->set_switch_on_hover(true);
|
||||
project_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools."));
|
||||
project_menu->set_text(TTR("Project"));
|
||||
project_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles"));
|
||||
project_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
|
||||
left_menu_hb->add_child(project_menu);
|
||||
|
||||
p = project_menu->get_popup();
|
||||
|
@ -6319,7 +6319,7 @@ EditorNode::EditorNode() {
|
|||
debug_menu->set_flat(false);
|
||||
debug_menu->set_switch_on_hover(true);
|
||||
debug_menu->set_text(TTR("Debug"));
|
||||
debug_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles"));
|
||||
debug_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
|
||||
left_menu_hb->add_child(debug_menu);
|
||||
|
||||
menu_hb->add_spacer();
|
||||
|
@ -6328,7 +6328,7 @@ EditorNode::EditorNode() {
|
|||
settings_menu->set_flat(false);
|
||||
settings_menu->set_switch_on_hover(true);
|
||||
settings_menu->set_text(TTR("Editor"));
|
||||
settings_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles"));
|
||||
settings_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
|
||||
left_menu_hb->add_child(settings_menu);
|
||||
|
||||
p = settings_menu->get_popup();
|
||||
|
@ -6381,26 +6381,26 @@ EditorNode::EditorNode() {
|
|||
help_menu->set_flat(false);
|
||||
help_menu->set_switch_on_hover(true);
|
||||
help_menu->set_text(TTR("Help"));
|
||||
help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles"));
|
||||
help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
|
||||
left_menu_hb->add_child(help_menu);
|
||||
|
||||
p = help_menu->get_popup();
|
||||
p->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option));
|
||||
#ifdef OSX_ENABLED
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon("HelpSearch", "EditorIcons"), ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_MASK_ALT | KEY_SPACE), HELP_SEARCH);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon(SNAME("HelpSearch"), SNAME("EditorIcons")), ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_MASK_ALT | KEY_SPACE), HELP_SEARCH);
|
||||
#else
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon("HelpSearch", "EditorIcons"), ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_F1), HELP_SEARCH);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon(SNAME("HelpSearch"), SNAME("EditorIcons")), ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_F1), HELP_SEARCH);
|
||||
#endif
|
||||
p->add_separator();
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/online_docs", TTR("Online Documentation")), HELP_DOCS);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/q&a", TTR("Questions & Answers")), HELP_QA);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/report_a_bug", TTR("Report a Bug")), HELP_REPORT_A_BUG);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/suggest_a_feature", TTR("Suggest a Feature")), HELP_SUGGEST_A_FEATURE);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/send_docs_feedback", TTR("Send Docs Feedback")), HELP_SEND_DOCS_FEEDBACK);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/community", TTR("Community")), HELP_COMMUNITY);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), ED_SHORTCUT("editor/online_docs", TTR("Online Documentation")), HELP_DOCS);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), ED_SHORTCUT("editor/q&a", TTR("Questions & Answers")), HELP_QA);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), ED_SHORTCUT("editor/report_a_bug", TTR("Report a Bug")), HELP_REPORT_A_BUG);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), ED_SHORTCUT("editor/suggest_a_feature", TTR("Suggest a Feature")), HELP_SUGGEST_A_FEATURE);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), ED_SHORTCUT("editor/send_docs_feedback", TTR("Send Docs Feedback")), HELP_SEND_DOCS_FEEDBACK);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), ED_SHORTCUT("editor/community", TTR("Community")), HELP_COMMUNITY);
|
||||
p->add_separator();
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon("Godot", "EditorIcons"), ED_SHORTCUT("editor/about", TTR("About Godot")), HELP_ABOUT);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon("Heart", "EditorIcons"), ED_SHORTCUT("editor/support_development", TTR("Support Godot Development")), HELP_SUPPORT_GODOT_DEVELOPMENT);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon(SNAME("Godot"), SNAME("EditorIcons")), ED_SHORTCUT("editor/about", TTR("About Godot")), HELP_ABOUT);
|
||||
p->add_icon_shortcut(gui_base->get_theme_icon(SNAME("Heart"), SNAME("EditorIcons")), ED_SHORTCUT("editor/support_development", TTR("Support Godot Development")), HELP_SUPPORT_GODOT_DEVELOPMENT);
|
||||
|
||||
HBoxContainer *play_hb = memnew(HBoxContainer);
|
||||
menu_hb->add_child(play_hb);
|
||||
|
@ -6409,7 +6409,7 @@ EditorNode::EditorNode() {
|
|||
play_button->set_flat(true);
|
||||
play_hb->add_child(play_button);
|
||||
play_button->set_toggle_mode(true);
|
||||
play_button->set_icon(gui_base->get_theme_icon("MainPlay", "EditorIcons"));
|
||||
play_button->set_icon(gui_base->get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons")));
|
||||
play_button->set_focus_mode(Control::FOCUS_NONE);
|
||||
play_button->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(RUN_PLAY));
|
||||
play_button->set_tooltip(TTR("Play the project."));
|
||||
|
@ -6422,7 +6422,7 @@ EditorNode::EditorNode() {
|
|||
pause_button = memnew(Button);
|
||||
pause_button->set_flat(true);
|
||||
pause_button->set_toggle_mode(true);
|
||||
pause_button->set_icon(gui_base->get_theme_icon("Pause", "EditorIcons"));
|
||||
pause_button->set_icon(gui_base->get_theme_icon(SNAME("Pause"), SNAME("EditorIcons")));
|
||||
pause_button->set_focus_mode(Control::FOCUS_NONE);
|
||||
pause_button->set_tooltip(TTR("Pause the scene execution for debugging."));
|
||||
pause_button->set_disabled(true);
|
||||
|
@ -6437,7 +6437,7 @@ EditorNode::EditorNode() {
|
|||
stop_button->set_flat(true);
|
||||
play_hb->add_child(stop_button);
|
||||
stop_button->set_focus_mode(Control::FOCUS_NONE);
|
||||
stop_button->set_icon(gui_base->get_theme_icon("Stop", "EditorIcons"));
|
||||
stop_button->set_icon(gui_base->get_theme_icon(SNAME("Stop"), SNAME("EditorIcons")));
|
||||
stop_button->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(RUN_STOP));
|
||||
stop_button->set_tooltip(TTR("Stop the scene."));
|
||||
stop_button->set_disabled(true);
|
||||
|
@ -6456,7 +6456,7 @@ EditorNode::EditorNode() {
|
|||
play_hb->add_child(play_scene_button);
|
||||
play_scene_button->set_toggle_mode(true);
|
||||
play_scene_button->set_focus_mode(Control::FOCUS_NONE);
|
||||
play_scene_button->set_icon(gui_base->get_theme_icon("PlayScene", "EditorIcons"));
|
||||
play_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayScene"), SNAME("EditorIcons")));
|
||||
play_scene_button->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(RUN_PLAY_SCENE));
|
||||
play_scene_button->set_tooltip(TTR("Play the edited scene."));
|
||||
#ifdef OSX_ENABLED
|
||||
|
@ -6470,7 +6470,7 @@ EditorNode::EditorNode() {
|
|||
play_hb->add_child(play_custom_scene_button);
|
||||
play_custom_scene_button->set_toggle_mode(true);
|
||||
play_custom_scene_button->set_focus_mode(Control::FOCUS_NONE);
|
||||
play_custom_scene_button->set_icon(gui_base->get_theme_icon("PlayCustom", "EditorIcons"));
|
||||
play_custom_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayCustom"), SNAME("EditorIcons")));
|
||||
play_custom_scene_button->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(RUN_PLAY_CUSTOM_SCENE));
|
||||
play_custom_scene_button->set_tooltip(TTR("Play custom scene"));
|
||||
#ifdef OSX_ENABLED
|
||||
|
@ -6486,8 +6486,8 @@ EditorNode::EditorNode() {
|
|||
video_driver = memnew(OptionButton);
|
||||
video_driver->set_focus_mode(Control::FOCUS_NONE);
|
||||
video_driver->connect("item_selected", callable_mp(this, &EditorNode::_video_driver_selected));
|
||||
video_driver->add_theme_font_override("font", gui_base->get_theme_font("bold", "EditorFonts"));
|
||||
video_driver->add_theme_font_size_override("font_size", gui_base->get_theme_font_size("bold_size", "EditorFonts"));
|
||||
video_driver->add_theme_font_override("font", gui_base->get_theme_font(SNAME("bold"), SNAME("EditorFonts")));
|
||||
video_driver->add_theme_font_size_override("font_size", gui_base->get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts")));
|
||||
// TODO: Show again when OpenGL is ported.
|
||||
video_driver->set_visible(false);
|
||||
right_menu_hb->add_child(video_driver);
|
||||
|
@ -6529,7 +6529,7 @@ EditorNode::EditorNode() {
|
|||
update_spinner = memnew(MenuButton);
|
||||
update_spinner->set_tooltip(TTR("Spins when the editor window redraws."));
|
||||
right_menu_hb->add_child(update_spinner);
|
||||
update_spinner->set_icon(gui_base->get_theme_icon("Progress1", "EditorIcons"));
|
||||
update_spinner->set_icon(gui_base->get_theme_icon(SNAME("Progress1"), SNAME("EditorIcons")));
|
||||
update_spinner->get_popup()->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option));
|
||||
p = update_spinner->get_popup();
|
||||
p->add_radio_check_item(TTR("Update Continuously"), SETTINGS_UPDATE_CONTINUOUSLY);
|
||||
|
@ -6606,7 +6606,7 @@ EditorNode::EditorNode() {
|
|||
// Bottom panels
|
||||
|
||||
bottom_panel = memnew(PanelContainer);
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("panel", "TabContainer"));
|
||||
bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")));
|
||||
center_split->add_child(bottom_panel);
|
||||
center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN);
|
||||
|
||||
|
@ -6649,7 +6649,7 @@ EditorNode::EditorNode() {
|
|||
|
||||
bottom_panel_raise = memnew(Button);
|
||||
bottom_panel_raise->set_flat(true);
|
||||
bottom_panel_raise->set_icon(gui_base->get_theme_icon("ExpandBottomDock", "EditorIcons"));
|
||||
bottom_panel_raise->set_icon(gui_base->get_theme_icon(SNAME("ExpandBottomDock"), SNAME("EditorIcons")));
|
||||
|
||||
bottom_panel_raise->set_shortcut(ED_SHORTCUT("editor/bottom_panel_expand", TTR("Expand Bottom Panel"), KEY_MASK_SHIFT | KEY_F12));
|
||||
|
||||
|
|
|
@ -180,8 +180,8 @@ void EditorPath::_notification(int p_what) {
|
|||
case NOTIFICATION_THEME_CHANGED: {
|
||||
update_path();
|
||||
|
||||
sub_objects_icon->set_texture(get_theme_icon("select_arrow", "Tree"));
|
||||
current_object_label->add_theme_font_override("font", get_theme_font("main", "EditorFonts"));
|
||||
sub_objects_icon->set_texture(get_theme_icon(SNAME("select_arrow"), SNAME("Tree")));
|
||||
current_object_label->add_theme_font_override("font", get_theme_font(SNAME("main"), SNAME("EditorFonts")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_READY: {
|
||||
|
|
|
@ -532,7 +532,7 @@ void EditorPlugin::set_force_draw_over_forwarding_enabled() {
|
|||
}
|
||||
|
||||
void EditorPlugin::notify_scene_changed(const Node *scn_root) {
|
||||
emit_signal("scene_changed", scn_root);
|
||||
emit_signal(SNAME("scene_changed"), scn_root);
|
||||
}
|
||||
|
||||
void EditorPlugin::notify_main_screen_changed(const String &screen_name) {
|
||||
|
@ -540,16 +540,16 @@ void EditorPlugin::notify_main_screen_changed(const String &screen_name) {
|
|||
return;
|
||||
}
|
||||
|
||||
emit_signal("main_screen_changed", screen_name);
|
||||
emit_signal(SNAME("main_screen_changed"), screen_name);
|
||||
last_main_screen_name = screen_name;
|
||||
}
|
||||
|
||||
void EditorPlugin::notify_scene_closed(const String &scene_filepath) {
|
||||
emit_signal("scene_closed", scene_filepath);
|
||||
emit_signal(SNAME("scene_closed"), scene_filepath);
|
||||
}
|
||||
|
||||
void EditorPlugin::notify_resource_saved(const Ref<Resource> &p_resource) {
|
||||
emit_signal("resource_saved", p_resource);
|
||||
emit_signal(SNAME("resource_saved"), p_resource);
|
||||
}
|
||||
|
||||
bool EditorPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p_event) {
|
||||
|
@ -729,13 +729,13 @@ void EditorPlugin::remove_translation_parser_plugin(const Ref<EditorTranslationP
|
|||
void EditorPlugin::add_import_plugin(const Ref<EditorImportPlugin> &p_importer) {
|
||||
ERR_FAIL_COND(!p_importer.is_valid());
|
||||
ResourceFormatImporter::get_singleton()->add_importer(p_importer);
|
||||
EditorFileSystem::get_singleton()->call_deferred("scan");
|
||||
EditorFileSystem::get_singleton()->call_deferred(SNAME("scan"));
|
||||
}
|
||||
|
||||
void EditorPlugin::remove_import_plugin(const Ref<EditorImportPlugin> &p_importer) {
|
||||
ERR_FAIL_COND(!p_importer.is_valid());
|
||||
ResourceFormatImporter::get_singleton()->remove_importer(p_importer);
|
||||
EditorFileSystem::get_singleton()->call_deferred("scan");
|
||||
EditorFileSystem::get_singleton()->call_deferred(SNAME("scan"));
|
||||
}
|
||||
|
||||
void EditorPlugin::add_export_plugin(const Ref<EditorExportPlugin> &p_exporter) {
|
||||
|
@ -854,7 +854,7 @@ void EditorPlugin::remove_debugger_plugin(const Ref<Script> &p_script) {
|
|||
}
|
||||
|
||||
void EditorPlugin::_editor_project_settings_changed() {
|
||||
emit_signal("project_settings_changed");
|
||||
emit_signal(SNAME("project_settings_changed"));
|
||||
}
|
||||
void EditorPlugin::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
|
|
|
@ -108,7 +108,7 @@ void EditorPluginSettings::update_plugins() {
|
|||
bool is_active = EditorNode::get_singleton()->is_addon_plugin_enabled(path);
|
||||
item->set_checked(3, is_active);
|
||||
item->set_editable(3, true);
|
||||
item->add_button(4, get_theme_icon("Edit", "EditorIcons"), BUTTON_PLUGIN_EDIT, false, TTR("Edit Plugin"));
|
||||
item->add_button(4, get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), BUTTON_PLUGIN_EDIT, false, TTR("Edit Plugin"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,10 +147,10 @@ void EditorPropertyMultilineText::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
Ref<Texture2D> df = get_theme_icon("DistractionFree", "EditorIcons");
|
||||
Ref<Texture2D> df = get_theme_icon(SNAME("DistractionFree"), SNAME("EditorIcons"));
|
||||
open_big_text->set_icon(df);
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
text->set_custom_minimum_size(Vector2(0, font->get_height(font_size) * 6));
|
||||
|
||||
} break;
|
||||
|
@ -276,9 +276,9 @@ void EditorPropertyTextEnum::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
edit_button->set_icon(get_theme_icon("Edit", "EditorIcons"));
|
||||
accept_button->set_icon(get_theme_icon("ImportCheck", "EditorIcons"));
|
||||
cancel_button->set_icon(get_theme_icon("ImportFail", "EditorIcons"));
|
||||
edit_button->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
accept_button->set_icon(get_theme_icon(SNAME("ImportCheck"), SNAME("EditorIcons")));
|
||||
cancel_button->set_icon(get_theme_icon(SNAME("ImportFail"), SNAME("EditorIcons")));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -386,7 +386,7 @@ void EditorPropertyPath::set_save_mode() {
|
|||
|
||||
void EditorPropertyPath::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
path_edit->set_icon(get_theme_icon("Folder", "EditorIcons"));
|
||||
path_edit->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -699,8 +699,8 @@ public:
|
|||
int hovered_index;
|
||||
|
||||
virtual Size2 get_minimum_size() const override {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
return Vector2(0, font->get_height(font_size) * 2);
|
||||
}
|
||||
|
||||
|
@ -737,7 +737,7 @@ public:
|
|||
value |= (1 << hovered_index);
|
||||
}
|
||||
|
||||
emit_signal("flag_changed", value);
|
||||
emit_signal(SNAME("flag_changed"), value);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
@ -753,7 +753,7 @@ public:
|
|||
const int h = bsize * 2 + 1;
|
||||
const int vofs = (rect.size.height - h) / 2;
|
||||
|
||||
Color color = get_theme_color("highlight_color", "Editor");
|
||||
Color color = get_theme_color(SNAME("highlight_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 2; i++) {
|
||||
Point2 ofs(4, vofs);
|
||||
if (i == 1) {
|
||||
|
@ -957,7 +957,7 @@ EditorPropertyInteger::EditorPropertyInteger() {
|
|||
///////////////////// OBJECT ID /////////////////////////
|
||||
|
||||
void EditorPropertyObjectID::_edit_pressed() {
|
||||
emit_signal("object_id_selected", get_edited_property(), get_edited_object()->get(get_edited_property()));
|
||||
emit_signal(SNAME("object_id_selected"), get_edited_property(), get_edited_object()->get(get_edited_property()));
|
||||
}
|
||||
|
||||
void EditorPropertyObjectID::update_property() {
|
||||
|
@ -1112,14 +1112,14 @@ void EditorPropertyEasing::_draw_easing() {
|
|||
|
||||
const float exp = get_edited_object()->get(get_edited_property());
|
||||
|
||||
const Ref<Font> f = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
const Color font_color = get_theme_color("font_color", "Label");
|
||||
const Ref<Font> f = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
const Color font_color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
Color line_color;
|
||||
if (dragging) {
|
||||
line_color = get_theme_color("accent_color", "Editor");
|
||||
line_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
} else {
|
||||
line_color = get_theme_color("font_color", "Label") * Color(1, 1, 1, 0.9);
|
||||
line_color = get_theme_color(SNAME("font_color"), SNAME("Label")) * Color(1, 1, 1, 0.9);
|
||||
}
|
||||
|
||||
Vector<Point2> points;
|
||||
|
@ -1205,15 +1205,15 @@ void EditorPropertyEasing::_notification(int p_what) {
|
|||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
preset->clear();
|
||||
preset->add_icon_item(get_theme_icon("CurveConstant", "EditorIcons"), "Zero", EASING_ZERO);
|
||||
preset->add_icon_item(get_theme_icon("CurveLinear", "EditorIcons"), "Linear", EASING_LINEAR);
|
||||
preset->add_icon_item(get_theme_icon("CurveIn", "EditorIcons"), "In", EASING_IN);
|
||||
preset->add_icon_item(get_theme_icon("CurveOut", "EditorIcons"), "Out", EASING_OUT);
|
||||
preset->add_icon_item(get_theme_icon(SNAME("CurveConstant"), SNAME("EditorIcons")), "Zero", EASING_ZERO);
|
||||
preset->add_icon_item(get_theme_icon(SNAME("CurveLinear"), SNAME("EditorIcons")), "Linear", EASING_LINEAR);
|
||||
preset->add_icon_item(get_theme_icon(SNAME("CurveIn"), SNAME("EditorIcons")), "In", EASING_IN);
|
||||
preset->add_icon_item(get_theme_icon(SNAME("CurveOut"), SNAME("EditorIcons")), "Out", EASING_OUT);
|
||||
if (full) {
|
||||
preset->add_icon_item(get_theme_icon("CurveInOut", "EditorIcons"), "In-Out", EASING_IN_OUT);
|
||||
preset->add_icon_item(get_theme_icon("CurveOutIn", "EditorIcons"), "Out-In", EASING_OUT_IN);
|
||||
preset->add_icon_item(get_theme_icon(SNAME("CurveInOut"), SNAME("EditorIcons")), "In-Out", EASING_IN_OUT);
|
||||
preset->add_icon_item(get_theme_icon(SNAME("CurveOutIn"), SNAME("EditorIcons")), "Out-In", EASING_OUT_IN);
|
||||
}
|
||||
easing_draw->set_custom_minimum_size(Size2(0, get_theme_font("font", "Label")->get_height(get_theme_font_size("font_size", "Label")) * 2));
|
||||
easing_draw->set_custom_minimum_size(Size2(0, get_theme_font(SNAME("font"), SNAME("Label"))->get_height(get_theme_font_size(SNAME("font_size"), SNAME("Label"))) * 2));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
@ -1273,7 +1273,7 @@ void EditorPropertyVector2::update_property() {
|
|||
|
||||
void EditorPropertyVector2::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 2; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -1360,7 +1360,7 @@ void EditorPropertyRect2::update_property() {
|
|||
|
||||
void EditorPropertyRect2::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 4; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i % 2) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -1482,7 +1482,7 @@ Vector3 EditorPropertyVector3::get_vector() {
|
|||
|
||||
void EditorPropertyVector3::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -1565,7 +1565,7 @@ void EditorPropertyVector2i::update_property() {
|
|||
|
||||
void EditorPropertyVector2i::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 2; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -1652,7 +1652,7 @@ void EditorPropertyRect2i::update_property() {
|
|||
|
||||
void EditorPropertyRect2i::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 4; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i % 2) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -1747,7 +1747,7 @@ void EditorPropertyVector3i::update_property() {
|
|||
|
||||
void EditorPropertyVector3i::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -1833,7 +1833,7 @@ void EditorPropertyPlane::update_property() {
|
|||
|
||||
void EditorPropertyPlane::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -1920,7 +1920,7 @@ void EditorPropertyQuaternion::update_property() {
|
|||
|
||||
void EditorPropertyQuaternion::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -2010,7 +2010,7 @@ void EditorPropertyAABB::update_property() {
|
|||
|
||||
void EditorPropertyAABB::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 6; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i % 3) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -2087,7 +2087,7 @@ void EditorPropertyTransform2D::update_property() {
|
|||
|
||||
void EditorPropertyTransform2D::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 6; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i % 2) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -2169,7 +2169,7 @@ void EditorPropertyBasis::update_property() {
|
|||
|
||||
void EditorPropertyBasis::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 9; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i % 3) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -2259,7 +2259,7 @@ void EditorPropertyTransform3D::update_using_transform(Transform3D p_transform)
|
|||
|
||||
void EditorPropertyTransform3D::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
for (int i = 0; i < 12; i++) {
|
||||
Color c = base;
|
||||
c.set_hsv(float(i % 3) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
|
||||
|
@ -2475,7 +2475,7 @@ void EditorPropertyNodePath::setup(const NodePath &p_base_hint, Vector<StringNam
|
|||
|
||||
void EditorPropertyNodePath::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Ref<Texture2D> t = get_theme_icon("Clear", "EditorIcons");
|
||||
Ref<Texture2D> t = get_theme_icon(SNAME("Clear"), SNAME("EditorIcons"));
|
||||
clear->set_icon(t);
|
||||
}
|
||||
}
|
||||
|
@ -2527,7 +2527,7 @@ void EditorPropertyResource::_resource_selected(const RES &p_resource) {
|
|||
get_edited_object()->editor_set_section_unfold(get_edited_property(), unfold);
|
||||
update_property();
|
||||
} else {
|
||||
emit_signal("resource_selected", get_edited_property(), p_resource);
|
||||
emit_signal(SNAME("resource_selected"), get_edited_property(), p_resource);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2580,22 +2580,22 @@ void EditorPropertyResource::_resource_changed(const RES &p_resource) {
|
|||
}
|
||||
|
||||
void EditorPropertyResource::_sub_inspector_property_keyed(const String &p_property, const Variant &p_value, bool) {
|
||||
emit_signal("property_keyed_with_value", String(get_edited_property()) + ":" + p_property, p_value, false);
|
||||
emit_signal(SNAME("property_keyed_with_value"), String(get_edited_property()) + ":" + p_property, p_value, false);
|
||||
}
|
||||
|
||||
void EditorPropertyResource::_sub_inspector_resource_selected(const RES &p_resource, const String &p_property) {
|
||||
emit_signal("resource_selected", String(get_edited_property()) + ":" + p_property, p_resource);
|
||||
emit_signal(SNAME("resource_selected"), String(get_edited_property()) + ":" + p_property, p_resource);
|
||||
}
|
||||
|
||||
void EditorPropertyResource::_sub_inspector_object_id_selected(int p_id) {
|
||||
emit_signal("object_id_selected", get_edited_property(), p_id);
|
||||
emit_signal(SNAME("object_id_selected"), get_edited_property(), p_id);
|
||||
}
|
||||
|
||||
void EditorPropertyResource::_open_editor_pressed() {
|
||||
RES res = get_edited_object()->get(get_edited_property());
|
||||
if (res.is_valid()) {
|
||||
// May clear the editor so do it deferred.
|
||||
EditorNode::get_singleton()->call_deferred("edit_item_resource", res);
|
||||
EditorNode::get_singleton()->call_deferred(SNAME("edit_item_resource"), res);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2651,18 +2651,18 @@ void EditorPropertyResource::_update_property_bg() {
|
|||
}
|
||||
count_subinspectors = MIN(15, count_subinspectors);
|
||||
|
||||
add_theme_color_override("property_color", get_theme_color("sub_inspector_property_color", "Editor"));
|
||||
add_theme_color_override("property_color", get_theme_color(SNAME("sub_inspector_property_color"), SNAME("Editor")));
|
||||
add_theme_style_override("bg_selected", get_theme_stylebox("sub_inspector_property_bg_selected" + itos(count_subinspectors), "Editor"));
|
||||
add_theme_style_override("bg", get_theme_stylebox("sub_inspector_property_bg" + itos(count_subinspectors), "Editor"));
|
||||
|
||||
add_theme_constant_override("font_offset", get_theme_constant("sub_inspector_font_offset", "Editor"));
|
||||
add_theme_constant_override("font_offset", get_theme_constant(SNAME("sub_inspector_font_offset"), SNAME("Editor")));
|
||||
add_theme_constant_override("vseparation", 0);
|
||||
} else {
|
||||
add_theme_color_override("property_color", get_theme_color("property_color", "EditorProperty"));
|
||||
add_theme_style_override("bg_selected", get_theme_stylebox("bg_selected", "EditorProperty"));
|
||||
add_theme_style_override("bg", get_theme_stylebox("bg", "EditorProperty"));
|
||||
add_theme_constant_override("vseparation", get_theme_constant("vseparation", "EditorProperty"));
|
||||
add_theme_constant_override("font_offset", get_theme_constant("font_offset", "EditorProperty"));
|
||||
add_theme_color_override("property_color", get_theme_color(SNAME("property_color"), SNAME("EditorProperty")));
|
||||
add_theme_style_override("bg_selected", get_theme_stylebox(SNAME("bg_selected"), SNAME("EditorProperty")));
|
||||
add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("EditorProperty")));
|
||||
add_theme_constant_override("vseparation", get_theme_constant(SNAME("vseparation"), SNAME("EditorProperty")));
|
||||
add_theme_constant_override("font_offset", get_theme_constant(SNAME("font_offset"), SNAME("EditorProperty")));
|
||||
}
|
||||
|
||||
updating_theme = false;
|
||||
|
@ -2760,7 +2760,7 @@ void EditorPropertyResource::update_property() {
|
|||
// Open editor directly and hide other such editors which are currently open.
|
||||
_open_editor_pressed();
|
||||
if (is_inside_tree()) {
|
||||
get_tree()->call_deferred("call_group", "_editor_resource_properties", "_fold_other_editors", this);
|
||||
get_tree()->call_deferred(SNAME("call_group"), "_editor_resource_properties", "_fold_other_editors", this);
|
||||
}
|
||||
opened_editor = true;
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ void EditorPropertyArray::_change_type_menu(int p_index) {
|
|||
}
|
||||
|
||||
void EditorPropertyArray::_object_id_selected(const StringName &p_property, ObjectID p_id) {
|
||||
emit_signal("object_id_selected", p_property, p_id);
|
||||
emit_signal(SNAME("object_id_selected"), p_property, p_id);
|
||||
}
|
||||
|
||||
void EditorPropertyArray::update_property() {
|
||||
|
@ -346,7 +346,7 @@ void EditorPropertyArray::update_property() {
|
|||
vbox->add_child(hbox);
|
||||
|
||||
Button *reorder_button = memnew(Button);
|
||||
reorder_button->set_icon(get_theme_icon("TripleBar", "EditorIcons"));
|
||||
reorder_button->set_icon(get_theme_icon(SNAME("TripleBar"), SNAME("EditorIcons")));
|
||||
reorder_button->set_default_cursor_shape(Control::CURSOR_MOVE);
|
||||
reorder_button->connect("gui_input", callable_mp(this, &EditorPropertyArray::_reorder_button_gui_input));
|
||||
reorder_button->connect("button_down", callable_mp(this, &EditorPropertyArray::_reorder_button_down), varray(i + offset));
|
||||
|
@ -383,12 +383,12 @@ void EditorPropertyArray::update_property() {
|
|||
|
||||
if (is_untyped_array) {
|
||||
Button *edit = memnew(Button);
|
||||
edit->set_icon(get_theme_icon("Edit", "EditorIcons"));
|
||||
edit->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
hbox->add_child(edit);
|
||||
edit->connect("pressed", callable_mp(this, &EditorPropertyArray::_change_type), varray(edit, i + offset));
|
||||
} else {
|
||||
Button *remove = memnew(Button);
|
||||
remove->set_icon(get_theme_icon("Remove", "EditorIcons"));
|
||||
remove->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
remove->connect("pressed", callable_mp(this, &EditorPropertyArray::_remove_pressed), varray(i + offset));
|
||||
hbox->add_child(remove);
|
||||
}
|
||||
|
@ -421,7 +421,7 @@ void EditorPropertyArray::_remove_pressed(int p_index) {
|
|||
|
||||
void EditorPropertyArray::_button_draw() {
|
||||
if (dropping) {
|
||||
Color color = get_theme_color("accent_color", "Editor");
|
||||
Color color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
edit->draw_rect(Rect2(Point2(), edit->get_size()), color, false);
|
||||
}
|
||||
}
|
||||
|
@ -1070,7 +1070,7 @@ void EditorPropertyDictionary::update_property() {
|
|||
for (int j = 0; j < 4; j++) {
|
||||
flat->set_default_margin(Side(j), 2 * EDSCALE);
|
||||
}
|
||||
flat->set_bg_color(get_theme_color("prop_subsection", "Editor"));
|
||||
flat->set_bg_color(get_theme_color(SNAME("prop_subsection"), SNAME("Editor")));
|
||||
|
||||
pc->add_theme_style_override("panel", flat);
|
||||
add_vbox = memnew(VBoxContainer);
|
||||
|
@ -1105,7 +1105,7 @@ void EditorPropertyDictionary::update_property() {
|
|||
hbox->add_child(prop);
|
||||
prop->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
Button *edit = memnew(Button);
|
||||
edit->set_icon(get_theme_icon("Edit", "EditorIcons"));
|
||||
edit->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
hbox->add_child(edit);
|
||||
edit->connect("pressed", callable_mp(this, &EditorPropertyDictionary::_change_type), varray(edit, change_index));
|
||||
|
||||
|
@ -1131,7 +1131,7 @@ void EditorPropertyDictionary::update_property() {
|
|||
}
|
||||
|
||||
void EditorPropertyDictionary::_object_id_selected(const StringName &p_property, ObjectID p_id) {
|
||||
emit_signal("object_id_selected", p_property, p_id);
|
||||
emit_signal(SNAME("object_id_selected"), p_property, p_id);
|
||||
}
|
||||
|
||||
void EditorPropertyDictionary::_notification(int p_what) {
|
||||
|
|
|
@ -76,7 +76,7 @@ void EditorResourcePicker::_update_resource_preview(const String &p_path, const
|
|||
}
|
||||
|
||||
if (p_preview.is_valid()) {
|
||||
preview_rect->set_offset(SIDE_LEFT, assign_button->get_icon()->get_width() + assign_button->get_theme_stylebox("normal")->get_default_margin(SIDE_LEFT) + get_theme_constant("hseparation", "Button"));
|
||||
preview_rect->set_offset(SIDE_LEFT, assign_button->get_icon()->get_width() + assign_button->get_theme_stylebox(SNAME("normal"))->get_default_margin(SIDE_LEFT) + get_theme_constant(SNAME("hseparation"), SNAME("Button")));
|
||||
|
||||
if (type == "GradientTexture") {
|
||||
preview_rect->set_stretch_mode(TextureRect::STRETCH_SCALE);
|
||||
|
@ -100,7 +100,7 @@ void EditorResourcePicker::_resource_selected() {
|
|||
return;
|
||||
}
|
||||
|
||||
emit_signal("resource_selected", edited_resource);
|
||||
emit_signal(SNAME("resource_selected"), edited_resource);
|
||||
}
|
||||
|
||||
void EditorResourcePicker::_file_selected(const String &p_path) {
|
||||
|
@ -125,7 +125,7 @@ void EditorResourcePicker::_file_selected(const String &p_path) {
|
|||
}
|
||||
|
||||
edited_resource = loaded_resource;
|
||||
emit_signal("resource_changed", edited_resource);
|
||||
emit_signal(SNAME("resource_changed"), edited_resource);
|
||||
_update_resource();
|
||||
}
|
||||
|
||||
|
@ -148,14 +148,14 @@ void EditorResourcePicker::_update_menu_items() {
|
|||
set_create_options(edit_menu);
|
||||
|
||||
// Add an option to load a resource from a file.
|
||||
edit_menu->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Load"), OBJ_MENU_LOAD);
|
||||
edit_menu->add_icon_item(get_theme_icon(SNAME("Load"), SNAME("EditorIcons")), TTR("Load"), OBJ_MENU_LOAD);
|
||||
|
||||
// Add options for changing existing value of the resource.
|
||||
if (edited_resource.is_valid()) {
|
||||
edit_menu->add_icon_item(get_theme_icon("Edit", "EditorIcons"), TTR("Edit"), OBJ_MENU_EDIT);
|
||||
edit_menu->add_icon_item(get_theme_icon("Clear", "EditorIcons"), TTR("Clear"), OBJ_MENU_CLEAR);
|
||||
edit_menu->add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), TTR("Make Unique"), OBJ_MENU_MAKE_UNIQUE);
|
||||
edit_menu->add_icon_item(get_theme_icon("Save", "EditorIcons"), TTR("Save"), OBJ_MENU_SAVE);
|
||||
edit_menu->add_icon_item(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), TTR("Edit"), OBJ_MENU_EDIT);
|
||||
edit_menu->add_icon_item(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")), TTR("Clear"), OBJ_MENU_CLEAR);
|
||||
edit_menu->add_icon_item(get_theme_icon(SNAME("Duplicate"), SNAME("EditorIcons")), TTR("Make Unique"), OBJ_MENU_MAKE_UNIQUE);
|
||||
edit_menu->add_icon_item(get_theme_icon(SNAME("Save"), SNAME("EditorIcons")), TTR("Save"), OBJ_MENU_SAVE);
|
||||
|
||||
if (edited_resource->get_path().is_resource_file()) {
|
||||
edit_menu->add_separator();
|
||||
|
@ -200,10 +200,10 @@ void EditorResourcePicker::_update_menu_items() {
|
|||
for (int i = 0; i < conversions.size(); i++) {
|
||||
String what = conversions[i]->converts_to();
|
||||
Ref<Texture2D> icon;
|
||||
if (has_theme_icon(what, "EditorIcons")) {
|
||||
icon = get_theme_icon(what, "EditorIcons");
|
||||
if (has_theme_icon(what, SNAME("EditorIcons"))) {
|
||||
icon = get_theme_icon(what, SNAME("EditorIcons"));
|
||||
} else {
|
||||
icon = get_theme_icon(what, "Resource");
|
||||
icon = get_theme_icon(what, SNAME("Resource"));
|
||||
}
|
||||
|
||||
edit_menu->add_icon_item(icon, vformat(TTR("Convert to %s"), what), CONVERT_BASE_ID + i);
|
||||
|
@ -242,13 +242,13 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
|
|||
|
||||
case OBJ_MENU_EDIT: {
|
||||
if (edited_resource.is_valid()) {
|
||||
emit_signal("resource_selected", edited_resource);
|
||||
emit_signal(SNAME("resource_selected"), edited_resource);
|
||||
}
|
||||
} break;
|
||||
|
||||
case OBJ_MENU_CLEAR: {
|
||||
edited_resource = RES();
|
||||
emit_signal("resource_changed", edited_resource);
|
||||
emit_signal(SNAME("resource_changed"), edited_resource);
|
||||
_update_resource();
|
||||
} break;
|
||||
|
||||
|
@ -282,7 +282,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
|
|||
}
|
||||
|
||||
edited_resource = unique_resource;
|
||||
emit_signal("resource_changed", edited_resource);
|
||||
emit_signal(SNAME("resource_changed"), edited_resource);
|
||||
_update_resource();
|
||||
} break;
|
||||
|
||||
|
@ -299,7 +299,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
|
|||
|
||||
case OBJ_MENU_PASTE: {
|
||||
edited_resource = EditorSettings::get_singleton()->get_resource_clipboard();
|
||||
emit_signal("resource_changed", edited_resource);
|
||||
emit_signal(SNAME("resource_changed"), edited_resource);
|
||||
_update_resource();
|
||||
} break;
|
||||
|
||||
|
@ -324,7 +324,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
|
|||
ERR_FAIL_INDEX(to_type, conversions.size());
|
||||
|
||||
edited_resource = conversions[to_type]->convert(edited_resource);
|
||||
emit_signal("resource_changed", edited_resource);
|
||||
emit_signal(SNAME("resource_changed"), edited_resource);
|
||||
_update_resource();
|
||||
break;
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
|
|||
ERR_BREAK(!resp);
|
||||
|
||||
edited_resource = RES(resp);
|
||||
emit_signal("resource_changed", edited_resource);
|
||||
emit_signal(SNAME("resource_changed"), edited_resource);
|
||||
_update_resource();
|
||||
} break;
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ void EditorResourcePicker::set_create_options(Object *p_menu_node) {
|
|||
inheritors_array.push_back(t);
|
||||
|
||||
if (!icon.is_valid()) {
|
||||
icon = get_theme_icon(has_theme_icon(t, "EditorIcons") ? t : "Object", "EditorIcons");
|
||||
icon = get_theme_icon(has_theme_icon(t, SNAME("EditorIcons")) ? t : String("Object"), SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
int id = TYPE_BASE_ID + idx;
|
||||
|
@ -429,7 +429,7 @@ bool EditorResourcePicker::handle_menu_selected(int p_which) {
|
|||
|
||||
void EditorResourcePicker::_button_draw() {
|
||||
if (dropping) {
|
||||
Color color = get_theme_color("accent_color", "Editor");
|
||||
Color color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
assign_button->draw_rect(Rect2(Point2(), assign_button->get_size()), color, false);
|
||||
}
|
||||
}
|
||||
|
@ -620,7 +620,7 @@ void EditorResourcePicker::drop_data_fw(const Point2 &p_point, const Variant &p_
|
|||
}
|
||||
|
||||
edited_resource = dropped_resource;
|
||||
emit_signal("resource_changed", edited_resource);
|
||||
emit_signal(SNAME("resource_changed"), edited_resource);
|
||||
_update_resource();
|
||||
}
|
||||
}
|
||||
|
@ -661,11 +661,11 @@ void EditorResourcePicker::_notification(int p_what) {
|
|||
[[fallthrough]];
|
||||
}
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
edit_button->set_icon(get_theme_icon("select_arrow", "Tree"));
|
||||
edit_button->set_icon(get_theme_icon(SNAME("select_arrow"), SNAME("Tree")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_DRAW: {
|
||||
draw_style_box(get_theme_stylebox("bg", "Tree"), Rect2(Point2(), get_size()));
|
||||
draw_style_box(get_theme_stylebox(SNAME("bg"), SNAME("Tree")), Rect2(Point2(), get_size()));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_DRAG_BEGIN: {
|
||||
|
@ -827,8 +827,8 @@ void EditorScriptPicker::set_create_options(Object *p_menu_node) {
|
|||
return;
|
||||
}
|
||||
|
||||
menu_node->add_icon_item(get_theme_icon("ScriptCreate", "EditorIcons"), TTR("New Script"), OBJ_MENU_NEW_SCRIPT);
|
||||
menu_node->add_icon_item(get_theme_icon("ScriptExtend", "EditorIcons"), TTR("Extend Script"), OBJ_MENU_EXTEND_SCRIPT);
|
||||
menu_node->add_icon_item(get_theme_icon(SNAME("ScriptCreate"), SNAME("EditorIcons")), TTR("New Script"), OBJ_MENU_NEW_SCRIPT);
|
||||
menu_node->add_icon_item(get_theme_icon(SNAME("ScriptExtend"), SNAME("EditorIcons")), TTR("Extend Script"), OBJ_MENU_EXTEND_SCRIPT);
|
||||
menu_node->add_separator();
|
||||
}
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref<
|
|||
}
|
||||
r_texture = generated;
|
||||
|
||||
int small_thumbnail_size = EditorNode::get_singleton()->get_theme_base()->get_theme_icon("Object", "EditorIcons")->get_width(); // Kind of a workaround to retrieve the default icon size
|
||||
int small_thumbnail_size = EditorNode::get_singleton()->get_theme_base()->get_theme_icon(SNAME("Object"), SNAME("EditorIcons"))->get_width(); // Kind of a workaround to retrieve the default icon size
|
||||
|
||||
if (preview_generators[i]->can_generate_small_preview()) {
|
||||
Ref<Texture2D> generated_small;
|
||||
|
@ -419,7 +419,7 @@ void EditorResourcePreview::check_for_invalidation(const String &p_path) {
|
|||
}
|
||||
|
||||
if (call_invalidated) { //do outside mutex
|
||||
call_deferred("emit_signal", "preview_invalidated", p_path);
|
||||
call_deferred(SNAME("emit_signal"), "preview_invalidated", p_path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ void EditorRunNative::_run_native(int p_idx, int p_platform) {
|
|||
return;
|
||||
}
|
||||
|
||||
emit_signal("native_run", preset);
|
||||
emit_signal(SNAME("native_run"), preset);
|
||||
|
||||
int flags = 0;
|
||||
|
||||
|
|
|
@ -250,8 +250,8 @@ void SectionedInspector::update_category_list() {
|
|||
|
||||
for (int i = 0; i < sc; i++) {
|
||||
TreeItem *parent = section_map[metasection];
|
||||
//parent->set_custom_bg_color(0, get_theme_color("prop_subsection", "Editor"));
|
||||
parent->set_custom_font(0, get_theme_font("bold", "EditorFonts"));
|
||||
//parent->set_custom_bg_color(0, get_theme_color(SNAME("prop_subsection"), SNAME("Editor")));
|
||||
parent->set_custom_font(0, get_theme_font(SNAME("bold"), SNAME("EditorFonts")));
|
||||
|
||||
if (i > 0) {
|
||||
metasection += "/" + sectionarr[i];
|
||||
|
|
|
@ -63,7 +63,7 @@ bool EditorSettings::_set(const StringName &p_name, const Variant &p_value) {
|
|||
|
||||
bool changed = _set_only(p_name, p_value);
|
||||
if (changed) {
|
||||
emit_signal("settings_changed");
|
||||
emit_signal(SNAME("settings_changed"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1344,7 +1344,7 @@ void EditorSettings::load_text_editor_theme() {
|
|||
}
|
||||
}
|
||||
}
|
||||
emit_signal("settings_changed");
|
||||
emit_signal(SNAME("settings_changed"));
|
||||
// if it doesn't load just use what is currently loaded
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
}
|
||||
} else if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_UP || mb->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN) {
|
||||
if (grabber->is_visible()) {
|
||||
call_deferred("update");
|
||||
call_deferred(SNAME("update"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ void EditorSpinSlider::_update_value_input_stylebox() {
|
|||
// when it's edited. The LineEdit "focus" stylebox uses the "normal" stylebox's
|
||||
// default margins.
|
||||
Ref<StyleBoxFlat> stylebox =
|
||||
EditorNode::get_singleton()->get_theme_base()->get_theme_stylebox("normal", "LineEdit")->duplicate();
|
||||
EditorNode::get_singleton()->get_theme_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"))->duplicate();
|
||||
// EditorSpinSliders with a label have more space on the left, so add an
|
||||
// higher margin to match the location where the text begins.
|
||||
// The margin values below were determined by empirical testing.
|
||||
|
@ -229,19 +229,19 @@ void EditorSpinSlider::_notification(int p_what) {
|
|||
bool rtl = is_layout_rtl();
|
||||
Vector2 size = get_size();
|
||||
|
||||
Ref<StyleBox> sb = get_theme_stylebox("normal", "LineEdit");
|
||||
Ref<StyleBox> sb = get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"));
|
||||
if (!flat) {
|
||||
draw_style_box(sb, Rect2(Vector2(), size));
|
||||
}
|
||||
Ref<Font> font = get_theme_font("font", "LineEdit");
|
||||
int font_size = get_theme_font_size("font_size", "LineEdit");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("LineEdit"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("LineEdit"));
|
||||
int sep_base = 4 * EDSCALE;
|
||||
int sep = sep_base + sb->get_offset().x; //make it have the same margin on both sides, looks better
|
||||
|
||||
int label_width = font->get_string_size(label, font_size).width;
|
||||
int number_width = size.width - sb->get_minimum_size().width - label_width - sep;
|
||||
|
||||
Ref<Texture2D> updown = get_theme_icon("updown", "SpinBox");
|
||||
Ref<Texture2D> updown = get_theme_icon(SNAME("updown"), SNAME("SpinBox"));
|
||||
|
||||
if (get_step() == 1) {
|
||||
number_width -= updown->get_width();
|
||||
|
@ -251,7 +251,7 @@ void EditorSpinSlider::_notification(int p_what) {
|
|||
|
||||
int vofs = (size.height - font->get_height(font_size)) / 2 + font->get_ascent(font_size);
|
||||
|
||||
Color fc = get_theme_color("font_color", "LineEdit");
|
||||
Color fc = get_theme_color(SNAME("font_color"), SNAME("LineEdit"));
|
||||
Color lc;
|
||||
if (use_custom_label_color) {
|
||||
lc = custom_label_color;
|
||||
|
@ -260,7 +260,7 @@ void EditorSpinSlider::_notification(int p_what) {
|
|||
}
|
||||
|
||||
if (flat && label != String()) {
|
||||
Color label_bg_color = get_theme_color("dark_color_3", "Editor");
|
||||
Color label_bg_color = get_theme_color(SNAME("dark_color_3"), SNAME("Editor"));
|
||||
if (rtl) {
|
||||
draw_rect(Rect2(Vector2(size.width - (sb->get_offset().x * 2 + label_width), 0), Vector2(sb->get_offset().x * 2 + label_width, size.height)), label_bg_color);
|
||||
} else {
|
||||
|
@ -269,7 +269,7 @@ void EditorSpinSlider::_notification(int p_what) {
|
|||
}
|
||||
|
||||
if (has_focus()) {
|
||||
Ref<StyleBox> focus = get_theme_stylebox("focus", "LineEdit");
|
||||
Ref<StyleBox> focus = get_theme_stylebox(SNAME("focus"), SNAME("LineEdit"));
|
||||
draw_style_box(focus, Rect2(Vector2(), size));
|
||||
}
|
||||
|
||||
|
@ -307,7 +307,7 @@ void EditorSpinSlider::_notification(int p_what) {
|
|||
TS->free(num_rid);
|
||||
|
||||
if (get_step() == 1) {
|
||||
Ref<Texture2D> updown2 = get_theme_icon("updown", "SpinBox");
|
||||
Ref<Texture2D> updown2 = get_theme_icon(SNAME("updown"), SNAME("SpinBox"));
|
||||
int updown_vofs = (size.height - updown2->get_height()) / 2;
|
||||
if (rtl) {
|
||||
updown_offset = sb->get_margin(SIDE_LEFT);
|
||||
|
@ -350,9 +350,9 @@ void EditorSpinSlider::_notification(int p_what) {
|
|||
if (display_grabber) {
|
||||
Ref<Texture2D> grabber_tex;
|
||||
if (mouse_over_grabber) {
|
||||
grabber_tex = get_theme_icon("grabber_highlight", "HSlider");
|
||||
grabber_tex = get_theme_icon(SNAME("grabber_highlight"), SNAME("HSlider"));
|
||||
} else {
|
||||
grabber_tex = get_theme_icon("grabber", "HSlider");
|
||||
grabber_tex = get_theme_icon(SNAME("grabber"), SNAME("HSlider"));
|
||||
}
|
||||
|
||||
if (grabber->get_texture() != grabber_tex) {
|
||||
|
@ -395,9 +395,9 @@ LineEdit *EditorSpinSlider::get_line_edit() {
|
|||
}
|
||||
|
||||
Size2 EditorSpinSlider::get_minimum_size() const {
|
||||
Ref<StyleBox> sb = get_theme_stylebox("normal", "LineEdit");
|
||||
Ref<Font> font = get_theme_font("font", "LineEdit");
|
||||
int font_size = get_theme_font_size("font_size", "LineEdit");
|
||||
Ref<StyleBox> sb = get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"));
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("LineEdit"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("LineEdit"));
|
||||
|
||||
Size2 ms = sb->get_minimum_size();
|
||||
ms.height += font->get_height(font_size);
|
||||
|
@ -529,9 +529,9 @@ void EditorSpinSlider::_focus_entered() {
|
|||
value_input->set_text(get_text_value());
|
||||
value_input_popup->set_position(gr.position);
|
||||
value_input_popup->set_size(gr.size);
|
||||
value_input_popup->call_deferred("popup");
|
||||
value_input->call_deferred("grab_focus");
|
||||
value_input->call_deferred("select_all");
|
||||
value_input_popup->call_deferred(SNAME("popup"));
|
||||
value_input->call_deferred(SNAME("grab_focus"));
|
||||
value_input->call_deferred(SNAME("select_all"));
|
||||
value_input->set_focus_next(find_next_valid_focus()->get_path());
|
||||
value_input->set_focus_previous(find_prev_valid_focus()->get_path());
|
||||
}
|
||||
|
|
|
@ -996,7 +996,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
|||
theme->set_stylebox("DebuggerPanel", "EditorStyles", style_panel_debugger);
|
||||
|
||||
Ref<StyleBoxFlat> style_panel_invisible_top = style_content_panel->duplicate();
|
||||
int stylebox_offset = theme->get_font("tab_selected", "TabContainer")->get_height(theme->get_font_size("tab_selected", "TabContainer")) + theme->get_stylebox("tab_selected", "TabContainer")->get_minimum_size().height + theme->get_stylebox("panel", "TabContainer")->get_default_margin(SIDE_TOP);
|
||||
int stylebox_offset = theme->get_font("tab_selected", "TabContainer")->get_height(theme->get_font_size("tab_selected", "TabContainer")) + theme->get_stylebox(SNAME("tab_selected"), SNAME("TabContainer"))->get_minimum_size().height + theme->get_stylebox(SNAME("panel"), SNAME("TabContainer"))->get_default_margin(SIDE_TOP);
|
||||
style_panel_invisible_top->set_expand_margin_size(SIDE_TOP, -stylebox_offset);
|
||||
style_panel_invisible_top->set_default_margin(SIDE_TOP, 0);
|
||||
theme->set_stylebox("BottomPanelDebuggerOverride", "EditorStyles", style_panel_invisible_top);
|
||||
|
|
|
@ -52,17 +52,17 @@ void EditorZoomWidget::_update_zoom_label() {
|
|||
|
||||
void EditorZoomWidget::_button_zoom_minus() {
|
||||
set_zoom_by_increments(-6, Input::get_singleton()->is_key_pressed(KEY_ALT));
|
||||
emit_signal("zoom_changed", zoom);
|
||||
emit_signal(SNAME("zoom_changed"), zoom);
|
||||
}
|
||||
|
||||
void EditorZoomWidget::_button_zoom_reset() {
|
||||
set_zoom(1.0 * MAX(1, EDSCALE));
|
||||
emit_signal("zoom_changed", zoom);
|
||||
emit_signal(SNAME("zoom_changed"), zoom);
|
||||
}
|
||||
|
||||
void EditorZoomWidget::_button_zoom_plus() {
|
||||
set_zoom_by_increments(6, Input::get_singleton()->is_key_pressed(KEY_ALT));
|
||||
emit_signal("zoom_changed", zoom);
|
||||
emit_signal(SNAME("zoom_changed"), zoom);
|
||||
}
|
||||
|
||||
float EditorZoomWidget::get_zoom() {
|
||||
|
@ -145,8 +145,8 @@ void EditorZoomWidget::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
zoom_minus->set_icon(get_theme_icon("ZoomLess", "EditorIcons"));
|
||||
zoom_plus->set_icon(get_theme_icon("ZoomMore", "EditorIcons"));
|
||||
zoom_minus->set_icon(get_theme_icon(SNAME("ZoomLess"), SNAME("EditorIcons")));
|
||||
zoom_plus->set_icon(get_theme_icon(SNAME("ZoomMore"), SNAME("EditorIcons")));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -106,8 +106,8 @@ void ExportTemplateManager::_update_template_status() {
|
|||
TreeItem *ti = installed_table->create_item(installed_root);
|
||||
ti->set_text(0, version_string);
|
||||
|
||||
ti->add_button(0, get_theme_icon("Folder", "EditorIcons"), OPEN_TEMPLATE_FOLDER, false, TTR("Open the folder containing these templates."));
|
||||
ti->add_button(0, get_theme_icon("Remove", "EditorIcons"), UNINSTALL_TEMPLATE, false, TTR("Uninstall these templates."));
|
||||
ti->add_button(0, get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")), OPEN_TEMPLATE_FOLDER, false, TTR("Open the folder containing these templates."));
|
||||
ti->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), UNINSTALL_TEMPLATE, false, TTR("Uninstall these templates."));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -352,9 +352,9 @@ void ExportTemplateManager::_set_current_progress_status(const String &p_status,
|
|||
download_progress_label->set_text(p_status);
|
||||
|
||||
if (p_error) {
|
||||
download_progress_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor"));
|
||||
download_progress_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
} else {
|
||||
download_progress_label->add_theme_color_override("font_color", get_theme_color("font_color", "Label"));
|
||||
download_progress_label->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), SNAME("Label")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -739,11 +739,11 @@ void ExportTemplateManager::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
current_value->add_theme_font_override("font", get_theme_font("main", "EditorFonts"));
|
||||
current_missing_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor"));
|
||||
current_installed_label->add_theme_color_override("font_color", get_theme_color("disabled_font_color", "Editor"));
|
||||
current_value->add_theme_font_override("font", get_theme_font(SNAME("main"), SNAME("EditorFonts")));
|
||||
current_missing_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
current_installed_label->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
|
||||
|
||||
mirror_options_button->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons"));
|
||||
mirror_options_button->set_icon(get_theme_icon(SNAME("GuiTabMenu"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
|
|
|
@ -50,9 +50,9 @@
|
|||
Ref<Texture2D> FileSystemDock::_get_tree_item_icon(bool p_is_valid, String p_file_type) {
|
||||
Ref<Texture2D> file_icon;
|
||||
if (!p_is_valid) {
|
||||
file_icon = get_theme_icon("ImportFail", "EditorIcons");
|
||||
file_icon = get_theme_icon(SNAME("ImportFail"), SNAME("EditorIcons"));
|
||||
} else {
|
||||
file_icon = (has_theme_icon(p_file_type, "EditorIcons")) ? get_theme_icon(p_file_type, "EditorIcons") : get_theme_icon("File", "EditorIcons");
|
||||
file_icon = (has_theme_icon(p_file_type, SNAME("EditorIcons"))) ? get_theme_icon(p_file_type, SNAME("EditorIcons")) : get_theme_icon(SNAME("File"), SNAME("EditorIcons"));
|
||||
}
|
||||
return file_icon;
|
||||
}
|
||||
|
@ -69,8 +69,8 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory
|
|||
|
||||
subdirectory_item->set_text(0, dname);
|
||||
subdirectory_item->set_structured_text_bidi_override(0, STRUCTURED_TEXT_FILE);
|
||||
subdirectory_item->set_icon(0, get_theme_icon("Folder", "EditorIcons"));
|
||||
subdirectory_item->set_icon_modulate(0, get_theme_color("folder_icon_modulate", "FileDialog"));
|
||||
subdirectory_item->set_icon(0, get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
subdirectory_item->set_icon_modulate(0, get_theme_color(SNAME("folder_icon_modulate"), SNAME("FileDialog")));
|
||||
subdirectory_item->set_selectable(0, true);
|
||||
String lpath = p_dir->get_path();
|
||||
subdirectory_item->set_metadata(0, lpath);
|
||||
|
@ -149,7 +149,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory
|
|||
file_item->set_as_cursor(0);
|
||||
}
|
||||
if (main_scene == file_metadata) {
|
||||
file_item->set_custom_color(0, get_theme_color("accent_color", "Editor"));
|
||||
file_item->set_custom_color(0, get_theme_color(SNAME("accent_color"), SNAME("Editor")));
|
||||
}
|
||||
Array udata;
|
||||
udata.push_back(tree_update_id);
|
||||
|
@ -215,7 +215,7 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo
|
|||
|
||||
// Handles the favorites.
|
||||
TreeItem *favorites = tree->create_item(root);
|
||||
favorites->set_icon(0, get_theme_icon("Favorites", "EditorIcons"));
|
||||
favorites->set_icon(0, get_theme_icon(SNAME("Favorites"), SNAME("EditorIcons")));
|
||||
favorites->set_text(0, TTR("Favorites:"));
|
||||
favorites->set_metadata(0, "Favorites");
|
||||
favorites->set_collapsed(p_uncollapsed_paths.find("Favorites") < 0);
|
||||
|
@ -227,8 +227,8 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo
|
|||
continue;
|
||||
}
|
||||
|
||||
Ref<Texture2D> folder_icon = get_theme_icon("Folder", "EditorIcons");
|
||||
const Color folder_color = get_theme_color("folder_icon_modulate", "FileDialog");
|
||||
Ref<Texture2D> folder_icon = get_theme_icon(SNAME("Folder"), SNAME("EditorIcons"));
|
||||
const Color folder_color = get_theme_color(SNAME("folder_icon_modulate"), SNAME("FileDialog"));
|
||||
|
||||
String text;
|
||||
Ref<Texture2D> icon;
|
||||
|
@ -248,7 +248,7 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo
|
|||
if (dir) {
|
||||
icon = _get_tree_item_icon(dir->get_file_import_is_valid(index), dir->get_file_type(index));
|
||||
} else {
|
||||
icon = get_theme_icon("File", "EditorIcons");
|
||||
icon = get_theme_icon(SNAME("File"), SNAME("EditorIcons"));
|
||||
}
|
||||
color = Color(1, 1, 1);
|
||||
}
|
||||
|
@ -339,28 +339,28 @@ void FileSystemDock::_notification(int p_what) {
|
|||
|
||||
String ei = "EditorIcons";
|
||||
|
||||
button_reload->set_icon(get_theme_icon("Reload", ei));
|
||||
button_toggle_display_mode->set_icon(get_theme_icon("Panels2", ei));
|
||||
button_reload->set_icon(get_theme_icon(SNAME("Reload"), ei));
|
||||
button_toggle_display_mode->set_icon(get_theme_icon(SNAME("Panels2"), ei));
|
||||
button_file_list_display_mode->connect("pressed", callable_mp(this, &FileSystemDock::_toggle_file_display));
|
||||
|
||||
files->connect("item_activated", callable_mp(this, &FileSystemDock::_file_list_activate_file));
|
||||
button_hist_next->connect("pressed", callable_mp(this, &FileSystemDock::_fw_history));
|
||||
button_hist_prev->connect("pressed", callable_mp(this, &FileSystemDock::_bw_history));
|
||||
|
||||
tree_search_box->set_right_icon(get_theme_icon("Search", ei));
|
||||
tree_search_box->set_right_icon(get_theme_icon(SNAME("Search"), ei));
|
||||
tree_search_box->set_clear_button_enabled(true);
|
||||
tree_button_sort->set_icon(get_theme_icon("Sort", ei));
|
||||
tree_button_sort->set_icon(get_theme_icon(SNAME("Sort"), ei));
|
||||
|
||||
file_list_search_box->set_right_icon(get_theme_icon("Search", ei));
|
||||
file_list_search_box->set_right_icon(get_theme_icon(SNAME("Search"), ei));
|
||||
file_list_search_box->set_clear_button_enabled(true);
|
||||
file_list_button_sort->set_icon(get_theme_icon("Sort", ei));
|
||||
file_list_button_sort->set_icon(get_theme_icon(SNAME("Sort"), ei));
|
||||
|
||||
if (is_layout_rtl()) {
|
||||
button_hist_next->set_icon(get_theme_icon("Back", ei));
|
||||
button_hist_prev->set_icon(get_theme_icon("Forward", ei));
|
||||
button_hist_next->set_icon(get_theme_icon(SNAME("Back"), ei));
|
||||
button_hist_prev->set_icon(get_theme_icon(SNAME("Forward"), ei));
|
||||
} else {
|
||||
button_hist_next->set_icon(get_theme_icon("Forward", ei));
|
||||
button_hist_prev->set_icon(get_theme_icon("Back", ei));
|
||||
button_hist_next->set_icon(get_theme_icon(SNAME("Forward"), ei));
|
||||
button_hist_prev->set_icon(get_theme_icon(SNAME("Back"), ei));
|
||||
}
|
||||
file_list_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_file_list_rmb_option));
|
||||
tree_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_tree_rmb_option));
|
||||
|
@ -412,28 +412,28 @@ void FileSystemDock::_notification(int p_what) {
|
|||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
// Update icons.
|
||||
String ei = "EditorIcons";
|
||||
button_reload->set_icon(get_theme_icon("Reload", ei));
|
||||
button_toggle_display_mode->set_icon(get_theme_icon("Panels2", ei));
|
||||
button_reload->set_icon(get_theme_icon(SNAME("Reload"), ei));
|
||||
button_toggle_display_mode->set_icon(get_theme_icon(SNAME("Panels2"), ei));
|
||||
if (is_layout_rtl()) {
|
||||
button_hist_next->set_icon(get_theme_icon("Back", ei));
|
||||
button_hist_prev->set_icon(get_theme_icon("Forward", ei));
|
||||
button_hist_next->set_icon(get_theme_icon(SNAME("Back"), ei));
|
||||
button_hist_prev->set_icon(get_theme_icon(SNAME("Forward"), ei));
|
||||
} else {
|
||||
button_hist_next->set_icon(get_theme_icon("Forward", ei));
|
||||
button_hist_prev->set_icon(get_theme_icon("Back", ei));
|
||||
button_hist_next->set_icon(get_theme_icon(SNAME("Forward"), ei));
|
||||
button_hist_prev->set_icon(get_theme_icon(SNAME("Back"), ei));
|
||||
}
|
||||
if (file_list_display_mode == FILE_LIST_DISPLAY_LIST) {
|
||||
button_file_list_display_mode->set_icon(get_theme_icon("FileThumbnail", "EditorIcons"));
|
||||
button_file_list_display_mode->set_icon(get_theme_icon(SNAME("FileThumbnail"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
button_file_list_display_mode->set_icon(get_theme_icon("FileList", "EditorIcons"));
|
||||
button_file_list_display_mode->set_icon(get_theme_icon(SNAME("FileList"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
tree_search_box->set_right_icon(get_theme_icon("Search", ei));
|
||||
tree_search_box->set_right_icon(get_theme_icon(SNAME("Search"), ei));
|
||||
tree_search_box->set_clear_button_enabled(true);
|
||||
tree_button_sort->set_icon(get_theme_icon("Sort", ei));
|
||||
tree_button_sort->set_icon(get_theme_icon(SNAME("Sort"), ei));
|
||||
|
||||
file_list_search_box->set_right_icon(get_theme_icon("Search", ei));
|
||||
file_list_search_box->set_right_icon(get_theme_icon(SNAME("Search"), ei));
|
||||
file_list_search_box->set_clear_button_enabled(true);
|
||||
file_list_button_sort->set_icon(get_theme_icon("Sort", ei));
|
||||
file_list_button_sort->set_icon(get_theme_icon(SNAME("Sort"), ei));
|
||||
|
||||
// Update always show folders.
|
||||
bool new_always_show_folders = bool(EditorSettings::get_singleton()->get("docks/filesystem/always_show_folders"));
|
||||
|
@ -451,7 +451,7 @@ void FileSystemDock::_notification(int p_what) {
|
|||
void FileSystemDock::_tree_multi_selected(Object *p_item, int p_column, bool p_selected) {
|
||||
// Update the import dock.
|
||||
import_dock_needs_update = true;
|
||||
call_deferred("_update_import_dock");
|
||||
call_deferred(SNAME("_update_import_dock"));
|
||||
|
||||
// Return if we don't select something new.
|
||||
if (!p_selected) {
|
||||
|
@ -581,17 +581,17 @@ void FileSystemDock::_tree_thumbnail_done(const String &p_path, const Ref<Textur
|
|||
|
||||
void FileSystemDock::_toggle_file_display() {
|
||||
_set_file_display(file_list_display_mode != FILE_LIST_DISPLAY_LIST);
|
||||
emit_signal("display_mode_changed");
|
||||
emit_signal(SNAME("display_mode_changed"));
|
||||
}
|
||||
|
||||
void FileSystemDock::_set_file_display(bool p_active) {
|
||||
if (p_active) {
|
||||
file_list_display_mode = FILE_LIST_DISPLAY_LIST;
|
||||
button_file_list_display_mode->set_icon(get_theme_icon("FileThumbnail", "EditorIcons"));
|
||||
button_file_list_display_mode->set_icon(get_theme_icon(SNAME("FileThumbnail"), SNAME("EditorIcons")));
|
||||
button_file_list_display_mode->set_tooltip(TTR("View items as a grid of thumbnails."));
|
||||
} else {
|
||||
file_list_display_mode = FILE_LIST_DISPLAY_THUMBNAILS;
|
||||
button_file_list_display_mode->set_icon(get_theme_icon("FileList", "EditorIcons"));
|
||||
button_file_list_display_mode->set_icon(get_theme_icon(SNAME("FileList"), SNAME("EditorIcons")));
|
||||
button_file_list_display_mode->set_tooltip(TTR("View items as a list."));
|
||||
}
|
||||
|
||||
|
@ -733,13 +733,13 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) {
|
|||
files->set_fixed_icon_size(Size2(thumbnail_size, thumbnail_size));
|
||||
|
||||
if (thumbnail_size < 64) {
|
||||
folder_thumbnail = get_theme_icon("FolderMediumThumb", ei);
|
||||
file_thumbnail = get_theme_icon("FileMediumThumb", ei);
|
||||
file_thumbnail_broken = get_theme_icon("FileDeadMediumThumb", ei);
|
||||
folder_thumbnail = get_theme_icon(SNAME("FolderMediumThumb"), ei);
|
||||
file_thumbnail = get_theme_icon(SNAME("FileMediumThumb"), ei);
|
||||
file_thumbnail_broken = get_theme_icon(SNAME("FileDeadMediumThumb"), ei);
|
||||
} else {
|
||||
folder_thumbnail = get_theme_icon("FolderBigThumb", ei);
|
||||
file_thumbnail = get_theme_icon("FileBigThumb", ei);
|
||||
file_thumbnail_broken = get_theme_icon("FileDeadBigThumb", ei);
|
||||
folder_thumbnail = get_theme_icon(SNAME("FolderBigThumb"), ei);
|
||||
file_thumbnail = get_theme_icon(SNAME("FileBigThumb"), ei);
|
||||
file_thumbnail_broken = get_theme_icon(SNAME("FileDeadBigThumb"), ei);
|
||||
}
|
||||
} else {
|
||||
// No thumbnails.
|
||||
|
@ -750,8 +750,8 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) {
|
|||
files->set_fixed_icon_size(Size2());
|
||||
}
|
||||
|
||||
Ref<Texture2D> folder_icon = (use_thumbnails) ? folder_thumbnail : get_theme_icon("folder", "FileDialog");
|
||||
const Color folder_color = get_theme_color("folder_icon_modulate", "FileDialog");
|
||||
Ref<Texture2D> folder_icon = (use_thumbnails) ? folder_thumbnail : get_theme_icon(SNAME("folder"), SNAME("FileDialog"));
|
||||
const Color folder_color = get_theme_color(SNAME("folder_icon_modulate"), SNAME("FileDialog"));
|
||||
|
||||
// Build the FileInfo list.
|
||||
List<FileInfo> file_list;
|
||||
|
@ -885,7 +885,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) {
|
|||
type_icon = (has_theme_icon(ftype, ei)) ? get_theme_icon(ftype, ei) : get_theme_icon(oi, ei);
|
||||
big_icon = file_thumbnail;
|
||||
} else {
|
||||
type_icon = get_theme_icon("ImportFail", ei);
|
||||
type_icon = get_theme_icon(SNAME("ImportFail"), ei);
|
||||
big_icon = file_thumbnail_broken;
|
||||
tooltip += "\n" + TTR("Status: Import of file failed. Please fix file and reimport manually.");
|
||||
}
|
||||
|
@ -905,7 +905,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) {
|
|||
}
|
||||
|
||||
if (fpath == main_scene) {
|
||||
files->set_item_custom_fg_color(item_index, get_theme_color("accent_color", "Editor"));
|
||||
files->set_item_custom_fg_color(item_index, get_theme_color(SNAME("accent_color"), SNAME("Editor")));
|
||||
}
|
||||
|
||||
// Generate the preview.
|
||||
|
@ -1189,11 +1189,11 @@ void FileSystemDock::_try_move_item(const FileOrFolder &p_item, const String &p_
|
|||
for (int i = 0; i < file_changed_paths.size(); ++i) {
|
||||
p_file_renames[file_changed_paths[i]] = file_changed_paths[i].replace_first(old_path, new_path);
|
||||
print_verbose(" Remap: " + file_changed_paths[i] + " -> " + p_file_renames[file_changed_paths[i]]);
|
||||
emit_signal("files_moved", file_changed_paths[i], p_file_renames[file_changed_paths[i]]);
|
||||
emit_signal(SNAME("files_moved"), file_changed_paths[i], p_file_renames[file_changed_paths[i]]);
|
||||
}
|
||||
for (int i = 0; i < folder_changed_paths.size(); ++i) {
|
||||
p_folder_renames[folder_changed_paths[i]] = folder_changed_paths[i].replace_first(old_path, new_path);
|
||||
emit_signal("folder_moved", folder_changed_paths[i], p_folder_renames[folder_changed_paths[i]].substr(0, p_folder_renames[folder_changed_paths[i]].length() - 1));
|
||||
emit_signal(SNAME("folder_moved"), folder_changed_paths[i], p_folder_renames[folder_changed_paths[i]].substr(0, p_folder_renames[folder_changed_paths[i]].length() - 1));
|
||||
}
|
||||
} else {
|
||||
EditorNode::get_singleton()->add_io_error(TTR("Error moving:") + "\n" + old_path + "\n");
|
||||
|
@ -1442,7 +1442,7 @@ void FileSystemDock::_make_scene_confirm() {
|
|||
}
|
||||
|
||||
void FileSystemDock::_file_removed(String p_file) {
|
||||
emit_signal("file_removed", p_file);
|
||||
emit_signal(SNAME("file_removed"), p_file);
|
||||
|
||||
// Find the closest parent directory available, in case multiple items were deleted along the same path.
|
||||
path = p_file.get_base_dir();
|
||||
|
@ -1455,7 +1455,7 @@ void FileSystemDock::_file_removed(String p_file) {
|
|||
}
|
||||
|
||||
void FileSystemDock::_folder_removed(String p_folder) {
|
||||
emit_signal("folder_removed", p_folder);
|
||||
emit_signal(SNAME("folder_removed"), p_folder);
|
||||
|
||||
// Find the closest parent directory available, in case multiple items were deleted along the same path.
|
||||
path = p_folder.get_base_dir();
|
||||
|
@ -1762,7 +1762,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
|
|||
case FILE_INHERIT: {
|
||||
// Create a new scene inherited from the selected one.
|
||||
if (p_selected.size() == 1) {
|
||||
emit_signal("inherit", p_selected[0]);
|
||||
emit_signal(SNAME("inherit"), p_selected[0]);
|
||||
}
|
||||
} break;
|
||||
|
||||
|
@ -1786,7 +1786,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
|
|||
}
|
||||
}
|
||||
if (!paths.is_empty()) {
|
||||
emit_signal("instance", paths);
|
||||
emit_signal(SNAME("instance"), paths);
|
||||
}
|
||||
} break;
|
||||
|
||||
|
@ -2019,7 +2019,7 @@ void FileSystemDock::_rescan() {
|
|||
|
||||
void FileSystemDock::_toggle_split_mode(bool p_active) {
|
||||
set_display_mode(p_active ? DISPLAY_MODE_SPLIT : DISPLAY_MODE_TREE_ONLY);
|
||||
emit_signal("display_mode_changed");
|
||||
emit_signal(SNAME("display_mode_changed"));
|
||||
}
|
||||
|
||||
void FileSystemDock::fix_dependencies(const String &p_for_file) {
|
||||
|
@ -2404,28 +2404,28 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str
|
|||
if (all_files) {
|
||||
if (all_files_scenes) {
|
||||
if (filenames.size() == 1) {
|
||||
p_popup->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Open Scene"), FILE_OPEN);
|
||||
p_popup->add_icon_item(get_theme_icon("CreateNewSceneFrom", "EditorIcons"), TTR("New Inherited Scene"), FILE_INHERIT);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("Load"), SNAME("EditorIcons")), TTR("Open Scene"), FILE_OPEN);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("CreateNewSceneFrom"), SNAME("EditorIcons")), TTR("New Inherited Scene"), FILE_INHERIT);
|
||||
if (ProjectSettings::get_singleton()->get("application/run/main_scene") != filenames[0]) {
|
||||
p_popup->add_icon_item(get_theme_icon("PlayScene", "EditorIcons"), TTR("Set As Main Scene"), FILE_MAIN_SCENE);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("PlayScene"), SNAME("EditorIcons")), TTR("Set As Main Scene"), FILE_MAIN_SCENE);
|
||||
}
|
||||
} else {
|
||||
p_popup->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Open Scenes"), FILE_OPEN);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("Load"), SNAME("EditorIcons")), TTR("Open Scenes"), FILE_OPEN);
|
||||
}
|
||||
p_popup->add_icon_item(get_theme_icon("Instance", "EditorIcons"), TTR("Instance"), FILE_INSTANCE);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), TTR("Instance"), FILE_INSTANCE);
|
||||
p_popup->add_separator();
|
||||
} else if (filenames.size() == 1) {
|
||||
p_popup->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Open"), FILE_OPEN);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("Load"), SNAME("EditorIcons")), TTR("Open"), FILE_OPEN);
|
||||
p_popup->add_separator();
|
||||
}
|
||||
}
|
||||
|
||||
if (p_paths.size() >= 1) {
|
||||
if (!all_favorites) {
|
||||
p_popup->add_icon_item(get_theme_icon("Favorites", "EditorIcons"), TTR("Add to Favorites"), FILE_ADD_FAVORITE);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("Favorites"), SNAME("EditorIcons")), TTR("Add to Favorites"), FILE_ADD_FAVORITE);
|
||||
}
|
||||
if (!all_not_favorites) {
|
||||
p_popup->add_icon_item(get_theme_icon("NonFavorite", "EditorIcons"), TTR("Remove from Favorites"), FILE_REMOVE_FAVORITE);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("NonFavorite"), SNAME("EditorIcons")), TTR("Remove from Favorites"), FILE_REMOVE_FAVORITE);
|
||||
}
|
||||
p_popup->add_separator();
|
||||
}
|
||||
|
@ -2438,36 +2438,36 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str
|
|||
}
|
||||
|
||||
} else if (all_folders && foldernames.size() > 0) {
|
||||
p_popup->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Open"), FILE_OPEN);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("Load"), SNAME("EditorIcons")), TTR("Open"), FILE_OPEN);
|
||||
p_popup->add_separator();
|
||||
}
|
||||
|
||||
if (p_paths.size() == 1) {
|
||||
p_popup->add_icon_shortcut(get_theme_icon("ActionCopy", "EditorIcons"), ED_GET_SHORTCUT("filesystem_dock/copy_path"), FILE_COPY_PATH);
|
||||
p_popup->add_icon_shortcut(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")), ED_GET_SHORTCUT("filesystem_dock/copy_path"), FILE_COPY_PATH);
|
||||
if (p_paths[0] != "res://") {
|
||||
p_popup->add_icon_shortcut(get_theme_icon("Rename", "EditorIcons"), ED_GET_SHORTCUT("filesystem_dock/rename"), FILE_RENAME);
|
||||
p_popup->add_icon_shortcut(get_theme_icon("Duplicate", "EditorIcons"), ED_GET_SHORTCUT("filesystem_dock/duplicate"), FILE_DUPLICATE);
|
||||
p_popup->add_icon_shortcut(get_theme_icon(SNAME("Rename"), SNAME("EditorIcons")), ED_GET_SHORTCUT("filesystem_dock/rename"), FILE_RENAME);
|
||||
p_popup->add_icon_shortcut(get_theme_icon(SNAME("Duplicate"), SNAME("EditorIcons")), ED_GET_SHORTCUT("filesystem_dock/duplicate"), FILE_DUPLICATE);
|
||||
}
|
||||
}
|
||||
|
||||
if (p_paths.size() > 1 || p_paths[0] != "res://") {
|
||||
p_popup->add_icon_item(get_theme_icon("MoveUp", "EditorIcons"), TTR("Move To..."), FILE_MOVE);
|
||||
p_popup->add_icon_shortcut(get_theme_icon("Remove", "EditorIcons"), ED_GET_SHORTCUT("filesystem_dock/delete"), FILE_REMOVE);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons")), TTR("Move To..."), FILE_MOVE);
|
||||
p_popup->add_icon_shortcut(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), ED_GET_SHORTCUT("filesystem_dock/delete"), FILE_REMOVE);
|
||||
}
|
||||
|
||||
if (p_paths.size() == 1) {
|
||||
p_popup->add_separator();
|
||||
if (p_display_path_dependent_options) {
|
||||
p_popup->add_icon_item(get_theme_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER);
|
||||
p_popup->add_icon_item(get_theme_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE);
|
||||
p_popup->add_icon_item(get_theme_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT);
|
||||
p_popup->add_icon_item(get_theme_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")), TTR("New Folder..."), FILE_NEW_FOLDER);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons")), TTR("New Scene..."), FILE_NEW_SCENE);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("Script"), SNAME("EditorIcons")), TTR("New Script..."), FILE_NEW_SCRIPT);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("Object"), SNAME("EditorIcons")), TTR("New Resource..."), FILE_NEW_RESOURCE);
|
||||
p_popup->add_separator();
|
||||
}
|
||||
|
||||
String fpath = p_paths[0];
|
||||
String item_text = fpath.ends_with("/") ? TTR("Open in File Manager") : TTR("Show in File Manager");
|
||||
p_popup->add_icon_item(get_theme_icon("Filesystem", "EditorIcons"), item_text, FILE_SHOW_IN_EXPLORER);
|
||||
p_popup->add_icon_item(get_theme_icon(SNAME("Filesystem"), SNAME("EditorIcons")), item_text, FILE_SHOW_IN_EXPLORER);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2478,8 +2478,8 @@ void FileSystemDock::_tree_rmb_select(const Vector2 &p_pos) {
|
|||
tree_popup->clear();
|
||||
if (paths.size() == 1) {
|
||||
if (paths[0].ends_with("/")) {
|
||||
tree_popup->add_icon_item(get_theme_icon("GuiTreeArrowDown", "EditorIcons"), TTR("Expand All"), FOLDER_EXPAND_ALL);
|
||||
tree_popup->add_icon_item(get_theme_icon("GuiTreeArrowRight", "EditorIcons"), TTR("Collapse All"), FOLDER_COLLAPSE_ALL);
|
||||
tree_popup->add_icon_item(get_theme_icon(SNAME("GuiTreeArrowDown"), SNAME("EditorIcons")), TTR("Expand All"), FOLDER_EXPAND_ALL);
|
||||
tree_popup->add_icon_item(get_theme_icon(SNAME("GuiTreeArrowRight"), SNAME("EditorIcons")), TTR("Collapse All"), FOLDER_COLLAPSE_ALL);
|
||||
tree_popup->add_separator();
|
||||
}
|
||||
}
|
||||
|
@ -2498,10 +2498,10 @@ void FileSystemDock::_tree_rmb_empty(const Vector2 &p_pos) {
|
|||
path = "res://";
|
||||
tree_popup->clear();
|
||||
tree_popup->set_size(Size2(1, 1));
|
||||
tree_popup->add_icon_item(get_theme_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER);
|
||||
tree_popup->add_icon_item(get_theme_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE);
|
||||
tree_popup->add_icon_item(get_theme_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT);
|
||||
tree_popup->add_icon_item(get_theme_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE);
|
||||
tree_popup->add_icon_item(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")), TTR("New Folder..."), FILE_NEW_FOLDER);
|
||||
tree_popup->add_icon_item(get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons")), TTR("New Scene..."), FILE_NEW_SCENE);
|
||||
tree_popup->add_icon_item(get_theme_icon(SNAME("Script"), SNAME("EditorIcons")), TTR("New Script..."), FILE_NEW_SCRIPT);
|
||||
tree_popup->add_icon_item(get_theme_icon(SNAME("Object"), SNAME("EditorIcons")), TTR("New Resource..."), FILE_NEW_RESOURCE);
|
||||
tree_popup->set_position(tree->get_global_position() + p_pos);
|
||||
tree_popup->popup();
|
||||
}
|
||||
|
@ -2543,12 +2543,12 @@ void FileSystemDock::_file_list_rmb_pressed(const Vector2 &p_pos) {
|
|||
file_list_popup->clear();
|
||||
file_list_popup->set_size(Size2(1, 1));
|
||||
|
||||
file_list_popup->add_icon_item(get_theme_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER);
|
||||
file_list_popup->add_icon_item(get_theme_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE);
|
||||
file_list_popup->add_icon_item(get_theme_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT);
|
||||
file_list_popup->add_icon_item(get_theme_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE);
|
||||
file_list_popup->add_icon_item(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")), TTR("New Folder..."), FILE_NEW_FOLDER);
|
||||
file_list_popup->add_icon_item(get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons")), TTR("New Scene..."), FILE_NEW_SCENE);
|
||||
file_list_popup->add_icon_item(get_theme_icon(SNAME("Script"), SNAME("EditorIcons")), TTR("New Script..."), FILE_NEW_SCRIPT);
|
||||
file_list_popup->add_icon_item(get_theme_icon(SNAME("Object"), SNAME("EditorIcons")), TTR("New Resource..."), FILE_NEW_RESOURCE);
|
||||
file_list_popup->add_separator();
|
||||
file_list_popup->add_icon_item(get_theme_icon("Filesystem", "EditorIcons"), TTR("Open in File Manager"), FILE_SHOW_IN_EXPLORER);
|
||||
file_list_popup->add_icon_item(get_theme_icon(SNAME("Filesystem"), SNAME("EditorIcons")), TTR("Open in File Manager"), FILE_SHOW_IN_EXPLORER);
|
||||
file_list_popup->set_position(files->get_global_position() + p_pos);
|
||||
file_list_popup->popup();
|
||||
}
|
||||
|
@ -2572,7 +2572,7 @@ void FileSystemDock::_file_multi_selected(int p_index, bool p_selected) {
|
|||
|
||||
// Update the import dock.
|
||||
import_dock_needs_update = true;
|
||||
call_deferred("_update_import_dock");
|
||||
call_deferred(SNAME("_update_import_dock"));
|
||||
}
|
||||
|
||||
void FileSystemDock::_tree_gui_input(Ref<InputEvent> p_event) {
|
||||
|
|
|
@ -116,12 +116,12 @@ void FindInFiles::_notification(int p_notification) {
|
|||
void FindInFiles::start() {
|
||||
if (_pattern == "") {
|
||||
print_verbose("Nothing to search, pattern is empty");
|
||||
emit_signal(SIGNAL_FINISHED);
|
||||
emit_signal(SNAME(SIGNAL_FINISHED));
|
||||
return;
|
||||
}
|
||||
if (_extension_filter.size() == 0) {
|
||||
print_verbose("Nothing to search, filter matches no files");
|
||||
emit_signal(SIGNAL_FINISHED);
|
||||
emit_signal(SNAME(SIGNAL_FINISHED));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ void FindInFiles::_iterate() {
|
|||
set_process(false);
|
||||
_current_dir = "";
|
||||
_searching = false;
|
||||
emit_signal(SIGNAL_FINISHED);
|
||||
emit_signal(SNAME(SIGNAL_FINISHED));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ void FindInFiles::_scan_file(String fpath) {
|
|||
String line = f->get_line();
|
||||
|
||||
while (find_next(line, _pattern, end, _match_case, _whole_words, begin, end)) {
|
||||
emit_signal(SIGNAL_RESULT_FOUND, fpath, line_number, begin, end, line);
|
||||
emit_signal(SNAME(SIGNAL_RESULT_FOUND), fpath, line_number, begin, end, line);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ void FindInFilesDialog::_notification(int p_what) {
|
|||
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
if (is_visible()) {
|
||||
// Doesn't work more than once if not deferred...
|
||||
_search_text_line_edit->call_deferred("grab_focus");
|
||||
_search_text_line_edit->call_deferred(SNAME("grab_focus"));
|
||||
_search_text_line_edit->select_all();
|
||||
// Extensions might have changed in the meantime, we clean them and instance them again.
|
||||
for (int i = 0; i < _filters_container->get_child_count(); i++) {
|
||||
|
@ -487,10 +487,10 @@ void FindInFilesDialog::custom_action(const String &p_action) {
|
|||
_filters_preferences[cb->get_text()] = cb->is_pressed();
|
||||
}
|
||||
if (p_action == "find") {
|
||||
emit_signal(SIGNAL_FIND_REQUESTED);
|
||||
emit_signal(SNAME(SIGNAL_FIND_REQUESTED));
|
||||
hide();
|
||||
} else if (p_action == "replace") {
|
||||
emit_signal(SIGNAL_REPLACE_REQUESTED);
|
||||
emit_signal(SNAME(SIGNAL_REPLACE_REQUESTED));
|
||||
hide();
|
||||
}
|
||||
}
|
||||
|
@ -565,8 +565,8 @@ FindInFilesPanel::FindInFilesPanel() {
|
|||
hbc->add_child(find_label);
|
||||
|
||||
_search_text_label = memnew(Label);
|
||||
_search_text_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("source", "EditorFonts"));
|
||||
_search_text_label->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size("source_size", "EditorFonts"));
|
||||
_search_text_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("source"), SNAME("EditorFonts")));
|
||||
_search_text_label->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts")));
|
||||
hbc->add_child(_search_text_label);
|
||||
|
||||
_progress_bar = memnew(ProgressBar);
|
||||
|
@ -594,8 +594,8 @@ FindInFilesPanel::FindInFilesPanel() {
|
|||
}
|
||||
|
||||
_results_display = memnew(Tree);
|
||||
_results_display->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("source", "EditorFonts"));
|
||||
_results_display->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size("source_size", "EditorFonts"));
|
||||
_results_display->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("source"), SNAME("EditorFonts")));
|
||||
_results_display->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts")));
|
||||
_results_display->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
_results_display->connect("item_selected", callable_mp(this, &FindInFilesPanel::_on_result_selected));
|
||||
_results_display->connect("item_edited", callable_mp(this, &FindInFilesPanel::_on_item_edited));
|
||||
|
@ -688,8 +688,8 @@ void FindInFilesPanel::_notification(int p_what) {
|
|||
if (p_what == NOTIFICATION_PROCESS) {
|
||||
_progress_bar->set_as_ratio(_finder->get_progress());
|
||||
} else if (p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
_search_text_label->add_theme_font_override("font", get_theme_font("source", "EditorFonts"));
|
||||
_results_display->add_theme_font_override("font", get_theme_font("source", "EditorFonts"));
|
||||
_search_text_label->add_theme_font_override("font", get_theme_font(SNAME("source"), SNAME("EditorFonts")));
|
||||
_results_display->add_theme_font_override("font", get_theme_font(SNAME("source"), SNAME("EditorFonts")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -754,8 +754,8 @@ void FindInFilesPanel::draw_result_text(Object *item_obj, Rect2 rect) {
|
|||
}
|
||||
Result r = E->value();
|
||||
String item_text = item->get_text(_with_replace ? 1 : 0);
|
||||
Ref<Font> font = _results_display->get_theme_font("font");
|
||||
int font_size = _results_display->get_theme_font_size("font_size");
|
||||
Ref<Font> font = _results_display->get_theme_font(SNAME("font"));
|
||||
int font_size = _results_display->get_theme_font_size(SNAME("font_size"));
|
||||
|
||||
Rect2 match_rect = rect;
|
||||
match_rect.position.x += font->get_string_size(item_text.left(r.begin_trimmed), font_size).x;
|
||||
|
@ -764,7 +764,7 @@ void FindInFilesPanel::draw_result_text(Object *item_obj, Rect2 rect) {
|
|||
match_rect.size.y -= 2 * EDSCALE;
|
||||
|
||||
// Use the inverted accent color to help match rectangles stand out even on the currently selected line.
|
||||
_results_display->draw_rect(match_rect, get_theme_color("accent_color", "Editor").inverted() * Color(1, 1, 1, 0.5));
|
||||
_results_display->draw_rect(match_rect, get_theme_color(SNAME("accent_color"), SNAME("Editor")).inverted() * Color(1, 1, 1, 0.5));
|
||||
|
||||
// Text is drawn by Tree already.
|
||||
}
|
||||
|
@ -773,11 +773,11 @@ void FindInFilesPanel::_on_item_edited() {
|
|||
TreeItem *item = _results_display->get_selected();
|
||||
|
||||
if (item->is_checked(0)) {
|
||||
item->set_custom_color(1, _results_display->get_theme_color("font_color"));
|
||||
item->set_custom_color(1, _results_display->get_theme_color(SNAME("font_color")));
|
||||
|
||||
} else {
|
||||
// Grey out
|
||||
Color color = _results_display->get_theme_color("font_color");
|
||||
Color color = _results_display->get_theme_color(SNAME("font_color"));
|
||||
color.a /= 2.0;
|
||||
item->set_custom_color(1, color);
|
||||
}
|
||||
|
@ -823,7 +823,7 @@ void FindInFilesPanel::_on_result_selected() {
|
|||
TreeItem *file_item = item->get_parent();
|
||||
String fpath = file_item->get_metadata(0);
|
||||
|
||||
emit_signal(SIGNAL_RESULT_SELECTED, fpath, r.line_number, r.begin, r.end);
|
||||
emit_signal(SNAME(SIGNAL_RESULT_SELECTED), fpath, r.line_number, r.begin, r.end);
|
||||
}
|
||||
|
||||
void FindInFilesPanel::_on_replace_text_changed(String text) {
|
||||
|
@ -860,7 +860,7 @@ void FindInFilesPanel::_on_replace_all_clicked() {
|
|||
// Hide replace bar so we can't trigger the action twice without doing a new search
|
||||
_replace_container->hide();
|
||||
|
||||
emit_signal(SIGNAL_FILES_MODIFIED, modified_files);
|
||||
emit_signal(SNAME(SIGNAL_FILES_MODIFIED), modified_files);
|
||||
}
|
||||
|
||||
// Same as get_line, but preserves line ending characters
|
||||
|
|
|
@ -94,7 +94,7 @@ void GroupDialog::_load_nodes(Node *p_current) {
|
|||
|
||||
if (!_can_edit(p_current, selected_group)) {
|
||||
node->set_selectable(0, false);
|
||||
node->set_custom_color(0, groups->get_theme_color("disabled_font_color", "Editor"));
|
||||
node->set_custom_color(0, groups->get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ void GroupDialog::_add_group(String p_name) {
|
|||
|
||||
TreeItem *new_group = groups->create_item(groups_root);
|
||||
new_group->set_text(0, name);
|
||||
new_group->add_button(0, groups->get_theme_icon("Remove", "EditorIcons"), 0);
|
||||
new_group->add_button(0, groups->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), 0);
|
||||
new_group->set_editable(0, true);
|
||||
new_group->select(0);
|
||||
groups->ensure_cursor_is_visible();
|
||||
|
@ -365,16 +365,16 @@ void GroupDialog::_notification(int p_what) {
|
|||
case Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
if (is_layout_rtl()) {
|
||||
add_button->set_icon(groups->get_theme_icon("Back", "EditorIcons"));
|
||||
remove_button->set_icon(groups->get_theme_icon("Forward", "EditorIcons"));
|
||||
add_button->set_icon(groups->get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
remove_button->set_icon(groups->get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
add_button->set_icon(groups->get_theme_icon("Forward", "EditorIcons"));
|
||||
remove_button->set_icon(groups->get_theme_icon("Back", "EditorIcons"));
|
||||
add_button->set_icon(groups->get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
remove_button->set_icon(groups->get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
add_filter->set_right_icon(groups->get_theme_icon("Search", "EditorIcons"));
|
||||
add_filter->set_right_icon(groups->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
add_filter->set_clear_button_enabled(true);
|
||||
remove_filter->set_right_icon(groups->get_theme_icon("Search", "EditorIcons"));
|
||||
remove_filter->set_right_icon(groups->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
remove_filter->set_clear_button_enabled(true);
|
||||
} break;
|
||||
}
|
||||
|
@ -655,7 +655,7 @@ void GroupsEditor::update_tree() {
|
|||
TreeItem *item = tree->create_item(root);
|
||||
item->set_text(0, gi.name);
|
||||
if (can_be_deleted) {
|
||||
item->add_button(0, get_theme_icon("Remove", "EditorIcons"), 0);
|
||||
item->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), 0);
|
||||
} else {
|
||||
item->set_selectable(0, false);
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ void SceneImportSettings::_fill_material(Tree *p_tree, const Ref<Material> &p_ma
|
|||
|
||||
MaterialData &material_data = material_map[import_id];
|
||||
|
||||
Ref<Texture2D> icon = get_theme_icon("StandardMaterial3D", "EditorIcons");
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("StandardMaterial3D"), SNAME("EditorIcons"));
|
||||
|
||||
TreeItem *item = p_tree->create_item(p_parent);
|
||||
item->set_text(0, p_material->get_name());
|
||||
|
@ -161,7 +161,7 @@ void SceneImportSettings::_fill_mesh(Tree *p_tree, const Ref<Mesh> &p_mesh, Tree
|
|||
|
||||
MeshData &mesh_data = mesh_map[import_id];
|
||||
|
||||
Ref<Texture2D> icon = get_theme_icon("Mesh", "EditorIcons");
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("Mesh"), SNAME("EditorIcons"));
|
||||
|
||||
TreeItem *item = p_tree->create_item(p_parent);
|
||||
item->set_text(0, p_mesh->get_name());
|
||||
|
@ -211,7 +211,7 @@ void SceneImportSettings::_fill_animation(Tree *p_tree, const Ref<Animation> &p_
|
|||
|
||||
AnimationData &animation_data = animation_map[p_name];
|
||||
|
||||
Ref<Texture2D> icon = get_theme_icon("Animation", "EditorIcons");
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("Animation"), SNAME("EditorIcons"));
|
||||
|
||||
TreeItem *item = p_tree->create_item(p_parent);
|
||||
item->set_text(0, p_name);
|
||||
|
@ -255,17 +255,17 @@ void SceneImportSettings::_fill_scene(Node *p_node, TreeItem *p_parent_item) {
|
|||
|
||||
String type = p_node->get_class();
|
||||
|
||||
if (!has_theme_icon(type, "EditorIcons")) {
|
||||
if (!has_theme_icon(type, SNAME("EditorIcons"))) {
|
||||
type = "Node3D";
|
||||
}
|
||||
|
||||
Ref<Texture2D> icon = get_theme_icon(type, "EditorIcons");
|
||||
Ref<Texture2D> icon = get_theme_icon(type, SNAME("EditorIcons"));
|
||||
|
||||
TreeItem *item = scene_tree->create_item(p_parent_item);
|
||||
item->set_text(0, p_node->get_name());
|
||||
|
||||
if (p_node == scene) {
|
||||
icon = get_theme_icon("PackedScene", "EditorIcons");
|
||||
icon = get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons"));
|
||||
item->set_text(0, "Scene");
|
||||
}
|
||||
|
||||
|
@ -795,11 +795,11 @@ void SceneImportSettings::_save_path_changed(const String &p_path) {
|
|||
if (FileAccess::exists(p_path)) {
|
||||
save_path_item->set_text(2, "Warning: File exists");
|
||||
save_path_item->set_tooltip(2, TTR("Existing file with the same name will be replaced."));
|
||||
save_path_item->set_icon(2, get_theme_icon("StatusWarning", "EditorIcons"));
|
||||
save_path_item->set_icon(2, get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
|
||||
|
||||
} else {
|
||||
save_path_item->set_text(2, "Will create new File");
|
||||
save_path_item->set_icon(2, get_theme_icon("StatusSuccess", "EditorIcons"));
|
||||
save_path_item->set_icon(2, get_theme_icon(SNAME("StatusSuccess"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -829,7 +829,7 @@ void SceneImportSettings::_save_dir_callback(const String &p_path) {
|
|||
String name = md.material_node->get_text(0);
|
||||
|
||||
item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
|
||||
item->set_icon(0, get_theme_icon("StandardMaterial3D", "EditorIcons"));
|
||||
item->set_icon(0, get_theme_icon(SNAME("StandardMaterial3D"), SNAME("EditorIcons")));
|
||||
item->set_text(0, name);
|
||||
|
||||
if (md.has_import_id) {
|
||||
|
@ -851,20 +851,20 @@ void SceneImportSettings::_save_dir_callback(const String &p_path) {
|
|||
if (FileAccess::exists(path)) {
|
||||
item->set_text(2, "Warning: File exists");
|
||||
item->set_tooltip(2, TTR("Existing file with the same name will be replaced."));
|
||||
item->set_icon(2, get_theme_icon("StatusWarning", "EditorIcons"));
|
||||
item->set_icon(2, get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
|
||||
|
||||
} else {
|
||||
item->set_text(2, "Will create new File");
|
||||
item->set_icon(2, get_theme_icon("StatusSuccess", "EditorIcons"));
|
||||
item->set_icon(2, get_theme_icon(SNAME("StatusSuccess"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
item->add_button(1, get_theme_icon("Folder", "EditorIcons"));
|
||||
item->add_button(1, get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
} else {
|
||||
item->set_text(2, "No import ID");
|
||||
item->set_tooltip(2, TTR("Material has no name nor any other way to identify on re-import.\nPlease name it or ensure it is exported with an unique ID."));
|
||||
item->set_icon(2, get_theme_icon("StatusError", "EditorIcons"));
|
||||
item->set_icon(2, get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
save_path_items.push_back(item);
|
||||
|
@ -882,7 +882,7 @@ void SceneImportSettings::_save_dir_callback(const String &p_path) {
|
|||
String name = md.mesh_node->get_text(0);
|
||||
|
||||
item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
|
||||
item->set_icon(0, get_theme_icon("Mesh", "EditorIcons"));
|
||||
item->set_icon(0, get_theme_icon(SNAME("Mesh"), SNAME("EditorIcons")));
|
||||
item->set_text(0, name);
|
||||
|
||||
if (md.has_import_id) {
|
||||
|
@ -904,20 +904,20 @@ void SceneImportSettings::_save_dir_callback(const String &p_path) {
|
|||
if (FileAccess::exists(path)) {
|
||||
item->set_text(2, "Warning: File exists");
|
||||
item->set_tooltip(2, TTR("Existing file with the same name will be replaced on import."));
|
||||
item->set_icon(2, get_theme_icon("StatusWarning", "EditorIcons"));
|
||||
item->set_icon(2, get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
|
||||
|
||||
} else {
|
||||
item->set_text(2, "Will save to new File");
|
||||
item->set_icon(2, get_theme_icon("StatusSuccess", "EditorIcons"));
|
||||
item->set_icon(2, get_theme_icon(SNAME("StatusSuccess"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
item->add_button(1, get_theme_icon("Folder", "EditorIcons"));
|
||||
item->add_button(1, get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
} else {
|
||||
item->set_text(2, "No import ID");
|
||||
item->set_tooltip(2, TTR("Mesh has no name nor any other way to identify on re-import.\nPlease name it or ensure it is exported with an unique ID."));
|
||||
item->set_icon(2, get_theme_icon("StatusError", "EditorIcons"));
|
||||
item->set_icon(2, get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
save_path_items.push_back(item);
|
||||
|
@ -935,7 +935,7 @@ void SceneImportSettings::_save_dir_callback(const String &p_path) {
|
|||
String name = ad.scene_node->get_text(0);
|
||||
|
||||
item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
|
||||
item->set_icon(0, get_theme_icon("Animation", "EditorIcons"));
|
||||
item->set_icon(0, get_theme_icon(SNAME("Animation"), SNAME("EditorIcons")));
|
||||
item->set_text(0, name);
|
||||
|
||||
if (ad.settings.has("save_to_file/enabled") && bool(ad.settings["save_to_file/enabled"])) {
|
||||
|
@ -956,14 +956,14 @@ void SceneImportSettings::_save_dir_callback(const String &p_path) {
|
|||
if (FileAccess::exists(path)) {
|
||||
item->set_text(2, "Warning: File exists");
|
||||
item->set_tooltip(2, TTR("Existing file with the same name will be replaced on import."));
|
||||
item->set_icon(2, get_theme_icon("StatusWarning", "EditorIcons"));
|
||||
item->set_icon(2, get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
|
||||
|
||||
} else {
|
||||
item->set_text(2, "Will save to new File");
|
||||
item->set_icon(2, get_theme_icon("StatusSuccess", "EditorIcons"));
|
||||
item->set_icon(2, get_theme_icon(SNAME("StatusSuccess"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
item->add_button(1, get_theme_icon("Folder", "EditorIcons"));
|
||||
item->add_button(1, get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
save_path_items.push_back(item);
|
||||
|
|
|
@ -98,7 +98,7 @@ void ImportDefaultsEditor::_save() {
|
|||
ProjectSettings::get_singleton()->set("importer_defaults/" + settings->importer->get_importer_name(), Variant());
|
||||
}
|
||||
|
||||
emit_signal("project_settings_changed");
|
||||
emit_signal(SNAME("project_settings_changed"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -526,18 +526,18 @@ void ImportDock::_reimport() {
|
|||
}
|
||||
|
||||
EditorFileSystem::get_singleton()->reimport_files(params->paths);
|
||||
EditorFileSystem::get_singleton()->emit_signal("filesystem_changed"); //it changed, so force emitting the signal
|
||||
EditorFileSystem::get_singleton()->emit_signal(SNAME("filesystem_changed")); //it changed, so force emitting the signal
|
||||
}
|
||||
|
||||
void ImportDock::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
imported->add_theme_style_override("normal", get_theme_stylebox("normal", "LineEdit"));
|
||||
imported->add_theme_style_override("normal", get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
import_opts->edit(params);
|
||||
label_warning->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor"));
|
||||
label_warning->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ void ImportDock::initialize_import_options() const {
|
|||
ImportDock::ImportDock() {
|
||||
set_name("Import");
|
||||
imported = memnew(Label);
|
||||
imported->add_theme_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("normal", "LineEdit"));
|
||||
imported->add_theme_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
|
||||
imported->set_clip_text(true);
|
||||
add_child(imported);
|
||||
HBoxContainer *hb = memnew(HBoxContainer);
|
||||
|
|
|
@ -63,7 +63,7 @@ void InspectorDock::_menu_option(int p_option) {
|
|||
case OBJECT_REQUEST_HELP: {
|
||||
if (current) {
|
||||
editor->set_visible_editor(EditorNode::EDITOR_SCRIPT);
|
||||
emit_signal("request_help", current->get_class());
|
||||
emit_signal(SNAME("request_help"), current->get_class());
|
||||
}
|
||||
} break;
|
||||
|
||||
|
@ -216,7 +216,7 @@ void InspectorDock::_prepare_history() {
|
|||
|
||||
history_menu->get_popup()->clear();
|
||||
|
||||
Ref<Texture2D> base_icon = get_theme_icon("Object", "EditorIcons");
|
||||
Ref<Texture2D> base_icon = get_theme_icon(SNAME("Object"), SNAME("EditorIcons"));
|
||||
Set<ObjectID> already;
|
||||
for (int i = editor_history->get_history_len() - 1; i >= history_to; i--) {
|
||||
ObjectID id = editor_history->get_history_obj(i);
|
||||
|
@ -337,27 +337,27 @@ void InspectorDock::_notification(int p_what) {
|
|||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
set_theme(editor->get_gui_base()->get_theme());
|
||||
|
||||
resource_new_button->set_icon(get_theme_icon("New", "EditorIcons"));
|
||||
resource_load_button->set_icon(get_theme_icon("Load", "EditorIcons"));
|
||||
resource_save_button->set_icon(get_theme_icon("Save", "EditorIcons"));
|
||||
resource_extra_button->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons"));
|
||||
resource_new_button->set_icon(get_theme_icon(SNAME("New"), SNAME("EditorIcons")));
|
||||
resource_load_button->set_icon(get_theme_icon(SNAME("Load"), SNAME("EditorIcons")));
|
||||
resource_save_button->set_icon(get_theme_icon(SNAME("Save"), SNAME("EditorIcons")));
|
||||
resource_extra_button->set_icon(get_theme_icon(SNAME("GuiTabMenu"), SNAME("EditorIcons")));
|
||||
|
||||
PopupMenu *resource_extra_popup = resource_extra_button->get_popup();
|
||||
resource_extra_popup->set_item_icon(resource_extra_popup->get_item_index(RESOURCE_EDIT_CLIPBOARD), get_theme_icon("ActionPaste", "EditorIcons"));
|
||||
resource_extra_popup->set_item_icon(resource_extra_popup->get_item_index(RESOURCE_COPY), get_theme_icon("ActionCopy", "EditorIcons"));
|
||||
resource_extra_popup->set_item_icon(resource_extra_popup->get_item_index(RESOURCE_EDIT_CLIPBOARD), get_theme_icon(SNAME("ActionPaste"), SNAME("EditorIcons")));
|
||||
resource_extra_popup->set_item_icon(resource_extra_popup->get_item_index(RESOURCE_COPY), get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")));
|
||||
|
||||
if (is_layout_rtl()) {
|
||||
backward_button->set_icon(get_theme_icon("Forward", "EditorIcons"));
|
||||
forward_button->set_icon(get_theme_icon("Back", "EditorIcons"));
|
||||
backward_button->set_icon(get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
forward_button->set_icon(get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
backward_button->set_icon(get_theme_icon("Back", "EditorIcons"));
|
||||
forward_button->set_icon(get_theme_icon("Forward", "EditorIcons"));
|
||||
backward_button->set_icon(get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
forward_button->set_icon(get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
history_menu->set_icon(get_theme_icon("History", "EditorIcons"));
|
||||
object_menu->set_icon(get_theme_icon("Tools", "EditorIcons"));
|
||||
warning->set_icon(get_theme_icon("NodeWarning", "EditorIcons"));
|
||||
warning->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor"));
|
||||
history_menu->set_icon(get_theme_icon(SNAME("History"), SNAME("EditorIcons")));
|
||||
object_menu->set_icon(get_theme_icon(SNAME("Tools"), SNAME("EditorIcons")));
|
||||
warning->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons")));
|
||||
warning->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
@ -433,8 +433,8 @@ void InspectorDock::update(Object *p_object) {
|
|||
PopupMenu *p = object_menu->get_popup();
|
||||
|
||||
p->clear();
|
||||
p->add_icon_shortcut(get_theme_icon("GuiTreeArrowDown", "EditorIcons"), ED_SHORTCUT("property_editor/expand_all", TTR("Expand All")), EXPAND_ALL);
|
||||
p->add_icon_shortcut(get_theme_icon("GuiTreeArrowRight", "EditorIcons"), ED_SHORTCUT("property_editor/collapse_all", TTR("Collapse All")), COLLAPSE_ALL);
|
||||
p->add_icon_shortcut(get_theme_icon(SNAME("GuiTreeArrowDown"), SNAME("EditorIcons")), ED_SHORTCUT("property_editor/expand_all", TTR("Expand All")), EXPAND_ALL);
|
||||
p->add_icon_shortcut(get_theme_icon(SNAME("GuiTreeArrowRight"), SNAME("EditorIcons")), ED_SHORTCUT("property_editor/collapse_all", TTR("Collapse All")), COLLAPSE_ALL);
|
||||
p->add_separator();
|
||||
|
||||
p->add_shortcut(ED_SHORTCUT("property_editor/copy_params", TTR("Copy Properties")), OBJECT_COPY_PARAMS);
|
||||
|
@ -499,7 +499,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) {
|
|||
resource_new_button = memnew(Button);
|
||||
resource_new_button->set_flat(true);
|
||||
resource_new_button->set_tooltip(TTR("Create a new resource in memory and edit it."));
|
||||
resource_new_button->set_icon(get_theme_icon("New", "EditorIcons"));
|
||||
resource_new_button->set_icon(get_theme_icon(SNAME("New"), SNAME("EditorIcons")));
|
||||
general_options_hb->add_child(resource_new_button);
|
||||
resource_new_button->connect("pressed", callable_mp(this, &InspectorDock::_new_resource));
|
||||
resource_new_button->set_focus_mode(Control::FOCUS_NONE);
|
||||
|
@ -507,14 +507,14 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) {
|
|||
resource_load_button = memnew(Button);
|
||||
resource_load_button->set_flat(true);
|
||||
resource_load_button->set_tooltip(TTR("Load an existing resource from disk and edit it."));
|
||||
resource_load_button->set_icon(get_theme_icon("Load", "EditorIcons"));
|
||||
resource_load_button->set_icon(get_theme_icon(SNAME("Load"), SNAME("EditorIcons")));
|
||||
general_options_hb->add_child(resource_load_button);
|
||||
resource_load_button->connect("pressed", callable_mp(this, &InspectorDock::_open_resource_selector));
|
||||
resource_load_button->set_focus_mode(Control::FOCUS_NONE);
|
||||
|
||||
resource_save_button = memnew(MenuButton);
|
||||
resource_save_button->set_tooltip(TTR("Save the currently edited resource."));
|
||||
resource_save_button->set_icon(get_theme_icon("Save", "EditorIcons"));
|
||||
resource_save_button->set_icon(get_theme_icon(SNAME("Save"), SNAME("EditorIcons")));
|
||||
general_options_hb->add_child(resource_save_button);
|
||||
resource_save_button->get_popup()->add_item(TTR("Save"), RESOURCE_SAVE);
|
||||
resource_save_button->get_popup()->add_item(TTR("Save As..."), RESOURCE_SAVE_AS);
|
||||
|
@ -523,10 +523,10 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) {
|
|||
resource_save_button->set_disabled(true);
|
||||
|
||||
resource_extra_button = memnew(MenuButton);
|
||||
resource_extra_button->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons"));
|
||||
resource_extra_button->set_icon(get_theme_icon(SNAME("GuiTabMenu"), SNAME("EditorIcons")));
|
||||
general_options_hb->add_child(resource_extra_button);
|
||||
resource_extra_button->get_popup()->add_icon_shortcut(get_theme_icon("ActionPaste", "EditorIcons"), ED_SHORTCUT("property_editor/paste_resource", TTR("Edit Resource from Clipboard")), RESOURCE_EDIT_CLIPBOARD);
|
||||
resource_extra_button->get_popup()->add_icon_shortcut(get_theme_icon("ActionCopy", "EditorIcons"), ED_SHORTCUT("property_editor/copy_resource", TTR("Copy Resource")), RESOURCE_COPY);
|
||||
resource_extra_button->get_popup()->add_icon_shortcut(get_theme_icon(SNAME("ActionPaste"), SNAME("EditorIcons")), ED_SHORTCUT("property_editor/paste_resource", TTR("Edit Resource from Clipboard")), RESOURCE_EDIT_CLIPBOARD);
|
||||
resource_extra_button->get_popup()->add_icon_shortcut(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")), ED_SHORTCUT("property_editor/copy_resource", TTR("Copy Resource")), RESOURCE_COPY);
|
||||
resource_extra_button->get_popup()->set_item_disabled(1, true);
|
||||
resource_extra_button->get_popup()->add_separator();
|
||||
resource_extra_button->get_popup()->add_shortcut(ED_SHORTCUT("property_editor/unref_resource", TTR("Make Resource Built-In")), RESOURCE_MAKE_BUILT_IN);
|
||||
|
@ -539,9 +539,9 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) {
|
|||
backward_button->set_flat(true);
|
||||
general_options_hb->add_child(backward_button);
|
||||
if (is_layout_rtl()) {
|
||||
backward_button->set_icon(get_theme_icon("Forward", "EditorIcons"));
|
||||
backward_button->set_icon(get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
backward_button->set_icon(get_theme_icon("Back", "EditorIcons"));
|
||||
backward_button->set_icon(get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
}
|
||||
backward_button->set_tooltip(TTR("Go to the previous edited object in history."));
|
||||
backward_button->set_disabled(true);
|
||||
|
@ -551,9 +551,9 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) {
|
|||
forward_button->set_flat(true);
|
||||
general_options_hb->add_child(forward_button);
|
||||
if (is_layout_rtl()) {
|
||||
forward_button->set_icon(get_theme_icon("Back", "EditorIcons"));
|
||||
forward_button->set_icon(get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
forward_button->set_icon(get_theme_icon("Forward", "EditorIcons"));
|
||||
forward_button->set_icon(get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
}
|
||||
forward_button->set_tooltip(TTR("Go to the next edited object in history."));
|
||||
forward_button->set_disabled(true);
|
||||
|
@ -561,7 +561,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) {
|
|||
|
||||
history_menu = memnew(MenuButton);
|
||||
history_menu->set_tooltip(TTR("History of recently edited objects."));
|
||||
history_menu->set_icon(get_theme_icon("History", "EditorIcons"));
|
||||
history_menu->set_icon(get_theme_icon(SNAME("History"), SNAME("EditorIcons")));
|
||||
general_options_hb->add_child(history_menu);
|
||||
history_menu->connect("about_to_popup", callable_mp(this, &InspectorDock::_prepare_history));
|
||||
history_menu->get_popup()->connect("id_pressed", callable_mp(this, &InspectorDock::_select_history));
|
||||
|
@ -576,7 +576,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) {
|
|||
open_docs_button->set_flat(true);
|
||||
open_docs_button->set_visible(false);
|
||||
open_docs_button->set_tooltip(TTR("Open documentation for this object."));
|
||||
open_docs_button->set_icon(get_theme_icon("HelpSearch", "EditorIcons"));
|
||||
open_docs_button->set_icon(get_theme_icon(SNAME("HelpSearch"), SNAME("EditorIcons")));
|
||||
open_docs_button->set_shortcut(ED_SHORTCUT("property_editor/open_help", TTR("Open Documentation")));
|
||||
subresource_hb->add_child(open_docs_button);
|
||||
open_docs_button->connect("pressed", callable_mp(this, &InspectorDock::_menu_option), varray(OBJECT_REQUEST_HELP));
|
||||
|
@ -592,13 +592,13 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) {
|
|||
search = memnew(LineEdit);
|
||||
search->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
search->set_placeholder(TTR("Filter properties"));
|
||||
search->set_right_icon(get_theme_icon("Search", "EditorIcons"));
|
||||
search->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
search->set_clear_button_enabled(true);
|
||||
property_tools_hb->add_child(search);
|
||||
|
||||
object_menu = memnew(MenuButton);
|
||||
object_menu->set_shortcut_context(this);
|
||||
object_menu->set_icon(get_theme_icon("Tools", "EditorIcons"));
|
||||
object_menu->set_icon(get_theme_icon(SNAME("Tools"), SNAME("EditorIcons")));
|
||||
property_tools_hb->add_child(object_menu);
|
||||
object_menu->set_tooltip(TTR("Manage object properties."));
|
||||
object_menu->get_popup()->connect("id_pressed", callable_mp(this, &InspectorDock::_menu_option));
|
||||
|
@ -606,8 +606,8 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) {
|
|||
warning = memnew(Button);
|
||||
add_child(warning);
|
||||
warning->set_text(TTR("Changes may be lost!"));
|
||||
warning->set_icon(get_theme_icon("NodeWarning", "EditorIcons"));
|
||||
warning->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor"));
|
||||
warning->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons")));
|
||||
warning->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
warning->set_clip_text(true);
|
||||
warning->hide();
|
||||
warning->connect("pressed", callable_mp(this, &InspectorDock::_warning_pressed));
|
||||
|
|
|
@ -176,7 +176,7 @@ void LocalizationEditor::_translation_res_select() {
|
|||
return;
|
||||
}
|
||||
|
||||
call_deferred("update_translations");
|
||||
call_deferred(SNAME("update_translations"));
|
||||
}
|
||||
|
||||
void LocalizationEditor::_translation_res_option_changed() {
|
||||
|
@ -453,7 +453,7 @@ void LocalizationEditor::update_translations() {
|
|||
t->set_text(0, translations[i].replace_first("res://", ""));
|
||||
t->set_tooltip(0, translations[i]);
|
||||
t->set_metadata(0, i);
|
||||
t->add_button(0, get_theme_icon("Remove", "EditorIcons"), 0, false, TTR("Remove"));
|
||||
t->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), 0, false, TTR("Remove"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -571,7 +571,7 @@ void LocalizationEditor::update_translations() {
|
|||
t->set_text(0, keys[i].replace_first("res://", ""));
|
||||
t->set_tooltip(0, keys[i]);
|
||||
t->set_metadata(0, keys[i]);
|
||||
t->add_button(0, get_theme_icon("Remove", "EditorIcons"), 0, false, TTR("Remove"));
|
||||
t->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), 0, false, TTR("Remove"));
|
||||
if (keys[i] == remap_selected) {
|
||||
t->select(0);
|
||||
translation_res_option_add_button->set_disabled(false);
|
||||
|
@ -588,7 +588,7 @@ void LocalizationEditor::update_translations() {
|
|||
t2->set_text(0, path.replace_first("res://", ""));
|
||||
t2->set_tooltip(0, path);
|
||||
t2->set_metadata(0, j);
|
||||
t2->add_button(0, get_theme_icon("Remove", "EditorIcons"), 0, false, TTR("Remove"));
|
||||
t2->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), 0, false, TTR("Remove"));
|
||||
t2->set_cell_mode(1, TreeItem::CELL_MODE_RANGE);
|
||||
t2->set_text(1, langnames);
|
||||
t2->set_editable(1, true);
|
||||
|
@ -621,7 +621,7 @@ void LocalizationEditor::update_translations() {
|
|||
t->set_text(0, pot_translations[i].replace_first("res://", ""));
|
||||
t->set_tooltip(0, pot_translations[i]);
|
||||
t->set_metadata(0, i);
|
||||
t->add_button(0, get_theme_icon("Remove", "EditorIcons"), 0, false, TTR("Remove"));
|
||||
t->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), 0, false, TTR("Remove"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -782,9 +782,9 @@ Light3DGizmoPlugin::Light3DGizmoPlugin() {
|
|||
create_material("lines_secondary", Color(1, 1, 1, 0.35), false, false, true);
|
||||
create_material("lines_billboard", Color(1, 1, 1), true, false, true);
|
||||
|
||||
create_icon_material("light_directional_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoDirectionalLight", "EditorIcons"));
|
||||
create_icon_material("light_omni_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoLight", "EditorIcons"));
|
||||
create_icon_material("light_spot_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoSpotLight", "EditorIcons"));
|
||||
create_icon_material("light_directional_icon", Node3DEditor::get_singleton()->get_theme_icon(SNAME("GizmoDirectionalLight"), SNAME("EditorIcons")));
|
||||
create_icon_material("light_omni_icon", Node3DEditor::get_singleton()->get_theme_icon(SNAME("GizmoLight"), SNAME("EditorIcons")));
|
||||
create_icon_material("light_spot_icon", Node3DEditor::get_singleton()->get_theme_icon(SNAME("GizmoSpotLight"), SNAME("EditorIcons")));
|
||||
|
||||
create_handle_material("handles");
|
||||
create_handle_material("handles_billboard", true);
|
||||
|
@ -1050,7 +1050,7 @@ void Light3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
|
|||
AudioStreamPlayer3DGizmoPlugin::AudioStreamPlayer3DGizmoPlugin() {
|
||||
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/stream_player_3d", Color(0.4, 0.8, 1));
|
||||
|
||||
create_icon_material("stream_player_3d_icon", Node3DEditor::get_singleton()->get_theme_icon("Gizmo3DSamplePlayer", "EditorIcons"));
|
||||
create_icon_material("stream_player_3d_icon", Node3DEditor::get_singleton()->get_theme_icon(SNAME("Gizmo3DSamplePlayer"), SNAME("EditorIcons")));
|
||||
create_material("stream_player_3d_material_primary", gizmo_color);
|
||||
create_material("stream_player_3d_material_secondary", gizmo_color * Color(1, 1, 1, 0.35));
|
||||
create_handle_material("handles");
|
||||
|
@ -1558,7 +1558,7 @@ Position3DGizmoPlugin::Position3DGizmoPlugin() {
|
|||
// Use a darkened axis color for the negative axis.
|
||||
// This makes it possible to see in which direction the Position3D node is rotated
|
||||
// (which can be important depending on how it's used).
|
||||
const Color color_x = EditorNode::get_singleton()->get_gui_base()->get_theme_color("axis_x_color", "Editor");
|
||||
const Color color_x = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("axis_x_color"), SNAME("Editor"));
|
||||
cursor_colors.push_back(color_x);
|
||||
cursor_colors.push_back(color_x);
|
||||
// FIXME: Use less strong darkening factor once GH-48573 is fixed.
|
||||
|
@ -1566,13 +1566,13 @@ Position3DGizmoPlugin::Position3DGizmoPlugin() {
|
|||
cursor_colors.push_back(color_x.lerp(Color(0, 0, 0), 0.75));
|
||||
cursor_colors.push_back(color_x.lerp(Color(0, 0, 0), 0.75));
|
||||
|
||||
const Color color_y = EditorNode::get_singleton()->get_gui_base()->get_theme_color("axis_y_color", "Editor");
|
||||
const Color color_y = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("axis_y_color"), SNAME("Editor"));
|
||||
cursor_colors.push_back(color_y);
|
||||
cursor_colors.push_back(color_y);
|
||||
cursor_colors.push_back(color_y.lerp(Color(0, 0, 0), 0.75));
|
||||
cursor_colors.push_back(color_y.lerp(Color(0, 0, 0), 0.75));
|
||||
|
||||
const Color color_z = EditorNode::get_singleton()->get_gui_base()->get_theme_color("axis_z_color", "Editor");
|
||||
const Color color_z = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("axis_z_color"), SNAME("Editor"));
|
||||
cursor_colors.push_back(color_z);
|
||||
cursor_colors.push_back(color_z);
|
||||
cursor_colors.push_back(color_z.lerp(Color(0, 0, 0), 0.75));
|
||||
|
@ -2284,7 +2284,7 @@ void VisibleOnScreenNotifier3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
|
|||
////
|
||||
|
||||
CPUParticles3DGizmoPlugin::CPUParticles3DGizmoPlugin() {
|
||||
create_icon_material("particles_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoCPUParticles3D", "EditorIcons"));
|
||||
create_icon_material("particles_icon", Node3DEditor::get_singleton()->get_theme_icon(SNAME("GizmoCPUParticles3D"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
bool CPUParticles3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
|
||||
|
@ -2315,7 +2315,7 @@ GPUParticles3DGizmoPlugin::GPUParticles3DGizmoPlugin() {
|
|||
create_material("particles_material", gizmo_color);
|
||||
gizmo_color.a = 0.1;
|
||||
create_material("particles_solid_material", gizmo_color);
|
||||
create_icon_material("particles_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoGPUParticles3D", "EditorIcons"));
|
||||
create_icon_material("particles_icon", Node3DEditor::get_singleton()->get_theme_icon(SNAME("GizmoGPUParticles3D"), SNAME("EditorIcons")));
|
||||
create_handle_material("handles");
|
||||
}
|
||||
|
||||
|
@ -2746,7 +2746,7 @@ ReflectionProbeGizmoPlugin::ReflectionProbeGizmoPlugin() {
|
|||
gizmo_color.a = 0.1;
|
||||
create_material("reflection_probe_solid_material", gizmo_color);
|
||||
|
||||
create_icon_material("reflection_probe_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoReflectionProbe", "EditorIcons"));
|
||||
create_icon_material("reflection_probe_icon", Node3DEditor::get_singleton()->get_theme_icon(SNAME("GizmoReflectionProbe"), SNAME("EditorIcons")));
|
||||
create_handle_material("handles");
|
||||
}
|
||||
|
||||
|
@ -3072,7 +3072,7 @@ VoxelGIGizmoPlugin::VoxelGIGizmoPlugin() {
|
|||
gizmo_color.a = 0.05;
|
||||
create_material("voxel_gi_solid_material", gizmo_color);
|
||||
|
||||
create_icon_material("voxel_gi_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoVoxelGI", "EditorIcons"));
|
||||
create_icon_material("voxel_gi_icon", Node3DEditor::get_singleton()->get_theme_icon(SNAME("GizmoVoxelGI"), SNAME("EditorIcons")));
|
||||
create_handle_material("handles");
|
||||
}
|
||||
|
||||
|
@ -3254,7 +3254,7 @@ LightmapGIGizmoPlugin::LightmapGIGizmoPlugin() {
|
|||
|
||||
add_material("lightmap_probe_material", mat);
|
||||
|
||||
create_icon_material("baked_indirect_light_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoLightmapGI", "EditorIcons"));
|
||||
create_icon_material("baked_indirect_light_icon", Node3DEditor::get_singleton()->get_theme_icon(SNAME("GizmoLightmapGI"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
String LightmapGIGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
|
||||
|
@ -4589,7 +4589,7 @@ Joint3DGizmoPlugin::Joint3DGizmoPlugin() {
|
|||
update_timer->set_wait_time(1.0 / 120.0);
|
||||
update_timer->connect("timeout", callable_mp(this, &Joint3DGizmoPlugin::incremental_update_gizmos));
|
||||
update_timer->set_autostart(true);
|
||||
EditorNode::get_singleton()->call_deferred("add_child", update_timer);
|
||||
EditorNode::get_singleton()->call_deferred(SNAME("add_child"), update_timer);
|
||||
}
|
||||
|
||||
void Joint3DGizmoPlugin::incremental_update_gizmos() {
|
||||
|
|
|
@ -52,8 +52,8 @@ void NodeDock::_bind_methods() {
|
|||
|
||||
void NodeDock::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
connections_button->set_icon(get_theme_icon("Signals", "EditorIcons"));
|
||||
groups_button->set_icon(get_theme_icon("Groups", "EditorIcons"));
|
||||
connections_button->set_icon(get_theme_icon(SNAME("Signals"), SNAME("EditorIcons")));
|
||||
groups_button->set_icon(get_theme_icon(SNAME("Groups"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ void PluginConfigDialog::_on_confirmed() {
|
|||
}
|
||||
#endif
|
||||
|
||||
emit_signal("plugin_ready", script.operator->(), active_edit->is_pressed() ? _to_absolute_plugin_path(subfolder_edit->get_text()) : "");
|
||||
emit_signal(SNAME("plugin_ready"), script.operator->(), active_edit->is_pressed() ? _to_absolute_plugin_path(subfolder_edit->get_text()) : "");
|
||||
} else {
|
||||
EditorNode::get_singleton()->get_project_settings()->update_plugins();
|
||||
}
|
||||
|
@ -128,8 +128,8 @@ void PluginConfigDialog::_on_required_text_changed(const String &) {
|
|||
int lang_idx = script_option_edit->get_selected();
|
||||
String ext = ScriptServer::get_language(lang_idx)->get_extension();
|
||||
|
||||
Ref<Texture2D> valid_icon = get_theme_icon("StatusSuccess", "EditorIcons");
|
||||
Ref<Texture2D> invalid_icon = get_theme_icon("StatusWarning", "EditorIcons");
|
||||
Ref<Texture2D> valid_icon = get_theme_icon(SNAME("StatusSuccess"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> invalid_icon = get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons"));
|
||||
|
||||
// Set variables to assume all is valid
|
||||
bool is_valid = true;
|
||||
|
|
|
@ -150,9 +150,9 @@ void AbstractPolygon2DEditor::_notification(int p_what) {
|
|||
case NOTIFICATION_READY: {
|
||||
disable_polygon_editing(false, String());
|
||||
|
||||
button_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveCreate", "EditorIcons"));
|
||||
button_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveEdit", "EditorIcons"));
|
||||
button_delete->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveDelete", "EditorIcons"));
|
||||
button_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveCreate"), SNAME("EditorIcons")));
|
||||
button_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveEdit"), SNAME("EditorIcons")));
|
||||
button_delete->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveDelete"), SNAME("EditorIcons")));
|
||||
button_edit->set_pressed(true);
|
||||
|
||||
get_tree()->connect("node_removed", callable_mp(this, &AbstractPolygon2DEditor::_node_removed));
|
||||
|
@ -477,7 +477,7 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl
|
|||
|
||||
Transform2D xform = canvas_item_editor->get_canvas_transform() * _get_node()->get_global_transform();
|
||||
// All polygon points are sharp, so use the sharp handle icon
|
||||
const Ref<Texture2D> handle = get_theme_icon("EditorPathSharpHandle", "EditorIcons");
|
||||
const Ref<Texture2D> handle = get_theme_icon(SNAME("EditorPathSharpHandle"), SNAME("EditorIcons"));
|
||||
|
||||
const Vertex active_point = get_active_point();
|
||||
const int n_polygons = _get_polygon_count();
|
||||
|
@ -550,8 +550,8 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl
|
|||
p_overlay->draw_texture(handle, point - handle->get_size() * 0.5, modulate);
|
||||
|
||||
if (vertex == hover_point) {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
String num = String::num(vertex.vertex);
|
||||
Size2 num_size = font->get_string_size(num, font_size);
|
||||
p_overlay->draw_string(font, point - num_size * 0.5, num, HALIGN_LEFT, -1, font_size, Color(1.0, 1.0, 1.0, 0.5));
|
||||
|
@ -560,7 +560,7 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl
|
|||
}
|
||||
|
||||
if (edge_point.valid()) {
|
||||
Ref<Texture2D> add_handle = get_theme_icon("EditorHandleAdd", "EditorIcons");
|
||||
Ref<Texture2D> add_handle = get_theme_icon(SNAME("EditorHandleAdd"), SNAME("EditorIcons"));
|
||||
p_overlay->draw_texture(add_handle, edge_point.pos - add_handle->get_size() * 0.5);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven
|
|||
ap->get_animation_list(&names);
|
||||
|
||||
for (List<StringName>::Element *E = names.front(); E; E = E->next()) {
|
||||
animations_menu->add_icon_item(get_theme_icon("Animation", "EditorIcons"), E->get());
|
||||
animations_menu->add_icon_item(get_theme_icon(SNAME("Animation"), SNAME("EditorIcons")), E->get());
|
||||
animations_to_add.push_back(E->get());
|
||||
}
|
||||
}
|
||||
|
@ -196,19 +196,19 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven
|
|||
}
|
||||
|
||||
void AnimationNodeBlendSpace1DEditor::_blend_space_draw() {
|
||||
Color linecolor = get_theme_color("font_color", "Label");
|
||||
Color linecolor = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
Color linecolor_soft = linecolor;
|
||||
linecolor_soft.a *= 0.5;
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Texture2D> icon = get_theme_icon("KeyValue", "EditorIcons");
|
||||
Ref<Texture2D> icon_selected = get_theme_icon("KeySelected", "EditorIcons");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("KeyValue"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> icon_selected = get_theme_icon(SNAME("KeySelected"), SNAME("EditorIcons"));
|
||||
|
||||
Size2 s = blend_space_draw->get_size();
|
||||
|
||||
if (blend_space_draw->has_focus()) {
|
||||
Color color = get_theme_color("accent_color", "Editor");
|
||||
Color color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
blend_space_draw->draw_rect(Rect2(Point2(), s), color, false);
|
||||
}
|
||||
|
||||
|
@ -279,7 +279,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_draw() {
|
|||
{
|
||||
Color color;
|
||||
if (tool_blend->is_pressed()) {
|
||||
color = get_theme_color("accent_color", "Editor");
|
||||
color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
} else {
|
||||
color = linecolor;
|
||||
color.a *= 0.5;
|
||||
|
@ -529,15 +529,15 @@ void AnimationNodeBlendSpace1DEditor::_open_editor() {
|
|||
|
||||
void AnimationNodeBlendSpace1DEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree"));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor"));
|
||||
panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree"));
|
||||
tool_blend->set_icon(get_theme_icon("EditPivot", "EditorIcons"));
|
||||
tool_select->set_icon(get_theme_icon("ToolSelect", "EditorIcons"));
|
||||
tool_create->set_icon(get_theme_icon("EditKey", "EditorIcons"));
|
||||
tool_erase->set_icon(get_theme_icon("Remove", "EditorIcons"));
|
||||
snap->set_icon(get_theme_icon("SnapGrid", "EditorIcons"));
|
||||
open_editor->set_icon(get_theme_icon("Edit", "EditorIcons"));
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
tool_blend->set_icon(get_theme_icon(SNAME("EditPivot"), SNAME("EditorIcons")));
|
||||
tool_select->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
||||
tool_create->set_icon(get_theme_icon(SNAME("EditKey"), SNAME("EditorIcons")));
|
||||
tool_erase->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
snap->set_icon(get_theme_icon(SNAME("SnapGrid"), SNAME("EditorIcons")));
|
||||
open_editor->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_PROCESS) {
|
||||
|
|
|
@ -97,7 +97,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven
|
|||
List<StringName> names;
|
||||
ap->get_animation_list(&names);
|
||||
for (List<StringName>::Element *E = names.front(); E; E = E->next()) {
|
||||
animations_menu->add_icon_item(get_theme_icon("Animation", "EditorIcons"), E->get());
|
||||
animations_menu->add_icon_item(get_theme_icon(SNAME("Animation"), SNAME("EditorIcons")), E->get());
|
||||
animations_to_add.push_back(E->get());
|
||||
}
|
||||
}
|
||||
|
@ -392,18 +392,18 @@ void AnimationNodeBlendSpace2DEditor::_tool_switch(int p_tool) {
|
|||
}
|
||||
|
||||
void AnimationNodeBlendSpace2DEditor::_blend_space_draw() {
|
||||
Color linecolor = get_theme_color("font_color", "Label");
|
||||
Color linecolor = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
Color linecolor_soft = linecolor;
|
||||
linecolor_soft.a *= 0.5;
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Texture2D> icon = get_theme_icon("KeyValue", "EditorIcons");
|
||||
Ref<Texture2D> icon_selected = get_theme_icon("KeySelected", "EditorIcons");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("KeyValue"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> icon_selected = get_theme_icon(SNAME("KeySelected"), SNAME("EditorIcons"));
|
||||
|
||||
Size2 s = blend_space_draw->get_size();
|
||||
|
||||
if (blend_space_draw->has_focus()) {
|
||||
Color color = get_theme_color("accent_color", "Editor");
|
||||
Color color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
blend_space_draw->draw_rect(Rect2(Point2(), s), color, false);
|
||||
}
|
||||
blend_space_draw->draw_line(Point2(1, 0), Point2(1, s.height - 1), linecolor);
|
||||
|
@ -483,7 +483,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_draw() {
|
|||
|
||||
Color color;
|
||||
if (i == selected_triangle) {
|
||||
color = get_theme_color("accent_color", "Editor");
|
||||
color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
color.a *= 0.5;
|
||||
} else {
|
||||
color = linecolor;
|
||||
|
@ -543,7 +543,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_draw() {
|
|||
{
|
||||
Color color;
|
||||
if (tool_blend->is_pressed()) {
|
||||
color = get_theme_color("accent_color", "Editor");
|
||||
color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
} else {
|
||||
color = linecolor;
|
||||
color.a *= 0.5;
|
||||
|
@ -733,21 +733,21 @@ void AnimationNodeBlendSpace2DEditor::_edit_point_pos(double) {
|
|||
|
||||
void AnimationNodeBlendSpace2DEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree"));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor"));
|
||||
panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree"));
|
||||
tool_blend->set_icon(get_theme_icon("EditPivot", "EditorIcons"));
|
||||
tool_select->set_icon(get_theme_icon("ToolSelect", "EditorIcons"));
|
||||
tool_create->set_icon(get_theme_icon("EditKey", "EditorIcons"));
|
||||
tool_triangle->set_icon(get_theme_icon("ToolTriangle", "EditorIcons"));
|
||||
tool_erase->set_icon(get_theme_icon("Remove", "EditorIcons"));
|
||||
snap->set_icon(get_theme_icon("SnapGrid", "EditorIcons"));
|
||||
open_editor->set_icon(get_theme_icon("Edit", "EditorIcons"));
|
||||
auto_triangles->set_icon(get_theme_icon("AutoTriangle", "EditorIcons"));
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
tool_blend->set_icon(get_theme_icon(SNAME("EditPivot"), SNAME("EditorIcons")));
|
||||
tool_select->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
||||
tool_create->set_icon(get_theme_icon(SNAME("EditKey"), SNAME("EditorIcons")));
|
||||
tool_triangle->set_icon(get_theme_icon(SNAME("ToolTriangle"), SNAME("EditorIcons")));
|
||||
tool_erase->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
snap->set_icon(get_theme_icon(SNAME("SnapGrid"), SNAME("EditorIcons")));
|
||||
open_editor->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
auto_triangles->set_icon(get_theme_icon(SNAME("AutoTriangle"), SNAME("EditorIcons")));
|
||||
interpolation->clear();
|
||||
interpolation->add_icon_item(get_theme_icon("TrackContinuous", "EditorIcons"), "", 0);
|
||||
interpolation->add_icon_item(get_theme_icon("TrackDiscrete", "EditorIcons"), "", 1);
|
||||
interpolation->add_icon_item(get_theme_icon("TrackCapture", "EditorIcons"), "", 2);
|
||||
interpolation->add_icon_item(get_theme_icon(SNAME("TrackContinuous"), SNAME("EditorIcons")), "", 0);
|
||||
interpolation->add_icon_item(get_theme_icon(SNAME("TrackDiscrete"), SNAME("EditorIcons")), "", 1);
|
||||
interpolation->add_icon_item(get_theme_icon(SNAME("TrackCapture"), SNAME("EditorIcons")), "", 2);
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_PROCESS) {
|
||||
|
|
|
@ -138,7 +138,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
|
|||
name->set_text(E->get());
|
||||
name->set_expand_to_text_length_enabled(true);
|
||||
node->add_child(name);
|
||||
node->set_slot(0, false, 0, Color(), true, 0, get_theme_color("font_color", "Label"));
|
||||
node->set_slot(0, false, 0, Color(), true, 0, get_theme_color(SNAME("font_color"), SNAME("Label")));
|
||||
name->connect("text_submitted", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed), varray(agnode), CONNECT_DEFERRED);
|
||||
name->connect("focus_exited", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed_focus_out), varray(name, agnode), CONNECT_DEFERRED);
|
||||
base = 1;
|
||||
|
@ -150,7 +150,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
|
|||
Label *in_name = memnew(Label);
|
||||
node->add_child(in_name);
|
||||
in_name->set_text(agnode->get_input_name(i));
|
||||
node->set_slot(base + i, true, 0, get_theme_color("font_color", "Label"), false, 0, Color());
|
||||
node->set_slot(base + i, true, 0, get_theme_color(SNAME("font_color"), SNAME("Label")), false, 0, Color());
|
||||
}
|
||||
|
||||
List<PropertyInfo> pinfo;
|
||||
|
@ -177,7 +177,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
|
|||
node->add_child(memnew(HSeparator));
|
||||
Button *open_in_editor = memnew(Button);
|
||||
open_in_editor->set_text(TTR("Open Editor"));
|
||||
open_in_editor->set_icon(get_theme_icon("Edit", "EditorIcons"));
|
||||
open_in_editor->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
node->add_child(open_in_editor);
|
||||
open_in_editor->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_open_in_editor), varray(E->get()), CONNECT_DEFERRED);
|
||||
open_in_editor->set_h_size_flags(SIZE_SHRINK_CENTER);
|
||||
|
@ -187,7 +187,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
|
|||
node->add_child(memnew(HSeparator));
|
||||
Button *edit_filters = memnew(Button);
|
||||
edit_filters->set_text(TTR("Edit Filters"));
|
||||
edit_filters->set_icon(get_theme_icon("AnimationFilter", "EditorIcons"));
|
||||
edit_filters->set_icon(get_theme_icon(SNAME("AnimationFilter"), SNAME("EditorIcons")));
|
||||
node->add_child(edit_filters);
|
||||
edit_filters->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_edit_filters), varray(E->get()), CONNECT_DEFERRED);
|
||||
edit_filters->set_h_size_flags(SIZE_SHRINK_CENTER);
|
||||
|
@ -197,7 +197,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
|
|||
if (anim.is_valid()) {
|
||||
MenuButton *mb = memnew(MenuButton);
|
||||
mb->set_text(anim->get_animation());
|
||||
mb->set_icon(get_theme_icon("Animation", "EditorIcons"));
|
||||
mb->set_icon(get_theme_icon(SNAME("Animation"), SNAME("EditorIcons")));
|
||||
Array options;
|
||||
|
||||
node->add_child(memnew(HSeparator));
|
||||
|
@ -231,7 +231,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
|
|||
mb->get_popup()->connect("index_pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_anim_selected), varray(options, E->get()), CONNECT_DEFERRED);
|
||||
}
|
||||
|
||||
Ref<StyleBoxFlat> sb = node->get_theme_stylebox("frame", "GraphNode");
|
||||
Ref<StyleBoxFlat> sb = node->get_theme_stylebox(SNAME("frame"), SNAME("GraphNode"));
|
||||
Color c = sb->get_border_color();
|
||||
Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0) : Color(0.0, 0.0, 0.0);
|
||||
mono_color.a = 0.85;
|
||||
|
@ -617,7 +617,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
|
|||
ti->set_text(0, F->get());
|
||||
ti->set_selectable(0, false);
|
||||
ti->set_editable(0, false);
|
||||
ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons"));
|
||||
ti->set_icon(0, get_theme_icon(SNAME("BoneAttachment3D"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
ti = parenthood[accum];
|
||||
}
|
||||
|
@ -628,7 +628,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
|
|||
ti->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
|
||||
ti->set_text(0, concat);
|
||||
ti->set_checked(0, anode->is_path_filtered(path));
|
||||
ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons"));
|
||||
ti->set_icon(0, get_theme_icon(SNAME("BoneAttachment3D"), SNAME("EditorIcons")));
|
||||
ti->set_metadata(0, path);
|
||||
|
||||
} else {
|
||||
|
@ -690,8 +690,8 @@ void AnimationNodeBlendTreeEditor::_removed_from_graph() {
|
|||
|
||||
void AnimationNodeBlendTreeEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree"));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor"));
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
|
||||
if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) {
|
||||
_update_graph();
|
||||
|
|
|
@ -99,23 +99,23 @@ void AnimationPlayerEditor::_notification(int p_what) {
|
|||
|
||||
get_tree()->connect("node_removed", callable_mp(this, &AnimationPlayerEditor::_node_removed));
|
||||
|
||||
add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("panel", "Panel"));
|
||||
add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("panel"), SNAME("Panel")));
|
||||
} break;
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("panel", "Panel"));
|
||||
add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("panel"), SNAME("Panel")));
|
||||
} break;
|
||||
case NOTIFICATION_TRANSLATION_CHANGED:
|
||||
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
autoplay->set_icon(get_theme_icon("AutoPlay", "EditorIcons"));
|
||||
autoplay->set_icon(get_theme_icon(SNAME("AutoPlay"), SNAME("EditorIcons")));
|
||||
|
||||
play->set_icon(get_theme_icon("PlayStart", "EditorIcons"));
|
||||
play_from->set_icon(get_theme_icon("Play", "EditorIcons"));
|
||||
play_bw->set_icon(get_theme_icon("PlayStartBackwards", "EditorIcons"));
|
||||
play_bw_from->set_icon(get_theme_icon("PlayBackwards", "EditorIcons"));
|
||||
play->set_icon(get_theme_icon(SNAME("PlayStart"), SNAME("EditorIcons")));
|
||||
play_from->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
|
||||
play_bw->set_icon(get_theme_icon(SNAME("PlayStartBackwards"), SNAME("EditorIcons")));
|
||||
play_bw_from->set_icon(get_theme_icon(SNAME("PlayBackwards"), SNAME("EditorIcons")));
|
||||
|
||||
autoplay_icon = get_theme_icon("AutoPlay", "EditorIcons");
|
||||
reset_icon = get_theme_icon("Reload", "EditorIcons");
|
||||
autoplay_icon = get_theme_icon(SNAME("AutoPlay"), SNAME("EditorIcons"));
|
||||
reset_icon = get_theme_icon(SNAME("Reload"), SNAME("EditorIcons"));
|
||||
{
|
||||
Ref<Image> autoplay_img = autoplay_icon->get_image();
|
||||
Ref<Image> reset_img = reset_icon->get_image();
|
||||
|
@ -128,17 +128,17 @@ void AnimationPlayerEditor::_notification(int p_what) {
|
|||
autoplay_reset_icon.instantiate();
|
||||
autoplay_reset_icon->create_from_image(autoplay_reset_img);
|
||||
}
|
||||
stop->set_icon(get_theme_icon("Stop", "EditorIcons"));
|
||||
stop->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons")));
|
||||
|
||||
onion_toggle->set_icon(get_theme_icon("Onion", "EditorIcons"));
|
||||
onion_skinning->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons"));
|
||||
onion_toggle->set_icon(get_theme_icon(SNAME("Onion"), SNAME("EditorIcons")));
|
||||
onion_skinning->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||
|
||||
pin->set_icon(get_theme_icon("Pin", "EditorIcons"));
|
||||
pin->set_icon(get_theme_icon(SNAME("Pin"), SNAME("EditorIcons")));
|
||||
|
||||
tool_anim->add_theme_style_override("normal", get_theme_stylebox("normal", "Button"));
|
||||
track_editor->get_edit_menu()->add_theme_style_override("normal", get_theme_stylebox("normal", "Button"));
|
||||
tool_anim->add_theme_style_override("normal", get_theme_stylebox(SNAME("normal"), SNAME("Button")));
|
||||
track_editor->get_edit_menu()->add_theme_style_override("normal", get_theme_stylebox(SNAME("normal"), SNAME("Button")));
|
||||
|
||||
#define ITEM_ICON(m_item, m_icon) tool_anim->get_popup()->set_item_icon(tool_anim->get_popup()->get_item_index(m_item), get_theme_icon(m_icon, "EditorIcons"))
|
||||
#define ITEM_ICON(m_item, m_icon) tool_anim->get_popup()->set_item_icon(tool_anim->get_popup()->get_item_index(m_item), get_theme_icon(SNAME(m_icon), SNAME("EditorIcons")))
|
||||
|
||||
ITEM_ICON(TOOL_NEW_ANIM, "New");
|
||||
ITEM_ICON(TOOL_LOAD_ANIM, "Load");
|
||||
|
@ -373,7 +373,7 @@ void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource> &p_resou
|
|||
}
|
||||
|
||||
((Resource *)p_resource.ptr())->set_path(path);
|
||||
editor->emit_signal("resource_saved", p_resource);
|
||||
editor->emit_signal(SNAME("resource_saved"), p_resource);
|
||||
}
|
||||
|
||||
void AnimationPlayerEditor::_animation_save(const Ref<Resource> &p_resource) {
|
||||
|
@ -1324,11 +1324,11 @@ void AnimationPlayerEditor::_prepare_onion_layers_1() {
|
|||
}
|
||||
|
||||
// And go to next step afterwards.
|
||||
call_deferred("_prepare_onion_layers_2");
|
||||
call_deferred(SNAME("_prepare_onion_layers_2"));
|
||||
}
|
||||
|
||||
void AnimationPlayerEditor::_prepare_onion_layers_1_deferred() {
|
||||
call_deferred("_prepare_onion_layers_1");
|
||||
call_deferred(SNAME("_prepare_onion_layers_1"));
|
||||
}
|
||||
|
||||
void AnimationPlayerEditor::_prepare_onion_layers_2() {
|
||||
|
|
|
@ -94,7 +94,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
|
|||
List<StringName> names;
|
||||
ap->get_animation_list(&names);
|
||||
for (List<StringName>::Element *E = names.front(); E; E = E->next()) {
|
||||
animations_menu->add_icon_item(get_theme_icon("Animation", "EditorIcons"), E->get());
|
||||
animations_menu->add_icon_item(get_theme_icon(SNAME("Animation"), SNAME("EditorIcons")), E->get());
|
||||
animations_to_add.push_back(E->get());
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
|
|||
|
||||
if (node_rects[i].name.has_point(mb->get_position())) { //edit name
|
||||
|
||||
Ref<StyleBox> line_sb = get_theme_stylebox("normal", "LineEdit");
|
||||
Ref<StyleBox> line_sb = get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"));
|
||||
|
||||
Rect2 edit_rect = node_rects[i].name;
|
||||
edit_rect.position -= line_sb->get_offset();
|
||||
|
@ -163,7 +163,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
|
|||
}
|
||||
|
||||
if (node_rects[i].edit.has_point(mb->get_position())) { //edit name
|
||||
call_deferred("_open_editor", node_rects[i].node_name);
|
||||
call_deferred(SNAME("_open_editor"), node_rects[i].node_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -487,9 +487,9 @@ void AnimationNodeStateMachineEditor::_add_animation_type(int p_index) {
|
|||
}
|
||||
|
||||
void AnimationNodeStateMachineEditor::_connection_draw(const Vector2 &p_from, const Vector2 &p_to, AnimationNodeStateMachineTransition::SwitchMode p_mode, bool p_enabled, bool p_selected, bool p_travel, bool p_auto_advance) {
|
||||
Color linecolor = get_theme_color("font_color", "Label");
|
||||
Color linecolor = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
Color icon_color(1, 1, 1);
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
|
||||
if (!p_enabled) {
|
||||
linecolor.a *= 0.2;
|
||||
|
@ -498,12 +498,12 @@ void AnimationNodeStateMachineEditor::_connection_draw(const Vector2 &p_from, co
|
|||
}
|
||||
|
||||
Ref<Texture2D> icons[6] = {
|
||||
get_theme_icon("TransitionImmediateBig", "EditorIcons"),
|
||||
get_theme_icon("TransitionSyncBig", "EditorIcons"),
|
||||
get_theme_icon("TransitionEndBig", "EditorIcons"),
|
||||
get_theme_icon("TransitionImmediateAutoBig", "EditorIcons"),
|
||||
get_theme_icon("TransitionSyncAutoBig", "EditorIcons"),
|
||||
get_theme_icon("TransitionEndAutoBig", "EditorIcons")
|
||||
get_theme_icon(SNAME("TransitionImmediateBig"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("TransitionSyncBig"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("TransitionEndBig"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("TransitionImmediateAutoBig"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("TransitionSyncAutoBig"), SNAME("EditorIcons")),
|
||||
get_theme_icon(SNAME("TransitionEndAutoBig"), SNAME("EditorIcons"))
|
||||
};
|
||||
|
||||
if (p_selected) {
|
||||
|
@ -555,19 +555,19 @@ void AnimationNodeStateMachineEditor::_clip_dst_line_to_rect(Vector2 &r_from, Ve
|
|||
void AnimationNodeStateMachineEditor::_state_machine_draw() {
|
||||
Ref<AnimationNodeStateMachinePlayback> playback = AnimationTreeEditor::get_singleton()->get_tree()->get(AnimationTreeEditor::get_singleton()->get_base_path() + "playback");
|
||||
|
||||
Ref<StyleBox> style = get_theme_stylebox("state_machine_frame", "GraphNode");
|
||||
Ref<StyleBox> style_selected = get_theme_stylebox("state_machine_selectedframe", "GraphNode");
|
||||
Ref<StyleBox> style = get_theme_stylebox(SNAME("state_machine_frame"), SNAME("GraphNode"));
|
||||
Ref<StyleBox> style_selected = get_theme_stylebox(SNAME("state_machine_selectedframe"), SNAME("GraphNode"));
|
||||
|
||||
Ref<Font> font = get_theme_font("title_font", "GraphNode");
|
||||
int font_size = get_theme_font_size("title_font_size", "GraphNode");
|
||||
Color font_color = get_theme_color("title_color", "GraphNode");
|
||||
Ref<Texture2D> play = get_theme_icon("Play", "EditorIcons");
|
||||
Ref<Texture2D> auto_play = get_theme_icon("AutoPlay", "EditorIcons");
|
||||
Ref<Texture2D> edit = get_theme_icon("Edit", "EditorIcons");
|
||||
Color accent = get_theme_color("accent_color", "Editor");
|
||||
Color linecolor = get_theme_color("font_color", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("title_font"), SNAME("GraphNode"));
|
||||
int font_size = get_theme_font_size(SNAME("title_font_size"), SNAME("GraphNode"));
|
||||
Color font_color = get_theme_color(SNAME("title_color"), SNAME("GraphNode"));
|
||||
Ref<Texture2D> play = get_theme_icon(SNAME("Play"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> auto_play = get_theme_icon(SNAME("AutoPlay"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> edit = get_theme_icon(SNAME("Edit"), SNAME("EditorIcons"));
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color linecolor = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
linecolor.a *= 0.3;
|
||||
Ref<StyleBox> playing_overlay = get_theme_stylebox("position", "GraphNode");
|
||||
Ref<StyleBox> playing_overlay = get_theme_stylebox(SNAME("position"), SNAME("GraphNode"));
|
||||
|
||||
bool playing = false;
|
||||
StringName current;
|
||||
|
@ -667,7 +667,7 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() {
|
|||
_connection_draw(from, to, AnimationNodeStateMachineTransition::SwitchMode(transition_mode->get_selected()), true, false, false, false);
|
||||
}
|
||||
|
||||
Ref<Texture2D> tr_reference_icon = get_theme_icon("TransitionImmediateBig", "EditorIcons");
|
||||
Ref<Texture2D> tr_reference_icon = get_theme_icon(SNAME("TransitionImmediateBig"), SNAME("EditorIcons"));
|
||||
float tr_bidi_offset = int(tr_reference_icon->get_height() * 0.8);
|
||||
|
||||
//draw transition lines
|
||||
|
@ -857,7 +857,7 @@ void AnimationNodeStateMachineEditor::_state_machine_pos_draw() {
|
|||
|
||||
float pos = CLAMP(play_pos, 0, len);
|
||||
float c = pos / len;
|
||||
Color fg = get_theme_color("font_color", "Label");
|
||||
Color fg = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
Color bg = fg;
|
||||
bg.a *= 0.3;
|
||||
|
||||
|
@ -882,26 +882,26 @@ void AnimationNodeStateMachineEditor::_update_graph() {
|
|||
|
||||
void AnimationNodeStateMachineEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_LAYOUT_DIRECTION_CHANGED || p_what == NOTIFICATION_TRANSLATION_CHANGED) {
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree"));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor"));
|
||||
panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree"));
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
|
||||
tool_select->set_icon(get_theme_icon("ToolSelect", "EditorIcons"));
|
||||
tool_create->set_icon(get_theme_icon("ToolAddNode", "EditorIcons"));
|
||||
tool_connect->set_icon(get_theme_icon("ToolConnect", "EditorIcons"));
|
||||
tool_select->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
||||
tool_create->set_icon(get_theme_icon(SNAME("ToolAddNode"), SNAME("EditorIcons")));
|
||||
tool_connect->set_icon(get_theme_icon(SNAME("ToolConnect"), SNAME("EditorIcons")));
|
||||
|
||||
transition_mode->clear();
|
||||
transition_mode->add_icon_item(get_theme_icon("TransitionImmediate", "EditorIcons"), TTR("Immediate"));
|
||||
transition_mode->add_icon_item(get_theme_icon("TransitionSync", "EditorIcons"), TTR("Sync"));
|
||||
transition_mode->add_icon_item(get_theme_icon("TransitionEnd", "EditorIcons"), TTR("At End"));
|
||||
transition_mode->add_icon_item(get_theme_icon(SNAME("TransitionImmediate"), SNAME("EditorIcons")), TTR("Immediate"));
|
||||
transition_mode->add_icon_item(get_theme_icon(SNAME("TransitionSync"), SNAME("EditorIcons")), TTR("Sync"));
|
||||
transition_mode->add_icon_item(get_theme_icon(SNAME("TransitionEnd"), SNAME("EditorIcons")), TTR("At End"));
|
||||
|
||||
tool_erase->set_icon(get_theme_icon("Remove", "EditorIcons"));
|
||||
tool_autoplay->set_icon(get_theme_icon("AutoPlay", "EditorIcons"));
|
||||
tool_end->set_icon(get_theme_icon("AutoEnd", "EditorIcons"));
|
||||
tool_erase->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
tool_autoplay->set_icon(get_theme_icon(SNAME("AutoPlay"), SNAME("EditorIcons")));
|
||||
tool_end->set_icon(get_theme_icon(SNAME("AutoEnd"), SNAME("EditorIcons")));
|
||||
|
||||
play_mode->clear();
|
||||
play_mode->add_icon_item(get_theme_icon("PlayTravel", "EditorIcons"), TTR("Travel"));
|
||||
play_mode->add_icon_item(get_theme_icon("Play", "EditorIcons"), TTR("Immediate"));
|
||||
play_mode->add_icon_item(get_theme_icon(SNAME("PlayTravel"), SNAME("EditorIcons")), TTR("Travel"));
|
||||
play_mode->add_icon_item(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")), TTR("Immediate"));
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_PROCESS) {
|
||||
|
|
|
@ -58,7 +58,7 @@ void EditorAssetLibraryItem::set_image(int p_type, int p_index, const Ref<Textur
|
|||
|
||||
void EditorAssetLibraryItem::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
icon->set_normal_texture(get_theme_icon("ProjectIconLoading", "EditorIcons"));
|
||||
icon->set_normal_texture(get_theme_icon(SNAME("ProjectIconLoading"), SNAME("EditorIcons")));
|
||||
category->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
|
||||
author->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
|
||||
price->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
|
||||
|
@ -66,15 +66,15 @@ void EditorAssetLibraryItem::_notification(int p_what) {
|
|||
}
|
||||
|
||||
void EditorAssetLibraryItem::_asset_clicked() {
|
||||
emit_signal("asset_selected", asset_id);
|
||||
emit_signal(SNAME("asset_selected"), asset_id);
|
||||
}
|
||||
|
||||
void EditorAssetLibraryItem::_category_clicked() {
|
||||
emit_signal("category_selected", category_id);
|
||||
emit_signal(SNAME("category_selected"), category_id);
|
||||
}
|
||||
|
||||
void EditorAssetLibraryItem::_author_clicked() {
|
||||
emit_signal("author_selected", author_id);
|
||||
emit_signal(SNAME("author_selected"), author_id);
|
||||
}
|
||||
|
||||
void EditorAssetLibraryItem::_bind_methods() {
|
||||
|
@ -144,7 +144,7 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const
|
|||
for (int i = 0; i < preview_images.size(); i++) {
|
||||
if (preview_images[i].id == p_index) {
|
||||
if (preview_images[i].is_video) {
|
||||
Ref<Image> overlay = previews->get_theme_icon("PlayOverlay", "EditorIcons")->get_image();
|
||||
Ref<Image> overlay = previews->get_theme_icon(SNAME("PlayOverlay"), SNAME("EditorIcons"))->get_image();
|
||||
Ref<Image> thumbnail = p_image->get_image();
|
||||
thumbnail = thumbnail->duplicate();
|
||||
Point2 overlay_pos = Point2((thumbnail->get_width() - overlay->get_width()) / 2, (thumbnail->get_height() - overlay->get_height()) / 2);
|
||||
|
@ -185,7 +185,7 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const
|
|||
void EditorAssetLibraryItemDescription::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
previews_bg->add_theme_style_override("panel", previews->get_theme_stylebox("normal", "TextEdit"));
|
||||
previews_bg->add_theme_style_override("panel", previews->get_theme_stylebox(SNAME("normal"), SNAME("TextEdit")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
@ -240,12 +240,12 @@ void EditorAssetLibraryItemDescription::add_preview(int p_id, bool p_video, cons
|
|||
preview.video_link = p_url;
|
||||
preview.is_video = p_video;
|
||||
preview.button = memnew(Button);
|
||||
preview.button->set_icon(previews->get_theme_icon("ThumbnailWait", "EditorIcons"));
|
||||
preview.button->set_icon(previews->get_theme_icon(SNAME("ThumbnailWait"), SNAME("EditorIcons")));
|
||||
preview.button->set_toggle_mode(true);
|
||||
preview.button->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDescription::_preview_click), varray(p_id));
|
||||
preview_hb->add_child(preview.button);
|
||||
if (!p_video) {
|
||||
preview.image = previews->get_theme_icon("ThumbnailWait", "EditorIcons");
|
||||
preview.image = previews->get_theme_icon(SNAME("ThumbnailWait"), SNAME("EditorIcons"));
|
||||
}
|
||||
preview_images.push_back(preview);
|
||||
if (preview_images.size() == 1 && !p_video) {
|
||||
|
@ -379,7 +379,7 @@ void EditorAssetLibraryItemDownload::configure(const String &p_title, int p_asse
|
|||
icon->set_texture(p_preview);
|
||||
asset_id = p_asset_id;
|
||||
if (!p_preview.is_valid()) {
|
||||
icon->set_texture(get_theme_icon("FileBrokenBigThumb", "EditorIcons"));
|
||||
icon->set_texture(get_theme_icon(SNAME("FileBrokenBigThumb"), SNAME("EditorIcons")));
|
||||
}
|
||||
host = p_download_url;
|
||||
sha256 = p_sha256_hash;
|
||||
|
@ -390,8 +390,8 @@ void EditorAssetLibraryItemDownload::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
// FIXME: The editor crashes if 'NOTICATION_THEME_CHANGED' is used.
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
add_theme_style_override("panel", get_theme_stylebox("panel", "TabContainer"));
|
||||
dismiss->set_normal_texture(get_theme_icon("Close", "EditorIcons"));
|
||||
add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")));
|
||||
dismiss->set_normal_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
case NOTIFICATION_PROCESS: {
|
||||
// Make the progress bar visible again when retrying the download.
|
||||
|
@ -455,7 +455,7 @@ void EditorAssetLibraryItemDownload::_install() {
|
|||
String file = download->get_download_file();
|
||||
|
||||
if (external_install) {
|
||||
emit_signal("install_asset", file, title->get_text());
|
||||
emit_signal(SNAME("install_asset"), file, title->get_text());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -553,8 +553,8 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
|
|||
void EditorAssetLibrary::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_READY: {
|
||||
error_tr->set_texture(get_theme_icon("Error", "EditorIcons"));
|
||||
filter->set_right_icon(get_theme_icon("Search", "EditorIcons"));
|
||||
error_tr->set_texture(get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
|
||||
filter->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
filter->set_clear_button_enabled(true);
|
||||
|
||||
error_label->raise();
|
||||
|
@ -588,10 +588,10 @@ void EditorAssetLibrary::_notification(int p_what) {
|
|||
|
||||
} break;
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
library_scroll_bg->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree"));
|
||||
downloads_scroll->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree"));
|
||||
error_tr->set_texture(get_theme_icon("Error", "EditorIcons"));
|
||||
filter->set_right_icon(get_theme_icon("Search", "EditorIcons"));
|
||||
library_scroll_bg->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
downloads_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
error_tr->set_texture(get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
|
||||
filter->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
filter->set_clear_button_enabled(true);
|
||||
} break;
|
||||
|
||||
|
@ -773,7 +773,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PackedB
|
|||
}
|
||||
|
||||
if (!image_set && final) {
|
||||
obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_theme_icon("FileBrokenBigThumb", "EditorIcons"));
|
||||
obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_theme_icon(SNAME("FileBrokenBigThumb"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -816,7 +816,7 @@ void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, cons
|
|||
WARN_PRINT("Error getting image file from URL: " + image_queue[p_queue_id].image_url);
|
||||
Object *obj = ObjectDB::get_instance(image_queue[p_queue_id].target);
|
||||
if (obj) {
|
||||
obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_theme_icon("FileBrokenBigThumb", "EditorIcons"));
|
||||
obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_theme_icon(SNAME("FileBrokenBigThumb"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1315,7 +1315,7 @@ void EditorAssetLibrary::_manage_plugins() {
|
|||
}
|
||||
|
||||
void EditorAssetLibrary::_install_external_asset(String p_zip_path, String p_title) {
|
||||
emit_signal("install_asset", p_zip_path, p_title);
|
||||
emit_signal(SNAME("install_asset"), p_zip_path, p_title);
|
||||
}
|
||||
|
||||
void EditorAssetLibrary::disable_community_support() {
|
||||
|
@ -1490,7 +1490,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
|
|||
error_hb = memnew(HBoxContainer);
|
||||
library_main->add_child(error_hb);
|
||||
error_label = memnew(Label);
|
||||
error_label->add_theme_color_override("color", get_theme_color("error_color", "Editor"));
|
||||
error_label->add_theme_color_override("color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
error_hb->add_child(error_label);
|
||||
error_tr = memnew(TextureRect);
|
||||
error_tr->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
|
||||
|
|
|
@ -43,10 +43,10 @@ void AudioStreamEditor::_notification(int p_what) {
|
|||
}
|
||||
|
||||
if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) {
|
||||
_play_button->set_icon(get_theme_icon("MainPlay", "EditorIcons"));
|
||||
_stop_button->set_icon(get_theme_icon("Stop", "EditorIcons"));
|
||||
_preview->set_color(get_theme_color("dark_color_2", "Editor"));
|
||||
set_color(get_theme_color("dark_color_1", "Editor"));
|
||||
_play_button->set_icon(get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons")));
|
||||
_stop_button->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons")));
|
||||
_preview->set_color(get_theme_color(SNAME("dark_color_2"), SNAME("Editor")));
|
||||
set_color(get_theme_color(SNAME("dark_color_1"), SNAME("Editor")));
|
||||
|
||||
_indicator->update();
|
||||
_preview->update();
|
||||
|
@ -86,7 +86,7 @@ void AudioStreamEditor::_draw_preview() {
|
|||
}
|
||||
|
||||
Vector<Color> color;
|
||||
color.push_back(get_theme_color("contrast_color_2", "Editor"));
|
||||
color.push_back(get_theme_color(SNAME("contrast_color_2"), SNAME("Editor")));
|
||||
|
||||
RS::get_singleton()->canvas_item_add_multiline(_preview->get_canvas_item(), lines, color);
|
||||
}
|
||||
|
@ -109,25 +109,25 @@ void AudioStreamEditor::_play() {
|
|||
// '_pausing' variable indicates that we want to pause the audio player, not stop it. See '_on_finished()'.
|
||||
_pausing = true;
|
||||
_player->stop();
|
||||
_play_button->set_icon(get_theme_icon("MainPlay", "EditorIcons"));
|
||||
_play_button->set_icon(get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons")));
|
||||
set_process(false);
|
||||
} else {
|
||||
_player->play(_current);
|
||||
_play_button->set_icon(get_theme_icon("Pause", "EditorIcons"));
|
||||
_play_button->set_icon(get_theme_icon(SNAME("Pause"), SNAME("EditorIcons")));
|
||||
set_process(true);
|
||||
}
|
||||
}
|
||||
|
||||
void AudioStreamEditor::_stop() {
|
||||
_player->stop();
|
||||
_play_button->set_icon(get_theme_icon("MainPlay", "EditorIcons"));
|
||||
_play_button->set_icon(get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons")));
|
||||
_current = 0;
|
||||
_indicator->update();
|
||||
set_process(false);
|
||||
}
|
||||
|
||||
void AudioStreamEditor::_on_finished() {
|
||||
_play_button->set_icon(get_theme_icon("MainPlay", "EditorIcons"));
|
||||
_play_button->set_icon(get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons")));
|
||||
if (!_pausing) {
|
||||
_current = 0;
|
||||
_indicator->update();
|
||||
|
@ -145,11 +145,11 @@ void AudioStreamEditor::_draw_indicator() {
|
|||
Rect2 rect = _preview->get_rect();
|
||||
float len = stream->get_length();
|
||||
float ofs_x = _current / len * rect.size.width;
|
||||
const Color color = get_theme_color("accent_color", "Editor");
|
||||
const Color color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
_indicator->draw_line(Point2(ofs_x, 0), Point2(ofs_x, rect.size.height), color, Math::round(2 * EDSCALE));
|
||||
_indicator->draw_texture(
|
||||
get_theme_icon("TimelineIndicator", "EditorIcons"),
|
||||
Point2(ofs_x - get_theme_icon("TimelineIndicator", "EditorIcons")->get_width() * 0.5, 0),
|
||||
get_theme_icon(SNAME("TimelineIndicator"), SNAME("EditorIcons")),
|
||||
Point2(ofs_x - get_theme_icon(SNAME("TimelineIndicator"), SNAME("EditorIcons"))->get_width() * 0.5, 0),
|
||||
color);
|
||||
|
||||
_current_label->set_text(String::num(_current, 2).pad_decimals(2) + " /");
|
||||
|
@ -243,14 +243,14 @@ AudioStreamEditor::AudioStreamEditor() {
|
|||
_current_label = memnew(Label);
|
||||
_current_label->set_align(Label::ALIGN_RIGHT);
|
||||
_current_label->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
_current_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("status_source", "EditorFonts"));
|
||||
_current_label->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size("status_source_size", "EditorFonts"));
|
||||
_current_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
|
||||
_current_label->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
|
||||
_current_label->set_modulate(Color(1, 1, 1, 0.5));
|
||||
hbox->add_child(_current_label);
|
||||
|
||||
_duration_label = memnew(Label);
|
||||
_duration_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("status_source", "EditorFonts"));
|
||||
_duration_label->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size("status_source_size", "EditorFonts"));
|
||||
_duration_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
|
||||
_duration_label->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
|
||||
hbox->add_child(_duration_label);
|
||||
}
|
||||
|
||||
|
|
|
@ -903,7 +903,7 @@ void CanvasItemEditor::_node_created(Node *p_node) {
|
|||
c->_edit_set_position(xform.xform(node_create_position));
|
||||
}
|
||||
|
||||
call_deferred("_reset_create_position"); // Defer the call in case more than one node is added.
|
||||
call_deferred(SNAME("_reset_create_position")); // Defer the call in case more than one node is added.
|
||||
}
|
||||
|
||||
void CanvasItemEditor::_reset_create_position() {
|
||||
|
@ -2529,7 +2529,7 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) {
|
|||
|
||||
// Grab focus
|
||||
if (!viewport->has_focus() && (!get_focus_owner() || !get_focus_owner()->is_text_field())) {
|
||||
viewport->call_deferred("grab_focus");
|
||||
viewport->call_deferred(SNAME("grab_focus"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2617,10 +2617,10 @@ void CanvasItemEditor::_update_cursor() {
|
|||
}
|
||||
|
||||
void CanvasItemEditor::_draw_text_at_position(Point2 p_position, String p_string, Side p_side) {
|
||||
Color color = get_theme_color("font_color", "Editor");
|
||||
Color color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
|
||||
color.a = 0.8;
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
Size2 text_size = font->get_string_size(p_string, font_size);
|
||||
switch (p_side) {
|
||||
case SIDE_LEFT:
|
||||
|
@ -2656,7 +2656,7 @@ void CanvasItemEditor::_draw_percentage_at_position(float p_value, Point2 p_posi
|
|||
void CanvasItemEditor::_draw_focus() {
|
||||
// Draw the focus around the base viewport
|
||||
if (viewport->has_focus()) {
|
||||
get_theme_stylebox("Focus", "EditorStyles")->draw(viewport->get_canvas_item(), Rect2(Point2(), viewport->get_size()));
|
||||
get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles"))->draw(viewport->get_canvas_item(), Rect2(Point2(), viewport->get_size()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2688,21 +2688,21 @@ void CanvasItemEditor::_draw_guides() {
|
|||
}
|
||||
|
||||
// Dragged guide
|
||||
Color text_color = get_theme_color("font_color", "Editor");
|
||||
Color text_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
|
||||
Color outline_color = text_color.inverted();
|
||||
const float outline_size = 2;
|
||||
if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_V_GUIDE) {
|
||||
String str = TS->format_number(vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).x)));
|
||||
Ref<Font> font = get_theme_font("bold", "EditorFonts");
|
||||
int font_size = get_theme_font_size("bold_size", "EditorFonts");
|
||||
Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts"));
|
||||
int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts"));
|
||||
Size2 text_size = font->get_string_size(str, font_size);
|
||||
viewport->draw_string(font, Point2(dragged_guide_pos.x + 10, RULER_WIDTH + text_size.y / 2 + 10), str, HALIGN_LEFT, -1, font_size, text_color, outline_size, outline_color);
|
||||
viewport->draw_line(Point2(dragged_guide_pos.x, 0), Point2(dragged_guide_pos.x, viewport->get_size().y), guide_color, Math::round(EDSCALE));
|
||||
}
|
||||
if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_H_GUIDE) {
|
||||
String str = TS->format_number(vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).y)));
|
||||
Ref<Font> font = get_theme_font("bold", "EditorFonts");
|
||||
int font_size = get_theme_font_size("bold_size", "EditorFonts");
|
||||
Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts"));
|
||||
int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts"));
|
||||
Size2 text_size = font->get_string_size(str, font_size);
|
||||
viewport->draw_string(font, Point2(RULER_WIDTH + 10, dragged_guide_pos.y + text_size.y / 2 + 10), str, HALIGN_LEFT, -1, font_size, text_color, outline_size, outline_color);
|
||||
viewport->draw_line(Point2(0, dragged_guide_pos.y), Point2(viewport->get_size().x, dragged_guide_pos.y), guide_color, Math::round(EDSCALE));
|
||||
|
@ -2724,12 +2724,12 @@ void CanvasItemEditor::_draw_smart_snapping() {
|
|||
}
|
||||
|
||||
void CanvasItemEditor::_draw_rulers() {
|
||||
Color bg_color = get_theme_color("dark_color_2", "Editor");
|
||||
Color graduation_color = get_theme_color("font_color", "Editor").lerp(bg_color, 0.5);
|
||||
Color font_color = get_theme_color("font_color", "Editor");
|
||||
Color bg_color = get_theme_color(SNAME("dark_color_2"), SNAME("Editor"));
|
||||
Color graduation_color = get_theme_color(SNAME("font_color"), SNAME("Editor")).lerp(bg_color, 0.5);
|
||||
Color font_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
|
||||
font_color.a = 0.8;
|
||||
Ref<Font> font = get_theme_font("rulers", "EditorFonts");
|
||||
int font_size = get_theme_font_size("rulers_size", "EditorFonts");
|
||||
Ref<Font> font = get_theme_font(SNAME("rulers"), SNAME("EditorFonts"));
|
||||
int font_size = get_theme_font_size(SNAME("rulers_size"), SNAME("EditorFonts"));
|
||||
|
||||
// The rule transform
|
||||
Transform2D ruler_transform = Transform2D();
|
||||
|
@ -2890,7 +2890,7 @@ void CanvasItemEditor::_draw_ruler_tool() {
|
|||
}
|
||||
|
||||
if (ruler_tool_active) {
|
||||
Color ruler_primary_color = get_theme_color("accent_color", "Editor");
|
||||
Color ruler_primary_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color ruler_secondary_color = ruler_primary_color;
|
||||
ruler_secondary_color.a = 0.5;
|
||||
|
||||
|
@ -2907,9 +2907,9 @@ void CanvasItemEditor::_draw_ruler_tool() {
|
|||
viewport->draw_line(corner, end, ruler_secondary_color, Math::round(EDSCALE));
|
||||
}
|
||||
|
||||
Ref<Font> font = get_theme_font("bold", "EditorFonts");
|
||||
int font_size = get_theme_font_size("bold_size", "EditorFonts");
|
||||
Color font_color = get_theme_color("font_color", "Editor");
|
||||
Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts"));
|
||||
int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts"));
|
||||
Color font_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
|
||||
Color font_secondary_color = font_color;
|
||||
font_secondary_color.set_v(font_secondary_color.get_v() > 0.5 ? 0.7 : 0.3);
|
||||
Color outline_color = font_color.inverted();
|
||||
|
@ -3010,8 +3010,8 @@ void CanvasItemEditor::_draw_ruler_tool() {
|
|||
}
|
||||
} else {
|
||||
if (grid_snap_active) {
|
||||
Ref<Texture2D> position_icon = get_theme_icon("EditorPosition", "EditorIcons");
|
||||
viewport->draw_texture(get_theme_icon("EditorPosition", "EditorIcons"), (ruler_tool_origin - view_offset) * zoom - position_icon->get_size() / 2);
|
||||
Ref<Texture2D> position_icon = get_theme_icon(SNAME("EditorPosition"), SNAME("EditorIcons"));
|
||||
viewport->draw_texture(get_theme_icon(SNAME("EditorPosition"), SNAME("EditorIcons")), (ruler_tool_origin - view_offset) * zoom - position_icon->get_size() / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3229,9 +3229,9 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) {
|
|||
}
|
||||
|
||||
void CanvasItemEditor::_draw_selection() {
|
||||
Ref<Texture2D> pivot_icon = get_theme_icon("EditorPivot", "EditorIcons");
|
||||
Ref<Texture2D> position_icon = get_theme_icon("EditorPosition", "EditorIcons");
|
||||
Ref<Texture2D> previous_position_icon = get_theme_icon("EditorPositionPrevious", "EditorIcons");
|
||||
Ref<Texture2D> pivot_icon = get_theme_icon(SNAME("EditorPivot"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> position_icon = get_theme_icon(SNAME("EditorPosition"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> previous_position_icon = get_theme_icon(SNAME("EditorPositionPrevious"), SNAME("EditorIcons"));
|
||||
|
||||
RID ci = viewport->get_canvas_item();
|
||||
|
||||
|
@ -3357,16 +3357,16 @@ void CanvasItemEditor::_draw_selection() {
|
|||
points.push_back(Vector2(move_factor.x * EDSCALE, -5 * EDSCALE));
|
||||
points.push_back(Vector2((move_factor.x + 10) * EDSCALE, 0));
|
||||
|
||||
viewport->draw_colored_polygon(points, get_theme_color("axis_x_color", "Editor"));
|
||||
viewport->draw_line(Point2(), Point2(move_factor.x * EDSCALE, 0), get_theme_color("axis_x_color", "Editor"), Math::round(EDSCALE));
|
||||
viewport->draw_colored_polygon(points, get_theme_color(SNAME("axis_x_color"), SNAME("Editor")));
|
||||
viewport->draw_line(Point2(), Point2(move_factor.x * EDSCALE, 0), get_theme_color(SNAME("axis_x_color"), SNAME("Editor")), Math::round(EDSCALE));
|
||||
|
||||
points.clear();
|
||||
points.push_back(Vector2(5 * EDSCALE, move_factor.y * EDSCALE));
|
||||
points.push_back(Vector2(-5 * EDSCALE, move_factor.y * EDSCALE));
|
||||
points.push_back(Vector2(0, (move_factor.y + 10) * EDSCALE));
|
||||
|
||||
viewport->draw_colored_polygon(points, get_theme_color("axis_y_color", "Editor"));
|
||||
viewport->draw_line(Point2(), Point2(0, move_factor.y * EDSCALE), get_theme_color("axis_y_color", "Editor"), Math::round(EDSCALE));
|
||||
viewport->draw_colored_polygon(points, get_theme_color(SNAME("axis_y_color"), SNAME("Editor")));
|
||||
viewport->draw_line(Point2(), Point2(0, move_factor.y * EDSCALE), get_theme_color(SNAME("axis_y_color"), SNAME("Editor")), Math::round(EDSCALE));
|
||||
|
||||
viewport->draw_set_transform_matrix(viewport->get_transform());
|
||||
}
|
||||
|
@ -3396,12 +3396,12 @@ void CanvasItemEditor::_draw_selection() {
|
|||
|
||||
viewport->draw_set_transform_matrix(simple_xform);
|
||||
Rect2 x_handle_rect = Rect2(scale_factor.x * EDSCALE, -5 * EDSCALE, 10 * EDSCALE, 10 * EDSCALE);
|
||||
viewport->draw_rect(x_handle_rect, get_theme_color("axis_x_color", "Editor"));
|
||||
viewport->draw_line(Point2(), Point2(scale_factor.x * EDSCALE, 0), get_theme_color("axis_x_color", "Editor"), Math::round(EDSCALE));
|
||||
viewport->draw_rect(x_handle_rect, get_theme_color(SNAME("axis_x_color"), SNAME("Editor")));
|
||||
viewport->draw_line(Point2(), Point2(scale_factor.x * EDSCALE, 0), get_theme_color(SNAME("axis_x_color"), SNAME("Editor")), Math::round(EDSCALE));
|
||||
|
||||
Rect2 y_handle_rect = Rect2(-5 * EDSCALE, scale_factor.y * EDSCALE, 10 * EDSCALE, 10 * EDSCALE);
|
||||
viewport->draw_rect(y_handle_rect, get_theme_color("axis_y_color", "Editor"));
|
||||
viewport->draw_line(Point2(), Point2(0, scale_factor.y * EDSCALE), get_theme_color("axis_y_color", "Editor"), Math::round(EDSCALE));
|
||||
viewport->draw_rect(y_handle_rect, get_theme_color(SNAME("axis_y_color"), SNAME("Editor")));
|
||||
viewport->draw_line(Point2(), Point2(0, scale_factor.y * EDSCALE), get_theme_color(SNAME("axis_y_color"), SNAME("Editor")), Math::round(EDSCALE));
|
||||
|
||||
viewport->draw_set_transform_matrix(viewport->get_transform());
|
||||
}
|
||||
|
@ -3416,11 +3416,11 @@ void CanvasItemEditor::_draw_selection() {
|
|||
|
||||
viewport->draw_rect(
|
||||
Rect2(bsfrom, bsto - bsfrom),
|
||||
get_theme_color("box_selection_fill_color", "Editor"));
|
||||
get_theme_color(SNAME("box_selection_fill_color"), SNAME("Editor")));
|
||||
|
||||
viewport->draw_rect(
|
||||
Rect2(bsfrom, bsto - bsfrom),
|
||||
get_theme_color("box_selection_stroke_color", "Editor"),
|
||||
get_theme_color(SNAME("box_selection_stroke_color"), SNAME("Editor")),
|
||||
false,
|
||||
Math::round(EDSCALE));
|
||||
}
|
||||
|
@ -3430,7 +3430,7 @@ void CanvasItemEditor::_draw_selection() {
|
|||
viewport->draw_line(
|
||||
transform.xform(drag_rotation_center),
|
||||
transform.xform(drag_to),
|
||||
get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.6),
|
||||
get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.6),
|
||||
Math::round(2 * EDSCALE));
|
||||
}
|
||||
}
|
||||
|
@ -3478,8 +3478,8 @@ void CanvasItemEditor::_draw_straight_line(Point2 p_from, Point2 p_to, Color p_c
|
|||
|
||||
void CanvasItemEditor::_draw_axis() {
|
||||
if (show_origin) {
|
||||
_draw_straight_line(Point2(), Point2(1, 0), get_theme_color("axis_x_color", "Editor") * Color(1, 1, 1, 0.75));
|
||||
_draw_straight_line(Point2(), Point2(0, 1), get_theme_color("axis_y_color", "Editor") * Color(1, 1, 1, 0.75));
|
||||
_draw_straight_line(Point2(), Point2(1, 0), get_theme_color(SNAME("axis_x_color"), SNAME("Editor")) * Color(1, 1, 1, 0.75));
|
||||
_draw_straight_line(Point2(), Point2(0, 1), get_theme_color(SNAME("axis_y_color"), SNAME("Editor")) * Color(1, 1, 1, 0.75));
|
||||
}
|
||||
|
||||
if (show_viewport) {
|
||||
|
@ -3533,7 +3533,7 @@ void CanvasItemEditor::_draw_invisible_nodes_positions(Node *p_node, const Trans
|
|||
Transform2D xform = transform * canvas_xform * parent_xform;
|
||||
|
||||
// Draw the node's position
|
||||
Ref<Texture2D> position_icon = get_theme_icon("EditorPositionUnselected", "EditorIcons");
|
||||
Ref<Texture2D> position_icon = get_theme_icon(SNAME("EditorPositionUnselected"), SNAME("EditorIcons"));
|
||||
Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * canvas_item->_edit_get_transform()).orthonormalized();
|
||||
Transform2D simple_xform = viewport->get_transform() * unscaled_transform;
|
||||
viewport->draw_set_transform_matrix(simple_xform);
|
||||
|
@ -3549,8 +3549,8 @@ void CanvasItemEditor::_draw_hover() {
|
|||
Ref<Texture2D> node_icon = hovering_results[i].icon;
|
||||
String node_name = hovering_results[i].name;
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
Size2 node_name_size = font->get_string_size(node_name);
|
||||
Size2 item_size = Size2(node_icon->get_size().x + 4 + node_name_size.x, MAX(node_icon->get_size().y, node_name_size.y - 3));
|
||||
|
||||
|
@ -3603,13 +3603,13 @@ void CanvasItemEditor::_draw_locks_and_groups(Node *p_node, const Transform2D &p
|
|||
if (canvas_item) {
|
||||
float offset = 0;
|
||||
|
||||
Ref<Texture2D> lock = get_theme_icon("LockViewport", "EditorIcons");
|
||||
Ref<Texture2D> lock = get_theme_icon(SNAME("LockViewport"), SNAME("EditorIcons"));
|
||||
if (p_node->has_meta("_edit_lock_") && show_edit_locks) {
|
||||
lock->draw(viewport_canvas_item, (transform * canvas_xform * parent_xform).xform(Point2(0, 0)) + Point2(offset, 0));
|
||||
offset += lock->get_size().x;
|
||||
}
|
||||
|
||||
Ref<Texture2D> group = get_theme_icon("GroupViewport", "EditorIcons");
|
||||
Ref<Texture2D> group = get_theme_icon(SNAME("GroupViewport"), SNAME("EditorIcons"));
|
||||
if (canvas_item->has_meta("_edit_group_") && show_edit_locks) {
|
||||
group->draw(viewport_canvas_item, (transform * canvas_xform * parent_xform).xform(Point2(0, 0)) + Point2(offset, 0));
|
||||
//offset += group->get_size().x;
|
||||
|
@ -3809,7 +3809,7 @@ void CanvasItemEditor::_notification(int p_what) {
|
|||
}
|
||||
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
select_sb->set_texture(get_theme_icon("EditorRect2D", "EditorIcons"));
|
||||
select_sb->set_texture(get_theme_icon(SNAME("EditorRect2D"), SNAME("EditorIcons")));
|
||||
for (int i = 0; i < 4; i++) {
|
||||
select_sb->set_margin_size(Side(i), 4);
|
||||
select_sb->set_default_margin(Side(i), 4);
|
||||
|
@ -3819,92 +3819,92 @@ void CanvasItemEditor::_notification(int p_what) {
|
|||
_keying_changed();
|
||||
|
||||
} else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||
select_sb->set_texture(get_theme_icon("EditorRect2D", "EditorIcons"));
|
||||
select_sb->set_texture(get_theme_icon(SNAME("EditorRect2D"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||
select_button->set_icon(get_theme_icon("ToolSelect", "EditorIcons"));
|
||||
list_select_button->set_icon(get_theme_icon("ListSelect", "EditorIcons"));
|
||||
move_button->set_icon(get_theme_icon("ToolMove", "EditorIcons"));
|
||||
scale_button->set_icon(get_theme_icon("ToolScale", "EditorIcons"));
|
||||
rotate_button->set_icon(get_theme_icon("ToolRotate", "EditorIcons"));
|
||||
smart_snap_button->set_icon(get_theme_icon("Snap", "EditorIcons"));
|
||||
grid_snap_button->set_icon(get_theme_icon("SnapGrid", "EditorIcons"));
|
||||
snap_config_menu->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons"));
|
||||
skeleton_menu->set_icon(get_theme_icon("Bone", "EditorIcons"));
|
||||
override_camera_button->set_icon(get_theme_icon("Camera2D", "EditorIcons"));
|
||||
pan_button->set_icon(get_theme_icon("ToolPan", "EditorIcons"));
|
||||
ruler_button->set_icon(get_theme_icon("Ruler", "EditorIcons"));
|
||||
pivot_button->set_icon(get_theme_icon("EditPivot", "EditorIcons"));
|
||||
select_handle = get_theme_icon("EditorHandle", "EditorIcons");
|
||||
anchor_handle = get_theme_icon("EditorControlAnchor", "EditorIcons");
|
||||
lock_button->set_icon(get_theme_icon("Lock", "EditorIcons"));
|
||||
unlock_button->set_icon(get_theme_icon("Unlock", "EditorIcons"));
|
||||
group_button->set_icon(get_theme_icon("Group", "EditorIcons"));
|
||||
ungroup_button->set_icon(get_theme_icon("Ungroup", "EditorIcons"));
|
||||
key_loc_button->set_icon(get_theme_icon("KeyPosition", "EditorIcons"));
|
||||
key_rot_button->set_icon(get_theme_icon("KeyRotation", "EditorIcons"));
|
||||
key_scale_button->set_icon(get_theme_icon("KeyScale", "EditorIcons"));
|
||||
key_insert_button->set_icon(get_theme_icon("Key", "EditorIcons"));
|
||||
key_auto_insert_button->set_icon(get_theme_icon("AutoKey", "EditorIcons"));
|
||||
select_button->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
||||
list_select_button->set_icon(get_theme_icon(SNAME("ListSelect"), SNAME("EditorIcons")));
|
||||
move_button->set_icon(get_theme_icon(SNAME("ToolMove"), SNAME("EditorIcons")));
|
||||
scale_button->set_icon(get_theme_icon(SNAME("ToolScale"), SNAME("EditorIcons")));
|
||||
rotate_button->set_icon(get_theme_icon(SNAME("ToolRotate"), SNAME("EditorIcons")));
|
||||
smart_snap_button->set_icon(get_theme_icon(SNAME("Snap"), SNAME("EditorIcons")));
|
||||
grid_snap_button->set_icon(get_theme_icon(SNAME("SnapGrid"), SNAME("EditorIcons")));
|
||||
snap_config_menu->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||
skeleton_menu->set_icon(get_theme_icon(SNAME("Bone"), SNAME("EditorIcons")));
|
||||
override_camera_button->set_icon(get_theme_icon(SNAME("Camera2D"), SNAME("EditorIcons")));
|
||||
pan_button->set_icon(get_theme_icon(SNAME("ToolPan"), SNAME("EditorIcons")));
|
||||
ruler_button->set_icon(get_theme_icon(SNAME("Ruler"), SNAME("EditorIcons")));
|
||||
pivot_button->set_icon(get_theme_icon(SNAME("EditPivot"), SNAME("EditorIcons")));
|
||||
select_handle = get_theme_icon(SNAME("EditorHandle"), SNAME("EditorIcons"));
|
||||
anchor_handle = get_theme_icon(SNAME("EditorControlAnchor"), SNAME("EditorIcons"));
|
||||
lock_button->set_icon(get_theme_icon(SNAME("Lock"), SNAME("EditorIcons")));
|
||||
unlock_button->set_icon(get_theme_icon(SNAME("Unlock"), SNAME("EditorIcons")));
|
||||
group_button->set_icon(get_theme_icon(SNAME("Group"), SNAME("EditorIcons")));
|
||||
ungroup_button->set_icon(get_theme_icon(SNAME("Ungroup"), SNAME("EditorIcons")));
|
||||
key_loc_button->set_icon(get_theme_icon(SNAME("KeyPosition"), SNAME("EditorIcons")));
|
||||
key_rot_button->set_icon(get_theme_icon(SNAME("KeyRotation"), SNAME("EditorIcons")));
|
||||
key_scale_button->set_icon(get_theme_icon(SNAME("KeyScale"), SNAME("EditorIcons")));
|
||||
key_insert_button->set_icon(get_theme_icon(SNAME("Key"), SNAME("EditorIcons")));
|
||||
key_auto_insert_button->set_icon(get_theme_icon(SNAME("AutoKey"), SNAME("EditorIcons")));
|
||||
// Use a different color for the active autokey icon to make them easier
|
||||
// to distinguish from the other key icons at the top. On a light theme,
|
||||
// the icon will be dark, so we need to lighten it before blending it
|
||||
// with the red color.
|
||||
const Color key_auto_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(1, 1, 1) : Color(4.25, 4.25, 4.25);
|
||||
key_auto_insert_button->add_theme_color_override("icon_pressed_color", key_auto_color.lerp(Color(1, 0, 0), 0.55));
|
||||
animation_menu->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons"));
|
||||
animation_menu->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||
|
||||
presets_menu->set_icon(get_theme_icon("ControlLayout", "EditorIcons"));
|
||||
presets_menu->set_icon(get_theme_icon(SNAME("ControlLayout"), SNAME("EditorIcons")));
|
||||
PopupMenu *p = presets_menu->get_popup();
|
||||
|
||||
p->clear();
|
||||
p->add_icon_item(get_theme_icon("ControlAlignTopLeft", "EditorIcons"), TTR("Top Left"), ANCHORS_AND_OFFSETS_PRESET_TOP_LEFT);
|
||||
p->add_icon_item(get_theme_icon("ControlAlignTopRight", "EditorIcons"), TTR("Top Right"), ANCHORS_AND_OFFSETS_PRESET_TOP_RIGHT);
|
||||
p->add_icon_item(get_theme_icon("ControlAlignBottomRight", "EditorIcons"), TTR("Bottom Right"), ANCHORS_AND_OFFSETS_PRESET_BOTTOM_RIGHT);
|
||||
p->add_icon_item(get_theme_icon("ControlAlignBottomLeft", "EditorIcons"), TTR("Bottom Left"), ANCHORS_AND_OFFSETS_PRESET_BOTTOM_LEFT);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignTopLeft"), SNAME("EditorIcons")), TTR("Top Left"), ANCHORS_AND_OFFSETS_PRESET_TOP_LEFT);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignTopRight"), SNAME("EditorIcons")), TTR("Top Right"), ANCHORS_AND_OFFSETS_PRESET_TOP_RIGHT);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignBottomRight"), SNAME("EditorIcons")), TTR("Bottom Right"), ANCHORS_AND_OFFSETS_PRESET_BOTTOM_RIGHT);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignBottomLeft"), SNAME("EditorIcons")), TTR("Bottom Left"), ANCHORS_AND_OFFSETS_PRESET_BOTTOM_LEFT);
|
||||
p->add_separator();
|
||||
p->add_icon_item(get_theme_icon("ControlAlignLeftCenter", "EditorIcons"), TTR("Center Left"), ANCHORS_AND_OFFSETS_PRESET_CENTER_LEFT);
|
||||
p->add_icon_item(get_theme_icon("ControlAlignTopCenter", "EditorIcons"), TTR("Center Top"), ANCHORS_AND_OFFSETS_PRESET_CENTER_TOP);
|
||||
p->add_icon_item(get_theme_icon("ControlAlignRightCenter", "EditorIcons"), TTR("Center Right"), ANCHORS_AND_OFFSETS_PRESET_CENTER_RIGHT);
|
||||
p->add_icon_item(get_theme_icon("ControlAlignBottomCenter", "EditorIcons"), TTR("Center Bottom"), ANCHORS_AND_OFFSETS_PRESET_CENTER_BOTTOM);
|
||||
p->add_icon_item(get_theme_icon("ControlAlignCenter", "EditorIcons"), TTR("Center"), ANCHORS_AND_OFFSETS_PRESET_CENTER);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignLeftCenter"), SNAME("EditorIcons")), TTR("Center Left"), ANCHORS_AND_OFFSETS_PRESET_CENTER_LEFT);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignTopCenter"), SNAME("EditorIcons")), TTR("Center Top"), ANCHORS_AND_OFFSETS_PRESET_CENTER_TOP);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignRightCenter"), SNAME("EditorIcons")), TTR("Center Right"), ANCHORS_AND_OFFSETS_PRESET_CENTER_RIGHT);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignBottomCenter"), SNAME("EditorIcons")), TTR("Center Bottom"), ANCHORS_AND_OFFSETS_PRESET_CENTER_BOTTOM);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignCenter"), SNAME("EditorIcons")), TTR("Center"), ANCHORS_AND_OFFSETS_PRESET_CENTER);
|
||||
p->add_separator();
|
||||
p->add_icon_item(get_theme_icon("ControlAlignLeftWide", "EditorIcons"), TTR("Left Wide"), ANCHORS_AND_OFFSETS_PRESET_LEFT_WIDE);
|
||||
p->add_icon_item(get_theme_icon("ControlAlignTopWide", "EditorIcons"), TTR("Top Wide"), ANCHORS_AND_OFFSETS_PRESET_TOP_WIDE);
|
||||
p->add_icon_item(get_theme_icon("ControlAlignRightWide", "EditorIcons"), TTR("Right Wide"), ANCHORS_AND_OFFSETS_PRESET_RIGHT_WIDE);
|
||||
p->add_icon_item(get_theme_icon("ControlAlignBottomWide", "EditorIcons"), TTR("Bottom Wide"), ANCHORS_AND_OFFSETS_PRESET_BOTTOM_WIDE);
|
||||
p->add_icon_item(get_theme_icon("ControlVcenterWide", "EditorIcons"), TTR("VCenter Wide"), ANCHORS_AND_OFFSETS_PRESET_VCENTER_WIDE);
|
||||
p->add_icon_item(get_theme_icon("ControlHcenterWide", "EditorIcons"), TTR("HCenter Wide"), ANCHORS_AND_OFFSETS_PRESET_HCENTER_WIDE);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignLeftWide"), SNAME("EditorIcons")), TTR("Left Wide"), ANCHORS_AND_OFFSETS_PRESET_LEFT_WIDE);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignTopWide"), SNAME("EditorIcons")), TTR("Top Wide"), ANCHORS_AND_OFFSETS_PRESET_TOP_WIDE);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignRightWide"), SNAME("EditorIcons")), TTR("Right Wide"), ANCHORS_AND_OFFSETS_PRESET_RIGHT_WIDE);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignBottomWide"), SNAME("EditorIcons")), TTR("Bottom Wide"), ANCHORS_AND_OFFSETS_PRESET_BOTTOM_WIDE);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlVcenterWide"), SNAME("EditorIcons")), TTR("VCenter Wide"), ANCHORS_AND_OFFSETS_PRESET_VCENTER_WIDE);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlHcenterWide"), SNAME("EditorIcons")), TTR("HCenter Wide"), ANCHORS_AND_OFFSETS_PRESET_HCENTER_WIDE);
|
||||
p->add_separator();
|
||||
p->add_icon_item(get_theme_icon("ControlAlignWide", "EditorIcons"), TTR("Full Rect"), ANCHORS_AND_OFFSETS_PRESET_WIDE);
|
||||
p->add_icon_item(get_theme_icon("Anchor", "EditorIcons"), TTR("Keep Ratio"), ANCHORS_AND_OFFSETS_PRESET_KEEP_RATIO);
|
||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignWide"), SNAME("EditorIcons")), TTR("Full Rect"), ANCHORS_AND_OFFSETS_PRESET_WIDE);
|
||||
p->add_icon_item(get_theme_icon(SNAME("Anchor"), SNAME("EditorIcons")), TTR("Keep Ratio"), ANCHORS_AND_OFFSETS_PRESET_KEEP_RATIO);
|
||||
p->add_separator();
|
||||
p->add_submenu_item(TTR("Anchors only"), "Anchors");
|
||||
p->set_item_icon(21, get_theme_icon("Anchor", "EditorIcons"));
|
||||
p->set_item_icon(21, get_theme_icon(SNAME("Anchor"), SNAME("EditorIcons")));
|
||||
|
||||
anchors_popup->clear();
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignTopLeft", "EditorIcons"), TTR("Top Left"), ANCHORS_PRESET_TOP_LEFT);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignTopRight", "EditorIcons"), TTR("Top Right"), ANCHORS_PRESET_TOP_RIGHT);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignBottomRight", "EditorIcons"), TTR("Bottom Right"), ANCHORS_PRESET_BOTTOM_RIGHT);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignBottomLeft", "EditorIcons"), TTR("Bottom Left"), ANCHORS_PRESET_BOTTOM_LEFT);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignTopLeft"), SNAME("EditorIcons")), TTR("Top Left"), ANCHORS_PRESET_TOP_LEFT);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignTopRight"), SNAME("EditorIcons")), TTR("Top Right"), ANCHORS_PRESET_TOP_RIGHT);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignBottomRight"), SNAME("EditorIcons")), TTR("Bottom Right"), ANCHORS_PRESET_BOTTOM_RIGHT);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignBottomLeft"), SNAME("EditorIcons")), TTR("Bottom Left"), ANCHORS_PRESET_BOTTOM_LEFT);
|
||||
anchors_popup->add_separator();
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignLeftCenter", "EditorIcons"), TTR("Center Left"), ANCHORS_PRESET_CENTER_LEFT);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignTopCenter", "EditorIcons"), TTR("Center Top"), ANCHORS_PRESET_CENTER_TOP);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignRightCenter", "EditorIcons"), TTR("Center Right"), ANCHORS_PRESET_CENTER_RIGHT);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignBottomCenter", "EditorIcons"), TTR("Center Bottom"), ANCHORS_PRESET_CENTER_BOTTOM);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignCenter", "EditorIcons"), TTR("Center"), ANCHORS_PRESET_CENTER);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignLeftCenter"), SNAME("EditorIcons")), TTR("Center Left"), ANCHORS_PRESET_CENTER_LEFT);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignTopCenter"), SNAME("EditorIcons")), TTR("Center Top"), ANCHORS_PRESET_CENTER_TOP);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignRightCenter"), SNAME("EditorIcons")), TTR("Center Right"), ANCHORS_PRESET_CENTER_RIGHT);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignBottomCenter"), SNAME("EditorIcons")), TTR("Center Bottom"), ANCHORS_PRESET_CENTER_BOTTOM);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignCenter"), SNAME("EditorIcons")), TTR("Center"), ANCHORS_PRESET_CENTER);
|
||||
anchors_popup->add_separator();
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignLeftWide", "EditorIcons"), TTR("Left Wide"), ANCHORS_PRESET_LEFT_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignTopWide", "EditorIcons"), TTR("Top Wide"), ANCHORS_PRESET_TOP_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignRightWide", "EditorIcons"), TTR("Right Wide"), ANCHORS_PRESET_RIGHT_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignBottomWide", "EditorIcons"), TTR("Bottom Wide"), ANCHORS_PRESET_BOTTOM_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlVcenterWide", "EditorIcons"), TTR("VCenter Wide"), ANCHORS_PRESET_VCENTER_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlHcenterWide", "EditorIcons"), TTR("HCenter Wide"), ANCHORS_PRESET_HCENTER_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignLeftWide"), SNAME("EditorIcons")), TTR("Left Wide"), ANCHORS_PRESET_LEFT_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignTopWide"), SNAME("EditorIcons")), TTR("Top Wide"), ANCHORS_PRESET_TOP_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignRightWide"), SNAME("EditorIcons")), TTR("Right Wide"), ANCHORS_PRESET_RIGHT_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignBottomWide"), SNAME("EditorIcons")), TTR("Bottom Wide"), ANCHORS_PRESET_BOTTOM_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlVcenterWide"), SNAME("EditorIcons")), TTR("VCenter Wide"), ANCHORS_PRESET_VCENTER_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlHcenterWide"), SNAME("EditorIcons")), TTR("HCenter Wide"), ANCHORS_PRESET_HCENTER_WIDE);
|
||||
anchors_popup->add_separator();
|
||||
anchors_popup->add_icon_item(get_theme_icon("ControlAlignWide", "EditorIcons"), TTR("Full Rect"), ANCHORS_PRESET_WIDE);
|
||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignWide"), SNAME("EditorIcons")), TTR("Full Rect"), ANCHORS_PRESET_WIDE);
|
||||
|
||||
anchor_mode_button->set_icon(get_theme_icon("Anchor", "EditorIcons"));
|
||||
anchor_mode_button->set_icon(get_theme_icon(SNAME("Anchor"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
|
@ -4889,7 +4889,7 @@ void CanvasItemEditor::_focus_selection(int p_op) {
|
|||
zoom *= 0.90;
|
||||
viewport->update();
|
||||
zoom_widget->set_zoom(zoom);
|
||||
call_deferred("_popup_callback", VIEW_CENTER_TO_SELECTION);
|
||||
call_deferred(SNAME("_popup_callback"), VIEW_CENTER_TO_SELECTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5215,8 +5215,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|||
editor->get_scene_tree_dock()->connect("node_created", callable_mp(this, &CanvasItemEditor::_node_created));
|
||||
editor->get_scene_tree_dock()->connect("add_node_used", callable_mp(this, &CanvasItemEditor::_reset_create_position));
|
||||
|
||||
editor->call_deferred("connect", "play_pressed", Callable(this, "_update_override_camera_button"), make_binds(true));
|
||||
editor->call_deferred("connect", "stop_pressed", Callable(this, "_update_override_camera_button"), make_binds(false));
|
||||
editor->call_deferred(SNAME("connect"), "play_pressed", Callable(this, "_update_override_camera_button"), make_binds(true));
|
||||
editor->call_deferred(SNAME("connect"), "stop_pressed", Callable(this, "_update_override_camera_button"), make_binds(false));
|
||||
|
||||
hb = memnew(HBoxContainer);
|
||||
add_child(hb);
|
||||
|
@ -5276,9 +5276,9 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|||
warning_child_of_container = memnew(Label);
|
||||
warning_child_of_container->hide();
|
||||
warning_child_of_container->set_text(TTR("Warning: Children of a container get their position and size determined only by their parent."));
|
||||
warning_child_of_container->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("warning_color", "Editor"));
|
||||
warning_child_of_container->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("main", "EditorFonts"));
|
||||
warning_child_of_container->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size("main_size", "EditorFonts"));
|
||||
warning_child_of_container->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
warning_child_of_container->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("main"), SNAME("EditorFonts")));
|
||||
warning_child_of_container->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("main_size"), SNAME("EditorFonts")));
|
||||
add_control_to_info_overlay(warning_child_of_container);
|
||||
|
||||
h_scroll = memnew(HScrollBar);
|
||||
|
@ -5615,8 +5615,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|||
|
||||
add_node_menu = memnew(PopupMenu);
|
||||
add_child(add_node_menu);
|
||||
add_node_menu->add_icon_item(editor->get_scene_tree_dock()->get_theme_icon("Add", "EditorIcons"), TTR("Add Node Here"));
|
||||
add_node_menu->add_icon_item(editor->get_scene_tree_dock()->get_theme_icon("Instance", "EditorIcons"), TTR("Instance Scene Here"));
|
||||
add_node_menu->add_icon_item(editor->get_scene_tree_dock()->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")), TTR("Add Node Here"));
|
||||
add_node_menu->add_icon_item(editor->get_scene_tree_dock()->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), TTR("Instance Scene Here"));
|
||||
add_node_menu->connect("id_pressed", callable_mp(this, &CanvasItemEditor::_add_node_pressed));
|
||||
|
||||
multiply_grid_step_shortcut = ED_SHORTCUT("canvas_item_editor/multiply_grid_step", TTR("Multiply grid step by 2"), KEY_KP_MULTIPLY);
|
||||
|
@ -5639,7 +5639,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|||
set_process_unhandled_key_input(true);
|
||||
|
||||
// Update the menus' checkboxes
|
||||
call_deferred("set_state", get_state());
|
||||
call_deferred(SNAME("set_state"), get_state());
|
||||
}
|
||||
|
||||
CanvasItemEditor *CanvasItemEditor::singleton = nullptr;
|
||||
|
@ -6075,7 +6075,7 @@ void CanvasItemEditorViewport::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
connect("mouse_exited", callable_mp(this, &CanvasItemEditorViewport::_on_mouse_exit));
|
||||
label->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor"));
|
||||
label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
} break;
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
disconnect("mouse_exited", callable_mp(this, &CanvasItemEditorViewport::_on_mouse_exit));
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
void CollisionPolygon3DEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_READY: {
|
||||
button_create->set_icon(get_theme_icon("Edit", "EditorIcons"));
|
||||
button_edit->set_icon(get_theme_icon("MovePoint", "EditorIcons"));
|
||||
button_create->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
button_edit->set_icon(get_theme_icon(SNAME("MovePoint"), SNAME("EditorIcons")));
|
||||
button_edit->set_pressed(true);
|
||||
get_tree()->connect("node_removed", callable_mp(this, &CollisionPolygon3DEditor::_node_removed));
|
||||
|
||||
|
@ -531,7 +531,7 @@ CollisionPolygon3DEditor::CollisionPolygon3DEditor(EditorNode *p_editor) {
|
|||
handle_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
Ref<Texture2D> handle = editor->get_gui_base()->get_theme_icon("Editor3DHandle", "EditorIcons");
|
||||
Ref<Texture2D> handle = editor->get_gui_base()->get_theme_icon(SNAME("Editor3DHandle"), SNAME("EditorIcons"));
|
||||
handle_material->set_point_size(handle->get_width());
|
||||
handle_material->set_texture(StandardMaterial3D::TEXTURE_ALBEDO, handle);
|
||||
|
||||
|
|
|
@ -430,7 +430,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla
|
|||
|
||||
Transform2D gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
|
||||
|
||||
Ref<Texture2D> h = get_theme_icon("EditorHandle", "EditorIcons");
|
||||
Ref<Texture2D> h = get_theme_icon(SNAME("EditorHandle"), SNAME("EditorIcons"));
|
||||
Vector2 size = h->get_size() * 0.5;
|
||||
|
||||
handles.clear();
|
||||
|
|
|
@ -224,7 +224,7 @@ void CPUParticles2DEditorPlugin::_generate_emission_mask() {
|
|||
void CPUParticles2DEditorPlugin::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
menu->get_popup()->connect("id_pressed", callable_mp(this, &CPUParticles2DEditorPlugin::_menu_callback));
|
||||
menu->set_icon(epoints->get_theme_icon("CPUParticles2D", "EditorIcons"));
|
||||
menu->set_icon(epoints->get_theme_icon(SNAME("CPUParticles2D"), SNAME("EditorIcons")));
|
||||
file->connect("file_selected", callable_mp(this, &CPUParticles2DEditorPlugin::_file_selected));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ void CPUParticles3DEditor::_node_removed(Node *p_node) {
|
|||
|
||||
void CPUParticles3DEditor::_notification(int p_notification) {
|
||||
if (p_notification == NOTIFICATION_ENTER_TREE) {
|
||||
options->set_icon(get_theme_icon("CPUParticles3D", "EditorIcons"));
|
||||
options->set_icon(get_theme_icon(SNAME("CPUParticles3D"), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -519,8 +519,8 @@ void CurveEditor::set_hover_point_index(int index) {
|
|||
}
|
||||
|
||||
void CurveEditor::update_view_transform() {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
|
||||
const real_t margin = font->get_height(font_size) + 2 * EDSCALE;
|
||||
|
||||
|
@ -635,7 +635,7 @@ void CurveEditor::_draw() {
|
|||
// Background
|
||||
|
||||
Vector2 view_size = get_rect().size;
|
||||
draw_style_box(get_theme_stylebox("bg", "Tree"), Rect2(Point2(), view_size));
|
||||
draw_style_box(get_theme_stylebox(SNAME("bg"), SNAME("Tree")), Rect2(Point2(), view_size));
|
||||
|
||||
// Grid
|
||||
|
||||
|
@ -644,8 +644,8 @@ void CurveEditor::_draw() {
|
|||
Vector2 min_edge = get_world_pos(Vector2(0, view_size.y));
|
||||
Vector2 max_edge = get_world_pos(Vector2(view_size.x, 0));
|
||||
|
||||
const Color grid_color0 = get_theme_color("mono_color", "Editor") * Color(1, 1, 1, 0.15);
|
||||
const Color grid_color1 = get_theme_color("mono_color", "Editor") * Color(1, 1, 1, 0.07);
|
||||
const Color grid_color0 = get_theme_color(SNAME("mono_color"), SNAME("Editor")) * Color(1, 1, 1, 0.15);
|
||||
const Color grid_color1 = get_theme_color(SNAME("mono_color"), SNAME("Editor")) * Color(1, 1, 1, 0.07);
|
||||
draw_line(Vector2(min_edge.x, curve.get_min_value()), Vector2(max_edge.x, curve.get_min_value()), grid_color0);
|
||||
draw_line(Vector2(max_edge.x, curve.get_max_value()), Vector2(min_edge.x, curve.get_max_value()), grid_color0);
|
||||
draw_line(Vector2(0, min_edge.y), Vector2(0, max_edge.y), grid_color0);
|
||||
|
@ -665,10 +665,10 @@ void CurveEditor::_draw() {
|
|||
|
||||
draw_set_transform_matrix(Transform2D());
|
||||
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
float font_height = font->get_height(font_size);
|
||||
Color text_color = get_theme_color("font_color", "Editor");
|
||||
Color text_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
|
||||
|
||||
{
|
||||
// X axis
|
||||
|
@ -695,7 +695,7 @@ void CurveEditor::_draw() {
|
|||
// Draw tangents for current point
|
||||
|
||||
if (_selected_point >= 0) {
|
||||
const Color tangent_color = get_theme_color("accent_color", "Editor");
|
||||
const Color tangent_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
|
||||
int i = _selected_point;
|
||||
Vector2 pos = curve.get_point_position(i);
|
||||
|
@ -717,8 +717,8 @@ void CurveEditor::_draw() {
|
|||
|
||||
draw_set_transform_matrix(_world_to_view);
|
||||
|
||||
const Color line_color = get_theme_color("font_color", "Editor");
|
||||
const Color edge_line_color = get_theme_color("highlight_color", "Editor");
|
||||
const Color line_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
|
||||
const Color edge_line_color = get_theme_color(SNAME("highlight_color"), SNAME("Editor"));
|
||||
|
||||
CanvasItemPlotCurve plot_func(*this, line_color, edge_line_color);
|
||||
plot_curve_accurate(curve, 4.f / view_size.x, plot_func);
|
||||
|
@ -727,8 +727,8 @@ void CurveEditor::_draw() {
|
|||
|
||||
draw_set_transform_matrix(Transform2D());
|
||||
|
||||
const Color point_color = get_theme_color("font_color", "Editor");
|
||||
const Color selected_point_color = get_theme_color("accent_color", "Editor");
|
||||
const Color point_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
|
||||
const Color selected_point_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
|
||||
for (int i = 0; i < curve.get_point_count(); ++i) {
|
||||
Vector2 pos = curve.get_point_position(i);
|
||||
|
|
|
@ -34,18 +34,18 @@
|
|||
|
||||
void EditorDebuggerPlugin::_breaked(bool p_really_did, bool p_can_debug) {
|
||||
if (p_really_did) {
|
||||
emit_signal("breaked", p_can_debug);
|
||||
emit_signal(SNAME("breaked"), p_can_debug);
|
||||
} else {
|
||||
emit_signal("continued");
|
||||
emit_signal(SNAME("continued"));
|
||||
}
|
||||
}
|
||||
|
||||
void EditorDebuggerPlugin::_started() {
|
||||
emit_signal("started");
|
||||
emit_signal(SNAME("started"));
|
||||
}
|
||||
|
||||
void EditorDebuggerPlugin::_stopped() {
|
||||
emit_signal("stopped");
|
||||
emit_signal(SNAME("stopped"));
|
||||
}
|
||||
|
||||
void EditorDebuggerPlugin::_bind_methods() {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
void FontDataPreview::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_DRAW) {
|
||||
Color text_color = get_theme_color("font_color", "Label");
|
||||
Color text_color = get_theme_color(SNAME("font_color"), SNAME("Label"));
|
||||
Color line_color = text_color;
|
||||
line_color.a *= 0.6;
|
||||
Vector2 pos = (get_size() - line->get_size()) / 2;
|
||||
|
@ -127,7 +127,7 @@ FontDataPreview::FontDataPreview() {
|
|||
void FontDataEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_SORT_CHILDREN) {
|
||||
int split_width = get_name_split_ratio() * get_size().width;
|
||||
button->set_size(Size2(get_theme_icon("Add", "EditorIcons")->get_width(), get_size().height));
|
||||
button->set_size(Size2(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))->get_width(), get_size().height));
|
||||
if (is_layout_rtl()) {
|
||||
if (le != nullptr) {
|
||||
fit_child_in_rect(le, Rect2(Vector2(split_width, 0), Size2(split_width, get_size().height)));
|
||||
|
@ -145,7 +145,7 @@ void FontDataEditor::_notification(int p_what) {
|
|||
}
|
||||
if (p_what == NOTIFICATION_DRAW) {
|
||||
int split_width = get_name_split_ratio() * get_size().width;
|
||||
Color dark_color = get_theme_color("dark_color_2", "Editor");
|
||||
Color dark_color = get_theme_color(SNAME("dark_color_2"), SNAME("Editor"));
|
||||
if (is_layout_rtl()) {
|
||||
draw_rect(Rect2(Vector2(0, 0), Size2(split_width, get_size().height)), dark_color);
|
||||
} else {
|
||||
|
@ -154,9 +154,9 @@ void FontDataEditor::_notification(int p_what) {
|
|||
}
|
||||
if (p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
if (le != nullptr) {
|
||||
button->set_icon(get_theme_icon("Add", "EditorIcons"));
|
||||
button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
button->set_icon(get_theme_icon("Remove", "EditorIcons"));
|
||||
button->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
}
|
||||
queue_sort();
|
||||
}
|
||||
|
@ -187,12 +187,12 @@ void FontDataEditor::init_lang_add() {
|
|||
le->set_editable(true);
|
||||
add_child(le);
|
||||
|
||||
button->set_icon(get_theme_icon("Add", "EditorIcons"));
|
||||
button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
button->connect("pressed", callable_mp(this, &FontDataEditor::add_lang));
|
||||
}
|
||||
|
||||
void FontDataEditor::init_lang_edit() {
|
||||
button->set_icon(get_theme_icon("Remove", "EditorIcons"));
|
||||
button->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
button->connect("pressed", callable_mp(this, &FontDataEditor::remove_lang));
|
||||
chk->connect("toggled", callable_mp(this, &FontDataEditor::toggle_lang));
|
||||
}
|
||||
|
@ -204,12 +204,12 @@ void FontDataEditor::init_script_add() {
|
|||
le->set_editable(true);
|
||||
add_child(le);
|
||||
|
||||
button->set_icon(get_theme_icon("Add", "EditorIcons"));
|
||||
button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
button->connect("pressed", callable_mp(this, &FontDataEditor::add_script));
|
||||
}
|
||||
|
||||
void FontDataEditor::init_script_edit() {
|
||||
button->set_icon(get_theme_icon("Remove", "EditorIcons"));
|
||||
button->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
button->connect("pressed", callable_mp(this, &FontDataEditor::remove_script));
|
||||
chk->connect("toggled", callable_mp(this, &FontDataEditor::toggle_script));
|
||||
}
|
||||
|
|
|
@ -329,7 +329,7 @@ void GPUParticles2DEditorPlugin::_generate_emission_mask() {
|
|||
void GPUParticles2DEditorPlugin::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
menu->get_popup()->connect("id_pressed", callable_mp(this, &GPUParticles2DEditorPlugin::_menu_callback));
|
||||
menu->set_icon(menu->get_theme_icon("GPUParticles2D", "EditorIcons"));
|
||||
menu->set_icon(menu->get_theme_icon(SNAME("GPUParticles2D"), SNAME("EditorIcons")));
|
||||
file->connect("file_selected", callable_mp(this, &GPUParticles2DEditorPlugin::_file_selected));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -230,7 +230,7 @@ void GPUParticles3DEditor::_node_removed(Node *p_node) {
|
|||
|
||||
void GPUParticles3DEditor::_notification(int p_notification) {
|
||||
if (p_notification == NOTIFICATION_ENTER_TREE) {
|
||||
options->set_icon(options->get_popup()->get_theme_icon("GPUParticles3D", "EditorIcons"));
|
||||
options->set_icon(options->get_popup()->get_theme_icon(SNAME("GPUParticles3D"), SNAME("EditorIcons")));
|
||||
get_tree()->connect("node_removed", callable_mp(this, &GPUParticles3DEditor::_node_removed));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,13 +83,13 @@ void GPUParticlesCollisionSDFEditorPlugin::_notification(int p_what) {
|
|||
Color color;
|
||||
if (size_mb <= 16.0 + CMP_EPSILON) {
|
||||
// Fast.
|
||||
color = bake_info->get_theme_color("success_color", "Editor");
|
||||
color = bake_info->get_theme_color(SNAME("success_color"), SNAME("Editor"));
|
||||
} else if (size_mb <= 64.0 + CMP_EPSILON) {
|
||||
// Medium.
|
||||
color = bake_info->get_theme_color("warning_color", "Editor");
|
||||
color = bake_info->get_theme_color(SNAME("warning_color"), SNAME("Editor"));
|
||||
} else {
|
||||
// Slow.
|
||||
color = bake_info->get_theme_color("error_color", "Editor");
|
||||
color = bake_info->get_theme_color(SNAME("error_color"), SNAME("Editor"));
|
||||
}
|
||||
bake_info->add_theme_color_override("font_color", color);
|
||||
|
||||
|
@ -174,7 +174,7 @@ GPUParticlesCollisionSDFEditorPlugin::GPUParticlesCollisionSDFEditorPlugin(Edito
|
|||
bake_hb->hide();
|
||||
bake = memnew(Button);
|
||||
bake->set_flat(true);
|
||||
bake->set_icon(editor->get_gui_base()->get_theme_icon("Bake", "EditorIcons"));
|
||||
bake->set_icon(editor->get_gui_base()->get_theme_icon(SNAME("Bake"), SNAME("EditorIcons")));
|
||||
bake->set_text(TTR("Bake SDF"));
|
||||
bake->connect("pressed", callable_mp(this, &GPUParticlesCollisionSDFEditorPlugin::_bake));
|
||||
bake_hb->add_child(bake);
|
||||
|
|
|
@ -243,8 +243,8 @@ void ItemListEditor::_node_removed(Node *p_node) {
|
|||
|
||||
void ItemListEditor::_notification(int p_notification) {
|
||||
if (p_notification == NOTIFICATION_ENTER_TREE || p_notification == NOTIFICATION_THEME_CHANGED) {
|
||||
add_button->set_icon(get_theme_icon("Add", "EditorIcons"));
|
||||
del_button->set_icon(get_theme_icon("Remove", "EditorIcons"));
|
||||
add_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
del_button->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
} else if (p_notification == NOTIFICATION_READY) {
|
||||
get_tree()->connect("node_removed", callable_mp(this, &ItemListEditor::_node_removed));
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ LightmapGIEditorPlugin::LightmapGIEditorPlugin(EditorNode *p_node) {
|
|||
editor = p_node;
|
||||
bake = memnew(Button);
|
||||
bake->set_flat(true);
|
||||
bake->set_icon(editor->get_gui_base()->get_theme_icon("Bake", "EditorIcons"));
|
||||
bake->set_icon(editor->get_gui_base()->get_theme_icon(SNAME("Bake"), SNAME("EditorIcons")));
|
||||
bake->set_text(TTR("Bake Lightmaps"));
|
||||
bake->hide();
|
||||
bake->connect("pressed", Callable(this, "_bake"));
|
||||
|
|
|
@ -42,22 +42,22 @@ void MaterialEditor::_notification(int p_what) {
|
|||
if (first_enter) {
|
||||
//it's in propertyeditor so.. could be moved around
|
||||
|
||||
light_1_switch->set_normal_texture(get_theme_icon("MaterialPreviewLight1", "EditorIcons"));
|
||||
light_1_switch->set_pressed_texture(get_theme_icon("MaterialPreviewLight1Off", "EditorIcons"));
|
||||
light_2_switch->set_normal_texture(get_theme_icon("MaterialPreviewLight2", "EditorIcons"));
|
||||
light_2_switch->set_pressed_texture(get_theme_icon("MaterialPreviewLight2Off", "EditorIcons"));
|
||||
light_1_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewLight1"), SNAME("EditorIcons")));
|
||||
light_1_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewLight1Off"), SNAME("EditorIcons")));
|
||||
light_2_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewLight2"), SNAME("EditorIcons")));
|
||||
light_2_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewLight2Off"), SNAME("EditorIcons")));
|
||||
|
||||
sphere_switch->set_normal_texture(get_theme_icon("MaterialPreviewSphereOff", "EditorIcons"));
|
||||
sphere_switch->set_pressed_texture(get_theme_icon("MaterialPreviewSphere", "EditorIcons"));
|
||||
box_switch->set_normal_texture(get_theme_icon("MaterialPreviewCubeOff", "EditorIcons"));
|
||||
box_switch->set_pressed_texture(get_theme_icon("MaterialPreviewCube", "EditorIcons"));
|
||||
sphere_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewSphereOff"), SNAME("EditorIcons")));
|
||||
sphere_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewSphere"), SNAME("EditorIcons")));
|
||||
box_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewCubeOff"), SNAME("EditorIcons")));
|
||||
box_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewCube"), SNAME("EditorIcons")));
|
||||
|
||||
first_enter = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_DRAW) {
|
||||
Ref<Texture2D> checkerboard = get_theme_icon("Checkerboard", "EditorIcons");
|
||||
Ref<Texture2D> checkerboard = get_theme_icon(SNAME("Checkerboard"), SNAME("EditorIcons"));
|
||||
Size2 size = get_size();
|
||||
|
||||
draw_texture_rect(checkerboard, Rect2(Point2(), size), true);
|
||||
|
|
|
@ -55,10 +55,10 @@ void MeshEditor::_notification(int p_what) {
|
|||
if (first_enter) {
|
||||
//it's in propertyeditor so. could be moved around
|
||||
|
||||
light_1_switch->set_normal_texture(get_theme_icon("MaterialPreviewLight1", "EditorIcons"));
|
||||
light_1_switch->set_pressed_texture(get_theme_icon("MaterialPreviewLight1Off", "EditorIcons"));
|
||||
light_2_switch->set_normal_texture(get_theme_icon("MaterialPreviewLight2", "EditorIcons"));
|
||||
light_2_switch->set_pressed_texture(get_theme_icon("MaterialPreviewLight2Off", "EditorIcons"));
|
||||
light_1_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewLight1"), SNAME("EditorIcons")));
|
||||
light_1_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewLight1Off"), SNAME("EditorIcons")));
|
||||
light_2_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewLight2"), SNAME("EditorIcons")));
|
||||
light_2_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewLight2Off"), SNAME("EditorIcons")));
|
||||
first_enter = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -441,7 +441,7 @@ MeshInstance3DEditor::MeshInstance3DEditor() {
|
|||
Node3DEditor::get_singleton()->add_control_to_menu_panel(options);
|
||||
|
||||
options->set_text(TTR("Mesh"));
|
||||
options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MeshInstance3D", "EditorIcons"));
|
||||
options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("MeshInstance3D"), SNAME("EditorIcons")));
|
||||
|
||||
options->get_popup()->add_item(TTR("Create Trimesh Static Body"), MENU_OPTION_CREATE_STATIC_TRIMESH_BODY);
|
||||
options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a StaticBody3D and assigns a polygon-based collision shape to it automatically.\nThis is the most accurate (but slowest) option for collision detection."));
|
||||
|
|
|
@ -254,7 +254,7 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) {
|
|||
Node3DEditor::get_singleton()->add_control_to_menu_panel(menu);
|
||||
menu->set_position(Point2(1, 1));
|
||||
menu->set_text(TTR("Mesh Library"));
|
||||
menu->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MeshLibrary", "EditorIcons"));
|
||||
menu->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("MeshLibrary"), SNAME("EditorIcons")));
|
||||
menu->get_popup()->add_item(TTR("Add Item"), MENU_OPTION_ADD_ITEM);
|
||||
menu->get_popup()->add_item(TTR("Remove Selected Item"), MENU_OPTION_REMOVE_ITEM);
|
||||
menu->get_popup()->add_separator();
|
||||
|
|
|
@ -268,7 +268,7 @@ MultiMeshEditor::MultiMeshEditor() {
|
|||
Node3DEditor::get_singleton()->add_control_to_menu_panel(options);
|
||||
|
||||
options->set_text("MultiMesh");
|
||||
options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MultiMeshInstance3D", "EditorIcons"));
|
||||
options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("MultiMeshInstance3D"), SNAME("EditorIcons")));
|
||||
|
||||
options->get_popup()->add_item(TTR("Populate Surface"));
|
||||
options->get_popup()->connect("id_pressed", callable_mp(this, &MultiMeshEditor::_menu_option));
|
||||
|
|
|
@ -92,9 +92,9 @@ void ViewportRotationControl::_notification(int p_what) {
|
|||
axis_menu_options.push_back(Node3DEditorViewport::VIEW_FRONT);
|
||||
|
||||
axis_colors.clear();
|
||||
axis_colors.push_back(get_theme_color("axis_x_color", "Editor"));
|
||||
axis_colors.push_back(get_theme_color("axis_y_color", "Editor"));
|
||||
axis_colors.push_back(get_theme_color("axis_z_color", "Editor"));
|
||||
axis_colors.push_back(get_theme_color(SNAME("axis_x_color"), SNAME("Editor")));
|
||||
axis_colors.push_back(get_theme_color(SNAME("axis_y_color"), SNAME("Editor")));
|
||||
axis_colors.push_back(get_theme_color(SNAME("axis_z_color"), SNAME("Editor")));
|
||||
update();
|
||||
|
||||
if (!is_connected("mouse_exited", callable_mp(this, &ViewportRotationControl::_on_mouse_exited))) {
|
||||
|
@ -143,7 +143,7 @@ void ViewportRotationControl::_draw_axis(const Axis2D &p_axis) {
|
|||
if (front) {
|
||||
String axis_name = direction == 0 ? "X" : (direction == 1 ? "Y" : "Z");
|
||||
draw_circle(p_axis.screen_point, AXIS_CIRCLE_RADIUS, c);
|
||||
draw_char(get_theme_font("rotation_control", "EditorFonts"), p_axis.screen_point + Vector2i(-4, 5) * EDSCALE, axis_name, "", get_theme_font_size("rotation_control_size", "EditorFonts"), Color(0.3, 0.3, 0.3));
|
||||
draw_char(get_theme_font(SNAME("rotation_control"), SNAME("EditorFonts")), p_axis.screen_point + Vector2i(-4, 5) * EDSCALE, axis_name, "", get_theme_font_size(SNAME("rotation_control_size"), SNAME("EditorFonts")), Color(0.3, 0.3, 0.3));
|
||||
} else {
|
||||
draw_circle(p_axis.screen_point, AXIS_CIRCLE_RADIUS * (0.55 + (0.2 * (1.0 + p_axis.z_axis))), c);
|
||||
}
|
||||
|
@ -1135,7 +1135,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
|||
Ref<InputEventMouseButton> b = p_event;
|
||||
|
||||
if (b.is_valid()) {
|
||||
emit_signal("clicked", this);
|
||||
emit_signal(SNAME("clicked"), this);
|
||||
|
||||
float zoom_factor = 1 + (ZOOM_FREELOOK_MULTIPLIER - 1) * b->get_factor();
|
||||
switch (b->get_button_index()) {
|
||||
|
@ -2045,7 +2045,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
|||
continue;
|
||||
}
|
||||
|
||||
spatial_editor->emit_signal("transform_key_request", sp, "", sp->get_transform());
|
||||
spatial_editor->emit_signal(SNAME("transform_key_request"), sp, "", sp->get_transform());
|
||||
}
|
||||
|
||||
set_message(TTR("Animation Key Inserted."));
|
||||
|
@ -2061,7 +2061,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
|||
|
||||
if (k->get_keycode() == KEY_SPACE) {
|
||||
if (!k->is_pressed()) {
|
||||
emit_signal("toggle_maximize_view", this);
|
||||
emit_signal(SNAME("toggle_maximize_view"), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2415,12 +2415,12 @@ void Node3DEditorViewport::_notification(int p_what) {
|
|||
} else {
|
||||
set_freelook_active(false);
|
||||
}
|
||||
call_deferred("update_transform_gizmo_view");
|
||||
call_deferred(SNAME("update_transform_gizmo_view"));
|
||||
rotation_control->set_visible(EditorSettings::get_singleton()->get("editors/3d/navigation/show_viewport_rotation_gizmo"));
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_RESIZED) {
|
||||
call_deferred("update_transform_gizmo_view");
|
||||
call_deferred(SNAME("update_transform_gizmo_view"));
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_PROCESS) {
|
||||
|
@ -2633,31 +2633,31 @@ void Node3DEditorViewport::_notification(int p_what) {
|
|||
}
|
||||
|
||||
if (p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
view_menu->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons"));
|
||||
preview_camera->set_icon(get_theme_icon("Camera3D", "EditorIcons"));
|
||||
view_menu->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||
preview_camera->set_icon(get_theme_icon(SNAME("Camera3D"), SNAME("EditorIcons")));
|
||||
|
||||
view_menu->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
view_menu->add_theme_style_override("hover", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
view_menu->add_theme_style_override("pressed", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
view_menu->add_theme_style_override("focus", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
view_menu->add_theme_style_override("disabled", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
view_menu->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
view_menu->add_theme_style_override("hover", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
view_menu->add_theme_style_override("pressed", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
view_menu->add_theme_style_override("focus", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
view_menu->add_theme_style_override("disabled", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
|
||||
preview_camera->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
preview_camera->add_theme_style_override("hover", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
preview_camera->add_theme_style_override("pressed", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
preview_camera->add_theme_style_override("focus", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
preview_camera->add_theme_style_override("disabled", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
preview_camera->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
preview_camera->add_theme_style_override("hover", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
preview_camera->add_theme_style_override("pressed", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
preview_camera->add_theme_style_override("focus", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
preview_camera->add_theme_style_override("disabled", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
|
||||
frame_time_gradient->set_color(0, get_theme_color("success_color", "Editor"));
|
||||
frame_time_gradient->set_color(1, get_theme_color("warning_color", "Editor"));
|
||||
frame_time_gradient->set_color(2, get_theme_color("error_color", "Editor"));
|
||||
frame_time_gradient->set_color(0, get_theme_color(SNAME("success_color"), SNAME("Editor")));
|
||||
frame_time_gradient->set_color(1, get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
frame_time_gradient->set_color(2, get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
|
||||
info_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
cpu_time_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
gpu_time_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
fps_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
cinema_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
locked_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
|
||||
info_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
cpu_time_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
gpu_time_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
fps_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
cinema_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
locked_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2698,7 +2698,7 @@ void Node3DEditorViewport::_draw() {
|
|||
if (surface->has_focus()) {
|
||||
Size2 size = surface->get_size();
|
||||
Rect2 r = Rect2(Point2(), size);
|
||||
get_theme_stylebox("Focus", "EditorStyles")->draw(surface->get_canvas_item(), r);
|
||||
get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles"))->draw(surface->get_canvas_item(), r);
|
||||
}
|
||||
|
||||
if (cursor.region_select) {
|
||||
|
@ -2706,11 +2706,11 @@ void Node3DEditorViewport::_draw() {
|
|||
|
||||
surface->draw_rect(
|
||||
selection_rect,
|
||||
get_theme_color("box_selection_fill_color", "Editor"));
|
||||
get_theme_color(SNAME("box_selection_fill_color"), SNAME("Editor")));
|
||||
|
||||
surface->draw_rect(
|
||||
selection_rect,
|
||||
get_theme_color("box_selection_stroke_color", "Editor"),
|
||||
get_theme_color(SNAME("box_selection_stroke_color"), SNAME("Editor")),
|
||||
false,
|
||||
Math::round(EDSCALE));
|
||||
}
|
||||
|
@ -2718,8 +2718,8 @@ void Node3DEditorViewport::_draw() {
|
|||
RID ci = surface->get_canvas_item();
|
||||
|
||||
if (message_time > 0) {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int font_size = get_theme_font_size("font_size", "Label");
|
||||
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
|
||||
int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
|
||||
Point2 msgpos = Point2(5, get_size().y - 20);
|
||||
font->draw_string(ci, msgpos + Point2(1, 1), message, HALIGN_LEFT, -1, font_size, Color(0, 0, 0, 0.8));
|
||||
font->draw_string(ci, msgpos + Point2(-1, -1), message, HALIGN_LEFT, -1, font_size, Color(0, 0, 0, 0.8));
|
||||
|
@ -2732,16 +2732,16 @@ void Node3DEditorViewport::_draw() {
|
|||
Color handle_color;
|
||||
switch (_edit.plane) {
|
||||
case TRANSFORM_X_AXIS:
|
||||
handle_color = get_theme_color("axis_x_color", "Editor");
|
||||
handle_color = get_theme_color(SNAME("axis_x_color"), SNAME("Editor"));
|
||||
break;
|
||||
case TRANSFORM_Y_AXIS:
|
||||
handle_color = get_theme_color("axis_y_color", "Editor");
|
||||
handle_color = get_theme_color(SNAME("axis_y_color"), SNAME("Editor"));
|
||||
break;
|
||||
case TRANSFORM_Z_AXIS:
|
||||
handle_color = get_theme_color("axis_z_color", "Editor");
|
||||
handle_color = get_theme_color(SNAME("axis_z_color"), SNAME("Editor"));
|
||||
break;
|
||||
default:
|
||||
handle_color = get_theme_color("accent_color", "Editor");
|
||||
handle_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
break;
|
||||
}
|
||||
handle_color.a = 1.0;
|
||||
|
@ -2798,9 +2798,9 @@ void Node3DEditorViewport::_draw() {
|
|||
draw_indicator_bar(
|
||||
*surface,
|
||||
1.0 - logscale_t,
|
||||
get_theme_icon("ViewportSpeed", "EditorIcons"),
|
||||
get_theme_font("font", "Label"),
|
||||
get_theme_font_size("font_size", "Label"),
|
||||
get_theme_icon(SNAME("ViewportSpeed"), SNAME("EditorIcons")),
|
||||
get_theme_font(SNAME("font"), SNAME("Label")),
|
||||
get_theme_font_size(SNAME("font_size"), SNAME("Label")),
|
||||
vformat("%s u/s", String::num(freelook_speed).pad_decimals(precision)));
|
||||
}
|
||||
|
||||
|
@ -2820,9 +2820,9 @@ void Node3DEditorViewport::_draw() {
|
|||
draw_indicator_bar(
|
||||
*surface,
|
||||
logscale_t,
|
||||
get_theme_icon("ViewportZoom", "EditorIcons"),
|
||||
get_theme_font("font", "Label"),
|
||||
get_theme_font_size("font_size", "Label"),
|
||||
get_theme_icon(SNAME("ViewportZoom"), SNAME("EditorIcons")),
|
||||
get_theme_font(SNAME("font"), SNAME("Label")),
|
||||
get_theme_font_size(SNAME("font_size"), SNAME("Label")),
|
||||
vformat("%s u", String::num(cursor.distance).pad_decimals(precision)));
|
||||
}
|
||||
}
|
||||
|
@ -2976,7 +2976,7 @@ void Node3DEditorViewport::_menu_option(int p_option) {
|
|||
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_ORTHOGONAL), false);
|
||||
orthogonal = false;
|
||||
auto_orthogonal = false;
|
||||
call_deferred("update_transform_gizmo_view");
|
||||
call_deferred(SNAME("update_transform_gizmo_view"));
|
||||
_update_name();
|
||||
|
||||
} break;
|
||||
|
@ -2985,7 +2985,7 @@ void Node3DEditorViewport::_menu_option(int p_option) {
|
|||
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_ORTHOGONAL), true);
|
||||
orthogonal = true;
|
||||
auto_orthogonal = false;
|
||||
call_deferred("update_transform_gizmo_view");
|
||||
call_deferred(SNAME("update_transform_gizmo_view"));
|
||||
_update_name();
|
||||
|
||||
} break;
|
||||
|
@ -4251,8 +4251,8 @@ void Node3DEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
if (mb->is_pressed()) {
|
||||
Vector2 size = get_size();
|
||||
|
||||
int h_sep = get_theme_constant("separation", "HSplitContainer");
|
||||
int v_sep = get_theme_constant("separation", "VSplitContainer");
|
||||
int h_sep = get_theme_constant(SNAME("separation"), SNAME("HSplitContainer"));
|
||||
int v_sep = get_theme_constant(SNAME("separation"), SNAME("VSplitContainer"));
|
||||
|
||||
int mid_w = size.width * ratio_h;
|
||||
int mid_h = size.height * ratio_v;
|
||||
|
@ -4297,8 +4297,8 @@ void Node3DEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
if (view == VIEW_USE_3_VIEWPORTS || view == VIEW_USE_3_VIEWPORTS_ALT || view == VIEW_USE_4_VIEWPORTS) {
|
||||
Vector2 size = get_size();
|
||||
|
||||
int h_sep = get_theme_constant("separation", "HSplitContainer");
|
||||
int v_sep = get_theme_constant("separation", "VSplitContainer");
|
||||
int h_sep = get_theme_constant(SNAME("separation"), SNAME("HSplitContainer"));
|
||||
int v_sep = get_theme_constant(SNAME("separation"), SNAME("VSplitContainer"));
|
||||
|
||||
int mid_w = size.width * ratio_h;
|
||||
int mid_h = size.height * ratio_v;
|
||||
|
@ -4337,18 +4337,18 @@ void Node3DEditorViewportContainer::_notification(int p_what) {
|
|||
}
|
||||
|
||||
if (p_what == NOTIFICATION_DRAW && mouseover) {
|
||||
Ref<Texture2D> h_grabber = get_theme_icon("grabber", "HSplitContainer");
|
||||
Ref<Texture2D> v_grabber = get_theme_icon("grabber", "VSplitContainer");
|
||||
Ref<Texture2D> h_grabber = get_theme_icon(SNAME("grabber"), SNAME("HSplitContainer"));
|
||||
Ref<Texture2D> v_grabber = get_theme_icon(SNAME("grabber"), SNAME("VSplitContainer"));
|
||||
|
||||
Ref<Texture2D> hdiag_grabber = get_theme_icon("GuiViewportHdiagsplitter", "EditorIcons");
|
||||
Ref<Texture2D> vdiag_grabber = get_theme_icon("GuiViewportVdiagsplitter", "EditorIcons");
|
||||
Ref<Texture2D> vh_grabber = get_theme_icon("GuiViewportVhsplitter", "EditorIcons");
|
||||
Ref<Texture2D> hdiag_grabber = get_theme_icon(SNAME("GuiViewportHdiagsplitter"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> vdiag_grabber = get_theme_icon(SNAME("GuiViewportVdiagsplitter"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> vh_grabber = get_theme_icon(SNAME("GuiViewportVhsplitter"), SNAME("EditorIcons"));
|
||||
|
||||
Vector2 size = get_size();
|
||||
|
||||
int h_sep = get_theme_constant("separation", "HSplitContainer");
|
||||
int h_sep = get_theme_constant(SNAME("separation"), SNAME("HSplitContainer"));
|
||||
|
||||
int v_sep = get_theme_constant("separation", "VSplitContainer");
|
||||
int v_sep = get_theme_constant(SNAME("separation"), SNAME("VSplitContainer"));
|
||||
|
||||
int mid_w = size.width * ratio_h;
|
||||
int mid_h = size.height * ratio_v;
|
||||
|
@ -4434,9 +4434,9 @@ void Node3DEditorViewportContainer::_notification(int p_what) {
|
|||
}
|
||||
return;
|
||||
}
|
||||
int h_sep = get_theme_constant("separation", "HSplitContainer");
|
||||
int h_sep = get_theme_constant(SNAME("separation"), SNAME("HSplitContainer"));
|
||||
|
||||
int v_sep = get_theme_constant("separation", "VSplitContainer");
|
||||
int v_sep = get_theme_constant(SNAME("separation"), SNAME("VSplitContainer"));
|
||||
|
||||
int mid_w = size.width * ratio_h;
|
||||
int mid_h = size.height * ratio_v;
|
||||
|
@ -5054,13 +5054,13 @@ void Node3DEditor::_menu_gizmo_toggled(int p_option) {
|
|||
const int state = gizmos_menu->get_item_state(idx);
|
||||
switch (state) {
|
||||
case EditorNode3DGizmoPlugin::VISIBLE:
|
||||
gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon("visibility_visible"));
|
||||
gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon(SNAME("visibility_visible")));
|
||||
break;
|
||||
case EditorNode3DGizmoPlugin::ON_TOP:
|
||||
gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon("visibility_xray"));
|
||||
gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon(SNAME("visibility_xray")));
|
||||
break;
|
||||
case EditorNode3DGizmoPlugin::HIDDEN:
|
||||
gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon("visibility_hidden"));
|
||||
gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon(SNAME("visibility_hidden")));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -5347,13 +5347,13 @@ void Node3DEditor::_init_indicators() {
|
|||
Color origin_color;
|
||||
switch (i) {
|
||||
case 0:
|
||||
origin_color = get_theme_color("axis_x_color", "Editor");
|
||||
origin_color = get_theme_color(SNAME("axis_x_color"), SNAME("Editor"));
|
||||
break;
|
||||
case 1:
|
||||
origin_color = get_theme_color("axis_y_color", "Editor");
|
||||
origin_color = get_theme_color(SNAME("axis_y_color"), SNAME("Editor"));
|
||||
break;
|
||||
case 2:
|
||||
origin_color = get_theme_color("axis_z_color", "Editor");
|
||||
origin_color = get_theme_color(SNAME("axis_z_color"), SNAME("Editor"));
|
||||
break;
|
||||
default:
|
||||
origin_color = Color();
|
||||
|
@ -5448,13 +5448,13 @@ void Node3DEditor::_init_indicators() {
|
|||
Color col;
|
||||
switch (i) {
|
||||
case 0:
|
||||
col = get_theme_color("axis_x_color", "Editor");
|
||||
col = get_theme_color(SNAME("axis_x_color"), SNAME("Editor"));
|
||||
break;
|
||||
case 1:
|
||||
col = get_theme_color("axis_y_color", "Editor");
|
||||
col = get_theme_color(SNAME("axis_y_color"), SNAME("Editor"));
|
||||
break;
|
||||
case 2:
|
||||
col = get_theme_color("axis_z_color", "Editor");
|
||||
col = get_theme_color(SNAME("axis_z_color"), SNAME("Editor"));
|
||||
break;
|
||||
default:
|
||||
col = Color();
|
||||
|
@ -5814,13 +5814,13 @@ void Node3DEditor::_update_gizmos_menu() {
|
|||
TTR("Click to toggle between visibility states.\n\nOpen eye: Gizmo is visible.\nClosed eye: Gizmo is hidden.\nHalf-open eye: Gizmo is also visible through opaque surfaces (\"x-ray\")."));
|
||||
switch (plugin_state) {
|
||||
case EditorNode3DGizmoPlugin::VISIBLE:
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_visible"));
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon(SNAME("visibility_visible")));
|
||||
break;
|
||||
case EditorNode3DGizmoPlugin::ON_TOP:
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_xray"));
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon(SNAME("visibility_xray")));
|
||||
break;
|
||||
case EditorNode3DGizmoPlugin::HIDDEN:
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_hidden"));
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon(SNAME("visibility_hidden")));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -5835,13 +5835,13 @@ void Node3DEditor::_update_gizmos_menu_theme() {
|
|||
const int idx = gizmos_menu->get_item_index(i);
|
||||
switch (plugin_state) {
|
||||
case EditorNode3DGizmoPlugin::VISIBLE:
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_visible"));
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon(SNAME("visibility_visible")));
|
||||
break;
|
||||
case EditorNode3DGizmoPlugin::ON_TOP:
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_xray"));
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon(SNAME("visibility_xray")));
|
||||
break;
|
||||
case EditorNode3DGizmoPlugin::HIDDEN:
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_hidden"));
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon(SNAME("visibility_hidden")));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -6291,26 +6291,26 @@ void Node3DEditor::_add_environment_to_scene(bool p_already_added_sun) {
|
|||
|
||||
void Node3DEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_READY) {
|
||||
tool_button[Node3DEditor::TOOL_MODE_SELECT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_MODE_MOVE]->set_icon(get_theme_icon("ToolMove", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_MODE_ROTATE]->set_icon(get_theme_icon("ToolRotate", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_MODE_SCALE]->set_icon(get_theme_icon("ToolScale", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon("ListSelect", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_LOCK_SELECTED]->set_icon(get_theme_icon("Lock", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon("Unlock", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_GROUP_SELECTED]->set_icon(get_theme_icon("Group", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon("Ungroup", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_MODE_SELECT]->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_MODE_MOVE]->set_icon(get_theme_icon(SNAME("ToolMove"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_MODE_ROTATE]->set_icon(get_theme_icon(SNAME("ToolRotate"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_MODE_SCALE]->set_icon(get_theme_icon(SNAME("ToolScale"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon(SNAME("ListSelect"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_LOCK_SELECTED]->set_icon(get_theme_icon(SNAME("Lock"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon(SNAME("Unlock"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_GROUP_SELECTED]->set_icon(get_theme_icon(SNAME("Group"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon(SNAME("Ungroup"), SNAME("EditorIcons")));
|
||||
|
||||
tool_option_button[Node3DEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon("Object", "EditorIcons"));
|
||||
tool_option_button[Node3DEditor::TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon("Snap", "EditorIcons"));
|
||||
tool_option_button[Node3DEditor::TOOL_OPT_OVERRIDE_CAMERA]->set_icon(get_theme_icon("Camera3D", "EditorIcons"));
|
||||
tool_option_button[Node3DEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon(SNAME("Object"), SNAME("EditorIcons")));
|
||||
tool_option_button[Node3DEditor::TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon(SNAME("Snap"), SNAME("EditorIcons")));
|
||||
tool_option_button[Node3DEditor::TOOL_OPT_OVERRIDE_CAMERA]->set_icon(get_theme_icon(SNAME("Camera3D"), SNAME("EditorIcons")));
|
||||
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_theme_icon("Panels1", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_theme_icon("Panels2", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS_ALT), get_theme_icon("Panels2Alt", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS), get_theme_icon("Panels3", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_theme_icon("Panels3Alt", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_theme_icon("Panels4", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_theme_icon(SNAME("Panels1"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_theme_icon(SNAME("Panels2"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS_ALT), get_theme_icon(SNAME("Panels2Alt"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS), get_theme_icon(SNAME("Panels3"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_theme_icon(SNAME("Panels3Alt"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_theme_icon(SNAME("Panels4"), SNAME("EditorIcons")));
|
||||
|
||||
_menu_item_pressed(MENU_VIEW_USE_1_VIEWPORT);
|
||||
|
||||
|
@ -6324,13 +6324,13 @@ void Node3DEditor::_notification(int p_what) {
|
|||
editor->connect("stop_pressed", callable_mp(this, &Node3DEditor::_update_camera_override_button), make_binds(false));
|
||||
editor->connect("play_pressed", callable_mp(this, &Node3DEditor::_update_camera_override_button), make_binds(true));
|
||||
|
||||
sun_button->set_icon(get_theme_icon("DirectionalLight3D", "EditorIcons"));
|
||||
environ_button->set_icon(get_theme_icon("WorldEnvironment", "EditorIcons"));
|
||||
sun_environ_settings->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons"));
|
||||
sun_button->set_icon(get_theme_icon(SNAME("DirectionalLight3D"), SNAME("EditorIcons")));
|
||||
environ_button->set_icon(get_theme_icon(SNAME("WorldEnvironment"), SNAME("EditorIcons")));
|
||||
sun_environ_settings->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||
|
||||
_update_preview_environment();
|
||||
sun_title->add_theme_font_override("font", get_theme_font("title_font", "Window"));
|
||||
environ_title->add_theme_font_override("font", get_theme_font("title_font", "Window"));
|
||||
sun_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
|
||||
environ_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
|
||||
|
||||
sun_state->set_custom_minimum_size(sun_vb->get_combined_minimum_size());
|
||||
environ_state->set_custom_minimum_size(environ_vb->get_combined_minimum_size());
|
||||
|
@ -6340,30 +6340,30 @@ void Node3DEditor::_notification(int p_what) {
|
|||
_init_indicators();
|
||||
} else if (p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
_update_gizmos_menu_theme();
|
||||
sun_title->add_theme_font_override("font", get_theme_font("title_font", "Window"));
|
||||
environ_title->add_theme_font_override("font", get_theme_font("title_font", "Window"));
|
||||
sun_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
|
||||
environ_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
|
||||
} else if (p_what == NOTIFICATION_EXIT_TREE) {
|
||||
_finish_indicators();
|
||||
} else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||
tool_button[Node3DEditor::TOOL_MODE_SELECT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_MODE_MOVE]->set_icon(get_theme_icon("ToolMove", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_MODE_ROTATE]->set_icon(get_theme_icon("ToolRotate", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_MODE_SCALE]->set_icon(get_theme_icon("ToolScale", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon("ListSelect", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_LOCK_SELECTED]->set_icon(get_theme_icon("Lock", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon("Unlock", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_GROUP_SELECTED]->set_icon(get_theme_icon("Group", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon("Ungroup", "EditorIcons"));
|
||||
tool_button[Node3DEditor::TOOL_MODE_SELECT]->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_MODE_MOVE]->set_icon(get_theme_icon(SNAME("ToolMove"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_MODE_ROTATE]->set_icon(get_theme_icon(SNAME("ToolRotate"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_MODE_SCALE]->set_icon(get_theme_icon(SNAME("ToolScale"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon(SNAME("ListSelect"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_LOCK_SELECTED]->set_icon(get_theme_icon(SNAME("Lock"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon(SNAME("Unlock"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_GROUP_SELECTED]->set_icon(get_theme_icon(SNAME("Group"), SNAME("EditorIcons")));
|
||||
tool_button[Node3DEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon(SNAME("Ungroup"), SNAME("EditorIcons")));
|
||||
|
||||
tool_option_button[Node3DEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon("Object", "EditorIcons"));
|
||||
tool_option_button[Node3DEditor::TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon("Snap", "EditorIcons"));
|
||||
tool_option_button[Node3DEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon(SNAME("Object"), SNAME("EditorIcons")));
|
||||
tool_option_button[Node3DEditor::TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon(SNAME("Snap"), SNAME("EditorIcons")));
|
||||
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_theme_icon("Panels1", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_theme_icon("Panels2", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS_ALT), get_theme_icon("Panels2Alt", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS), get_theme_icon("Panels3", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_theme_icon("Panels3Alt", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_theme_icon("Panels4", "EditorIcons"));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_theme_icon(SNAME("Panels1"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_theme_icon(SNAME("Panels2"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS_ALT), get_theme_icon(SNAME("Panels2Alt"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS), get_theme_icon(SNAME("Panels3"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_theme_icon(SNAME("Panels3Alt"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_theme_icon(SNAME("Panels4"), SNAME("EditorIcons")));
|
||||
|
||||
// Update grid color by rebuilding grid.
|
||||
_finish_grid();
|
||||
|
@ -7514,7 +7514,7 @@ void EditorNode3DGizmoPlugin::create_handle_material(const String &p_name, bool
|
|||
|
||||
handle_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_USE_POINT_SIZE, true);
|
||||
Ref<Texture2D> handle_t = p_icon != nullptr ? p_icon : Node3DEditor::get_singleton()->get_theme_icon("Editor3DHandle", "EditorIcons");
|
||||
Ref<Texture2D> handle_t = p_icon != nullptr ? p_icon : Node3DEditor::get_singleton()->get_theme_icon(SNAME("Editor3DHandle"), SNAME("EditorIcons"));
|
||||
handle_material->set_point_size(handle_t->get_width());
|
||||
handle_material->set_texture(StandardMaterial3D::TEXTURE_ALBEDO, handle_t);
|
||||
handle_material->set_albedo(Color(1, 1, 1));
|
||||
|
|
|
@ -98,7 +98,7 @@ OccluderInstance3DEditorPlugin::OccluderInstance3DEditorPlugin(EditorNode *p_nod
|
|||
editor = p_node;
|
||||
bake = memnew(Button);
|
||||
bake->set_flat(true);
|
||||
bake->set_icon(editor->get_gui_base()->get_theme_icon("Bake", "EditorIcons"));
|
||||
bake->set_icon(editor->get_gui_base()->get_theme_icon(SNAME("Bake"), SNAME("EditorIcons")));
|
||||
bake->set_text(TTR("Bake Occluders"));
|
||||
bake->hide();
|
||||
bake->connect("pressed", Callable(this, "_bake"));
|
||||
|
|
|
@ -49,10 +49,10 @@ void OpenTypeFeaturesEditor::update_property() {
|
|||
|
||||
void OpenTypeFeaturesEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
|
||||
button->set_icon(get_theme_icon("Remove", "EditorIcons"));
|
||||
button->set_size(get_theme_icon("Remove", "EditorIcons")->get_size());
|
||||
button->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
button->set_size(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"))->get_size());
|
||||
spin->set_custom_label_color(true, base);
|
||||
}
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ void OpenTypeFeaturesAdd::update_property() {
|
|||
bool have_ss = false;
|
||||
bool have_cv = false;
|
||||
bool have_cu = false;
|
||||
Dictionary features = Object::cast_to<Control>(get_edited_object())->get_theme_font("font")->get_feature_list();
|
||||
Dictionary features = Object::cast_to<Control>(get_edited_object())->get_theme_font(SNAME("font"))->get_feature_list();
|
||||
for (const Variant *ftr = features.next(nullptr); ftr != nullptr; ftr = features.next(ftr)) {
|
||||
String ftr_name = TS->tag_to_name(*ftr);
|
||||
if (ftr_name.begins_with("stylistic_set_")) {
|
||||
|
@ -142,8 +142,8 @@ void OpenTypeFeaturesAdd::_features_menu() {
|
|||
void OpenTypeFeaturesAdd::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) {
|
||||
set_label("");
|
||||
button->set_icon(get_theme_icon("Add", "EditorIcons"));
|
||||
button->set_size(get_theme_icon("Add", "EditorIcons")->get_size());
|
||||
button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
button->set_size(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))->get_size());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -364,12 +364,12 @@ void Path2DEditor::forward_canvas_draw_over_viewport(Control *p_overlay) {
|
|||
|
||||
Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
|
||||
|
||||
const Ref<Texture2D> path_sharp_handle = get_theme_icon("EditorPathSharpHandle", "EditorIcons");
|
||||
const Ref<Texture2D> path_smooth_handle = get_theme_icon("EditorPathSmoothHandle", "EditorIcons");
|
||||
const Ref<Texture2D> path_sharp_handle = get_theme_icon(SNAME("EditorPathSharpHandle"), SNAME("EditorIcons"));
|
||||
const Ref<Texture2D> path_smooth_handle = get_theme_icon(SNAME("EditorPathSmoothHandle"), SNAME("EditorIcons"));
|
||||
// Both handle icons must be of the same size
|
||||
const Size2 handle_size = path_sharp_handle->get_size();
|
||||
|
||||
const Ref<Texture2D> curve_handle = get_theme_icon("EditorCurveHandle", "EditorIcons");
|
||||
const Ref<Texture2D> curve_handle = get_theme_icon(SNAME("EditorCurveHandle"), SNAME("EditorIcons"));
|
||||
const Size2 curve_handle_size = curve_handle->get_size();
|
||||
|
||||
Ref<Curve2D> curve = node->get_curve();
|
||||
|
@ -411,7 +411,7 @@ void Path2DEditor::forward_canvas_draw_over_viewport(Control *p_overlay) {
|
|||
}
|
||||
|
||||
if (on_edge) {
|
||||
Ref<Texture2D> add_handle = get_theme_icon("EditorHandleAdd", "EditorIcons");
|
||||
Ref<Texture2D> add_handle = get_theme_icon(SNAME("EditorHandleAdd"), SNAME("EditorIcons"));
|
||||
p_overlay->draw_texture(add_handle, edge_point - add_handle->get_size() * 0.5);
|
||||
}
|
||||
}
|
||||
|
@ -534,7 +534,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) {
|
|||
base_hb->add_child(sep);
|
||||
curve_edit = memnew(Button);
|
||||
curve_edit->set_flat(true);
|
||||
curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveEdit", "EditorIcons"));
|
||||
curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveEdit"), SNAME("EditorIcons")));
|
||||
curve_edit->set_toggle_mode(true);
|
||||
curve_edit->set_focus_mode(Control::FOCUS_NONE);
|
||||
curve_edit->set_tooltip(TTR("Select Points") + "\n" + TTR("Shift+Drag: Select Control Points") + "\n" + keycode_get_string(KEY_MASK_CMD) + TTR("Click: Add Point") + "\n" + TTR("Left Click: Split Segment (in curve)") + "\n" + TTR("Right Click: Delete Point"));
|
||||
|
@ -542,7 +542,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) {
|
|||
base_hb->add_child(curve_edit);
|
||||
curve_edit_curve = memnew(Button);
|
||||
curve_edit_curve->set_flat(true);
|
||||
curve_edit_curve->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveCurve", "EditorIcons"));
|
||||
curve_edit_curve->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveCurve"), SNAME("EditorIcons")));
|
||||
curve_edit_curve->set_toggle_mode(true);
|
||||
curve_edit_curve->set_focus_mode(Control::FOCUS_NONE);
|
||||
curve_edit_curve->set_tooltip(TTR("Select Control Points (Shift+Drag)"));
|
||||
|
@ -550,7 +550,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) {
|
|||
base_hb->add_child(curve_edit_curve);
|
||||
curve_create = memnew(Button);
|
||||
curve_create->set_flat(true);
|
||||
curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveCreate", "EditorIcons"));
|
||||
curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveCreate"), SNAME("EditorIcons")));
|
||||
curve_create->set_toggle_mode(true);
|
||||
curve_create->set_focus_mode(Control::FOCUS_NONE);
|
||||
curve_create->set_tooltip(TTR("Add Point (in empty space)"));
|
||||
|
@ -558,7 +558,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) {
|
|||
base_hb->add_child(curve_create);
|
||||
curve_del = memnew(Button);
|
||||
curve_del->set_flat(true);
|
||||
curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveDelete", "EditorIcons"));
|
||||
curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveDelete"), SNAME("EditorIcons")));
|
||||
curve_del->set_toggle_mode(true);
|
||||
curve_del->set_focus_mode(Control::FOCUS_NONE);
|
||||
curve_del->set_tooltip(TTR("Delete Point"));
|
||||
|
@ -566,7 +566,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) {
|
|||
base_hb->add_child(curve_del);
|
||||
curve_close = memnew(Button);
|
||||
curve_close->set_flat(true);
|
||||
curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveClose", "EditorIcons"));
|
||||
curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveClose"), SNAME("EditorIcons")));
|
||||
curve_close->set_focus_mode(Control::FOCUS_NONE);
|
||||
curve_close->set_tooltip(TTR("Close Curve"));
|
||||
curve_close->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected), varray(ACTION_CLOSE));
|
||||
|
|
|
@ -453,14 +453,14 @@ void Path3DEditorPlugin::edit(Object *p_object) {
|
|||
path = Object::cast_to<Path3D>(p_object);
|
||||
if (path) {
|
||||
if (path->get_curve().is_valid()) {
|
||||
path->get_curve()->emit_signal("changed");
|
||||
path->get_curve()->emit_signal(SNAME("changed"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Path3D *pre = path;
|
||||
path = nullptr;
|
||||
if (pre) {
|
||||
pre->get_curve()->emit_signal("changed");
|
||||
pre->get_curve()->emit_signal(SNAME("changed"));
|
||||
}
|
||||
}
|
||||
//collision_polygon_editor->edit(Object::cast_to<Node>(p_object));
|
||||
|
@ -490,7 +490,7 @@ void Path3DEditorPlugin::make_visible(bool p_visible) {
|
|||
Path3D *pre = path;
|
||||
path = nullptr;
|
||||
if (pre && pre->get_curve().is_valid()) {
|
||||
pre->get_curve()->emit_signal("changed");
|
||||
pre->get_curve()->emit_signal(SNAME("changed"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) {
|
|||
Node3DEditor::get_singleton()->add_control_to_menu_panel(sep);
|
||||
curve_edit = memnew(Button);
|
||||
curve_edit->set_flat(true);
|
||||
curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveEdit", "EditorIcons"));
|
||||
curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveEdit"), SNAME("EditorIcons")));
|
||||
curve_edit->set_toggle_mode(true);
|
||||
curve_edit->hide();
|
||||
curve_edit->set_focus_mode(Control::FOCUS_NONE);
|
||||
|
@ -570,7 +570,7 @@ Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) {
|
|||
Node3DEditor::get_singleton()->add_control_to_menu_panel(curve_edit);
|
||||
curve_create = memnew(Button);
|
||||
curve_create->set_flat(true);
|
||||
curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveCreate", "EditorIcons"));
|
||||
curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveCreate"), SNAME("EditorIcons")));
|
||||
curve_create->set_toggle_mode(true);
|
||||
curve_create->hide();
|
||||
curve_create->set_focus_mode(Control::FOCUS_NONE);
|
||||
|
@ -578,7 +578,7 @@ Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) {
|
|||
Node3DEditor::get_singleton()->add_control_to_menu_panel(curve_create);
|
||||
curve_del = memnew(Button);
|
||||
curve_del->set_flat(true);
|
||||
curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveDelete", "EditorIcons"));
|
||||
curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveDelete"), SNAME("EditorIcons")));
|
||||
curve_del->set_toggle_mode(true);
|
||||
curve_del->hide();
|
||||
curve_del->set_focus_mode(Control::FOCUS_NONE);
|
||||
|
@ -586,7 +586,7 @@ Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) {
|
|||
Node3DEditor::get_singleton()->add_control_to_menu_panel(curve_del);
|
||||
curve_close = memnew(Button);
|
||||
curve_close->set_flat(true);
|
||||
curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveClose", "EditorIcons"));
|
||||
curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("CurveClose"), SNAME("EditorIcons")));
|
||||
curve_close->hide();
|
||||
curve_close->set_focus_mode(Control::FOCUS_NONE);
|
||||
curve_close->set_tooltip(TTR("Close Curve"));
|
||||
|
@ -644,6 +644,6 @@ Path3DGizmoPlugin::Path3DGizmoPlugin() {
|
|||
Color path_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/path", Color(0.5, 0.5, 1.0, 0.8));
|
||||
create_material("path_material", path_color);
|
||||
create_material("path_thin_material", Color(0.5, 0.5, 0.5));
|
||||
create_handle_material("handles", false, Node3DEditor::get_singleton()->get_theme_icon("EditorPathSmoothHandle", "EditorIcons"));
|
||||
create_handle_material("sec_handles", false, Node3DEditor::get_singleton()->get_theme_icon("EditorCurveHandle", "EditorIcons"));
|
||||
create_handle_material("handles", false, Node3DEditor::get_singleton()->get_theme_icon(SNAME("EditorPathSmoothHandle"), SNAME("EditorIcons")));
|
||||
create_handle_material("sec_handles", false, Node3DEditor::get_singleton()->get_theme_icon(SNAME("EditorCurveHandle"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ PhysicalBone3DEditor::PhysicalBone3DEditor(EditorNode *p_editor) :
|
|||
spatial_editor_hb->add_child(button_transform_joint);
|
||||
|
||||
button_transform_joint->set_text(TTR("Move Joint"));
|
||||
button_transform_joint->set_icon(Node3DEditor::get_singleton()->get_theme_icon("PhysicalBone3D", "EditorIcons"));
|
||||
button_transform_joint->set_icon(Node3DEditor::get_singleton()->get_theme_icon(SNAME("PhysicalBone3D"), SNAME("EditorIcons")));
|
||||
button_transform_joint->set_toggle_mode(true);
|
||||
button_transform_joint->connect("toggled", callable_mp(this, &PhysicalBone3DEditor::_on_toggle_button_transform_joint));
|
||||
|
||||
|
|
|
@ -64,27 +64,27 @@ void Polygon2DEditor::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
uv_edit_draw->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree"));
|
||||
bone_scroll->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree"));
|
||||
uv_edit_draw->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
bone_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
} break;
|
||||
case NOTIFICATION_READY: {
|
||||
button_uv->set_icon(get_theme_icon("Uv", "EditorIcons"));
|
||||
button_uv->set_icon(get_theme_icon(SNAME("Uv"), SNAME("EditorIcons")));
|
||||
|
||||
uv_button[UV_MODE_CREATE]->set_icon(get_theme_icon("Edit", "EditorIcons"));
|
||||
uv_button[UV_MODE_CREATE_INTERNAL]->set_icon(get_theme_icon("EditInternal", "EditorIcons"));
|
||||
uv_button[UV_MODE_REMOVE_INTERNAL]->set_icon(get_theme_icon("RemoveInternal", "EditorIcons"));
|
||||
uv_button[UV_MODE_EDIT_POINT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons"));
|
||||
uv_button[UV_MODE_MOVE]->set_icon(get_theme_icon("ToolMove", "EditorIcons"));
|
||||
uv_button[UV_MODE_ROTATE]->set_icon(get_theme_icon("ToolRotate", "EditorIcons"));
|
||||
uv_button[UV_MODE_SCALE]->set_icon(get_theme_icon("ToolScale", "EditorIcons"));
|
||||
uv_button[UV_MODE_ADD_POLYGON]->set_icon(get_theme_icon("Edit", "EditorIcons"));
|
||||
uv_button[UV_MODE_REMOVE_POLYGON]->set_icon(get_theme_icon("Close", "EditorIcons"));
|
||||
uv_button[UV_MODE_PAINT_WEIGHT]->set_icon(get_theme_icon("Bucket", "EditorIcons"));
|
||||
uv_button[UV_MODE_CLEAR_WEIGHT]->set_icon(get_theme_icon("Clear", "EditorIcons"));
|
||||
uv_button[UV_MODE_CREATE]->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
uv_button[UV_MODE_CREATE_INTERNAL]->set_icon(get_theme_icon(SNAME("EditInternal"), SNAME("EditorIcons")));
|
||||
uv_button[UV_MODE_REMOVE_INTERNAL]->set_icon(get_theme_icon(SNAME("RemoveInternal"), SNAME("EditorIcons")));
|
||||
uv_button[UV_MODE_EDIT_POINT]->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
||||
uv_button[UV_MODE_MOVE]->set_icon(get_theme_icon(SNAME("ToolMove"), SNAME("EditorIcons")));
|
||||
uv_button[UV_MODE_ROTATE]->set_icon(get_theme_icon(SNAME("ToolRotate"), SNAME("EditorIcons")));
|
||||
uv_button[UV_MODE_SCALE]->set_icon(get_theme_icon(SNAME("ToolScale"), SNAME("EditorIcons")));
|
||||
uv_button[UV_MODE_ADD_POLYGON]->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
uv_button[UV_MODE_REMOVE_POLYGON]->set_icon(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
uv_button[UV_MODE_PAINT_WEIGHT]->set_icon(get_theme_icon(SNAME("Bucket"), SNAME("EditorIcons")));
|
||||
uv_button[UV_MODE_CLEAR_WEIGHT]->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")));
|
||||
|
||||
b_snap_grid->set_icon(get_theme_icon("Grid", "EditorIcons"));
|
||||
b_snap_enable->set_icon(get_theme_icon("SnapGrid", "EditorIcons"));
|
||||
uv_icon_zoom->set_texture(get_theme_icon("Zoom", "EditorIcons"));
|
||||
b_snap_grid->set_icon(get_theme_icon(SNAME("Grid"), SNAME("EditorIcons")));
|
||||
b_snap_enable->set_icon(get_theme_icon(SNAME("SnapGrid"), SNAME("EditorIcons")));
|
||||
uv_icon_zoom->set_texture(get_theme_icon(SNAME("Zoom"), SNAME("EditorIcons")));
|
||||
|
||||
uv_vscroll->set_anchors_and_offsets_preset(PRESET_RIGHT_WIDE);
|
||||
uv_hscroll->set_anchors_and_offsets_preset(PRESET_BOTTOM_WIDE);
|
||||
|
@ -1015,7 +1015,7 @@ void Polygon2DEditor::_uv_draw() {
|
|||
}
|
||||
|
||||
// All UV points are sharp, so use the sharp handle icon
|
||||
Ref<Texture2D> handle = get_theme_icon("EditorPathSharpHandle", "EditorIcons");
|
||||
Ref<Texture2D> handle = get_theme_icon(SNAME("EditorPathSharpHandle"), SNAME("EditorIcons"));
|
||||
|
||||
Color poly_line_color = Color(0.9, 0.5, 0.5);
|
||||
if (polygons.size() || polygon_create.size()) {
|
||||
|
|
|
@ -40,7 +40,7 @@ void ResourcePreloaderEditor::_gui_input(Ref<InputEvent> p_event) {
|
|||
|
||||
void ResourcePreloaderEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
load->set_icon(get_theme_icon("Folder", "EditorIcons"));
|
||||
load->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_READY) {
|
||||
|
@ -208,11 +208,11 @@ void ResourcePreloaderEditor::_update_library() {
|
|||
ti->set_selectable(1, false);
|
||||
|
||||
if (type == "PackedScene") {
|
||||
ti->add_button(1, get_theme_icon("InstanceOptions", "EditorIcons"), BUTTON_OPEN_SCENE, false, TTR("Open in Editor"));
|
||||
ti->add_button(1, get_theme_icon(SNAME("InstanceOptions"), SNAME("EditorIcons")), BUTTON_OPEN_SCENE, false, TTR("Open in Editor"));
|
||||
} else {
|
||||
ti->add_button(1, get_theme_icon("Load", "EditorIcons"), BUTTON_EDIT_RESOURCE, false, TTR("Open in Editor"));
|
||||
ti->add_button(1, get_theme_icon(SNAME("Load"), SNAME("EditorIcons")), BUTTON_EDIT_RESOURCE, false, TTR("Open in Editor"));
|
||||
}
|
||||
ti->add_button(1, get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE, false, TTR("Remove"));
|
||||
ti->add_button(1, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE, false, TTR("Remove"));
|
||||
}
|
||||
|
||||
//player->add_resource("default",resource);
|
||||
|
|
|
@ -149,7 +149,7 @@ void EditorPropertyRootMotion::_node_assign() {
|
|||
ti->set_text(0, F->get());
|
||||
ti->set_selectable(0, true);
|
||||
ti->set_editable(0, false);
|
||||
ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons"));
|
||||
ti->set_icon(0, get_theme_icon(SNAME("BoneAttachment3D"), SNAME("EditorIcons")));
|
||||
ti->set_metadata(0, accum);
|
||||
} else {
|
||||
ti = parenthood[accum];
|
||||
|
@ -158,7 +158,7 @@ void EditorPropertyRootMotion::_node_assign() {
|
|||
|
||||
ti->set_selectable(0, true);
|
||||
ti->set_text(0, concat);
|
||||
ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons"));
|
||||
ti->set_icon(0, get_theme_icon(SNAME("BoneAttachment3D"), SNAME("EditorIcons")));
|
||||
ti->set_metadata(0, path);
|
||||
if (path == current) {
|
||||
ti->select(0);
|
||||
|
@ -234,7 +234,7 @@ void EditorPropertyRootMotion::setup(const NodePath &p_base_hint) {
|
|||
|
||||
void EditorPropertyRootMotion::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Ref<Texture2D> t = get_theme_icon("Clear", "EditorIcons");
|
||||
Ref<Texture2D> t = get_theme_icon(SNAME("Clear"), SNAME("EditorIcons"));
|
||||
clear->set_icon(t);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@ void ScriptEditorQuickOpen::_confirmed() {
|
|||
}
|
||||
int line = ti->get_text(0).get_slice(":", 1).to_int();
|
||||
|
||||
emit_signal("goto_line", line - 1);
|
||||
emit_signal(SNAME("goto_line"), line - 1);
|
||||
hide();
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ void ScriptEditorQuickOpen::_notification(int p_what) {
|
|||
[[fallthrough]];
|
||||
}
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
search_box->set_right_icon(search_options->get_theme_icon("Search", "EditorIcons"));
|
||||
search_box->set_right_icon(search_options->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
disconnect("confirmed", callable_mp(this, &ScriptEditorQuickOpen::_confirmed));
|
||||
|
@ -577,7 +577,7 @@ void ScriptEditor::_go_to_tab(int p_idx) {
|
|||
}
|
||||
if (Object::cast_to<EditorHelp>(c)) {
|
||||
script_name_label->set_text(Object::cast_to<EditorHelp>(c)->get_class());
|
||||
script_icon->set_texture(get_theme_icon("Help", "EditorIcons"));
|
||||
script_icon->set_texture(get_theme_icon(SNAME("Help"), SNAME("EditorIcons")));
|
||||
if (is_visible_in_tree()) {
|
||||
Object::cast_to<EditorHelp>(c)->set_focused();
|
||||
}
|
||||
|
@ -631,7 +631,7 @@ void ScriptEditor::_open_recent_script(int p_idx) {
|
|||
// clear button
|
||||
if (p_idx == recent_scripts->get_item_count() - 1) {
|
||||
EditorSettings::get_singleton()->set_project_metadata("recent_files", "scripts", Array());
|
||||
call_deferred("_update_recent_scripts");
|
||||
call_deferred(SNAME("_update_recent_scripts"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -946,7 +946,7 @@ void ScriptEditor::_res_saved_callback(const Ref<Resource> &p_res) {
|
|||
_update_script_names();
|
||||
|
||||
if (!pending_auto_reload && auto_reload_running_scripts) {
|
||||
call_deferred("_live_auto_reload_running_scripts");
|
||||
call_deferred(SNAME("_live_auto_reload_running_scripts"));
|
||||
pending_auto_reload = true;
|
||||
}
|
||||
}
|
||||
|
@ -997,7 +997,7 @@ bool ScriptEditor::_test_script_times_on_disk(RES p_for_script) {
|
|||
script_editor->_reload_scripts();
|
||||
need_reload = false;
|
||||
} else {
|
||||
disk_changed->call_deferred("popup_centered_ratio", 0.5);
|
||||
disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1155,7 +1155,7 @@ void ScriptEditor::_menu_option(int p_option) {
|
|||
if (ResourceLoader::get_resource_type(res_path) == "PackedScene") {
|
||||
if (!EditorNode::get_singleton()->is_scene_open(res_path)) {
|
||||
EditorNode::get_singleton()->load_scene(res_path);
|
||||
script_editor->call_deferred("_menu_option", p_option);
|
||||
script_editor->call_deferred(SNAME("_menu_option"), p_option);
|
||||
previous_scripts.push_back(path); //repeat the operation
|
||||
return;
|
||||
}
|
||||
|
@ -1486,23 +1486,23 @@ void ScriptEditor::_notification(int p_what) {
|
|||
case NOTIFICATION_TRANSLATION_CHANGED:
|
||||
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
help_search->set_icon(get_theme_icon("HelpSearch", "EditorIcons"));
|
||||
site_search->set_icon(get_theme_icon("Instance", "EditorIcons"));
|
||||
help_search->set_icon(get_theme_icon(SNAME("HelpSearch"), SNAME("EditorIcons")));
|
||||
site_search->set_icon(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
|
||||
if (is_layout_rtl()) {
|
||||
script_forward->set_icon(get_theme_icon("Back", "EditorIcons"));
|
||||
script_back->set_icon(get_theme_icon("Forward", "EditorIcons"));
|
||||
script_forward->set_icon(get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
script_back->set_icon(get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
script_forward->set_icon(get_theme_icon("Forward", "EditorIcons"));
|
||||
script_back->set_icon(get_theme_icon("Back", "EditorIcons"));
|
||||
script_forward->set_icon(get_theme_icon(SNAME("Forward"), SNAME("EditorIcons")));
|
||||
script_back->set_icon(get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
members_overview_alphabeta_sort_button->set_icon(get_theme_icon("Sort", "EditorIcons"));
|
||||
members_overview_alphabeta_sort_button->set_icon(get_theme_icon(SNAME("Sort"), SNAME("EditorIcons")));
|
||||
|
||||
filter_scripts->set_right_icon(get_theme_icon("Search", "EditorIcons"));
|
||||
filter_methods->set_right_icon(get_theme_icon("Search", "EditorIcons"));
|
||||
filter_scripts->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
filter_methods->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
|
||||
filename->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("normal", "LineEdit"));
|
||||
filename->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
|
||||
|
||||
recent_scripts->set_as_minsize();
|
||||
|
||||
|
@ -1576,11 +1576,11 @@ void ScriptEditor::edited_scene_changed() {
|
|||
}
|
||||
|
||||
void ScriptEditor::notify_script_close(const Ref<Script> &p_script) {
|
||||
emit_signal("script_close", p_script);
|
||||
emit_signal(SNAME("script_close"), p_script);
|
||||
}
|
||||
|
||||
void ScriptEditor::notify_script_changed(const Ref<Script> &p_script) {
|
||||
emit_signal("editor_script_changed", p_script);
|
||||
emit_signal(SNAME("editor_script_changed"), p_script);
|
||||
}
|
||||
|
||||
void ScriptEditor::get_breakpoints(List<String> *p_breakpoints) {
|
||||
|
@ -1796,8 +1796,8 @@ void ScriptEditor::_update_script_colors() {
|
|||
bool script_temperature_enabled = EditorSettings::get_singleton()->get("text_editor/script_list/script_temperature_enabled");
|
||||
|
||||
int hist_size = EditorSettings::get_singleton()->get("text_editor/script_list/script_temperature_history_size");
|
||||
Color hot_color = get_theme_color("accent_color", "Editor");
|
||||
Color cold_color = get_theme_color("font_color", "Editor");
|
||||
Color hot_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color cold_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
|
||||
|
||||
for (int i = 0; i < script_list->get_item_count(); i++) {
|
||||
int c = script_list->get_item_metadata(i);
|
||||
|
@ -1946,7 +1946,7 @@ void ScriptEditor::_update_script_names() {
|
|||
EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_child(i));
|
||||
if (eh) {
|
||||
String name = eh->get_class();
|
||||
Ref<Texture2D> icon = get_theme_icon("Help", "EditorIcons");
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("Help"), SNAME("EditorIcons"));
|
||||
String tooltip = vformat(TTR("%s Class Reference"), name);
|
||||
|
||||
_ScriptEditorItemData sd;
|
||||
|
@ -2554,8 +2554,8 @@ void ScriptEditor::_tree_changed() {
|
|||
}
|
||||
|
||||
waiting_update_names = true;
|
||||
call_deferred("_update_script_names");
|
||||
call_deferred("_update_script_connections");
|
||||
call_deferred(SNAME("_update_script_names"));
|
||||
call_deferred(SNAME("_update_script_connections"));
|
||||
}
|
||||
|
||||
void ScriptEditor::_script_split_dragged(float) {
|
||||
|
@ -2581,7 +2581,7 @@ Variant ScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
|
|||
EditorHelp *eh = Object::cast_to<EditorHelp>(cur_node);
|
||||
if (eh) {
|
||||
preview_name = eh->get_class();
|
||||
preview_icon = get_theme_icon("Help", "EditorIcons");
|
||||
preview_icon = get_theme_icon(SNAME("Help"), SNAME("EditorIcons"));
|
||||
}
|
||||
|
||||
if (!preview_icon.is_null()) {
|
||||
|
@ -3362,7 +3362,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
|
|||
filename = memnew(Label);
|
||||
filename->set_clip_text(true);
|
||||
filename->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
filename->add_theme_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("normal", "LineEdit"));
|
||||
filename->add_theme_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
|
||||
buttons_hbox->add_child(filename);
|
||||
|
||||
members_overview_alphabeta_sort_button = memnew(Button);
|
||||
|
@ -3612,8 +3612,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
|
|||
|
||||
ScriptServer::edit_request_func = _open_script_request;
|
||||
|
||||
add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("ScriptEditorPanel", "EditorStyles"));
|
||||
tab_container->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("ScriptEditor", "EditorStyles"));
|
||||
add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("ScriptEditorPanel"), SNAME("EditorStyles")));
|
||||
tab_container->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("ScriptEditor"), SNAME("EditorStyles")));
|
||||
}
|
||||
|
||||
ScriptEditor::~ScriptEditor() {
|
||||
|
|
|
@ -66,7 +66,7 @@ void ConnectionInfoDialog::popup_connections(String p_method, Vector<Node *> p_n
|
|||
|
||||
node_item->set_text(1, connection.signal.get_name());
|
||||
Control *p = Object::cast_to<Control>(get_parent());
|
||||
node_item->set_icon(1, p->get_theme_icon("Slot", "EditorIcons"));
|
||||
node_item->set_icon(1, p->get_theme_icon(SNAME("Slot"), SNAME("EditorIcons")));
|
||||
node_item->set_selectable(1, false);
|
||||
node_item->set_editable(1, false);
|
||||
|
||||
|
@ -147,7 +147,7 @@ void ScriptTextEditor::set_edited_resource(const RES &p_res) {
|
|||
code_editor->get_text_editor()->clear_undo_history();
|
||||
code_editor->get_text_editor()->tag_saved_version();
|
||||
|
||||
emit_signal("name_changed");
|
||||
emit_signal(SNAME("name_changed"));
|
||||
code_editor->update_line_and_column();
|
||||
}
|
||||
|
||||
|
@ -440,7 +440,7 @@ void ScriptTextEditor::_validate_script() {
|
|||
String target_path = base == connection.callable.get_object() ? base_path : base_path + "/" + base->get_path_to(Object::cast_to<Node>(connection.callable.get_object()));
|
||||
|
||||
warnings_panel->push_cell();
|
||||
warnings_panel->push_color(warnings_panel->get_theme_color("warning_color", "Editor"));
|
||||
warnings_panel->push_color(warnings_panel->get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
warnings_panel->add_text(vformat(TTR("Missing connected method '%s' for signal '%s' from node '%s' to node '%s'."), connection.callable.get_method(), connection.signal.get_name(), source_path, target_path));
|
||||
warnings_panel->pop(); // Color.
|
||||
warnings_panel->pop(); // Cell.
|
||||
|
@ -465,7 +465,7 @@ void ScriptTextEditor::_validate_script() {
|
|||
warnings_panel->push_cell();
|
||||
warnings_panel->push_meta(ignore_meta);
|
||||
warnings_panel->push_color(
|
||||
warnings_panel->get_theme_color("accent_color", "Editor").lerp(warnings_panel->get_theme_color("mono_color", "Editor"), 0.5));
|
||||
warnings_panel->get_theme_color(SNAME("accent_color"), SNAME("Editor")).lerp(warnings_panel->get_theme_color(SNAME("mono_color"), SNAME("Editor")), 0.5));
|
||||
warnings_panel->add_text(TTR("[Ignore]"));
|
||||
warnings_panel->pop(); // Color.
|
||||
warnings_panel->pop(); // Meta ignore.
|
||||
|
@ -473,7 +473,7 @@ void ScriptTextEditor::_validate_script() {
|
|||
|
||||
warnings_panel->push_cell();
|
||||
warnings_panel->push_meta(w.start_line - 1);
|
||||
warnings_panel->push_color(warnings_panel->get_theme_color("warning_color", "Editor"));
|
||||
warnings_panel->push_color(warnings_panel->get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
warnings_panel->add_text(TTR("Line") + " " + itos(w.start_line));
|
||||
warnings_panel->add_text(" (" + w.string_code + "):");
|
||||
warnings_panel->pop(); // Color.
|
||||
|
@ -493,7 +493,7 @@ void ScriptTextEditor::_validate_script() {
|
|||
|
||||
errors_panel->push_cell();
|
||||
errors_panel->push_meta(err.line - 1);
|
||||
errors_panel->push_color(warnings_panel->get_theme_color("error_color", "Editor"));
|
||||
errors_panel->push_color(warnings_panel->get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
errors_panel->add_text(TTR("Line") + " " + itos(err.line) + ":");
|
||||
errors_panel->pop(); // Color.
|
||||
errors_panel->pop(); // Meta goto.
|
||||
|
@ -535,8 +535,8 @@ void ScriptTextEditor::_validate_script() {
|
|||
}
|
||||
}
|
||||
|
||||
emit_signal("name_changed");
|
||||
emit_signal("edited_script_changed");
|
||||
emit_signal(SNAME("name_changed"));
|
||||
emit_signal(SNAME("edited_script_changed"));
|
||||
}
|
||||
|
||||
void ScriptTextEditor::_update_bookmark_list() {
|
||||
|
@ -725,7 +725,7 @@ void ScriptTextEditor::_breakpoint_item_pressed(int p_idx) {
|
|||
_edit_option(breakpoints_menu->get_item_id(p_idx));
|
||||
} else {
|
||||
code_editor->goto_line(breakpoints_menu->get_item_metadata(p_idx));
|
||||
code_editor->get_text_editor()->call_deferred("center_viewport_to_cursor"); //Need to be deferred, because goto uses call_deferred().
|
||||
code_editor->get_text_editor()->call_deferred(SNAME("center_viewport_to_cursor")); //Need to be deferred, because goto uses call_deferred().
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -760,14 +760,14 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c
|
|||
switch (result.type) {
|
||||
case ScriptLanguage::LookupResult::RESULT_SCRIPT_LOCATION: {
|
||||
if (result.script.is_valid()) {
|
||||
emit_signal("request_open_script_at_line", result.script, result.location - 1);
|
||||
emit_signal(SNAME("request_open_script_at_line"), result.script, result.location - 1);
|
||||
} else {
|
||||
emit_signal("request_save_history");
|
||||
emit_signal(SNAME("request_save_history"));
|
||||
goto_line_centered(result.location - 1);
|
||||
}
|
||||
} break;
|
||||
case ScriptLanguage::LookupResult::RESULT_CLASS: {
|
||||
emit_signal("go_to_help", "class_name:" + result.class_name);
|
||||
emit_signal(SNAME("go_to_help"), "class_name:" + result.class_name);
|
||||
} break;
|
||||
case ScriptLanguage::LookupResult::RESULT_CLASS_CONSTANT: {
|
||||
StringName cname = result.class_name;
|
||||
|
@ -782,11 +782,11 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c
|
|||
}
|
||||
}
|
||||
|
||||
emit_signal("go_to_help", "class_constant:" + result.class_name + ":" + result.class_member);
|
||||
emit_signal(SNAME("go_to_help"), "class_constant:" + result.class_name + ":" + result.class_member);
|
||||
|
||||
} break;
|
||||
case ScriptLanguage::LookupResult::RESULT_CLASS_PROPERTY: {
|
||||
emit_signal("go_to_help", "class_property:" + result.class_name + ":" + result.class_member);
|
||||
emit_signal(SNAME("go_to_help"), "class_property:" + result.class_name + ":" + result.class_member);
|
||||
|
||||
} break;
|
||||
case ScriptLanguage::LookupResult::RESULT_CLASS_METHOD: {
|
||||
|
@ -801,7 +801,7 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c
|
|||
}
|
||||
}
|
||||
|
||||
emit_signal("go_to_help", "class_method:" + result.class_name + ":" + result.class_member);
|
||||
emit_signal(SNAME("go_to_help"), "class_method:" + result.class_name + ":" + result.class_member);
|
||||
|
||||
} break;
|
||||
case ScriptLanguage::LookupResult::RESULT_CLASS_ENUM: {
|
||||
|
@ -817,11 +817,11 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c
|
|||
}
|
||||
}
|
||||
|
||||
emit_signal("go_to_help", "class_enum:" + result.class_name + ":" + result.class_member);
|
||||
emit_signal(SNAME("go_to_help"), "class_enum:" + result.class_name + ":" + result.class_member);
|
||||
|
||||
} break;
|
||||
case ScriptLanguage::LookupResult::RESULT_CLASS_TBD_GLOBALSCOPE: {
|
||||
emit_signal("go_to_help", "class_global:" + result.class_name + ":" + result.class_member);
|
||||
emit_signal(SNAME("go_to_help"), "class_global:" + result.class_name + ":" + result.class_member);
|
||||
} break;
|
||||
}
|
||||
} else if (ProjectSettings::get_singleton()->has_autoload(p_symbol)) {
|
||||
|
@ -934,7 +934,7 @@ void ScriptTextEditor::_update_connected_methods() {
|
|||
if (name == connection.callable.get_method()) {
|
||||
line = functions[j].get_slice(":", 1).to_int() - 1;
|
||||
text_edit->set_line_gutter_metadata(line, connection_gutter, connection.callable.get_method());
|
||||
text_edit->set_line_gutter_icon(line, connection_gutter, get_parent_control()->get_theme_icon("Slot", "EditorIcons"));
|
||||
text_edit->set_line_gutter_icon(line, connection_gutter, get_parent_control()->get_theme_icon(SNAME("Slot"), SNAME("EditorIcons")));
|
||||
text_edit->set_line_gutter_clickable(line, connection_gutter, true);
|
||||
methods_found.insert(connection.callable.get_method());
|
||||
break;
|
||||
|
@ -1004,27 +1004,27 @@ void ScriptTextEditor::_edit_option(int p_op) {
|
|||
switch (p_op) {
|
||||
case EDIT_UNDO: {
|
||||
tx->undo();
|
||||
tx->call_deferred("grab_focus");
|
||||
tx->call_deferred(SNAME("grab_focus"));
|
||||
} break;
|
||||
case EDIT_REDO: {
|
||||
tx->redo();
|
||||
tx->call_deferred("grab_focus");
|
||||
tx->call_deferred(SNAME("grab_focus"));
|
||||
} break;
|
||||
case EDIT_CUT: {
|
||||
tx->cut();
|
||||
tx->call_deferred("grab_focus");
|
||||
tx->call_deferred(SNAME("grab_focus"));
|
||||
} break;
|
||||
case EDIT_COPY: {
|
||||
tx->copy();
|
||||
tx->call_deferred("grab_focus");
|
||||
tx->call_deferred(SNAME("grab_focus"));
|
||||
} break;
|
||||
case EDIT_PASTE: {
|
||||
tx->paste();
|
||||
tx->call_deferred("grab_focus");
|
||||
tx->call_deferred(SNAME("grab_focus"));
|
||||
} break;
|
||||
case EDIT_SELECT_ALL: {
|
||||
tx->select_all();
|
||||
tx->call_deferred("grab_focus");
|
||||
tx->call_deferred(SNAME("grab_focus"));
|
||||
} break;
|
||||
case EDIT_MOVE_LINE_UP: {
|
||||
code_editor->move_lines_up();
|
||||
|
@ -1163,12 +1163,12 @@ void ScriptTextEditor::_edit_option(int p_op) {
|
|||
|
||||
// Yep, because it doesn't make sense to instance this dialog for every single script open...
|
||||
// So this will be delegated to the ScriptEditor.
|
||||
emit_signal("search_in_files_requested", selected_text);
|
||||
emit_signal(SNAME("search_in_files_requested"), selected_text);
|
||||
} break;
|
||||
case REPLACE_IN_FILES: {
|
||||
String selected_text = code_editor->get_text_editor()->get_selection_text();
|
||||
|
||||
emit_signal("replace_in_files_requested", selected_text);
|
||||
emit_signal(SNAME("replace_in_files_requested"), selected_text);
|
||||
} break;
|
||||
case SEARCH_LOCATE_FUNCTION: {
|
||||
quick_open->popup_dialog(get_functions());
|
||||
|
@ -1262,7 +1262,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
|
|||
text = tx->get_word_under_cursor();
|
||||
}
|
||||
if (text != "") {
|
||||
emit_signal("request_help", text);
|
||||
emit_signal(SNAME("request_help"), text);
|
||||
}
|
||||
} break;
|
||||
case LOOKUP_SYMBOL: {
|
||||
|
@ -1686,16 +1686,16 @@ void ScriptTextEditor::_enable_code_editor() {
|
|||
|
||||
editor_box->add_child(warnings_panel);
|
||||
warnings_panel->add_theme_font_override(
|
||||
"normal_font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("main", "EditorFonts"));
|
||||
"normal_font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("main"), SNAME("EditorFonts")));
|
||||
warnings_panel->add_theme_font_size_override(
|
||||
"normal_font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size("main_size", "EditorFonts"));
|
||||
"normal_font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("main_size"), SNAME("EditorFonts")));
|
||||
warnings_panel->connect("meta_clicked", callable_mp(this, &ScriptTextEditor::_warning_clicked));
|
||||
|
||||
editor_box->add_child(errors_panel);
|
||||
errors_panel->add_theme_font_override(
|
||||
"normal_font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("main", "EditorFonts"));
|
||||
"normal_font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("main"), SNAME("EditorFonts")));
|
||||
errors_panel->add_theme_font_size_override(
|
||||
"normal_font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size("main_size", "EditorFonts"));
|
||||
"normal_font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("main_size"), SNAME("EditorFonts")));
|
||||
errors_panel->connect("meta_clicked", callable_mp(this, &ScriptTextEditor::_error_clicked));
|
||||
|
||||
add_child(context_menu);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue