Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
55b41f85fa | |||
d468df31df | |||
a97cf81ea9 | |||
2ad1dd1e25 | |||
0c280cf2e6 | |||
91786abb15 | |||
577e6b87b4 | |||
d318d7b5f9 | |||
9d8a809b13 | |||
79c6ea8a9e | |||
0bf43164f2 | |||
605080d7ff | |||
|
1b56b8c8df | ||
|
9f49afd472 | ||
|
e016b7b582 | ||
|
4726a4488b | ||
|
bcdf52d5c6 | ||
|
c4da303a5d | ||
|
de8e4b4793 | ||
|
ecead11830 | ||
|
91074133bb | ||
37c7759cdf | |||
262450728d | |||
dab07c9f62 | |||
|
93d424e3e7 | ||
|
96afc12c92 | ||
|
20978010a1 | ||
|
39078e7a98 | ||
|
a52ca54bca | ||
|
7be2c5a119 |
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1 +1,2 @@
|
||||
patreon: vaporvee
|
||||
ko_fi: vaporvee
|
||||
|
5
.github/ISSUE_TEMPLATE/BUG.yml
vendored
5
.github/ISSUE_TEMPLATE/BUG.yml
vendored
@@ -23,6 +23,7 @@ body:
|
||||
label: Version
|
||||
description: What version of the Discord Game SDK Godot plugin are you running?
|
||||
options:
|
||||
- 1.2.0
|
||||
- 1.1.0
|
||||
- 1.0.1
|
||||
- 1.0.0
|
||||
@@ -88,10 +89,10 @@ body:
|
||||
attributes:
|
||||
label: Checks
|
||||
description: Common mistakes (Adding more in the future sorry btw)
|
||||
options:
|
||||
options:
|
||||
- label: I tried reinstalling the addon or tried to fix it myself with other methods.
|
||||
required: true
|
||||
- label: I tried restarting Discord and Godot completely.
|
||||
required: true
|
||||
- label: I did read the documentation https://github.com/vaporvee/discord-sdk-godot/wiki
|
||||
- label: I did read the documentation https://vaporvee.com/docs/discord-sdk-godot/
|
||||
required: true
|
||||
|
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,12 +1,14 @@
|
||||
# Objects.
|
||||
.scons-cache/
|
||||
*.os
|
||||
*.o
|
||||
|
||||
# SConstruct
|
||||
.sconf_temp
|
||||
.sconsign.dblite
|
||||
*.pyc
|
||||
|
||||
|
||||
# MacOS
|
||||
.DS_Store
|
||||
|
||||
@@ -17,9 +19,15 @@ build/
|
||||
*.obj
|
||||
*.exp
|
||||
*.lib
|
||||
*.a
|
||||
|
||||
#Clean files from the Game SDK
|
||||
#Clean files from setup.py
|
||||
src/lib/discord_game_sdk/
|
||||
|
||||
# release.py
|
||||
release/
|
||||
# release
|
||||
release/
|
||||
project/export/
|
||||
|
||||
# venv
|
||||
venv/
|
||||
|
||||
|
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,4 +1,4 @@
|
||||
[submodule "src/lib/godot-cpp"]
|
||||
path = src/lib/godot-cpp
|
||||
url = https://github.com/godotengine/godot-cpp
|
||||
branch = 4.2
|
||||
branch = 4.1
|
||||
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -4,7 +4,7 @@
|
||||
"${workspaceFolder}/src/lib/godot-cpp/include"
|
||||
],
|
||||
"files.associations": {
|
||||
"*.gdextension": "config-definition"
|
||||
"*.gdextension": "ini"
|
||||
},
|
||||
"[python]": {
|
||||
"editor.defaultFormatter": "ms-python.black-formatter"
|
||||
|
@@ -1,8 +1,10 @@
|
||||
<img src="/project/assets/Banner.svg" alt="Project Banner" />
|
||||
|
||||
|
||||
**Discord Game SDK support for GDScript in Godot Engine 4.2. with the easiest code pattern!**<br><br>
|
||||
<br />
|
||||
# [Quick start :rocket: (click here)](https://github.com/vaporvee/discord-sdk-godot/wiki#quick-start)
|
||||
### [My Discord Server](https://discord.gg/EBdaTefpWy)
|
||||
# [Quick start :rocket: (click here)](https://vaporvee.com/docs/discord-sdk-godot#quick-start)
|
||||
<br />
|
||||
|
||||
**A small donation with the sponsor button would be nice if you sell your project with this addon but is of course not mandatory!**
|
||||
|
@@ -5,7 +5,7 @@ env = SConscript("src/lib/godot-cpp/SConstruct")
|
||||
|
||||
if env["platform"] == "macos":
|
||||
discord_library = "libdiscord_game_sdk.dylib"
|
||||
discord_library_second = "libdiscord_game_sdk_aarch64.dylib"
|
||||
discord_library_second = ""
|
||||
libexportfolder = "/macos/"
|
||||
|
||||
elif env["platform"] in ("linuxbsd", "linux"):
|
||||
|
11
build.py
11
build.py
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
yes = {"yes", "y", "ye", ""}
|
||||
@@ -16,15 +17,17 @@ if choice in yes:
|
||||
"python -m SCons && python -m SCons target=template_release && cd project && godot"
|
||||
)
|
||||
elif choice in no:
|
||||
if os.name == "nt": # Windows
|
||||
system = platform.system()
|
||||
print("Building for: '%s'" % (system))
|
||||
if system == "Windows": # Windows
|
||||
os.system(
|
||||
"python -m SCons && python -m SCons target=template_release && godot project\project.godot"
|
||||
"python -m SCons && python -m SCons target=template_release && godot project/project.godot"
|
||||
)
|
||||
elif os.name == "darwin": # macOS
|
||||
elif system == "Darwin": # macOS
|
||||
os.system(
|
||||
"python -m SCons target=template_release arch=x86_64 && python -m SCons target=template_debug arch=x86_64 && python -m SCons target=template_release arch=arm64 && python -m SCons target=template_debug arch=arm64 && godot project/project.godot"
|
||||
)
|
||||
else:
|
||||
else: # Linux
|
||||
os.system(
|
||||
"python -m SCons && python -m SCons target=template_release && godot project/project.godot"
|
||||
)
|
||||
|
@@ -1,14 +1,12 @@
|
||||
[configuration]
|
||||
|
||||
entry_symbol = "discordsdkgd_library_init"
|
||||
compatibility_minimum = 4.2
|
||||
compatibility_minimum = 4.1
|
||||
|
||||
[libraries]
|
||||
|
||||
macos.debug.x86_64 = "macos/libdiscord_game_sdk_binding_debug.dylib"
|
||||
macos.release.x86_64 = "macos/libdiscord_game_sdk_binding.dylib"
|
||||
macos.debug.arm64 = "macos/libdiscord_game_sdk_binding_arm64_debug.dylib"
|
||||
macos.release.arm64 = "macos/libdiscord_game_sdk_binding_arm64.dylib"
|
||||
macos.debug = "macos/libdiscord_game_sdk_binding_debug.dylib"
|
||||
macos.release = "macos/libdiscord_game_sdk_binding.dylib"
|
||||
windows.debug.x86_64 = "windows/discord_game_sdk_binding_debug.dll"
|
||||
windows.release.x86_64 = "windows/discord_game_sdk_binding.dll"
|
||||
linux.debug.x86_64 = "linux/libdiscord_game_sdk_binding_debug.so"
|
||||
@@ -20,10 +18,7 @@ linux.release.rv64 = "linux/libdiscord_game_sdk_binding.so"
|
||||
|
||||
[dependencies]
|
||||
|
||||
macos.debug.x86_64 = { "macos/libdiscord_game_sdk.dylib": "" }
|
||||
macos.release.x86_64 = { "macos/libdiscord_game_sdk.dylib": "" }
|
||||
macos.debug.arm64 = { "macos/libdiscord_game_sdk_aarch64": "" }
|
||||
macos.release.arm64 = { "macos/libdiscord_game_sdk_aarch64": "" }
|
||||
macos = { "macos/libdiscord_game_sdk.dylib": "" }
|
||||
windows.debug.x86_64 = { "windows/discord_game_sdk.dll": "" }
|
||||
windows.release.x86_64 = { "windows/discord_game_sdk.dll": "" }
|
||||
linux.debug.x86_64 = { "linux/libdiscord_game_sdk.so": "" }
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,6 +3,5 @@
|
||||
name="DiscordSDK"
|
||||
description="Discord Game SDK support for GDScript in Godot"
|
||||
author="vaporvee"
|
||||
version="1.1.0"
|
||||
version="1.2.0"
|
||||
script="plugin.gd"
|
||||
editor_presence=true
|
||||
|
@@ -10,16 +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)
|
||||
await RenderingServer.frame_post_draw
|
||||
plugin_cfg.load(EditorInterface.get_editor_paths().get_data_dir() + plugin_data_filename)
|
||||
print(EditorInterface.get_editor_paths().get_data_dir())
|
||||
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))
|
||||
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(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"):
|
||||
@@ -27,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()
|
||||
|
@@ -9,7 +9,7 @@ Button/styles/focus = SubResource("StyleBoxEmpty_1t7mm")
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5vqdt"]
|
||||
|
||||
[sub_resource type="Image" id="Image_oelge"]
|
||||
[sub_resource type="Image" id="Image_v4whe"]
|
||||
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_oelge")
|
||||
image = SubResource("Image_v4whe")
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7v0rg"]
|
||||
|
||||
@@ -80,9 +80,9 @@ layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 8
|
||||
mouse_default_cursor_shape = 16
|
||||
theme_override_font_sizes/font_size = 24
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "HOW TO USE"
|
||||
uri = "https://github.com/vaporvee/discord-sdk-godot/wiki"
|
||||
uri = "https://vaporvee.com/docs/discord-sdk-godot#quick-start"
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Panel/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(128, 128)
|
||||
|
@@ -8,7 +8,7 @@ custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="../../eexport/windows/discord-sdk-godot-demo.exe"
|
||||
export_path="export/windows/discord-sdk-godot-demo.exe"
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
encrypt_pck=false
|
||||
@@ -42,6 +42,7 @@ application/product_name=""
|
||||
application/file_description="Discord SDK Godot Test"
|
||||
application/copyright=""
|
||||
application/trademarks=""
|
||||
application/export_angle=0
|
||||
ssh_remote_deploy/enabled=false
|
||||
ssh_remote_deploy/host="user@host_ip"
|
||||
ssh_remote_deploy/port="22"
|
||||
@@ -70,7 +71,7 @@ custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="../../eexport/linux/discord-sdk-godot-demo.x86_64"
|
||||
export_path="export/linux/discord-sdk-godot-demo.x86_64"
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
encrypt_pck=false
|
||||
@@ -99,3 +100,108 @@ unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
|
||||
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
|
||||
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
|
||||
rm -rf \"{temp_dir}\""
|
||||
|
||||
[preset.2]
|
||||
|
||||
name="macOS"
|
||||
platform="macOS"
|
||||
runnable=true
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="export/macos/discord-sdk-godot-demo.zip"
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
|
||||
[preset.2.options]
|
||||
|
||||
export/distribution_type=0
|
||||
binary_format/architecture="universal"
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
debug/export_console_wrapper=1
|
||||
application/icon=""
|
||||
application/icon_interpolation=4
|
||||
application/bundle_identifier="com.vaporvee.discord-sdk-godot-demo"
|
||||
application/signature=""
|
||||
application/app_category="Games"
|
||||
application/short_version=""
|
||||
application/version=""
|
||||
application/copyright=""
|
||||
application/copyright_localized={}
|
||||
application/min_macos_version="10.12"
|
||||
application/export_angle=0
|
||||
display/high_res=true
|
||||
xcode/platform_build="14C18"
|
||||
xcode/sdk_version="13.1"
|
||||
xcode/sdk_build="22C55"
|
||||
xcode/sdk_name="macosx13.1"
|
||||
xcode/xcode_version="1420"
|
||||
xcode/xcode_build="14C18"
|
||||
codesign/codesign=1
|
||||
codesign/installer_identity=""
|
||||
codesign/apple_team_id=""
|
||||
codesign/identity=""
|
||||
codesign/entitlements/custom_file=""
|
||||
codesign/entitlements/allow_jit_code_execution=false
|
||||
codesign/entitlements/allow_unsigned_executable_memory=false
|
||||
codesign/entitlements/allow_dyld_environment_variables=false
|
||||
codesign/entitlements/disable_library_validation=false
|
||||
codesign/entitlements/audio_input=false
|
||||
codesign/entitlements/camera=false
|
||||
codesign/entitlements/location=false
|
||||
codesign/entitlements/address_book=false
|
||||
codesign/entitlements/calendars=false
|
||||
codesign/entitlements/photos_library=false
|
||||
codesign/entitlements/apple_events=false
|
||||
codesign/entitlements/debugging=false
|
||||
codesign/entitlements/app_sandbox/enabled=false
|
||||
codesign/entitlements/app_sandbox/network_server=false
|
||||
codesign/entitlements/app_sandbox/network_client=false
|
||||
codesign/entitlements/app_sandbox/device_usb=false
|
||||
codesign/entitlements/app_sandbox/device_bluetooth=false
|
||||
codesign/entitlements/app_sandbox/files_downloads=0
|
||||
codesign/entitlements/app_sandbox/files_pictures=0
|
||||
codesign/entitlements/app_sandbox/files_music=0
|
||||
codesign/entitlements/app_sandbox/files_movies=0
|
||||
codesign/entitlements/app_sandbox/files_user_selected=0
|
||||
codesign/entitlements/app_sandbox/helper_executables=[]
|
||||
codesign/custom_options=PackedStringArray()
|
||||
notarization/notarization=0
|
||||
privacy/microphone_usage_description=""
|
||||
privacy/microphone_usage_description_localized={}
|
||||
privacy/camera_usage_description=""
|
||||
privacy/camera_usage_description_localized={}
|
||||
privacy/location_usage_description=""
|
||||
privacy/location_usage_description_localized={}
|
||||
privacy/address_book_usage_description=""
|
||||
privacy/address_book_usage_description_localized={}
|
||||
privacy/calendar_usage_description=""
|
||||
privacy/calendar_usage_description_localized={}
|
||||
privacy/photos_library_usage_description=""
|
||||
privacy/photos_library_usage_description_localized={}
|
||||
privacy/desktop_folder_usage_description=""
|
||||
privacy/desktop_folder_usage_description_localized={}
|
||||
privacy/documents_folder_usage_description=""
|
||||
privacy/documents_folder_usage_description_localized={}
|
||||
privacy/downloads_folder_usage_description=""
|
||||
privacy/downloads_folder_usage_description_localized={}
|
||||
privacy/network_volumes_usage_description=""
|
||||
privacy/network_volumes_usage_description_localized={}
|
||||
privacy/removable_volumes_usage_description=""
|
||||
privacy/removable_volumes_usage_description_localized={}
|
||||
ssh_remote_deploy/enabled=false
|
||||
ssh_remote_deploy/host="user@host_ip"
|
||||
ssh_remote_deploy/port="22"
|
||||
ssh_remote_deploy/extra_args_ssh=""
|
||||
ssh_remote_deploy/extra_args_scp=""
|
||||
ssh_remote_deploy/run_script="#!/usr/bin/env bash
|
||||
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
|
||||
open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}"
|
||||
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
|
||||
kill $(pgrep -x -f \"{temp_dir}/{exe_name}.app/Contents/MacOS/{exe_name} {cmd_args}\")
|
||||
rm -rf \"{temp_dir}\""
|
||||
|
@@ -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()
|
||||
|
||||
|
35
release.py
35
release.py
@@ -1,26 +1,37 @@
|
||||
import os
|
||||
from distutils.dir_util import copy_tree
|
||||
import shutil
|
||||
from distutils.dir_util import copy_tree
|
||||
|
||||
folder_path = "project/addons/discord-sdk-gd/bin/windows"
|
||||
|
||||
# Filter files that end with 'TMP' or 'exp' or 'lib'
|
||||
matching_files = [
|
||||
file for file in os.listdir(folder_path) if file.endswith(("TMP", "exp", "lib"))
|
||||
]
|
||||
win_folder_path = "project/addons/discord-sdk-gd/bin/windows"
|
||||
|
||||
matching_files = [file for file in os.listdir(win_folder_path) if file.endswith(("TMP", "exp", "lib"))]
|
||||
for file in matching_files:
|
||||
file_path = os.path.join(folder_path, file)
|
||||
file_path = os.path.join(win_folder_path, file)
|
||||
os.remove(file_path)
|
||||
|
||||
if os.path.exists("release/ADDON-Discord-SDK-Godot/addons"):
|
||||
shutil.rmtree("release/ADDON-Discord-SDK-Godot/addons", ignore_errors=True)
|
||||
|
||||
copy_tree("project/addons/", "release/temp/ADDON-Discord-SDK-Godot/addons")
|
||||
open(
|
||||
"release/temp/ADDON-Discord-SDK-Godot/addons/discord-sdk-gd/bin/.gdignore", "a"
|
||||
).close()
|
||||
|
||||
shutil.make_archive("release/ADDON-Discord-SDK-Godot", "zip", "release/temp/")
|
||||
open("release/temp/ADDON-Discord-SDK-Godot/addons/discord-sdk-gd/bin/.gdignore", "a").close()
|
||||
|
||||
shutil.make_archive('release/ADDON-Discord-SDK-Godot', 'zip', 'release/temp/')
|
||||
|
||||
shutil.rmtree("release/temp/")
|
||||
# Export Demos
|
||||
os.system("cd project && godot --headless --export-release \"Linux/X11\"")
|
||||
os.system("cd project && godot --headless --export-release \"Windows Desktop\"")
|
||||
os.system("cd project && godot --headless --export-release \"macOS\"")
|
||||
|
||||
temp_dir = "release/temp_export_dir"
|
||||
os.makedirs(temp_dir, exist_ok=True)
|
||||
|
||||
for platform in ["windows", "linux", "macos"]:
|
||||
shutil.copytree(f"project/export/{platform}", os.path.join(temp_dir, platform))
|
||||
|
||||
shutil.make_archive('release/Demo-Export', 'zip', temp_dir)
|
||||
|
||||
shutil.rmtree(temp_dir)
|
||||
|
||||
print("ADDON-Discord-SDK-Godot.zip and Demo-Export.zip have been created successfully.")
|
||||
|
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
setuptools
|
||||
scons
|
21
setup.py
21
setup.py
@@ -2,6 +2,7 @@ import zipfile
|
||||
from distutils.dir_util import copy_tree
|
||||
import shutil
|
||||
import os
|
||||
import sys
|
||||
|
||||
with zipfile.ZipFile("src/lib/discord_game_sdk.zip", "r") as zip_ref:
|
||||
zip_ref.extractall("src/lib/discord_game_sdk/")
|
||||
@@ -15,11 +16,7 @@ with open("src/lib/discord_game_sdk/cpp/types.h", "r+") as f:
|
||||
copy_tree("src/lib/discord_game_sdk/lib/", "src/lib/discord_game_sdk/bin/")
|
||||
os.rename(
|
||||
"src/lib/discord_game_sdk/bin/aarch64/discord_game_sdk.dylib",
|
||||
"src/lib/discord_game_sdk/bin/aarch64/libdiscord_game_sdk_aarch64.dylib",
|
||||
)
|
||||
os.rename(
|
||||
"src/lib/discord_game_sdk/bin/x86_64/discord_game_sdk.dylib",
|
||||
"src/lib/discord_game_sdk/bin/x86_64/libdiscord_game_sdk.dylib",
|
||||
"src/lib/discord_game_sdk/bin/aarch64/discord_game_sdk_aarch64.dylib",
|
||||
)
|
||||
os.rename(
|
||||
"src/lib/discord_game_sdk/bin/x86_64/discord_game_sdk.so",
|
||||
@@ -47,4 +44,18 @@ shutil.rmtree("src/lib/discord_game_sdk/bin/x86/", ignore_errors=True)
|
||||
shutil.rmtree("src/lib/discord_game_sdk/bin/x86_64/", ignore_errors=True)
|
||||
os.remove("src/lib/discord_game_sdk/README.md")
|
||||
|
||||
if sys.platform == "darwin":
|
||||
# Combine the two libraries into one
|
||||
os.system(
|
||||
"lipo src/lib/discord_game_sdk/bin/{discord_game_sdk.dylib,discord_game_sdk_aarch64.dylib} -output src/lib/discord_game_sdk/bin/libdiscord_game_sdk.dylib -create"
|
||||
)
|
||||
# Change the install name to (library's location)/(its new name)
|
||||
os.system(
|
||||
"install_name_tool -id '@loader_path/libdiscord_game_sdk.dylib'\
|
||||
src/lib/discord_game_sdk/bin/libdiscord_game_sdk.dylib"
|
||||
)
|
||||
# Remove the ones it's made of
|
||||
os.remove("src/lib/discord_game_sdk/bin/discord_game_sdk.dylib")
|
||||
os.remove("src/lib/discord_game_sdk/bin/discord_game_sdk_aarch64.dylib")
|
||||
|
||||
os.system("git submodule update --init --remote")
|
||||
|
@@ -87,15 +87,17 @@ SET_GET(is_public_party, activity.GetParty().SetPrivacy(static_cast<discord::Act
|
||||
|
||||
DiscordSDK::DiscordSDK()
|
||||
{
|
||||
ERR_FAIL_COND(singleton != nullptr);
|
||||
singleton = this;
|
||||
}
|
||||
|
||||
DiscordSDK::~DiscordSDK()
|
||||
{
|
||||
singleton = nullptr;
|
||||
app_id = 0;
|
||||
delete core; // couldn't use destructor because it would not compile on linux
|
||||
core = nullptr;
|
||||
ERR_FAIL_COND(singleton != this);
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
DiscordSDK *DiscordSDK::get_singleton()
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#include "lib/discord_game_sdk/cpp/discord.h"
|
||||
#include <godot_cpp/core/class_db.hpp>
|
||||
#include <godot_cpp/variant/utility_functions.hpp>
|
||||
#include <godot_cpp/classes/scene_tree.hpp>
|
||||
|
||||
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) {});
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#include <godot_cpp/classes/project_settings.hpp>
|
||||
#include <godot_cpp/classes/engine.hpp>
|
||||
#include <godot_cpp/classes/time.hpp>
|
||||
#include <godot_cpp/classes/editor_interface.hpp>
|
||||
#include <godot_cpp/classes/tree.hpp>
|
||||
|
||||
using namespace godot;
|
||||
|
||||
@@ -28,7 +28,6 @@ public:
|
||||
godot::Engine *engine = godot::Engine::get_singleton();
|
||||
godot::ProjectSettings *project_settings = godot::ProjectSettings::get_singleton();
|
||||
godot::Time *time = godot::Time::get_singleton();
|
||||
godot::EditorInterface *editor_interface = godot::EditorInterface::get_singleton();
|
||||
|
||||
discord::Core *core{};
|
||||
discord::Result result;
|
||||
|
Submodule src/lib/godot-cpp updated: 78ffea5b13...4b63d795e4
@@ -28,6 +28,7 @@ void uninitialize_discordsdk_module(ModuleInitializationLevel p_level)
|
||||
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE)
|
||||
{
|
||||
Engine::get_singleton()->unregister_singleton("DiscordSDK");
|
||||
memdelete(discordsdk);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user