summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/audio_stream_preview.cpp4
-rw-r--r--editor/create_dialog.cpp2
-rw-r--r--editor/doc/doc_dump.cpp2
-rw-r--r--editor/editor_export.cpp1
-rw-r--r--editor/editor_themes.cpp5
-rw-r--r--editor/filesystem_dock.cpp2
-rw-r--r--editor/plugins/animation_blend_space_2d_editor.cpp4
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h4
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp93
-rw-r--r--editor/plugins/tile_map_editor_plugin.h2
-rw-r--r--editor/scene_tree_dock.cpp2
11 files changed, 65 insertions, 56 deletions
diff --git a/editor/audio_stream_preview.cpp b/editor/audio_stream_preview.cpp
index c5759ac076..5a94d41aba 100644
--- a/editor/audio_stream_preview.cpp
+++ b/editor/audio_stream_preview.cpp
@@ -50,7 +50,7 @@ float AudioStreamPreview::get_max(float p_time, float p_time_next) const {
time_to = time_from + 1;
}
- uint8_t vmax;
+ uint8_t vmax = 0;
for (int i = time_from; i < time_to; i++) {
@@ -77,7 +77,7 @@ float AudioStreamPreview::get_min(float p_time, float p_time_next) const {
time_to = time_from + 1;
}
- uint8_t vmin;
+ uint8_t vmin = 0;
for (int i = time_from; i < time_to; i++) {
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index eb11aea9cc..c4516c1f17 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -558,6 +558,7 @@ void CreateDialog::_history_selected() {
return;
search_box->set_text(item->get_text(0).get_slicec(' ', 0));
+ favorites->deselect_all();
_update_search();
}
@@ -568,6 +569,7 @@ void CreateDialog::_favorite_selected() {
return;
search_box->set_text(item->get_text(0).get_slicec(' ', 0));
+ recent->deselect_all();
_update_search();
}
diff --git a/editor/doc/doc_dump.cpp b/editor/doc/doc_dump.cpp
index 86fd9b436b..f1c337605e 100644
--- a/editor/doc/doc_dump.cpp
+++ b/editor/doc/doc_dump.cpp
@@ -223,7 +223,7 @@ void DocDump::dump(const String &p_file) {
hint = "Values: ";
for (int j = 0; j < arginfo.hint_string.get_slice_count(","); j++) {
if (j > 0) hint += ", ";
- hint += arginfo.hint_string.get_slice(",", j) + "=" + itos(1 << j);
+ hint += arginfo.hint_string.get_slice(",", j) + "=" + itos((uint64_t)1 << j);
}
break;
case PROPERTY_HINT_FILE: hint = "A file:"; break;
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 455c889224..1a6188862f 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -1097,6 +1097,7 @@ Ref<EditorExportPreset> EditorExport::get_export_preset(int p_idx) {
void EditorExport::remove_export_preset(int p_idx) {
export_presets.remove(p_idx);
+ save_presets();
}
void EditorExport::add_export_plugin(const Ref<EditorExportPlugin> &p_plugin) {
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 9e81051dc2..768a8fc066 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -251,7 +251,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
Color preset_accent_color;
Color preset_base_color;
- float preset_contrast;
+ float preset_contrast = 0;
// Please, use alphabet order if you've added new theme here(After "Default" and "Custom")
@@ -376,7 +376,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
//Register icons + font
// the resolution and the icon color (dark_theme bool) has not changed, so we do not regenerate the icons
- if (p_theme != NULL && fabs(p_theme->get_constant("scale", "Editor") - EDSCALE) < 0.00001 && p_theme->get_constant("dark_theme", "Editor") == dark_theme) {
+ if (p_theme != NULL && fabs(p_theme->get_constant("scale", "Editor") - EDSCALE) < 0.00001 && (bool)p_theme->get_constant("dark_theme", "Editor") == dark_theme) {
// register already generated icons
for (int i = 0; i < editor_icons_count; i++) {
theme->set_icon(editor_icons_names[i], "EditorIcons", p_theme->get_icon(editor_icons_names[i], "EditorIcons"));
@@ -1016,6 +1016,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_constant("port_offset", "GraphNode", 14 * EDSCALE);
theme->set_constant("title_h_offset", "GraphNode", -16 * EDSCALE);
+ theme->set_constant("title_offset", "GraphNode", 20 * EDSCALE);
theme->set_constant("close_h_offset", "GraphNode", 20 * EDSCALE);
theme->set_constant("close_offset", "GraphNode", 20 * EDSCALE);
theme->set_constant("separation", "GraphNode", 1 * EDSCALE);
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 2c69909f23..4d386c1af6 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -1953,7 +1953,7 @@ void FileSystemDock::_get_drag_target_folder(String &target, bool &target_favori
}
String ltarget = files->get_item_metadata(pos);
- target = ltarget.ends_with("/") ? ltarget : path;
+ target = ltarget.ends_with("/") ? ltarget : path.get_base_dir();
return;
}
diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp
index c4f8cdc3d7..394b888d0e 100644
--- a/editor/plugins/animation_blend_space_2d_editor.cpp
+++ b/editor/plugins/animation_blend_space_2d_editor.cpp
@@ -434,7 +434,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_draw() {
if (blend_space->get_snap().x > 0) {
- int prev_idx;
+ int prev_idx = 0;
for (int i = 0; i < s.x; i++) {
float v = blend_space->get_min_space().x + i * (blend_space->get_max_space().x - blend_space->get_min_space().x) / s.x;
@@ -450,7 +450,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_draw() {
if (blend_space->get_snap().y > 0) {
- int prev_idx;
+ int prev_idx = 0;
for (int i = 0; i < s.y; i++) {
float v = blend_space->get_max_space().y - i * (blend_space->get_max_space().y - blend_space->get_min_space().y) / s.y;
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index 6a788692d7..4f8cc6ab5e 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -280,6 +280,10 @@ private:
Transform2D xform;
float length;
uint64_t last_pass;
+
+ BoneList() :
+ length(0.f),
+ last_pass(0) {}
};
uint64_t bone_last_frame;
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index aa4338d775..27c3ff960b 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -43,8 +43,8 @@ void TileMapEditor::_notification(int p_what) {
case NOTIFICATION_PROCESS: {
- if (bucket_queue.size() && canvas_item_editor) {
- canvas_item_editor->update();
+ if (bucket_queue.size() && canvas_item_editor_viewport) {
+ canvas_item_editor_viewport->update();
}
} break;
@@ -97,27 +97,27 @@ void TileMapEditor::_menu_option(int p_option) {
// immediately without pressing the left mouse button first
tool = TOOL_NONE;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
} break;
case OPTION_BUCKET: {
tool = TOOL_BUCKET;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
} break;
case OPTION_PICK_TILE: {
tool = TOOL_PICKING;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
} break;
case OPTION_SELECT: {
tool = TOOL_SELECTING;
selection_active = false;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
} break;
case OPTION_COPY: {
@@ -126,7 +126,7 @@ void TileMapEditor::_menu_option(int p_option) {
if (selection_active) {
tool = TOOL_PASTING;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
}
} break;
case OPTION_ERASE_SELECTION: {
@@ -141,7 +141,7 @@ void TileMapEditor::_menu_option(int p_option) {
selection_active = false;
copydata.clear();
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
} break;
case OPTION_FIX_INVALID: {
@@ -165,7 +165,7 @@ void TileMapEditor::_menu_option(int p_option) {
tool = TOOL_PASTING;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
}
} break;
}
@@ -182,13 +182,13 @@ void TileMapEditor::_palette_multi_selected(int index, bool selected) {
void TileMapEditor::_canvas_mouse_enter() {
mouse_over = true;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
}
void TileMapEditor::_canvas_mouse_exit() {
mouse_over = false;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
}
Vector<int> TileMapEditor::get_selected_tiles() const {
@@ -318,7 +318,7 @@ void TileMapEditor::_manual_toggled(bool p_enabled) {
void TileMapEditor::_text_entered(const String &p_text) {
- canvas_item_editor->grab_focus();
+ canvas_item_editor_viewport->grab_focus();
}
void TileMapEditor::_text_changed(const String &p_text) {
@@ -524,7 +524,7 @@ void TileMapEditor::_pick_tile(const Point2 &p_pos) {
transp->set_pressed(node->is_cell_transposed(p_pos.x, p_pos.y));
_update_transform_buttons();
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
}
PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool erase, bool preview) {
@@ -671,7 +671,7 @@ void TileMapEditor::_select(const Point2i &p_from, const Point2i &p_to) {
rectangle.position = begin;
rectangle.size = end - begin;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
}
void TileMapEditor::_erase_selection() {
@@ -978,7 +978,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
paint_undo.clear();
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
}
} else if (tool == TOOL_RECTANGLE_PAINT) {
@@ -995,7 +995,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
}
_finish_undo();
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
}
} else if (tool == TOOL_PASTING) {
@@ -1011,12 +1011,12 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
}
_finish_undo();
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true; // We want to keep the Pasting tool
} else if (tool == TOOL_SELECTING) {
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
} else if (tool == TOOL_BUCKET) {
@@ -1055,7 +1055,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
tool = TOOL_NONE;
selection_active = false;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true;
}
@@ -1065,7 +1065,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
tool = TOOL_NONE;
copydata.clear();
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true;
}
@@ -1106,7 +1106,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
_finish_undo();
if (tool == TOOL_RECTANGLE_ERASE || tool == TOOL_LINE_ERASE) {
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
}
tool = TOOL_NONE;
@@ -1149,7 +1149,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (new_over_tile != over_tile) {
over_tile = new_over_tile;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
}
if (show_tile_info) {
@@ -1235,7 +1235,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
_set_cell(points[i], invalid_cell);
}
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
}
return true;
@@ -1294,7 +1294,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
tool = TOOL_NONE;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true;
}
@@ -1308,13 +1308,13 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
// NOTE: We do not set tool = TOOL_PAINTING as this begins painting
// immediately without pressing the left mouse button first
tool = TOOL_NONE;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true;
}
if (ED_IS_SHORTCUT("tile_map_editor/bucket_fill", p_event)) {
tool = TOOL_BUCKET;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true;
}
@@ -1327,7 +1327,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
tool = TOOL_SELECTING;
selection_active = false;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true;
}
@@ -1337,7 +1337,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (selection_active) {
tool = TOOL_PASTING;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true;
}
@@ -1354,7 +1354,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
tool = TOOL_PASTING;
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true;
}
}
@@ -1368,21 +1368,21 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
flip_h = !flip_h;
mirror_x->set_pressed(flip_h);
_update_transform_buttons();
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true;
}
if (ED_IS_SHORTCUT("tile_map_editor/mirror_y", p_event)) {
flip_v = !flip_v;
mirror_y->set_pressed(flip_v);
_update_transform_buttons();
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true;
}
if (ED_IS_SHORTCUT("tile_map_editor/transpose", p_event)) {
transpose = !transpose;
transp->set_pressed(transpose);
_update_transform_buttons();
- canvas_item_editor->update();
+ canvas_item_editor_viewport->update();
return true;
}
}
@@ -1396,8 +1396,7 @@ void TileMapEditor::forward_canvas_draw_over_viewport(Control *p_overlay) {
return;
Transform2D cell_xf = node->get_cell_transform();
-
- Transform2D xform = p_overlay->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform();
Transform2D xform_inv = xform.affine_inverse();
Size2 screen_size = p_overlay->get_size();
@@ -1608,8 +1607,8 @@ void TileMapEditor::edit(Node *p_tile_map) {
search_box->set_text("");
- if (!canvas_item_editor) {
- canvas_item_editor = CanvasItemEditor::get_singleton()->get_viewport_control();
+ if (!canvas_item_editor_viewport) {
+ canvas_item_editor_viewport = CanvasItemEditor::get_singleton()->get_viewport_control();
}
if (node)
@@ -1617,20 +1616,20 @@ void TileMapEditor::edit(Node *p_tile_map) {
if (p_tile_map) {
node = Object::cast_to<TileMap>(p_tile_map);
- if (!canvas_item_editor->is_connected("mouse_entered", this, "_canvas_mouse_enter"))
- canvas_item_editor->connect("mouse_entered", this, "_canvas_mouse_enter");
- if (!canvas_item_editor->is_connected("mouse_exited", this, "_canvas_mouse_exit"))
- canvas_item_editor->connect("mouse_exited", this, "_canvas_mouse_exit");
+ if (!canvas_item_editor_viewport->is_connected("mouse_entered", this, "_canvas_mouse_enter"))
+ canvas_item_editor_viewport->connect("mouse_entered", this, "_canvas_mouse_enter");
+ if (!canvas_item_editor_viewport->is_connected("mouse_exited", this, "_canvas_mouse_exit"))
+ canvas_item_editor_viewport->connect("mouse_exited", this, "_canvas_mouse_exit");
_update_palette();
} else {
node = NULL;
- if (canvas_item_editor->is_connected("mouse_entered", this, "_canvas_mouse_enter"))
- canvas_item_editor->disconnect("mouse_entered", this, "_canvas_mouse_enter");
- if (canvas_item_editor->is_connected("mouse_exited", this, "_canvas_mouse_exit"))
- canvas_item_editor->disconnect("mouse_exited", this, "_canvas_mouse_exit");
+ if (canvas_item_editor_viewport->is_connected("mouse_entered", this, "_canvas_mouse_enter"))
+ canvas_item_editor_viewport->disconnect("mouse_entered", this, "_canvas_mouse_enter");
+ if (canvas_item_editor_viewport->is_connected("mouse_exited", this, "_canvas_mouse_exit"))
+ canvas_item_editor_viewport->disconnect("mouse_exited", this, "_canvas_mouse_exit");
_update_palette();
}
@@ -1645,8 +1644,8 @@ void TileMapEditor::_tileset_settings_changed() {
_update_palette();
- if (canvas_item_editor)
- canvas_item_editor->update();
+ if (canvas_item_editor_viewport)
+ canvas_item_editor_viewport->update();
}
void TileMapEditor::_icon_size_changed(float p_value) {
@@ -1730,7 +1729,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
node = NULL;
manual_autotile = false;
manual_position = Vector2(0, 0);
- canvas_item_editor = NULL;
+ canvas_item_editor_viewport = NULL;
editor = p_editor;
undo_redo = editor->get_undo_redo();
diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h
index 74aece6f47..3d44647a1b 100644
--- a/editor/plugins/tile_map_editor_plugin.h
+++ b/editor/plugins/tile_map_editor_plugin.h
@@ -82,7 +82,7 @@ class TileMapEditor : public VBoxContainer {
EditorNode *editor;
UndoRedo *undo_redo;
- Control *canvas_item_editor;
+ Control *canvas_item_editor_viewport;
LineEdit *search_box;
HSlider *size_slider;
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index f2c04d7326..08f1ece2d4 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -836,6 +836,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
editor_data->get_undo_redo().commit_action();
editor->edit_node(new_node);
+ editor_selection->clear();
+ editor_selection->add_node(new_node);
} break;