From 6a781533e0e5840a79dece0399a70c931a1c9f74 Mon Sep 17 00:00:00 2001 From: apple1417 Date: Sat, 24 Aug 2024 18:23:45 +1200 Subject: [PATCH] add coop support field --- _layouts/mod.html | 18 ++++++++++++++++++ assets/js/pyproject-loader.js | 13 +++++++++++++ developing/index.md | 17 ++++++++++------- faq/index.md | 11 +++++++++++ 4 files changed, 52 insertions(+), 7 deletions(-) diff --git a/_layouts/mod.html b/_layouts/mod.html index f2156ba..10db7c9 100644 --- a/_layouts/mod.html +++ b/_layouts/mod.html @@ -33,6 +33,21 @@

{{ page.title }}

{%- endfor -%}
{{ games | array_to_sentence_string | default: "Unknown" }}
+
Coop
+ {%- assign coop_support = page.coop_support + | default: page.pyproject.tool.sdkmod.coop_support + | downcase -%} + {%- case coop_support -%} + {%- when "incompatible" -%} +
Incompatible
+ {%- when "requiresallplayers" -%} +
Requires All Players
+ {%- when "clientside" -%} +
Client Side
+ {%- else -%} +
Unknown
+ {%- endcase -%} +
License
{%- if page.license -%} {%- assign license_name = page.license.name -%} @@ -125,6 +140,9 @@

{{ page.title }}

{%- unless page.supported_games -%} games: true, {%- endunless -%} +{%- unless page.coop_support -%} + coop: true, +{%- endunless -%} {%- unless page.license -%} license: true, {%- endunless -%} diff --git a/assets/js/pyproject-loader.js b/assets/js/pyproject-loader.js index 049603b..ce668b6 100644 --- a/assets/js/pyproject-loader.js +++ b/assets/js/pyproject-loader.js @@ -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"); diff --git a/developing/index.md b/developing/index.md index 28476b2..766734b 100644 --- a/developing/index.md +++ b/developing/index.md @@ -114,20 +114,23 @@ Title | `title` | `tool.sdkmod.name`, `project.n Author(s) | `author` | `project.authors[n].name`1 Latest Version | `version` | `tool.sdkmod.version`, `project.version` Supported Games2 | `supported_games` | `tool.sdkmod.supported_games` -License3 | `license` | `tool.sdkmod.license`, `project.license.text`4 +Coop Support | `coop_support` | `tool.sdkmod.coop_support` +License4 | `license` | `tool.sdkmod.license`, `project.license.text`5 Requirements | `dependencies` | `project.dependencies` -Misc URLs5 | `urls` | `project.urls` +Misc URLs6 | `urls` | `project.urls` Download Link | `download` | `tool.sdkmod.download` -Description | The page contents | `project.description`6 +Description | The page contents | `project.description`7 1 Multiple authors are concatenated in the order given. 2 An array of strings, with valid values of `BL3` and `WL` (case insensitive). If not given, defaults to all games. -3 A table with keys `name` and `url`. Prefer linking to a summary site, rather than +3 One of `Unknown`, `Incompatible`, `RequiresAllPlayers`, or `ClientSide`. Defaults to + unknown. +4 A table with keys `name` and `url`. Prefer linking to a summary site, rather than direct to your `LICENSE`. -4 Used as the name, with no url. -5 A dict where keys are the names and values are the urls. -6 HTML tags are stripped, rather than just being escaped. +5 Used as the name, with no url. +6 A dict where keys are the names and values are the urls. +7 HTML tags are stripped, rather than just being escaped. {: .fs-2 } ### Updating Info diff --git a/faq/index.md b/faq/index.md index b4d8aae..524c350 100644 --- a/faq/index.md +++ b/faq/index.md @@ -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