예제 #1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }

            OverlayItems.SimpleItem Item = value as OverlayItems.SimpleItem;

            return(TextColors.TryGet((Item.SNOItem.SetItem) ? "Set" : "Legendary"));
        }
        public void PaintItem(OverlayItems Items, ushort ID)
        {
            OverlayItems.SimpleItem Item = Items.Item;

            Brush Color = TextColors.TryGet(Item.ItemQuality.ToString());

            UniqueItem Legendary = new UniqueItem {
                ItemName          = "Unknown",
                LegendaryItemType = (UniqueItemType)Item.SNOItem.ItemType
            };

            string PathType = Legendary.LegendaryItemType.ToString();

            if (Item.ItemQuality == Controller.Enums.ItemQuality.Legendary)
            {
                if (Item.SNOItem.SetItem)
                {
                    Color = TextColors.TryGet("Set");
                }

                if (UniqueItemsController.TryGet(Item.SNOItem.ActorName.ToLower()) != null)
                {
                    Legendary = UniqueItemsController.TryGet(Item.SNOItem.ActorName.ToLower());
                    PathType  = Legendary.LegendaryItemType.ToString();

                    if (Legendary.LegendaryItemType == UniqueItemType.PlanLegendary_Smith)
                    {
                        PathType = "PlanLegendary_Smith";
                    }
                }
            }

            else // Magic, Rare, White
            {
                Legendary.ItemName = ItemsTypesConversion.TryGet(((LegendaryItemsTypes)Item.SNOItem.ItemType).ToString());

                if (Legendary.LegendaryItemType.ToString().Contains("Generic"))
                {
                    PathType = Legendary.ItemName;
                }
            }

            Extensions.Execute.UIThread(() =>
            {
                Canvas xContainer = new Canvas {
                    Width = 370
                };
                Grid Container = new Grid {
                    Width = 370
                };

                Border Border = new Border {
                    Height = 64, BorderBrush = Transition.BorderBrush, BorderThickness = new Thickness(2), Opacity = 0.7
                };

                Grid NameContainerGrid = new Grid {
                    Height = 90, VerticalAlignment = VerticalAlignment.Center
                };

                StackPanel NameContainer = new StackPanel {
                    VerticalAlignment = VerticalAlignment.Center
                };
                StackPanel ItemContainer = new StackPanel {
                    Height = 90, Orientation = Orientation.Horizontal
                };

                Canvas Background = new Canvas {
                    Background = BackgroundGradient, Opacity = 1, Height = 59, Margin = new Thickness(1, 0, 0, 0)
                };

                StackPanel Image = new StackPanel {
                    Width = 85
                };
                StackPanel Name    = new StackPanel();
                TextBlock ItemName = new TextBlock {
                    FontFamily = Transition.FontFamily, VerticalAlignment = VerticalAlignment.Center, FontWeight = FontWeights.Normal,
                    Text       = Legendary.ItemName, Height = 25, FontSize = 18, Foreground = Color
                };

                StackPanel Ancient = new StackPanel {
                    Width = 4, Height = 60, Background = Brushes.Orange, Opacity = 0.5
                };
                string Path           = UniqueItemsController.GetBaseItemName(Item.SNOItem.ActorName.ToLower());
                string ItemNamePath   = string.IsNullOrWhiteSpace(Legendary.Override) ? Path : Path + "_" + Legendary.Override;
                string ItemNamePather = (Legendary.LegendaryItemType == UniqueItemType.PlanLegendary_Smith) ? "SmithPlan" : ItemNamePath;

                Image.Children.Add(new Image {
                    Source = Extensions.ItemImage(PathType + "/" + ItemNamePather), Width = 75, Height = 90
                });

                NameContainer.Children.Add(ItemName);

                if (Items.Account != null)
                {
                    TextBlock ItemNames = new TextBlock
                    {
                        FontFamily        = Transition.FontFamily,
                        VerticalAlignment = VerticalAlignment.Center,
                        FontWeight        = FontWeights.Normal,
                        Text       = Items.Account.Nickname,
                        Height     = 20,
                        FontSize   = 12.1,
                        Foreground = Items.Account.Foreground
                    };
                    NameContainer.Children.Add(ItemNames);
                }

                NameContainerGrid.Children.Add(NameContainer);
                Name.Children.Add(NameContainerGrid);

                if (Item.ShowAncient && Item.AncientItem)
                {
                    Border.BorderBrush = Color;
                    Ancient.Height     = 64;
                }

                ItemContainer.Children.Add(Image);
                ItemContainer.Children.Add(Name);

                Border.Child = Background;

                Container.Children.Add(Border);
                Container.Children.Add(ItemContainer);

                xContainer.Children.Add(Container);

                Elements.Children.Add(xContainer);

                xContainer.AnimateFade <Canvas>(0, 1, TimeSpan.FromSeconds(1));
                Active.Add(xContainer);
                Canvas.SetTop(xContainer, ID * 90);

                DeleteTimer(xContainer, Items.Transition, ID);
            });
        }
예제 #3
0
        public void Paint(FKTracker.LegendaryItems Item)
        {
            //  StackPanel Container = new StackPanel { Orientation = Orientation.Horizontal };
            //   StackPanel MainContent = new StackPanel { Width = 634, Height = 300, Background = Extensions.HexToBrush("#ffffff") };

            UniqueItem Legendary = new UniqueItem
            {
                ItemName = "Unknown"
            };

            string ImagePath = "";
            Brush  Color     = TextColors.TryGet(Item.SetItem ? "Set2" : "Legendary");
            string Diff      = Item.GameType == FKTracker.GameType.GreaterRift ? Item.Difficulty.ToString() : TranslateDifficulty(Item.Difficulty);

            if (UniqueItemsController.TryGet(Item.Name.ToLower()) != null)
            {
                Legendary = UniqueItemsController.TryGet(Item.Name.ToLower());

                string PathType = Legendary.LegendaryItemType.ToString();

                if (Legendary.LegendaryItemType == UniqueItemType.PlanLegendary_Smith)
                {
                    PathType = "PlanLegendary_Smith";
                }

                string Path           = UniqueItemsController.GetBaseItemName(Item.Name.ToLower());
                string ItemNamePath   = string.IsNullOrWhiteSpace(Legendary.Override) ? Path : Path + "_" + Legendary.Override;
                string ItemNamePather = (Legendary.LegendaryItemType == UniqueItemType.PlanLegendary_Smith) ? "SmithPlan" : ItemNamePath;

                ImagePath = PathType + "/" + ItemNamePather;
            }

            StackPanel Container = new StackPanel {
                Cursor = Cursors.Hand, Height = 60, HorizontalAlignment = HorizontalAlignment.Left, Orientation = Orientation.Horizontal, Width = 634, Background = Extensions.HexToBrush("#ffffff")
            };

            StackPanel ImageHolder = new StackPanel {
                Width = 60, Height = 60, Margin = new Thickness(1, 0, 0, 0), Background = Extensions.HexToBrush("#fbfbfb")
            };
            Grid Alignment = new Grid {
                VerticalAlignment = VerticalAlignment.Center, Height = 60
            };
            Image Image = new Image {
                Source = Extensions.ItemImage(ImagePath), Height = 40, VerticalAlignment = VerticalAlignment.Center
            };

            StackPanel TextContainer = new StackPanel {
                Margin = new Thickness(15, 0, 0, 0), Width = 200, VerticalAlignment = VerticalAlignment.Center, Orientation = Orientation.Horizontal
            };
            TextBlock Text = new TextBlock {
                Text = Legendary.ItemName, FontFamily = Extensions.GetFont("DINPro Regular"), FontSize = 15, Foreground = Color
            };

            StackPanel CContainer = new StackPanel {
                Orientation = Orientation.Horizontal
            };
            StackPanel AccountContainer = new StackPanel {
                Margin = new Thickness(0, 16, 0, 0), Width = 45
            };
            TextBlock ATextHeader = new TextBlock {
                Text = "Account", FontFamily = new FontFamily("Segoe UI"), Height = 15, FontSize = 10, FontWeight = FontWeights.Regular, TextAlignment = TextAlignment.Center, Foreground = Extensions.HexToBrush("#bfbfbf")
            };
            //TextBlock AText = new TextBlock { Text = Config.Get<FKAccounts>().GetAccount((int)Item.AccountID).Nickname, FontFamily = new FontFamily("Segoe UI"), FontSize = 10, FontWeight = FontWeights.Regular, TextAlignment = TextAlignment.Center, Foreground = Extensions.HexToBrush("#2a2627") };
            TextBlock AText = new TextBlock {
                Text = Item.ID.ToString(), FontFamily = new FontFamily("Segoe UI"), FontSize = 10, FontWeight = FontWeights.Regular, TextAlignment = TextAlignment.Center, Foreground = Extensions.HexToBrush("#2a2627")
            };

            StackPanel LevelContainer = new StackPanel {
                Margin = new Thickness(25, 16, 0, 0), Width = 70,
            };
            TextBlock LTextHeader = new TextBlock {
                Text = TranslateGameType(Item.GameType), FontFamily = new FontFamily("Segoe UI"), Height = 15, FontSize = 10, FontWeight = FontWeights.Regular, TextAlignment = TextAlignment.Center, Foreground = Extensions.HexToBrush("#bfbfbf")
            };
            TextBlock LText = new TextBlock {
                Text = Diff, FontFamily = new FontFamily("Segoe UI"), FontSize = 10, FontWeight = FontWeights.Regular, TextAlignment = TextAlignment.Center, Foreground = Extensions.HexToBrush("#2a2627")
            };

            StackPanel AncientContainer = new StackPanel {
                Margin = new Thickness(25, 16, 0, 0), Width = 45,
            };
            TextBlock AnTextHeader = new TextBlock {
                Text = "Ancient", FontFamily = new FontFamily("Segoe UI"), Height = 15, FontSize = 10, FontWeight = FontWeights.Regular, TextAlignment = TextAlignment.Center, Foreground = Extensions.HexToBrush("#bfbfbf")
            };
            TextBlock AnText = new TextBlock {
                Text = Item.AncientItem ? "Yes" : "No", FontFamily = new FontFamily("Segoe UI"), FontSize = 10, FontWeight = FontWeights.Regular, TextAlignment = TextAlignment.Center, Foreground = Extensions.HexToBrush("#2a2627")
            };

            StackPanel TimeContainer = new StackPanel {
                Margin = new Thickness(25, 4, 0, 0), Orientation = Orientation.Horizontal, Width = 100
            };
            Image TImage = new Image {
                Source = Extensions.FKImage("clock2"), Width = 15, Height = 15, Margin = new Thickness(0, 0, 10, 0)
            };
            TextBlock TText = new TextBlock {
                Text = GetTime(Item.Found), FontFamily = new FontFamily("Segoe UI"), VerticalAlignment = VerticalAlignment.Center, FontSize = 11, FontWeight = FontWeights.Regular, TextAlignment = TextAlignment.Center, Foreground = Extensions.HexToBrush("#ff6686")
            };

            Alignment.Children.Add(Image);
            ImageHolder.Children.Add(Alignment);
            Container.Children.Add(ImageHolder);

            TextContainer.Children.Add(Text);

            AccountContainer.Children.Add(ATextHeader);
            AccountContainer.Children.Add(AText);
            CContainer.Children.Add(AccountContainer);

            LevelContainer.Children.Add(LTextHeader);
            LevelContainer.Children.Add(LText);
            CContainer.Children.Add(LevelContainer);

            AncientContainer.Children.Add(AnTextHeader);
            AncientContainer.Children.Add(AnText);
            CContainer.Children.Add(AncientContainer);

            TimeContainer.Children.Add(TImage);
            TimeContainer.Children.Add(TText);
            CContainer.Children.Add(TimeContainer);

            Container.Children.Add(TextContainer);
            Container.Children.Add(CContainer);

            Container.ToolTip = new TextBlock {
                Text = "Double click to show more information"
            };

            Container.MouseEnter += (s, e) =>
            {
                Container.Cursor       = Cursors.Hand;
                Container.Background   = Extensions.HexToBrush("#efefef");
                ImageHolder.Background = Extensions.HexToBrush("#e2e2e2");
            };
            Container.MouseLeave += (s, e) =>
            {
                Container.Background   = Brushes.Transparent;
                ImageHolder.Background = Extensions.HexToBrush("#fbfbfb");
            };

            Entries.Children.Add(Container);

            /* < StackPanel Margin = "25,4,0,0" Orientation = "Horizontal" >
             *             < Image Source = "./../../Images/FK/clock2.png" Width = "15" Height = "15" Margin = "0,0,10,0" />
             *                < TextBlock Foreground = "#ff6686" FontFamily = "Segoe UI" FontSize = "11" VerticalAlignment = "Center" FontWeight = "Regular" TextAlignment = "Center" > 5 minutes ago</ TextBlock >
             *                 </ StackPanel >
             *
             *                 < StackPanel Margin = "20,4,0,0" Orientation = "Horizontal" >
             *                       < Border Width = "20" Height = "20" BorderBrush = "#dedede" BorderThickness = "1" CornerRadius = "3" >
             *                               < TextBlock Foreground = "#2a2627" FontWeight = "Bold" FontFamily = "DinPro" FontSize = "10" VerticalAlignment = "Center" TextAlignment = "Center" > X </ TextBlock >
             *                                </ Border >*/
        }