Skip to content

Commit

Permalink
Improved manual and hid scrollbars
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSery committed Mar 30, 2018
1 parent 100eeea commit a25f8ab
Show file tree
Hide file tree
Showing 72 changed files with 654 additions and 1,005 deletions.
22 changes: 11 additions & 11 deletions BattleChess3.Api/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Setter Property="Background">
<Setter.Value>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.DefaultObject, UpdateSourceTrigger=PropertyChanged}" />
ImageSource="{Binding Path=ApplicationStyle.DefaultObject}" />
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black" />
Expand All @@ -21,7 +21,7 @@
<Setter Property="Background">
<Setter.Value>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.DefaultObject, UpdateSourceTrigger=PropertyChanged}" />
ImageSource="{Binding Path=ApplicationStyle.DefaultObject}" />
</Setter.Value>
</Setter>
<Setter Property="FontWeight" Value="Heavy" />
Expand All @@ -38,7 +38,7 @@
<Setter Property="Background">
<Setter.Value>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.DefaultButton, UpdateSourceTrigger=PropertyChanged}" />
ImageSource="{Binding Path=ApplicationStyle.DefaultButton}" />
</Setter.Value>
</Setter>
<Setter Property="Template">
Expand All @@ -56,7 +56,7 @@
<Setter Property="Background">
<Setter.Value>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.DefaultButtonMouseOn, Source={x:Static game:Session.SelectedStyle}, UpdateSourceTrigger=PropertyChanged}" />
ImageSource="{Binding Path=ApplicationStyle.DefaultButtonMouseOn, Source={x:Static game:Session.SelectedStyle}}" />
</Setter.Value>
</Setter>
</Trigger>
Expand All @@ -68,7 +68,7 @@
<Setter Property="Background">
<Setter.Value>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.ChessTile, UpdateSourceTrigger=PropertyChanged}" />
ImageSource="{Binding Path=ApplicationStyle.ChessTile}" />
</Setter.Value>
</Setter>
<Setter Property="Template">
Expand All @@ -85,7 +85,7 @@
<Setter Property="Background">
<Setter.Value>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.SelectedChessTile, Source={x:Static game:Session.SelectedStyle}, UpdateSourceTrigger=PropertyChanged}" />
ImageSource="{Binding Path=ApplicationStyle.SelectedChessTile, Source={x:Static game:Session.SelectedStyle}}" />
</Setter.Value>
</Setter>
</Trigger>
Expand All @@ -101,7 +101,7 @@
<Setter Property="Background">
<Setter.Value>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.TabItem, UpdateSourceTrigger=PropertyChanged}" />
ImageSource="{Binding Path=ApplicationStyle.TabItem}" />
</Setter.Value>
</Setter>
<Setter Property="Template">
Expand All @@ -121,7 +121,7 @@
<Setter Property="Background">
<Setter.Value>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.TabItem, UpdateSourceTrigger=PropertyChanged}" />
ImageSource="{Binding Path=ApplicationStyle.TabItem}" />
</Setter.Value>
</Setter>
</Trigger>
Expand All @@ -130,7 +130,7 @@
<Setter Property="Background">
<Setter.Value>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.TabItemMouseOn, UpdateSourceTrigger=PropertyChanged}" />
ImageSource="{Binding Path=ApplicationStyle.TabItemMouseOn}" />
</Setter.Value>
</Setter>
</Trigger>
Expand All @@ -139,7 +139,7 @@
<Setter Property="Background">
<Setter.Value>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.TabItemMouseOn, UpdateSourceTrigger=PropertyChanged}" />
ImageSource="{Binding Path=ApplicationStyle.TabItemMouseOn}" />
</Setter.Value>
</Setter>
</Trigger>
Expand All @@ -148,7 +148,7 @@
<Setter Property="Background">
<Setter.Value>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.TabItemDisabled, UpdateSourceTrigger=PropertyChanged}" />
ImageSource="{Binding Path=ApplicationStyle.TabItemDisabled}" />
</Setter.Value>
</Setter>
</Trigger>
Expand Down
8 changes: 1 addition & 7 deletions BattleChess3.Api/BattleChess3.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,12 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\BattleChess3.Model\BattleChess3.Model.csproj">
<Project>{4663da29-aa05-4134-800d-1974be8db559}</Project>
<Name>BattleChess3.Model</Name>
</ProjectReference>
<ProjectReference Include="..\BattleChess3.Shared\BattleChess3.Shared.csproj">
<Project>{4f503f20-176f-4c63-9604-6ed9d0c46652}</Project>
<Name>BattleChess3.Shared</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="WMPLib\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
5 changes: 3 additions & 2 deletions BattleChess3.Api/Controller/MainWindowController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using BattleChess3.Api.Game;
using BattleChess3.Api.ViewModel;
using BattleChess3.Shared.Properties;
using BattleChess3.Model.Properties;
using System;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -76,9 +76,10 @@ private void OnQuitApplicationClick(object sender, RoutedEventArgs e)
}

private bool _played = false;

private void OnSelectionChanged(object sender, RoutedEventArgs e)
{
if(_played)
if (_played)
PlayButtonSound();
_played = true;
}
Expand Down
15 changes: 14 additions & 1 deletion BattleChess3.Api/Controller/ManualController.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
namespace BattleChess3.Api.Controller
using BattleChess3.Model;
using System.Windows;
using System.Windows.Controls;
using System.Linq;

namespace BattleChess3.Api.Controller
{
public partial class ManualController
{
public ManualController()
{
InitializeComponent();
}

private void OnManualSelectedClick(object sender, RoutedEventArgs e)
{
System.Media.SoundPlayer snd = new System.Media.SoundPlayer("Sounds/BoardSound.wav");
snd.Play();
var button = (Button)sender;
ManualContent.DataContext = TypesOfFigures.FigureGroups.FirstOrDefault(x => x.Name == button.Content);
}
}
}
3 changes: 1 addition & 2 deletions BattleChess3.Api/Game/BoardTools.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using BattleChess3.Api.ViewModel;
using BattleChess3.Model.Figures;
using BattleChess3.Shared;
using BattleChess3.Shared.Properties;
using BattleChess3.Model.Properties;
using System.Linq;

namespace BattleChess3.Api.Game
Expand Down
5 changes: 2 additions & 3 deletions BattleChess3.Api/Game/FigureTools.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using BattleChess3.Model;
using BattleChess3.Model.Figures;
using BattleChess3.Shared;
using BattleChess3.Shared.Properties;
using BattleChess3.Model.Properties;

namespace BattleChess3.Api.Game
{
Expand All @@ -17,7 +16,7 @@ private static void CreateFigure(string tile, Position position, string playerNa
player?.CreateFigure(newBaseFigure);
SetFigureAtPosition(position, newBaseFigure);
}

/// <summary>
/// Tries to play the position if it is your turn
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion BattleChess3.Api/Game/Highlight.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BattleChess3.Model.Figures;
using BattleChess3.Shared;
using System.IO;

namespace BattleChess3.Api.Game
Expand Down
5 changes: 1 addition & 4 deletions BattleChess3.Api/Game/Session.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using BattleChess3.Api.ViewModel;
using BattleChess3.Model;
using BattleChess3.Model.Figures;
using BattleChess3.Shared;
using BattleChess3.Shared.Properties;
using BattleChess3.Model.Properties;

namespace BattleChess3.Api.Game
{
Expand Down
2 changes: 1 addition & 1 deletion BattleChess3.Api/ViewModel/MapsHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;

namespace BattleChess3.Api.ViewModel
{
public class MapsHolder : INotifyPropertyChanged
{
private List<Map> _maps = new List<Map>();

public List<Map> Maps
{
get => _maps;
Expand Down
1 change: 0 additions & 1 deletion BattleChess3.Api/ViewModel/SelectedFigure.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using BattleChess3.Api.Annotations;
using BattleChess3.Api.Game;
using BattleChess3.Model.Figures;
using BattleChess3.Shared;
using System.ComponentModel;
using System.Runtime.CompilerServices;

Expand Down
2 changes: 1 addition & 1 deletion BattleChess3.Api/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xmlns:controllers="clr-namespace:BattleChess3.Api.Controller"
mc:Ignorable="d"
DataContext="{Binding Source={x:Static game:Session.SelectedStyle}, UpdateSourceTrigger=PropertyChanged}"
Title="MainWindow" Height="480" Width="800" MinHeight="480" MinWidth="640">
Title="MainWindow" Height="620" Width="860" MinHeight="480" MinWidth="640">
<Window.Background>
<ImageBrush
ImageSource="{Binding Path=ApplicationStyle.ApplicationBackground, UpdateSourceTrigger=PropertyChanged}" />
Expand Down
Loading

0 comments on commit a25f8ab

Please sign in to comment.