feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -30,14 +30,13 @@
|
|||
|
||||
#include "theme.h"
|
||||
|
||||
#include "core/string/print_string.h"
|
||||
#include "scene/theme/theme_db.h"
|
||||
|
||||
// Dynamic properties.
|
||||
bool Theme::_set(const StringName &p_name, const Variant &p_value) {
|
||||
String sname = p_name;
|
||||
|
||||
if (sname.contains("/")) {
|
||||
if (sname.contains_char('/')) {
|
||||
String type = sname.get_slicec('/', 1);
|
||||
String theme_type = sname.get_slicec('/', 0);
|
||||
String prop_name = sname.get_slicec('/', 2);
|
||||
|
|
@ -69,7 +68,7 @@ bool Theme::_set(const StringName &p_name, const Variant &p_value) {
|
|||
bool Theme::_get(const StringName &p_name, Variant &r_ret) const {
|
||||
String sname = p_name;
|
||||
|
||||
if (sname.contains("/")) {
|
||||
if (sname.contains_char('/')) {
|
||||
String type = sname.get_slicec('/', 1);
|
||||
String theme_type = sname.get_slicec('/', 0);
|
||||
String prop_name = sname.get_slicec('/', 2);
|
||||
|
|
@ -514,6 +513,10 @@ bool Theme::has_font(const StringName &p_name, const StringName &p_theme_type) c
|
|||
return ((font_map.has(p_theme_type) && font_map[p_theme_type].has(p_name) && font_map[p_theme_type][p_name].is_valid()) || has_default_font());
|
||||
}
|
||||
|
||||
bool Theme::has_font_no_default(const StringName &p_name, const StringName &p_theme_type) const {
|
||||
return (font_map.has(p_theme_type) && font_map[p_theme_type].has(p_name) && font_map[p_theme_type][p_name].is_valid());
|
||||
}
|
||||
|
||||
bool Theme::has_font_nocheck(const StringName &p_name, const StringName &p_theme_type) const {
|
||||
return (font_map.has(p_theme_type) && font_map[p_theme_type].has(p_name));
|
||||
}
|
||||
|
|
@ -617,6 +620,10 @@ bool Theme::has_font_size(const StringName &p_name, const StringName &p_theme_ty
|
|||
return ((font_size_map.has(p_theme_type) && font_size_map[p_theme_type].has(p_name) && (font_size_map[p_theme_type][p_name] > 0)) || has_default_font_size());
|
||||
}
|
||||
|
||||
bool Theme::has_font_size_no_default(const StringName &p_name, const StringName &p_theme_type) const {
|
||||
return (font_size_map.has(p_theme_type) && font_size_map[p_theme_type].has(p_name) && (font_size_map[p_theme_type][p_name] > 0));
|
||||
}
|
||||
|
||||
bool Theme::has_font_size_nocheck(const StringName &p_name, const StringName &p_theme_type) const {
|
||||
return (font_size_map.has(p_theme_type) && font_size_map[p_theme_type].has(p_name));
|
||||
}
|
||||
|
|
@ -924,9 +931,17 @@ bool Theme::has_theme_item(DataType p_data_type, const StringName &p_name, const
|
|||
case DATA_TYPE_CONSTANT:
|
||||
return has_constant(p_name, p_theme_type);
|
||||
case DATA_TYPE_FONT:
|
||||
return has_font(p_name, p_theme_type);
|
||||
if (!variation_map.has(p_theme_type)) {
|
||||
return has_font(p_name, p_theme_type);
|
||||
} else {
|
||||
return has_font_no_default(p_name, p_theme_type);
|
||||
}
|
||||
case DATA_TYPE_FONT_SIZE:
|
||||
return has_font_size(p_name, p_theme_type);
|
||||
if (!variation_map.has(p_theme_type)) {
|
||||
return has_font_size(p_name, p_theme_type);
|
||||
} else {
|
||||
return has_font_size_no_default(p_name, p_theme_type);
|
||||
}
|
||||
case DATA_TYPE_ICON:
|
||||
return has_icon(p_name, p_theme_type);
|
||||
case DATA_TYPE_STYLEBOX:
|
||||
|
|
@ -1113,8 +1128,8 @@ void Theme::get_theme_item_type_list(DataType p_data_type, List<StringName> *p_l
|
|||
void Theme::set_type_variation(const StringName &p_theme_type, const StringName &p_base_type) {
|
||||
ERR_FAIL_COND_MSG(!is_valid_type_name(p_theme_type), vformat("Invalid type name: '%s'", p_theme_type));
|
||||
ERR_FAIL_COND_MSG(!is_valid_type_name(p_base_type), vformat("Invalid type name: '%s'", p_base_type));
|
||||
ERR_FAIL_COND_MSG(p_theme_type == StringName(), "An empty theme type cannot be marked as a variation of another type.");
|
||||
ERR_FAIL_COND_MSG(ClassDB::class_exists(p_theme_type), "A type associated with a built-in class cannot be marked as a variation of another type.");
|
||||
ERR_FAIL_COND_MSG(p_theme_type == StringName(), vformat("An empty theme type cannot be marked as a variation of another type (\"%s\").", p_base_type));
|
||||
ERR_FAIL_COND_MSG(ClassDB::class_exists(p_theme_type), vformat("A type associated with a built-in class cannot be marked as a variation of another type (variation: \"%s\", base: \"%s\").", p_theme_type, p_base_type));
|
||||
ERR_FAIL_COND_MSG(p_base_type == StringName(), "An empty theme type cannot be the base type of a variation. Use clear_type_variation() instead if you want to unmark '" + String(p_theme_type) + "' as a variation.");
|
||||
|
||||
if (variation_map.has(p_theme_type)) {
|
||||
|
|
@ -1250,14 +1265,12 @@ void Theme::get_type_list(List<StringName> *p_list) const {
|
|||
}
|
||||
}
|
||||
|
||||
void Theme::get_type_dependencies(const StringName &p_base_type, const StringName &p_type_variation, List<StringName> *p_list) {
|
||||
ERR_FAIL_NULL(p_list);
|
||||
|
||||
void Theme::get_type_dependencies(const StringName &p_base_type, const StringName &p_type_variation, Vector<StringName> &r_result) {
|
||||
// Build the dependency chain for type variations.
|
||||
if (p_type_variation != StringName()) {
|
||||
StringName variation_name = p_type_variation;
|
||||
while (variation_name != StringName()) {
|
||||
p_list->push_back(variation_name);
|
||||
r_result.push_back(variation_name);
|
||||
variation_name = get_type_variation_base(variation_name);
|
||||
|
||||
// If we have reached the base type dependency, it's safe to stop (assuming no funny business was done to the Theme).
|
||||
|
|
@ -1268,7 +1281,7 @@ void Theme::get_type_dependencies(const StringName &p_base_type, const StringNam
|
|||
}
|
||||
|
||||
// Continue building the chain using native class hierarchy.
|
||||
ThemeDB::get_singleton()->get_native_type_dependencies(p_base_type, p_list);
|
||||
ThemeDB::get_singleton()->get_native_type_dependencies(p_base_type, r_result);
|
||||
}
|
||||
|
||||
// Internal methods for getting lists as a Vector of String (compatible with public API).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue