Add more schema badges

This commit is contained in:
Ben C 2023-07-16 19:51:15 -04:00
parent 13503a11b2
commit 6a2997693b
No known key found for this signature in database
GPG Key ID: 556064B755159BBC
4 changed files with 31 additions and 38 deletions

View File

@ -1,4 +0,0 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}

View File

@ -1,11 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}

View File

@ -160,7 +160,7 @@ You can load your XML file to your planet by doing adding the following to your
### Entry Layout ### Entry Layout
By default, entries in rumor mode are laid out by rows, where each row is one planet. This will not make for a perfect By default, entries in rumor mode are laid out by rows, where each row is one planet. This will not make for a perfect
layout, so you can use the `entryPositions` property in your star system config to change them layout, so you can use the `entryPositions` property in your star system config to change them.
For example, if I want to change an entry with the ID of `EXAMPLE_ENTRY` and another with the ID of `EXAMPLE_ENTRY_2`: For example, if I want to change an entry with the ID of `EXAMPLE_ENTRY` and another with the ID of `EXAMPLE_ENTRY_2`:
```json ```json
@ -184,7 +184,7 @@ For example, if I want to change an entry with the ID of `EXAMPLE_ENTRY` and ano
} }
``` ```
To help with this, download the unity explorer mod and manually position entries, then simply use the dev tools to dump all the entries to a json string you can copy and paste into your config. To help with this, download the unity explorer mod and manually position entries (they're located under `Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/MapMode/ScaleRoot/PanRoot`), then simply use the dev tools to dump all the entries to a json string you can copy and paste into your config.
![autoDetectiveMode](/ship_log/auto_rumor_mode.webp) ![autoDetectiveMode](/ship_log/auto_rumor_mode.webp)
_A set of entries laid out with auto mode_ _A set of entries laid out with auto mode_
@ -210,12 +210,10 @@ would be `EXAMPLE_ENTRY_ALT.png`.
### Curiosity Colors ### Curiosity Colors
Colors for each curiosity is given in a list, so if I wanted the curiosity `EXAMPLE_ENTRY` to have a color of blue: Colors for each curiosity is given in a list **within the star system config**, so if I wanted the curiosity `EXAMPLE_ENTRY` to have a color of blue:
```json ```json
{ {
"ShipLog": {
"xmlFile": "planets/example.xml",
"curiosities": [ "curiosities": [
{ {
"id": "EXAMPLE_ENTRY", "id": "EXAMPLE_ENTRY",
@ -233,7 +231,6 @@ Colors for each curiosity is given in a list, so if I wanted the curiosity `EXAM
} }
} }
] ]
}
} }
``` ```

View File

@ -123,7 +123,18 @@ export const SchemaTools = {
getAdditionalBadges: (schema: Schema) => { getAdditionalBadges: (schema: Schema) => {
switch (schema.internalSchema.type) { switch (schema.internalSchema.type) {
case "JSON": case "JSON":
return []; const internalSchema = schema.internalSchema.val;
const badges = [];
if (internalSchema.minimum !== undefined) {
badges.push(`Minimum: ${internalSchema.minimum}`);
}
if (internalSchema.maximum !== undefined) {
badges.push(`Maximum: ${internalSchema.maximum}`);
}
if (internalSchema.default !== undefined) {
badges.push(`Default: ${internalSchema.default}`);
}
return badges;
case "XML": case "XML":
const node = schema.internalSchema.val; const node = schema.internalSchema.val;
if (node.name === "xs:complexType") return []; if (node.name === "xs:complexType") return [];