51 Commits
1.4 ... 4.0.X

Author SHA1 Message Date
Yannik
35c1895650 Update README.md 2023-07-05 23:47:48 +02:00
Yannik
548349d9f8 bumped version 2023-06-30 22:54:43 +02:00
Yannik
68c8a42826 removed obsolete export plugin 2023-06-30 22:54:13 +02:00
Yannik
3e944683a4 Merge pull request #31 from vaartis/patch-1
Change gdextension dependencies so they're actually used, patch the SDK
2023-06-30 22:22:33 +02:00
Ekaterina Vaartis
6f288564cf Patch the SDK in setup.py so it actually builds 2023-06-30 20:51:04 +03:00
vaartis
aa39fb80e0 Change gdextension dependencies so they're actually used
This part isn't very well documented, but they changed the format of that file at some point and now it needs to be like this to pull the dependencies into the built project. Assuming this is what the export plugin does, that can probably be removed.
2023-06-30 19:35:35 +03:00
Yannik
980080492e bumped version and cleaned up project 2023-05-23 23:30:27 +02:00
Yannik
b3ebd2c737 Merge pull request #29 from Bioblaze/patch-1 2023-05-23 21:57:38 +02:00
Yannik
f9134f30f7 Update export.gd 2023-05-23 21:56:07 +02:00
Bioblaze Payne
da42d6a228 Update export.gd to support extend environments
After having a conversation with Yannik, had more environment variables in my array then most so made this lil change to make it work. Works flawlessly.
2023-05-23 11:48:50 -07:00
Yannik
a998076b79 bumped version to 2.1 2023-05-20 15:15:48 +02:00
Yannik
7fd0d25da9 added release.py 2023-05-20 15:14:04 +02:00
Yannik
52fcce409a fixed random crashes by only typing = 0 2023-05-20 15:01:46 +02:00
Yannik
88a855d1da fixed editor presence again 2023-05-18 15:49:36 +02:00
Yannik
53dafb1da2 removed unused method 2023-05-18 14:47:35 +02:00
Yannik
9772445870 Updated github things 2023-05-18 13:35:30 +02:00
Yannik
52ec3392fa removed custom loader node and did a bit documentation 2023-05-18 13:35:30 +02:00
Yannik
3913736a42 Update README.md 2023-05-18 13:35:20 +02:00
Yannik
ba5eb3316e fixed wrong EditorPresence tooltip 2023-05-18 13:34:47 +02:00
Yannik
9929ccbb3a fixed some 2.0 bugs 2023-05-18 13:34:47 +02:00
Yannik
73b915485f added linux builds 2023-05-17 00:34:46 +02:00
Yannik
fd5a59d1eb added EditorPresence 2023-05-17 00:30:48 +02:00
Yannik
7e8c1cc7bb gone back to vulkan because it crashes less 2023-05-16 21:58:09 +02:00
Yannik
ed67525242 added custom nodes 2023-05-16 21:53:21 +02:00
Yannik
a803ffb9a1 bumped version to 2.0 2023-05-16 20:22:05 +02:00
Yannik
ee4b0567c5 cleares more variables in clear() 2023-05-16 19:30:29 +02:00
Yannik
92ec704ddb improved demo 2023-05-16 19:27:39 +02:00
Yannik
3bf8ee8d36 added a comment 2023-05-16 19:03:02 +02:00
Yannik
3765612588 Merge branch 'main' of https://github.com/vaporvee/discord-sdk-godot 2023-05-16 18:56:54 +02:00
Yannik
58a043a885 should finally fix #20 2023-05-16 18:56:44 +02:00
Yannik
df556e8a72 Merge pull request #22 from vaporvee/add-user-dictionary
Added current user dictionary
2023-05-16 16:59:44 +02:00
Yannik
5cd13316a0 Merge branch 'main' of https://github.com/vaporvee/discord-sdk-godot into add-user-dictionary 2023-05-16 16:59:22 +02:00
Yannik
c62e9af0ef added current user dictionary 2023-05-16 16:57:01 +02:00
Yannik
31e3302384 Merge pull request #23 from vaporvee/overlay
Adding overlay support
2023-05-16 16:00:43 +02:00
Yannik
0013c8c788 added overlay support 2023-05-16 16:00:11 +02:00
Yannik
27498f9e70 Delete discord_addon_export_beta.zip 2023-05-15 20:18:47 +02:00
Yannik
54d6cebd5c Update README.md 2023-05-15 19:33:31 +02:00
Yannik
029111a04f Merge pull request #17 from vaporvee/just-add-invites-already
Just add invites already
2023-05-15 19:32:26 +02:00
Yannik
281bdb2cfa Merge branch 'main' of https://github.com/vaporvee/discord-sdk-godot into just-add-invites-already 2023-05-15 19:31:47 +02:00
Yannik
0f903dfb6c variables for setting the privacy 2023-05-15 19:30:01 +02:00
Yannik
65fb3b1d0f added send invite from game methods 2023-05-15 19:11:10 +02:00
Yannik
fa63df6094 Merge pull request #21 from vaporvee/fixed-error-when-exporting-project
fixed error when exporting project #20
2023-05-15 18:39:29 +02:00
Yannik
edf3e7fab6 fixed error when exporting project #20 2023-05-15 18:38:30 +02:00
Yannik
5e080bc846 Updated GitHub stuff 2023-05-15 12:51:32 +02:00
Yannik
7f586869d7 added clear() method 2023-05-15 12:46:11 +02:00
Yannik
9eaf340637 added invite signals 2023-05-15 09:15:50 +02:00
Yannik
0c9e4123b7 fixed #18 2023-05-13 01:40:36 +02:00
Yannik
274a3ebbed added steam register 2023-05-12 22:44:00 +02:00
Yannik
3b921901ee added invite variables 2023-05-12 22:10:08 +02:00
Yannik
aadd2cb982 renamed Discord_Activity to discord_sdk 2023-05-12 20:38:55 +02:00
Yannik
f8325c8164 version bump (will get hotifxed) 2023-05-12 20:30:28 +02:00
45 changed files with 1504 additions and 259 deletions

View File

@@ -23,6 +23,12 @@ body:
label: Version
description: What version of our software are you running?
options:
- 2.3
- 2.2
- 2.1
- 2.0
- 1.5
- 1.4
- 1.3
- 1.2
- 1.1
@@ -47,6 +53,14 @@ body:
render: gdscript
validations:
required: true
- type: textarea
id: log
attributes:
label: Godot output
description: The output log from Godot
render: shell
validations:
required: false
- type: textarea
id: additional
attributes:
@@ -61,5 +75,7 @@ body:
label: Checks
description: Common mistakes (Adding more in the future sorry btw)
options:
- label: I tried reinstalling the addon in a new project.
- 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

27
.github/ISSUE_TEMPLATE/FEATURE.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Feature request
description: File a feature request
title: "[Feature request]: "
labels: ["enhancement"]
assignees:
- vaporvee
body:
- type: markdown
attributes:
value: Thanks for taking the time to fill out this feature request!
- type: textarea
id: idea
attributes:
label: What is your idea?
description: Tell me what you want to see in the addon.
placeholder: Tell me what you want to see!
value: "I have a cool new feature!"
validations:
required: true
- type: textarea
id: additional
attributes:
label: Additional information
description: If you have anything else tell me here
placeholder: Anything else.
validations:
required: false

5
.gitignore vendored
View File

@@ -19,4 +19,7 @@ build/
*.lib
#Clean files from the Game SDK
src/lib/discord_game_sdk/
src/lib/discord_game_sdk/
# release.py
release/

View File

@@ -3,7 +3,10 @@
{
"name": "Win32",
"includePath": [
"${default}"
"${default}",
"${workspaceFolder}/src/lib/godot-cpp/gen/include",
"${workspaceFolder}/src/lib/godot-cpp/include",
"${workspaceFolder}/src/lib/godot-cpp/gdextension"
],
"defines": [
"_DEBUG",

64
.vscode/settings.json vendored
View File

@@ -1,11 +1,67 @@
{
"C_Cpp.default.includePath": [
"src/lib/godot-cpp/include",
"src/lib/godot-cpp/gen/include",
"src/lib/godot-cpp/gdextension"
"${workspaceFolder}/src/lib/godot-cpp/gen/include",
"${workspaceFolder}/src/lib/godot-cpp/include"
],
"files.associations": {
"xlocbuf": "cpp"
"xlocbuf": "cpp",
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"csignal": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"exception": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"memory": "cpp",
"new": "cpp",
"optional": "cpp",
"ostream": "cpp",
"ratio": "cpp",
"set": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"string": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"utility": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocinfo": "cpp",
"xlocnum": "cpp",
"xmemory": "cpp",
"xstddef": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"

View File

@@ -1,52 +1,27 @@
<img src="/project/assets/Banner.svg" alt="Project Banner" />
![HitCount](https://hits.dwyl.com/vaporvee/discord-sdk-godot.svg)
### :warning: This is an early version! MacOS support still doesn't work! In future versions there also will be invites, user info etc. very soon!
Don't forget to run the following command **if you clone this project** or files will be missing
```sh
python setup.py
```
# Addon Usage :rocket:
1. [Download the addon](https://github.com/vaporvee/discord-sdk-godot/releases/latest/download/ADDON-Discord-SDK-Godot.zip/)
2. Put the `addons/` folder in your Godot project
3. Enable the addon in your Project Settings under "Plugins" and "DiscordSDK". (if it doesn't show up restart your project and try again)
4. Restart your project
5. Create an Application under https://discord.com/developers/applications and get the Application ID
6. (optional) Set images under "Rich Presence" and "Art Assets" and remember the keys
```gdscript
extends Node
func _ready():
Discord_Activity.app_id = 1099618430065324082 # Application ID
print("Discord working: " + str(Discord_Activity.get_is_discord_working())) # A boolean if everything worked
Discord_Activity.details = "A demo activity by vaporvee#1231"
Discord_Activity.state = "Checkpoint 23/23"
Discord_Activity.large_image = "game" # Image key from "Art Assets"
Discord_Activity.large_image_text = "Try it now!"
Discord_Activity.small_image = "boss" # Image key from "Art Assets"
Discord_Activity.small_image_text = "Fighting the end boss! D:"
Discord_Activity.start_timestamp = int(Time.get_unix_time_from_system()) # "02:46 elapsed"
# Discord_Activity.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time / "01:00 remaining"
Discord_Activity.refresh() # Always refresh after changing the values!
```
#### Then it will look similar to this:
<img src="/project/assets/ActivityPreview.svg" alt="Activity Preview" />
### [Try a built demo](https://github.com/vaporvee/discord-sdk-godot/releases/latest/download/Demo-Export.zip)
:incoming_envelope: Still questions? write an [issue](https://github.com/vaporvee/discord-sdk-godot/issues)! I'll answer very fast :)
**Discord Game SDK support for GDScript in Godot Engine 4.0. with the easiest code pattern!**<br><br>
<br />
<br />
# [Quick start :rocket: (click here)](https://github.com/vaporvee/discord-sdk-godot/wiki)
<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!**
# Features
- Activities (Make people see what you are playing)
- Invites
- Steam and launch command registering
- User information
- Overlay management
- Editor Presence (optional)
<img width="400px" src="https://camo.githubusercontent.com/e4ae18ce30a7731145376e1a85c384e9ea207420c09365e3fcdd455ef332ba98/68747470733a2f2f6769746875622d70726f64756374696f6e2d757365722d61737365742d3632313064662e73332e616d617a6f6e6177732e636f6d2f38303632313836332f3233383739343331392d35373164653262612d346635652d343062612d613263662d3839666365643963306366302e706e67">
<br />
<br />
### Credit
[@Pukimaa](https://github.com/pukimaa) - Designer<br>
[@koyuawsmbrtn](https://github.com/koyuawsmbrtn) - Getting it to work on MacOS (shes giving her best)
<br />
*This project is not endorsed or affiliated with Discord Inc. or the Godot Foundation.*

BIN
project/Node Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -17,13 +17,13 @@ linux.release.rv64 = "bin/linux/libdiscord_game_sdk_binding.so"
[dependencies]
macos.debug = "bin/macos/libdiscord_game_sdk.dylib"
macos.release = "bin/macos/libdiscord_game_sdk.dylib"
windows.debug.x86_64 = "bin/windows/discord_game_sdk.dll"
windows.release.x86_64 = "bin/windows/discord_game_sdk.dll"
linux.debug.x86_64 = "bin/linux/libdiscord_game_sdk.so"
linux.release.x86_64 = "bin/linux/libdiscord_game_sdk.so"
linux.debug.arm64 = "bin/linux/libdiscord_game_sdk.so"
linux.release.arm64 = "bin/linux/libdiscord_game_sdk.so"
linux.debug.rv64 = "bin/linux/libdiscord_game_sdk.so"
linux.release.rv64 = "bin/linux/libdiscord_game_sdk.so"
macos.debug = { "bin/macos/libdiscord_game_sdk.dylib": "" }
macos.release = { "bin/macos/libdiscord_game_sdk.dylib": "" }
windows.debug.x86_64 = { "bin/windows/discord_game_sdk.dll": "" }
windows.release.x86_64 = { "bin/windows/discord_game_sdk.dll": "" }
linux.debug.x86_64 = { "bin/linux/libdiscord_game_sdk.so": "" }
linux.release.x86_64 = { "bin/linux/libdiscord_game_sdk.so": "" }
linux.debug.arm64 = { "bin/linux/libdiscord_game_sdk.so": "" }
linux.release.arm64 = { "bin/linux/libdiscord_game_sdk.so": "" }
linux.debug.rv64 = { "bin/linux/libdiscord_game_sdk.so": "" }
linux.release.rv64 = { "bin/linux/libdiscord_game_sdk.so": "" }

View File

@@ -1,25 +1,38 @@
class_name DiscordSDKTutorial
extends Node
# 1. Put the addons/ folder in your Godot project
# 2. Enable the addon in your Project Settings under "Plugins" and "DiscordSDK". (if it doesn't show up restart your project and try again)
# 3. Restart your 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
#SELECT THE TEXT WITH YOUR MOUSE AND CTR + K TO UNCOMMENT THE FOLLOWING
#func _ready():
# Discord_Activity.app_id = 1099618430065324082 # Application ID
# print("Discord working: " + str(Discord_Activity.get_is_discord_working())) # A boolean if everything worked
# Discord_Activity.details = "A demo activity by vaporvee#1231"
# Discord_Activity.state = "Checkpoint 23/23"
#
# Discord_Activity.large_image = "game" # Image key from "Art Assets"
# Discord_Activity.large_image_text = "Try it now!"
# Discord_Activity.small_image = "boss" # Image key from "Art Assets"
# Discord_Activity.small_image_text = "Fighting the end boss! D:"
#
# Discord_Activity.start_timestamp = int(Time.get_unix_time_from_system()) # "02:41 elapsed"
# Discord_Activity.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time
#
# Discord_Activity.refresh() # Always refresh after changing the values!
## 1. Put the addons/ folder in your Godot project[br]
## 2. Enable the addon in your Project Settings under "Plugins" and "DiscordSDK". [br](if it doesn't show up restart your project and try again)[br]
## 3. Restart your project[br]
## 4. Create an Application under https://discord.com/developers/applications and get the Application ID br]
## 5. (optional) Set images under "Rich Presence" and "Art Assets" and remember the keys[br]
##
## This is your [code]_ready()[/code] function wich could be anywhere
## [codeblock]
## func _ready():
## # Application ID
## discord_sdk.app_id = 1099618430065324082
## # this is boolean if everything worked
## print("Discord working: " + str(discord_sdk.get_is_discord_working()))
## # Set the first custom text row of the activity here
## discord_sdk.details = "A demo activity by vaporvee#1231"
## # Set the second custom text row of the activity here
## discord_sdk.state = "Checkpoint 23/23"
## # Image key for small image from "Art Assets" from the Discord Developer website
## discord_sdk.large_image = "game"
## # Tooltip text for the large image
## discord_sdk.large_image_text = "Try it now!"
## # Image key for large image from "Art Assets" from the Discord Developer website
## discord_sdk.small_image = "boss"
## # Tooltip text for the small image
## discord_sdk.small_image_text = "Fighting the end boss! D:"
## # "02:41 elapsed" timestamp for the activity
## discord_sdk.start_timestamp = int(Time.get_unix_time_from_system())
## # "59:59 remaining" timestamp for the activity
## discord_sdk.end_timestamp = int(Time.get_unix_time_from_system()) + 3600
## # Always refresh after changing the values!
## discord_sdk.refresh()
## [/codeblock]
##
## @tutorial(More information here): https://github.com/vaporvee/discord-sdk-godot/wiki/Quick-start
## @tutorial(Make your Application ID and else here): https://discord.com/developers/applications

View File

@@ -1,14 +0,0 @@
@tool
extends EditorExportPlugin
func _export_file(path, type, features):
if features[2] == "windows":
if features[4] == "x86_64":
add_shared_object("bin/windows/discord_game_sdk.dll",[],"/")
elif features[4] == "x86":
add_shared_object("bin/windows/discord_game_sdk_x86.dll",[],"/")
elif features[2] == "linux":
add_shared_object("bin/linux/libdiscord_game_sdk.so",[],"/")
elif features[2] == "macos":
add_shared_object("bin/macos/libdiscord_game_sdk.dylib",[],"/")
add_shared_object("bin/macos/libdiscord_game_sdk_aarch64.dylib",[],"/")

View File

@@ -0,0 +1,623 @@
[gd_scene load_steps=68 format=3 uid="uid://c1slhdnlsv2qt"]
[ext_resource type="Texture2D" uid="uid://cq8lwj2matk6x" path="res://addons/discord-sdk-gd/nodes/assets/flow_spritesheet.png" id="4_gvc3o"]
[sub_resource type="GDScript" id="GDScript_ak1tp"]
resource_name = "Debug"
script/source = "extends Node
func _ready():
discord_sdk.connect(\"activity_join_request\",_on_activity_join_request)
func _process(_delta):
if(discord_sdk.get_is_discord_working()):
$AnimatedSprite2D.play(\"default\")
debug_text_update()
else:
$AnimatedSprite2D.stop()
$AnimatedSprite2D.animation = \"gray\"
debug_text_update()
func debug_text_update():
$Info.text = \"Application ID : {id}
Details: {details}
State: {state}
Large image key: {lkey}
Large image text: {ltext}
Small image key: {skey}
Small image text: {stext}
Start timestamp: {stimestamp}
End timestamp: {etimestamp}
Party ID: {partyid}
Current party size: {cpartysize}
Max party size: {mpartysize}
Match secret: {msecret}
Join secret: {jsecret}
Spectate secret: {ssecret}
Is party public: {ppublic} (needs to be activated in Discord client settings)
Is instanced: {instanced}
\"
$Info.text = $Info.text.replace(\"{ppublic}\",str(discord_sdk.is_public_party)).replace(\"{instanced}\",str(discord_sdk.instanced)).replace(\"{ssecret}\",discord_sdk.spectate_secret).replace(\"{jsecret}\",discord_sdk.join_secret).replace(\"{msecret}\",discord_sdk.match_secret).replace(\"{mpartysize}\",str(discord_sdk.max_party_size)).replace(\"{cpartysize}\",str(discord_sdk.current_party_size)).replace(\"{partyid}\",discord_sdk.party_id).replace(\"{id}\",str(discord_sdk.app_id)).replace(\"{details}\",discord_sdk.details).replace(\"{state}\",discord_sdk.state).replace(\"{lkey}\",discord_sdk.large_image).replace(\"{ltext}\",discord_sdk.large_image_text).replace(\"{skey}\",discord_sdk.small_image).replace(\"{stext}\",discord_sdk.small_image_text).replace(\"{stimestamp}\",str(discord_sdk.start_timestamp)).replace(\"{etimestamp}\",str(discord_sdk.end_timestamp))
var user_request = {};
func _on_activity_join_request(user_requesting):
print(user_requesting)
user_request = user_requesting
func _on_button_pressed():
if(!user_request.is_empty()):
discord_sdk.accept_join_request(user_request.id)
func _on_line_edit_text_submitted(new_text):
discord_sdk.send_invite(int(new_text),true,\"this is a test invite sent from godot\")
func _on_line_edit_2_text_submitted(new_text):
discord_sdk.accept_invite(int(new_text))
func _on_button_2_pressed():
print(discord_sdk.get_current_user())
func _on_check_button_toggled(button_pressed):
if(button_pressed):
debug_text_update()
else:
discord_sdk.clear()
debug_text_update()
"
[sub_resource type="AtlasTexture" id="AtlasTexture_85oj4"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 0, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_vv4mb"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 0, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_kwv3j"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 0, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_ij57t"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 0, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_w2du1"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 512, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_4pma1"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 512, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_fcoqp"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 512, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_tjcb7"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 512, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_oudh8"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 512, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_csja0"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 1024, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_0xbpk"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 1024, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_p84pv"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 1024, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_1gjwh"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 1024, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_mrm73"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 1024, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_8rkne"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 1536, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_c15qo"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 1536, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_74tpk"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 1536, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_v5nxq"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 1536, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_0mf44"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 1536, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_kb0hn"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 2048, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_o22ug"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 2048, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_21q7w"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 2048, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_gitfl"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 2048, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_8hg1o"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 2048, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_niuoc"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 2560, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_mt5ft"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 2560, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_ub7uo"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 2560, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_2uxnl"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 2560, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_bh4ts"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 2560, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_lcu0i"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 3072, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_mmqt1"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 3072, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_orode"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 3072, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_ricn8"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 3072, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_6ftll"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 3072, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_fm4jy"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 3584, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_7qcot"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 3584, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_2y47g"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 3584, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_gpr0t"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 3584, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_nn332"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 3584, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_jg384"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 4096, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_g0wvw"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 4096, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_e6fmf"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 4096, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_n1rtv"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 4096, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_365g3"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 4096, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_frkrx"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 4608, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_j8adw"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 4608, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_76fh7"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 4608, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_gmmrx"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 4608, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_rlh42"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 4608, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_wijf7"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 5120, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_2n5hs"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 5120, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_yrp6k"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 5120, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_w411h"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 5120, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_pe7po"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 5120, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_sr5kq"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 5632, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_kgesr"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 5632, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_vfk6x"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 5632, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_4d1t3"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 5632, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_6bexm"]
atlas = ExtResource("4_gvc3o")
region = Rect2(2048, 5632, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_tadlo"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 6144, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_g2h20"]
atlas = ExtResource("4_gvc3o")
region = Rect2(512, 6144, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_x351d"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1024, 6144, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_0jq3r"]
atlas = ExtResource("4_gvc3o")
region = Rect2(1536, 6144, 512, 512)
[sub_resource type="AtlasTexture" id="AtlasTexture_1eeyl"]
atlas = ExtResource("4_gvc3o")
region = Rect2(0, 0, 512, 512)
[sub_resource type="SpriteFrames" id="SpriteFrames_kudgl"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_85oj4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vv4mb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kwv3j")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ij57t")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_w2du1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4pma1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fcoqp")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tjcb7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_oudh8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_csja0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0xbpk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_p84pv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1gjwh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mrm73")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8rkne")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_c15qo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_74tpk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_v5nxq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0mf44")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kb0hn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_o22ug")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_21q7w")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gitfl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8hg1o")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_niuoc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mt5ft")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ub7uo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2uxnl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bh4ts")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lcu0i")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mmqt1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_orode")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ricn8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6ftll")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fm4jy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7qcot")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2y47g")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gpr0t")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nn332")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jg384")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_g0wvw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_e6fmf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_n1rtv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_365g3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_frkrx")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j8adw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_76fh7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gmmrx")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_rlh42")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wijf7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2n5hs")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yrp6k")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_w411h")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_pe7po")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_sr5kq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kgesr")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vfk6x")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4d1t3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6bexm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tadlo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_g2h20")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_x351d")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0jq3r")
}],
"loop": true,
"name": &"default",
"speed": 30.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_1eeyl")
}],
"loop": true,
"name": &"gray",
"speed": 5.0
}]
[node name="DebugNodeGroup" type="Node"]
editor_description = "This is a Debug Node wich will show (only if the project runs) some usefull info and buttons/input"
script = SubResource("GDScript_ak1tp")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
position = Vector2(389, 477.375)
scale = Vector2(0.14209, 0.14209)
sprite_frames = SubResource("SpriteFrames_kudgl")
frame_progress = 0.417812
[node name="Info" type="RichTextLabel" parent="."]
offset_left = 7.0
offset_top = 6.0
offset_right = 424.0
offset_bottom = 312.0
theme_override_font_sizes/normal_font_size = 14
text = "Application ID : {id}
Details: {details}
State: {state}
Large image key: {lkey}
Large image text: {ltext}
Small image key: {skey}
Small image text: {stext}
Start timestamp: {stimestamp}
End timestamp: {etimestamp}
Party ID: {partyid}
Current party size: {cpartysize}
Max party size: {mpartysize}
Match secret: {msecret}
Join secret: {jsecret}
Spectate secret: {ssecret}
Is party public: {ppublic} (needs to be activated in Discord client settings)
Is instanced: {instanced}
"
fit_content = true
[node name="PrintCurrentUserOnConsole" type="Button" parent="."]
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 7.0
offset_top = 141.375
offset_right = 240.0
offset_bottom = 174.375
grow_vertical = 2
text = "Print current user on console"
[node name="AcceptInviteRequest" type="Button" parent="."]
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 7.0
offset_top = 178.875
offset_right = 149.0
offset_bottom = 209.875
grow_vertical = 2
text = "ACCEPT REQUEST"
[node name="InviteWithUserID" type="LineEdit" parent="."]
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 6.0
offset_top = 215.375
offset_right = 205.0
offset_bottom = 246.375
grow_vertical = 2
size_flags_horizontal = 0
placeholder_text = "Invite with user_id here"
[node name="AcceptWithUserID" type="LineEdit" parent="."]
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 6.0
offset_top = 250.875
offset_right = 255.0
offset_bottom = 281.875
grow_vertical = 2
placeholder_text = "Accept Invite with user_id here"
[connection signal="pressed" from="PrintCurrentUserOnConsole" to="." method="_on_button_2_pressed"]
[connection signal="pressed" from="AcceptInviteRequest" to="." method="_on_button_pressed"]
[connection signal="text_submitted" from="InviteWithUserID" to="." method="_on_line_edit_text_submitted"]
[connection signal="text_submitted" from="AcceptWithUserID" to="." method="_on_line_edit_2_text_submitted"]

View File

@@ -0,0 +1,18 @@
<svg width="834" height="500" viewBox="0 0 834 500" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_162_85)">
<rect width="833.333" height="500" rx="250" fill="#23A55A"/>
<g clip-path="url(#clip1_162_85)">
<path d="M791.667 250C791.667 134.941 698.393 41.6666 583.333 41.6666C468.274 41.6666 375 134.941 375 250C375 365.059 468.274 458.333 583.333 458.333C698.393 458.333 791.667 365.059 791.667 250Z" fill="white"/>
<path d="M539.491 351.121L506.345 317.977L673.122 151.199L706.268 184.345L539.491 351.121Z" fill="#23A55A"/>
<path d="M460.134 272.714L493.279 239.568L571.844 318.133L538.698 351.279L460.134 272.714Z" fill="#23A55A"/>
</g>
</g>
<defs>
<clipPath id="clip0_162_85">
<rect width="833.333" height="500" rx="250" fill="white"/>
</clipPath>
<clipPath id="clip1_162_85">
<rect width="583.333" height="416.667" fill="white" transform="translate(291.667 41.6666)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 926 B

View File

@@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://2no2ced378ds"
path="res://.godot/imported/Core Updater.svg-75aabb825d7cf085efdd2bf5760ba312.ctex"
uid="uid://dnfq6kug4x6o2"
path="res://.godot/imported/Checked.svg-152467b95b56fa0b9944b5cc25700916.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Core Updater.svg"
dest_files=["res://.godot/imported/Core Updater.svg-75aabb825d7cf085efdd2bf5760ba312.ctex"]
source_file="res://addons/discord-sdk-gd/nodes/assets/Checked.svg"
dest_files=["res://.godot/imported/Checked.svg-152467b95b56fa0b9944b5cc25700916.ctex"]
[params]

View File

@@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_110_26)">
<path d="M13.3334 5.33333H11.4601C11.1594 4.81182 10.7446 4.36512 10.2467 4.02667L11.3334 2.94L10.3934 2L8.94675 3.44667C8.64008 3.37333 8.32675 3.33333 8.00008 3.33333C7.67341 3.33333 7.36008 3.37333 7.06008 3.44667L5.60675 2L4.66675 2.94L5.74675 4.02667C5.25341 4.36667 4.84008 4.81333 4.54008 5.33333H2.66675V6.66667H4.06008C4.02675 6.88667 4.00008 7.10667 4.00008 7.33333V8H2.66675V9.33333H4.00008V10C4.00008 10.2267 4.02675 10.4467 4.06008 10.6667H2.66675V12H4.54008C5.23341 13.1933 6.52008 14 8.00008 14C9.48008 14 10.7667 13.1933 11.4601 12H13.3334V10.6667H11.9401C11.9734 10.4467 12.0001 10.2267 12.0001 10V9.33333H13.3334V8H12.0001V7.33333C12.0001 7.10667 11.9734 6.88667 11.9401 6.66667H13.3334V5.33333ZM9.33341 10.6667H6.66675V9.33333H9.33341V10.6667ZM9.33341 8H6.66675V6.66667H9.33341V8Z" fill="#5865F2"/>
</g>
<defs>
<clipPath id="clip0_110_26">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://d1dntlgjiapde"
path="res://.godot/imported/Debug.svg-dbd0299514a2ed7480404c509868c103.ctex"
uid="uid://ufh1hha1ehui"
path="res://.godot/imported/Debug.svg-c87ff9d4b4b0e718ec457560f6c420dc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Debug.svg"
dest_files=["res://.godot/imported/Debug.svg-dbd0299514a2ed7480404c509868c103.ctex"]
source_file="res://addons/discord-sdk-gd/nodes/assets/Debug.svg"
dest_files=["res://.godot/imported/Debug.svg-c87ff9d4b4b0e718ec457560f6c420dc.ctex"]
[params]

View File

@@ -0,0 +1,4 @@
<svg width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.35776 4.35954C0.15745 6.80425 -0.158183 9.20437 0.0679444 11.5772C1.29133 12.4811 2.66066 13.1685 4.11639 13.6096C4.44417 13.1687 4.73422 12.701 4.98346 12.2115C4.51007 12.0346 4.05317 11.8165 3.61804 11.5596C3.73256 11.4765 3.84456 11.3909 3.95279 11.3079C5.21891 11.9033 6.60083 12.212 7.99997 12.212C9.39912 12.212 10.781 11.9033 12.0472 11.3079C12.1566 11.3972 12.2686 11.4828 12.3819 11.5596C11.9459 11.8169 11.4882 12.0355 11.014 12.2127C11.2629 12.7021 11.553 13.1694 11.881 13.6096C13.338 13.1703 14.7084 12.4832 15.932 11.5785C16.1887 8.91658 15.71 6.52885 14.6441 4.35954H1.35776ZM3.90119 8.15294C3.90119 9.03386 4.55307 9.74992 5.34212 9.74992C6.14627 9.74992 6.76795 9.03386 6.78179 8.15294C6.79563 7.27203 6.14879 6.54967 5.3396 6.54967C4.53042 6.54967 3.90119 7.27203 3.90119 8.15294ZM9.21815 8.15294C9.21815 9.03386 9.86752 9.74992 10.6578 9.74992C11.462 9.74992 12.0824 9.03386 12.0962 8.15294C12.1101 7.27203 11.4683 6.54967 10.6578 6.54967C9.84738 6.54967 9.21815 7.27203 9.21815 8.15294Z" fill="#5865F2"/>
<path d="M4.31337 0.711094C4.97409 0.378693 5.67883 0.1583 6.39124 0C6.67624 0.478046 6.93634 0.995727 7.16285 1.50181C7.43169 1.45692 7.70147 1.4403 7.97234 1.43708V1.43666C7.97402 1.43666 7.97578 1.43708 7.97746 1.43708C7.97907 1.43708 7.98082 1.43666 7.98271 1.43666V1.43708C8.25308 1.4403 8.5231 1.45692 8.79187 1.50181C9.01852 0.995727 9.27877 0.478046 9.56334 0C10.2761 0.1583 10.9807 0.378693 11.6415 0.711094C11.6264 1.29423 11.5887 1.85296 11.5124 2.42051C11.7685 2.58482 12.0385 2.72584 12.2781 2.91819C12.522 3.10544 12.7702 3.28458 12.9907 3.50357C13.4312 3.21235 13.8976 2.93868 14.3777 2.6971C14.8955 3.25402 15.3798 3.85511 15.7752 4.52774C15.5165 4.9441 15.1789 5.43899 14.8223 5.88763H1.13254C0.823832 5.50544 0.490472 5.01534 0.179688 4.52774C0.575141 3.85511 1.05924 3.25402 1.57697 2.6971C2.05728 2.93868 2.52351 3.21235 2.96401 3.50357C3.18451 3.28458 3.43322 3.10544 3.67673 2.91819C3.9164 2.72584 4.18607 2.58482 4.44266 2.42051C4.3662 1.85296 4.32848 1.29423 4.31337 0.711094Z" fill="#5865F2"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c70jidlptani4"
path="res://.godot/imported/Group_1.svg-8cf36058739c5884a9a47a4dfa7d001a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/discord-sdk-gd/nodes/assets/Group_1.svg"
dest_files=["res://.godot/imported/Group_1.svg-8cf36058739c5884a9a47a4dfa7d001a.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -0,0 +1,18 @@
<svg width="834" height="500" viewBox="0 0 834 500" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_162_79)">
<rect x="0.666687" width="833.333" height="500" rx="250" fill="#80848E"/>
<g clip-path="url(#clip1_162_79)">
<path d="M459 250C459 134.941 365.726 41.6666 250.667 41.6666C135.607 41.6666 42.3333 134.941 42.3333 250C42.3333 365.059 135.607 458.333 250.667 458.333C365.726 458.333 459 365.059 459 250Z" fill="white"/>
<path d="M149.257 181.868L182.402 148.722L351.813 318.134L318.667 351.28L149.257 181.868Z" fill="#80848E"/>
<path d="M318.801 148.722L351.946 181.868L182.535 351.28L149.389 318.134L318.801 148.722Z" fill="#80848E"/>
</g>
</g>
<defs>
<clipPath id="clip0_162_79">
<rect x="0.666687" width="833.333" height="500" rx="250" fill="white"/>
</clipPath>
<clipPath id="clip1_162_79">
<rect width="583.333" height="416.667" fill="white" transform="translate(-41 41.6666)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 942 B

View File

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://compmm3kviqqe"
path="res://.godot/imported/Unchecked.svg-91cff67e13e7a1508fbc6a949f5f5f52.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/discord-sdk-gd/nodes/assets/Unchecked.svg"
dest_files=["res://.godot/imported/Unchecked.svg-91cff67e13e7a1508fbc6a949f5f5f52.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

View File

@@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cm3gqnd84wbvu"
path="res://.godot/imported/Core Updater.png-3bb461d6b6e9b42b926c572ac9a4a10f.ctex"
uid="uid://cq8lwj2matk6x"
path="res://.godot/imported/flow_spritesheet.png-4637bb4103771b4d4bbc78a0bb858512.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Core Updater.png"
dest_files=["res://.godot/imported/Core Updater.png-3bb461d6b6e9b42b926c572ac9a4a10f.ctex"]
source_file="res://addons/discord-sdk-gd/nodes/assets/flow_spritesheet.png"
dest_files=["res://.godot/imported/flow_spritesheet.png-4637bb4103771b4d4bbc78a0bb858512.ctex"]
[params]

View File

@@ -0,0 +1,12 @@
## [color=yellow]PLEASE IGNORE![/color] This is a important Node wich gets automatically added as Singleton.
##
## 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.
##
## @tutorial: https://github.com/vaporvee/discord-sdk-godot/wiki
class_name core_updater
extends Node
func _process(delta) -> void:
discord_sdk.coreupdate()

View File

@@ -0,0 +1,10 @@
## This is a Debug Node wich will show some usefull info and buttons/input
##
## The DiscordSDK Debug Node will show info about the current values of its variables and some buttons to change them.
##
## @tutorial: https://github.com/vaporvee/discord-sdk-godot/wiki
extends Node
func _ready() -> void:
const DebugNodeGroup: PackedScene = preload("res://addons/discord-sdk-gd/nodes/Debug.tscn")
add_child(DebugNodeGroup.instantiate())

View File

@@ -3,5 +3,5 @@
name="DiscordSDK"
description="Discord Game SDK support for GDScript in Godot"
author="vaporvee"
version="1.3"
version="2.3"
script="plugin.gd"

View File

@@ -1,13 +1,36 @@
@tool
extends EditorPlugin
const ExportPlugin = preload("export.gd")
var loaded_exportplugin = ExportPlugin.new()
const DiscordSDKDebug = preload("res://addons/discord-sdk-gd/nodes/debug.gd")
const DiscordSDKDebug_icon = preload("res://addons/discord-sdk-gd/nodes/assets/Debug.svg")
var loaded_DiscordSDKDebug = DiscordSDKDebug.new()
func _enter_tree():
add_autoload_singleton("updater_discordsdk", "sdk_utility.gd")
add_export_plugin(loaded_exportplugin)
func disable_plugin():
remove_autoload_singleton("updater_discordsdk")
remove_export_plugin(loaded_exportplugin)
func _enter_tree() -> void:
add_custom_type("DiscordSDKDebug","Node",DiscordSDKDebug,DiscordSDKDebug_icon)
add_autoload_singleton("DiscordSDKLoader", "res://addons/discord-sdk-gd/nodes/core_updater.gd")
func _enable_plugin() -> void:
print("DiscordSDK Addon got enabled (PLEASE RESTART THE EDITOR)")
ProjectSettings.set_setting("DiscordSDK/EditorPresence/enabled",false)
ProjectSettings.set_initial_value("DiscordSDK/EditorPresence/enabled",false)
ProjectSettings.set_restart_if_changed("DiscordSDK/EditorPresence/enabled",true)
func _disable_plugin() -> void:
print("DiscordSDK Addon got disabled")
remove_autoload_singleton("DiscordSDKLoader")
remove_custom_type("DiscordSDKDebug")
ProjectSettings.clear("DiscordSDK/EditorPresence/enabled")
func _process(_delta):
if(ProjectSettings.get_setting("DiscordSDK/EditorPresence/enabled")&&!get_editor_interface().is_playing_scene()):
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):
discord_sdk.coreupdate()

View File

@@ -1,4 +0,0 @@
extends Node
func _process(delta):
Discord_Activity.coreupdate()

BIN
project/assets/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://b5dn3rnp5eqqp"
path="res://.godot/imported/Debug.png-81b23c4a8a55e89d458626f08de3d2fb.ctex"
uid="uid://ht210p8vs8s7"
path="res://.godot/imported/1.png-c9a8e694d0d275633d567702fb508122.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Debug.png"
dest_files=["res://.godot/imported/Debug.png-81b23c4a8a55e89d458626f08de3d2fb.ctex"]
source_file="res://assets/1.png"
dest_files=["res://.godot/imported/1.png-c9a8e694d0d275633d567702fb508122.ctex"]
[params]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -1,6 +0,0 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Discord Other">
<path id="Vector" d="M389.77 149.331V469.331H335.043V149.331L273.052 212.264L234.665 173.064L362.534 42.664L490.666 173.064L452.278 213.064L389.77 149.331Z" fill="#5865F2"/>
<path id="Vector_2" d="M122.228 362.666V42.664H176.955L176.955 362.666L238.945 299.731L277.332 338.931L149.462 469.331L21.332 338.931L59.719 298.931L122.228 362.666Z" fill="#5865F2"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

View File

@@ -1,5 +0,0 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Discord Other">
<path id="Vector" d="M426.667 170.667H366.72C357.098 153.978 343.824 139.684 327.893 128.853L362.667 94.08L332.587 64L286.293 110.293C276.48 107.947 266.453 106.667 256 106.667C245.547 106.667 235.52 107.947 225.92 110.293L179.413 64L149.333 94.08L183.893 128.853C168.107 139.733 154.88 154.027 145.28 170.667H85.3333V213.333H129.92C128.853 220.373 128 227.413 128 234.667V256H85.3333V298.667H128V320C128 327.253 128.853 334.293 129.92 341.333H85.3333V384H145.28C167.467 422.187 208.64 448 256 448C303.36 448 344.533 422.187 366.72 384H426.667V341.333H382.08C383.147 334.293 384 327.253 384 320V298.667H426.667V256H384V234.667C384 227.413 383.147 220.373 382.08 213.333H426.667V170.667ZM298.667 341.333H213.333V298.667H298.667V341.333ZM298.667 256H213.333V213.333H298.667V256Z" fill="#5865F2"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 930 B

View File

@@ -8,7 +8,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../demo/Discord_Activity.exe"
export_path="../../exportestt/discord_sdk_demo.exe"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
@@ -35,15 +35,15 @@ codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PackedStringArray()
application/modify_resources=false
application/icon=""
application/modify_resources=true
application/icon="res://assets/Logo_V2.png"
application/console_wrapper_icon=""
application/icon_interpolation=4
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/file_description="Discord SDK Godot Test"
application/copyright=""
application/trademarks=""
ssh_remote_deploy/enabled=false

View File

@@ -1,18 +1,60 @@
extends Node
func _ready():
Discord_Activity.app_id = 1099618430065324082
Discord_Activity.details = "A demo activity by vaporvee#1231"
Discord_Activity.state = "Checkpoint 23/23"
func _ready() -> void:
set_activity()
discord_sdk.connect("activity_join_request",_on_activity_join_request)
discord_sdk.connect("activity_join",_on_activity_join)
discord_sdk.connect("activity_spectate",_on_activity_spectate)
Discord_Activity.large_image = "game"
Discord_Activity.large_image_text = "Try it now!"
Discord_Activity.small_image = "boss"
Discord_Activity.small_image_text = "Fighting the end boss! D:"
func set_activity() -> void:
discord_sdk.clear()
discord_sdk.app_id = 1099618430065324082
discord_sdk.details = "A demo activity by vaporvee#1231"
discord_sdk.state = "Checkpoint 23/23"
discord_sdk.large_image = "example_game"
discord_sdk.large_image_text = "Try it now!"
discord_sdk.small_image = "boss"
discord_sdk.small_image_text = "Fighting the end boss! D:"
discord_sdk.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time
# It is NOT recommended to manage secrets locally! It's meant to be a payload wich the server
# understands and returns the other variables like current_party_size, party_id etc. Most of the values must differ from the others.
var my_secret: String = str(randi_range(0,999999))
discord_sdk.party_id = "mylobbycanbeeverything_" + my_secret
discord_sdk.current_party_size = 1
discord_sdk.max_party_size = 4
discord_sdk.match_secret = "m_" + my_secret #better use seeds with 1 to 1 range instead of just chars
discord_sdk.join_secret = "j_" + my_secret
discord_sdk.spectate_secret = "s_" + my_secret
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_steam(1389990)
discord_sdk.refresh()
#Discord_Activity.start_timestamp = int(Time.get_unix_time_from_system())
Discord_Activity.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time
var user_request: Dictionary;
Discord_Activity.refresh()
func _on_activity_join_request(user_requesting) -> void:
print(user_requesting)
user_request = user_requesting
$Info.text = $Info.text.replace("{discordinfo}",str(Discord_Activity.get_is_discord_working())).replace("{id}",str(Discord_Activity.app_id)).replace("{details}",Discord_Activity.details).replace("{state}",Discord_Activity.state).replace("{lkey}",Discord_Activity.large_image).replace("{ltext}",Discord_Activity.large_image_text).replace("{skey}",Discord_Activity.small_image).replace("{stext}",Discord_Activity.small_image_text).replace("{stimestamp}",str(Discord_Activity.start_timestamp)).replace("{etimestamp}",str(Discord_Activity.end_timestamp))
func _on_activity_join(secret) -> void:
if(discord_sdk.join_secret != secret):
discord_sdk.current_party_size = clamp(int(secret) + 1, 0, discord_sdk.max_party_size)
discord_sdk.party_id = secret.replace("j_","mylobbycanbeeverything_")
discord_sdk.match_secret = secret.replace("j_","m_")
discord_sdk.join_secret = secret
discord_sdk.spectate_secret = secret.replace("j_","s_")
discord_sdk.refresh()
func _on_activity_spectate(secret) -> void:
print(secret)
func _on_toggle_sdk_toggled(button_pressed):
if(button_pressed):
set_activity()
else:
discord_sdk.clear()

View File

@@ -1,7 +1,12 @@
[gd_scene load_steps=3 format=3 uid="uid://dmx2xuigcpvt4"]
[gd_scene load_steps=7 format=3 uid="uid://dyc3kseph4el7"]
[ext_resource type="Script" path="res://main.gd" id="1_kl8ri"]
[ext_resource type="Texture2D" uid="uid://dhuttdaet6q1u" path="res://assets/Logo_V2_Clyde.png" id="2_1hv5q"]
[ext_resource type="Texture2D" uid="uid://b3qm246m7pnsx" path="res://assets/Logo_V2.png" id="2_gd222"]
[ext_resource type="Texture2D" uid="uid://dnfq6kug4x6o2" path="res://addons/discord-sdk-gd/nodes/assets/Checked.svg" id="3_wajuo"]
[ext_resource type="Texture2D" uid="uid://compmm3kviqqe" path="res://addons/discord-sdk-gd/nodes/assets/Unchecked.svg" id="4_8hvtu"]
[ext_resource type="Script" path="res://addons/discord-sdk-gd/nodes/debug.gd" id="6_ujijw"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_phc3u"]
[node name="Node" type="Node"]
script = ExtResource("1_kl8ri")
@@ -18,45 +23,43 @@ color = Color(0.345098, 0.396078, 0.94902, 1)
[node name="Sprite2D" type="Sprite2D" parent="."]
texture_filter = 4
position = Vector2(565, 308)
position = Vector2(580, 308)
scale = Vector2(0.408203, 0.408203)
texture = ExtResource("2_1hv5q")
texture = ExtResource("2_gd222")
[node name="DiscordSDK Test" type="RichTextLabel" parent="."]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -257.0
offset_top = 54.0
offset_right = 257.0
offset_bottom = 150.0
anchors_preset = -1
anchor_left = 0.293
anchor_top = 0.59
anchor_right = 0.736
anchor_bottom = 0.727
offset_left = -0.536011
offset_top = -0.319977
offset_right = 0.12793
offset_bottom = -0.0960388
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
theme_override_colors/font_outline_color = Color(1, 1, 1, 1)
theme_override_constants/outline_size = 10
bbcode_enabled = true
text = "[center][font s=60][rainbow]DiscordSDK Test[/rainbow][/font]"
text = "[center][font s=60]DiscordSDK Test"
[node name="Info" type="RichTextLabel" parent="."]
offset_left = 7.0
offset_top = 6.0
offset_right = 514.0
offset_bottom = 722.0
text = "Discord working: {discordinfo}
[node name="DiscordSDKDebug" type="Node" parent="."]
script = ExtResource("6_ujijw")
Application ID : {id}
Details: {details}
State: {state}
[node name="ToggleSDK" type="CheckButton" parent="."]
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 293.0
offset_top = 142.375
offset_right = 1139.0
offset_bottom = 650.375
grow_vertical = 2
scale = Vector2(0.05, 0.05)
theme_override_icons/checked = ExtResource("3_wajuo")
theme_override_icons/unchecked = ExtResource("4_8hvtu")
theme_override_styles/focus = SubResource("StyleBoxEmpty_phc3u")
button_pressed = true
Large image key: {lkey}
Large image text: {ltext}
Small image key: {skey}
Small image text: {stext}
Start timestamp: {stimestamp}
End timestamp: {etimestamp}"
scroll_active = false
[connection signal="toggled" from="ToggleSDK" to="." method="_on_toggle_sdk_toggled"]

View File

@@ -20,7 +20,11 @@ config/icon="res://assets/Logo_V2.png"
[autoload]
updater_discordsdk="*res://addons/discord-sdk-gd/sdk_utility.gd"
DiscordSDKLoader="*res://addons/discord-sdk-gd/nodes/core_updater.gd"
[display]
window/size/resizable=false
[dotnet]

12
release.py Normal file
View File

@@ -0,0 +1,12 @@
import os
from distutils.dir_util import copy_tree
import shutil
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")
shutil.make_archive("release/ADDON-Discord-SDK-Godot", "zip", "release/temp/")
shutil.rmtree("release/temp/")

View File

@@ -6,6 +6,12 @@ import os
with zipfile.ZipFile("src/lib/discord_game_sdk.zip", "r") as zip_ref:
zip_ref.extractall("src/lib/discord_game_sdk/")
# Patch the SDK to actually build, since it's missing an include
with open("src/lib/discord_game_sdk/cpp/types.h", "r+") as f:
s = f.read();
f.seek(0);
f.write("#include <cstdint>\n" + s)
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",

View File

@@ -7,80 +7,133 @@
using namespace godot;
Discord_Activity *Discord_Activity::singleton = nullptr;
discord_sdk *discord_sdk::singleton = nullptr;
discord::Core *core{};
discord::Result result;
discord::Activity activity{};
discord::User user{};
void Discord_Activity::_bind_methods()
void discord_sdk::_bind_methods()
{
ClassDB::bind_method(D_METHOD("debug"), &Discord_Activity::debug);
ClassDB::bind_method(D_METHOD("coreupdate"), &Discord_Activity::coreupdate);
ClassDB::bind_method(D_METHOD("debug"), &discord_sdk::debug);
ClassDB::bind_method(D_METHOD("coreupdate"), &discord_sdk::coreupdate);
ClassDB::bind_method(D_METHOD("get_app_id"), &Discord_Activity::get_app_id);
ClassDB::bind_method(D_METHOD("set_app_id", "app_id"), &Discord_Activity::set_app_id);
ClassDB::bind_method(D_METHOD("get_app_id"), &discord_sdk::get_app_id);
ClassDB::bind_method(D_METHOD("set_app_id", "app_id"), &discord_sdk::set_app_id);
ADD_PROPERTY(PropertyInfo(Variant::INT, "app_id"), "set_app_id", "get_app_id");
ClassDB::bind_method(D_METHOD("get_state"), &Discord_Activity::get_state);
ClassDB::bind_method(D_METHOD("set_state", "state"), &Discord_Activity::set_state);
ClassDB::bind_method(D_METHOD("get_state"), &discord_sdk::get_state);
ClassDB::bind_method(D_METHOD("set_state", "state"), &discord_sdk::set_state);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "state"), "set_state", "get_state");
ClassDB::bind_method(D_METHOD("get_details"), &Discord_Activity::get_details);
ClassDB::bind_method(D_METHOD("set_details", "details"), &Discord_Activity::set_details);
ClassDB::bind_method(D_METHOD("get_details"), &discord_sdk::get_details);
ClassDB::bind_method(D_METHOD("set_details", "details"), &discord_sdk::set_details);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "details"), "set_details", "get_details");
ClassDB::bind_method(D_METHOD("get_large_image"), &Discord_Activity::get_large_image);
ClassDB::bind_method(D_METHOD("set_large_image", "large_image"), &Discord_Activity::set_large_image);
ClassDB::bind_method(D_METHOD("get_large_image"), &discord_sdk::get_large_image);
ClassDB::bind_method(D_METHOD("set_large_image", "large_image"), &discord_sdk::set_large_image);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "large_image"), "set_large_image", "get_large_image");
ClassDB::bind_method(D_METHOD("get_large_image_text"), &Discord_Activity::get_large_image_text);
ClassDB::bind_method(D_METHOD("set_large_image_text", "large_image_text"), &Discord_Activity::set_large_image_text);
ClassDB::bind_method(D_METHOD("get_large_image_text"), &discord_sdk::get_large_image_text);
ClassDB::bind_method(D_METHOD("set_large_image_text", "large_image_text"), &discord_sdk::set_large_image_text);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "large_image_text"), "set_large_image_text", "get_large_image_text");
ClassDB::bind_method(D_METHOD("get_small_image"), &Discord_Activity::get_small_image);
ClassDB::bind_method(D_METHOD("set_small_image", "small_image"), &Discord_Activity::set_small_image);
ClassDB::bind_method(D_METHOD("get_small_image"), &discord_sdk::get_small_image);
ClassDB::bind_method(D_METHOD("set_small_image", "small_image"), &discord_sdk::set_small_image);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "small_image"), "set_small_image", "get_small_image");
ClassDB::bind_method(D_METHOD("get_small_image_text"), &Discord_Activity::get_small_image_text);
ClassDB::bind_method(D_METHOD("set_small_image_text", "large_small_text"), &Discord_Activity::set_small_image_text);
ClassDB::bind_method(D_METHOD("get_small_image_text"), &discord_sdk::get_small_image_text);
ClassDB::bind_method(D_METHOD("set_small_image_text", "large_small_text"), &discord_sdk::set_small_image_text);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "small_image_text"), "set_small_image_text", "get_small_image_text");
ClassDB::bind_method(D_METHOD("get_start_timestamp"), &Discord_Activity::get_start_timestamp);
ClassDB::bind_method(D_METHOD("set_start_timestamp", "start_timestamp"), &Discord_Activity::set_start_timestamp);
ClassDB::bind_method(D_METHOD("get_start_timestamp"), &discord_sdk::get_start_timestamp);
ClassDB::bind_method(D_METHOD("set_start_timestamp", "start_timestamp"), &discord_sdk::set_start_timestamp);
ADD_PROPERTY(PropertyInfo(Variant::INT, "start_timestamp"), "set_start_timestamp", "get_start_timestamp");
ClassDB::bind_method(D_METHOD("get_end_timestamp"), &Discord_Activity::get_end_timestamp);
ClassDB::bind_method(D_METHOD("set_end_timestamp", "end_timestamp"), &Discord_Activity::set_end_timestamp);
ClassDB::bind_method(D_METHOD("get_end_timestamp"), &discord_sdk::get_end_timestamp);
ClassDB::bind_method(D_METHOD("set_end_timestamp", "end_timestamp"), &discord_sdk::set_end_timestamp);
ADD_PROPERTY(PropertyInfo(Variant::INT, "end_timestamp"), "set_end_timestamp", "get_end_timestamp");
ClassDB::bind_method(D_METHOD("refresh"), &Discord_Activity::refresh);
ClassDB::bind_method(D_METHOD("get_party_id"), &discord_sdk::get_party_id);
ClassDB::bind_method(D_METHOD("get_is_discord_working"), &Discord_Activity::get_is_discord_working);
ClassDB::bind_method(D_METHOD("set_party_id", "party_id"), &discord_sdk::set_party_id);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "party_id"), "set_party_id", "get_party_id");
ClassDB::bind_method(D_METHOD("get_result_int"), &Discord_Activity::get_result_int);
ClassDB::bind_method(D_METHOD("get_current_party_size"), &discord_sdk::get_current_party_size);
ClassDB::bind_method(D_METHOD("set_current_party_size", "current_party_size"), &discord_sdk::set_current_party_size);
ADD_PROPERTY(PropertyInfo(Variant::INT, "current_party_size"), "set_current_party_size", "get_current_party_size");
ClassDB::bind_method(D_METHOD("get_max_party_size"), &discord_sdk::get_max_party_size);
ClassDB::bind_method(D_METHOD("set_max_party_size", "max_party_size"), &discord_sdk::set_max_party_size);
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_party_size"), "set_max_party_size", "get_max_party_size");
ClassDB::bind_method(D_METHOD("get_match_secret"), &discord_sdk::get_match_secret);
ClassDB::bind_method(D_METHOD("set_match_secret", "match_secret"), &discord_sdk::set_match_secret);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "match_secret"), "set_match_secret", "get_match_secret");
ClassDB::bind_method(D_METHOD("get_join_secret"), &discord_sdk::get_join_secret);
ClassDB::bind_method(D_METHOD("set_join_secret", "join_secret"), &discord_sdk::set_join_secret);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "join_secret"), "set_join_secret", "get_join_secret");
ClassDB::bind_method(D_METHOD("get_spectate_secret"), &discord_sdk::get_spectate_secret);
ClassDB::bind_method(D_METHOD("set_spectate_secret", "spectate_secret"), &discord_sdk::set_spectate_secret);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "spectate_secret"), "set_spectate_secret", "get_spectate_secret");
ClassDB::bind_method(D_METHOD("get_instanced"), &discord_sdk::get_instanced);
ClassDB::bind_method(D_METHOD("set_instanced", "instanced"), &discord_sdk::set_instanced);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "instanced"), "set_instanced", "get_instanced");
ClassDB::bind_method(D_METHOD("get_is_public_party"), &discord_sdk::get_is_public_party);
ClassDB::bind_method(D_METHOD("set_is_public_party", "is_public_party"), &discord_sdk::set_is_public_party);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "is_public_party"), "set_is_public_party", "get_is_public_party");
ADD_SIGNAL(MethodInfo("activity_join", PropertyInfo(Variant::STRING, "join_secret")));
ADD_SIGNAL(MethodInfo("activity_spectate", PropertyInfo(Variant::STRING, "spectate_secret")));
ADD_SIGNAL(MethodInfo("activity_join_request", PropertyInfo(Variant::DICTIONARY, "user_requesting")));
ClassDB::bind_method(D_METHOD("refresh"), &discord_sdk::refresh);
ClassDB::bind_method(D_METHOD("clear"), &discord_sdk::clear);
ClassDB::bind_method(D_METHOD("register_command", "command"), &discord_sdk::register_command);
ClassDB::bind_method(D_METHOD("register_steam", "steam_id"), &discord_sdk::register_steam);
ClassDB::bind_method(D_METHOD("accept_join_request", "user_id"), &discord_sdk::accept_join_request);
ClassDB::bind_method(D_METHOD("send_invite", "user_id", "is_spectate", "message_content"), &discord_sdk::send_invite);
ClassDB::bind_method(D_METHOD("accept_invite", "user_id"), &discord_sdk::accept_invite);
ClassDB::bind_method(D_METHOD("get_current_user"), &discord_sdk::get_current_user);
ClassDB::bind_method(D_METHOD("get_is_overlay_enabled"), &discord_sdk::get_is_overlay_enabled);
ClassDB::bind_method(D_METHOD("get_is_overlay_locked"), &discord_sdk::get_is_overlay_locked);
ClassDB::bind_method(D_METHOD("set_is_overlay_locked", "is_overlay_locked"), &discord_sdk::set_is_overlay_locked);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "is_overlay_locked"), "set_is_overlay_locked", "get_is_overlay_locked");
ClassDB::bind_method(D_METHOD("open_invite_overlay", "is_spectate"), &discord_sdk::open_invite_overlay);
ClassDB::bind_method(D_METHOD("open_server_invite_overlay", "invite_code"), &discord_sdk::open_server_invite_overlay);
ClassDB::bind_method(D_METHOD("open_voice_settings"), &discord_sdk::open_voice_settings);
ADD_SIGNAL(MethodInfo("overlay_toggle", PropertyInfo(Variant::BOOL, "is_locked")));
ClassDB::bind_method(D_METHOD("get_is_discord_working"), &discord_sdk::get_is_discord_working);
ClassDB::bind_method(D_METHOD("get_result_int"), &discord_sdk::get_result_int);
}
Discord_Activity *Discord_Activity::get_singleton()
discord_sdk *discord_sdk::get_singleton()
{
return singleton;
}
Discord_Activity::Discord_Activity()
discord_sdk::discord_sdk()
{
ERR_FAIL_COND(singleton != nullptr);
singleton = this;
}
Discord_Activity::~Discord_Activity()
discord_sdk::~discord_sdk()
{
ERR_FAIL_COND(singleton != this);
singleton = nullptr;
delete core;
core = nullptr;
}
void Discord_Activity::coreupdate()
void discord_sdk::coreupdate()
{
if (result == discord::Result::Ok && app_id > 0)
{
::core->RunCallbacks();
}
}
void Discord_Activity::debug()
void discord_sdk::debug()
{
result = discord::Core::Create(1080224638845591692, DiscordCreateFlags_NoRequireDiscord, &core);
activity.SetState("Test from Godot!");
@@ -93,116 +146,335 @@ void Discord_Activity::debug()
if (result == discord::Result::Ok)
{
core->ActivityManager().UpdateActivity(activity, [](discord::Result result) {});
core->UserManager().OnCurrentUserUpdate.Connect([]()
{ core->UserManager().GetCurrentUser(&user); });
}
else
UtilityFunctions::push_warning("Discord Activity couldn't be updated. It could be that Discord isn't running!");
}
void Discord_Activity::set_app_id(int64_t value)
void discord_sdk::set_app_id(int64_t value)
{
app_id = value;
result = discord::Core::Create(value, DiscordCreateFlags_NoRequireDiscord, &core);
result = discord::Core::Create(value, DiscordCreateFlags_NoRequireDiscord, &core); // after setting app_ID it initializes everything
if (result == discord::Result::Ok && app_id > 0)
{
// initialize currentuser stuff
core->UserManager().OnCurrentUserUpdate.Connect([]()
{discord::User user{};
core->UserManager().GetCurrentUser(&user); });
// signals
core->ActivityManager().OnActivityJoin.Connect([](const char *secret)
{ discord_sdk::get_singleton()
->emit_signal("activity_join", secret); });
core->ActivityManager().OnActivitySpectate.Connect([](const char *secret)
{ discord_sdk::get_singleton()
->emit_signal("activity_spectate", secret); });
core->ActivityManager().OnActivityJoinRequest.Connect([this](discord::User const &user)
{ Dictionary user_requesting;
user_requesting["avatar"] = user.GetAvatar(); //can be empty when user has no avatar
user_requesting["is_bot"] = user.GetBot();
user_requesting["discriminator"] = user.GetDiscriminator();
user_requesting["id"] = user.GetId();
user_requesting["username"] = user.GetUsername();
if(String(user_requesting["avatar"]).is_empty())
user_requesting["avatar_url"] = String(std::string("https://cdn.discordapp.com/embed/avatars/" + std::to_string((user_requesting["discriminator"].INT % 5) - 1)+ ".png").c_str());
else
user_requesting["avatar_url"] = String(std::string("https://cdn.discordapp.com/avatars/" + std::to_string(user.GetId()) + "/" + user.GetAvatar() + ".png?size=512").c_str());//I don't know what the hell i did there but removing ?size=512 will crash the whole editor
user_requesting.make_read_only();
discord_sdk::get_singleton()
->emit_signal("activity_join_request",user_requesting); });
core->OverlayManager().OnToggle.Connect([](bool is_locked)
{ discord_sdk::get_singleton()
->emit_signal("overlay_toggle", is_locked); });
}
}
int64_t Discord_Activity::get_app_id()
int64_t discord_sdk::get_app_id()
{
return app_id;
}
void Discord_Activity::set_state(String value)
void discord_sdk::set_state(String value)
{
state = value;
activity.SetState(value.utf8().get_data());
}
String Discord_Activity::get_state()
String discord_sdk::get_state()
{
return state;
}
void Discord_Activity::set_details(String value)
void discord_sdk::set_details(String value)
{
details = value;
activity.SetDetails(value.utf8().get_data());
}
String Discord_Activity::get_details()
String discord_sdk::get_details()
{
return details;
}
void Discord_Activity::refresh()
void discord_sdk::refresh()
{
if (result == discord::Result::Ok && app_id > 0)
{
activity.GetParty().SetPrivacy(discord::ActivityPartyPrivacy::Public);
activity.SetType(discord::ActivityType::Playing);
core->ActivityManager().UpdateActivity(activity, [](discord::Result result) {});
core->UserManager().OnCurrentUserUpdate.Connect([]()
{ core->UserManager().GetCurrentUser(&user); });
}
else
UtilityFunctions::push_warning("Discord Activity couldn't be updated. It could be that Discord isn't running!");
}
void Discord_Activity::set_large_image(String value)
void discord_sdk::clear()
{
if (result == discord::Result::Ok)
{
app_id = 0;
state = "";
details = "";
large_image = "";
large_image_text = "";
small_image = "";
small_image_text = "";
start_timestamp = 0;
end_timestamp = 0;
party_id = "";
current_party_size = 0;
max_party_size = 0;
match_secret = "";
join_secret = "";
spectate_secret = "";
instanced = false;
is_public_party = false;
is_overlay_locked = false;
delete core;
core = nullptr;
}
}
void discord_sdk::set_large_image(String value)
{
large_image = value;
activity.GetAssets().SetLargeImage(value.utf8().get_data());
}
String Discord_Activity::get_large_image()
String discord_sdk::get_large_image()
{
return large_image;
}
void Discord_Activity::set_large_image_text(String value)
void discord_sdk::set_large_image_text(String value)
{
large_image_text = value;
activity.GetAssets().SetLargeText(value.utf8().get_data());
}
String Discord_Activity::get_large_image_text()
String discord_sdk::get_large_image_text()
{
return large_image_text;
}
void Discord_Activity::set_small_image(String value)
void discord_sdk::set_small_image(String value)
{
small_image = value;
activity.GetAssets().SetSmallImage(value.utf8().get_data());
}
String Discord_Activity::get_small_image()
String discord_sdk::get_small_image()
{
return small_image;
}
void Discord_Activity::set_small_image_text(String value)
void discord_sdk::set_small_image_text(String value)
{
small_image_text = value;
activity.GetAssets().SetSmallText(value.utf8().get_data());
}
String Discord_Activity::get_small_image_text()
String discord_sdk::get_small_image_text()
{
return small_image_text;
}
void Discord_Activity::set_start_timestamp(int64_t value)
void discord_sdk::set_start_timestamp(int64_t value)
{
start_timestamp = value;
activity.GetTimestamps().SetStart(value);
}
int64_t Discord_Activity::get_start_timestamp()
int64_t discord_sdk::get_start_timestamp()
{
return activity.GetTimestamps().GetStart();
}
void Discord_Activity::set_end_timestamp(int64_t value)
void discord_sdk::set_end_timestamp(int64_t value)
{
end_timestamp = value;
activity.GetTimestamps().SetEnd(value);
}
int64_t Discord_Activity::get_end_timestamp()
int64_t discord_sdk::get_end_timestamp()
{
return activity.GetTimestamps().GetEnd();
}
bool Discord_Activity::get_is_discord_working()
void discord_sdk::set_party_id(String value)
{
party_id = value;
activity.GetParty().SetId(value.utf8().get_data());
}
String discord_sdk::get_party_id()
{
return party_id;
}
void discord_sdk::set_current_party_size(int32_t value)
{
current_party_size = value;
activity.GetParty().GetSize().SetCurrentSize(value);
}
int32_t discord_sdk::get_current_party_size()
{
return current_party_size;
}
void discord_sdk::set_max_party_size(int32_t value)
{
max_party_size = value;
activity.GetParty().GetSize().SetMaxSize(value);
}
int32_t discord_sdk::get_max_party_size()
{
return max_party_size;
}
void discord_sdk::set_match_secret(String value)
{
match_secret = value;
activity.GetSecrets().SetMatch(value.utf8().get_data());
}
String discord_sdk::get_match_secret()
{
return match_secret;
}
void discord_sdk::set_join_secret(String value)
{
join_secret = value;
activity.GetSecrets().SetJoin(value.utf8().get_data());
}
String discord_sdk::get_join_secret()
{
return join_secret;
}
void discord_sdk::set_spectate_secret(String value)
{
spectate_secret = value;
activity.GetSecrets().SetSpectate(value.utf8().get_data());
}
String discord_sdk::get_spectate_secret()
{
return spectate_secret;
}
void discord_sdk::set_instanced(bool value)
{
instanced = value;
activity.SetInstance(value);
}
bool discord_sdk::get_instanced()
{
return instanced;
}
bool discord_sdk::get_is_overlay_enabled()
{
bool ie;
if (result == discord::Result::Ok && app_id > 0)
core->OverlayManager().IsEnabled(&ie);
return ie;
}
bool discord_sdk::get_is_overlay_locked()
{
bool il;
if (result == discord::Result::Ok && app_id > 0)
core->OverlayManager().IsLocked(&il);
return il;
}
void discord_sdk::set_is_overlay_locked(bool value)
{
is_overlay_locked = value;
if (result == discord::Result::Ok && app_id > 0)
core->OverlayManager().SetLocked(value, {});
}
void discord_sdk::open_invite_overlay(bool is_spectate)
{
if (result == discord::Result::Ok && app_id > 0)
core->OverlayManager().OpenActivityInvite(static_cast<discord::ActivityActionType>(is_spectate + 1), {});
}
void discord_sdk::open_server_invite_overlay(String invite_code)
{
if (result == discord::Result::Ok && app_id > 0)
core->OverlayManager().OpenGuildInvite(invite_code.utf8().get_data(), {});
}
void discord_sdk::open_voice_settings()
{
if (result == discord::Result::Ok && app_id > 0)
core->OverlayManager().OpenVoiceSettings({});
}
void discord_sdk::set_is_public_party(bool value)
{
is_public_party = value;
activity.GetParty().SetPrivacy(static_cast<discord::ActivityPartyPrivacy>(value)); // normaly true
}
bool discord_sdk::get_is_public_party()
{
return is_public_party;
}
void discord_sdk::accept_join_request(int64_t user_id)
{
if (result == discord::Result::Ok && app_id > 0)
core->ActivityManager().SendRequestReply(user_id, static_cast<discord::ActivityJoinRequestReply>(1), {});
}
void discord_sdk::send_invite(int64_t user_id, bool is_spectate = false, String message_content = "")
{
if (result == discord::Result::Ok && app_id > 0)
core->ActivityManager().SendInvite(user_id, static_cast<discord::ActivityActionType>(is_spectate + 1), message_content.utf8().get_data(), {});
}
void discord_sdk::accept_invite(int64_t user_id)
{
if (result == discord::Result::Ok && app_id > 0)
core->ActivityManager().AcceptInvite(user_id, {});
}
void discord_sdk::register_command(String value)
{
if (result == discord::Result::Ok && app_id > 0)
core->ActivityManager().RegisterCommand(value.utf8().get_data());
}
void discord_sdk::register_steam(int32_t value)
{
if (result == discord::Result::Ok && app_id > 0)
core->ActivityManager().RegisterSteam(value);
}
Dictionary discord_sdk::get_current_user()
{
Dictionary userdict;
if (result == discord::Result::Ok && app_id > 0)
{
discord::User user{};
core->UserManager().GetCurrentUser(&user);
userdict["avatar"] = user.GetAvatar(); // can be empty when user has no avatar
userdict["is_bot"] = user.GetBot();
userdict["discriminator"] = user.GetDiscriminator();
userdict["id"] = user.GetId();
userdict["username"] = user.GetUsername();
if (String(userdict["avatar"]).is_empty())
userdict["avatar_url"] = String(std::string("https://cdn.discordapp.com/embed/avatars/" + std::to_string((userdict["discriminator"].INT % 5) - 1) + ".png").c_str());
else
userdict["avatar_url"] = String(std::string("https://cdn.discordapp.com/avatars/" + std::to_string(user.GetId()) + "/" + user.GetAvatar() + ".png?size=512").c_str());
userdict.make_read_only();
}
return userdict;
}
bool discord_sdk::get_is_discord_working()
{
return result == discord::Result::Ok && app_id > 0;
}
int Discord_Activity::get_result_int()
int discord_sdk::get_result_int()
{
return static_cast<int>(result);
}

View File

@@ -3,22 +3,22 @@
#include <stdio.h>
#include "lib/discord_game_sdk/cpp/discord.h"
#include <godot_cpp/classes/object.hpp>
#include <godot_cpp/classes/ref_counted.hpp>
#include <godot_cpp/core/class_db.hpp>
using namespace godot;
class Discord_Activity : public Object
class discord_sdk : public RefCounted
{
GDCLASS(Discord_Activity, Object);
GDCLASS(discord_sdk, Object);
static Discord_Activity *singleton;
static discord_sdk *singleton;
protected:
static void _bind_methods();
private:
int64_t app_id;
int64_t app_id = 0;
String state;
String details;
@@ -31,18 +31,32 @@ private:
int64_t start_timestamp;
int64_t end_timestamp;
public:
static Discord_Activity *get_singleton();
String party_id;
int32_t current_party_size;
int32_t max_party_size;
String match_secret;
String join_secret;
String spectate_secret;
Discord_Activity();
~Discord_Activity();
bool is_public_party;
bool instanced;
bool is_overlay_locked;
public:
static discord_sdk *
get_singleton();
discord_sdk();
~discord_sdk();
void debug();
void coreupdate();
void refresh();
void clear();
int64_t get_app_id();
void set_app_id(int64_t value);
String get_state();
void set_state(String value);
@@ -63,6 +77,42 @@ public:
int64_t get_end_timestamp();
void set_end_timestamp(int64_t value);
String get_party_id();
void set_party_id(String value);
int32_t get_current_party_size();
void set_current_party_size(int32_t value);
int32_t get_max_party_size();
void set_max_party_size(int32_t value);
String get_match_secret();
void set_match_secret(String value);
String get_join_secret();
void set_join_secret(String value);
String get_spectate_secret();
void set_spectate_secret(String value);
bool get_is_public_party();
void set_is_public_party(bool value);
bool get_instanced();
void set_instanced(bool value);
bool get_is_overlay_enabled();
bool get_is_overlay_locked();
void set_is_overlay_locked(bool value);
void open_invite_overlay(bool is_spectate);
void open_server_invite_overlay(String invite_code);
void open_voice_settings();
void accept_join_request(int64_t user_id);
void send_invite(int64_t user_id, bool is_spectate, String message_content);
void accept_invite(int64_t user_id);
void register_command(String value);
void register_steam(int32_t value);
Dictionary get_current_user();
bool get_is_discord_working();
int get_result_int();
};

View File

@@ -9,15 +9,15 @@
#include "discordgodot.h"
using namespace godot;
static Discord_Activity *discordsdk;
static discord_sdk *discordsdk;
void gdextension_initialize(ModuleInitializationLevel p_level)
{
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE)
{
ClassDB::register_class<Discord_Activity>();
discordsdk = memnew(Discord_Activity);
Engine::get_singleton()->register_singleton("Discord_Activity", Discord_Activity::get_singleton());
ClassDB::register_class<discord_sdk>();
discordsdk = memnew(discord_sdk);
Engine::get_singleton()->register_singleton("discord_sdk", discord_sdk::get_singleton());
}
}
@@ -25,7 +25,7 @@ void gdextension_terminate(ModuleInitializationLevel p_level)
{
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE)
{
Engine::get_singleton()->unregister_singleton("Discord_Activity");
Engine::get_singleton()->unregister_singleton("discord_sdk");
memdelete(discordsdk);
}
}