Skip to content

Commit

Permalink
Merge pull request #7 from Xrayez/reload-icon-simplify
Browse files Browse the repository at this point in the history
Simplify the way reload icon is set from current theme
  • Loading branch information
willnationsdev authored Aug 1, 2019
2 parents 2f8e221 + 5e7ed77 commit 25638ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
4 changes: 1 addition & 3 deletions addons/godot-plugin-refresher/plugin_refresher.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ signal confirm_refresh_plugin(p_name)
onready var options = $OptionButton

func _ready():
$RefreshButton.icon = get_icon('Reload', 'EditorIcons')
reload_items()

func reload_items():
Expand Down Expand Up @@ -37,9 +38,6 @@ func select_plugin(p_name):
options.selected = options.get_item_id(idx)
break

func set_refresh_button_icon(p_icon):
$RefreshButton.icon = p_icon

func _on_RefreshButton_pressed():
if options.selected == -1:
return # nothing selected
Expand Down
10 changes: 1 addition & 9 deletions addons/godot-plugin-refresher/plugin_refresher_plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,8 @@ func _enter_tree():
refresher = PluginRefresherScn.instance()
add_control_to_container(CONTAINER_TOOLBAR, refresher)

var eds = get_editor_interface()

# Set reload icon from Godot's own theme
var godot_editor = eds.get_base_control()
var reload_icon = godot_editor.theme.get_icon('Reload', 'EditorIcons')
assert(reload_icon != null)
refresher.set_refresh_button_icon(reload_icon)

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

refresher.connect("request_refresh_plugin", self, "_on_request_refresh_plugin")
Expand Down

0 comments on commit 25638ab

Please sign in to comment.