Minor Mod manager fix, lints and dox (#11013)

* ModOptions reorder into regions, and bring back "internal" fields into the wiki

* Fix two cases of Mod Manager displaying out-of-sync states

* ModConstants and ModConstants.UnitUpgradeCost get equality contracts and a reflection-based shorter merge

* GithubAPI.kt more documentation
This commit is contained in:
SomeTroglodyte
2024-01-28 10:06:25 +01:00
committed by GitHub
parent d0c2df995d
commit f1dd08ccc2
5 changed files with 93 additions and 40 deletions

View File

@ -127,7 +127,7 @@ This file is a little different:
Note that this file controls _declarative mod compatibility_ (Work in progress) - e.g. there's [uniques](../uniques.md#modoptions-uniques) to say your Mod should only or never be used as 'Permanent audiovisual mod'.
Incompatibility filtering works so far between extension and base mods, but feel free to document known extension-to-extension incompatibilities using the same Unique now. Stay tuned!
The file can have the following attributes, not including the values Unciv sets (no point in a mod author setting those):
The file can have the following attributes, not including the values Unciv sets automatically:
| Attribute | Type | | Notes |
| --------- | ---- | ------- | ----- |
@ -139,6 +139,20 @@ The file can have the following attributes, not including the values Unciv sets
| nationsToRemove | List | empty | List of [Nations](2-Civilization-related-JSON-files.md#nationsjson) or [nationFilter](../Unique-parameters.md#nationfilter) to remove (isBaseRuleset=false only) |
| constants | Object | empty | See [ModConstants](#modconstants) |
The values normally set automatically from github metadata are:
| Attribute | Type | | Notes |
| --------- | ---- | ------- | ----- |
| modUrl | String | | The github page the mod was downloaded from, or empty if a freely hosted zip was used |
| defaultBranch | String | master | The repo's default branch |
| author | String | | Repo owner |
| lastUpdated | String | | ISO date |
| modSize | Integer | 0 | Size in kB |
| topics | List | empty | A list of "unciv-mod-*" github topics |
To clarify: When your Mod is distributed via github, including these in the Mod repo has no effect.
However, when a Mod is distributed _without_ a github repository, these values can and _should_ be set by the author in the distributed `ModOptions.json`.
### ModConstants
Stored in ModOptions.constants, this is a collection of constants used internally in Unciv.