Modified competition overlay settings page to match the new home page design.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace osrs_toolbox
|
||||
{
|
||||
@@ -31,13 +33,15 @@ namespace osrs_toolbox
|
||||
public bool HideOtherPlayers
|
||||
{
|
||||
get { return _hideOtherPlayers; }
|
||||
set { SetProperty(ref _hideOtherPlayers, value, nameof(HideOtherPlayers)); }
|
||||
set { SetProperty(ref _hideOtherPlayers, value, nameof(HideOtherPlayers)); OnPropertyChanged(nameof(OtherPlayersCheckboxImage)); }
|
||||
}
|
||||
public bool HideZeroGained
|
||||
{
|
||||
get { return _hideZeroKC; }
|
||||
set { SetProperty(ref _hideZeroKC, value, nameof(HideZeroGained)); }
|
||||
set { SetProperty(ref _hideZeroKC, value, nameof(HideZeroGained)); OnPropertyChanged(nameof(HideZeroCheckboxImage)); }
|
||||
}
|
||||
public ImageSource OtherPlayersCheckboxImage => HideOtherPlayers ? new BitmapImage(new Uri(@"/Resources/stone-checkbox-checked.png", UriKind.Relative)) : new BitmapImage(new Uri(@"/Resources/stone-checkbox-unchecked.png", UriKind.Relative));
|
||||
public ImageSource HideZeroCheckboxImage => HideZeroGained ? new BitmapImage(new Uri(@"/Resources/stone-checkbox-checked.png", UriKind.Relative)) : new BitmapImage(new Uri(@"/Resources/stone-checkbox-unchecked.png", UriKind.Relative));
|
||||
|
||||
public ICommand ToggleCompetitionOverlay
|
||||
{
|
||||
|
@@ -5,42 +5,120 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:osrs_toolbox"
|
||||
mc:Ignorable="d"
|
||||
Title="Wise Old Man Competition Overlay Settings" d:Height="450" d:Width="800" SizeToContent="WidthAndHeight" Closed="Window_Closed">
|
||||
Title="Wise Old Man Competition Overlay Settings" Height="450" Width="600" Closed="Window_Closed" WindowStyle="None" Background="Transparent" AllowsTransparency="True">
|
||||
<Window.DataContext>
|
||||
<local:CompetitionOverlaySettingsViewModel/>
|
||||
</Window.DataContext>
|
||||
<Window.Resources>
|
||||
<ControlTemplate x:Key="NoMouseOverButtonTemplate"
|
||||
TargetType="Button">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Border>
|
||||
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled"
|
||||
Value="False">
|
||||
<Setter Property="Background"
|
||||
Value="{x:Static SystemColors.ControlLightBrush}" />
|
||||
<Setter Property="Foreground"
|
||||
Value="{x:Static SystemColors.GrayTextBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Competition Overlay Testing" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" TextDecorations="Underline" Margin="3"/>
|
||||
<TextBlock Text="Player Name:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3"/>
|
||||
<!--TextBlock Text="Group ID:" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3"/-->
|
||||
<TextBlock Text="Competition ID:" Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3"/>
|
||||
<TextBlock Text="Hide Other Players:" Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3"/>
|
||||
<TextBlock Text="Hide Zero Gained:" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3"/>
|
||||
<Border Grid.Row="1" Grid.Column="1" Height="50" Width="180" HorizontalAlignment="Left">
|
||||
<Grid>
|
||||
<Image Source="/Resources/stone-input-box.png" Stretch="Fill" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
|
||||
<TextBox Text="{Binding PlayerName, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="16,3,16,3" Background="Transparent" BorderBrush="Transparent" Foreground="Yellow" FontSize="16"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--TextBox Text="{Binding GroupID, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="3"/-->
|
||||
<TextBox Text="{Binding CompetitionID, UpdateSourceTrigger=PropertyChanged}" Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="3"/>
|
||||
<CheckBox IsChecked="{Binding HideOtherPlayers, UpdateSourceTrigger=PropertyChanged}" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3"/>
|
||||
<CheckBox IsChecked="{Binding HideZeroGained, UpdateSourceTrigger=PropertyChanged}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3"/>
|
||||
<Button Command="{Binding ToggleCompetitionOverlay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="3" Padding="3" Content="Toggle Competition Overlay"/>
|
||||
<Button Command="{Binding ToggleCompetitionOverlayClickThrough, UpdateSourceTrigger=PropertyChanged}" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="3" Padding="3" Content="Make Overlay Click-Through"/>
|
||||
<Image Source="/Resources/Panel/panel-background.png" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="Fill" Margin="-3"/>
|
||||
<Image Source="/Resources/Panel/panel-left.png" Grid.Row="2" Grid.Column="0" Margin="0,-8,0,-8" Width="40" StretchDirection="Both" HorizontalAlignment="Stretch" VerticalAlignment="Top" Stretch="Fill"/>
|
||||
<Image Source="/Resources/Panel/panel-bottom.png" Grid.Row="3" Margin="-8,0,-8,0" Grid.Column="1" Height="40" StretchDirection="Both" HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="Fill"/>
|
||||
<Image Source="/Resources/Panel/panel-right.png" Grid.Row="2" Grid.Column="2" Margin="0,-8,0,-8" Width="40" StretchDirection="Both" HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="Fill"/>
|
||||
<Image Source="/Resources/Panel/panel-top.png" Grid.Row="1" Margin="-8,0,-8,0" Grid.Column="1" Height="40" StretchDirection="Both" HorizontalAlignment="Left" VerticalAlignment="Bottom" Stretch="Fill" MouseDown="Move_Window"/>
|
||||
<Image Source="/Resources/Panel/panel-top-left.png" Grid.Row="1" Grid.Column="0" Width="40" StretchDirection="Both" HorizontalAlignment="Right" VerticalAlignment="Bottom" MouseDown="Move_Window"/>
|
||||
<Image Source="/Resources/Panel/panel-bottom-left.png" Grid.Row="3" Grid.Column="0" Height="40" StretchDirection="Both" HorizontalAlignment="Right" VerticalAlignment="Top"/>
|
||||
<Image Source="/Resources/Panel/panel-bottom-right.png" Grid.Row="3" Grid.Column="2" Width="40" StretchDirection="Both" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||
<Image Source="/Resources/Panel/panel-top-right.png" Grid.Row="1" Grid.Column="2" Width="40" StretchDirection="Both" HorizontalAlignment="Left" VerticalAlignment="Bottom" MouseDown="Move_Window"/>
|
||||
<!--Image Source="/Resources/main-banner.png" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Width="360" Margin="0,0,0,-30" StretchDirection="Both" HorizontalAlignment="Center" VerticalAlignment="Bottom" Stretch="Uniform" MouseDown="Move_Window"/-->
|
||||
<Rectangle Grid.Row="1" Grid.Column="2" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="22" Height="22" Fill="White" Margin="10,0,0,10" MouseDown="Close_Window" MouseEnter="Exit_Hovered" MouseLeave="Exit_Unhovered"/>
|
||||
<Image Source="/Resources/close-button.png" Grid.Row="1" Grid.Column="2" StretchDirection="Both" Width="30" Margin="5,0,0,5" Stretch="Uniform" VerticalAlignment="Bottom" HorizontalAlignment="Left" IsHitTestVisible="False"/>
|
||||
<Grid Grid.Column="1" Grid.Row="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<local:OutlinedTextBlock Text="Competition Overlay Settings" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Stroke="Black" Fill="Yellow" StrokeThickness="1.2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="30" Margin="3,-45,3,0" IsHitTestVisible="False"/>
|
||||
<local:OutlinedTextBlock Text="Player Name:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3" Stroke="Black" Fill="Yellow" StrokeThickness="0.5" FontSize="20"/>
|
||||
<!--TextBlock Text="Group ID:" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3"/-->
|
||||
<local:OutlinedTextBlock Text="Competition ID:" Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3" Stroke="Black" Fill="Yellow" StrokeThickness="0.5" FontSize="20"/>
|
||||
<local:OutlinedTextBlock Text="Hide Other Players:" Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3" Stroke="Black" Fill="Yellow" StrokeThickness="0.5" FontSize="20"/>
|
||||
<local:OutlinedTextBlock Text="Hide Zero Gained:" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3" Stroke="Black" Fill="Yellow" StrokeThickness="0.5" FontSize="20"/>
|
||||
<Border Grid.Row="1" Grid.Column="1" Height="40" Width="300" HorizontalAlignment="Left" Margin="3">
|
||||
<Grid>
|
||||
<Image Source="/Resources/stone-input-box.png" Stretch="Fill" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
|
||||
<TextBox Text="{Binding PlayerName, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="25,3,25,3" Background="Transparent" BorderBrush="Transparent" Foreground="Yellow" FontSize="16"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="3" Grid.Column="1" Height="40" Width="300" HorizontalAlignment="Left" Margin="3">
|
||||
<Grid>
|
||||
<Image Source="/Resources/stone-input-box.png" Stretch="Fill" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
|
||||
<TextBox Text="{Binding CompetitionID, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="25,3,25,3" Background="Transparent" BorderBrush="Transparent" Foreground="Yellow" FontSize="16"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="4" Grid.Column="1" Width="30" Height="30" Margin="3" HorizontalAlignment="Left">
|
||||
<Image Source="{Binding OtherPlayersCheckboxImage, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" StretchDirection="Both" Stretch="Fill" MouseDown="Toggle_Other_Players"/>
|
||||
</Border>
|
||||
<Border Grid.Row="5" Grid.Column="1" Width="30" Height="30" Margin="3" HorizontalAlignment="Left">
|
||||
<Image Source="{Binding HideZeroCheckboxImage, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" StretchDirection="Both" Stretch="Fill" MouseDown="Toggle_Zero_Gained"/>
|
||||
</Border>
|
||||
<!--CheckBox IsChecked="{Binding HideOtherPlayers, UpdateSourceTrigger=PropertyChanged}" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3" Foreground="Transparent" Background="Transparent" BorderBrush="Transparent" BorderThickness="0"/>
|
||||
<CheckBox IsChecked="{Binding HideZeroGained, UpdateSourceTrigger=PropertyChanged}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3"/-->
|
||||
<Button Command="{Binding ToggleCompetitionOverlay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Template="{StaticResource NoMouseOverButtonTemplate}" Width="450" Height="60" Margin="3" Padding="3" VerticalAlignment="Center" HorizontalAlignment="Center" Background="Transparent" BorderBrush="Transparent" BorderThickness="0">
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="/Resources/wood-button.png" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" StretchDirection="Both" Stretch="Fill" MouseEnter="Button_Hovered" MouseLeave="Button_Unhovered"/>
|
||||
<local:OutlinedTextBlock Text="Toggle Competition Overlay" VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="Black" Fill="Yellow" FontSize="30" StrokeThickness="1.2" IsHitTestVisible="False" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Grid>
|
||||
</Button>
|
||||
<Button Command="{Binding ToggleCompetitionOverlayClickThrough, UpdateSourceTrigger=PropertyChanged}" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Template="{StaticResource NoMouseOverButtonTemplate}" Width="450" Height="60" Margin="3" Padding="3" VerticalAlignment="Center" HorizontalAlignment="Center" Background="Transparent" BorderBrush="Transparent" BorderThickness="0">
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="/Resources/wood-button.png" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" StretchDirection="Both" Stretch="Fill" MouseEnter="Button_Hovered" MouseLeave="Button_Unhovered"/>
|
||||
<local:OutlinedTextBlock Text="Make Overlay Click-Through" VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="Black" Fill="Yellow" FontSize="30" StrokeThickness="1.2" IsHitTestVisible="False" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Grid>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
@@ -31,5 +31,45 @@ namespace osrs_toolbox
|
||||
{
|
||||
Current = null;
|
||||
}
|
||||
|
||||
private void Move_Window(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed) { this.DragMove(); }
|
||||
}
|
||||
|
||||
private void Close_Window(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
Current.Close();
|
||||
}
|
||||
|
||||
private void Button_Hovered(object sender, MouseEventArgs e)
|
||||
{
|
||||
(sender as Image).Source = new BitmapImage(new Uri(@"/Resources/wood-button-pressed.png", UriKind.Relative));
|
||||
}
|
||||
|
||||
private void Button_Unhovered(object sender, MouseEventArgs e)
|
||||
{
|
||||
(sender as Image).Source = new BitmapImage(new Uri(@"/Resources/wood-button.png", UriKind.Relative));
|
||||
}
|
||||
|
||||
private void Exit_Hovered(object sender, MouseEventArgs e)
|
||||
{
|
||||
(sender as Rectangle).Fill = new SolidColorBrush(Colors.Red);
|
||||
}
|
||||
|
||||
private void Exit_Unhovered(object sender, MouseEventArgs e)
|
||||
{
|
||||
(sender as Rectangle).Fill = new SolidColorBrush(Colors.White);
|
||||
}
|
||||
|
||||
private void Toggle_Other_Players(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
(DataContext as CompetitionOverlaySettingsViewModel).HideOtherPlayers = !(DataContext as CompetitionOverlaySettingsViewModel).HideOtherPlayers;
|
||||
}
|
||||
|
||||
private void Toggle_Zero_Gained(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
(DataContext as CompetitionOverlaySettingsViewModel).HideZeroGained = !(DataContext as CompetitionOverlaySettingsViewModel).HideZeroGained;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user