summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_export.cpp15
-rw-r--r--editor/editor_node.cpp4
-rw-r--r--editor/editor_settings.cpp2
-rw-r--r--editor/editor_themes.cpp5
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp2
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp35
-rw-r--r--editor/plugins/visual_shader_editor_plugin.h3
-rw-r--r--editor/project_manager.cpp44
-rw-r--r--editor/project_manager.h2
9 files changed, 69 insertions, 43 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index d661a3ec3c..f638df28a8 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -1245,23 +1245,14 @@ void EditorExport::add_export_preset(const Ref<EditorExportPreset> &p_preset, in
String EditorExportPlatform::test_etc2() const {
String driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name");
- bool driver_fallback = ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2");
bool etc_supported = ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc");
bool etc2_supported = ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc2");
if (driver == "GLES2" && !etc_supported) {
return TTR("Target platform requires 'ETC' texture compression for GLES2. Enable 'Import Etc' in Project Settings.");
- } else if (driver == "GLES3") {
- String err;
- if (!etc2_supported) {
- err += TTR("Target platform requires 'ETC2' texture compression for GLES3. Enable 'Import Etc 2' in Project Settings.");
- }
- if (driver_fallback && !etc_supported) {
- if (err != String())
- err += "\n";
- err += TTR("Target platform requires 'ETC' texture compression for the driver fallback to GLES2.\nEnable 'Import Etc' in Project Settings, or disable 'Driver Fallback Enabled'.");
- }
- return err;
+ } else if (driver == "Vulkan" && !etc2_supported) {
+ // FIXME: Review if this is true for Vulkan.
+ return TTR("Target platform requires 'ETC2' texture compression for Vulkan. Enable 'Import Etc 2' in Project Settings.");
}
return String();
}
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index a6172faeaa..f88b071515 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -5353,10 +5353,8 @@ void EditorNode::_update_video_driver_color() {
// TODO: Probably should de-hardcode this and add to editor settings.
if (video_driver->get_text() == "GLES2") {
video_driver->add_color_override("font_color", Color::hex(0x5586a4ff));
- } else if (video_driver->get_text() == "GLES3") {
- video_driver->add_color_override("font_color", Color::hex(0xa5557dff));
} else if (video_driver->get_text() == "Vulkan") {
- video_driver->add_color_override("font_color", Color::hex(0xad1128ff));
+ video_driver->add_color_override("font_color", theme_base->get_color("vulkan_color", "Editor"));
}
}
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 715ce6bea7..d81b9bbb82 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -628,7 +628,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
/* Extra config */
_initial_set("project_manager/sorting_order", 0);
- hints["project_manager/sorting_order"] = PropertyInfo(Variant::INT, "project_manager/sorting_order", PROPERTY_HINT_ENUM, "Name,Path,Last Modified");
+ hints["project_manager/sorting_order"] = PropertyInfo(Variant::INT, "project_manager/sorting_order", PROPERTY_HINT_ENUM, "Name,Path,Last Edited");
if (p_extra_config.is_valid()) {
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 78387fceb7..f43aefc944 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -409,6 +409,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("error_color", "Editor", error_color);
theme->set_color("property_color", "Editor", property_color);
+ if (!dark_theme) {
+ theme->set_color("vulkan_color", "Editor", Color::hex(0xad1128ff));
+ } else {
+ theme->set_color("vulkan_color", "Editor", Color(1.0, 0.0, 0.0));
+ }
const int thumb_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size");
theme->set_constant("scale", "Editor", EDSCALE);
theme->set_constant("thumb_size", "Editor", thumb_size);
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index cf6c8feaed..e916f6f028 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -3687,7 +3687,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
view_menu->set_disable_shortcuts(true);
if (OS::get_singleton()->get_current_video_driver() == OS::VIDEO_DRIVER_GLES2) {
- // Alternate display modes only work when using the GLES3 renderer; make this explicit.
+ // Alternate display modes only work when using the Vulkan renderer; make this explicit.
const int normal_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL);
const int wireframe_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_WIREFRAME);
const int overdraw_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_OVERDRAW);
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index ae6087263e..ebd7b4edf6 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -116,7 +116,7 @@ void VisualShaderEditor::clear_custom_types() {
}
}
-void VisualShaderEditor::add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, const String &p_subcategory) {
+void VisualShaderEditor::add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, const String &p_subcategory, bool p_highend) {
ERR_FAIL_COND(!p_name.is_valid_identifier());
ERR_FAIL_COND(!p_script.is_valid());
@@ -135,6 +135,7 @@ void VisualShaderEditor::add_custom_type(const String &p_name, const Ref<Script>
ao.description = p_description;
ao.category = p_category;
ao.sub_category = p_subcategory;
+ ao.highend = p_highend;
ao.is_custom = true;
bool begin = false;
@@ -247,6 +248,11 @@ void VisualShaderEditor::update_custom_nodes() {
subcategory = (String)ref->call("_get_subcategory");
}
+ bool highend = false;
+ if (ref->has_method("_is_highend")) {
+ highend = (bool)ref->call("_is_highend");
+ }
+
Dictionary dict;
dict["name"] = name;
dict["script"] = script;
@@ -254,6 +260,7 @@ void VisualShaderEditor::update_custom_nodes() {
dict["return_icon_type"] = return_icon_type;
dict["category"] = category;
dict["subcategory"] = subcategory;
+ dict["highend"] = highend;
String key;
key = category;
@@ -277,18 +284,14 @@ void VisualShaderEditor::update_custom_nodes() {
const Dictionary &value = (Dictionary)added[key];
- add_custom_type(value["name"], value["script"], value["description"], value["return_icon_type"], value["category"], value["subcategory"]);
+ add_custom_type(value["name"], value["script"], value["description"], value["return_icon_type"], value["category"], value["subcategory"], value["highend"]);
}
_update_options_menu();
}
String VisualShaderEditor::_get_description(int p_idx) {
- if (add_options[p_idx].highend) {
- return TTR("(GLES3 only)") + " " + add_options[p_idx].description; // TODO: change it to (Vulkan Only) when its ready
- } else {
- return add_options[p_idx].description;
- }
+ return add_options[p_idx].description;
}
void VisualShaderEditor::_update_options_menu() {
@@ -1680,6 +1683,8 @@ void VisualShaderEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
+ highend_label->set_modulate(get_color("vulkan_color", "Editor"));
+
error_panel->add_style_override("panel", get_stylebox("bg", "Tree"));
error_label->add_color_override("font_color", get_color("error_color", "Editor"));
@@ -2037,8 +2042,10 @@ void VisualShaderEditor::_member_selected() {
if (item != NULL && item->has_meta("id")) {
members_dialog->get_ok()->set_disabled(false);
+ highend_label->set_visible(add_options[item->get_meta("id")].highend);
node_desc->set_text(_get_description(item->get_meta("id")));
} else {
+ highend_label->set_visible(false);
members_dialog->get_ok()->set_disabled(true);
node_desc->set_text("");
}
@@ -2425,10 +2432,22 @@ VisualShaderEditor::VisualShaderEditor() {
members->connect("item_selected", this, "_member_selected");
members->connect("nothing_selected", this, "_member_unselected");
+ HBoxContainer *desc_hbox = memnew(HBoxContainer);
+ members_vb->add_child(desc_hbox);
+
Label *desc_label = memnew(Label);
- members_vb->add_child(desc_label);
+ desc_hbox->add_child(desc_label);
desc_label->set_text(TTR("Description:"));
+ desc_hbox->add_spacer();
+
+ highend_label = memnew(Label);
+ desc_hbox->add_child(highend_label);
+ highend_label->set_visible(false);
+ highend_label->set_text("Vulkan");
+ highend_label->set_mouse_filter(Control::MOUSE_FILTER_STOP);
+ highend_label->set_tooltip(TTR("High-end node"));
+
node_desc = memnew(RichTextLabel);
members_vb->add_child(node_desc);
node_desc->set_h_size_flags(SIZE_EXPAND_FILL);
diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h
index 8c5dd8e82f..150cf16167 100644
--- a/editor/plugins/visual_shader_editor_plugin.h
+++ b/editor/plugins/visual_shader_editor_plugin.h
@@ -94,6 +94,7 @@ class VisualShaderEditor : public VBoxContainer {
AcceptDialog *alert;
LineEdit *node_filter;
RichTextLabel *node_desc;
+ Label *highend_label;
void _tools_menu_option(int p_idx);
void _show_members_dialog(bool at_mouse_pos);
@@ -264,7 +265,7 @@ public:
static VisualShaderEditor *get_singleton() { return singleton; }
void clear_custom_types();
- void add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, const String &p_subcategory);
+ void add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, const String &p_subcategory, bool p_highend);
virtual Size2 get_minimum_size() const;
void edit(VisualShader *p_visual_shader);
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 006c753158..0c22db075d 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -484,8 +484,8 @@ private:
if (mode == MODE_NEW) {
ProjectSettings::CustomMap initial_settings;
- if (rasterizer_button_group->get_pressed_button()->get_meta("driver_name") == "GLES3") {
- initial_settings["rendering/quality/driver/driver_name"] = "GLES3";
+ if (rasterizer_button_group->get_pressed_button()->get_meta("driver_name") == "Vulkan") {
+ initial_settings["rendering/quality/driver/driver_name"] = "Vulkan";
} else {
initial_settings["rendering/quality/driver/driver_name"] = "GLES2";
initial_settings["rendering/vram_compression/import_etc2"] = false;
@@ -881,7 +881,7 @@ public:
Button *rs_button = memnew(CheckBox);
rs_button->set_button_group(rasterizer_button_group);
rs_button->set_text(TTR("Vulkan"));
- rs_button->set_meta("driver_name", "GLES3");
+ rs_button->set_meta("driver_name", "Vulkan");
rs_button->set_pressed(true);
rvb->add_child(rs_button);
l = memnew(Label);
@@ -891,17 +891,26 @@ public:
rshb->add_child(memnew(VSeparator));
+ const String gles2_unsupported_tooltip =
+ TTR("The GLES2 renderer is currently unavailable, as it needs to be reworked for Godot 4.0.\nUse Godot 3.2 if you need GLES2 support.");
+
rvb = memnew(VBoxContainer);
rvb->set_h_size_flags(SIZE_EXPAND_FILL);
rshb->add_child(rvb);
rs_button = memnew(CheckBox);
rs_button->set_button_group(rasterizer_button_group);
- rs_button->set_text(TTR("OpenGL ES 2.0"));
+ rs_button->set_text(TTR("OpenGL ES 2.0 (currently unavailable)"));
rs_button->set_meta("driver_name", "GLES2");
+ rs_button->set_disabled(true);
+ rs_button->set_tooltip(gles2_unsupported_tooltip);
rvb->add_child(rs_button);
l = memnew(Label);
l->set_text(TTR("- Lower visual quality\n- Some features not available\n- Works on most hardware\n- Recommended for web and mobile games"));
l->set_modulate(Color(1, 1, 1, 0.7));
+ // Also set the tooltip on the label so it appears when hovering either the checkbox or label.
+ l->set_tooltip(gles2_unsupported_tooltip);
+ // Required for the tooltip to show.
+ l->set_mouse_filter(MOUSE_FILTER_STOP);
rvb->add_child(l);
l = memnew(Label);
@@ -992,7 +1001,7 @@ public:
String path;
String icon;
String main_scene;
- uint64_t last_modified;
+ uint64_t last_edited;
bool favorite;
bool grayed;
bool missing;
@@ -1008,7 +1017,7 @@ public:
const String &p_path,
const String &p_icon,
const String &p_main_scene,
- uint64_t p_last_modified,
+ uint64_t p_last_edited,
bool p_favorite,
bool p_grayed,
bool p_missing,
@@ -1020,7 +1029,7 @@ public:
path = p_path;
icon = p_icon;
main_scene = p_main_scene;
- last_modified = p_last_modified;
+ last_edited = p_last_edited;
favorite = p_favorite;
grayed = p_grayed;
missing = p_missing;
@@ -1095,8 +1104,8 @@ struct ProjectListComparator {
switch (order_option) {
case ProjectListFilter::FILTER_PATH:
return a.project_key < b.project_key;
- case ProjectListFilter::FILTER_MODIFIED:
- return a.last_modified > b.last_modified;
+ case ProjectListFilter::FILTER_EDIT_DATE:
+ return a.last_edited > b.last_edited;
default:
return a.project_name < b.project_name;
}
@@ -1104,7 +1113,7 @@ struct ProjectListComparator {
};
ProjectList::ProjectList() {
- _order_option = ProjectListFilter::FILTER_MODIFIED;
+ _order_option = ProjectListFilter::FILTER_EDIT_DATE;
_scroll_children = memnew(VBoxContainer);
_scroll_children->set_h_size_flags(SIZE_EXPAND_FILL);
@@ -1191,15 +1200,18 @@ void ProjectList::load_project_data(const String &p_property_key, Item &p_item,
String icon = cf->get_value("application", "config/icon", "");
String main_scene = cf->get_value("application", "run/main_scene", "");
- uint64_t last_modified = 0;
+ uint64_t last_edited = 0;
if (FileAccess::exists(conf)) {
- last_modified = FileAccess::get_modified_time(conf);
+ // The modification date marks the date the project was last edited.
+ // This is because the `project.godot` file will always be modified
+ // when editing a project (but not when running it).
+ last_edited = FileAccess::get_modified_time(conf);
String fscache = path.plus_file(".fscache");
if (FileAccess::exists(fscache)) {
uint64_t cache_modified = FileAccess::get_modified_time(fscache);
- if (cache_modified > last_modified)
- last_modified = cache_modified;
+ if (cache_modified > last_edited)
+ last_edited = cache_modified;
}
} else {
grayed = true;
@@ -1209,7 +1221,7 @@ void ProjectList::load_project_data(const String &p_property_key, Item &p_item,
String project_key = p_property_key.get_slice("/", 1);
- p_item = Item(project_key, project_name, description, path, icon, main_scene, last_modified, p_favorite, grayed, missing, config_version);
+ p_item = Item(project_key, project_name, description, path, icon, main_scene, last_edited, p_favorite, grayed, missing, config_version);
}
void ProjectList::load_projects() {
@@ -2506,7 +2518,7 @@ ProjectManager::ProjectManager() {
Vector<String> sort_filter_titles;
sort_filter_titles.push_back(TTR("Name"));
sort_filter_titles.push_back(TTR("Path"));
- sort_filter_titles.push_back(TTR("Last Modified"));
+ sort_filter_titles.push_back(TTR("Last Edited"));
project_order_filter = memnew(ProjectListFilter);
project_order_filter->add_filter_option();
project_order_filter->_setup_filters(sort_filter_titles);
diff --git a/editor/project_manager.h b/editor/project_manager.h
index b8f7403e27..feeea9695d 100644
--- a/editor/project_manager.h
+++ b/editor/project_manager.h
@@ -134,7 +134,7 @@ public:
enum FilterOption {
FILTER_NAME,
FILTER_PATH,
- FILTER_MODIFIED,
+ FILTER_EDIT_DATE,
};
private: