Disable multi-window buttons instead of hiding them when support is unavailable
This is more explicit as for why this functionality isn't available depending on editor settings and current platform. This also exposes a `EditorInterface.is_multi_window_enabled()` method so that editor plugins can easily query whether the editor is able and expected to create multiple windows.
This commit is contained in:
parent
17e7f85c06
commit
04a930d9a6
10 changed files with 81 additions and 30 deletions
|
|
@ -3711,6 +3711,10 @@ bool EditorNode::is_scene_open(const String &p_path) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool EditorNode::is_multi_window_enabled() const {
|
||||
return !SceneTree::get_singleton()->get_root()->is_embedding_subwindows() && !EDITOR_GET("interface/editor/single_window_mode") && EDITOR_GET("interface/multi_window/enable");
|
||||
}
|
||||
|
||||
void EditorNode::fix_dependencies(const String &p_for_file) {
|
||||
dependency_fixer->edit(p_for_file);
|
||||
}
|
||||
|
|
@ -4122,6 +4126,20 @@ void EditorNode::request_instantiate_scenes(const Vector<String> &p_files) {
|
|||
SceneTreeDock::get_singleton()->instantiate_scenes(p_files);
|
||||
}
|
||||
|
||||
String EditorNode::get_multiwindow_support_tooltip_text() const {
|
||||
if (SceneTree::get_singleton()->get_root()->is_embedding_subwindows()) {
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SUBWINDOWS)) {
|
||||
return TTR("Multi-window support is not available because the `--single-window` command line argument was used to start the editor.");
|
||||
} else {
|
||||
return TTR("Multi-window support is not available because the current platform doesn't support multiple windows.");
|
||||
}
|
||||
} else if (EDITOR_GET("interface/editor/single_window_mode")) {
|
||||
return TTR("Multi-window support is not available because Interface > Editor > Single Window Mode is enabled in the editor settings.");
|
||||
}
|
||||
|
||||
return TTR("Multi-window support is not available because Interface > Multi Window > Enable is disabled in the editor settings.");
|
||||
}
|
||||
|
||||
void EditorNode::_inherit_request(String p_file) {
|
||||
current_menu_option = FILE_NEW_INHERITED_SCENE;
|
||||
_dialog_action(p_file);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue