generated from ShadowBlip/OpenGamepadUI-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.gd
28 lines (20 loc) · 803 Bytes
/
plugin.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
extends Plugin
const Discord := preload("res://plugins/discord/core/discord_client.gd")
var discord: Discord = Discord.new()
var overlay_scene := load("res://plugins/discord/core/overlay.tscn") as PackedScene
var overlay := overlay_scene.instantiate()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
logger = Log.get_logger("Discord", Log.LEVEL.DEBUG)
logger.info("Discord plugin loaded")
logger.debug("Adding discord client node")
add_child(discord)
logger.debug("Opening connection to discord client")
discord.open.call_deferred()
# Add the overlay scene to the main scene
logger.debug("Adding overlay to interface")
add_overlay(overlay)
## Called when the plugin is unloaded
func unload() -> void:
overlay.queue_free()
discord.queue_free()