Ejemplo n.º 1
0
 public static void LoadSkins()
 {
     foreach (string svgPath in Directory.GetFiles("./skins", "*.svg"))
     {
         var svg = new SvgSkin();
         svg.Load(svgPath);
         Skins.Add(svg);
     }
     foreach (string padpyghtDir in Directory.GetDirectories("./skins"))
     {
         foreach (string iniPath in Directory.GetFiles(padpyghtDir, "*.ini"))
         {
             var pp = new PadpyghtSkin();
             pp.Load(iniPath);
             if (pp.LoadResult == SkinLoadResult.Ok)
             {
                 Skins.Add(pp);
             }
         }
     }
 }
Ejemplo n.º 2
0
        public static void LoadSkins()
        {
            foreach (var dir in SkinFolders)
            {
                if (!Directory.Exists(dir.Path))
                {
                    continue;
                }

                if ((dir.Types & SkinType.Svg) != 0)
                {
                    foreach (string svgPath in Directory.GetFiles(dir.Path, "*.svg"))
                    {
                        var svg = new SvgSkin();
                        svg.Load(svgPath);
                        if (svg.LoadResult == SkinLoadResult.Ok)
                        {
                            Skins.Add(svg);
                            var b = new BindingList <ColorRemap>();
                            foreach (var map in svg.EmbeddedRemaps)
                            {
                                b.Add(map);
                            }
                            AvailableRemaps[svg.Path] = b;
                            SelectedRemaps[svg]       = null;
                        }
                    }
                }

                if ((dir.Types & SkinType.PadPyght) != 0)
                {
                    foreach (string padpyghtDir in Directory.GetDirectories(dir.Path))
                    {
                        foreach (string iniPath in Directory.GetFiles(padpyghtDir, "*.ini"))
                        {
                            var pp = new PadpyghtSkin();
                            pp.Load(iniPath);
                            if (pp.LoadResult == SkinLoadResult.Ok)
                            {
                                Skins.Add(pp);
                            }
                        }
                    }
                }

                if ((dir.Types & SkinType.NintendoSpy) != 0)
                {
                    foreach (string nspyDir in Directory.GetDirectories(dir.Path))
                    {
                        foreach (string xmlPath in Directory.GetFiles(nspyDir, "skin.xml"))
                        {
                            var pp = new NintendoSpySkin();
                            pp.Load(xmlPath);
                            if (pp.LoadResult == SkinLoadResult.Ok)
                            {
                                Skins.Add(pp);
                            }
                        }
                    }
                }
            }
        }