Пример #1
0
        public Saver()
        {
            Console.WriteLine(nameof(ModdedCarSaver) + " booting up");

            Tick    += OnTick;
            KeyUp   += OnKeyUp;
            KeyDown += OnKeyDown;


            VehicleList = IniHelper.LoadIni() ?? new VehicleList()
            {
                Vehicles = new System.Collections.Generic.List <VehicleModel>()
                {
                    new VehicleModel()
                    {
                        VehicleHash = VehicleHash.Zentorno,
                    }
                }
            };

            myMenu.OnItemSelect  += Menu_OnItemSelect;
            myMenu.OnIndexChange += (sender, newIndex) => highlighted = newIndex;
            //StyleMenu();
            RefreshMenu();
            myMenuPool.Add(myMenu);
        }
Пример #2
0
        public static void SaveIni(VehicleList vehicleList)
        {
            var vehiclejson = JsonConvert.SerializeObject(vehicleList, Formatting.Indented, new Newtonsoft.Json.Converters.StringEnumConverter());

            File.WriteAllText(configName, vehiclejson);
        }