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 d20f94e..4e45ce7 100644 --- a/project/addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension +++ b/project/addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension @@ -1,7 +1,7 @@ [configuration] entry_symbol = "discordsdkgd_library_init" -compatibility_minimum = 4.2 +compatibility_minimum = 4.1 [libraries] diff --git a/project/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk_binding.so b/project/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk_binding.so index b0d258d..4a4946e 100644 Binary files a/project/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk_binding.so and b/project/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk_binding.so differ diff --git a/project/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk_binding_debug.so b/project/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk_binding_debug.so index d5611e3..199e291 100644 Binary files a/project/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk_binding_debug.so and b/project/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk_binding_debug.so differ 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 14d739a..af5bdf7 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 9c585c2..9e39579 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/libdiscord_game_sdk_binding.a b/project/addons/discord-sdk-gd/bin/windows/libdiscord_game_sdk_binding.a index 7035413..ac821dc 100644 Binary files a/project/addons/discord-sdk-gd/bin/windows/libdiscord_game_sdk_binding.a and b/project/addons/discord-sdk-gd/bin/windows/libdiscord_game_sdk_binding.a differ diff --git a/project/addons/discord-sdk-gd/bin/windows/libdiscord_game_sdk_binding_debug.a b/project/addons/discord-sdk-gd/bin/windows/libdiscord_game_sdk_binding_debug.a index 4670af3..06502e7 100644 Binary files a/project/addons/discord-sdk-gd/bin/windows/libdiscord_game_sdk_binding_debug.a and b/project/addons/discord-sdk-gd/bin/windows/libdiscord_game_sdk_binding_debug.a differ diff --git a/project/addons/discord-sdk-gd/plugin.gd b/project/addons/discord-sdk-gd/plugin.gd index a900280..f890de7 100644 --- a/project/addons/discord-sdk-gd/plugin.gd +++ b/project/addons/discord-sdk-gd/plugin.gd @@ -10,17 +10,17 @@ const plugin_data_filename = "/plugin_data.cfg" func _enter_tree() -> void: add_custom_type("DiscordSDKDebug","Node",DiscordSDKDebug,DiscordSDKDebug_icon) - EditorInterface.get_editor_settings().settings_changed.connect(_on_editor_settings_changed) + get_editor_interface().get_editor_settings().settings_changed.connect(_on_editor_settings_changed) func _ready() -> void: await get_tree().create_timer(0.5).timeout - plugin_cfg.load(EditorInterface.get_editor_paths().get_data_dir() + plugin_data_filename) - if !EditorInterface.get_editor_settings().has_setting("DiscordSDK/EditorPresence/enabled"): - EditorInterface.get_editor_settings().set_setting("DiscordSDK/EditorPresence/enabled",plugin_cfg.get_value("Discord","editor_presence",false)) + plugin_cfg.load(get_editor_interface().get_editor_paths().get_data_dir() + plugin_data_filename) + if !get_editor_interface().get_editor_settings().has_setting("DiscordSDK/EditorPresence/enabled"): + get_editor_interface().get_editor_settings().set_setting("DiscordSDK/EditorPresence/enabled",plugin_cfg.get_value("Discord","editor_presence",false)) func _exit_tree(): - if EditorInterface.get_editor_settings().has_setting("DiscordSDK/EditorPresence/enabled"): - EditorInterface.get_editor_settings().erase("DiscordSDK/EditorPresence/enabled") + if get_editor_interface().get_editor_settings().has_setting("DiscordSDK/EditorPresence/enabled"): + get_editor_interface().get_editor_settings().erase("DiscordSDK/EditorPresence/enabled") func _enable_plugin() -> void: if FileAccess.file_exists(ProjectSettings.globalize_path("res://") + "addons/discord-sdk-gd/bin/.gdignore"): @@ -28,30 +28,29 @@ func _enable_plugin() -> void: add_autoload_singleton("DiscordSDKLoader","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) + get_editor_interface().popup_dialog_centered(restart_window) print("IGNORE RED ERROR MESSAGES BEFORE THE SECOND RESTART!") func _disable_plugin() -> void: remove_autoload_singleton("DiscordSDKLoader") FileAccess.open("res://addons/discord-sdk-gd/bin/.gdignore",FileAccess.WRITE) remove_custom_type("DiscordSDKDebug") - EditorInterface.get_editor_settings().erase("DiscordSDK/EditorPresence/enabled") + get_editor_interface().get_editor_settings().erase("DiscordSDK/EditorPresence/enabled") push_warning("Please restart the editor to fully disable the DiscordSDK plugin") func save_and_restart() -> void: - EditorInterface.save_all_scenes() - EditorInterface.restart_editor(true) + get_editor_interface().restart_editor(true) func save_no_restart() -> void: - EditorInterface.restart_editor(false) + get_editor_interface().restart_editor(false) var editor_presence: Node func _on_editor_settings_changed() -> void: - plugin_cfg.set_value("Discord","editor_presence",EditorInterface.get_editor_settings().get_setting("DiscordSDK/EditorPresence/enabled")) - plugin_cfg.save(EditorInterface.get_editor_paths().get_data_dir() + plugin_data_filename) + plugin_cfg.set_value("Discord","editor_presence",get_editor_interface().get_editor_settings().get_setting("DiscordSDK/EditorPresence/enabled")) + plugin_cfg.save(get_editor_interface().get_editor_paths().get_data_dir() + plugin_data_filename) if ClassDB.class_exists("EditorPresence") && editor_presence == null: editor_presence = ClassDB.instantiate("EditorPresence") - if EditorInterface.get_editor_settings().has_setting("DiscordSDK/EditorPresence/enabled") && EditorInterface.get_editor_settings().get_setting("DiscordSDK/EditorPresence/enabled"): + if get_editor_interface().get_editor_settings().has_setting("DiscordSDK/EditorPresence/enabled") && get_editor_interface().get_editor_settings().get_setting("DiscordSDK/EditorPresence/enabled"): add_child(editor_presence) else: editor_presence.queue_free() diff --git a/project/addons/discord-sdk-gd/restart_window.tscn b/project/addons/discord-sdk-gd/restart_window.tscn index c09a1ba..7d13aaf 100644 --- a/project/addons/discord-sdk-gd/restart_window.tscn +++ b/project/addons/discord-sdk-gd/restart_window.tscn @@ -9,7 +9,7 @@ Button/styles/focus = SubResource("StyleBoxEmpty_1t7mm") [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5vqdt"] -[sub_resource type="Image" id="Image_vgwcx"] +[sub_resource type="Image" id="Image_jkad7"] 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,7 +19,7 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_gdtpn"] -image = SubResource("Image_vgwcx") +image = SubResource("Image_jkad7") [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7v0rg"] diff --git a/project/main.gd b/project/main.gd index 2af6f66..cab40d6 100644 --- a/project/main.gd +++ b/project/main.gd @@ -33,7 +33,7 @@ func set_activity() -> void: DiscordSDK.is_public_party = true DiscordSDK.instanced = true #required for spectate #DiscordSDK.start_timestamp = int(Time.get_unix_time_from_system()) - DiscordSDK.register_command(r"C:\Users\yanni\Desktop\demo\DiscordSDK.exe") + DiscordSDK.register_command("C:\\Users\\yanni\\Desktop\\demo\\DiscordSDK.exe") #DiscordSDK.register_steam(1389990) DiscordSDK.refresh() diff --git a/src/editor_presence.cpp b/src/editor_presence.cpp index 8afbaf3..3fc1807 100644 --- a/src/editor_presence.cpp +++ b/src/editor_presence.cpp @@ -2,6 +2,7 @@ #include "lib/discord_game_sdk/cpp/discord.h" #include #include +#include EditorPresence *EditorPresence::singleton = nullptr; @@ -44,7 +45,7 @@ void EditorPresence::_process(double delta) { if (state_string.utf8() != activity.GetState()) { - godot::Node *edited_scene_root = editor_interface->get_edited_scene_root(); + godot::Node *edited_scene_root = get_tree()->get_edited_scene_root(); activity.SetState(String("Editing: \"" + edited_scene_root->get_scene_file_path() + "\"").replace("res://", "").utf8()); if (result == discord::Result::Ok) core->ActivityManager().UpdateActivity(activity, [](discord::Result result) {}); diff --git a/src/editor_presence.h b/src/editor_presence.h index a0a063c..c92b41d 100644 --- a/src/editor_presence.h +++ b/src/editor_presence.h @@ -8,6 +8,7 @@ #include #include #include +#include using namespace godot;