Пример #1
0
        static int getImageIndex(INesMenuElement nesElement)
        {
            if (nesElement is NesMenuFolder || nesElement is NesMenuCollection)
            {
                return(0);
            }
            if (nesElement is NesDefaultGame)
            {
                return(2);
            }
            if (nesElement is NesGame)
            {
                return(6);
            }
            if (nesElement is NesUGame)
            {
                return(8);
            }
            if (nesElement is FdsGame)
            {
                return(10);
            }
            if (nesElement is SnesGame)
            {
                return(12);
            }
            if (nesElement is N64Game)
            {
                return(14);
            }
            if (nesElement is SmsGame)
            {
                return(16);
            }
            if (nesElement is GenesisGame)
            {
                return(18);
            }
            if (nesElement is PceGame)
            {
                return(20);
            }
            if (nesElement is GbGame)
            {
                return(22);
            }
            if (nesElement is GbcGame)
            {
                return(24);
            }
            if (nesElement is GbaGame)
            {
                return(26);
            }

            return(4);
        }
Пример #2
0
        static int getImageIndex(INesMenuElement nesElement)
        {
            if (nesElement == null || nesElement is NesMenuFolder || nesElement is NesMenuCollection)
            {
                return(12);
            }

            /*
             * if (nesElement is Sega32XGame)
             *  return 0;
             * if (nesElement is Atari2600Game)
             *  return 2;
             * if (nesElement is ArcadeGame)
             *  return 6;
             * if (nesElement is NesUGame)
             *  return 8;
             * if (nesElement is FdsGame)
             *  return 10;
             * if (nesElement is GbGame)
             *  return 14;
             * if (nesElement is GbaGame)
             *  return 16;
             * if (nesElement is GbcGame)
             *  return 18;
             * if (nesElement is GenesisGame)
             *  return 20;
             * if (nesElement is GameGearGame)
             *  return 22;
             * if (nesElement is N64Game)
             *  return 24;
             * if (nesElement is NesGame)
             *  return 28;
             * if (nesElement is NesDefaultGame)
             *  return 30;
             * if (nesElement is PceGame)
             *  return 32;
             * if (nesElement is SmsGame)
             *  return 34;
             * if (nesElement is SnesGame)
             *  return 36;
             */
            return(4);
        }
            public int Compare(object o1, object o2)
            {
                if (o1 is ListViewItem)
                {
                    o1 = (o1 as ListViewItem).Tag;
                }
                if (o2 is ListViewItem)
                {
                    o2 = (o2 as ListViewItem).Tag;
                }

                if ((o1 as TreeNode).Tag is NesMenuCollection)
                {
                    return(-1);                                           // Root is always first
                }
                if ((o2 as TreeNode).Tag is NesMenuCollection)
                {
                    return(1);
                }
                INesMenuElement el1  = (o1 as TreeNode).Tag as INesMenuElement;
                INesMenuElement el2  = (o2 as TreeNode).Tag as INesMenuElement;
                var             pos1 = 2;
                var             pos2 = 2;

                if (el1 is NesMenuFolder)
                {
                    pos1 = (int)(el1 as NesMenuFolder).Position;
                }
                if (el2 is NesMenuFolder)
                {
                    pos2 = (int)(el2 as NesMenuFolder).Position;
                }
                if (pos1 != pos2)
                {
                    return(pos1.CompareTo(pos2));
                }
                return(el1.Name.CompareTo(el2.Name));
            }
        static int getImageIndex(INesMenuElement nesElement)
        {
            if (nesElement == null || nesElement is NesMenuFolder || nesElement is NesMenuCollection)
            {
                return(12);
            }

            if (nesElement is Sega32XGame)
            {
                return(0);
            }
            if (nesElement is Atari2600Game)
            {
                return(2);
            }
            if (nesElement is ArcadeGame)
            {
                return(6);
            }
            if (nesElement is NesUGame)
            {
                return(8);
            }
            if (nesElement is FdsGame)
            {
                return(10);
            }
            if (nesElement is GbGame)
            {
                return(14);
            }
            if (nesElement is GbaGame)
            {
                return(16);
            }
            if (nesElement is GbcGame)
            {
                return(18);
            }
            if (nesElement is GenesisGame)
            {
                return(20);
            }
            if (nesElement is GameGearGame)
            {
                return(22);
            }
            if (nesElement is N64Game)
            {
                return(24);
            }
            if (nesElement is NesGame)
            {
                return(28);
            }
            if (nesElement is NesDefaultGame)
            {
                return(30);
            }
            if (nesElement is PceGame)
            {
                return(32);
            }
            if (nesElement is SmsGame)
            {
                return(34);
            }
            if (nesElement is SnesGame)
            {
                return(36);
            }

            return(4);
        }
Пример #5
0
        static int getImageIndex(INesMenuElement nesElement)
        {
            if (nesElement == null || nesElement is NesMenuFolder || nesElement is NesMenuCollection)
            {
                return(12);
            }
            if (nesElement is FdsGame)
            {
                return(10);
            }
            if (nesElement is NesGame)
            {
                return((nesElement as NesGame).IsOriginalGame ? 30 : 28);
            }
            if (nesElement is SnesGame)
            {
                return(36);
            }
            if (nesElement is NesApplication)
            {
                var system = (nesElement as NesApplication).Metadata.AppInfo.Name;
                switch (system)
                {
                case "Sega - 32X":
                    return(0);

                case "Atari - 2600":
                    return(2);

                case "Arcade (various)":
                case "CP System I":
                case "CP System II":
                case "CP System III":
                case "FB Alpha - Arcade Games":
                case "MAME 2000":
                case "MAME 2003":
                case "MAME 2010":
                case "MAME 2014":
                    return(6);

                case "Nintendo - Game Boy":
                    return(14);

                case "Nintendo - Game Boy Advance":
                    return(16);

                case "Nintendo - Game Boy Color":
                    return(18);

                case "Sega - Mega Drive - Genesis":
                    return(20);

                case "Sega - Game Gear":
                    return(22);

                case "Nintendo - Nintendo 64":
                    return(24);

                case "Neo Geo":
                    return(26);

                case "NEC - PC Engine - TurboGrafx 16":
                    return(32);

                case "Sega - Master System - Mark III":
                    return(34);
                }
            }
            return(4);
        }