summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-05 19:00:45 +0200
committerGitHub <noreply@github.com>2021-04-05 19:00:45 +0200
commitf4b82814f89d992bc0119245590737ae361a0358 (patch)
treec366d4d1963ba3dc6c3f1c554ba236272a41367e /editor
parent3d84fa85b49b604b189bf6d918759060a4a02dc9 (diff)
parentea31af68ba4aa5f15ef0dab9555f80d8efdfe6c7 (diff)
Merge pull request #47622 from pycbouh/editor-plugins-expose-scale
Expose editor scale to the plugin API
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_plugin.cpp5
-rw-r--r--editor/editor_plugin.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index c0cecbc651..064271fce8 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -262,6 +262,10 @@ Control *EditorInterface::get_base_control() {
return EditorNode::get_singleton()->get_gui_base();
}
+float EditorInterface::get_editor_scale() const {
+ return EDSCALE;
+}
+
void EditorInterface::set_plugin_enabled(const String &p_plugin, bool p_enabled) {
EditorNode::get_singleton()->set_addon_plugin_enabled(p_plugin, p_enabled, true);
}
@@ -306,6 +310,7 @@ void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_editor_settings"), &EditorInterface::get_editor_settings);
ClassDB::bind_method(D_METHOD("get_script_editor"), &EditorInterface::get_script_editor);
ClassDB::bind_method(D_METHOD("get_base_control"), &EditorInterface::get_base_control);
+ ClassDB::bind_method(D_METHOD("get_editor_scale"), &EditorInterface::get_editor_scale);
ClassDB::bind_method(D_METHOD("edit_resource", "resource"), &EditorInterface::edit_resource);
ClassDB::bind_method(D_METHOD("open_scene_from_path", "scene_filepath"), &EditorInterface::open_scene_from_path);
ClassDB::bind_method(D_METHOD("reload_scene_from_path", "scene_filepath"), &EditorInterface::reload_scene_from_path);
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index ae9fcfb28a..b0713c641b 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -100,6 +100,7 @@ public:
FileSystemDock *get_file_system_dock();
Control *get_base_control();
+ float get_editor_scale() const;
void set_plugin_enabled(const String &p_plugin, bool p_enabled);
bool is_plugin_enabled(const String &p_plugin) const;