Skip to content

Commit

Permalink
Revert use of EditorInterface for 4.0 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
willnationsdev committed Dec 9, 2024
1 parent e5007ae commit fa2b2f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion addons/godot-plugin-refresher/plugin_refresher.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ signal confirm_refresh_plugin(p_name: String)
func _ready() -> void:
if get_tree().edited_scene_root == self:
return # This is the scene opened in the editor!
$RefreshButton.icon = EditorInterface.get_editor_theme().get_icon("Reload", "EditorIcons")
$RefreshButton.icon = get_editor_interface().get_editor_theme().get_icon("Reload", "EditorIcons")


func update_items(p_plugins_info: Array) -> void:
Expand Down
12 changes: 6 additions & 6 deletions addons/godot-plugin-refresher/plugin_refresher_plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func _enter_tree() -> void:
add_control_to_container(CONTAINER_TOOLBAR, refresher)

# Watch whether any plugin is changed, added or removed on the filesystem
var efs := EditorInterface.get_resource_filesystem()
var efs := get_editor_interface().get_resource_filesystem()
efs.filesystem_changed.connect(_on_filesystem_changed)

refresher.request_refresh_plugin.connect(_on_request_refresh_plugin)
Expand Down Expand Up @@ -100,7 +100,7 @@ func _save_settings() -> void:


func get_settings_path() -> String:
var editor_paths := EditorInterface.get_editor_paths()
var editor_paths := get_editor_interface().get_editor_paths()
var dir := editor_paths.get_project_settings_dir()

var home := dir.path_join(PLUGIN_CONFIG_DIR)
Expand Down Expand Up @@ -128,7 +128,7 @@ func get_recent_plugin() -> String:
func _on_request_refresh_plugin(p_path: String) -> void:
assert(not p_path.is_empty())

var disabled := not EditorInterface.is_plugin_enabled(p_path)
var disabled := not get_editor_interface().is_plugin_enabled(p_path)
if disabled:
refresher.show_warning(p_path)
else:
Expand All @@ -146,11 +146,11 @@ func get_plugin_path() -> String:
func refresh_plugin(p_path: String) -> void:
print("Refreshing plugin: ", p_path)

var enabled := EditorInterface.is_plugin_enabled(p_path)
var enabled := get_editor_interface().is_plugin_enabled(p_path)
if enabled: # can only disable an active plugin
EditorInterface.set_plugin_enabled(p_path, false)
get_editor_interface().set_plugin_enabled(p_path, false)

EditorInterface.set_plugin_enabled(p_path, true)
get_editor_interface().set_plugin_enabled(p_path, true)

plugin_config.set_value(SETTINGS, SETTING_RECENT, p_path)
_save_settings()

0 comments on commit fa2b2f8

Please sign in to comment.