예제 #1
0
        static XBoxConfig()
        {
            if (!LoadMapPack())
            {

                for (var i = 0; i < 7; i++)
                {

                    var map = new XboxMap();
                    map.ControlMaps = MakeControlGroups();
                    if (i < 5)
                    {
                        map.Name = Enum.GetName(typeof(ImageSetType), (ImageSetType)i);
                    }
                    else if (i == 5)
                    {
                        map.Name = "Sky - Local Horizon Mode";
                    }
                    else
                    {
                        map.Name = "Modeless Xbox Controller Map";
                    }
                    map.Slot = i;
                    xboxMaps.Add(map);
                }
            }
            //LoadMaps();
        }
예제 #2
0
 static XBoxConfig()
 {
     if (!LoadMapPack())
     {
         for (int i = 0; i < 7; i++)
         {
             XboxMap map = new XboxMap();
             map.ControlMaps = MakeControlGroups();
             if (i < 5)
             {
                 map.Name = Enum.GetName(typeof(ImageSetType), (ImageSetType)i);
             }
             else if (i == 5)
             {
                 map.Name = "Sky - Local Horizon Mode";
             }
             else
             {
                 map.Name = "Modeless Xbox Controller Map";
             }
             map.Slot = i;
             xboxMaps.Add(map);
         }
     }
     //LoadMaps();
 }
예제 #3
0
        public static void SaveMap(XboxMap map, string filename)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(XboxMap));
            StreamWriter  sw         = new StreamWriter(filename);

            serializer.Serialize(sw, map);

            sw.Close();
        }
예제 #4
0
        public static XboxMap LoadMap(string filename, bool update)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(XboxMap));
            FileStream    fs         = new FileStream(filename, FileMode.Open);

            XboxMap map = (XboxMap)serializer.Deserialize(fs);


            map.Dirty = true;

            fs.Close();
            map.UpdateMapLinks();

            return(map);
        }
예제 #5
0
        public static void SaveMap(XboxMap map, string filename)
        {
            var serializer = new XmlSerializer(typeof(XboxMap));
            var sw = new StreamWriter(filename);

            serializer.Serialize(sw, map);

            sw.Close();
        }