Description:
Default string parser.

Added In: v0.45

Function

    public class UMFConfigString : UMFConfigParser<string>
    {
        public string DefaultValue;
        public string VanillaValue;
        public bool KeyBind;
        public bool RequiresRestart;
        public string[] AllowedValues;

        public UMFConfigString(string defaultValue = "", string vanillaValue = "", bool isKeyBind = false, bool requiresRestart = false, params string[] allowedValues)
        {
            DefaultValue = defaultValue.Trim();
            VanillaValue = vanillaValue.Trim();
            KeyBind = isKeyBind;
            RequiresRestart = requiresRestart;
            AllowedValues = allowedValues;
        }

        public override string Parse(string value)
        {
            return value.Trim();
        }

        public override string ToString()
        {
            return DefaultValue;
        }

        public override string Default()
        {
            return DefaultValue;
        }

        public override string Vanilla()
        {
            return VanillaValue.ToString();
        }

        public override string Allowed()
        {
            return (AllowedValues.Length > 0 ? string.Join(",", AllowedValues.Select(x => x.ToString()).ToArray()) : null);
        }

        public override string Restart()
        {
            return RequiresRestart.ToString();
        }

        public override string IsKeyBind()
        {
            return KeyBind.ToString();
        }
    }



Usage

//Coming soon



Examples

//Coming soon