summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_file_dialog.cpp2
-rw-r--r--editor/editor_inspector.cpp7
-rw-r--r--editor/editor_node.cpp8
-rw-r--r--editor/editor_profiler.cpp2
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp12
-rw-r--r--editor/inspector_dock.cpp15
-rw-r--r--editor/inspector_dock.h1
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--editor/plugins/script_editor_plugin.cpp2
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp2
-rw-r--r--editor/project_export.cpp6
-rw-r--r--editor/scene_tree_dock.cpp2
-rw-r--r--editor/spatial_editor_gizmos.cpp25
13 files changed, 49 insertions, 37 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 38bdba31ea..f425d0a995 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -501,7 +501,7 @@ void EditorFileDialog::_items_clear_selection() {
case MODE_OPEN_FILE:
case MODE_OPEN_FILES:
get_ok()->set_text(TTR("Open"));
- get_ok()->set_disabled(item_list->is_anything_selected() == false);
+ get_ok()->set_disabled(!item_list->is_anything_selected());
break;
case MODE_OPEN_DIR:
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index c6258c8493..a90f15004a 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -2139,6 +2139,13 @@ void EditorInspector::_notification(int p_what) {
}
if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+
+ if (use_sub_inspector_bg) {
+ add_style_override("bg", get_stylebox("sub_inspector_bg", "Editor"));
+ } else if (is_inside_tree()) {
+ add_style_override("bg", get_stylebox("bg", "Tree"));
+ }
+
update_tree();
}
}
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 790e38afca..18dd85617b 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -227,12 +227,6 @@ void EditorNode::_unhandled_input(const Ref<InputEvent> &p_event) {
_editor_select_prev();
}
- if (k->get_scancode() == KEY_ESCAPE) {
- for (int i = 0; i < bottom_panel_items.size(); i++) {
- _bottom_panel_switch(false, i);
- }
- }
-
if (old_editor != editor_plugin_screen) {
get_tree()->set_input_as_handled();
}
@@ -3889,7 +3883,7 @@ void EditorNode::_scene_tab_closed(int p_tab) {
}
void EditorNode::_scene_tab_hover(int p_tab) {
- if (bool(EDITOR_GET("interface/scene_tabs/show_thumbnail_on_hover")) == false) {
+ if (!bool(EDITOR_GET("interface/scene_tabs/show_thumbnail_on_hover"))) {
return;
}
int current_tab = scene_tabs->get_current_tab();
diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp
index b57e3826c6..d3978749c0 100644
--- a/editor/editor_profiler.cpp
+++ b/editor/editor_profiler.cpp
@@ -257,7 +257,7 @@ void EditorProfiler::_update_plot() {
//get
const Metric &m = frame_metrics[idx];
- if (m.valid == false)
+ if (!m.valid)
continue; //skip because invalid
float value = 0;
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index a6b754de3b..cb15be35f2 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -1793,22 +1793,22 @@ template <>
struct EditorSceneImporterGLTFInterpolate<Quat> {
Quat lerp(const Quat &a, const Quat &b, float c) const {
- ERR_FAIL_COND_V(a.is_normalized() == false, Quat());
- ERR_FAIL_COND_V(b.is_normalized() == false, Quat());
+ ERR_FAIL_COND_V(!a.is_normalized(), Quat());
+ ERR_FAIL_COND_V(!b.is_normalized(), Quat());
return a.slerp(b, c).normalized();
}
Quat catmull_rom(const Quat &p0, const Quat &p1, const Quat &p2, const Quat &p3, float c) {
- ERR_FAIL_COND_V(p1.is_normalized() == false, Quat());
- ERR_FAIL_COND_V(p2.is_normalized() == false, Quat());
+ ERR_FAIL_COND_V(!p1.is_normalized(), Quat());
+ ERR_FAIL_COND_V(!p2.is_normalized(), Quat());
return p1.slerp(p2, c).normalized();
}
Quat bezier(Quat start, Quat control_1, Quat control_2, Quat end, float t) {
- ERR_FAIL_COND_V(start.is_normalized() == false, Quat());
- ERR_FAIL_COND_V(end.is_normalized() == false, Quat());
+ ERR_FAIL_COND_V(!start.is_normalized(), Quat());
+ ERR_FAIL_COND_V(!end.is_normalized(), Quat());
return start.slerp(end, t).normalized();
}
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index 4f4980d83c..750fca2852 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -328,6 +328,21 @@ Container *InspectorDock::get_addon_area() {
return this;
}
+void InspectorDock::_notification(int p_what) {
+ switch (p_what) {
+ case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+ set_theme(editor->get_gui_base()->get_theme());
+ resource_new_button->set_icon(get_icon("New", "EditorIcons"));
+ resource_load_button->set_icon(get_icon("Load", "EditorIcons"));
+ backward_button->set_icon(get_icon("Back", "EditorIcons"));
+ forward_button->set_icon(get_icon("Forward", "EditorIcons"));
+ history_menu->set_icon(get_icon("History", "EditorIcons"));
+ object_menu->set_icon(get_icon("Tools", "EditorIcons"));
+ warning->set_icon(get_icon("NodeWarning", "EditorIcons"));
+ } break;
+ }
+}
+
void InspectorDock::_bind_methods() {
ClassDB::bind_method("_menu_option", &InspectorDock::_menu_option);
diff --git a/editor/inspector_dock.h b/editor/inspector_dock.h
index 97ef6899dc..57d2a03295 100644
--- a/editor/inspector_dock.h
+++ b/editor/inspector_dock.h
@@ -118,6 +118,7 @@ class InspectorDock : public VBoxContainer {
protected:
static void _bind_methods();
+ void _notification(int p_what);
public:
void go_back();
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index e8f00ce0ba..a9bc5e77ac 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5113,7 +5113,7 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian
type == "AtlasTexture" ||
type == "LargeTexture") {
Ref<Texture> texture = Ref<Texture>(Object::cast_to<Texture>(*res));
- if (texture.is_valid() == false) {
+ if (!texture.is_valid()) {
continue;
}
} else {
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 7cda15bdc6..d26e1a39f6 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1960,7 +1960,7 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra
// doesn't have it, make a new one
- ScriptEditorBase *se;
+ ScriptEditorBase *se = NULL;
for (int i = script_editor_func_count - 1; i >= 0; i--) {
se = script_editor_funcs[i](p_resource);
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index f627788171..f57614b3b3 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -2124,7 +2124,7 @@ void SpatialEditorViewport::_notification(int p_what) {
_update_freelook(delta);
Node *scene_root = editor->get_scene_tree_dock()->get_editor_data()->get_edited_scene_root();
- if (previewing_cinema == true && scene_root != NULL) {
+ if (previewing_cinema && scene_root != NULL) {
Camera *cam = scene_root->get_viewport()->get_camera();
if (cam != NULL && cam != previewing) {
//then switch the viewport's camera to the scene's viewport camera
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index fa6dce1771..3ec49e187f 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -638,10 +638,10 @@ bool ProjectExportDialog::_fill_tree(EditorFileSystemDirectory *p_dir, TreeItem
for (int i = 0; i < p_dir->get_subdir_count(); i++) {
TreeItem *subdir = include_files->create_item(p_item);
- if (_fill_tree(p_dir->get_subdir(i), subdir, current, p_only_scenes) == false) {
- memdelete(subdir);
- } else {
+ if (_fill_tree(p_dir->get_subdir(i), subdir, current, p_only_scenes)) {
used = true;
+ } else {
+ memdelete(subdir);
}
}
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 08f1ece2d4..a6a014f3bd 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -797,7 +797,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
case TOOL_CREATE_USER_INTERFACE:
case TOOL_CREATE_FAVORITE: {
- Node *new_node;
+ Node *new_node = NULL;
if (TOOL_CREATE_FAVORITE == p_tool) {
String name = selected_favorite_root.get_slicec(' ', 0);
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index 96bca86f83..a321cb16c5 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -4201,21 +4201,16 @@ void JointSpatialGizmoPlugin::CreateGeneric6DOFJointGizmo(
float cs = 0.25;
for (int ax = 0; ax < 3; ax++) {
- /*r_points.push_back(p_offset.translated(Vector3(+cs,0,0)).origin);
- r_points.push_back(p_offset.translated(Vector3(-cs,0,0)).origin);
- r_points.push_back(p_offset.translated(Vector3(0,+cs,0)).origin);
- r_points.push_back(p_offset.translated(Vector3(0,-cs,0)).origin);
- r_points.push_back(p_offset.translated(Vector3(0,0,+cs*2)).origin);
- r_points.push_back(p_offset.translated(Vector3(0,0,-cs*2)).origin); */
-
- float ll;
- float ul;
- float lll;
- float lul;
-
- int a1, a2, a3;
- bool enable_ang;
- bool enable_lin;
+ float ll = 0;
+ float ul = 0;
+ float lll = 0;
+ float lul = 0;
+
+ int a1 = 0;
+ int a2 = 0;
+ int a3 = 0;
+ bool enable_ang = false;
+ bool enable_lin = false;
switch (ax) {
case 0: