You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add EditorStringNames singleton
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "editor/create_dialog.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/gui/editor_validation_panel.h"
|
||||
#include "scene/2d/node_2d.h"
|
||||
#include "scene/3d/node_3d.h"
|
||||
@@ -48,11 +49,11 @@ void SceneCreateDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
select_node_button->set_icon(get_theme_icon(SNAME("ClassList"), SNAME("EditorIcons")));
|
||||
node_type_2d->set_icon(get_theme_icon(SNAME("Node2D"), SNAME("EditorIcons")));
|
||||
node_type_3d->set_icon(get_theme_icon(SNAME("Node3D"), SNAME("EditorIcons")));
|
||||
node_type_gui->set_icon(get_theme_icon(SNAME("Control"), SNAME("EditorIcons")));
|
||||
node_type_other->add_theme_icon_override(SNAME("icon"), get_theme_icon(SNAME("Node"), SNAME("EditorIcons")));
|
||||
select_node_button->set_icon(get_editor_theme_icon(SNAME("ClassList")));
|
||||
node_type_2d->set_icon(get_editor_theme_icon(SNAME("Node2D")));
|
||||
node_type_3d->set_icon(get_editor_theme_icon(SNAME("Node3D")));
|
||||
node_type_gui->set_icon(get_editor_theme_icon(SNAME("Control")));
|
||||
node_type_other->add_theme_icon_override(SNAME("icon"), get_editor_theme_icon(SNAME("Node")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
@@ -114,8 +115,8 @@ void SceneCreateDialog::update_dialog() {
|
||||
}
|
||||
|
||||
const StringName root_type_name = StringName(other_type_display->get_text());
|
||||
if (has_theme_icon(root_type_name, SNAME("EditorIcons"))) {
|
||||
node_type_other->set_icon(get_theme_icon(root_type_name, SNAME("EditorIcons")));
|
||||
if (has_theme_icon(root_type_name, EditorStringName(EditorIcons))) {
|
||||
node_type_other->set_icon(get_editor_theme_icon(root_type_name));
|
||||
} else {
|
||||
node_type_other->set_icon(nullptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user