AMP icon indicating copy to clipboard operation
AMP copied to clipboard

Enum values re-ordered in Generic

Open Greelan opened this issue 3 years ago • 1 comments

Bug Report

System Information

  • Ubuntu 20.04.3 LTS
  • AMP Nightly v20220305.1
  • Nightly

I confirm:

  • [x] that I have searched for an existing bug report for this issue.
  • [x] that I am using the latest available version of AMP.
  • [x] that my operating system is up-to-date.

Symptoms

EnumValues are included in a Generic config.json as follows:

   {
        "DisplayName":"Server Public Status",
        "Category":"Server Settings",
        "Description":"Sets the public status of the server and whether it is included in the master server list",
        "Keywords":"public,list,private",
        "FieldName":"sv_public",
        "InputType":"enum",
        "IsFlagArgument":false,
        "ParamFieldName":"sv_public",
        "IncludeInCommandLine":false,
        "DefaultValue":"1",
        "EnumValues":{
            "1":"Public and included in server list",
            "0":"Public but not included in server list",
            "-1":"Not public"
        }
    }

However, they are displayed in a different order:

Screenshot

It seems AMP is re-ordering perhaps based on numerical order (although it does not appear to do that for -1).

The UI should appear instead exactly in the order that it is listed in the config.json.

Reproduction

Create a manifest setting like the above, and see how it appears in the UI.

Greelan avatar Mar 05 '22 08:03 Greelan

Low priority - I'm not entirely sure why it's not in the same order though given that no sorting is applied. I suspect this is down to how Dictionary<> is implemented.

PhonicUK avatar Mar 08 '22 17:03 PhonicUK