From a62ae85545920ad9ddc727e49d7a6d37dd98346b Mon Sep 17 00:00:00 2001 From: vaporvee Date: Tue, 25 Apr 2023 13:43:18 +0200 Subject: [PATCH] added automatic discord game sdk lib exporting --- README.md | 4 +--- project/addons/discord-sdk-gd/bin/.gdignore | 0 .../bin/windows/discord_game_sdk_binding.dll | Bin 163328 -> 163328 bytes .../discord_game_sdk_binding_debug.dll | Bin 164864 -> 164864 bytes project/addons/discord-sdk-gd/export.gd | 11 +++++++---- project/export_presets.cfg | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 project/addons/discord-sdk-gd/bin/.gdignore diff --git a/README.md b/README.md index e1d4d28..38e1513 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -### This is version 1.0! In future versions there will be lobbies, invites, linux builds etc. very soon! +### This is an early version! In future versions there will be lobbies, invites, linux builds etc. very soon! Don't forget to run the following command **if you clone this project** or the godot-cpp folder will be empty ```sh git submodule update --init @@ -11,7 +11,6 @@ git submodule update --init 3. Enable the addon in your Project Settings under "Plugins" and "DiscordSDK". (if it doesn't show up reopen the project) 4. Create an Application under https://discord.com/developers/applications and get the Application ID 5. (optional) Set images under "Rich Presence" and "Art Assets" and remember the keys -6. Exporting: You need to copy the `discord_game_sdk.dll` or on linux `discord_game_sdk.so` from `res://addons/discord-sdk-gd/bin/PLATFORM/discord_game_sdk.[dll/.so]` to your exported project in the same directory as `discord_game_sdk_binding_debug.[dll/.so]` ```gdscript extends Node @@ -40,7 +39,6 @@ func _ready():
## Extra Info -- "Step 2" (enabling the addon) is needed to add `Discord_Activity.coreupdate()` to a `_process()` function with a singleton. This function is needed by pretty everything but you can it also just add it yourself. - The Discord SDK itself doesn't build under Linux for some reason (I don't have a Mac so i don't even know if it's builds under OSX) its not well documented but I try as hard as i can to get it working crossplatform but at the time its only working under Windows... (But feel free to make pull requests btw) - Its an early release some features aren't implemented only because i need a small amount of time not because it's not possible diff --git a/project/addons/discord-sdk-gd/bin/.gdignore b/project/addons/discord-sdk-gd/bin/.gdignore deleted file mode 100644 index e69de29..0000000 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 e861aa464e7e92e753f7b54a86cb9d7491beb729..6838552fbd66efb45251d587389f9d227a3d97b2 100644 GIT binary patch delta 33 ocmZqp!`bkMa{(jM*WJxbjO|Q}jN6$QnJ#ey`P;AYFliM60M|1M@Bjb+ delta 33 ocmZqp!`bkMa{(jM=1I*=jO|Q}jN6$QnJ#ey`P;AYFliM60Lmo`8UO$Q 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 453ab274502ac0254d3449a164215e033ee74bc6..4f3b0ba96563ab7874bcad177d28356ca8db1624 100644 GIT binary patch delta 33 ncmZqZ;A-gLTENKkVs|qWV>=Tg<8~%SCLuu}f4i6v)2l)Nul@== delta 33 ncmZqZ;A-gLTENJZGqIV8v7L#LaXS+ulaL^gzgBo016d diff --git a/project/addons/discord-sdk-gd/export.gd b/project/addons/discord-sdk-gd/export.gd index b177e8b..1bb5f82 100644 --- a/project/addons/discord-sdk-gd/export.gd +++ b/project/addons/discord-sdk-gd/export.gd @@ -1,7 +1,10 @@ @tool extends EditorExportPlugin - -# Called when the node enters the scene tree for the first time. -func _export_end(): - pass +func _export_file(path, type, features): + if path[2] == "windows": + add_shared_object("res://addons/discord-sdk-gd/bin/windows/discord_game_sdk.dll",[],"/") + elif path[2] == "linux": + add_shared_object("res://addons/discord-sdk-gd/bin/linux/discord_game_sdk.so",[],"/") + elif path[2] == "macos": + add_shared_object("res://addons/discord-sdk-gd/bin/macos/discord_game_sdk.dylib",[],"/") diff --git a/project/export_presets.cfg b/project/export_presets.cfg index dc3ae44..b58e3cc 100644 --- a/project/export_presets.cfg +++ b/project/export_presets.cfg @@ -35,7 +35,7 @@ codesign/timestamp_server_url="" codesign/digest_algorithm=1 codesign/description="" codesign/custom_options=PackedStringArray() -application/modify_resources=true +application/modify_resources=false application/icon="" application/console_wrapper_icon="" application/icon_interpolation=4