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

Commit

Permalink
Added perfect combo option to Ryu Edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Plextora committed Jan 14, 2023
1 parent 5bb4d8e commit 031a750
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 6 deletions.
133 changes: 130 additions & 3 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
WindowStyle="None"
WindowStartupLocation="CenterScreen"
Title="Ryu Edit" Height="420" Width="620">
<!-- region Control Templates -->
<!-- region Control Templates & Styles -->
<Window.Resources>
<ControlTemplate TargetType="Button" x:Key="DefaultButton">
<Border Name="RootElement" BorderThickness="1">
Expand Down Expand Up @@ -114,11 +114,125 @@
</VisualStateManager.VisualStateGroups>
</Border>
</ControlTemplate>

<Style x:Key="CheckBox" TargetType="{x:Type CheckBox}">
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<BulletDecorator Background="Transparent">
<BulletDecorator.Bullet>
<Border x:Name="Border" Width="13" Height="13" CornerRadius="0" BorderThickness="1">
<Border.BorderBrush>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#303030" Offset="0.0" />
<GradientStop Color="#303030" Offset="1.0" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Border.BorderBrush>
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#202020" />
<GradientStop Color="#303030" Offset="10" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Border.Background>
<Grid>
<Path Visibility="Collapsed" Width="7" Height="7" x:Name="CheckMark" SnapsToDevicePixels="False" StrokeThickness="2" Data="M 0 0 L 7 7 M 0 7 L 7 0">
<Path.Stroke>
<SolidColorBrush Color="PeachPuff" />
</Path.Stroke>
</Path>
<Path Visibility="Collapsed" Width="7" Height="7" x:Name="InderminateMark" SnapsToDevicePixels="False" StrokeThickness="2" Data="M 0 7 L 7 0">
<Path.Stroke>
<SolidColorBrush Color="PeachPuff" />
</Path.Stroke>
</Path>
</Grid>
</Border>
</BulletDecorator.Bullet>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="#454545" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="#454545" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="#303030" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="#303030" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="#454545" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="#454545" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="#303030" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="#303030" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled" />
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="CheckMark">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
<VisualState x:Name="Indeterminate">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="InderminateMark">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter Margin="4,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" RecognizesAccessKey="True" />
</BulletDecorator>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>



</Window.Resources>

<!-- endregion -->
<Grid x:Name="MainGrid" Background="#FF181818">
<Grid
Panel.ZIndex="-1">
<Grid.RowDefinitions>
<RowDefinition Height="53*"/>
<RowDefinition Height="31*"/>
</Grid.RowDefinitions>
<Rectangle
x:Name="WindowToolbar"
HorizontalAlignment="Center"
Expand All @@ -145,9 +259,10 @@
Foreground="PeachPuff"
FontFamily="Segoe UI Light"
HorizontalAlignment="Left"
Margin="10,380,0,0"
Margin="10,115,0,0"
VerticalAlignment="Top"
FontSize="15" />
FontSize="15"
Grid.Row="1" />
<Label
Content="Replay username"
Foreground="PeachPuff"
Expand Down Expand Up @@ -210,6 +325,18 @@
HorizontalAlignment="Left"
Margin="155,116,0,0"
VerticalAlignment="Top" />
<CheckBox
Grid.Row="0"
x:Name="IsPerfectComboCheckbox"
x:FieldModifier="public"
Style="{StaticResource CheckBox}"
Content="Turn on FC property in replay?"
Foreground="PeachPuff"
Background="#202020"
HorizontalAlignment="Left"
Margin="300,148,0,0"
VerticalAlignment="Top"
IsChecked="False"/>
</Grid>
<Button
x:Name="CloseButton"
Expand Down
6 changes: 5 additions & 1 deletion MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ private async void LoadReplayInfo()
{
ReplayUsernameTextbox.Text = _osuReplay?.PlayerName;
ComboTextbox.Text = (_osuReplay?.Combo).ToString();
IsPerfectComboCheckbox.IsChecked = _osuReplay is { PerfectCombo: true };

SetStatusLabel.Completed("Loaded replay info!");
await Task.Delay(2000);
SetStatusLabel.Default();
Expand All @@ -75,7 +77,9 @@ private async void SaveReplayButton_Click(object sender, RoutedEventArgs e)

_osuReplay.PlayerName = ReplayUsernameTextbox.Text;
_osuReplay.Combo = Convert.ToUInt16(ComboTextbox.Text);

if (IsPerfectComboCheckbox.IsChecked != null)
_osuReplay.PerfectCombo = (bool)IsPerfectComboCheckbox.IsChecked;

_osuReplay.Save(saveFileDialog.FileName);
SetStatusLabel.Completed("Saved edited replay!");
await Task.Delay(2000);
Expand Down
9 changes: 7 additions & 2 deletions RyuEdit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<AssemblyVersion>1.4.1.1</AssemblyVersion>
<FileVersion>1.4.1.1</FileVersion>
<NeutralLanguage>en</NeutralLanguage>
<Company>Plextora</Company>
<Product>Ryu Edit</Product>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<Optimize>False</Optimize>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 031a750

Please sign in to comment.