Conversation
|
I wonder if it would be a good idea to have an "id" field for a configuration parameter so you could have the title and the way it's referred to in code be different. |
the config schema property would be a dictionary where each key is the id of the config property, for example: "ConfigSchema": {
"EnableFeature": {
"Type": "bool"
},
"FeatureMax": {
"Type": "int",
"Minimum": 1,
"Maximum": 10
}
} |
|
Personal opinions but this kind of seems unnecessary there is already a way to make a config that is also bound to object aka more convenient to use. Though that way of making a config has flaws being you it is written by the program and loses all formatting and comments if it wasn't json. Using the Microsoft.Extensions.Configuration package is very nice for read-only configurations. But I think it's a little late for that change. Also how do you even access this? Every thing is marked internal and ModManifest is never passed to the mod. |
a schema allows config editors (in mod managers, mods, etc.) to give users more helpful information and restrictions beyond only being able to assume what type the property should be from what's already there. as well as that, lots of people are using configs with gdscript rather than exclusively in C# mods. it's primarily meant to make this information available outside of the mod and to consolidate it into the manifest rather than spread across multiple places |
my proposal for a config schema field in the mod manifest based on the layout of json schema. sorry for the c# side of things being lacking, im aware it could be better
each property in
ConfigSchemawill have the config property as the key and its data as the values.TitleandDescriptioncan optionally be provided for config managers to show richer information (for example,Titlecan be used in place of the config key andDescriptioncan fill a tooltip to better explain what a property does)properties will use the following types and the additional data associated with them:
string:MinLengthMaxLengthPattern: a regex pattern for use in C#. since godot's regex is based on PCRE, mod devs should define patterns separately in their gdscript code when required. hesitant with this one because of the catchint/float:MinimumMaximumMultipleOfstring/int/float:Enum: a list of acceptable valuesSuggestedEnum: a list of suggested values for hints/autocomplete in UIs, but any value is acceptedobject:Propertiesarray:ItemsMinItemsMaxItemsboolwould love discussion ty ૮ ˶′ ཅ ‵˶ ა