Пример #1
0
        protected static void PushStringSetting(
            SettingScope scope,
            SettingProtection protectionLevel,
            string label,
            string name,
            string defaultVal,
            Func <string, string> translator = null,
            string maskerName = "",
            Func <SettingBase, bool> maskingEvaluator = null)
        {
            SettingBase newSetting = new StrSetting(
                scope,
                protectionLevel,
                label,
                name,
                defaultVal,
                translator: translator);

            settings.Add(newSetting);
            nameSettingsMap.Add(name, newSetting);

            if (!string.IsNullOrEmpty(maskerName))
            {
                AddToMaskerMap(maskerName, name, maskingEvaluator);
            }
        }
Пример #2
0
            public IntSetting(
                SettingScope scope,
                SettingProtection protectionLevel,
                string label,
                string name,
                int defaultVal = 0,
                int minVal     = int.MinValue,
                int maxVal     = int.MaxValue,
                Func <int, string> translator = null,
                string postFix = "",
                bool dropdown  = false)
                : base(
                    scope: scope,
                    protectionLevel: protectionLevel,
                    label: label,
                    name: name)
            {
                this.defaultVal = defaultVal;

                this.minVal = minVal;
                this.maxVal = maxVal;

                this.translator = translator;
                this.postFix    = postFix;

                this.dropdown = dropdown;
            }
Пример #3
0
        protected static void PushFloatSetting(
            SettingScope scope,
            SettingProtection protectionLevel,
            string label,
            string name,
            float defaultVal,
            float minVal = float.MinValue,
            float maxVal = float.MaxValue,
            Func <float, string> translator = null,
            string postFix    = "",
            string maskerName = "",
            Func <SettingBase, bool> maskingEvaluator = null)
        {
            SettingBase newSetting = new FloatSetting(
                scope,
                protectionLevel,
                label,
                name,
                defaultVal,
                minVal: minVal,
                maxVal: maxVal,
                translator: translator,
                postFix: postFix);

            settings.Add(newSetting);
            nameSettingsMap.Add(name, newSetting);

            if (!string.IsNullOrEmpty(maskerName))
            {
                AddToMaskerMap(maskerName, name, maskingEvaluator);
            }
        }
Пример #4
0
 protected ColorSetting(
     SettingScope scope,
     SettingProtection protectionLevel,
     string label,
     string name)
     : base(
         scope: scope,
         protectionLevel: protectionLevel,
         label: label,
         name: name)
 {
 }
Пример #5
0
            protected SettingBase(
                SettingScope scope,
                SettingProtection protectionLevel,
                string label,
                string name)
            {
                this.scope           = scope;
                this.protectionLevel = protectionLevel;
                this.label           = label;
                this.name            = name;

                tmpNewValue = "";
                nameDirty   = false;
            }
Пример #6
0
 public BoolSetting(
     SettingScope scope,
     SettingProtection protectionLevel,
     string label,
     string name,
     bool defaultVal = false)
     : base(
         scope: scope,
         protectionLevel: protectionLevel,
         label: label,
         name: name)
 {
     this.defaultVal = defaultVal;
 }
Пример #7
0
 public SettingColorSetting(
     SettingScope scope,
     SettingProtection protectionLevel,
     string label,
     string name,
     Color defaultVal)
     : base(
         scope: scope,
         protectionLevel: protectionLevel,
         label: label,
         name: name)
 {
     this.defaultVal = defaultVal;
 }
Пример #8
0
 public StrSetting(
     SettingScope scope,
     SettingProtection protectionLevel,
     string label,
     string name,
     string defaultVal = "",
     Func <string, string> translator = null)
     : base(
         scope: scope,
         protectionLevel: protectionLevel,
         label: label,
         name: name)
 {
     this.defaultVal = defaultVal;
     this.translator = translator;
 }
Пример #9
0
            public FloatSetting(
                SettingScope scope,
                SettingProtection protectionLevel,
                string label,
                string name,
                float defaultVal = 0,
                float minVal     = float.MinValue,
                float maxVal     = float.MaxValue,
                Func <float, string> translator = null,
                string postFix = "")
                : base(
                    scope: scope,
                    protectionLevel: protectionLevel,
                    label: label,
                    name: name)
            {
                this.defaultVal = defaultVal;

                this.minVal = minVal;
                this.maxVal = maxVal;

                this.postFix    = postFix;
                this.translator = translator;
            }