diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/setting/GameSettings.java b/HMCL/src/main/java/org/jackhuang/hmcl/setting/GameSettings.java index c20246d7be..d770339354 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/setting/GameSettings.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/setting/GameSettings.java @@ -82,7 +82,7 @@ public sealed abstract class GameSettings extends ObservableSetting { public static final class Instance extends GameSettings implements JsonSchemaSetting { /// The JSON schema supported by instance-specific game settings. public static final JsonSchema CURRENT_SCHEMA = - new JsonSchema("instance-game-settings", new JsonSchema.Version(1, 0, 0)); + new JsonSchema("instance-game-settings", new JsonSchema.Version(1, 0, 1)); /// Creates an empty instance setting. public Instance() { diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/setting/GameSettingsPresets.java b/HMCL/src/main/java/org/jackhuang/hmcl/setting/GameSettingsPresets.java index fe33b40979..7ea2ae1947 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/setting/GameSettingsPresets.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/setting/GameSettingsPresets.java @@ -44,7 +44,7 @@ import java.util.Objects; public final class GameSettingsPresets extends ObservableSetting implements JsonSchemaSetting { /// The JSON schema supported by this game settings preset store. public static final JsonSchema CURRENT_SCHEMA = - new JsonSchema("game-settings", new JsonSchema.Version(1, 0, 0)); + new JsonSchema("game-settings", new JsonSchema.Version(1, 0, 1)); /// Creates an empty game settings preset store. public GameSettingsPresets() { diff --git a/docs/schemas/game-settings/1.0.1.json b/docs/schemas/game-settings/1.0.1.json new file mode 100644 index 0000000000..7a364c0829 --- /dev/null +++ b/docs/schemas/game-settings/1.0.1.json @@ -0,0 +1,248 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://schemas.glavo.site/hmcl/game-settings/1.0.1", + "title": "HMCL Game Settings Presets", + "type": "object", + "additionalProperties": true, + "required": [ + "$schema" + ], + "patternProperties": { + "^\\$schema$": { + "enum": [ + "https://schemas.glavo.site/hmcl/game-settings/1.0.1" + ] + } + }, + "properties": { + "presets": { + "type": "array", + "items": { + "$ref": "#/$defs/preset" + } + } + }, + "$defs": { + "preset": { + "allOf": [ + { + "$ref": "#/$defs/gameSettings" + }, + { + "type": "object", + "additionalProperties": true, + "required": [ + "id" + ], + "properties": { + "id": { + "$ref": "#/$defs/gameSettingsPresetID" + }, + "name": { + "$ref": "#/$defs/localizedText" + }, + "autoNameNumber": { + "type": "integer", + "minimum": 1 + }, + "defaultIsolationType": { + "enum": [ + "NEVER", + "ALWAYS", + "MODDED" + ] + } + } + } + ] + }, + "gameSettings": { + "type": "object", + "additionalProperties": true, + "properties": { + "javaType": { + "enum": [ + "AUTO", + "VERSION", + "DETECTED", + "CUSTOM" + ] + }, + "customJavaVersion": { + "type": "string" + }, + "customJavaPath": { + "type": "string" + }, + "detectedJava": { + "type": "object", + "additionalProperties": true, + "properties": { + "version": { + "type": "string" + }, + "pathHash": { + "type": "string" + } + } + }, + "notUseJavaw": { + "type": "boolean" + }, + "jvmOptions": { + "type": "string" + }, + "noJVMOptions": { + "type": "boolean" + }, + "noOptimizingJVMOptions": { + "type": "boolean" + }, + "notCheckJVM": { + "type": "boolean" + }, + "notCheckGame": { + "type": "boolean" + }, + "autoMemory": { + "type": "boolean" + }, + "minMemory": { + "type": "integer" + }, + "maxMemory": { + "type": "integer" + }, + "permSize": { + "type": "string" + }, + "windowType": { + "enum": [ + "WINDOWED", + "FULLSCREEN", + "MAXIMIZED" + ] + }, + "width": { + "type": "number" + }, + "height": { + "type": "number" + }, + "runningDirectory": { + "type": "string" + }, + "processPriority": { + "enum": [ + "LOW", + "BELOW_NORMAL", + "NORMAL", + "ABOVE_NORMAL", + "HIGH" + ] + }, + "launcherVisibility": { + "enum": [ + "CLOSE", + "HIDE", + "KEEP", + "HIDE_AND_REOPEN" + ] + }, + "allowAutoAgent": { + "type": "boolean" + }, + "disableAutoGameOptions": { + "type": "boolean" + }, + "gameArguments": { + "type": "string" + }, + "graphicsBackend": { + "enum": [ + "DEFAULT", + "OPENGL", + "VULKAN" + ] + }, + "openGLRenderer": { + "type": "string" + }, + "vulkanRenderer": { + "type": "string" + }, + "highPerformance": { + "type": "boolean" + }, + "environmentVariables": { + "type": "string" + }, + "commandWrapper": { + "type": "string" + }, + "preLaunchCommand": { + "type": "string" + }, + "postExitCommand": { + "type": "string" + }, + "quickPlay": { + "enum": [ + "NONE", + "MULTIPLAYER", + "SINGLEPLAYER", + "REALMS" + ] + }, + "quickPlayMultiplayer": { + "type": "string" + }, + "quickPlaySingleplayer": { + "type": "string" + }, + "quickPlayRealms": { + "type": "string" + }, + "showLogs": { + "type": "boolean" + }, + "enableDebugLogOutput": { + "type": "boolean" + }, + "notPatchNatives": { + "type": "boolean" + }, + "useCustomNatives": { + "type": "boolean" + }, + "nativesDirectory": { + "type": "string" + }, + "useNativeGLFW": { + "type": "boolean" + }, + "useNativeOpenAL": { + "type": "boolean" + } + } + }, + "gameSettingsPresetID": { + "type": "string", + "pattern": "^game-settings-preset:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" + }, + "localizedText": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "minProperties": 1, + "additionalProperties": { + "type": "string" + } + } + ] + } + } +} diff --git a/docs/schemas/instance-game-settings/1.0.1.json b/docs/schemas/instance-game-settings/1.0.1.json new file mode 100644 index 0000000000..e206e2dd78 --- /dev/null +++ b/docs/schemas/instance-game-settings/1.0.1.json @@ -0,0 +1,231 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://schemas.glavo.site/hmcl/instance-game-settings/1.0.1", + "title": "HMCL Instance Game Settings", + "allOf": [ + { + "$ref": "#/$defs/gameSettings" + }, + { + "type": "object", + "additionalProperties": true, + "required": [ + "$schema" + ], + "patternProperties": { + "^\\$schema$": { + "enum": [ + "https://schemas.glavo.site/hmcl/instance-game-settings/1.0.1" + ] + } + }, + "properties": { + "parent": { + "$ref": "#/$defs/gameSettingsPresetID" + }, + "icon": { + "enum": [ + "DEFAULT", + "GRASS", + "CHEST", + "CHICKEN", + "COMMAND", + "OPTIFINE", + "CRAFT_TABLE", + "FABRIC", + "FORGE", + "NEO_FORGE", + "FURNACE", + "QUILT", + "APRIL_FOOLS", + "CLEANROOM", + "LEGACY_FABRIC" + ] + }, + "overrideProperties": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + } + } + ], + "$defs": { + "gameSettings": { + "type": "object", + "additionalProperties": true, + "properties": { + "javaType": { + "enum": [ + "AUTO", + "VERSION", + "DETECTED", + "CUSTOM" + ] + }, + "customJavaVersion": { + "type": "string" + }, + "customJavaPath": { + "type": "string" + }, + "detectedJava": { + "type": "object", + "additionalProperties": true, + "properties": { + "version": { + "type": "string" + }, + "pathHash": { + "type": "string" + } + } + }, + "notUseJavaw": { + "type": "boolean" + }, + "jvmOptions": { + "type": "string" + }, + "noJVMOptions": { + "type": "boolean" + }, + "noOptimizingJVMOptions": { + "type": "boolean" + }, + "notCheckJVM": { + "type": "boolean" + }, + "notCheckGame": { + "type": "boolean" + }, + "autoMemory": { + "type": "boolean" + }, + "minMemory": { + "type": "integer" + }, + "maxMemory": { + "type": "integer" + }, + "permSize": { + "type": "string" + }, + "windowType": { + "enum": [ + "WINDOWED", + "FULLSCREEN", + "MAXIMIZED" + ] + }, + "width": { + "type": "number" + }, + "height": { + "type": "number" + }, + "runningDirectory": { + "type": "string" + }, + "processPriority": { + "enum": [ + "LOW", + "BELOW_NORMAL", + "NORMAL", + "ABOVE_NORMAL", + "HIGH" + ] + }, + "launcherVisibility": { + "enum": [ + "CLOSE", + "HIDE", + "KEEP", + "HIDE_AND_REOPEN" + ] + }, + "allowAutoAgent": { + "type": "boolean" + }, + "disableAutoGameOptions": { + "type": "boolean" + }, + "gameArguments": { + "type": "string" + }, + "graphicsBackend": { + "enum": [ + "DEFAULT", + "OPENGL", + "VULKAN" + ] + }, + "openGLRenderer": { + "type": "string" + }, + "vulkanRenderer": { + "type": "string" + }, + "highPerformance": { + "type": "boolean" + }, + "environmentVariables": { + "type": "string" + }, + "commandWrapper": { + "type": "string" + }, + "preLaunchCommand": { + "type": "string" + }, + "postExitCommand": { + "type": "string" + }, + "quickPlay": { + "enum": [ + "NONE", + "MULTIPLAYER", + "SINGLEPLAYER", + "REALMS" + ] + }, + "quickPlayMultiplayer": { + "type": "string" + }, + "quickPlaySingleplayer": { + "type": "string" + }, + "quickPlayRealms": { + "type": "string" + }, + "showLogs": { + "type": "boolean" + }, + "enableDebugLogOutput": { + "type": "boolean" + }, + "notPatchNatives": { + "type": "boolean" + }, + "useCustomNatives": { + "type": "boolean" + }, + "nativesDirectory": { + "type": "string" + }, + "useNativeGLFW": { + "type": "boolean" + }, + "useNativeOpenAL": { + "type": "boolean" + } + } + }, + "gameSettingsPresetID": { + "type": "string", + "pattern": "^game-settings-preset:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" + } + } +}