Esempio n. 1
0
        protected override void ClientTooltipCreateControlsInternal(IItem item, List <UIElement> controls)
        {
            base.ClientTooltipCreateControlsInternal(item, controls);

            if (this.Effects.Count > 0)
            {
                controls.Add(ItemTooltipInfoEffectActionsControl.Create(this.Effects));
            }

            // display a "Never consumed" message if this food is available in Completionist menu
            if (this.IsAvailableInCompletionist)
            {
                var isUnlockedInCompletionist = false;
                foreach (var entry in ClientCurrentCharacterHelper.PrivateState.CompletionistData.ListFood)
                {
                    if (ReferenceEquals(entry.Prototype, this))
                    {
                        isUnlockedInCompletionist = true;
                        break;
                    }
                }

                if (!isUnlockedInCompletionist)
                {
                    controls.Add(
                        new TextBlock()
                    {
                        Text         = "(" + ItemHints.NeverConsumed + ")",
                        TextWrapping = TextWrapping.Wrap,
                        FontWeight   = FontWeights.Bold,
                        Foreground   = Api.Client.UI.GetApplicationResource <Brush>("BrushColor4")
                    });
                }
            }
        }
Esempio n. 2
0
        protected override void ClientTooltipCreateControlsInternal(IItem item, List <UIElement> controls)
        {
            base.ClientTooltipCreateControlsInternal(item, controls);

            if (this.Effects.Count > 0)
            {
                controls.Add(ItemTooltipInfoEffectActionsControl.Create(this.Effects));
            }
        }
Esempio n. 3
0
        protected override void ClientTooltipCreateControlsInternal(IItem item, List <UIElement> controls)
        {
            base.ClientTooltipCreateControlsInternal(item, controls);

            if (this.CooldownDuration > 0)
            {
                var control = ItemTooltipInfoEntryControl.Create(
                    Api.GetProtoEntity <StatusEffectMedicalCooldown>().Name,
                    ClientTimeFormatHelper.FormatTimeDuration(this.CooldownDuration));
                ((FrameworkElement)control).Margin = new Thickness(0, 7, 0, 7);
                controls.Add(control);
            }

            if (this.Effects.Count > 0)
            {
                controls.Add(ItemTooltipInfoEffectActionsControl.Create(this.Effects));
            }
        }
Esempio n. 4
0
        protected override void ClientTooltipCreateControlsInternal(IItem item, List <UIElement> controls)
        {
            base.ClientTooltipCreateControlsInternal(item, controls);

            if (this.CooldownDuration > 0)
            {
                var stackPanel = new StackPanel();
                stackPanel.Orientation = Orientation.Horizontal;

                var statusEffectMedicalCooldown = Api.GetProtoEntity <StatusEffectMedicalCooldown>();
                var icon = new Rectangle()
                {
                    Fill = Api.Client.UI.GetTextureBrush(
                        ((IProtoStatusEffect)statusEffectMedicalCooldown).Icon),
                    Width             = 26,
                    Height            = 26,
                    UseLayoutRounding = true
                };

                var controlInfoEntry = ItemTooltipInfoEntryControl.Create(
                    statusEffectMedicalCooldown.Name,
                    ClientTimeFormatHelper.FormatTimeDuration(
                        Math.Min(this.CooldownDuration, StatusEffectMedicalCooldown.MaxDuration)));
                controlInfoEntry.Margin            = new Thickness(4, 0, 0, -5);
                controlInfoEntry.VerticalAlignment = VerticalAlignment.Center;
                controlInfoEntry.Foreground
                      = controlInfoEntry.ValueBrush
                      = Api.Client.UI.GetApplicationResource <Brush>("BrushColorAltLabelForeground");

                stackPanel.Children.Add(icon);
                stackPanel.Children.Add(controlInfoEntry);
                stackPanel.Margin = new Thickness(0, 7, 0, 7);
                controls.Add(stackPanel);
            }

            if (this.Effects.Count > 0)
            {
                controls.Add(ItemTooltipInfoEffectActionsControl.Create(this.Effects));
            }
        }