Skip to content

Commit

Permalink
Fixed itemdisplay bug causing implicit mods not to display
Browse files Browse the repository at this point in the history
  • Loading branch information
Stickymaddness committed Sep 13, 2014
1 parent 89becb2 commit 22f48cc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 29 deletions.
46 changes: 23 additions & 23 deletions Procurement/Controls/ItemHover.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,29 +176,6 @@
</ItemsControl.ItemTemplate>
</ItemsControl>

<ItemsControl ItemsSource="{Binding CraftedMods}"
Padding="10 0 10 5"
Visibility="{Binding HasCraftedMods,
Converter={StaticResource bc},
ConverterParameter=CollapseWhenFalse}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock FontFamily="../Resources/#Fontin SmallCaps"
Foreground="#b4b4ff"
Text="{Binding}"
TextAlignment="Center"
TextWrapping="Wrap" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

<Border Margin="0 0 0 5"
BorderBrush="{StaticResource SeperatorBrush}"
BorderThickness="1"
Expand Down Expand Up @@ -251,6 +228,29 @@
Converter={StaticResource VisibilityConverter},
ConverterParameter=CollapseWhenFalse}" />

<ItemsControl ItemsSource="{Binding CraftedMods}"
Padding="10 0 10 5"
Visibility="{Binding HasCraftedMods,
Converter={StaticResource bc},
ConverterParameter=CollapseWhenFalse}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock FontFamily="../Resources/#Fontin SmallCaps"
Foreground="#b4b4ff"
Text="{Binding}"
TextAlignment="Center"
TextWrapping="Wrap" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

<TextBlock Width="{Binding Path=ActualWidth,
ElementName=ItemHeader,
Mode=OneWay}"
Expand Down
19 changes: 13 additions & 6 deletions Procurement/ViewModel/ItemHoverViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ public class ItemHoverViewModel
public bool IsCorrupted { get; private set; }
public List<string> Microtransactions { get; private set; }
public bool HasMicrotransactions { get; private set; }
public List<string> CraftedMods { get; private set; }

public List<string> CraftedMods { get; set; }

public bool HasCraftedMods { get; private set; }


public ItemHoverViewModel(Item item)
{
this.Item = item;
Expand All @@ -38,13 +41,9 @@ public ItemHoverViewModel(Item item)
this.Properties = item.Properties;

this.Requirements = new List<Requirement>();
this.HasRequirements = Requirements != null && Requirements.Count > 0;

this.ExplicitMods = item.Explicitmods;
this.HasExplicitMods = ExplicitMods != null && ExplicitMods.Count > 0;

this.ImplicitMods = new List<string>();
this.HasImplicitMods = ImplicitMods != null && ImplicitMods.Count > 0;

this.DescriptionText = item.DescrText;

Expand All @@ -54,10 +53,18 @@ public ItemHoverViewModel(Item item)
this.HasMicrotransactions = item.Microtransactions.Count > 0;

this.CraftedMods = item.CraftedMods;
this.HasCraftedMods = CraftedMods != null && CraftedMods.Count > 0;

SecondaryDescriptionText = item.SecDescrText;
setTypeSpecificProperties(item);

this.HasExplicitMods = ExplicitMods != null && ExplicitMods.Count > 0;
this.HasImplicitMods = ImplicitMods != null && ImplicitMods.Count > 0;
this.HasCraftedMods = CraftedMods != null && CraftedMods.Count > 0;
this.HasRequirements = Requirements != null && Requirements.Count > 0;
}

private void setTypeSpecificProperties(Item item)
{
var gear = item as Gear;

if (gear != null)
Expand Down

0 comments on commit 22f48cc

Please sign in to comment.