Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachee committed Aug 16, 2022
1 parent 804231e commit 19a3e9e
Show file tree
Hide file tree
Showing 30 changed files with 26 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: cp README.md Docfx/index.md

- name: Build Site
run: docfx Docfx/docfx.json -t default,templates/darkfx
run: docfx Docfx/docfx.json

# Upload the generated documentation
- name: Upload site artifact
Expand Down
5 changes: 2 additions & 3 deletions Docfx/api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
###############
# temp file #
###############
# All the documentation is built and then published via a GH Action
# So there is no need for us to store the actual built YML files, that just takes up sapce.
*.yml
.manifest
2 changes: 1 addition & 1 deletion Docfx/articles/getting_started/monogame.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Currently no guide for Mono Game setup. Please follow the [Standard Guide](standard.md) and include the follow files from the Unity Package:

* The [Unity Named Pipes](https://github.com/Lachee/unity-named-pipes) Library
* The [UnityNamedPipe.cs](https://github.com/Lachee/discord-rpc-csharp/blob/master/Unity%20Example/Assets/Discord%20RPC/Scripts/Control/UnityNamedPipe.cs)
* The [Lachee/Discord-RPC-Unity](https://github.com/Lachee/discord-rpc-unity) Named Pipe

# Help Wanted Here

Expand Down
68 changes: 1 addition & 67 deletions Docfx/articles/getting_started/unity3d.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,3 @@
# Unity3D

This library has full Unity3D intergration and custom editor scripts to help enhance your usage with the library. Please note there are some technical limitations with Unity3D however:

* .NET 2.0+ is required (no subset).
* Newtonsoft.Json is required.
* Native Named Pipe Wrapper is required.

Luckily the provided Unity Package handles all this for you.

## Download

Use the automatically built `.UnityPackage` that can be found in the artifacts of the AppVoyer build. This contains the extra dependencies for the platform and full editor support to make it easier to use.

[Download Package](https://ci.appveyor.com/project/Lachee/discord-rpc-csharp/build/artifacts) and import into your project.

[![Unity Package](/images/unity_package.png)](https://ci.appveyor.com/project/Lachee/discord-rpc-csharp/build/artifacts)

## Importing

Import the unity package normally and make sure all content is selected. Once imported you may get the following warning. This library does not support the .NET 2.0 **Subset** and requires the full .NET 2.0 or greater. Proceeding with `Yes` will convert the project automatically to .NET 2.0.

![import Warning](https://i.imgur.com/noRnm33.png)

## Creating a Manager

The Discord Manager is a wrapper class around the DiscordRpcClient. It will handle the initialization, deinitialization and event invoking for you automatically.

Create a new Discord Manager in your very first loaded scene by following `GameObject -> Discord Manager`.

![Import Settings](https://i.imgur.com/rRsGCf2.png)

### Discord Manager Inspector

Once created, a new object will appear in your scene. You can _only_ have 1 Discord Manager at a time and any extras will automatically be deleted. The manager has some default values, but will need to be configured to your application.

| Property | Description |
|----------|-------------|
| Application ID | The Client ID of your Discord App created in the [Developer Portal](https://discordapp.com/developers/applications/). |
| Steam ID | A optional Steam App ID of your game. This will let Discord launch your game through the steam client instead of directly when using the [Join & Spectate](/join_spectate/intro.md) |
| Target Pipe | The pipe your Discord Client is running on. If you have 2 clients running for testing purposes, you can switch which client the game connects too. |
| Log Level | The level of logging to receive from the DiscordRpcClient. |
| Register Uri Scheme | Registers a custom URI scheme so Discord can launch your game. Only required if using the [Join & Spectate](/join_spectate/intro.md) feature. |
| Active | If enabled, the Discord Manager will create a connection and maintain it. |
| **State** | The current state of the connected client. These values are generally `Read Only` |

![Configuration](https://i.imgur.com/rrjEOHA.png)

## Usage

Setting Rich Presence is done via your game code. It is upto you on how you implement it, but as an example from the Survival Shooter example by Unity3D:

```cs
public void UpdatePresence()
{
presence.state = "Score: " + CompleteProject.ScoreManager.score;
presence.largeAsset = new DiscordAsset()
{
image = health.isDead ? "dead" : "alive",
tooltip = health.currentHealth + "HP"
};

DiscordManager.current.SetPresence(presence);
}
```

## Further Reading

If you wish to implement the Join and Spectate feature within your project (those buttons), please read [Joining & Spectating Introduction](../join_spectate/intro.md) to get started.
Please visit the documentation for [Lachee/Discord-RPC-Unity](https://github.com/Lachee/discord-rpc-unity)
4 changes: 2 additions & 2 deletions Docfx/articles/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Getting started with DiscordRPC-C# is easy! With automatic nuget packages and a

[**Standard .NET Project**](getting_started/standard.md) - Recommended. For most users that are making a .NET Application

[**Unity3D Project**](getting_started/unity3d.md) - For Unity3D users that want to add Rich Presence to their game.
[**Lachee/Discord-RPC-Unity**](https://github.com/Lachee/discord-rpc-unity) - For Unity3D users that want to add Rich Presence to their game.

[**MonoGame Project / Modding**](getting_started/monogame.md) - For developers using custom MonoGame engines or modding existing games.
[**MonoGame Project / Modding / Godot**](getting_started/monogame.md) - For developers using custom MonoGame engines or modding existing games.

## Need More Help?

Expand Down
51 changes: 16 additions & 35 deletions Docfx/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,41 @@
{
"src": [
{
"src": "../",
"files": [
"**.csproj"
]
"src": "..",
"files": [ "**.csproj" ]
}
],
"globalNamespaceId": "Global",
"dest": "api"
}
],
"build": {
"globalMetadata": {
"_appTitle": "Discord RPC C#",
"_appFooter": "<a href=\"https://github.com/Lachee/discord-rpc-csharp\">Contribute</a> on GitHub",
"_enableSearch": true
},

"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
"files": [ "api/*.yml" ]
},
{
"files": [
"articles/**.md",
"articles/**/toc.yml"
]
"files": [ "articles/toc.yml", "articles/**.md" ]
},
{
"files": [
"toc.yml",
"index.md"
]
"files": [ "toc.yml", "index.md" ]
}
],
"resource": [
{
"files": [
"images/**"
]
"files": [ "Resources/**"]
}
],

"globalMetadata": {
"_appTitle": "Discord RPC C#",
"_appFooter": "MIT by Lachee",
"_enableSearch": true
},

"sitemap":
{
"baseUrl": "https://lachee.github.io/discord-rpc-csharp/docs",
"changefreq": "yearly",
"fileOptions": {
"api/*": {
"changefreq": "daily"
}
}
"sitemap": {
"baseUrl": "https://lachee.github.io/discord-rpc-csharp/"
},
"template": ["default", "templates/darkfx"],
"xref": [ "https://normanderwan.github.io/UnityXrefMaps/xrefmap.yml" ],
"xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ],
"dest": "../_site"
Expand Down
Binary file removed Docfx/images/unity_add_marked.png
Binary file not shown.
Binary file removed Docfx/images/unity_add_unmarked.png
Binary file not shown.
Binary file removed Docfx/images/unity_entire_add.png
Binary file not shown.
Binary file removed Docfx/images/unity_import-large.png
Binary file not shown.
Binary file removed Docfx/images/unity_inspector_hierarchy.png
Binary file not shown.
Binary file removed Docfx/images/unity_netconvert.png
Binary file not shown.
Binary file removed Docfx/images/unity_package.png
Binary file not shown.
Binary file removed Docfx/images/unity_project.png
Binary file not shown.
Binary file removed Docfx/images/unity_project_short.png
Binary file not shown.
2 changes: 1 addition & 1 deletion Docfx/templates/darkfx/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ article h4 {
color: var(--color-foreground);
background-color: var(--color-background-dark);
border-bottom: 3px solid var(--color-foreground);
transition: all ease 0.25s;
transition: background-color ease 0.25s;
}

.navbar-form .form-control {
Expand Down
6 changes: 2 additions & 4 deletions Docfx/toc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
- name: Articles
href: articles/
topicUid: Articles.Intro
- name: API Documentation
href: api/
topicUid: API.Docs
- name: API Reference
href: api/
Binary file removed Resources/glory.png
Binary file not shown.
Binary file removed Resources/image_large.png
Binary file not shown.
Binary file removed Resources/image_large_1.png
Binary file not shown.
Binary file removed Resources/image_large_2.png
Binary file not shown.
Binary file removed Resources/image_large_3.png
Binary file not shown.
Binary file removed Resources/image_small_0.png
Binary file not shown.
Binary file removed Resources/image_small_1.png
Binary file not shown.
Binary file removed Resources/image_small_2.png
Binary file not shown.
Binary file removed Resources/ingame.png
Binary file not shown.
Binary file removed Resources/ingame_hightlights.png
Binary file not shown.
Binary file removed Resources/ingame_live.png
Binary file not shown.
Binary file removed Resources/koala.png
Binary file not shown.
Binary file modified Resources/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 19a3e9e

Please sign in to comment.