Skip to content

Conversation

@axxroytovu
Copy link
Contributor

Adds the optional "yaml_description" item to the Categories.json file, which allows the user to add a line of description text to the yaml options.

Example syntax:

{
    "Example Yaml-option category": {
        "yaml_option": ["DLC_enabled"],
        "yaml_description": {"DLC_enabled": "Include items and locations that require purchasing the DLC"}
    }
}

Result in the player yaml:

  DLC_enabled:
    # Include items and locations that require purchasing the DLC
    'false': 0
    'true': 50

Copy link
Contributor

@nicopop nicopop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels more like something that should be done in a dedicated option section/file like the wip #54
In the short term, yes this works but im not 100% happy with it but I leave the decisions to fuzzy

"yaml_description": {
"description": "(Optional) Dictionary of option-description pairs to add descriptor text to the yaml options defined in 'yaml_option'",
"type": "object"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally I would define the object using paternproperties but this should work as is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I've never used schemas so I did the bare minimum here. Feel free to suggest whatever makes sense to change here.

How do patternproperties work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basicaly normaly with an object you can define its properties using properties but, when they are define by the user you can use a regex aka a pattern using patternProperties
you could look at items.schema.json for a pretty good example for your situation

@axxroytovu
Copy link
Contributor Author

this feels more like something that should be done in a dedicated option section/file like the wip #54 In the short term, yes this works but im not 100% happy with it but I leave the decisions to fuzzy

I didn't know how far along #54 was so I wanted to push this fairly simple change in the short term.

@silasary
Copy link
Collaborator

I do not like this syntax.

Putting a dict in each category is confusing, and the moment people start using the same option for multiple categories, they're going to be confused whether they need to duplicate the description.

If we're going to do this as a stopgap for #54, I'd want the dict in game.json, not in every category.

@FuzzyGamesOn
Copy link
Collaborator

FuzzyGamesOn commented Jul 21, 2024

I do not like this syntax.

Putting a dict in each category is confusing, and the moment people start using the same option for multiple categories, they're going to be confused whether they need to duplicate the description.

If we're going to do this as a stopgap for #54, I'd want the dict in game.json, not in every category.

I agree with sila. Wherever it is, it has to be a single place to change it. And agree with both that the best single place would be the Options json when it happens.

game.json is a good fallback, but we know we'd be building something that we're going to deprecate probably this year.

If we're really insistent on trying to get YAML option descriptions into world builders' hands, I'd almost prefer that we just build out a skeleton Options json that just takes an option name and lets you specify an option description, and nothing else. Then Nico's WIP PR can add types and other stuff later. That way, the YAML option description ends up in the file it's going to be in. We can explain away that Options in general are a WIP and that this would be a precursor to more functionality. (And, obviously, the format for this skeleton Options json should follow what Nico is establishing in their WIP PR).

tl;dr - #54 doesn't have to be a blocker to having an options.json to put YAML option descriptions in.

@axxroytovu
Copy link
Contributor Author

All good, I'll wait until Options.json is ready then.

@axxroytovu axxroytovu closed this Jul 21, 2024
@axxroytovu axxroytovu deleted the add-yaml-description branch October 27, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants