- 
                Notifications
    You must be signed in to change notification settings 
- Fork 16
Adding options.json #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from 12 commits
      Commits
    
    
            Show all changes
          
          
            44 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      1c3790d
              
                add conversion of existing goal option as alias for new system
              
              
                nicopop 0be50d5
              
                Add check for compatible goal option before attempting to convert
              
              
                nicopop ebb619d
              
                Added warning and moved convert example to hook
              
              
                nicopop 49e202a
              
                small fix
              
              
                nicopop c8a88c8
              
                WIP option.json loading and parsing
              
              
                nicopop aac3e05
              
                Merge branch 'main' into adding-Option.json
              
              
                nicopop 3192f04
              
                made the options generation actually work
              
              
                nicopop 9c19947
              
                Merge branch 'main' into adding-Option.json
              
              
                nicopop 3a744b9
              
                updated descriptions and removed Undefined from enum
              
              
                nicopop 88580c7
              
                Actually implement Range/NamedRange options
              
              
                nicopop d5fb99f
              
                Let manual load with option.json missing
              
              
                nicopop c1fb867
              
                allow goal description/default/display override
              
              
                nicopop f6e4c12
              
                use Locate to convert str type to Type
              
              
                nicopop 9fcdf97
              
                update Schema catalog and option.json path to schema
              
              
                nicopop c3b2ed7
              
                Merge branch 'main' into adding-Option.json
              
              
                nicopop bf55e1b
              
                Add Option Groups
              
              
                nicopop bc55ea4
              
                Merge remote-tracking branch 'remotes/origin/main' into adding-Option…
              
              
                nicopop bc7a2cf
              
                cleanup of imports
              
              
                nicopop 79f26e2
              
                Simplify import
              
              
                nicopop f46c170
              
                Added Visibility setting to options
              
              
                nicopop 544843a
              
                Simplify Options schema
              
              
                nicopop 867499f
              
                Remove locate and use list instead
              
              
                nicopop e77a1f2
              
                Restrict option type to what can be used right now
              
              
                nicopop a0b3ff6
              
                small fix
              
              
                nicopop 4040675
              
                revert changes to init.py
              
              
                nicopop 38161b5
              
                enable the example options that can be enabled
              
              
                nicopop eb3c9ab
              
                Combine Option Types together like Toggle and DefaultOnToggle
              
              
                nicopop 34d7240
              
                small tweaks
              
              
                nicopop 476378f
              
                fix yaml templates breaking when multiline description present
              
              
                nicopop a1b19fa
              
                Renamed params as proposed and split goal override from basic option …
              
              
                nicopop 975b41c
              
                small options.json descriptions tweaks
              
              
                nicopop b131807
              
                removed the override dict in options.py
              
              
                nicopop 1758c47
              
                cleanup of options.py
              
              
                nicopop da72c1f
              
                only modify option if it exists
              
              
                nicopop 63f55ea
              
                make the schema even simpler to update
              
              
                nicopop b5ac869
              
                make override mode work with any existing options
              
              
                nicopop b73c83b
              
                Split Option.json data into core and user
              
              
                nicopop 1a92dfb
              
                small tweaks for option group order
              
              
                nicopop 116ff4c
              
                updated hooks example/information
              
              
                nicopop bae6678
              
                don't recreate choice options to add aliases
              
              
                nicopop 77fa93c
              
                Schema descriptions tweaks 1th pass
              
              
                nicopop c088b06
              
                schema descriptions changed based on feedback
              
              
                nicopop 31ad275
              
                Merge remote-tracking branch 'origin/main' into adding-Option.json
              
              
                nicopop 85ec7db
              
                Small  tweaks based on Fuzzy's feedback
              
              
                nicopop File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "$id": "https://raw.githubusercontent.com/ManualForArchipelago/Manual/main/schemas/Manual.options.schema.json", | ||
| "description": "Schema for Manual's options.json", | ||
| "type": "object", | ||
| "items": { | ||
| "$ref": "#/definitions/Option" | ||
| }, | ||
| "properties": { | ||
| "$schema": { | ||
| "type":"string", | ||
| "description": "The schema to verify this document against." | ||
| }, | ||
| "data": { | ||
| "description": "dict of options for this apworld", | ||
| "type": "object", | ||
| "patternProperties": { | ||
| "^_.*$": {"description": "A commented out Option", "$ref": "#/definitions/Option"}, | ||
| "^.*$": {"description": "An Option for your World","$ref": "#/definitions/Option"} | ||
| } | ||
| }, | ||
| "_comment": {"$ref": "#/definitions/comment"} | ||
| }, | ||
| "definitions": { | ||
| "Option": { | ||
| "type": "object", | ||
| "properties": { | ||
| "display_name": { | ||
| "description": "The name shown on the webhost.", | ||
| "type": "string" | ||
| }, | ||
| "type": { | ||
| "description": "The type of this options, check the official Archipelago docs for the options types here: \nhttps://github.com/ArchipelagoMW/Archipelago/blob/main/docs/options%20api.md#basic-option-classes", | ||
| "type": "string", | ||
| "enum": ["FreeText", "Toggle", "DefaultOnToggle", "Choice", "TextChoice", "Range", "NamedRange"] | ||
| }, | ||
| "description": { | ||
| "description": "long description of what this option is for(is shown on hover on the webhost)", | ||
| "type": ["array", "string"], | ||
| "items": {"type": "string"} | ||
| }, | ||
| "rich_text_doc": { | ||
| "description": "Enable support for HTML generated from the standard Python reStructuredText format for your description. \nfor more info: https://github.com/ArchipelagoMW/Archipelago/blob/main/docs/options%20api.md#option-documentation", | ||
| "type": "boolean", | ||
| "default": false | ||
| }, | ||
| "_comment": {"$ref": "#/definitions/comment"} | ||
| }, | ||
| "required": ["type"], | ||
| "if": {"properties": { "type": {"const": "Choice"}}}, | ||
| "then": { | ||
| "description": "Let the user pick from a list of values", | ||
| "properties": { | ||
| "values": {"$ref": "#/definitions/ChoiceValue"}, | ||
| "aliases": {"$ref": "#/definitions/ChoiceAlias"}, | ||
| "default": {"$ref": "#/definitions/DefaultInt"} | ||
| }, | ||
| "required": ["values", "type"] | ||
| }, | ||
| "else": { | ||
| "if": {"properties": { "type": {"const": "TextChoice"}}}, | ||
| "then": { | ||
| "description": "Like Choice but the player can define their own values", | ||
| "properties": { | ||
| "values": {"$ref": "#/definitions/ChoiceValue"}, | ||
| "aliases": {"$ref": "#/definitions/ChoiceAlias"}, | ||
| "default": {"$ref": "#/definitions/DefaultInt"} | ||
| }, | ||
| "required": ["values", "type"] | ||
| }, | ||
| "else": { | ||
| "if": {"properties": { "type": {"const": "Range"}}}, | ||
| "then": { | ||
| "description": "Allow the player to specify a value between 'start' and 'end'", | ||
| "properties": { | ||
| "range_start": {"$ref": "#/definitions/rangeStart"}, | ||
| "range_end": {"$ref": "#/definitions/rangeEnd"}, | ||
| "default": {"$ref": "#/definitions/DefaultInt"} | ||
| } | ||
| }, | ||
| "else": { | ||
| "if": {"properties": { "type": {"const": "NamedRange"}}}, | ||
| "then": {"description": "Like a Range, but with your own defined label for certain values", | ||
| "properties": { | ||
| "range_start": {"$ref": "#/definitions/rangeStart"}, | ||
| "range_end": {"$ref": "#/definitions/rangeEnd"}, | ||
| "default": {"$ref": "#/definitions/DefaultInt"}, | ||
| "special_range_names":{"$ref": "#/definitions/special_range_names"} | ||
| } | ||
| }, | ||
| "else": { | ||
| "if": {"properties": { "type": {"const": "Toggle"}}}, | ||
| "then": {"description": "A simple boolean, the default value is False. Use DefaultOnToggle instead for True"}, | ||
| "else":{ | ||
| "if": {"properties": { "type": {"const": "DefaultOnToggle"}}}, | ||
| "then": {"description": "A simple boolean, the default value is True. Use Toggle instead for False"}, | ||
| "else":{ | ||
| "if": {"properties": { "type": {"const": "FreeText"}}}, | ||
| "then": { | ||
| "description": "This Option will return a Player's chosen String", | ||
| "properties": { | ||
| "default": { | ||
| "description": "Default Text value for this option", | ||
| "type": "string", | ||
| "default": "" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "rangeStart": { | ||
| "type": "integer", | ||
| "description": "The lowest Value for this range", | ||
| "default": 0 | ||
| }, | ||
| "rangeEnd": { | ||
| "type":"integer", | ||
| "description": "The Highest Value for this range", | ||
| "default": 1 | ||
| }, | ||
| "special_range_names": { | ||
| "description": "A Special Dict in the format 'name':int of named values for this range \nAll names need to be lowercase", | ||
| "type":"object", | ||
| "patternProperties": { | ||
| "^.*$": { | ||
| "description": "A named numerical value", | ||
| "type": "integer" | ||
| } | ||
| } | ||
| }, | ||
| "ChoiceValue": { | ||
| "description": "A dict of possible values in the format 'name':int \nthe default option is, by default the one with 0 as value", | ||
| "type":"object", | ||
| "patternProperties": { | ||
| "^.*$": { | ||
| "description": "An int value this option can have", | ||
| "type": "integer" | ||
| } | ||
| }, | ||
| "minProperties": 1 | ||
| }, | ||
| "ChoiceAlias": { | ||
| "description": "A dict of possible values in the format 'name':int/the name of a value from 'values'", | ||
| "type": "object", | ||
| "patternProperties": { | ||
| "^.*$": { | ||
| "description": "An alias for a value declared in 'values'", | ||
| "type": ["integer", "string"] | ||
| } | ||
| } | ||
| }, | ||
| "DefaultInt": { | ||
| "description": "the default integer value of this option", | ||
| "type": "integer", | ||
| "default": 0 | ||
| }, | ||
| "comment": { | ||
| "description": "(Optional) Does nothing, Its mainly here for Dev notes for future devs to understand your logic", | ||
| "type": ["string", "array"], | ||
| "items": { | ||
| "description": "A line of comment", | ||
| "type":"string" | ||
| } | ||
| } | ||
| } | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              |         
                  nicopop marked this conversation as resolved.
              Show resolved
            Hide resolved | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| { | ||
| "$schema": "../../schemas/Manual.options.schema.json", | ||
| "_comment": "Add a _ before an option name to comment it out and it wont be added to the apworld", | ||
| "data": { | ||
| "Choice":{ | ||
| "type": "Choice", | ||
| "description": ["This is a Choice"], | ||
| "values": { | ||
| "start":0, | ||
| "test":1 | ||
| }, | ||
| "default": 0 | ||
| }, | ||
| "TextChoice":{ | ||
| "type":"TextChoice", | ||
| "description": ["This is a TextChoice"], | ||
| "values": { | ||
| "start":0, | ||
| "test":1 | ||
| }, | ||
| "default": 0 | ||
| }, | ||
| "Range":{ | ||
|         
                  nicopop marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| "type": "Range", | ||
| "description": ["this is a Range"], | ||
| "range_start": 0, | ||
| "default": 1, | ||
| "range_end": 10 | ||
| }, | ||
| "NamedRange":{ | ||
| "description": ["this is a NamedRange"], | ||
| "type": "NamedRange", | ||
| "range_start": 0, | ||
| "range_end": 10, | ||
| "special_range_names": {"test":2} | ||
| }, | ||
| "DefaultOnToggle":{ | ||
| "description": ["this is a DefaultOnToggle"], | ||
| "type": "DefaultOnToggle" | ||
| }, | ||
| "Toggle":{ | ||
| "description": ["this is a Toggle"], | ||
| "type": "Toggle" | ||
| }, | ||
| "FreeText":{ | ||
| "description": ["this is a FreeText"], | ||
| "type": "FreeText" | ||
| }, | ||
|  | ||
|  | ||
| "DLC_enabled":{ | ||
| "display_name": "DLC Enabled", | ||
| "description": ["Is the Dlc enabled?"], | ||
| "type": "DefaultOnToggle" | ||
| }, | ||
|  | ||
| "_commented_out":{ | ||
| "type": "DefaultOnToggle" | ||
| } | ||
| } | ||
|  | ||
| } | ||
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.