You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Editor: Display deprecated/experimental messages in tooltips
This commit is contained in:
@@ -593,6 +593,10 @@ void EditorBuildProfileManager::_action_confirm() {
|
||||
}
|
||||
}
|
||||
|
||||
void EditorBuildProfileManager::_hide_requested() {
|
||||
_cancel_pressed(); // From AcceptDialog.
|
||||
}
|
||||
|
||||
void EditorBuildProfileManager::_fill_classes_from(TreeItem *p_parent, const String &p_class, const String &p_selected) {
|
||||
TreeItem *class_item = class_list->create_item(p_parent);
|
||||
class_item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
|
||||
@@ -646,21 +650,10 @@ void EditorBuildProfileManager::_class_list_item_selected() {
|
||||
|
||||
Variant md = item->get_metadata(0);
|
||||
if (md.get_type() == Variant::STRING || md.get_type() == Variant::STRING_NAME) {
|
||||
String text = description_bit->get_class_description(md);
|
||||
if (!text.is_empty()) {
|
||||
// Display both class name and description, since the help bit may be displayed
|
||||
// far away from the location (especially if the dialog was resized to be taller).
|
||||
description_bit->set_text(vformat("[b]%s[/b]: %s", md, text));
|
||||
description_bit->get_rich_text()->set_self_modulate(Color(1, 1, 1, 1));
|
||||
} else {
|
||||
// Use nested `vformat()` as translators shouldn't interfere with BBCode tags.
|
||||
description_bit->set_text(vformat(TTR("No description available for %s."), vformat("[b]%s[/b]", md)));
|
||||
description_bit->get_rich_text()->set_self_modulate(Color(1, 1, 1, 0.5));
|
||||
}
|
||||
description_bit->parse_symbol("class|" + md.operator String() + "|");
|
||||
} else if (md.get_type() == Variant::INT) {
|
||||
String build_option_description = EditorBuildProfile::get_build_option_description(EditorBuildProfile::BuildOption((int)md));
|
||||
description_bit->set_text(vformat("[b]%s[/b]: %s", TTR(item->get_text(0)), TTRGET(build_option_description)));
|
||||
description_bit->get_rich_text()->set_self_modulate(Color(1, 1, 1, 1));
|
||||
description_bit->set_custom_text(TTR(item->get_text(0)), String(), TTRGET(build_option_description));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -864,7 +857,8 @@ EditorBuildProfileManager::EditorBuildProfileManager() {
|
||||
main_vbc->add_margin_child(TTR("Configure Engine Compilation Profile:"), class_list, true);
|
||||
|
||||
description_bit = memnew(EditorHelpBit);
|
||||
description_bit->set_custom_minimum_size(Size2(0, 80) * EDSCALE);
|
||||
description_bit->set_content_height_limits(80 * EDSCALE, 80 * EDSCALE);
|
||||
description_bit->connect("request_hide", callable_mp(this, &EditorBuildProfileManager::_hide_requested));
|
||||
main_vbc->add_margin_child(TTR("Description:"), description_bit, false);
|
||||
|
||||
confirm_dialog = memnew(ConfirmationDialog);
|
||||
|
||||
Reference in New Issue
Block a user