Skip to content

Commit

Permalink
fix: do not modify project.godot unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
univeous authored and Ark2000 committed Jul 16, 2023
1 parent b56ed2d commit 22ee80d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions addons/panku_console/plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ extends EditorPlugin

const SingletonName = "Panku"

#When enable this plugin, it will add a singleton to Autoload and an input action to Input Map.
#You may need to add a random input action to update Input Map UI.
#Maybe I'll work on this engine bug later, https://github.com/godotengine/godot/issues/25865
func _enter_tree():
#You may need to reload project to see the input action named `toggle_console` under input map after enabling plugin.
func _enable_plugin():
# Initialization of the plugin goes here.
add_autoload_singleton(SingletonName, "res://addons/panku_console/console.tscn")
var default_open_console_event = InputEventKey.new()
default_open_console_event.physical_keycode = KEY_QUOTELEFT
ProjectSettings.set_setting("input/toggle_console", {"deadzone":0.5,"events":[default_open_console_event]})
ProjectSettings.save()
print("Panku Console was initialized!")
print("Project page: https://github.com/Ark2000/PankuConsole")
print("Panku Console enabled.")

func _exit_tree():
func _disable_plugin():
# Clean-up of the plugin goes here.
remove_autoload_singleton(SingletonName)
ProjectSettings.clear("input/toggle_console")
ProjectSettings.save()
print("Panku Console was unloaded!")
print("Panku Console disabled.")

func _enter_tree():
print("Panku Console initialized! Project page: https://github.com/Ark2000/PankuConsole")

0 comments on commit 22ee80d

Please sign in to comment.