From da843b8fdb3444c6cd6eef78cf40af8df2eb42d8 Mon Sep 17 00:00:00 2001 From: dreamscached Date: Mon, 19 Jun 2023 20:50:41 +0200 Subject: [PATCH] Add spritepack schemas --- schemas/v3/acs-split.schema.json | 148 +++++++++++++++++++++++++++ schemas/v3/acs.schema.json | 112 +++++++++++++++++++++ schemas/v3/clothes.schema.json | 168 +++++++++++++++++++++++++++++++ schemas/v3/hair.schema.json | 115 +++++++++++++++++++++ 4 files changed, 543 insertions(+) create mode 100644 schemas/v3/acs-split.schema.json create mode 100644 schemas/v3/acs.schema.json create mode 100644 schemas/v3/clothes.schema.json create mode 100644 schemas/v3/hair.schema.json diff --git a/schemas/v3/acs-split.schema.json b/schemas/v3/acs-split.schema.json new file mode 100644 index 0000000000..fca36c0018 --- /dev/null +++ b/schemas/v3/acs-split.schema.json @@ -0,0 +1,148 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + + "title": "ACS (Split)", + "description": "Monika After Story Mod split ACS JSON schema", + + "type": "object", + "additionalProperties": false, + + "if": { + "anyOf": [ + { "properties": { "rec_layer": { "const": 8 } } }, + { "properties": { "rec_layer": { "const": 9 } } } + ] + }, + "then": { + "required": [ + "version", + "type", + "name", + "img_sit", + "pose_map", + "arm_split" + ] + }, + "else": { + "required": [ + "version", + "type", + "name", + "img_sit", + "pose_map" + ] + }, + + "properties": { + "__author": { "$ref": "#/$defs/any" }, + + "version": { "const": 3 }, + "type": { "const": 0 }, + "name": { "type": "string" }, + "img_sit": { "$ref": "#/$defs/filename" }, + + "pose_map": { + "type": "object", + "additionalProperties": false, + "properties": { + "mpm_type": { "type": "integer" }, + "default": { "$ref": "#/$defs/pose" }, + "l_default": { "$ref": "#/$defs/pose" }, + "use_reg_for_l": { "type": "boolean", "default": false } + }, + "patternProperties": { + "p[0-7]": { "$ref": "#/$defs/pose" } + } + }, + + "arm_split": { + "type": "object", + "additionalProperties": false, + "properties": { + "mpm_type": { "type": "integer" }, + "default": { "$ref": "#/$defs/acs_split_pose" }, + "l_default": { "$ref": "#/$defs/acs_split_pose" }, + "use_reg_for_l": { "type": "boolean", "default": false } + }, + "patternProperties": { + "p[0-7]": { "$ref": "#/$defs/acs_split_pose" } + } + }, + + "stay_on_start": { "type": "boolean", "default": false }, + + "ex_props": { + "type": "object", + "default": { }, + "properties": { + "drink": { "$ref": "#/$defs/flag" }, + "excluded-hair-props": { "$ref": "#/$defs/string_list" }, + "food": { "$ref": "#/$defs/flag" }, + "left-desk-acs": { "$ref": "#/$defs/flag" }, + "required-hair-prop": { "type": "string" }, + "ribbon-like": { "$ref": "#/$defs/flag" }, + "twin-ribbon": { "$ref": "#/$defs/flag" } + } + }, + + "select_info": { + "type": "object", + "additionalProperties": false, + "properties": { + "display_name": { "type": "string" }, + "thumb": { "$ref": "#/$defs/filename" }, + "group": { "type": "string" }, + "visible_when_locked": { "type": "boolean", "default": true }, + "select_dlg": { "$ref": "#/$defs/string_list" } + } + }, + + "highlight": { + "type": "object", + "additionalProperties": false, + + "properties": { + "default": { "$ref": "#/$defs/filter" }, + "mapping": { + "type": "object", + "additionalProperties": false, + "patternProperties": { "^.*$": { "$ref": "#/$defs/filter" } } + } + } + }, + + "dryrun": { "$ref": "#/$defs/flag" }, + "rec_layer": { "enum": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ], "default": 2 }, + "priority": { "type": "integer", "default": 10 }, + "acs_type": { "type": "string", "default": null }, + "mux_type": { "$ref": "#/$defs/string_list" }, + "giftname": { "$ref": "#/$defs/filename" }, + "dlg_desc": { "type": "string", "pattern": "^[^A-Z]*$" }, + "dlg_plural": { "type": "boolean" }, + "keep_on_desk": { "type": "boolean", "default": false } + }, + + "$defs": { + "pose": { "type": "string", "default": null }, + "acs_split_pose": { + "type": "string", "pattern": "^(?:|\\*|(?:(?:0|1|5|10))(?:\\^(?:0|1|5|10))*)$", "default": null + }, + + "flag": { }, + + "string_list": { "type": "array","items": { "type": "string" }, "default": null }, + + "filter": { + "type": "object", + "properties": { + "default": { "type": "string" }, + "day": { "type": "string" }, + "night": { "type": "string" } + } + }, + + "filename": { "type": "string", "pattern": "^[^./\\\\]*$" }, + + "any": { "type": [ "number", "string", "boolean", "object", "array", "null" ] } + } +} diff --git a/schemas/v3/acs.schema.json b/schemas/v3/acs.schema.json new file mode 100644 index 0000000000..a29e638172 --- /dev/null +++ b/schemas/v3/acs.schema.json @@ -0,0 +1,112 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + + "title": "ACS (Regular)", + "description": "Monika After Story Mod regular ACS JSON schema", + + "type": "object", + "additionalProperties": false, + "required": [ + "version", + "type", + "name", + "img_sit", + "pose_map" + ], + + "properties": { + "__author": { "$ref": "#/$defs/any" }, + + "version": { "const": 3 }, + "type": { "const": 0 }, + "name": { "type": "string" }, + "img_sit": { "$ref": "#/$defs/filename" }, + + "pose_map": { + "type": "object", + "additionalProperties": false, + "properties": { + "mpm_type": { "type": "integer" }, + "default": { "$ref": "#/$defs/pose" }, + "l_default": { "$ref": "#/$defs/pose" }, + "use_reg_for_l": { "type": "boolean", "default": false } + }, + "patternProperties": { + "p[0-7]": { "$ref": "#/$defs/pose" } + } + }, + + "stay_on_start": { "type": "boolean", "default": false }, + + "ex_props": { + "type": "object", + "default": { }, + "properties": { + "drink": { "$ref": "#/$defs/flag" }, + "excluded-hair-props": { "$ref": "#/$defs/string_list" }, + "food": { "$ref": "#/$defs/flag" }, + "left-desk-acs": { "$ref": "#/$defs/flag" }, + "required-hair-prop": { "type": "string" }, + "ribbon-like": { "$ref": "#/$defs/flag" }, + "twin-ribbon": { "$ref": "#/$defs/flag" } + } + }, + + "select_info": { + "type": "object", + "additionalProperties": false, + "properties": { + "display_name": { "type": "string" }, + "thumb": { "$ref": "#/$defs/filename" }, + "group": { "type": "string" }, + "visible_when_locked": { "type": "boolean", "default": true }, + "select_dlg": { "$ref": "#/$defs/string_list" } + } + }, + + "highlight": { + "type": "object", + "additionalProperties": false, + + "properties": { + "default": { "$ref": "#/$defs/filter" }, + "mapping": { + "type": "object", + "additionalProperties": false, + "patternProperties": { "^.*$": { "$ref": "#/$defs/filter" } } + } + } + }, + + "dryrun": { "$ref": "#/$defs/flag" }, + "rec_layer": { "enum": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ], "default": 2 }, + "priority": { "type": "integer", "default": 10 }, + "acs_type": { "type": "string", "default": null }, + "mux_type": { "$ref": "#/$defs/string_list" }, + "giftname": { "$ref": "#/$defs/filename" }, + "dlg_desc": { "type": "string", "pattern": "^[^A-Z]*$" }, + "dlg_plural": { "type": "boolean" }, + "keep_on_desk": { "type": "boolean", "default": false } + }, + + "$defs": { + "pose": { "type": "string", "default": null }, + + "flag": { }, + + "string_list": { "type": "array","items": { "type": "string" }, "default": null }, + + "filter": { + "type": "object", + "properties": { + "default": { "type": "string" }, + "day": { "type": "string" }, + "night": { "type": "string" } + } + }, + + "filename": { "type": "string", "pattern": "^[^./\\\\]*$" }, + + "any": { "type": [ "number", "string", "boolean", "object", "array", "null" ] } + } +} diff --git a/schemas/v3/clothes.schema.json b/schemas/v3/clothes.schema.json new file mode 100644 index 0000000000..36a6a03899 --- /dev/null +++ b/schemas/v3/clothes.schema.json @@ -0,0 +1,168 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + + "title": "Clothes", + "description": "Monika After Story Mod clothes JSON schema", + + "type": "object", + "additionalProperties": false, + "required": [ + "version", + "type", + "name", + "img_sit", + "pose_map" + ], + + "properties": { + "__author": { "$ref": "#/$defs/any" }, + + "version": { "const": 3 }, + "type": { "const": 2 }, + "name": { "type": "string" }, + "img_sit": { "$ref": "#/$defs/filename" }, + + "pose_map": { + "type": "object", + "additionalProperties": false, + "properties": { + "mpm_type": { "type": "integer" }, + "default": { "$ref": "#/$defs/pose" }, + "l_default": { "$ref": "#/$defs/pose" }, + "use_reg_for_l": { "type": "boolean", "default": false } + }, + "patternProperties": { + "p[0-7]": { "$ref": "#/$defs/pose" } + } + }, + + "stay_on_start": { "type": "boolean", "default": false }, + + "ex_props": { + "type": "object", + "default": { }, + "properties": { + "excluded-clothes-props": { "$ref": "#/$defs/string_list" }, + "no-tails": { "$ref": "#/$defs/flag" }, + "required-clothes-prop": { "type": "string" }, + "ribbon": { "$ref": "#/$defs/flag" }, + "ribbon-off": { "$ref": "#/$defs/flag" }, + "ribbon-restore": { "$ref": "#/$defs/flag" }, + "tiedstrand": { "$ref": "#/$defs/flag" }, + "twintails": { "$ref": "#/$defs/flag" } + } + }, + + "select_info": { + "type": "object", + "additionalProperties": false, + "properties": { + "display_name": { "type": "string" }, + "thumb": { "$ref": "#/$defs/filename" }, + "group": { "type": "string" }, + "visible_when_locked": { "type": "boolean", "default": true }, + "select_dlg": { "$ref": "#/$defs/string_list" } + } + }, + + "highlight": { + "type": "object", + "additionalProperties": false, + + "properties": { + "default": { "$ref": "#/$defs/filter" }, + "mapping": { + "type": "object", + "additionalProperties": false, + "patternProperties": { "^.*$": { "$ref": "#/$defs/filter" } } + } + } + }, + + "dryrun": { "$ref": "#/$defs/flag" }, + + "hair_map": { + "type": "object", + "properties": { + "all": { "type": "string", "default": "def" } + }, + "patternProperties": { + "^.*$": { "type": "string" } + } + }, + + "giftname": { "$ref": "#/$defs/filename" }, + + "pose_arms": { + "crossed": { "$ref": "#/$defs/pose_arm" }, + "left-down": { "$ref": "#/$defs/pose_arm" }, + "left-rest": { "$ref": "#/$defs/pose_arm" }, + "right-down": { "$ref": "#/$defs/pose_arm" }, + "right-point": { "$ref": "#/$defs/pose_arm" }, + "right-restpoint": { "$ref": "#/$defs/pose_arm" }, + "steepling": { "$ref": "#/$defs/pose_arm" }, + "def|left-down": { "$ref": "#/$defs/pose_arm" }, + "def|right-def": { "$ref": "#/$defs/pose_arm" } + } + }, + + "$defs": { + "pose": { + "anyOf": [ + { + "if": { "properties": { "mpm_type": { "const": 0 } } }, + "then": { "type": "boolean" } + }, + { + "if": { "properties": { "mpm_type": { "const": 1 } } }, + "then": { + "enum": [ + "steepling", "crossed", "restleftpointright", "pointright", "down", "downleftpointright", "def|def" + ] + } + } + ] + }, + + "flag": { }, + + "string_list": { "type": "array","items": { "type": "string" }, "default": null }, + + "filter": { + "type": "object", + "properties": { + "default": { "type": "string" }, + "day": { "type": "string" }, + "night": { "type": "string" } + } + }, + + "filename": { "type": "string", "pattern": "^[^./\\\\]*$" }, + + "pose_arm": { + "type": "object", + "required": [ "tag", "layers" ], + "properties": { + "tag": { "type": "string", "pattern": "^arms-(?:left|right)-" }, + "layers": { + "type": "string", "pattern": "^(?:|\\*|(?:(?:0|1|5|10))(?:\\^(?:0|1|5|10))*)$" + }, + "highlight": { + "type": "object", + "additionalProperties": false, + + "properties": { + "default": { "$ref": "#/$defs/filter" }, + "mapping": { + "type": "object", + "additionalProperties": false, + "patternProperties": { "^.*$": { "$ref": "#/$defs/filter" } } + } + } + } + } + }, + + "any": { "type": [ "number", "string", "boolean", "object", "array", "null" ] } + } +} diff --git a/schemas/v3/hair.schema.json b/schemas/v3/hair.schema.json new file mode 100644 index 0000000000..39ff561a1a --- /dev/null +++ b/schemas/v3/hair.schema.json @@ -0,0 +1,115 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + + "title": "Hair", + "description": "Monika After Story Mod hair JSON schema", + + "type": "object", + "additionalProperties": false, + "required": [ + "version", + "type", + "name", + "img_sit", + "pose_map" + ], + + "properties": { + "__author": { "$ref": "#/$defs/any" }, + + "version": { "const": 3 }, + "type": { "const": 1 }, + "name": { "type": "string" }, + "img_sit": { "$ref": "#/$defs/filename" }, + + "pose_map": { + "type": "object", + "additionalProperties": false, + "properties": { + "mpm_type": { "type": "integer" }, + "default": { "$ref": "#/$defs/pose" }, + "l_default": { "$ref": "#/$defs/pose" }, + "use_reg_for_l": { "type": "boolean", "default": false } + }, + "patternProperties": { + "p[0-7]": { "$ref": "#/$defs/pose" } + } + }, + + "stay_on_start": { "type": "boolean", "default": false }, + + "ex_props": { + "type": "object", + "default": { }, + "properties": { + "excluded-clothes-props": { "$ref": "#/$defs/string_list" }, + "no-tails": { "$ref": "#/$defs/flag" }, + "required-clothes-prop": { "type": "string" }, + "ribbon": { "$ref": "#/$defs/flag" }, + "ribbon-off": { "$ref": "#/$defs/flag" }, + "ribbon-restore": { "$ref": "#/$defs/flag" }, + "tiedstrand": { "$ref": "#/$defs/flag" }, + "twintails": { "$ref": "#/$defs/flag" } + } + }, + + "select_info": { + "type": "object", + "additionalProperties": false, + "properties": { + "display_name": { "type": "string" }, + "thumb": { "$ref": "#/$defs/filename" }, + "group": { "type": "string" }, + "visible_when_locked": { "type": "boolean", "default": true }, + "select_dlg": { "$ref": "#/$defs/string_list" } + } + }, + + "highlight": { + "type": "object", + "additionalProperties": false, + + "properties": { + "default": { "$ref": "#/$defs/filter" }, + "mapping": { + "type": "object", + "additionalProperties": false, + "patternProperties": { "^.*$": { "$ref": "#/$defs/filter" } } + } + } + }, + + "dryrun": { "$ref": "#/$defs/flag" }, + + "unlock": { "type": "boolean", "default": true } + }, + + "$defs": { + "pose": { + "if": { "properties": { "mpm_type": 0 } }, + "then": { "type": "boolean" }, + "else": { + "enum": [ + "steepling", "crossed", "restleftpointright", "pointright", "down", "downleftpointright", "def|def" + ] + } + }, + + "flag": { }, + + "string_list": { "type": "array","items": { "type": "string" }, "default": null }, + + "filter": { + "type": "object", + "properties": { + "default": { "type": "string" }, + "day": { "type": "string" }, + "night": { "type": "string" } + } + }, + + "filename": { "type": "string", "pattern": "^[^./\\\\]*$" }, + + "any": { "type": [ "number", "string", "boolean", "object", "array", "null" ] } + } +}