AMP icon indicating copy to clipboard operation
AMP copied to clipboard

Add ability to specify ConfigFormat per input

Open IceOfWraith opened this issue 3 years ago • 5 comments

Feature Request

Feature Information:

When using automap, we'd like the option to specify per input setting in the configmanifest.json what the format should be. This would override any ConfigFormat specified in the metaconfig.json.

I confirm:

  • [x] that I have searched for an existing feature request matching the description.

IceOfWraith avatar Feb 12 '22 08:02 IceOfWraith

Can you give some examples?

PhonicUK avatar Feb 12 '22 12:02 PhonicUK

Sure, any scenario where the regex wouldn't match is what we're looking at. Things like: MOTD={"Line1", "Line2"} Admins=[user1,user2,user3]

Basically, lines with symbols that we don't want the user to have to enter for a setting to work. But don't apply to every setting.

IceOfWraith avatar Feb 12 '22 16:02 IceOfWraith

Sounds like what you actually want is a setting to govern the syntax of lists and arrays. Something like:

ArrayStart: "{",
ArrayEnd: "}",
ArraySeparator: ", ",
ArrayQuotes: "\""

Which would produce {"Line1", "Line2"}

Really this is #574

PhonicUK avatar Apr 21 '22 20:04 PhonicUK

My memory is terrible lately. Too much on my plate. Perhaps @Greelan can speak up on what the specific need was for this as opposed to a theoretical scenario. If we can use lists as input types to be merged into the config file, that's a big step forward and would probably combine the two issues. The part that would need clarified is if it's possible to handle multiple lines like the Map=Europe Map=US Map=Mars

That will probably require the ability to merge/add using automap though as the user might input 25 options, but the config file only includes 10 of those Map= lines.

One step at a time though... I think the solution above will probably work well for a large number of the inputs we were having the issue with.

IceOfWraith avatar Apr 29 '22 16:04 IceOfWraith

Arrays/lists were a big part of the issue, but basically it was to help with any situation where the format of a particular parameter was different to the “norm” or default - eg if certain entries require quotes around values but most others don’t

Greelan avatar Apr 29 '22 22:04 Greelan