Пример #1
0
        private UIElement CreateBlankSpriteSelection(ushort dexID, FrontSpriteSelectionTypes type)
        {
            Grid grid = new Grid();

            grid.Width  = 64;
            grid.Height = 64;
            if (dexID == 327)
            {
                grid.Background = spriteDisabled;
            }
            else if (PokeManager.Settings.FrontSpriteSelections[shinyMode ? 1 : 0, dexID - 1] == type)
            {
                grid.Background = spriteUnhighlightChecked;
            }
            else
            {
                grid.Background = spriteUnhighlight;
            }

            Label label = new Label();

            label.HorizontalAlignment = HorizontalAlignment.Center;
            label.VerticalAlignment   = VerticalAlignment.Center;
            label.Padding             = new Thickness(1, 1, 1, 1);
            label.Content             = "No " + type.ToString();

            grid.Children.Add(label);
            return(grid);
        }
        private UIElement CreateSpriteSelection(ushort dexID, FrontSpriteSelectionTypes type)
        {
            Grid grid = new Grid();
            // Spinda has spot drawing code so we're not allowed to change him
            if (dexID != 327) {
                grid.PreviewMouseDown += OnSpriteSelectionClicked;
                grid.MouseEnter += OnSpriteSelectionEnter;
                grid.MouseLeave += OnSpriteSelectionLeave;
                if (PokeManager.Settings.FrontSpriteSelections[shinyMode ? 1 : 0, dexID - 1] == type)
                    grid.Background = spriteUnhighlightChecked;
                else
                    grid.Background = spriteUnhighlight;
            }
            else {
                grid.Background = spriteDisabled;
            }
            grid.Width = 64;
            grid.Height = 64;

            Image sprite = new Image();
            sprite.Width = 64;
            sprite.Height = 64;
            sprite.IsHitTestVisible = false;
            if (type == FrontSpriteSelectionTypes.RSE) {
                if (shinyMode)
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).ShinyImage;
                else
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).Image;
            }
            else if (type == FrontSpriteSelectionTypes.FRLG) {
                if (shinyMode)
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).FRLGShinyImage;
                else
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).FRLGImage;
            }
            else {
                if (shinyMode)
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).CustomShinyImage;
                else
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).CustomImage;
            }

            grid.Children.Add(sprite);

            grid.Tag = new SpriteSelecionTag{ DexID = dexID, Type = type };
            return grid;
        }
        private UIElement CreateBlankSpriteSelection(ushort dexID, FrontSpriteSelectionTypes type)
        {
            Grid grid = new Grid();
            grid.Width = 64;
            grid.Height = 64;
            if (dexID == 327)
                grid.Background = spriteDisabled;
            else if (PokeManager.Settings.FrontSpriteSelections[shinyMode ? 1 : 0, dexID - 1] == type)
                grid.Background = spriteUnhighlightChecked;
            else
                grid.Background = spriteUnhighlight;

            Label label = new Label();
            label.HorizontalAlignment = HorizontalAlignment.Center;
            label.VerticalAlignment = VerticalAlignment.Center;
            label.Padding = new Thickness(1, 1, 1, 1);
            label.Content = "No " + type.ToString();

            grid.Children.Add(label);
            return grid;
        }
Пример #4
0
 public static bool HasPokemonImageType(ushort dexID, FrontSpriteSelectionTypes type, bool shiny, byte formID = byte.MaxValue)
 {
     switch (type) {
     case FrontSpriteSelectionTypes.RSE: return true;
     case FrontSpriteSelectionTypes.FRLG:
         if (formID != byte.MaxValue)
             return false;
         else
             return gen3PokemonImages[dexID].FRLGImage != null;
     case FrontSpriteSelectionTypes.Custom:
         if (formID != byte.MaxValue) {
             if (shiny)
                 return gen3PokemonFormImages[new DexFormID { DexID = dexID, FormID = formID }].CustomShinyImage != null;
             else
                 return gen3PokemonFormImages[new DexFormID { DexID = dexID, FormID = formID }].CustomImage != null;
         }
         else {
             if (shiny)
                 return gen3PokemonImages[dexID].CustomShinyImage != null;
             else
                 return gen3PokemonImages[dexID].CustomImage != null;
         }
     }
     return false;
 }
Пример #5
0
        private UIElement CreateSpriteSelection(ushort dexID, FrontSpriteSelectionTypes type)
        {
            Grid grid = new Grid();

            // Spinda has spot drawing code so we're not allowed to change him
            if (dexID != 327)
            {
                grid.PreviewMouseDown += OnSpriteSelectionClicked;
                grid.MouseEnter       += OnSpriteSelectionEnter;
                grid.MouseLeave       += OnSpriteSelectionLeave;
                if (PokeManager.Settings.FrontSpriteSelections[shinyMode ? 1 : 0, dexID - 1] == type)
                {
                    grid.Background = spriteUnhighlightChecked;
                }
                else
                {
                    grid.Background = spriteUnhighlight;
                }
            }
            else
            {
                grid.Background = spriteDisabled;
            }
            grid.Width  = 64;
            grid.Height = 64;

            Image sprite = new Image();

            sprite.Width            = 64;
            sprite.Height           = 64;
            sprite.IsHitTestVisible = false;
            if (type == FrontSpriteSelectionTypes.RSE)
            {
                if (shinyMode)
                {
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).ShinyImage;
                }
                else
                {
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).Image;
                }
            }
            else if (type == FrontSpriteSelectionTypes.FRLG)
            {
                if (shinyMode)
                {
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).FRLGShinyImage;
                }
                else
                {
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).FRLGImage;
                }
            }
            else
            {
                if (shinyMode)
                {
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).CustomShinyImage;
                }
                else
                {
                    sprite.Source = PokemonDatabase.GetPokemonImageTypes(dexID).CustomImage;
                }
            }

            grid.Children.Add(sprite);

            grid.Tag = new SpriteSelecionTag {
                DexID = dexID, Type = type
            };
            return(grid);
        }