feat: add all essential dialogs

This commit is contained in:
2025-11-17 13:22:00 +08:00
parent 9d51866443
commit 02118f4c0a
12 changed files with 278 additions and 114 deletions

View File

@ -66,6 +66,12 @@
<Compile Include="Views\AboutDialog.xaml.cs">
<DependentUpon>AboutDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Views\AddFrameDialog.xaml.cs">
<DependentUpon>AddFrameDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Views\EditFpsDialog.xaml.cs">
<DependentUpon>EditFpsDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Views\GotoDialog.xaml.cs">
<DependentUpon>GotoDialog.xaml</DependentUpon>
</Compile>
@ -75,8 +81,8 @@
<Compile Include="Views\PreferenceDialog.xaml.cs">
<DependentUpon>PreferenceDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Views\SetupCountAndFpsDialog.xaml.cs">
<DependentUpon>SetupCountAndFpsDialog.xaml</DependentUpon>
<Compile Include="Views\TasViewer.xaml.cs">
<DependentUpon>TasViewer.xaml</DependentUpon>
</Compile>
<Page Include="Styles\AccessoryIconControl.xaml">
<SubType>Designer</SubType>
@ -94,6 +100,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\AddFrameDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\EditFpsDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\GotoDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -122,7 +136,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\SetupCountAndFpsDialog.xaml">
<Page Include="Views\TasViewer.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>

View File

@ -0,0 +1,58 @@
<Window x:Class="BallanceTasEditor.Views.AddFrameDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BallanceTasEditor.Views"
mc:Ignorable="d" WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow"
Title="Add Frame" Height="250" Width="400" Icon="/Assets/AddFrame.ico">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Add frames with given FPS and frame count."
Style="{StaticResource NoteBannerStyle}"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image Source="/Assets/Count.ico" RenderOptions.BitmapScalingMode="HighQuality"
Grid.Column="0" Grid.Row="0" Width="16" Height="16" VerticalAlignment="Center"/>
<Image Source="/Assets/Fps.ico" RenderOptions.BitmapScalingMode="HighQuality"
Grid.Column="0" Grid.Row="1" Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Margin="5" Grid.Column="1" Grid.Row="0" Text="Count" VerticalAlignment="Center"/>
<TextBlock Margin="5" Grid.Column="1" Grid.Row="1" Text="FPS" VerticalAlignment="Center"/>
<TextBlock Margin="5" Grid.Column="1" Grid.Row="2" Text="Delta Time" VerticalAlignment="Center"/>
<TextBox Margin="5" Padding="3" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center"/>
<TextBox Margin="5" Padding="3" Grid.Row="1" Grid.Column="2" VerticalAlignment="Center"/>
<TextBlock Margin="5" Padding="3" Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" Text="N/A"/>
</Grid>
</Grid>
<StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right" Margin="10">
<Button Content="OK" Margin="5" Style="{StaticResource OkButtonStyle}" IsDefault="True"/>
<Button Content="Cancel" Margin="5" Style="{StaticResource CancelButtonStyle}"/>
</StackPanel>
</Grid>
</Window>

View File

@ -14,10 +14,10 @@ using System.Windows.Shapes;
namespace BallanceTasEditor.Views {
/// <summary>
/// Interaction logic for SetupCountAndFpsDialog.xaml
/// Interaction logic for AddFrameDialog.xaml
/// </summary>
public partial class SetupCountAndFpsDialog : Window {
public SetupCountAndFpsDialog() {
public partial class AddFrameDialog : Window {
public AddFrameDialog() {
InitializeComponent();
}
}

View File

@ -0,0 +1,53 @@
<Window x:Class="BallanceTasEditor.Views.EditFpsDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BallanceTasEditor.Views"
mc:Ignorable="d" WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow"
Title="Edit FPS" Height="220" Width="400" Icon="/Assets/SetFps.ico">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Change frame delta time into your given FPS."
Style="{StaticResource NoteBannerStyle}"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image Source="/Assets/Fps.ico" RenderOptions.BitmapScalingMode="HighQuality"
Grid.Column="0" Grid.Row="0" Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Margin="5" Grid.Column="1" Grid.Row="0" Text="FPS" VerticalAlignment="Center"/>
<TextBlock Margin="5" Grid.Column="1" Grid.Row="1" Text="Delta Time" VerticalAlignment="Center"/>
<TextBox Margin="5" Padding="3" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center"/>
<TextBlock Margin="5" Padding="3" Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Text="N/A"/>
</Grid>
</Grid>
<StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right" Margin="10">
<Button Content="OK" Margin="5" Style="{StaticResource OkButtonStyle}" IsDefault="True"/>
<Button Content="Cancel" Margin="5" Style="{StaticResource CancelButtonStyle}"/>
</StackPanel>
</Grid>
</Window>

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BallanceTasEditor.Views {
/// <summary>
/// Interaction logic for EditFpsDialog.xaml
/// </summary>
public partial class EditFpsDialog : Window {
public EditFpsDialog() {
InitializeComponent();
}
}
}

View File

@ -4,9 +4,30 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BallanceTasEditor.Views"
mc:Ignorable="d"
Title="GotoDialog" Height="450" Width="800">
mc:Ignorable="d" WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow"
Title="Goto..." Height="180" Width="400" Icon="/Assets/Goto.ico">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Jump into your specified index of frame."
Style="{StaticResource NoteBannerStyle}"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBox Margin="10" Padding="3" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center"/>
</Grid>
<StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right" Margin="10">
<Button Content="OK" Margin="5" Style="{StaticResource OkButtonStyle}" IsDefault="True"/>
<Button Content="Cancel" Margin="5" Style="{StaticResource CancelButtonStyle}"/>
</StackPanel>
</Grid>
</Window>

View File

@ -61,13 +61,14 @@
<MenuItem Header="Previous Item" Icon="{StaticResource IconPreviousItem}" InputGestureText="S"/>
<MenuItem Header="Next Page" Icon="{StaticResource IconNextPage}" InputGestureText="D"/>
<MenuItem Header="Next Item" Icon="{StaticResource IconNextItem}" InputGestureText="F"/>
<MenuItem Header="Goto Item" Icon="{StaticResource IconGoto}" InputGestureText="G"/>
<MenuItem Header="Goto Item" Icon="{StaticResource IconGoto}" InputGestureText="G" Click="MenuItem_Click_4"/>
<Separator/>
<MenuItem Header="Select Mode" Icon="{StaticResource IconSelectMode}"/>
<MenuItem Header="Fill Mode" Icon="{StaticResource IconFillMode}"/>
<MenuItem Header="Draw Mode" Icon="{StaticResource IconDrawMode}"/>
<Separator/>
<MenuItem Header="Uniform FPS" Icon="{StaticResource IconUniformFps}"/>
<MenuItem Header="Clear Keys"/>
<MenuItem Header="Uniform FPS" Icon="{StaticResource IconUniformFps}" Click="MenuItem_Click_5"/>
<Separator/>
<MenuItem Header="Preference" Icon="{StaticResource IconPreference}" InputGestureText="Ctrl+P" Click="MenuItem_Click"/>
</MenuItem>
@ -106,40 +107,42 @@
</StackPanel>
</Grid>
<Grid.ContextMenu>
<ContextMenu>
<ContextMenu.Resources>
<!-- Context Menu Icons -->
<Image x:Key="IconSet" Source="/Assets/SetCell.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconUnset" Source="/Assets/UnsetCell.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconFlip" Source="/Assets/FlipCell.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconCut" Source="/Assets/CutFrame.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconCopy" Source="/Assets/CopyFrame.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconPaste" Source="/Assets/PasteFrame.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconDelete" Source="/Assets/DeleteFrame.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconAdd" Source="/Assets/AddFrame.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconFps" Source="/Assets/SetFps.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
</ContextMenu.Resources>
<local:TasViewer>
<local:TasViewer.ContextMenu>
<ContextMenu>
<ContextMenu.Resources>
<!-- Context Menu Icons -->
<Image x:Key="IconSet" Source="/Assets/SetCell.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconUnset" Source="/Assets/UnsetCell.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconFlip" Source="/Assets/FlipCell.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconCut" Source="/Assets/CutFrame.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconCopy" Source="/Assets/CopyFrame.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconPaste" Source="/Assets/PasteFrame.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconDelete" Source="/Assets/DeleteFrame.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconAdd" Source="/Assets/AddFrame.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
<Image x:Key="IconFps" Source="/Assets/SetFps.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
</ContextMenu.Resources>
<MenuItem Header="Set" Icon="{StaticResource IconSet}"/>
<MenuItem Header="Unset" Icon="{StaticResource IconUnset}"/>
<MenuItem Header="Flip" Icon="{StaticResource IconFlip}"/>
<Separator/>
<MenuItem Header="Cut" Icon="{StaticResource IconCut}" InputGestureText="Ctrl+X"/>
<MenuItem Header="Copy" Icon="{StaticResource IconCopy}" InputGestureText="Ctrl+C"/>
<MenuItem Header="Paste after This" Icon="{StaticResource IconPaste}" InputGestureText="Ctrl+V"/>
<MenuItem Header="Paste before This"/>
<Separator/>
<MenuItem Header="Delete This" Icon="{StaticResource IconDelete}"/>
<MenuItem Header="Delete after This" InputGestureText="Del"/>
<MenuItem Header="Delete before This" InputGestureText="Backspace"/>
<Separator/>
<MenuItem Header="Add after This" Icon="{StaticResource IconAdd}" Click="MenuItem_Click_2"/>
<MenuItem Header="Add before This"/>
<Separator/>
<MenuItem Header="Set FPS" Icon="{StaticResource IconFps}"/>
</ContextMenu>
</Grid.ContextMenu>
<MenuItem Header="Set" Icon="{StaticResource IconSet}"/>
<MenuItem Header="Unset" Icon="{StaticResource IconUnset}"/>
<MenuItem Header="Flip" Icon="{StaticResource IconFlip}"/>
<Separator/>
<MenuItem Header="Cut" Icon="{StaticResource IconCut}" InputGestureText="Ctrl+X"/>
<MenuItem Header="Copy" Icon="{StaticResource IconCopy}" InputGestureText="Ctrl+C"/>
<MenuItem Header="Paste after This" Icon="{StaticResource IconPaste}" InputGestureText="Ctrl+V"/>
<MenuItem Header="Paste before This"/>
<Separator/>
<MenuItem Header="Delete This" Icon="{StaticResource IconDelete}"/>
<MenuItem Header="Delete after This" InputGestureText="Del"/>
<MenuItem Header="Delete before This" InputGestureText="Backspace"/>
<Separator/>
<MenuItem Header="Add after This" Icon="{StaticResource IconAdd}" Click="MenuItem_Click_2"/>
<MenuItem Header="Add before This"/>
<Separator/>
<MenuItem Header="Set FPS" Icon="{StaticResource IconFps}" Click="MenuItem_Click_6"/>
</ContextMenu>
</local:TasViewer.ContextMenu>
</local:TasViewer>
</Grid>
<StatusBar Grid.Row="3">

View File

@ -40,9 +40,26 @@ namespace BallanceTasEditor.Views {
dialog.ShowDialog();
}
private void MenuItem_Click_4(object sender, RoutedEventArgs e) {
var dialog =new GotoDialog();
dialog.Owner = this;
dialog.ShowDialog();
}
private void MenuItem_Click_5(object sender, RoutedEventArgs e) {
var dialog = new EditFpsDialog();
dialog.Owner = this;
dialog.ShowDialog();
}
private void MenuItem_Click_6(object sender, RoutedEventArgs e) {
var dialog = new EditFpsDialog();
dialog.Owner = this;
dialog.ShowDialog();
}
private void MenuItem_Click_2(object sender, RoutedEventArgs e) {
// TODO; Change Title and Icon
var dialog = new SetupCountAndFpsDialog();
var dialog = new AddFrameDialog();
dialog.Owner = this;
dialog.ShowDialog();
}

View File

@ -5,7 +5,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BallanceTasEditor.Views"
mc:Ignorable="d" WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow"
RenderOptions.BitmapScalingMode="HighQuality"
Title="New File" Height="250" Width="400" Icon="/Assets/NewFile.ico">
<Grid>
<Grid.RowDefinitions>
@ -35,8 +34,10 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image Source="/Assets/Count.ico" Grid.Column="0" Grid.Row="0" Width="16" Height="16" VerticalAlignment="Center"/>
<Image Source="/Assets/Fps.ico" Grid.Column="0" Grid.Row="1" Width="16" Height="16" VerticalAlignment="Center"/>
<Image Source="/Assets/Count.ico" RenderOptions.BitmapScalingMode="HighQuality"
Grid.Column="0" Grid.Row="0" Width="16" Height="16" VerticalAlignment="Center"/>
<Image Source="/Assets/Fps.ico" RenderOptions.BitmapScalingMode="HighQuality"
Grid.Column="0" Grid.Row="1" Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Margin="5" Grid.Column="1" Grid.Row="0" Text="Count" VerticalAlignment="Center"/>
<TextBlock Margin="5" Grid.Column="1" Grid.Row="1" Text="FPS" VerticalAlignment="Center"/>

View File

@ -1,64 +0,0 @@
<Window x:Class="BallanceTasEditor.Views.SetupCountAndFpsDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BallanceTasEditor.Views"
mc:Ignorable="d" WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow"
Title="Setup Count and FPS" Height="250" Width="400">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Grid.Row="0" Text="Count" VerticalAlignment="Center"/>
<TextBlock Grid.Column="0" Grid.Row="1" Text="FPS" VerticalAlignment="Center"/>
<TextBlock Grid.Column="0" Grid.Row="2" Text="Delta Time" VerticalAlignment="Center"/>
<TextBox Margin="5" Padding="3" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
<TextBox Margin="5" Padding="3" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"/>
<TextBlock Margin="5" Padding="3" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Text="N/A"/>
</Grid>
</Grid>
<StackPanel Grid.Row="1" HorizontalAlignment="Right" Orientation="Horizontal" Margin="10">
<Button IsDefault="True" Padding="5" Margin="5" MinWidth="80">
<Button.Content>
<StackPanel Orientation="Horizontal">
<ContentControl Content="{StaticResource IconBtnOk}" Width="24" Height="24"/>
<TextBlock Text="OK" VerticalAlignment="Center"/>
</StackPanel>
</Button.Content>
</Button>
<Button Padding="5" Margin="5" MinWidth="80">
<Button.Content>
<StackPanel Orientation="Horizontal">
<ContentControl Content="{StaticResource IconBtnCancel}" Width="24" Height="24"/>
<TextBlock Text="Cancel" VerticalAlignment="Center"/>
</StackPanel>
</Button.Content>
</Button>
</StackPanel>
</Grid>
</Window>

View File

@ -0,0 +1,12 @@
<UserControl x:Class="BallanceTasEditor.Views.TasViewer"
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:BallanceTasEditor.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Rectangle Fill="Black" Width="300" Height="100" VerticalAlignment="Top" HorizontalAlignment="Center"/>
</Grid>
</UserControl>

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BallanceTasEditor.Views {
/// <summary>
/// Interaction logic for TasViewer.xaml
/// </summary>
public partial class TasViewer : UserControl {
public TasViewer() {
InitializeComponent();
}
}
}