Exemple #1
0
 public Pokeblock(PokeblockCase pokeblockCase, PokeblockColors color, byte spicy, byte dry, byte sweet, byte bitter, byte sour, byte feel, byte unknown)
 {
     this.pokeblockCase = pokeblockCase;
     this.color         = color;
     this.spicy         = spicy;
     this.dry           = dry;
     this.sweet         = sweet;
     this.bitter        = bitter;
     this.sour          = sour;
     this.feel          = feel;
     this.unknown       = unknown;
 }
 public Pokeblock(PokeblockCase pokeblockCase, PokeblockColors color, byte spicy, byte dry, byte sweet, byte bitter, byte sour, byte feel, byte unknown)
 {
     this.pokeblockCase	= pokeblockCase;
     this.color			= color;
     this.spicy			= spicy;
     this.dry			= dry;
     this.sweet			= sweet;
     this.bitter			= bitter;
     this.sour			= sour;
     this.feel			= feel;
     this.unknown		= unknown;
 }
        public void AddPokeblock(PokeblockColors color, byte spicy, byte dry, byte sweet, byte bitter, byte sour, byte feel, byte unknown)
        {
            if (caseSize == 0 || pokeblocks.Count < caseSize)
            {
                inventory.GameSave.IsChanged = true;
                pokeblocks.Add(new Pokeblock(this, color, spicy, dry, sweet, bitter, sour, feel, unknown));

                PokeblockCaseEventArgs args = new PokeblockCaseEventArgs();
                args.Index     = pokeblocks.Count - 1;
                args.Pokeblock = pokeblocks[pokeblocks.Count - 1];
                OnAddListViewItem(args);
            }
        }
 public static BitmapSource GetPokeblockImageFromColor(PokeblockColors color, bool large)
 {
     if (large)
     {
         if (pokeblockLargeImageMap.ContainsKey(color))
         {
             return(pokeblockLargeImageMap[color]);
         }
     }
     else
     {
         if (pokeblockSmallImageMap.ContainsKey(color))
         {
             return(pokeblockSmallImageMap[color]);
         }
     }
     return(null);
 }
Exemple #5
0
        private void AddFlavor(PokeblockColors color, byte amount)
        {
            Grid grid = new Grid();

            grid.Height = 22;

            Image image = new Image();

            image.Source = ItemDatabase.GetPokeblockImageFromColor(color, false);
            image.Width  = 10;
            image.Height = 10;
            image.HorizontalAlignment = HorizontalAlignment.Left;
            image.VerticalAlignment   = VerticalAlignment.Center;
            grid.Children.Add(image);
            Label labelFlavor = new Label();

            labelFlavor.Margin            = new Thickness(10, 0, 0, 0);
            labelFlavor.Padding           = new Thickness(5, 3, 5, 3);
            labelFlavor.FontWeight        = FontWeights.Bold;
            labelFlavor.VerticalAlignment = VerticalAlignment.Center;
            labelFlavor.Content           = ((PokeblockFlavorTypes)color).ToString() + "/" + ((ConditionTypes)color).ToString();
            grid.Children.Add(labelFlavor);
            Label labelAmount = new Label();

            labelAmount.Margin                     = new Thickness(10, 0, 0, 0);
            labelAmount.Padding                    = new Thickness(5, 3, 5, 3);
            labelAmount.FontWeight                 = FontWeights.Bold;
            labelAmount.Width                      = double.NaN;
            labelAmount.HorizontalAlignment        = HorizontalAlignment.Stretch;
            labelAmount.HorizontalContentAlignment = HorizontalAlignment.Right;
            labelAmount.VerticalAlignment          = VerticalAlignment.Center;
            labelAmount.Content                    = amount.ToString();
            grid.Children.Add(labelAmount);

            if (stackPanelFlavors1.Children.Count < 3)
            {
                stackPanelFlavors1.Children.Add(grid);
                stackPanelFlavors1.Height = (stackPanelFlavors1.Children.Count == 3 ? 66 : 44);
            }
            else
            {
                stackPanelFlavors2.Children.Add(grid);
            }
        }
 private void AddPokeblockCase(int index, uint caseSize)
 {
     parent.Inventory.AddPokeblockCase(caseSize);
     for (int i = 0; i < parent.Inventory.Pokeblocks.TotalSlots; i++)
     {
         PokeblockColors color   = (PokeblockColors)raw[index + i * 8];
         byte            spicy   = raw[index + i * 8 + 1];
         byte            dry     = raw[index + i * 8 + 2];
         byte            sweet   = raw[index + i * 8 + 3];
         byte            bitter  = raw[index + i * 8 + 4];
         byte            sour    = raw[index + i * 8 + 5];
         byte            feel    = raw[index + i * 8 + 6];
         byte            unknown = raw[index + i * 8 + 7];
         if (color != PokeblockColors.None)
         {
             parent.Inventory.Pokeblocks.AddPokeblock(color, spicy, dry, sweet, bitter, sour, feel, unknown);
         }
     }
 }
Exemple #7
0
 public PokeblockFlavor(PokeblockColors flavor, byte amount)
 {
     this.Flavor = flavor;
     this.Amount = amount;
 }
        public static void Initialize()
        {
            ItemDatabase.gen3ImageMap = new Dictionary <ushort, BitmapSource>();
            ItemDatabase.gen3ItemMap  = new Dictionary <ushort, ItemData>();
            ItemDatabase.gen3ItemList = new List <ItemData>();

            ItemDatabase.pokeblockLargeImageMap = new Dictionary <PokeblockColors, BitmapSource>();
            ItemDatabase.pokeblockSmallImageMap = new Dictionary <PokeblockColors, BitmapSource>();

            ItemDatabase.decorationImageMap         = new Dictionary <byte, BitmapSource>();
            ItemDatabase.decorationFullSizeImageMap = new Dictionary <byte, BitmapSource>();
            ItemDatabase.decorationMap  = new Dictionary <byte, DecorationData>();
            ItemDatabase.decorationList = new List <DecorationData>();

            ItemDatabase.easyChatMap        = new Dictionary <ushort, string>();
            ItemDatabase.easyChatReverseMap = new Dictionary <string, ushort>();
            ItemDatabase.easyChatList       = new List <string>();

            ItemDatabase.pocketNamesMap = new Dictionary <ItemTypes, string>()
            {
                { ItemTypes.PC, "PC" },
                { ItemTypes.Items, "Items" },
                { ItemTypes.KeyItems, "Key Items" },
                { ItemTypes.PokeBalls, "Poké Balls" },
                { ItemTypes.TMCase, "TMs & HMs" },
                { ItemTypes.Berries, "Berries" },
                { ItemTypes.CologneCase, "Cologne Case" },
                { ItemTypes.DiscCase, "Disc Case" },
                { ItemTypes.InBattle, "In-Battle Items" },
                { ItemTypes.Valuables, "Valuable Items" },
                { ItemTypes.Hold, "Hold Items" },
                { ItemTypes.Misc, "Other Items" },
                { ItemTypes.Any, "Any" },
                { ItemTypes.TheVoid, "The Void" }
            };
            ItemDatabase.decorationContainerNamesMap = new Dictionary <DecorationTypes, string>()
            {
                { DecorationTypes.Desk, "Desks" },
                { DecorationTypes.Chair, "Chairs" },
                { DecorationTypes.Plant, "Plants" },
                { DecorationTypes.Ornament, "Ornaments" },
                { DecorationTypes.Mat, "Mats" },
                { DecorationTypes.Poster, "Posters" },
                { DecorationTypes.Doll, "Dolls" },
                { DecorationTypes.Cushion, "Cushions" }
            };

            secretBaseUsedIcon = ResourceDatabase.GetImageFromName("DecorationSecretBase");
            bedroomUsedIcon    = ResourceDatabase.GetImageFromName("DecorationBedroom");

            SQLiteCommand    command;
            SQLiteDataReader reader;
            DataTable        table;

            SQLiteConnection connection = new SQLiteConnection("Data Source=ItemDatabase.db");

            connection.Open();

            // Load Gen3 Item Data
            command = new SQLiteCommand("SELECT * FROM Items", connection);
            reader  = command.ExecuteReader();
            table   = new DataTable("Items");
            table.Load(reader);
            foreach (DataRow row in table.Rows)
            {
                ItemData item = new ItemData(row, Generations.Gen3);
                gen3ItemMap.Add(item.ID, item);
                gen3ItemList.Add(item);
            }

            // Load Gen3 Item Images
            command = new SQLiteCommand("SELECT * FROM ItemImages", connection);
            reader  = command.ExecuteReader();
            table   = new DataTable("Images");
            table.Load(reader);
            foreach (DataRow row in table.Rows)
            {
                ushort       id    = (ushort)(long)row["ID"];
                BitmapSource image = LoadImage((byte[])row["Image"]);
                gen3ImageMap.Add(id, image);
            }

            // Load Gen3 Decoration Data
            command = new SQLiteCommand("SELECT * FROM Decorations", connection);
            reader  = command.ExecuteReader();
            table   = new DataTable("Decorations");
            table.Load(reader);
            foreach (DataRow row in table.Rows)
            {
                DecorationData decoration = new DecorationData(row);
                decorationMap.Add(decoration.ID, decoration);
                decorationList.Add(decoration);
            }

            // Load Gen3 Decoration Images
            command = new SQLiteCommand("SELECT * FROM DecorationImages", connection);
            reader  = command.ExecuteReader();
            table   = new DataTable("DecorationImages");
            table.Load(reader);
            foreach (DataRow row in table.Rows)
            {
                byte id = (byte)(long)row["ID"];
                decorationImageMap.Add(id, LoadImage((byte[])row["Image"]));
                decorationFullSizeImageMap.Add(id, LoadImage((byte[])row["ImageFullSize"]));
            }

            // Load Gen3 Pokeblock Small Images
            command = new SQLiteCommand("SELECT * FROM PokeblockImages", connection);
            reader  = command.ExecuteReader();
            table   = new DataTable("PokeblockImages");
            table.Load(reader);
            foreach (DataRow row in table.Rows)
            {
                PokeblockColors id = (PokeblockColors)(long)row["ID"];
                pokeblockSmallImageMap.Add(id, LoadImage((byte[])row["ImageSmall"]));
                pokeblockLargeImageMap.Add(id, LoadImage((byte[])row["ImageLarge"]));
            }
            // Load Gen3 Pokeblock Large Images

            /*command = new SQLiteCommand("SELECT * FROM PokeblockLargeImages", connection);
             * reader = command.ExecuteReader();
             * table = new DataTable("PokeblockLargeImages");
             * table.Load(reader);
             * foreach (DataRow row in table.Rows) {
             *      PokeblockColors id = (PokeblockColors)(long)row["ID"];
             *      BitmapImage image = LoadImage((byte[])row["Data"]);
             *      pokeblockLargeImageMap.Add(id, image);
             * }*/


            connection.Close();
        }
 public PokeblockFlavor(PokeblockColors flavor, byte amount)
 {
     this.Flavor = flavor;
     this.Amount = amount;
 }
        private void AddFlavor(PokeblockColors color, byte amount)
        {
            Grid grid = new Grid();
            grid.Height = 22;

            Image image = new Image();
            image.Source = ItemDatabase.GetPokeblockImageFromColor(color, false);
            image.Width = 10;
            image.Height = 10;
            image.HorizontalAlignment = HorizontalAlignment.Left;
            image.VerticalAlignment = VerticalAlignment.Center;
            grid.Children.Add(image);
            Label labelFlavor = new Label();
            labelFlavor.Margin = new Thickness(10, 0, 0, 0);
            labelFlavor.Padding = new Thickness(5, 3, 5, 3);
            labelFlavor.FontWeight = FontWeights.Bold;
            labelFlavor.VerticalAlignment = VerticalAlignment.Center;
            labelFlavor.Content = ((PokeblockFlavorTypes)color).ToString() + "/" + ((ConditionTypes)color).ToString();
            grid.Children.Add(labelFlavor);
            Label labelAmount = new Label();
            labelAmount.Margin = new Thickness(10, 0, 0, 0);
            labelAmount.Padding = new Thickness(5, 3, 5, 3);
            labelAmount.FontWeight = FontWeights.Bold;
            labelAmount.Width = double.NaN;
            labelAmount.HorizontalAlignment = HorizontalAlignment.Stretch;
            labelAmount.HorizontalContentAlignment = HorizontalAlignment.Right;
            labelAmount.VerticalAlignment = VerticalAlignment.Center;
            labelAmount.Content = amount.ToString();
            grid.Children.Add(labelAmount);

            if (stackPanelFlavors1.Children.Count < 3) {
                stackPanelFlavors1.Children.Add(grid);
                stackPanelFlavors1.Height = (stackPanelFlavors1.Children.Count == 3 ? 66 : 44);
            }
            else {
                stackPanelFlavors2.Children.Add(grid);
            }
        }