Skip to content

Commit

Permalink
feat(setup): add programmatic autoload in PlayFabEditor plugin script (
Browse files Browse the repository at this point in the history
  • Loading branch information
OctoD authored and Structed committed Jul 30, 2023
1 parent 0607613 commit d34d7fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 4 additions & 0 deletions addons/godot-playfab/PlayFabEditor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ func _init():


func _enter_tree():
add_autoload_singleton("PlayFabManager", "res://addons/godot-playfab/PlayFabManager.gd")

main_panel_instance = MainPanel.instantiate()
# Add the main panel to the editor's main viewport.
get_editor_interface().get_editor_main_screen().add_child(main_panel_instance)
Expand All @@ -22,6 +24,8 @@ func _enter_tree():


func _exit_tree():
remove_autoload_singleton("PlayFabManager")

if main_panel_instance:
main_panel_instance.queue_free()

Expand Down
5 changes: 0 additions & 5 deletions docs/user/initial-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ If you close and re-open Project Settings, the General tab will now have a "Play
> * Last, click the `Add` button
> After you added the setting, you can set the Title ID as described above.
## Adding the `PlayFabManager` singleton AutoLoad
In the "Autoload" tab of your project's Project Settings, add `res://addons/godot-playfab/PlayFabManager.gd` as an autoload path. Its Node Name should automatically be filled in as `PlayFabManager` (you should manually enter that if it does not auto-fill).
> godot-playfab relies on the exact name `PlayFabManager`!

# Configuration
On autoload of the `PlayFabManager`, an encrypted `PlayFab Client Config` file will be created in `user://playfab_client_config.tres`.
See the [File paths in Godot projects documentation](https://docs.godotengine.org/en/stable/tutorials/io/data_paths.html).
Expand Down

0 comments on commit d34d7fe

Please sign in to comment.