summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdoc/tools/doc_status.py32
-rw-r--r--editor/editor_settings.cpp6
-rw-r--r--modules/gltf/gltf_document.cpp51
-rw-r--r--modules/gltf/gltf_document.h1
-rw-r--r--scene/gui/item_list.cpp10
-rw-r--r--scene/gui/item_list.h2
-rw-r--r--scene/gui/menu_button.cpp2
-rw-r--r--scene/gui/popup_menu.cpp10
8 files changed, 83 insertions, 31 deletions
diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.py
index 629b5a032b..cc0733cab2 100755
--- a/doc/tools/doc_status.py
+++ b/doc/tools/doc_status.py
@@ -66,10 +66,23 @@ table_columns = [
"methods",
"constants",
"members",
- "signals",
"theme_items",
+ "signals",
+ "operators",
+ "constructors",
+]
+table_column_names = [
+ "Name",
+ "Brief Desc.",
+ "Desc.",
+ "Methods",
+ "Constants",
+ "Members",
+ "Theme Items",
+ "Signals",
+ "Operators",
+ "Constructors",
]
-table_column_names = ["Name", "Brief Desc.", "Desc.", "Methods", "Constants", "Members", "Signals", "Theme Items"]
colors = {
"name": [36], # cyan
"part_big_problem": [4, 31], # underline, red
@@ -82,7 +95,7 @@ colors = {
"state_on": [1, 35], # bold, magenta/plum
"bold": [1], # bold
}
-overall_progress_description_weigth = 10
+overall_progress_description_weight = 10
################################################################################
@@ -180,6 +193,8 @@ class ClassStatus:
"members": ClassStatusProgress(),
"theme_items": ClassStatusProgress(),
"signals": ClassStatusProgress(),
+ "operators": ClassStatusProgress(),
+ "constructors": ClassStatusProgress(),
}
def __add__(self, other):
@@ -218,12 +233,12 @@ class ClassStatus:
output["description"] = ok_string if self.has_description else missing_string
description_progress = ClassStatusProgress(
- (self.has_brief_description + self.has_description) * overall_progress_description_weigth,
- 2 * overall_progress_description_weigth,
+ (self.has_brief_description + self.has_description) * overall_progress_description_weight,
+ 2 * overall_progress_description_weight,
)
items_progress = ClassStatusProgress()
- for k in ["methods", "constants", "members", "signals", "theme_items"]:
+ for k in ["methods", "constants", "members", "theme_items", "signals", "constructors", "operators"]:
items_progress += self.progresses[k]
output[k] = self.progresses[k].to_configured_colored_string()
@@ -260,7 +275,7 @@ class ClassStatus:
elif tag.tag == "description":
status.has_description = len(tag.text.strip()) > 0
- elif tag.tag in ["methods", "signals"]:
+ elif tag.tag in ["methods", "signals", "operators", "constructors"]:
for sub_tag in list(tag):
descr = sub_tag.find("description")
status.progresses[tag.tag].increment(len(descr.text.strip()) > 0)
@@ -272,9 +287,6 @@ class ClassStatus:
elif tag.tag in ["tutorials"]:
pass # Ignore those tags for now
- elif tag.tag in ["theme_items"]:
- pass # Ignore those tags, since they seem to lack description at all
-
else:
print(tag.tag, tag.attrib)
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 02c78eb2a8..bb0a2ed7c1 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -431,7 +431,11 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("interface/editor/hide_console_window", false);
_initial_set("interface/editor/mouse_extra_buttons_navigate_history", true);
_initial_set("interface/editor/save_each_scene_on_quit", true); // Regression
- EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/show_internal_errors_in_toast_notifications", 0, "Auto,Enabled,Disabled")
+#ifdef DEV_ENABLED
+ EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/show_internal_errors_in_toast_notifications", 0, "Auto (Enabled),Enabled,Disabled")
+#else
+ EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/show_internal_errors_in_toast_notifications", 0, "Auto (Disabled),Enabled,Disabled")
+#endif
// Inspector
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/inspector/max_array_dictionary_items_per_page", 20, "10,100,1")
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index 0d41ff025e..5a931ed839 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -6901,78 +6901,83 @@ Error GLTFDocument::append_from_buffer(PackedByteArray p_bytes, String p_base_pa
Error GLTFDocument::_parse_gltf_state(Ref<GLTFState> state, const String &p_search_path, float p_bake_fps) {
Error err;
- /* STEP 0 PARSE SCENE */
+
+ /* PARSE EXTENSIONS */
+ err = _parse_gltf_extensions(state);
+ ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
+
+ /* PARSE SCENE */
err = _parse_scenes(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 1 PARSE NODES */
+ /* PARSE NODES */
err = _parse_nodes(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 2 PARSE BUFFERS */
+ /* PARSE BUFFERS */
err = _parse_buffers(state, p_search_path);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 3 PARSE BUFFER VIEWS */
+ /* PARSE BUFFER VIEWS */
err = _parse_buffer_views(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 4 PARSE ACCESSORS */
+ /* PARSE ACCESSORS */
err = _parse_accessors(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 5 PARSE IMAGES */
+ /* PARSE IMAGES */
err = _parse_images(state, p_search_path);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 6 PARSE TEXTURES */
+ /* PARSE TEXTURES */
err = _parse_textures(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 7 PARSE TEXTURES */
+ /* PARSE TEXTURES */
err = _parse_materials(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 9 PARSE SKINS */
+ /* PARSE SKINS */
err = _parse_skins(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 10 DETERMINE SKELETONS */
+ /* DETERMINE SKELETONS */
err = _determine_skeletons(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 11 CREATE SKELETONS */
+ /* CREATE SKELETONS */
err = _create_skeletons(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 12 CREATE SKINS */
+ /* CREATE SKINS */
err = _create_skins(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 13 PARSE MESHES (we have enough info now) */
+ /* PARSE MESHES (we have enough info now) */
err = _parse_meshes(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 14 PARSE LIGHTS */
+ /* PARSE LIGHTS */
err = _parse_lights(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 15 PARSE CAMERAS */
+ /* PARSE CAMERAS */
err = _parse_cameras(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 16 PARSE ANIMATIONS */
+ /* PARSE ANIMATIONS */
err = _parse_animations(state);
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
- /* STEP 17 ASSIGN SCENE NAMES */
+ /* ASSIGN SCENE NAMES */
_assign_scene_names(state);
Node3D *root = memnew(Node3D);
@@ -6999,3 +7004,15 @@ Error GLTFDocument::append_from_file(String p_path, Ref<GLTFState> r_state, uint
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
return err;
}
+
+Error GLTFDocument::_parse_gltf_extensions(Ref<GLTFState> state) {
+ ERR_FAIL_NULL_V(state, ERR_PARSE_ERROR);
+ if (state->json.has("extensionsRequired") && state->json["extensionsRequired"].get_type() == Variant::ARRAY) {
+ Array extensions_required = state->json["extensionsRequired"];
+ if (extensions_required.find("KHR_draco_mesh_compression") != -1) {
+ ERR_PRINT("glTF2 extension KHR_draco_mesh_compression is not supported.");
+ return ERR_UNAVAILABLE;
+ }
+ }
+ return OK;
+}
diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h
index 8f8f5b410a..c0649e0129 100644
--- a/modules/gltf/gltf_document.h
+++ b/modules/gltf/gltf_document.h
@@ -392,6 +392,7 @@ public:
public:
Error _parse_gltf_state(Ref<GLTFState> state, const String &p_search_path, float p_bake_fps);
+ Error _parse_gltf_extensions(Ref<GLTFState> state);
void _process_mesh_instances(Ref<GLTFState> state, Node *scene_root);
void _generate_scene_node(Ref<GLTFState> state, Node *scene_parent,
Node3D *scene_root,
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index b0dc12d046..0cb3249c1d 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -1492,6 +1492,9 @@ bool ItemList::_set(const StringName &p_name, const Variant &p_value) {
} else if (components[1] == "disabled") {
set_item_disabled(item_index, p_value);
return true;
+ } else if (components[1] == "selectable") {
+ set_item_selectable(item_index, p_value);
+ return true;
}
}
#ifndef DISABLE_DEPRECATED
@@ -1528,6 +1531,9 @@ bool ItemList::_get(const StringName &p_name, Variant &r_ret) const {
} else if (components[1] == "disabled") {
r_ret = is_item_disabled(item_index);
return true;
+ } else if (components[1] == "selectable") {
+ r_ret = is_item_selectable(item_index);
+ return true;
}
}
return false;
@@ -1541,6 +1547,10 @@ void ItemList::_get_property_list(List<PropertyInfo> *p_list) const {
pi.usage &= ~(get_item_icon(i).is_null() ? PROPERTY_USAGE_STORAGE : 0);
p_list->push_back(pi);
+ pi = PropertyInfo(Variant::BOOL, vformat("item_%d/selectable", i));
+ pi.usage &= ~(is_item_selectable(i) ? PROPERTY_USAGE_STORAGE : 0);
+ p_list->push_back(pi);
+
pi = PropertyInfo(Variant::BOOL, vformat("item_%d/disabled", i));
pi.usage &= ~(!is_item_disabled(i) ? PROPERTY_USAGE_STORAGE : 0);
p_list->push_back(pi);
diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h
index e688ba9826..77e910870f 100644
--- a/scene/gui/item_list.h
+++ b/scene/gui/item_list.h
@@ -62,7 +62,7 @@ private:
String language;
TextDirection text_direction = TEXT_DIRECTION_AUTO;
- bool selectable = false;
+ bool selectable = true;
bool selected = false;
bool disabled = false;
bool tooltip_enabled = true;
diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp
index 5420f9c5a5..f7805136f9 100644
--- a/scene/gui/menu_button.cpp
+++ b/scene/gui/menu_button.cpp
@@ -184,7 +184,7 @@ void MenuButton::_get_property_list(List<PropertyInfo> *p_list) const {
pi.usage &= ~(!popup->is_item_checked(i) ? PROPERTY_USAGE_STORAGE : 0);
p_list->push_back(pi);
- pi = PropertyInfo(Variant::INT, vformat("popup/item_%d/id", i), PROPERTY_HINT_RANGE, "1,10,1,or_greater");
+ pi = PropertyInfo(Variant::INT, vformat("popup/item_%d/id", i), PROPERTY_HINT_RANGE, "0,10,1,or_greater");
p_list->push_back(pi);
pi = PropertyInfo(Variant::BOOL, vformat("popup/item_%d/disabled", i));
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index e47b7280b9..f4d45fe1fa 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -1275,7 +1275,15 @@ int PopupMenu::get_current_index() const {
void PopupMenu::set_item_count(int p_count) {
ERR_FAIL_COND(p_count < 0);
+ int prev_size = items.size();
items.resize(p_count);
+
+ if (prev_size < p_count) {
+ for (int i = prev_size; i < p_count; i++) {
+ items.write[i].id = i;
+ }
+ }
+
control->update();
child_controls_changed();
notify_property_list_changed();
@@ -1658,7 +1666,7 @@ void PopupMenu::_get_property_list(List<PropertyInfo> *p_list) const {
pi.usage &= ~(!is_item_checked(i) ? PROPERTY_USAGE_STORAGE : 0);
p_list->push_back(pi);
- pi = PropertyInfo(Variant::INT, vformat("item_%d/id", i), PROPERTY_HINT_RANGE, "1,10,1,or_greater");
+ pi = PropertyInfo(Variant::INT, vformat("item_%d/id", i), PROPERTY_HINT_RANGE, "0,10,1,or_greater");
p_list->push_back(pi);
pi = PropertyInfo(Variant::BOOL, vformat("item_%d/disabled", i));