Compare commits

...
2 Commits
Author SHA1 Message Date
Alexandru Macocian 16030063ed Fix skill icon not unloading.
Moved all help icons on same side.
2021-04-23 19:52:09 +02:00
Alexandru Macocian 458696ad8f Fixed a bug where skill templates would try to load the image for No Skill.
Fixed a bug where build template manager would delete saved template.
2021-04-23 17:28:12 +02:00
4 changed files with 23 additions and 17 deletions
@@ -25,11 +25,11 @@
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="Primary Profession: " FontSize="16" Foreground="White"></TextBlock>
<ListView FontSize="16" Foreground="White" Grid.Column="1" BorderThickness="0"
<TextBlock Text="Primary Profession: " FontSize="16" Foreground="White" Grid.Column="1"></TextBlock>
<ListView FontSize="16" Foreground="White" Grid.Column="2" BorderThickness="0"
Background="Transparent" ItemsSource="{Binding ElementName=_this, Path=Professions, Mode=OneWay}"
SelectedItem="{Binding ElementName=_this, Path=PrimaryProfession, Mode=TwoWay}" Height="30"
SelectionMode="Single" ScrollViewer.VerticalScrollBarVisibility="Disabled"
@@ -43,17 +43,17 @@
<behaviors:ScrollIntoView></behaviors:ScrollIntoView>
</interactivity:Interaction.Behaviors>
</ListView>
<local:HelpButton Grid.Column="2" Foreground="White" Width="20" Height="20" Margin="3"
<local:HelpButton Grid.Column="0" Foreground="White" Width="20" Height="20" Margin="3"
Clicked="HelpButtonPrimary_Clicked" Cursor="Hand"></local:HelpButton>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="Secondary Profession: " FontSize="16" Foreground="White"></TextBlock>
<ListView FontSize="16" Foreground="White" Grid.Column="1" BorderThickness="0"
<TextBlock Text="Secondary Profession: " FontSize="16" Foreground="White" Grid.Column="1"></TextBlock>
<ListView FontSize="16" Foreground="White" Grid.Column="2" BorderThickness="0"
Background="Transparent" ItemsSource="{Binding ElementName=_this, Path=Professions, Mode=OneWay}"
SelectedItem="{Binding ElementName=_this, Path=SecondaryProfession, Mode=TwoWay}" Height="30"
SelectionMode="Single" ScrollViewer.VerticalScrollBarVisibility="Disabled"
@@ -67,7 +67,7 @@
<behaviors:ScrollIntoView></behaviors:ScrollIntoView>
</interactivity:Interaction.Behaviors>
</ListView>
<local:HelpButton Grid.Column="2" Foreground="White" Width="20" Height="20" Margin="3"
<local:HelpButton Grid.Column="0" Foreground="White" Width="20" Height="20" Margin="3"
Clicked="HelpButtonSecondary_Clicked" Cursor="Hand"></local:HelpButton>
</Grid>
<Grid Grid.Row="3">
@@ -48,15 +48,22 @@ namespace Daybreak.Controls
private void SkillTemplate_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (e.NewValue is Skill)
if (e.NewValue is Skill skill)
{
Task.Run(() => GetImageStream(e.NewValue.As<Skill>())).ContinueWith((previousTask) =>
if (skill != Skill.NoSkill)
{
this.Dispatcher.Invoke(() =>
Task.Run(() => GetImageStream(skill)).ContinueWith((previousTask) =>
{
this.ImageSource = GetImageSource(previousTask.Result);
this.Dispatcher.Invoke(() =>
{
this.ImageSource = GetImageSource(previousTask.Result);
});
});
});
}
else if (this.ImageSource is not null)
{
this.ImageSource = null;
}
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<LangVersion>preview</LangVersion>
<ApplicationIcon>Daybreak.ico</ApplicationIcon>
<Version>0.7.5</Version>
<Version>0.7.7</Version>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
@@ -68,13 +68,12 @@ namespace Daybreak.Services.BuildTemplates
public void SaveBuild(BuildEntry buildEntry)
{
var encodedBuild = this.EncodeTemplate(buildEntry.Build);
File.WriteAllText($"{BuildsPath}\\{buildEntry.Name}.txt", encodedBuild);
if (string.IsNullOrWhiteSpace(buildEntry.PreviousName))
{
return;
File.Delete($"{BuildsPath}\\{buildEntry.PreviousName}.txt");
}
File.Delete($"{BuildsPath}\\{buildEntry.PreviousName}.txt");
File.WriteAllText($"{BuildsPath}\\{buildEntry.Name}.txt", encodedBuild);
}
public void RemoveBuild(BuildEntry buildEntry)