Exemplo n.º 1
0
        public static ProfileSettings GetSettingsToProfile()
        {
            var baseName = "VHR_Custom";
            var index = Profiles.Count(m => !m.IsDefault) + 1;

            ProfileSettings p = new ProfileSettings
            {
                ProfileName = baseName+index,
                ProfileDescription = "Custom VHR User-Created Profile #"+index,
                IsDefault = false,
                Options = GetOptions()
            };
            return p;
        }
Exemplo n.º 2
0
        //TODO Not working
        public static void LoadProfileDesc(ProfileSettings current, Menu menu)
        {

            var currentDescription = current.ProfileDescription;
            List<string> array = new List<string>();
            for (int i = 0; i < currentDescription.Length; i += 16)
            {
                array.Add(currentDescription.Substring(i, 16));
            }
            var counter = 0;
            foreach (var h in array)
            {
                menu.AddItem(new MenuItem(string.Format("dz191.vhr.ps.{0}.{1}", current.ProfileName.ToLower(), counter), h));
                counter++;
            }
        }
Exemplo n.º 3
0
        public static void LoadProfile(ProfileSettings P)
        {
            if (P != null)
            {
                foreach (var option in P.Options)
                {
                    //Console.WriteLine(option.getMenuName());
                    // continue;
                    var menuItem = Variables.Menu.Item(option.getMenuName());
                    if (menuItem != null)
                    {
                        switch (option.ValueType)
                        {
                        case ValueTypes.Boolean:
                            if (!option.getMenuName().ToLower().Contains("dz191.vhr.misc.tumble.noaastealth"))
                            {
                                menuItem.SetValue(option.BoolValue);
                            }
                            break;

                        case ValueTypes.Keybind:
                            if (option.KeybindValue != null)
                            {
                                menuItem.SetValue(new KeyBind(option.KeybindValue.Item1, option.KeybindValue.Item2));
                            }
                            break;

                        case ValueTypes.Slider:
                            if (option.SliderValue != null)
                            {
                                menuItem.SetValue(new Slider(option.SliderValue.Item1, option.SliderValue.Item2, option.SliderValue.Item3));
                            }
                            break;

                        case ValueTypes.Stringlist:
                            if (option.StringListValue != null)
                            {
                                menuItem.SetValue(
                                    new StringList(option.StringListValue.Item1, option.StringListValue.Item2));
                            }
                            break;
                        }
                    }
                }
            }
        }