fixed a lot of bugs but broke linux support

This commit is contained in:
2023-12-07 18:32:04 +01:00
parent 6fd58b0ddf
commit 1f2dac7a0e
13 changed files with 37 additions and 90 deletions

View File

@@ -1,13 +1,12 @@
## [color=yellow]PLEASE IGNORE![/color] This is a important Node wich gets automatically added as Singleton.
## This is a GDscript Node wich gets automatically added as Autoload while installing the addon.
##
## The DiscordSDKLoader Node automatically gets added as Singleton while installing the addon.
## It has to run in the background to comunicate with Discord.
## You don't need to use it.
## It can run in the background to comunicate with Discord.
## You don't need to use it unless you are using EditorPresence. If you remove it make sure to run [code]discord_sdk.run_callbacks()[/code] in a [code]_process[/code] function.
##
## @tutorial: https://github.com/vaporvee/discord-sdk-godot/wiki
@tool
class_name core_updater
extends Node
class_name DiscordSDKLoaderAutoload
func _process(_delta):
if(ProjectSettings.get_setting("DiscordSDK/EditorPresence/enabled") && Engine.is_editor_hint()):
@@ -20,4 +19,4 @@ func _process(_delta):
discord_sdk.start_timestamp = int(Time.get_unix_time_from_system())
discord_sdk.refresh()
if(discord_sdk.app_id == 1108142249990176808 || !Engine.is_editor_hint()):
discord_sdk.coreupdate()
discord_sdk.run_callbacks()

View File

@@ -13,15 +13,16 @@ func _enter_tree() -> void:
ProjectSettings.set_setting("DiscordSDK/EditorPresence/enabled",false)
ProjectSettings.set_as_basic("DiscordSDK/EditorPresence/enabled",true)
ProjectSettings.set_initial_value("DiscordSDK/EditorPresence/enabled",false)
get_node("/root/").add_child(DiscordLoader.new())
func _enable_plugin() -> void:
add_autoload_singleton("DiscordSDKAutoload","res://addons/discord-sdk-gd/nodes/discord_autoload.gd")
if FileAccess.file_exists(ProjectSettings.globalize_path("res://") + "addons/discord-sdk-gd/bin/.gdignore"):
DirAccess.remove_absolute(ProjectSettings.globalize_path("res://") + "addons/discord-sdk-gd/bin/.gdignore")
if FileAccess.file_exists(ProjectSettings.globalize_path("res://") + "addons/discord-sdk-gd/nodes/.gdignore"):
DirAccess.remove_absolute(ProjectSettings.globalize_path("res://") + "addons/discord-sdk-gd/nodes/.gdignore")
func _disable_plugin() -> void:
remove_autoload_singleton("DiscordSDKAutoload")
FileAccess.open("res://addons/discord-sdk-gd/bin/.gdignore",FileAccess.WRITE)
FileAccess.open("res://addons/discord-sdk-gd/nodes/.gdignore",FileAccess.WRITE)
remove_custom_type("DiscordSDKDebug")