diff --git a/SConstruct b/SConstruct index e3d1976..ebc824b 100644 --- a/SConstruct +++ b/SConstruct @@ -1,10 +1,8 @@ #!python import os -# Gets the standard flags CC, CCX, etc. env = SConscript("src/lib/godot-cpp/SConstruct") -# Check our platform specifics if env["platform"] == "macos": discord_library = "libdiscord_game_sdk.dylib" discord_library_second = "libdiscord_game_sdk_aarch64.dylib" @@ -25,19 +23,16 @@ if env["target"] == "template_debug": else: debugsuffix = "" -# make sure our binding library is properly includes env.Append(LIBPATH=["src/lib/discord_game_sdk/bin/"]) sources = Glob("src/lib/discord_game_sdk/cpp/*.cpp") -env.Append( - CPPPATH=["src/lib/discord_game_sdk/cpp/"] -) # this line for some reason doesn't get understanded by most linux distros +env.Append(CPPPATH=["src/lib/discord_game_sdk/cpp/"]) env.Append(LIBS=["discord_game_sdk"]) -# tweak this if you want to use different folders, or more folders, to store your source code in. env.Append(CPPPATH=["src/"]) sources += Glob("src/*.cpp") -# The finished exports +env.Append(CPPDEFINES=["HOT_RELOAD_ENABLED"]) + library = env.SharedLibrary( target="project/addons/discord-sdk-gd/bin/" + libexportfolder diff --git a/project/addons/discord-sdk-gd/READ_ME_PLEASE.txt b/project/addons/discord-sdk-gd/READ_ME_PLEASE.txt new file mode 100644 index 0000000..b532cfb --- /dev/null +++ b/project/addons/discord-sdk-gd/READ_ME_PLEASE.txt @@ -0,0 +1,5 @@ +PLEASE ACTIVATE THE PLUGIN UNDER Project -> Project Settings... -> Plugins -> DiscordSDK -> Status +IGNORE THE RED ERRORS ON THE FIRST 2 RESTARTS +READ THE TUTORIAL LINKED IN THE WINDOW THAT WILL OPEN ON PLUGIN ENABLE + +If nothing works, enable the plugin and delete /addons/discord-sdk-gd/bin/.gdignore diff --git a/project/addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension b/project/addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension index 03bf48e..829d65b 100644 --- a/project/addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension +++ b/project/addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension @@ -2,6 +2,7 @@ entry_symbol = "discordsdkgd_library_init" compatibility_minimum = 4.2 +reloadable = true [libraries] diff --git a/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding.dll b/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding.dll index bf4b3d0..366b47d 100644 Binary files a/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding.dll and b/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding.dll differ diff --git a/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding_debug.dll b/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding_debug.dll index 616923c..42aff01 100644 Binary files a/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding_debug.dll and b/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding_debug.dll differ diff --git a/project/addons/discord-sdk-gd/bin/windows/~discord_game_sdk_binding_debug.dll b/project/addons/discord-sdk-gd/bin/windows/~discord_game_sdk_binding_debug.dll index 0345fad..42aff01 100644 Binary files a/project/addons/discord-sdk-gd/bin/windows/~discord_game_sdk_binding_debug.dll and b/project/addons/discord-sdk-gd/bin/windows/~discord_game_sdk_binding_debug.dll differ diff --git a/project/addons/discord-sdk-gd/logo.png b/project/addons/discord-sdk-gd/logo.png new file mode 100644 index 0000000..fb6c700 Binary files /dev/null and b/project/addons/discord-sdk-gd/logo.png differ diff --git a/project/addons/discord-sdk-gd/logo.png.import b/project/addons/discord-sdk-gd/logo.png.import new file mode 100644 index 0000000..a6947aa --- /dev/null +++ b/project/addons/discord-sdk-gd/logo.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://csl0e2px0cwc1" +path="res://.godot/imported/logo.png-b59b4861dc0c64616d78af30082b08b5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/discord-sdk-gd/logo.png" +dest_files=["res://.godot/imported/logo.png-b59b4861dc0c64616d78af30082b08b5.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/project/addons/discord-sdk-gd/nodes/Debug.tscn b/project/addons/discord-sdk-gd/nodes/Debug.tscn index f4474f2..b661770 100644 --- a/project/addons/discord-sdk-gd/nodes/Debug.tscn +++ b/project/addons/discord-sdk-gd/nodes/Debug.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=9 format=3 uid="uid://c1slhdnlsv2qt"] -[ext_resource type="Texture2D" uid="uid://dnfq6kug4x6o2" path="res://addons/discord-sdk-gd/nodes/assets/Checked.svg" id="2_q6tao"] -[ext_resource type="Texture2D" uid="uid://compmm3kviqqe" path="res://addons/discord-sdk-gd/nodes/assets/Unchecked.svg" id="3_5cyem"] -[ext_resource type="Texture2D" uid="uid://dtc6ckladq0td" path="res://addons/discord-sdk-gd/nodes/assets/circle.svg" id="3_goflf"] +[ext_resource type="Texture2D" path="res://addons/discord-sdk-gd/nodes/assets/Checked.svg" id="2_q6tao"] +[ext_resource type="Texture2D" path="res://addons/discord-sdk-gd/nodes/assets/Unchecked.svg" id="3_5cyem"] +[ext_resource type="Texture2D" path="res://addons/discord-sdk-gd/nodes/assets/circle.svg" id="3_goflf"] [sub_resource type="GDScript" id="GDScript_ak1tp"] resource_name = "Debug" diff --git a/project/addons/discord-sdk-gd/nodes/discord_autoload.gd b/project/addons/discord-sdk-gd/nodes/discord_autoload.gd index 3852777..8571302 100644 --- a/project/addons/discord-sdk-gd/nodes/discord_autoload.gd +++ b/project/addons/discord-sdk-gd/nodes/discord_autoload.gd @@ -8,15 +8,16 @@ extends Node class_name DiscordSDKLoaderAutoload -func _process(_delta): - if(ProjectSettings.get_setting("DiscordSDK/EditorPresence/enabled") && Engine.is_editor_hint()): - if(discord_sdk.app_id != 1108142249990176808): - discord_sdk.app_id = 1108142249990176808 - discord_sdk.details = ProjectSettings.get_setting("application/config/name") - discord_sdk.state = "Editing: \""+ str(get_tree().edited_scene_root.scene_file_path).replace("res://","") +"\"" - discord_sdk.large_image = "godot" - discord_sdk.large_image_text = str(Engine.get_version_info().string) - 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.run_callbacks() +func _process(_delta) -> void: + if GDExtensionManager.get_loaded_extensions().has("res://addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension"): + if ProjectSettings.get_setting("DiscordSDK/EditorPresence/enabled",false) && Engine.is_editor_hint(): + if discord_sdk.app_id != 1108142249990176808: + discord_sdk.app_id = 1108142249990176808 + discord_sdk.details = ProjectSettings.get_setting("application/config/name") + discord_sdk.state = "Editing: \""+ str(get_tree().edited_scene_root.scene_file_path).replace("res://","") +"\"" + discord_sdk.large_image = "godot" + discord_sdk.large_image_text = str(Engine.get_version_info().string) + 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.run_callbacks() diff --git a/project/addons/discord-sdk-gd/plugin.gd b/project/addons/discord-sdk-gd/plugin.gd index f086bbc..987df07 100644 --- a/project/addons/discord-sdk-gd/plugin.gd +++ b/project/addons/discord-sdk-gd/plugin.gd @@ -4,9 +4,7 @@ extends EditorPlugin const DiscordSDKDebug = preload("res://addons/discord-sdk-gd/nodes/debug.gd") const DiscordSDKDebug_icon = preload("res://addons/discord-sdk-gd/Debug.svg") var loaded_DiscordSDKDebug = DiscordSDKDebug.new() -var restart_window: Control = preload("res://addons/discord-sdk-gd/restart_window.tscn").instantiate() - - +var restart_window: ConfirmationDialog = preload("res://addons/discord-sdk-gd/restart_window.tscn").instantiate() func _enter_tree() -> void: add_custom_type("DiscordSDKDebug","Node",DiscordSDKDebug,DiscordSDKDebug_icon) @@ -15,15 +13,26 @@ func _enter_tree() -> void: ProjectSettings.set_initial_value("DiscordSDK/EditorPresence/enabled",false) 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") + add_autoload_singleton("DiscordSDKAutoload","res://addons/discord-sdk-gd/nodes/discord_autoload.gd") + restart_window.connect("confirmed", save_no_restart) + restart_window.connect("canceled", save_and_restart) + EditorInterface.popup_dialog_centered(restart_window) func _disable_plugin() -> void: + GDExtensionManager.unload_extension("res://addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension") 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") ProjectSettings.clear("DiscordSDK/EditorPresence/enabled") + +func save_and_restart() -> void: + EditorInterface.save_all_scenes() + EditorInterface.restart_editor(true) + +func save_no_restart() -> void: + EditorInterface.restart_editor(false) diff --git a/project/addons/discord-sdk-gd/restart_window.tscn b/project/addons/discord-sdk-gd/restart_window.tscn index fa51a4d..6551884 100644 --- a/project/addons/discord-sdk-gd/restart_window.tscn +++ b/project/addons/discord-sdk-gd/restart_window.tscn @@ -1,15 +1,31 @@ -[gd_scene load_steps=8 format=3 uid="uid://byc4c6d5tpomq"] +[gd_scene load_steps=9 format=3 uid="uid://byc4c6d5tpomq"] -[ext_resource type="Texture2D" uid="uid://csl0e2px0cwc1" path="res://addons/discord-sdk-gd/Logo_V2_No_Bg.png" id="1_f828l"] +[ext_resource type="Texture2D" uid="uid://csl0e2px0cwc1" path="res://addons/discord-sdk-gd/Logo_V2_No_Bg.png" id="1_0svbg"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1t7mm"] [sub_resource type="Theme" id="Theme_swwco"] Button/styles/focus = SubResource("StyleBoxEmpty_1t7mm") +[sub_resource type="GDScript" id="GDScript_7v43l"] +resource_name = "RestartWindow" +script/source = "extends ConfirmationDialog + + +func _ready(): + canceled.connect(_on_canceled) + confirmed.connect(_on_confirmed) + +func _on_canceled(): + EditorInterface.restart_editor(false) + +func _on_confirmed(): + EditorInterface.restart_editor(true) +" + [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5vqdt"] -[sub_resource type="Image" id="Image_inmd8"] +[sub_resource type="Image" id="Image_241ci"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 227, 227, 227, 36, 224, 224, 224, 168, 224, 224, 224, 233, 224, 224, 224, 236, 224, 224, 224, 170, 231, 231, 231, 31, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 227, 227, 227, 36, 224, 224, 224, 234, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 239, 230, 230, 230, 30, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 168, 224, 224, 224, 255, 224, 224, 224, 186, 224, 224, 224, 32, 224, 224, 224, 33, 224, 224, 224, 187, 224, 224, 224, 255, 225, 225, 225, 167, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 237, 224, 224, 224, 255, 224, 224, 224, 33, 255, 255, 255, 0, 255, 255, 255, 0, 227, 227, 227, 36, 224, 224, 224, 255, 224, 224, 224, 234, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 237, 224, 224, 224, 255, 224, 224, 224, 33, 255, 255, 255, 0, 255, 255, 255, 0, 229, 229, 229, 38, 224, 224, 224, 255, 224, 224, 224, 229, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 164, 224, 224, 224, 255, 224, 224, 224, 187, 225, 225, 225, 34, 227, 227, 227, 36, 224, 224, 224, 192, 224, 224, 224, 255, 224, 224, 224, 162, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 24, 225, 225, 225, 215, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 229, 224, 224, 224, 32, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 24, 224, 224, 224, 216, 224, 224, 224, 255, 224, 224, 224, 210, 224, 224, 224, 161, 224, 224, 224, 232, 224, 224, 224, 231, 225, 225, 225, 159, 230, 230, 230, 30, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 107, 224, 224, 224, 255, 224, 224, 224, 210, 230, 230, 230, 20, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 105, 230, 230, 230, 20, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 221, 224, 224, 224, 130, 255, 255, 255, 1, 255, 255, 255, 1, 225, 225, 225, 134, 224, 224, 224, 224, 225, 225, 225, 223, 224, 224, 224, 132, 255, 255, 255, 1, 255, 255, 255, 6, 224, 224, 224, 137, 224, 224, 224, 231, 224, 224, 224, 255, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 130, 225, 225, 225, 133, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 129, 224, 224, 224, 137, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 65, 224, 224, 224, 255, 224, 224, 224, 220, 225, 225, 225, 223, 224, 224, 224, 255, 226, 226, 226, 61, 224, 224, 224, 65, 224, 224, 224, 255, 224, 224, 224, 222, 224, 224, 224, 231, 224, 224, 224, 255, 227, 227, 227, 62, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 225, 225, 225, 67, 224, 224, 224, 255, 224, 224, 224, 219, 224, 224, 224, 222, 224, 224, 224, 255, 227, 227, 227, 63, 225, 225, 225, 67, 224, 224, 224, 255, 224, 224, 224, 219, 224, 224, 224, 230, 224, 224, 224, 255, 227, 227, 227, 63, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 225, 225, 225, 127, 224, 224, 224, 129, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 225, 225, 225, 126, 225, 225, 225, 135, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 221, 225, 225, 225, 127, 255, 255, 255, 0, 255, 255, 255, 1, 224, 224, 224, 128, 224, 224, 224, 220, 224, 224, 224, 219, 225, 225, 225, 127, 255, 255, 255, 0, 255, 255, 255, 5, 225, 225, 225, 134, 224, 224, 224, 229, 224, 224, 224, 255, 255, 255, 255, 0), "format": "RGBA8", @@ -19,97 +35,94 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_gdtpn"] -image = SubResource("Image_inmd8") +image = SubResource("Image_241ci") [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7v0rg"] -[node name="RestartWindow" type="Control"] -layout_mode = 3 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -200.0 -offset_top = -171.5 -offset_right = 200.0 -offset_bottom = 171.5 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="ConfirmationDialog" type="ConfirmationDialog" parent="."] +[node name="RestartWindow" type="ConfirmationDialog"] title = "Restart required" initial_position = 2 -size = Vector2i(416, 400) +size = Vector2i(430, 500) visible = true transient = false unresizable = true theme = SubResource("Theme_swwco") ok_button_text = "Restart" cancel_button_text = "Save and restart" +script = SubResource("GDScript_7v43l") -[node name="Panel" type="Panel" parent="ConfirmationDialog"] +[node name="Panel" type="Panel" parent="."] +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 offset_left = 8.0 offset_top = 8.0 -offset_right = 408.0 -offset_bottom = 351.0 +offset_right = 422.0 +offset_bottom = 451.0 +grow_horizontal = 2 mouse_filter = 1 -[node name="VBoxContainer" type="VBoxContainer" parent="ConfirmationDialog/Panel"] +[node name="VBoxContainer" type="VBoxContainer" parent="Panel"] custom_minimum_size = Vector2(400, 0) -layout_mode = 0 -offset_right = 400.0 -offset_bottom = 309.0 +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -200.0 +offset_right = 200.0 +offset_bottom = 389.0 +grow_horizontal = 2 -[node name="HSeparator" type="HSeparator" parent="ConfirmationDialog/Panel/VBoxContainer"] +[node name="HSeparator" type="HSeparator" parent="Panel/VBoxContainer"] layout_mode = 2 mouse_filter = 1 theme_override_constants/separation = 15 theme_override_styles/separator = SubResource("StyleBoxEmpty_5vqdt") -[node name="HBoxContainer" type="HBoxContainer" parent="ConfirmationDialog/Panel/VBoxContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="Panel/VBoxContainer"] layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 4 +theme_override_constants/separation = 10 -[node name="DocsIcon" type="TextureRect" parent="ConfirmationDialog/Panel/VBoxContainer/HBoxContainer"] +[node name="DocsIcon" type="TextureRect" parent="Panel/VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 8 size_flags_vertical = 4 texture = SubResource("ImageTexture_gdtpn") stretch_mode = 2 -[node name="LinkButton" type="LinkButton" parent="ConfirmationDialog/Panel/VBoxContainer/HBoxContainer"] +[node name="LinkButton" type="LinkButton" parent="Panel/VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 8 mouse_default_cursor_shape = 16 -text = "Plugin Docs" +theme_override_font_sizes/font_size = 24 +text = "HOW TO USE" uri = "https://github.com/vaporvee/discord-sdk-godot/wiki" -[node name="TextureRect" type="TextureRect" parent="ConfirmationDialog/Panel/VBoxContainer"] +[node name="TextureRect" type="TextureRect" parent="Panel/VBoxContainer"] custom_minimum_size = Vector2(128, 128) layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 0 -texture = ExtResource("1_f828l") +texture = ExtResource("1_0svbg") expand_mode = 1 -[node name="RichTextLabel" type="RichTextLabel" parent="ConfirmationDialog/Panel/VBoxContainer"] -custom_minimum_size = Vector2(400, 200) +[node name="RichTextLabel" type="RichTextLabel" parent="Panel/VBoxContainer"] +custom_minimum_size = Vector2(400, 250) layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 0 mouse_filter = 1 +theme_override_font_sizes/normal_font_size = 16 theme_override_styles/normal = SubResource("StyleBoxEmpty_7v0rg") bbcode_enabled = true text = "[center]Thanks for enabling the -[rainbow]Discord Game SDK Plugin[/rainbow] +[rainbow][b]Discord Game SDK Plugin[/b][/rainbow] made by vaporvee. ❤️ -You need to [wave]restart[/wave] the editor to fully enable this plugin! -Do you want to [wave]save[/wave] your project before restarting? +You need to [wave][b]restart[/b][/wave] the editor to fully enable this plugin! +Do you want to [wave][b]save[/b][/wave] your project before restarting? (Error messages after the first restart are normal. Please ignore them)" diff --git a/project/main.gd b/project/main.gd index 3c19342..16a7cb1 100644 --- a/project/main.gd +++ b/project/main.gd @@ -33,7 +33,7 @@ func set_activity() -> void: discord_sdk.is_public_party = true discord_sdk.instanced = true #required for spectate #discord_sdk.start_timestamp = int(Time.get_unix_time_from_system()) - discord_sdk.register_command("C:\\Users\\yanni\\Desktop\\demo\\discord_sdk.exe") + discord_sdk.register_command(r"C:\Users\yanni\Desktop\demo\discord_sdk.exe") #discord_sdk.register_steam(1389990) discord_sdk.refresh() diff --git a/project/project.godot b/project/project.godot index c84cf16..5218a8b 100644 --- a/project/project.godot +++ b/project/project.godot @@ -19,6 +19,10 @@ boot_splash/image="res://assets/Banner_v1.png" boot_splash/fullsize=false config/icon="res://assets/Logo_V2.png" +[autoload] + +DiscordSDKAutoload="*res://addons/discord-sdk-gd/nodes/discord_autoload.gd" + [display] window/size/resizable=false diff --git a/src/discordgodot.cpp b/src/discordgodot.cpp index 3dc230b..e318cf0 100644 --- a/src/discordgodot.cpp +++ b/src/discordgodot.cpp @@ -93,7 +93,7 @@ discord_sdk::discord_sdk() discord_sdk::~discord_sdk() { singleton = nullptr; - delete core; + delete core; // couldn't use destructor because it would not compile on linux core = nullptr; } diff --git a/src/discordgodot.h b/src/discordgodot.h index 9a47b9f..424733a 100644 --- a/src/discordgodot.h +++ b/src/discordgodot.h @@ -3,7 +3,7 @@ #include #include "lib/discord_game_sdk/cpp/discord.h" -#include +#include #include #define H_SET_GET(variable_type, property_name) \ @@ -13,7 +13,7 @@ using namespace godot; -class discord_sdk : public RefCounted +class discord_sdk : public Object { GDCLASS(discord_sdk, Object); diff --git a/src/register_types.cpp b/src/register_types.cpp index 37f3fc6..472ccb7 100644 --- a/src/register_types.cpp +++ b/src/register_types.cpp @@ -26,7 +26,6 @@ void uninitialize_discordsdk_module(ModuleInitializationLevel p_level) if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) { Engine::get_singleton()->unregister_singleton("discord_sdk"); - memdelete(discordsdk); } }