You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Make EditorPropertyNameProcessor check EditorSettings validity
This commit is contained in:
@@ -36,6 +36,9 @@
|
|||||||
EditorPropertyNameProcessor *EditorPropertyNameProcessor::singleton = nullptr;
|
EditorPropertyNameProcessor *EditorPropertyNameProcessor::singleton = nullptr;
|
||||||
|
|
||||||
EditorPropertyNameProcessor::Style EditorPropertyNameProcessor::get_default_inspector_style() {
|
EditorPropertyNameProcessor::Style EditorPropertyNameProcessor::get_default_inspector_style() {
|
||||||
|
if (!EditorSettings::get_singleton()) {
|
||||||
|
return STYLE_CAPITALIZED;
|
||||||
|
}
|
||||||
const Style style = (Style)EDITOR_GET("interface/inspector/default_property_name_style").operator int();
|
const Style style = (Style)EDITOR_GET("interface/inspector/default_property_name_style").operator int();
|
||||||
if (style == STYLE_LOCALIZED && !is_localization_available()) {
|
if (style == STYLE_LOCALIZED && !is_localization_available()) {
|
||||||
return STYLE_CAPITALIZED;
|
return STYLE_CAPITALIZED;
|
||||||
@@ -44,6 +47,9 @@ EditorPropertyNameProcessor::Style EditorPropertyNameProcessor::get_default_insp
|
|||||||
}
|
}
|
||||||
|
|
||||||
EditorPropertyNameProcessor::Style EditorPropertyNameProcessor::get_settings_style() {
|
EditorPropertyNameProcessor::Style EditorPropertyNameProcessor::get_settings_style() {
|
||||||
|
if (!EditorSettings::get_singleton()) {
|
||||||
|
return STYLE_LOCALIZED;
|
||||||
|
}
|
||||||
const bool translate = EDITOR_GET("interface/editor/localize_settings");
|
const bool translate = EDITOR_GET("interface/editor/localize_settings");
|
||||||
return translate ? STYLE_LOCALIZED : STYLE_CAPITALIZED;
|
return translate ? STYLE_LOCALIZED : STYLE_CAPITALIZED;
|
||||||
}
|
}
|
||||||
@@ -53,6 +59,9 @@ EditorPropertyNameProcessor::Style EditorPropertyNameProcessor::get_tooltip_styl
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool EditorPropertyNameProcessor::is_localization_available() {
|
bool EditorPropertyNameProcessor::is_localization_available() {
|
||||||
|
if (!EditorSettings::get_singleton()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const Vector<String> forbidden = String("en").split(",");
|
const Vector<String> forbidden = String("en").split(",");
|
||||||
return forbidden.find(EDITOR_GET("interface/editor/editor_language")) == -1;
|
return forbidden.find(EDITOR_GET("interface/editor/editor_language")) == -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user