Beispiel #1
0
        private void NonItemTooltip()
        {
            RootLayout.Visibility = Visibility.Visible;
            try
            {
                string Title = CurrentString.Split('|')[0].Trim();
                string Desc  = CurrentString.Split('|')[1].Trim();

                ItemName.Text       = Title;
                ItemName.Foreground = new SolidColorBrush(Colors.Purple);

                // Hide Item related fields
                TypesPanel.Visibility       = Visibility.Collapsed;
                StatPanel.Visibility        = Visibility.Collapsed;
                GemStack.Visibility         = Visibility.Collapsed;
                GemNamesLabel1.Visibility   = Visibility.Collapsed;
                GemNamesLabel2.Visibility   = Visibility.Collapsed;
                GemNamesLabel3.Visibility   = Visibility.Collapsed;
                SocketBonusLabel.Visibility = Visibility.Collapsed;
                EnchantLabel.Visibility     = Visibility.Collapsed;

                LocationLabel.Visibility = Visibility.Visible;
                LocationLabel.Text       = Desc;

                ItemsGrid.Visibility = Visibility.Collapsed;
            }
            catch (Exception ex) {
                ErrorBox eb = new ErrorBox(
                    "Error setting up a Non-Item Tooltip",
                    ex.Message, "NonItemTooltip()", "No Additional Info",
                    ex.StackTrace);
            }
        }
Beispiel #2
0
        private void NonItemTooltip()
        {
            RootLayout.Visibility = Visibility.Visible;
            try {
                string Title = CurrentString.Split('|')[0].Trim();
                string Desc  = CurrentString.Split('|')[1].Trim();

                ItemName.Text       = Title;
                ItemName.Foreground = new SolidColorBrush(Colors.Purple);

                // Hide Item related fields
                TypesPanel.Visibility       = Visibility.Collapsed;
                StatPanel.Visibility        = Visibility.Collapsed;
                GemStack.Visibility         = Visibility.Collapsed;
                GemNamesLabel1.Visibility   = Visibility.Collapsed;
                GemNamesLabel2.Visibility   = Visibility.Collapsed;
                GemNamesLabel3.Visibility   = Visibility.Collapsed;
                SocketBonusLabel.Visibility = Visibility.Collapsed;
                EnchantLabel.Visibility     = Visibility.Collapsed;
                ReforgingLabel.Visibility   = Visibility.Collapsed;
                SetLabel.Visibility         = Visibility.Collapsed;
                UnusedStatPanel.Visibility  = Visibility.Collapsed;

                LocationLabel.Visibility = Visibility.Visible;
                LocationLabel.Text       = Desc;

                if (ItemSet != null && ItemSet.Count > 0)
                {
                    ItemsGrid.Visibility = Visibility.Visible;
                    #region Additional Items, like in Build Upgrade List
                    ItemsGrid.Children.Clear();
                    ItemsGrid.RowDefinitions.Clear();
                    int row = 0;
                    foreach (ItemInstance setItem in ItemSet)
                    {
                        ItemsGrid.RowDefinitions.Add(new RowDefinition()
                        {
                            Height = GridLength.Auto
                        });
                        if (setItem == null)
                        {
                            continue;
                        }

                        Image iconImage = new Image();
                        iconImage.Style  = Resources["SmallIconStyle"] as Style;
                        iconImage.Source = Icons.AnIcon(setItem.Item.IconPath);
                        Grid.SetColumn(iconImage, 0);
                        Grid.SetRow(iconImage, row);
                        ItemsGrid.Children.Add(iconImage);

                        if (setItem.Gem1Id > 0)
                        {
                            Image gem1Image = new Image();
                            gem1Image.Style  = Resources["SmallIconStyle"] as Style;
                            gem1Image.Source = Icons.AnIcon(setItem.Gem1.IconPath);
                            Grid.SetColumn(gem1Image, 1);
                            Grid.SetRow(gem1Image, row);
                            ItemsGrid.Children.Add(gem1Image);
                        }

                        if (setItem.Gem2Id > 0)
                        {
                            Image gem2Image = new Image();
                            gem2Image.Style  = Resources["SmallIconStyle"] as Style;
                            gem2Image.Source = Icons.AnIcon(setItem.Gem2.IconPath);
                            Grid.SetColumn(gem2Image, 2);
                            Grid.SetRow(gem2Image, row);
                            ItemsGrid.Children.Add(gem2Image);
                        }

                        if (setItem.Gem3Id > 0)
                        {
                            Image gem3Image = new Image();
                            gem3Image.Style  = Resources["SmallIconStyle"] as Style;
                            gem3Image.Source = Icons.AnIcon(setItem.Gem3.IconPath);
                            Grid.SetColumn(gem3Image, 3);
                            Grid.SetRow(gem3Image, row);
                            ItemsGrid.Children.Add(gem3Image);
                        }

                        TextBlock nameText = new TextBlock();
                        if (setItem.EnchantId > 0)
                        {
                            nameText.Text = string.Format("{0} ({1})", setItem.Item.Name, setItem.Enchant.Name);
                        }
                        else
                        {
                            nameText.Text = string.Format("{0}", setItem.Item.Name);
                        }
                        nameText.Foreground = new SolidColorBrush(ColorForQuality(setItem.Item.Quality));
                        Grid.SetColumn(nameText, 4);
                        Grid.SetRow(nameText, row);
                        ItemsGrid.Children.Add(nameText);

                        row++;
                    }
                    #endregion
                }
                else
                {
                    ItemsGrid.Visibility = Visibility.Collapsed;
                }
            } catch (Exception ex) {
                new Base.ErrorBox()
                {
                    Title        = "Error setting up a Non-Item Tooltip",
                    Function     = "NonItemTooltip()",
                    TheException = ex,
                }.Show();
            }
        }