diff --git a/JSONValidator/Sources/JSONValidator/JSONValidator.swift b/JSONValidator/Sources/JSONValidator/JSONValidator.swift index 089e3047..94800758 100644 --- a/JSONValidator/Sources/JSONValidator/JSONValidator.swift +++ b/JSONValidator/Sources/JSONValidator/JSONValidator.swift @@ -97,6 +97,8 @@ public struct ModOptionGroup: Codable { public var name: String /// The type (currently only one option) public var type: ModOptionType + /// A list of submods which this ModOptionGroup is applicable to. If it doesn't exist, is applicable to all submods. + public var submods: [String]? /// Data for if this is a radio button. Mutually exclusive with checkBox public var radio: [ModOptionEntry]? /// Data for if this is a checkBox. Mutually exclusive with radio diff --git a/gameScanner.py b/gameScanner.py index 53f819a0..90d13f52 100644 --- a/gameScanner.py +++ b/gameScanner.py @@ -240,8 +240,10 @@ def jsonAddModOptionsFromList(jsonModOptionList, isRadio): data=jsonModOption.get('data', None))) for jsonModOptionGroup in mod.get('modOptionGroups', []): - jsonAddModOptionsFromList(jsonModOptionGroup.get('radio', []), isRadio=True) - jsonAddModOptionsFromList(jsonModOptionGroup.get('checkBox', []), isRadio=False) + applicableSubMods = jsonModOptionGroup.get('submods') + if applicableSubMods is None or self.subModName in applicableSubMods: + jsonAddModOptionsFromList(jsonModOptionGroup.get('radio', []), isRadio=True) + jsonAddModOptionsFromList(jsonModOptionGroup.get('checkBox', []), isRadio=False) def __repr__(self): return "Type: [{}] Game Name: [{}]".format(self.modName, self.subModName) diff --git a/installData.json b/installData.json index 27211e58..1a8ed215 100644 --- a/installData.json +++ b/installData.json @@ -430,6 +430,7 @@ }, { "name" : "Sprite Options", "type": "downloadAndExtract", + "submods" : ["full"], "radio": [ {"name": "PS3 sprites (default)", "description": "Use sprites from the PS3 game. No additional download required."}, { @@ -510,6 +511,7 @@ }, { "name" : "Sprite Options", "type": "downloadAndExtract", + "submods" : ["novel-mode", "adv-mode"], "radio": [ {"name": "PS3 sprites (default)", "description": "Use sprites from the PS3 game. No additional download required."}, {