Skip to content

Commit

Permalink
Release 0.9.9.14 (#570)
Browse files Browse the repository at this point in the history
* Team build support (#565)

* Setup support for team builds
Fix parser to load team builds
Fix bug in attribute loading
Adjust encoder to order and skip attributes for consistency

* Small buildtemplate binding fixes
Setup TeamBuildTemplateView

* Setup button to create team build

* Fix launch button (#566)

Closes #563

* Team build improvements (#568)

Closes #564

* Closes #562 (#569)

Closes #561

* Increment version
  • Loading branch information
AlexMacocian authored Feb 4, 2024
1 parent 09fdbb6 commit f4bc58b
Show file tree
Hide file tree
Showing 42 changed files with 1,734 additions and 269 deletions.
497 changes: 471 additions & 26 deletions Daybreak.Tests/Services/BuildTemplateManagerTests.cs

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Daybreak/Configuration/ProjectConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public override void RegisterViews(IViewProducer viewProducer)
viewProducer.RegisterView<UpdateView>();
viewProducer.RegisterView<AccountsView>();
viewProducer.RegisterView<ExecutablesView>();
viewProducer.RegisterView<BuildTemplateView>();
viewProducer.RegisterView<SingleBuildTemplateView>();
viewProducer.RegisterView<BuildsListView>();
viewProducer.RegisterView<RequestElevationView>();
viewProducer.RegisterView<RequestDelevationView>();
Expand Down Expand Up @@ -330,6 +330,7 @@ public override void RegisterViews(IViewProducer viewProducer)
viewProducer.RegisterView<DirectSongOnboardingEntryView>();
viewProducer.RegisterView<DirectSongSwitchView>();
viewProducer.RegisterView<SettingsSynchronizationView>();
viewProducer.RegisterView<TeamBuildTemplateView>();
}

public override void RegisterStartupActions(IStartupActionProducer startupActionProducer)
Expand Down
15 changes: 8 additions & 7 deletions Daybreak/Controls/Buttons/AddButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Daybreak.Controls.Buttons"
xmlns:glyphs="clr-namespace:Daybreak.Controls.Glyphs"
mc:Ignorable="d"
x:Name="_this"
Cursor="Hand"
Expand All @@ -13,13 +14,13 @@
Highlight="{StaticResource MahApps.Brushes.Accent}"
Clicked="HighlightButton_Clicked">
<local:CircularButton.Content>
<Viewbox Stretch="Fill" Width="60" Height="60">
<Grid Width="25" Height="25">
<Path Data="m13,20a1,1 0 0 1 -1,-1l0,-12a1,1 0 0 1 2,0l0,12a1,1 0 0 1 -1,1z"
Fill="{StaticResource MahApps.Brushes.ThemeForeground}"></Path>
<Path Data="m19,14l-12,0a1,1 0 0 1 0,-2l12,0a1,1 0 0 1 0,2z"
Fill="{StaticResource MahApps.Brushes.ThemeForeground}"></Path>
</Grid>
<Viewbox>
<glyphs:PlusGlyph Foreground="{StaticResource MahApps.Brushes.ThemeForeground}"
Height="50"
Width="50"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Margin="0, 0, 14, 14"/>
</Viewbox>
</local:CircularButton.Content>
</local:CircularButton>
Expand Down
3 changes: 2 additions & 1 deletion Daybreak/Controls/ChromiumBrowserWrapper.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Daybreak.Configuration.Options;
using Daybreak.Models;
using Daybreak.Models.Browser;
using Daybreak.Models.Builds;
using Daybreak.Models.Guildwars;
using Daybreak.Services.Browser;
using Daybreak.Services.BuildTemplates;
Expand Down Expand Up @@ -486,7 +487,7 @@ private void DownloadOperation_StateChanged(object? sender, object? e)

private void LoadBuildTemplateButton_Click(object sender, EventArgs e)
{
var build = this.ContextMenu.DataContext.As<Build>();
var build = this.ContextMenu.DataContext.As<IBuildEntry>();
this.ContextMenu.IsOpen = false;
if (build is null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ private void EditBuild_MouseLeftButtonDown(object _, System.Windows.Input.MouseB

if (mainPlayer.CurrentBuild is Build build)
{
var buildEntry = this.buildTemplateManager.CreateBuild();
buildEntry.Build = build;
this.viewManager.ShowView<BuildTemplateView>(buildEntry);
var buildEntry = this.buildTemplateManager.CreateSingleBuild();
buildEntry.Primary = build.Primary;
buildEntry.Secondary = build.Secondary;
buildEntry.Attributes = build.Attributes;
buildEntry.Skills = build.Skills;
this.viewManager.ShowView<SingleBuildTemplateView>(buildEntry);
}
}
}
16 changes: 16 additions & 0 deletions Daybreak/Controls/Glyphs/PersonGlyph.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<UserControl x:Class="Daybreak.Controls.Glyphs.PersonGlyph"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Daybreak.Controls.Glyphs"
mc:Ignorable="d"
x:Name="_this"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Viewbox>
<Path Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}"
Data="m12.5,11c3.03757,0 5.5,-2.46243 5.5,-5.5c0,-3.03757 -2.46243,-5.5 -5.5,-5.5c-3.03757,0 -5.5,2.46243 -5.5,5.5c0,3.03757 2.46243,5.5 5.5,5.5l0,0zm12.5,12l0,0l0,0l-25,0c0.74635,-6.19634 6.05817,-11 12.5,-11c6.44183,0 11.75365,4.80366 12.5,11l0,0z"/>
</Viewbox>
</Grid>
</UserControl>
13 changes: 13 additions & 0 deletions Daybreak/Controls/Glyphs/PersonGlyph.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Windows.Controls;

namespace Daybreak.Controls.Glyphs;
/// <summary>
/// Interaction logic for PersonGlyph.xaml
/// </summary>
public partial class PersonGlyph : UserControl
{
public PersonGlyph()
{
this.InitializeComponent();
}
}
18 changes: 18 additions & 0 deletions Daybreak/Controls/Glyphs/PlusGlyph.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<UserControl x:Class="Daybreak.Controls.Glyphs.PlusGlyph"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Daybreak.Controls.Glyphs"
x:Name="_this"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Viewbox Stretch="Fill">
<Grid>
<Path Data="m13,20a1,1 0 0 1 -1,-1l0,-12a1,1 0 0 1 2,0l0,12a1,1 0 0 1 -1,1z"
Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}"></Path>
<Path Data="m19,14l-12,0a1,1 0 0 1 0,-2l12,0a1,1 0 0 1 0,2z"
Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}"></Path>
</Grid>
</Viewbox>
</UserControl>
13 changes: 13 additions & 0 deletions Daybreak/Controls/Glyphs/PlusGlyph.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Windows.Controls;

namespace Daybreak.Controls.Glyphs;
/// <summary>
/// Interaction logic for PlusGlyph.xaml
/// </summary>
public partial class PlusGlyph : UserControl
{
public PlusGlyph()
{
this.InitializeComponent();
}
}
40 changes: 40 additions & 0 deletions Daybreak/Controls/Glyphs/TeamGlyph.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<UserControl x:Class="Daybreak.Controls.Glyphs.TeamGlyph"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Daybreak.Controls.Glyphs"
x:Name="_this"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Viewbox>
<Grid>
<Ellipse Margin="97,25,0,0"
Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Width="13"
Height="13"/>
<Ellipse Margin="20,25,0,0"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}"
Width="13"
Height="13"/>
<Ellipse Margin="0,18,0,0"
VerticalAlignment="Top"
HorizontalAlignment="Center"
Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}"
Width="18"
Height="18"/>
<Path Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}"
Data="m34.6,51.17l0,0q-0.43,0.61 -0.84,1.24l0,0a35.82,35.82 0 0 0 -5.76,19.53l72,0a35.82,35.82 0 0 0 -5.71,-19.44l0,0q-0.41,-0.63 -0.84,-1.24l0,0a36,36 0 0 0 -58.8,0l-0.05,-0.09z"/>
<Path Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}"
Data="m0,63.94l20.74,0a44,44 0 0 1 13.72,-24.58a26,26 0 0 0 -34.46,24.58z"/>
<Path Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}"
Data="m102,37.94a26,26 0 0 0 -8.46,1.42a44,44 0 0 1 13.72,24.58l20.74,0a26,26 0 0 0 -26,-26z"/>
</Grid>
</Viewbox>
</Grid>
</UserControl>
13 changes: 13 additions & 0 deletions Daybreak/Controls/Glyphs/TeamGlyph.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Windows.Controls;

namespace Daybreak.Controls.Glyphs;
/// <summary>
/// Interaction logic for TeamGlyph.xaml
/// </summary>
public partial class TeamGlyph : UserControl
{
public TeamGlyph()
{
this.InitializeComponent();
}
}
14 changes: 8 additions & 6 deletions Daybreak/Controls/Templates/AttributeTemplate.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Daybreak.Models.Builds;
using Daybreak.Services.BuildTemplates;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Core.Extensions;
using System.Extensions;
Expand Down Expand Up @@ -29,7 +30,14 @@ public partial class AttributeTemplate : UserControl
private int attributePoints;

public AttributeTemplate()
: this(Launch.Launcher.Instance.ApplicationServiceProvider.GetRequiredService<IAttributePointCalculator>())
{
}

public AttributeTemplate(
IAttributePointCalculator attributePointCalculator)
{
this.attributePointCalculator = attributePointCalculator.ThrowIfNull();
this.InitializeComponent();
this.DataContextChanged += this.AttributeTemplate_DataContextChanged;
}
Expand All @@ -53,12 +61,6 @@ protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
}
}

public void InitializeAttributeTemplate(
IAttributePointCalculator attributePointCalculator)
{
this.attributePointCalculator = attributePointCalculator.ThrowIfNull();
}

private void AttributeTemplate_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (e.NewValue is AttributeEntry attributeEntry)
Expand Down
8 changes: 4 additions & 4 deletions Daybreak/Controls/Templates/BuildEntryTemplate.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace Daybreak.Controls;
/// </summary>
public partial class BuildEntryTemplate : UserControl
{
public event EventHandler<BuildEntry>? RemoveClicked;
public event EventHandler<BuildEntry>? EntryClicked;
public event EventHandler<IBuildEntry>? RemoveClicked;
public event EventHandler<IBuildEntry>? EntryClicked;

public BuildEntryTemplate()
{
Expand All @@ -19,15 +19,15 @@ public BuildEntryTemplate()

private void BinButton_Clicked(object _, EventArgs __)
{
if (this.DataContext is BuildEntry buildEntry)
if (this.DataContext is IBuildEntry buildEntry)
{
this.RemoveClicked?.Invoke(this, buildEntry);
}
}

private void HighlightButton_Clicked(object _, EventArgs __)
{
if (this.DataContext is BuildEntry buildEntry)
if (this.DataContext is IBuildEntry buildEntry)
{
this.EntryClicked?.Invoke(this, buildEntry);
}
Expand Down
38 changes: 33 additions & 5 deletions Daybreak/Controls/Templates/BuildTemplate.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
</Grid.RowDefinitions>
Expand Down Expand Up @@ -64,6 +65,34 @@
ToolTip="Open secondary profession info"/>
</Grid>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<buttons:HelpButton Grid.Column="0"
ToolTip="Open attribute points info"
Clicked="HelpButtonAttributePoints_Clicked"
Width="20"
Height="20"
Margin="3, 5, 3, 5"/>
<TextBlock Grid.Column="1"
Text="Remaining Attribute Points:"
Foreground="{StaticResource MahApps.Brushes.ThemeForeground}"
FontSize="16"
VerticalAlignment="Center"/>
<TextBox Grid.Column="2"
Width="50"
Margin="3, 0, 0, 5"
Foreground="{StaticResource MahApps.Brushes.ThemeForeground}"
BorderBrush="{StaticResource MahApps.Brushes.ThemeForeground}"
BorderThickness="1"
Text="{Binding ElementName=_this, Path=AttributePoints, Mode=OneWay}"
FontSize="16"
Background="Transparent"
IsReadOnly="True"/>
</Grid>
<Grid Grid.Row="4">
<ListView Background="Transparent" ItemsSource="{Binding ElementName=_this, Path=BuildEntry.Attributes, Mode=OneWay}"
HorizontalContentAlignment="Stretch" BorderThickness="0">
<ListView.ItemContainerStyle>
Expand All @@ -75,13 +104,12 @@
<DataTemplate>
<templates:AttributeTemplate HelpClicked="AttributeTemplate_HelpClicked"
AttributeChanged="AttributeTemplate_AttributeChanged"
Loaded="AttributeTemplate_Loaded"
AttributePoints="{Binding Path=AttributePoints, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
<Grid Grid.Row="4">
<Grid Grid.Row="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
Expand Down Expand Up @@ -153,7 +181,7 @@
<TextBlock Grid.Column="7" Grid.Row="1" TextWrapping="Wrap" FontSize="16"
Foreground="{StaticResource MahApps.Brushes.ThemeForeground}" Text="{Binding ElementName=_this, Path=BuildEntry.EigthSkill.Name, Mode=OneWay}"></TextBlock>
</Grid>
<Grid Grid.Column="1" Grid.RowSpan="6"
<Grid Grid.Column="1" Grid.RowSpan="7"
x:Name="SideHolder">
<local:ChromiumBrowserWrapper x:Name="SkillBrowser"
MaxWidth="0"
Expand All @@ -170,7 +198,7 @@
PreventDispose="True"
MaximizeClicked="SkillBrowser_MaximizeClicked" />
</Grid>
<Grid Grid.Column="1" Grid.RowSpan="6">
<Grid Grid.Column="1" Grid.RowSpan="7">
<Grid x:Name="SkillListContainer">
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
Expand Down Expand Up @@ -231,7 +259,7 @@
</ItemsControl>
</Grid>
</Grid>
<Grid Grid.RowSpan="6"
<Grid Grid.RowSpan="7"
Grid.ColumnSpan="2"
Visibility="Hidden"
x:Name="FullScreenHolder">
Expand Down
Loading

0 comments on commit f4bc58b

Please sign in to comment.