summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/code_editor.cpp1
-rw-r--r--editor/editor_asset_installer.cpp2
-rw-r--r--editor/editor_export.cpp32
-rw-r--r--editor/editor_file_dialog.cpp18
-rw-r--r--editor/editor_node.h2
-rw-r--r--editor/editor_plugin.cpp34
-rw-r--r--editor/editor_settings.cpp1
-rw-r--r--editor/editor_themes.cpp16
-rw-r--r--editor/export_template_manager.cpp8
-rw-r--r--editor/filesystem_dock.cpp3
-rw-r--r--editor/icons/SCsub1
-rw-r--r--editor/import/editor_import_collada.cpp5
-rw-r--r--editor/plugins/particles_editor_plugin.cpp4
-rw-r--r--editor/plugins/script_editor_plugin.cpp5
-rw-r--r--editor/plugins/script_text_editor.cpp9
-rw-r--r--editor/script_create_dialog.cpp25
16 files changed, 74 insertions, 92 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index a809f4b15e..4575bfcb08 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -258,7 +258,6 @@ void FindReplaceBar::_get_search_from(int &r_line, int &r_col) {
int selection_from_col = text_edit->get_selection_from_column();
if (r_col >= selection_from_col && r_col <= text_edit->get_selection_to_column()) {
- r_col = selection_line;
r_col = selection_from_col;
}
}
diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp
index 96bfb295ea..6c05a9ef80 100644
--- a/editor/editor_asset_installer.cpp
+++ b/editor/editor_asset_installer.cpp
@@ -100,7 +100,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
//get filename
unz_file_info info;
char fname[16384];
- ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
+ unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
String name = fname;
files_sorted.insert(name);
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index d8d3554612..14d713bb36 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -3323,22 +3323,22 @@ void EditorImportExport::_bind_methods() {
- BIND_CONSTANT( ACTION_NONE );
- BIND_CONSTANT( ACTION_COPY );
- BIND_CONSTANT( ACTION_BUNDLE );
-
- BIND_CONSTANT( EXPORT_SELECTED );
- BIND_CONSTANT( EXPORT_RESOURCES );
- BIND_CONSTANT( EXPORT_ALL );
-
- BIND_CONSTANT( IMAGE_ACTION_NONE );
- BIND_CONSTANT( IMAGE_ACTION_COMPRESS_DISK );
- BIND_CONSTANT( IMAGE_ACTION_COMPRESS_RAM );
- BIND_CONSTANT( IMAGE_ACTION_KEEP );
-
- BIND_CONSTANT( SCRIPT_ACTION_NONE );
- BIND_CONSTANT( SCRIPT_ACTION_COMPILE );
- BIND_CONSTANT( SCRIPT_ACTION_ENCRYPT );
+ BIND_ENUM_CONSTANT( ACTION_NONE );
+ BIND_ENUM_CONSTANT( ACTION_COPY );
+ BIND_ENUM_CONSTANT( ACTION_BUNDLE );
+
+ BIND_ENUM_CONSTANT( EXPORT_SELECTED );
+ BIND_ENUM_CONSTANT( EXPORT_RESOURCES );
+ BIND_ENUM_CONSTANT( EXPORT_ALL );
+
+ BIND_ENUM_CONSTANT( IMAGE_ACTION_NONE );
+ BIND_ENUM_CONSTANT( IMAGE_ACTION_COMPRESS_DISK );
+ BIND_ENUM_CONSTANT( IMAGE_ACTION_COMPRESS_RAM );
+ BIND_ENUM_CONSTANT( IMAGE_ACTION_KEEP );
+
+ BIND_ENUM_CONSTANT( SCRIPT_ACTION_NONE );
+ BIND_ENUM_CONSTANT( SCRIPT_ACTION_COMPILE );
+ BIND_ENUM_CONSTANT( SCRIPT_ACTION_ENCRYPT );
};
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index d572ee8724..26dbc27136 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -1187,15 +1187,15 @@ void EditorFileDialog::_bind_methods() {
ADD_SIGNAL(MethodInfo("files_selected", PropertyInfo(Variant::POOL_STRING_ARRAY, "paths")));
ADD_SIGNAL(MethodInfo("dir_selected", PropertyInfo(Variant::STRING, "dir")));
- BIND_CONSTANT(MODE_OPEN_FILE);
- BIND_CONSTANT(MODE_OPEN_FILES);
- BIND_CONSTANT(MODE_OPEN_DIR);
- BIND_CONSTANT(MODE_OPEN_ANY);
- BIND_CONSTANT(MODE_SAVE_FILE);
-
- BIND_CONSTANT(ACCESS_RESOURCES);
- BIND_CONSTANT(ACCESS_USERDATA);
- BIND_CONSTANT(ACCESS_FILESYSTEM);
+ BIND_ENUM_CONSTANT(MODE_OPEN_FILE);
+ BIND_ENUM_CONSTANT(MODE_OPEN_FILES);
+ BIND_ENUM_CONSTANT(MODE_OPEN_DIR);
+ BIND_ENUM_CONSTANT(MODE_OPEN_ANY);
+ BIND_ENUM_CONSTANT(MODE_SAVE_FILE);
+
+ BIND_ENUM_CONSTANT(ACCESS_RESOURCES);
+ BIND_ENUM_CONSTANT(ACCESS_USERDATA);
+ BIND_ENUM_CONSTANT(ACCESS_FILESYSTEM);
}
void EditorFileDialog::set_show_hidden_files(bool p_show) {
diff --git a/editor/editor_node.h b/editor/editor_node.h
index cf6ef33325..385d97ecc3 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -684,6 +684,8 @@ public:
void merge_from_scene() { _menu_option_confirm(FILE_IMPORT_SUBSCENE, false); }
+ void show_about() { _menu_option_confirm(HELP_ABOUT, false); }
+
static bool has_unsaved_changes() { return singleton->unsaved_cache; }
static HBoxContainer *get_menu_hb() { return singleton->menu_hb; }
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index d8c8d419b9..f8ed18bba4 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -468,23 +468,23 @@ void EditorPlugin::_bind_methods() {
ADD_SIGNAL(MethodInfo("scene_closed", PropertyInfo(Variant::STRING, "filepath:String")));
ADD_SIGNAL(MethodInfo("main_screen_changed", PropertyInfo(Variant::STRING, "screen_name:String")));
- BIND_CONSTANT(CONTAINER_TOOLBAR);
- BIND_CONSTANT(CONTAINER_SPATIAL_EDITOR_MENU);
- BIND_CONSTANT(CONTAINER_SPATIAL_EDITOR_SIDE);
- BIND_CONSTANT(CONTAINER_SPATIAL_EDITOR_BOTTOM);
- BIND_CONSTANT(CONTAINER_CANVAS_EDITOR_MENU);
- BIND_CONSTANT(CONTAINER_CANVAS_EDITOR_SIDE);
- BIND_CONSTANT(CONTAINER_PROPERTY_EDITOR_BOTTOM);
-
- BIND_CONSTANT(DOCK_SLOT_LEFT_UL);
- BIND_CONSTANT(DOCK_SLOT_LEFT_BL);
- BIND_CONSTANT(DOCK_SLOT_LEFT_UR);
- BIND_CONSTANT(DOCK_SLOT_LEFT_BR);
- BIND_CONSTANT(DOCK_SLOT_RIGHT_UL);
- BIND_CONSTANT(DOCK_SLOT_RIGHT_BL);
- BIND_CONSTANT(DOCK_SLOT_RIGHT_UR);
- BIND_CONSTANT(DOCK_SLOT_RIGHT_BR);
- BIND_CONSTANT(DOCK_SLOT_MAX);
+ BIND_ENUM_CONSTANT(CONTAINER_TOOLBAR);
+ BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_MENU);
+ BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_SIDE);
+ BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_BOTTOM);
+ BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_MENU);
+ BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_SIDE);
+ BIND_ENUM_CONSTANT(CONTAINER_PROPERTY_EDITOR_BOTTOM);
+
+ BIND_ENUM_CONSTANT(DOCK_SLOT_LEFT_UL);
+ BIND_ENUM_CONSTANT(DOCK_SLOT_LEFT_BL);
+ BIND_ENUM_CONSTANT(DOCK_SLOT_LEFT_UR);
+ BIND_ENUM_CONSTANT(DOCK_SLOT_LEFT_BR);
+ BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_UL);
+ BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_BL);
+ BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_UR);
+ BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_BR);
+ BIND_ENUM_CONSTANT(DOCK_SLOT_MAX);
}
EditorPlugin::EditorPlugin() {
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 5c8e166730..358d575764 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -593,6 +593,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
hints["text_editor/theme/color_theme"] = PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, "Default");
set("text_editor/theme/line_spacing", 4);
+ set("text_editor/theme/adapted_code_editor_background_color", true);
_load_default_text_editor_theme();
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 9f6416f4e6..4f1e6c1771 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -86,19 +86,6 @@ static Ref<StyleBoxFlat> change_border_color(Ref<StyleBoxFlat> p_style, Color p_
return style;
}
-static Ref<StyleBoxFlat> add_additional_border(Ref<StyleBoxFlat> p_style, int p_left, int p_top, int p_right, int p_bottom) {
- Ref<StyleBoxFlat> style = p_style->duplicate();
- style->set_border_width(MARGIN_LEFT, p_left * EDSCALE + style->get_border_width(MARGIN_LEFT));
- style->set_border_width(MARGIN_RIGHT, p_right * EDSCALE + style->get_border_width(MARGIN_RIGHT));
- style->set_border_width(MARGIN_TOP, p_top * EDSCALE + style->get_border_width(MARGIN_TOP));
- style->set_border_width(MARGIN_BOTTOM, p_bottom * EDSCALE + style->get_border_width(MARGIN_BOTTOM));
- style->set_expand_margin_size(MARGIN_LEFT, p_left * EDSCALE);
- style->set_expand_margin_size(MARGIN_RIGHT, p_right * EDSCALE);
- style->set_expand_margin_size(MARGIN_TOP, p_top * EDSCALE);
- style->set_expand_margin_size(MARGIN_BOTTOM, p_bottom * EDSCALE);
- return style;
-}
-
#define HIGHLIGHT_COLOR_LIGHT highlight_color.linear_interpolate(Color(1, 1, 1, 1), 0.3)
#define HIGHLIGHT_COLOR_DARK highlight_color.linear_interpolate(Color(0, 0, 0, 1), 0.5)
@@ -537,7 +524,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
// PopupPanel
Ref<StyleBoxFlat> style_dock_select = make_flat_stylebox(base_color);
style_dock_select->set_border_color_all(light_color_1);
- style_dock_select = add_additional_border(style_dock_select, 2, 2, 2, 2);
+ style_dock_select->set_expand_margin_size_all(2);
+ style_dock_select->set_border_width_all(2);
theme->set_stylebox("panel", "PopupPanel", style_dock_select);
// SpinBox
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp
index e6f15d1712..5ff9b795d7 100644
--- a/editor/export_template_manager.cpp
+++ b/editor/export_template_manager.cpp
@@ -195,7 +195,7 @@ void ExportTemplateManager::_install_from_file(const String &p_file) {
data.resize(info.uncompressed_size);
//read
- ret = unzOpenCurrentFile(pkg);
+ unzOpenCurrentFile(pkg);
ret = unzReadCurrentFile(pkg, data.ptr(), data.size());
unzCloseCurrentFile(pkg);
@@ -257,7 +257,7 @@ void ExportTemplateManager::_install_from_file(const String &p_file) {
//get filename
unz_file_info info;
char fname[16384];
- ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
+ unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
String file = fname;
@@ -265,8 +265,8 @@ void ExportTemplateManager::_install_from_file(const String &p_file) {
data.resize(info.uncompressed_size);
//read
- ret = unzOpenCurrentFile(pkg);
- ret = unzReadCurrentFile(pkg, data.ptr(), data.size());
+ unzOpenCurrentFile(pkg);
+ unzReadCurrentFile(pkg, data.ptr(), data.size());
unzCloseCurrentFile(pkg);
print_line(fname);
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 8e40850a0c..7413b05aac 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -1465,10 +1465,9 @@ void FileSystemDock::_files_list_rmb_select(int p_item, const Vector2 &p_pos) {
return;
}
- EditorFileSystemDirectory *efsd = NULL;
int pos;
- efsd = EditorFileSystem::get_singleton()->find_file(path, &pos);
+ EditorFileSystemDirectory *efsd = EditorFileSystem::get_singleton()->find_file(path, &pos);
if (efsd) {
diff --git a/editor/icons/SCsub b/editor/icons/SCsub
index 564188f315..86c51a50f3 100644
--- a/editor/icons/SCsub
+++ b/editor/icons/SCsub
@@ -88,5 +88,4 @@ make_editor_icons_builder = Builder(action=make_editor_icons_action,
env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder
env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.gen.h', Glob("*.svg"))])
-env.editor_sources.append("#editor/editor_icons.gen.h")
Export('env')
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index a75147a3a9..b3ccb5097e 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -1584,14 +1584,12 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) {
apply_xform = Transform();
}
- Collada::SkinControllerData::Source *joint_src = NULL;
-
ERR_FAIL_COND_V(!skin->weights.sources.has("JOINT"), ERR_INVALID_DATA);
String joint_id = skin->weights.sources["JOINT"].source;
ERR_FAIL_COND_V(!skin->sources.has(joint_id), ERR_INVALID_DATA);
- joint_src = &skin->sources[joint_id];
+ Collada::SkinControllerData::Source *joint_src = &skin->sources[joint_id];
bone_remap.resize(joint_src->sarray.size());
@@ -2317,7 +2315,6 @@ Ref<Animation> EditorSceneImporterCollada::import_animation(const String &p_path
if (state.animations.size() == 0)
return Ref<Animation>();
Ref<Animation> anim = state.animations[0];
- anim = state.animations[0];
print_line("Anim Load OK");
String base = p_path.get_basename().to_lower();
if (p_flags & IMPORT_ANIMATION_DETECT_LOOP) {
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp
index d918a3e24e..1e3723a911 100644
--- a/editor/plugins/particles_editor_plugin.cpp
+++ b/editor/plugins/particles_editor_plugin.cpp
@@ -270,9 +270,7 @@ void ParticlesEditor::_generate_emission_points() {
Vector3 dir;
dir[Math::rand() % 3] = 1.0;
- Vector3 ofs = Vector3(1, 1, 1) - dir;
- ofs = (Vector3(1, 1, 1) - dir) * Vector3(Math::randf(), Math::randf(), Math::randf()) * aabb.size;
- ofs += aabb.position;
+ Vector3 ofs = (Vector3(1, 1, 1) - dir) * Vector3(Math::randf(), Math::randf(), Math::randf()) * aabb.size + aabb.position;
Vector3 ofsv = ofs + aabb.size * dir;
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 7c504ecc03..e8770febd9 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2072,7 +2072,10 @@ void ScriptEditor::_update_selected_editor_menu() {
}
}
- EditorHelp *eh = tab_container->get_current_tab_control()->cast_to<EditorHelp>();
+ EditorHelp *eh = NULL;
+ if (tab_container->get_current_tab_control())
+ eh = tab_container->get_current_tab_control()->cast_to<EditorHelp>();
+
if (eh) {
script_search_menu->show();
} else {
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 1a3092b6e4..19de027287 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -75,9 +75,14 @@ void ScriptTextEditor::_load_theme_settings() {
text_edit->clear_colors();
- /* keyword color */
+ /* color from color_theme or from editor color */
+
+ Color background_color = EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0));
+ if (EDITOR_DEF("text_editor/theme/adapted_code_editor_background_color", false))
+ background_color = get_color("dark_color_1", "Editor");
- text_edit->add_color_override("background_color", EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0)));
+ /* keyword color */
+ text_edit->add_color_override("background_color", background_color);
text_edit->add_color_override("completion_background_color", EDITOR_DEF("text_editor/highlighting/completion_background_color", Color(0, 0, 0, 0)));
text_edit->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/highlighting/completion_selected_color", Color::html("434244")));
text_edit->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")));
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index 0748c43b5f..299538a2b3 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -531,28 +531,19 @@ void ScriptCreateDialog::_bind_methods() {
ScriptCreateDialog::ScriptCreateDialog() {
- GridContainer *gc = memnew(GridContainer);
- VBoxContainer *vb = memnew(VBoxContainer);
- HBoxContainer *hb = memnew(HBoxContainer);
- Label *l = memnew(Label);
- Control *empty = memnew(Control);
- Control *empty_h = memnew(Control);
- Control *empty_v = memnew(Control);
- PanelContainer *pc = memnew(PanelContainer);
-
/* DIALOG */
/* Main Controls */
- gc = memnew(GridContainer);
+ GridContainer *gc = memnew(GridContainer);
gc->set_columns(2);
/* Error Messages Field */
- vb = memnew(VBoxContainer);
+ VBoxContainer *vb = memnew(VBoxContainer);
- hb = memnew(HBoxContainer);
- l = memnew(Label);
+ HBoxContainer *hb = memnew(HBoxContainer);
+ Label *l = memnew(Label);
l->set_text(" - ");
hb->add_child(l);
error_label = memnew(Label);
@@ -571,19 +562,19 @@ ScriptCreateDialog::ScriptCreateDialog() {
hb->add_child(path_error_label);
vb->add_child(hb);
- pc = memnew(PanelContainer);
+ PanelContainer *pc = memnew(PanelContainer);
pc->set_h_size_flags(Control::SIZE_FILL);
pc->add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("bg", "Tree"));
pc->add_child(vb);
/* Margins */
- empty_h = memnew(Control);
+ Control *empty_h = memnew(Control);
empty_h->set_name("empty_h"); //duplicate() doesn't like nodes without a name
empty_h->set_h_size_flags(Control::SIZE_EXPAND_FILL);
empty_h->set_v_size_flags(Control::SIZE_EXPAND_FILL);
empty_h->set_custom_minimum_size(Size2(0, 10 * EDSCALE));
- empty_v = memnew(Control);
+ Control *empty_v = memnew(Control);
empty_v->set_name("empty_v");
empty_v->set_h_size_flags(Control::SIZE_EXPAND_FILL);
empty_v->set_v_size_flags(Control::SIZE_EXPAND_FILL);
@@ -684,7 +675,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
internal = memnew(CheckButton);
internal->connect("pressed", this, "_built_in_pressed");
hb = memnew(HBoxContainer);
- empty = memnew(Control);
+ Control *empty = memnew(Control);
hb->add_child(internal);
hb->add_child(empty);
l = memnew(Label);