You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
BaseButton: Add identifier for shortcut in tooltip
This commit is contained in:
@@ -418,8 +418,13 @@ void BaseButton::_unhandled_input(InputEvent p_event) {
|
||||
String BaseButton::get_tooltip(const Point2& p_pos) const {
|
||||
|
||||
String tooltip=Control::get_tooltip(p_pos);
|
||||
if (shortcut.is_valid() && shortcut->is_valid())
|
||||
tooltip+=" ("+shortcut->get_as_text()+")";
|
||||
if (shortcut.is_valid() && shortcut->is_valid()) {
|
||||
if (tooltip.find("$sc")!=-1) {
|
||||
tooltip=tooltip.replace_first("$sc","("+shortcut->get_as_text()+")");
|
||||
} else {
|
||||
tooltip+=" ("+shortcut->get_as_text()+")";
|
||||
}
|
||||
}
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user