added addon as plugin to simplefy gdscript user code

This commit is contained in:
Yannik
2023-04-20 11:43:28 +02:00
parent 4701514f3b
commit d867881678
9 changed files with 41 additions and 6 deletions

View File

@@ -0,0 +1,11 @@
extends Node
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
DiscordSDK.update()

View File

@@ -0,0 +1,7 @@
[plugin]
name="DiscordRPC"
description="Takes the activity manager part from the discord-game-sdk and adds GDscript functionality."
author="vaporvee"
version="0.1"
script="plugin.gd"

View File

@@ -0,0 +1,8 @@
@tool
extends EditorPlugin
func _enter_tree():
add_autoload_singleton("Discord", "res://addons/discord-rpc-gd/loadaddon.gd")
func disable_plugin():
remove_autoload_singleton("Discord")

View File

@@ -4,6 +4,3 @@ extends Node
# Called when the node enters the scene tree for the first time.
func _ready():
DiscordSDK.debug()
func _process(_delta):
DiscordSDK.updatedebug()

View File

@@ -17,10 +17,18 @@ boot_splash/bg_color=Color(0.341176, 0.415686, 0.929412, 1)
boot_splash/image="res://assets/Logo_V2.png"
config/icon="res://assets/Logo_V2.png"
[autoload]
Discord="*res://addons/discord-rpc-gd/loadaddon.gd"
[dotnet]
project/assembly_name="GDExtension Test Project"
[editor_plugins]
enabled=PackedStringArray("res://addons/discord-rpc-gd/plugin.cfg")
[native_extensions]
paths=["res://example.gdextension"]