Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
Merge branch 'rel-v1.12' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
CSharperMantle committed Jul 18, 2021
2 parents a2ad2b8 + 4af58b7 commit 8c5e479
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Periotris.Net/Periotris.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/CSharperMantle/Periotris.Net</PackageProjectUrl>
<RepositoryUrl>https://github.com/CSharperMantle/Periotris.Net.git</RepositoryUrl>
<AssemblyVersion>1.11.0.0</AssemblyVersion>
<FileVersion>1.11.0.0</FileVersion>
<AssemblyVersion>1.12.0.0</AssemblyVersion>
<FileVersion>1.12.0.0</FileVersion>
<Description>Periotris.Net is a .NET 5 porting and modernized version of CSharperMantle's Periotris game belonging to CmTetris product family.</Description>
<Copyright>Copyright (c) 2020-present Rong "Mantle" Bao (aka CSharperMantle)</Copyright>
<NeutralLanguage></NeutralLanguage>
<PackageTags>game;tetris;tetrimino;wpf;chemistry;periodic-table;tetromino-tiling;tetromino-solver;puzzle</PackageTags>
<SignAssembly>false</SignAssembly>
<ApplicationIcon>Icon.ico</ApplicationIcon>
<Version>1.11.0</Version>
<Version>1.12.0</Version>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<Nullable>warnings</Nullable>
<AnalysisLevel>5.0</AnalysisLevel>
Expand Down
18 changes: 15 additions & 3 deletions Periotris.Net/View/GamePage.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Page x:Class="Periotris.Net.View.GamePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Expand Down Expand Up @@ -39,17 +40,28 @@
<RowDefinition Height="80" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid Grid.Row="0"
Visibility="{Binding Path=GameWon, Converter={StaticResource VisibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button x:Name="WonBackButton" Grid.Column="1"
HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30 0 10 0"
Style="{DynamicResource MahApps.Styles.Button.Circle}"
ToolTip="{x:Static p:StartPageResources.AboutButtonToolTip}"
Click="BackButton_Click">
<iconPacks:PackIconModern Width="25"
Height="25"
Margin="5 5 5 5"
VerticalAlignment="Center" HorizontalAlignment="Center"
Kind="ArrowLeft" />
</Button>
<TextBlock Grid.Column="1"
Text="{x:Static p:GamePageResources.TableTitleTextBlockText}"
HorizontalAlignment="Center" Margin="35, 15, 0, 0"
Foreground="White"
FontFamily="Microsoft YaHei UI, Arial" FontSize="34" FontWeight="Regular"
Visibility="{Binding Path=GameWon, Converter={StaticResource VisibilityConverter}}" />
FontFamily="Microsoft YaHei UI, Arial" FontSize="34" FontWeight="Regular" />
</Grid>

<StackPanel Grid.Row="0"
Expand Down
6 changes: 4 additions & 2 deletions Periotris.Net/View/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
<mah:FlyoutsControl DataContext="{StaticResource ViewModel}">
<mah:Flyout x:Name="AboutFlyout" Header="{x:Static p:MainWindowResources.AboutFlyoutHeader}"
Position="Right" Width="300"
IsOpen="{Binding Path=AboutFlyoutOpened, Mode=TwoWay}">
IsOpen="{Binding Path=AboutFlyoutOpened, Mode=TwoWay}"
IsModal="True">
<Border Padding="10 10 10 10">
<TextBlock Text="{x:Static p:MainWindowResources.AboutFlyoutText}"
Foreground="White"
Expand All @@ -53,7 +54,8 @@
</mah:Flyout>
<mah:Flyout x:Name="SettingsFlyout" Header="{x:Static p:MainWindowResources.SettingsFlyoutHeader}"
Position="Right" Width="300" Padding="10 10 10 10"
IsOpen="{Binding Path=SettingsFlyoutOpened, Mode=TwoWay}">
IsOpen="{Binding Path=SettingsFlyoutOpened, Mode=TwoWay}"
IsModal="True">
<mah:Flyout.Resources>
</mah:Flyout.Resources>
<Border Padding="10 10 10 10">
Expand Down
10 changes: 5 additions & 5 deletions Periotris.Net/ViewModel/PeriotrisViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ public bool OnKeyDown(Key key)
/// </summary>
public void StartGame()
{
RecreateAssistGrids();
foreach (FrameworkElement block in _blocksByPosition.Values)
{
_sprites.Remove(block);
}
// Clear remaining sprites.
_sprites.Clear();
// Clear blocks.
_blocksByPosition.Clear();

RecreateAssistGrids();
_model.StartGame();
OnPropertyChanged(nameof(GameOver));
OnPropertyChanged(nameof(GameWon));
Expand Down

0 comments on commit 8c5e479

Please sign in to comment.