Skip to content

Commit

Permalink
add coop support field
Browse files Browse the repository at this point in the history
  • Loading branch information
apple1417 committed Aug 24, 2024
1 parent bcaf864 commit 6a78153
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 7 deletions.
18 changes: 18 additions & 0 deletions _layouts/mod.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ <h1 id="title">{{ page.title }}</h1>
{%- endfor -%}
<dd id="games">{{ games | array_to_sentence_string | default: "Unknown" }}</dd>

<dt>Coop</dt>
{%- assign coop_support = page.coop_support
| default: page.pyproject.tool.sdkmod.coop_support
| downcase -%}
{%- case coop_support -%}
{%- when "incompatible" -%}
<dd id="coop">Incompatible</dd>
{%- when "requiresallplayers" -%}
<dd id="coop">Requires All Players</dd>
{%- when "clientside" -%}
<dd id="coop">Client Side</dd>
{%- else -%}
<dd id="coop">Unknown</dd>
{%- endcase -%}

<dt>License</dt>
{%- if page.license -%}
{%- assign license_name = page.license.name -%}
Expand Down Expand Up @@ -125,6 +140,9 @@ <h1 id="title">{{ page.title }}</h1>
{%- unless page.supported_games -%}
games: true,
{%- endunless -%}
{%- unless page.coop_support -%}
coop: true,
{%- endunless -%}
{%- unless page.license -%}
license: true,
{%- endunless -%}
Expand Down
13 changes: 13 additions & 0 deletions assets/js/pyproject-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ async function load_from_pyproject(url, fields) {
}
}

if (fields?.coop) {
const coop_support = pyproject?.tool?.sdkmod?.coop_support;
if (coop_support) {
const COOP_SUPPORT_TO_FRIENDLY_NAME = {
"incompatible": "Incompatible",
"requiresallplayers": "Requires All Players",
"clientside": "Client Side",
};
const friendly = COOP_SUPPORT_TO_FRIENDLY_NAME[coop_support.toLowerCase()] || "Unknown";
document.querySelector("#coop").innerText = friendly;
}
}

if (fields?.license) {
const license_element = document.querySelector("#license");

Expand Down
17 changes: 10 additions & 7 deletions developing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,23 @@ Title | `title` | `tool.sdkmod.name`, `project.n
Author(s) | `author` | `project.authors[n].name`<sup>1</sup>
Latest Version | `version` | `tool.sdkmod.version`, `project.version`
Supported Games<sup>2</sup> | `supported_games` | `tool.sdkmod.supported_games`
License<sup>3</sup> | `license` | `tool.sdkmod.license`, `project.license.text`<sup>4</sup>
Coop Support | `coop_support` | `tool.sdkmod.coop_support`
License<sup>4</sup> | `license` | `tool.sdkmod.license`, `project.license.text`<sup>5</sup>
Requirements | `dependencies` | `project.dependencies`
Misc URLs<sup>5</sup> | `urls` | `project.urls`
Misc URLs<sup>6</sup> | `urls` | `project.urls`
Download Link | `download` | `tool.sdkmod.download`
Description | The page contents | `project.description`<sup>6</sup>
Description | The page contents | `project.description`<sup>7</sup>

<sup>1</sup> Multiple authors are concatenated in the order given.
<sup>2</sup> An array of strings, with valid values of `BL3` and `WL` (case insensitive). If not
given, defaults to all games.
<sup>3</sup> A table with keys `name` and `url`. Prefer linking to a summary site, rather than
<sup>3</sup> One of `Unknown`, `Incompatible`, `RequiresAllPlayers`, or `ClientSide`. Defaults to
unknown.
<sup>4</sup> A table with keys `name` and `url`. Prefer linking to a summary site, rather than
direct to your `LICENSE`.
<sup>4</sup> Used as the name, with no url.
<sup>5</sup> A dict where keys are the names and values are the urls.
<sup>6</sup> HTML tags are stripped, rather than just being escaped.
<sup>5</sup> Used as the name, with no url.
<sup>6</sup> A dict where keys are the names and values are the urls.
<sup>7</sup> HTML tags are stripped, rather than just being escaped.
{: .fs-2 }

### Updating Info
Expand Down
11 changes: 11 additions & 0 deletions faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ UNREALSDK_CONSOLE_KEY=F1
```
Note that this file is bundled with the SDK, so updating will overwrite it.

## What do the different "Coop" fields on the mod pages mean?

| Category | Meaning |
|:---------------------|:------------------------------------------------------------------------------------------------------------------------------------|
| Incompatible | The mod is fundamentally incompatible with coop, it can only be played solo. |
| Requires All Players | The mod needs all players to have it installed in order to work best. There may still be aspects which don't work as well off host. |
| Client Side | The mod is entirely client side, and can be used in coop regardless of what other players are running. |

These categories are manually set by the mod's developer, a mod which is still left on unknown may
simply never have been tested.

## My game is crashing when...
### I open one of the entrys in the BL3 Mod Menu
Update the sdk, this was fixed in version 1.3. The BL3 update on 2024-08-08 caused older versions of
Expand Down

0 comments on commit 6a78153

Please sign in to comment.