summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/editor_node.cpp25
-rw-r--r--editor/editor_node.h2
-rw-r--r--editor/plugins/script_editor_plugin.cpp21
-rw-r--r--modules/gdscript/gdscript_parser.cpp21
-rw-r--r--scene/resources/tile_set.cpp2
5 files changed, 30 insertions, 41 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index a3743efb38..c887e8ffcc 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -5187,12 +5187,6 @@ EditorNode::EditorNode() {
top_region->add_child(left_menu_hb);
menu_hb->add_child(top_region);
- {
- Control *sp = memnew(Control);
- sp->set_custom_minimum_size(Size2(30, 0) * EDSCALE);
- menu_hb->add_child(sp);
- }
-
file_menu = memnew(MenuButton);
file_menu->set_flat(false);
file_menu->set_text(TTR("Scene"));
@@ -5409,12 +5403,8 @@ EditorNode::EditorNode() {
p->add_separator();
p->add_icon_item(gui_base->get_icon("Godot", "EditorIcons"), TTR("About"), HELP_ABOUT);
- play_cc = memnew(CenterContainer);
- play_cc->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
- menu_hb->add_child(play_cc);
-
play_button_panel = memnew(PanelContainer);
- play_cc->add_child(play_button_panel);
+ menu_hb->add_child(play_button_panel);
HBoxContainer *play_hb = memnew(HBoxContainer);
play_button_panel->add_child(play_hb);
@@ -5460,11 +5450,6 @@ EditorNode::EditorNode() {
run_native = memnew(EditorRunNative);
play_hb->add_child(run_native);
- native_play_button = memnew(MenuButton);
- native_play_button->set_text("NTV");
- menu_hb->add_child(native_play_button);
- native_play_button->hide();
- native_play_button->get_popup()->connect("id_pressed", this, "_run_in_device");
run_native->connect("native_run", this, "_menu_option", varray(RUN_PLAY_NATIVE));
play_scene_button = memnew(ToolButton);
@@ -5493,6 +5478,9 @@ EditorNode::EditorNode() {
play_custom_scene_button->set_shortcut(ED_SHORTCUT("editor/play_custom_scene", TTR("Play Custom Scene"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F5));
#endif
+ HBoxContainer *right_menu_hb = memnew(HBoxContainer);
+ menu_hb->add_child(right_menu_hb);
+
// Toggle for video driver
video_driver = memnew(OptionButton);
video_driver->set_flat(true);
@@ -5500,7 +5488,7 @@ EditorNode::EditorNode() {
video_driver->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
video_driver->connect("item_selected", this, "_video_driver_selected");
video_driver->add_font_override("font", gui_base->get_font("bold", "EditorFonts"));
- menu_hb->add_child(video_driver);
+ right_menu_hb->add_child(video_driver);
String video_drivers = ProjectSettings::get_singleton()->get_custom_property_info()["rendering/quality/driver/driver_name"].hint_string;
String current_video_driver = OS::get_singleton()->get_video_driver_name(OS::get_singleton()->get_current_video_driver());
@@ -5526,9 +5514,6 @@ EditorNode::EditorNode() {
progress_hb = memnew(BackgroundProgress);
- HBoxContainer *right_menu_hb = memnew(HBoxContainer);
- menu_hb->add_child(right_menu_hb);
-
layout_dialog = memnew(EditorNameDialog);
gui_base->add_child(layout_dialog);
layout_dialog->set_hide_on_ok(false);
diff --git a/editor/editor_node.h b/editor/editor_node.h
index 3a4b8d451f..e5670e5e7c 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -243,7 +243,6 @@ private:
Control *vp_base;
PaneDrag *pd;
- CenterContainer *play_cc;
HBoxContainer *menu_hb;
Control *viewport;
MenuButton *file_menu;
@@ -255,7 +254,6 @@ private:
ToolButton *export_button;
ToolButton *prev_scene;
ToolButton *play_button;
- MenuButton *native_play_button;
ToolButton *pause_button;
ToolButton *stop_button;
ToolButton *run_settings_button;
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 75529d6007..c9b8affc8a 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -897,12 +897,12 @@ void ScriptEditor::_file_dialog_action(String p_file) {
} break;
case THEME_SAVE_AS: {
if (!EditorSettings::get_singleton()->save_text_editor_theme_as(p_file)) {
- editor->show_warning(TTR("Error while saving theme"), TTR("Error saving"));
+ editor->show_warning(TTR("Error while saving theme."), TTR("Error Saving"));
}
} break;
case THEME_IMPORT: {
if (!EditorSettings::get_singleton()->import_text_editor_theme(p_file)) {
- editor->show_warning(TTR("Error importing theme"), TTR("Error importing"));
+ editor->show_warning(TTR("Error importing theme."), TTR("Error Importing"));
}
} break;
}
@@ -1090,7 +1090,7 @@ void ScriptEditor::_menu_option(int p_option) {
Ref<Script> scr = current->get_edited_resource();
if (scr == NULL || scr.is_null()) {
- EditorNode::get_singleton()->show_warning("Can't obtain the script for running");
+ EditorNode::get_singleton()->show_warning("Can't obtain the script for running.");
break;
}
@@ -1103,13 +1103,13 @@ void ScriptEditor::_menu_option(int p_option) {
}
if (!scr->is_tool()) {
- EditorNode::get_singleton()->show_warning("Script is not in tool mode, will not be able to run");
+ EditorNode::get_singleton()->show_warning("Script is not in tool mode, will not be able to run.");
return;
}
if (!ClassDB::is_parent_class(scr->get_instance_base_type(), "EditorScript")) {
- EditorNode::get_singleton()->show_warning("To run this script, it must inherit EditorScript and be set to tool mode");
+ EditorNode::get_singleton()->show_warning("To run this script, it must inherit EditorScript and be set to tool mode.");
return;
}
@@ -2978,9 +2978,9 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
menu_hb->add_child(file_menu);
file_menu->set_text(TTR("File"));
file_menu->get_popup()->set_hide_on_window_lose_focus(true);
- file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new", TTR("New Script")), FILE_NEW);
- file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new_textfile", TTR("New TextFile")), FILE_NEW_TEXTFILE);
- file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/open", TTR("Open")), FILE_OPEN);
+ file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new", TTR("New Script...")), FILE_NEW);
+ file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new_textfile", TTR("New TextFile...")), FILE_NEW_TEXTFILE);
+ file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/open", TTR("Open...")), FILE_OPEN);
file_menu->get_popup()->add_submenu_item(TTR("Open Recent"), "RecentScripts", FILE_OPEN_RECENT);
recent_scripts = memnew(PopupMenu);
@@ -3009,10 +3009,11 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
theme_submenu->set_name("Theme");
file_menu->get_popup()->add_child(theme_submenu);
theme_submenu->connect("id_pressed", this, "_theme_option");
- theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/import_theme", TTR("Import Theme")), THEME_IMPORT);
+ theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/import_theme", TTR("Import Theme...")), THEME_IMPORT);
theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/reload_theme", TTR("Reload Theme")), THEME_RELOAD);
+ theme_submenu->add_separator();
theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/save_theme", TTR("Save Theme")), THEME_SAVE);
- theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/save_theme_as", TTR("Save Theme As")), THEME_SAVE_AS);
+ theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/save_theme_as", TTR("Save Theme As...")), THEME_SAVE_AS);
file_menu->get_popup()->add_separator();
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS);
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 0926c1a1ab..6ea0dbcb19 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -5746,18 +5746,23 @@ bool GDScriptParser::_is_type_compatible(const DataType &p_container, const Data
if (p_container.kind == DataType::BUILTIN && p_expression.kind == DataType::BUILTIN) {
bool valid = p_container.builtin_type == p_expression.builtin_type;
if (p_allow_implicit_conversion) {
- valid = valid || (p_container.builtin_type == Variant::INT && p_expression.builtin_type == Variant::REAL);
- valid = valid || (p_container.builtin_type == Variant::REAL && p_expression.builtin_type == Variant::INT);
- valid = valid || (p_container.builtin_type == Variant::STRING && p_expression.builtin_type == Variant::NODE_PATH);
- valid = valid || (p_container.builtin_type == Variant::NODE_PATH && p_expression.builtin_type == Variant::STRING);
- valid = valid || (p_container.builtin_type == Variant::BOOL && p_expression.builtin_type == Variant::REAL);
- valid = valid || (p_container.builtin_type == Variant::BOOL && p_expression.builtin_type == Variant::INT);
- valid = valid || (p_container.builtin_type == Variant::INT && p_expression.builtin_type == Variant::BOOL);
- valid = valid || (p_container.builtin_type == Variant::REAL && p_expression.builtin_type == Variant::BOOL);
+ valid = valid || Variant::can_convert_strict(p_expression.builtin_type, p_container.builtin_type);
}
return valid;
}
+ if (p_container.kind == DataType::BUILTIN && p_container.builtin_type == Variant::OBJECT) {
+ // Object built-in is a special case, it's compatible with any object and with null
+ if (p_expression.kind == DataType::BUILTIN && p_expression.builtin_type == Variant::NIL) {
+ return true;
+ }
+ if (p_expression.kind == DataType::BUILTIN) {
+ return false;
+ }
+ // If it's not a built-in, must be an object
+ return true;
+ }
+
if (p_container.kind == DataType::BUILTIN || (p_expression.kind == DataType::BUILTIN && p_expression.builtin_type != Variant::NIL)) {
// Can't mix built-ins with objects
return false;
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 88dbc67e01..c2c2c0ff32 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -137,7 +137,7 @@ bool TileSet::_set(const StringName &p_name, const Variant &p_value) {
int z_index;
while (p.size() > 0) {
val = p[0];
- if (val.z > 1) {
+ if (val.z != 0) {
v.x = val.x;
v.y = val.y;
z_index = (int)val.z;