started working on the docs sidebar
This commit is contained in:
@@ -20,7 +20,7 @@ export default defineConfig({
|
||||
remarkPlugins: [remarkDirective, remarkCalloutDirectives, [remarkExternalLinks, {
|
||||
target: '_blank'
|
||||
}]],
|
||||
drafts: true,
|
||||
drafts: false,
|
||||
shikiConfig: {
|
||||
theme: 'dracula'
|
||||
}
|
||||
|
@@ -5,10 +5,23 @@ const title = frontmatter.title + "| Docs";
|
||||
---
|
||||
|
||||
<Layout
|
||||
title={title}
|
||||
description="This is my personal website with my projects, docs and other useful stuff."
|
||||
title={title}
|
||||
description="This is my personal website with my projects, docs and other useful stuff."
|
||||
>
|
||||
<div class="content">
|
||||
<h1 style="text-align: center;">{frontmatter.title}</h1><slot />
|
||||
<div class="content">
|
||||
<h1 style="text-align: center;">{frontmatter.title}</h1>
|
||||
<a href={"https://github.com/vaporvee/" + frontmatter.repo}
|
||||
><img
|
||||
src="/github-mark.svg"
|
||||
style="margin-bottom: -10px; margin-right:3px;"
|
||||
/>Respository</a
|
||||
><br />
|
||||
<br />
|
||||
<hr />
|
||||
<br />
|
||||
<slot />
|
||||
<div class="sidebar">
|
||||
<a href={"/docs/" + frontmatter.repo}>{frontmatter.repo}</a>
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
|
99
src/pages/docs/discord-sdk-godot/activities.mdx
Normal file
99
src/pages/docs/discord-sdk-godot/activities.mdx
Normal file
@@ -0,0 +1,99 @@
|
||||
---
|
||||
layout: ../../../layouts/DocsLayout.astro
|
||||
repo: discord-sdk-godot
|
||||
title: Activities
|
||||
draft: true
|
||||
---
|
||||
|
||||
# Variables
|
||||
|
||||
Anything of course begins with `DiscordSDK.` e.g. `DiscordSDK.app_id = <your Application ID>`
|
||||
### Rich presence
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| app_id | int | The Application ID you need to get to make anything in the SDK → https://discord.com/developers/applications |
|
||||
| details | String | The first text line visible in the Activity (after the app name) |
|
||||
| state | String | The second text line visible in the Activity |
|
||||
| large_image | String | Key for the large image you set while uploading an image to the "Rich Presence" → "Art Assets" tab in your online Discord dev panel |
|
||||
| large_image_text | String | Text wich shows when you hover over the large image |
|
||||
| small_image | String | Key for the small image you set while uploading an image to the "Rich Presence" → "Art Assets" tab in your online Discord dev panel |
|
||||
| small_image_text | String | Text wich shows when you hover over the small image |
|
||||
| start_timestamp | int | The "02:46 elapsed" timestamp in the presence. Get the current time with Godot's `int(Time.get_unix_time_from_system())` and Discord counts in seconds from it |
|
||||
| end_timestamp | int | The "59:59 elapsed" timestamp in the presence. Get it with Godot's `int(Time.get_unix_time_from_system())` and add seconds as int e.g. `+ 3600` → + 1 Hour |
|
||||
|
||||
### Invite system
|
||||
The values can be pretty anything since there is no lobby system in the SDK anymore. You should already have a custom lobby system wich can compute the secret and change the values. After an invite every value should be the same as the other player.
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| party_id | String | Unique identifier for the party |
|
||||
| current_party_size | int | The current playercount in the party |
|
||||
| max_party_size | int | Maximum allowed playercount in the party |
|
||||
| match_secret | String | Unique hash for the given match context |
|
||||
| join_secret | String | Unique hash for chat invites and Ask to Join |
|
||||
| spectate_secret | String | Unique hash for Spectate button |
|
||||
| is_public_party | bool | Turn it to `true` if you want people to join the party without asking. This needs to be enabled in the Discord user settings |
|
||||
| instanced | bool | Whether this activity is an instanced context, like a match |
|
||||
|
||||
# Signals
|
||||
### Invite system
|
||||
|
||||
### Activity join request
|
||||
**Connect it with:**
|
||||
```gdscript
|
||||
DiscordSDK.connect("activity_join_request",_on_activity_join_request)
|
||||
```
|
||||
**Add it in your gdscript as function:**
|
||||
```gdscript
|
||||
func _on_activity_join_request(user_requesting):
|
||||
```
|
||||
The Signal fires when someone requests to join your Activity via an request join button in Discord.<br/>
|
||||
**Given variable:** [`Dictionary user_requesting`](https://github.com/vaporvee/discord-sdk-godot/wiki/Users#get-current-user)
|
||||
<br/>
|
||||
<br/>
|
||||
### Activity join
|
||||
**Connect it with:**
|
||||
```gdscript
|
||||
DiscordSDK.connect("activity_join",_on_activity_join)
|
||||
```
|
||||
**Add it in your gdscript as function:**
|
||||
```gdscript
|
||||
func _on_activity_join(secret):
|
||||
```
|
||||
The Signal fires when someone joins your Activity via an invite or join button in Discord.<br/>
|
||||
**Given variable:** `String secret`<br/>
|
||||
Send the secret to your custom system to generate the other party values and make them the same as the target user.
|
||||
<br/>
|
||||
<br/>
|
||||
### Activity spectate
|
||||
**Connect it with:**
|
||||
```gdscript
|
||||
DiscordSDK.connect("activity_spectate",_on_activity_spectate)
|
||||
```
|
||||
**Add it in your gdscript as function:**
|
||||
```gdscript
|
||||
func _on_activity_spectate(secret):
|
||||
```
|
||||
The Signal fires when someone spectates your Activity via an invite or spectate button in Discord.<br/>
|
||||
**Given variable:** `String secret` <br/>
|
||||
Send the secret to your custom system to generate the other party values and make them the same as the target user.
|
||||
# Methods
|
||||
### Refresh
|
||||
After setting any variables you have to reload the SDK with this method
|
||||
```gdscript
|
||||
DiscordSDK.refresh()
|
||||
```
|
||||
### Clear
|
||||
Disables the Activity.
|
||||
```gdscript
|
||||
DiscordSDK.clear(reset_values)
|
||||
```
|
||||
**Taken variable:** `bool reset_values` **Standard value:** `false`<br/>
|
||||
When turning `reset_values` to `true` it completely clears the whole activity with its app_id and other values.
|
||||
|
||||
### Unclear
|
||||
Reenables the before cleared Activity. Only works with `DiscordSDK.clear(reset_values = false)`(default).
|
||||
```gdscript
|
||||
DiscordSDK.unclear()
|
||||
```
|
47
src/pages/docs/discord-sdk-godot/building.mdx
Normal file
47
src/pages/docs/discord-sdk-godot/building.mdx
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
layout: ../../../layouts/DocsLayout.astro
|
||||
repo: discord-sdk-godot
|
||||
title: Building
|
||||
draft: true
|
||||
---
|
||||
# How to build
|
||||
1. Clone the project
|
||||
2. Install [python](https://www.python.org/downloads/)
|
||||
3. Install scons via pip with
|
||||
```sh
|
||||
pip install scons
|
||||
```
|
||||
and make sure to put scons on your PATH or replace "scons" with a scons run command<br/>
|
||||
<br/>
|
||||
4. Run this command
|
||||
```sh
|
||||
python setup.py
|
||||
```
|
||||
5. and build the project with
|
||||
```sh
|
||||
python build.py
|
||||
```
|
||||
There is a prompt how it should start Godot (if `godot` is on PATH) to test the addon fast directly.
|
||||
<br/>
|
||||
|
||||
**or** run
|
||||
```sh
|
||||
scons
|
||||
```
|
||||
and
|
||||
```sh
|
||||
scons target=template_release
|
||||
```
|
||||
<br/>
|
||||
|
||||
6. Now the addon should be installed in the project folder of the repo and can be exported with
|
||||
```sh
|
||||
python release.py
|
||||
```
|
||||
# MacOS Support
|
||||
:::warn
|
||||
MacOS is supported but not included in this project releases. <br/>
|
||||
You have to build it yourself because signing costs money we don't want to pay currently.<br/>
|
||||
You have to sign the binding dylib to use it. The official Discord Game SDK dylib is already signed by Discord.<br/>
|
||||
It should be possible to run the dylib for testing before signing it but i haven't tested it yet.<br/>
|
||||
:::
|
11
src/pages/docs/discord-sdk-godot/debug.mdx
Normal file
11
src/pages/docs/discord-sdk-godot/debug.mdx
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
layout: ../../../layouts/DocsLayout.astro
|
||||
repo: discord-sdk-godot
|
||||
title: Debug
|
||||
draft: true
|
||||
---
|
||||
The `DiscordSDKDebug` Node shows the current status of the SDK and its values.<br/>
|
||||
You can also print the `current_user` Dictionary or the whole friendslist Array on the console and manage invites with the Button and input LineEdits. You can also disable and enable the Activity with the button switch.
|
||||
|
||||
|
||||

|
21
src/pages/docs/discord-sdk-godot/editor_presence.mdx
Normal file
21
src/pages/docs/discord-sdk-godot/editor_presence.mdx
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
layout: ../../../layouts/DocsLayout.astro#
|
||||
repo: discord-sdk-godot
|
||||
title: Editor Presence
|
||||
draft: true
|
||||
---
|
||||
<img width="550px" src="https://raw.githubusercontent.com/vaporvee/discord-sdk-godot/main/project/assets/GodotEditorPresenceBanner.svg" />
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
***
|
||||
|
||||
**Enabling it:**
|
||||
1. Enable the DiscordSDK addon (and restart the editor like in the quickstart guide)
|
||||
2. Go to the **editor** settings
|
||||
3. and enable `DiscordSDK/EditorPresence/enabled`<br/>
|
||||
|
||||
Editor Presence also updates a bit slower on client side. Your friends will see what you are doing in the exact second even when its not updated for you directly.
|
||||
***
|
||||
(old image)
|
||||
<img width="500px" src="https://github.com/vaporvee/discord-sdk-godot/assets/80621863/72b85ea7-24f1-4136-b788-92590c165a55" />
|
@@ -1,5 +1,6 @@
|
||||
---
|
||||
layout: ../../../layouts/DocsLayout.astro
|
||||
repo: discord-sdk-godot
|
||||
title: Discord SDK plugin for Godot
|
||||
draft: true
|
||||
---
|
||||
@@ -8,7 +9,7 @@ draft: true
|
||||
The GameSDK's Achievements, Applications, Voice, Images, Lobbies, Networking, Storage, and Store (purchases and discounts) features have been deprecated and will not be added. <br /> However the rest is and will still be supported by Discord.
|
||||
:::
|
||||
|
||||
**[About MacOS Support](https://github.com/vaporvee/discord-sdk-godot/wiki/Building#macos-support)**<br />
|
||||
**[About MacOS Support](/docs/discord-sdk-godot/building#macos-support)**<br />
|
||||
|
||||
:::warn
|
||||
The plugin only works with 4.2 and above for the current version
|
||||
|
63
src/pages/docs/discord-sdk-godot/relationship_manager.mdx
Normal file
63
src/pages/docs/discord-sdk-godot/relationship_manager.mdx
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
layout: ../../../layouts/DocsLayout.astro
|
||||
repo: discord-sdk-godot
|
||||
title: Relationship Manager
|
||||
draft: true
|
||||
---
|
||||
# Variables
|
||||
|
||||
### relationship
|
||||
Type: `Dictionary`
|
||||
| Key | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| "type" | String | <details><summary>The type of relationship the current user has with the given user. These are:</summary> `"None"` user has no intrinsic relationship<br/>`"Friend"` user is a friend<br/>`"Blocked"` user is blocked<br/>`"PendingIncoming"` user has a pending incoming friend request to connected user<br/>`"PendingOutgoing"` current user has a pending outgoing friend request to user<br/>`"Implicit"` user is not friends, but interacts with current user often (frequency + recency)<br/>`"NotAvailable"` relationship is unknown<br/></details> |
|
||||
| "user" | Dictionary | https://github.com/vaporvee/discord-sdk-godot/wiki/Users#get-current-user |
|
||||
| "presence" | Dictionary | Will be described below. |
|
||||
|
||||
### presence
|
||||
Type: `Dictionary`
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| "status" | String | <details><summary>The user status:</summary>`"Offline"`<br/>`"Online"`<br/>`"Idle"`<br/>`"DoNotDisturb"`<br/>`"NotAvailable"`<br/></details> |
|
||||
| "activity" | Dictionary | All [activity](https://github.com/vaporvee/discord-sdk-godot/wiki/Activities) values and the `"name"` of the activity
|
||||
|
||||
# Signals
|
||||
|
||||
### Relationship init
|
||||
**Connect it with:**
|
||||
```gdscript
|
||||
DiscordSDK.connect("relationships_init",_on_relationships_init)
|
||||
```
|
||||
**Add it in your gdscript as function:**
|
||||
```gdscript
|
||||
func _on_relationships_init():
|
||||
```
|
||||
The Signal fires when Discord is ready to offer relationship information.<br/>
|
||||
|
||||
### Updated relationship
|
||||
**Connect it with:**
|
||||
```gdscript
|
||||
DiscordSDK.connect("updated_relationship",_on_updated_relationship)
|
||||
```
|
||||
**Add it in your gdscript as function:**
|
||||
```gdscript
|
||||
func _on_updated_relationship(relationship):
|
||||
```
|
||||
The Signal fires when a user in the Relationships list of the current user updated any user information.<br/>
|
||||
For example activity details update, avatar update, username update, online, offline etc...<br/>
|
||||
**Given variable:** `Dictionary relationship`
|
||||
# Methods
|
||||
### Get relationship
|
||||
Returns the relationship between the current user and the `user_id`
|
||||
```gdscript
|
||||
DiscordSDK.get_relationship(user_id)
|
||||
```
|
||||
**Taken variable:** `int user_id`<br/>
|
||||
**Given variable:** `Dictionary relationship`
|
||||
|
||||
### Get all relationships
|
||||
Returns all relationships the current user has. Warning: this will be many! (if not I'm sorry xD)
|
||||
```gdscript
|
||||
DiscordSDK.get_all_relationships()
|
||||
```
|
||||
**Given variable:** `Dictionary relationship`
|
24
src/pages/docs/discord-sdk-godot/users.mdx
Normal file
24
src/pages/docs/discord-sdk-godot/users.mdx
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
layout: ../../../layouts/DocsLayout.astro
|
||||
repo: discord-sdk-godot
|
||||
title: Users
|
||||
draft: true
|
||||
---
|
||||
# Methods
|
||||
|
||||
### Get current user
|
||||
Fetch information about the currently to the Discord client connected user account.<br/>
|
||||
Note: This doesn't return the proper values when the game is not fully connected to the Discord client. Give it its time!
|
||||
```gdscript
|
||||
DiscordSDK.get_current_user()
|
||||
```
|
||||
|
||||
Returns `Dictionary current_user`
|
||||
| **Key** | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| avatar | String | The avatar hash of the Discord user |
|
||||
| is_bot | bool | If the user is a bot (when does this happen?) |
|
||||
| discriminator | int | The "#1234" number after the name from a user |
|
||||
| id | int | The user's unique ID |
|
||||
| username | String | The Discord username (without discriminator) |
|
||||
| avatar_url | String | <details><summary>The url of the user's avatar</summary>also returns the correct url for the [default avatar](https://cdn.discordapp.com/embed/avatars/5.png).<br/>When `avatar` is empty a url will be generated out of `discriminator % 5`. The user avatars are 512x512px and the default avatars 256x256px </details> |
|
26
src/pages/docs/discord-sdk-godot/utillity_or_other.mdx
Normal file
26
src/pages/docs/discord-sdk-godot/utillity_or_other.mdx
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
layout: ../../../layouts/DocsLayout.astro
|
||||
repo: discord-sdk-godot
|
||||
title: Utillity or other stuff
|
||||
draft: true
|
||||
---
|
||||
# Methods
|
||||
## Run callbacks
|
||||
```gdscript
|
||||
func _process(_delta):
|
||||
DiscordSDK.run_callbacks()
|
||||
```
|
||||
This runs normaly inside the Autoload `DiscordSDKLoader` wich should be automatically added by the plugin. If not this needs to be added to use most features of the plugin. In older versions of the plguin known as `discord_sdk.coreupdate()`.
|
||||
## Register game
|
||||
### Register Steam
|
||||
Registers your game's Steam app id for the protocol `steam://run-game-id/<id>` when you are shipping your game on steam. Used when Discord wants to launch your game or to push the Discord overlay to your game.
|
||||
```gdscript
|
||||
DiscordSDK.register_steam(1938123)
|
||||
```
|
||||
Requires a steamID `int` value
|
||||
### Register command
|
||||
Registers your game's launch command. Used when Discord wants to launch your game or to push the Discord overlay to your game. Only really makes sense when the command works on the given OS
|
||||
```gdscript
|
||||
DiscordSDK.register_command("my-awesome-game://run --full-screen")
|
||||
```
|
||||
Requires a launch command `String` value
|
@@ -22,10 +22,17 @@ h1 {
|
||||
border: 1px solid lighten($highlight-primary, 16%);
|
||||
box-shadow: 0px 4px 4px 0px #00000040;
|
||||
padding: 2vw;
|
||||
margin-inline: 20vw;
|
||||
margin-inline: 10vw;
|
||||
margin-bottom: 11vh;
|
||||
}
|
||||
|
||||
.sidebar{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
margin-top: 10.5vh;
|
||||
}
|
||||
|
||||
|
||||
td {
|
||||
border-inline: 15px solid;
|
||||
|
Reference in New Issue
Block a user