Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define fake "singleton" structure for plugin #142

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/constants.gd
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Plugin constants

const NAME = &"Blockflow"
const PLUGIN_NAME = &"BlockflowPlugin"

const COMMAND_FOLDER = &"res://addons/blockflow/commands"

Expand Down
6 changes: 5 additions & 1 deletion core/plugin_script.gd
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func _has_main_screen() -> bool:


func _get_plugin_name() -> String:
return "Blockflow"
return Constants.NAME

func _get_plugin_icon():
return theme.get_icon("plugin_icon_flat", "PluginIcons")
Expand Down Expand Up @@ -166,3 +166,7 @@ func _init() -> void:
project_settings_changed.connect(_project_settings_changed)

debugger = BlockflowDebugger.new()

# Add the plugin to the list when we're created as soon as possible.
# Existing doesn't mean that plugin is ready, be careful with that.
Engine.set_meta(Constants.PLUGIN_NAME, self)