Compare commits

..
2 Commits
Author SHA1 Message Date
Koquem 65dc344f79 界面下方输出beat(未完全实现) 2025-04-24 20:17:57 +08:00
Koquem 3fa6184341 test 2025-04-15 09:48:47 +08:00
2 changed files with 116 additions and 96 deletions
+94 -65
View File
@@ -7,69 +7,98 @@
xmlns:local="clr-namespace:RDTKEditor" xmlns:local="clr-namespace:RDTKEditor"
mc:Ignorable="d" mc:Ignorable="d"
Title="RDTK Editor" Height="450" Width="800"> Title="RDTK Editor" Height="450" Width="800">
<Window.DataContext> <Window.DataContext>
<local:MainViewModel/> <local:MainViewModel/>
</Window.DataContext> </Window.DataContext>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Menu Grid.Row="0" VerticalAlignment="Top"> <Menu Grid.Row="0" VerticalAlignment="Top">
<MenuItem Header="文件(_F)"> <MenuItem Header="文件(_F)">
<MenuItem Header="打开文件(_O)" Click="OpenFile" InputGestureText="Ctrl+O"/> <MenuItem Header="打开文件(_O)" Click="OpenFile" InputGestureText="Ctrl+O"/>
<MenuItem Header="保存文件(_S)" Click="SaveFile" InputGestureText="Ctrl+S"/> <MenuItem Header="保存文件(_S)" Click="SaveFile" InputGestureText="Ctrl+S"/>
<Separator/> <Separator/>
<MenuItem Header="退出(_E)" Click="Exit"/> <MenuItem Header="退出(_E)" Click="Exit"/>
</MenuItem> </MenuItem>
<MenuItem Header="帮助(_H)"> <MenuItem Header="帮助(_H)">
<MenuItem Header="关于(_A)" Click="About"/> <MenuItem Header="关于(_A)" Click="About"/>
</MenuItem> </MenuItem>
</Menu> </Menu>
<Grid Grid.Row="1"> <Grid Grid.Row="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="200" MinWidth="100" MaxWidth="300" /> <ColumnDefinition Width="200" MinWidth="100" MaxWidth="300" />
<ColumnDefinition Width="5" /> <ColumnDefinition Width="5" />
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="5" /> <ColumnDefinition Width="5" />
<ColumnDefinition Width="200" MinWidth="100" MaxWidth="300" /> <ColumnDefinition Width="200" MinWidth="100" MaxWidth="300" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
<RowDefinition Height="5" /> <RowDefinition Height="5" />
<RowDefinition Height="100" MinHeight="90" MaxHeight="270"/> <RowDefinition Height="100" MinHeight="90" MaxHeight="270"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Grid.Column="0" Background="LightBlue"> <Border Grid.Column="0" Background="LightBlue">
<ScrollViewer VerticalScrollBarVisibility="Auto"> <ScrollViewer VerticalScrollBarVisibility="Auto">
<ItemsControl x:Name="ItemProperties" Background="LightGray"> <ItemsControl x:Name="ItemProperties" Background="LightGray">
</ItemsControl> <ComboBox Width="120" Height="21" BorderBrush="#FFDF4444" Foreground="#FFC65E5E" RenderTransformOrigin="0.5,0.5">
</ScrollViewer> <ComboBox.RenderTransform>
</Border> <TransformGroup>
<GridSplitter Grid.Column="1" Width="5" Background="Gray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> <ScaleTransform/>
<Viewbox Grid.Row="0" Grid.Column="2" Stretch="Uniform"> <SkewTransform/>
<Border Background="LightGray" Width="1600" Height="900"> <RotateTransform Angle="-0.383"/>
<skia:SKElement x:Name="mainUI" PaintSurface="mainUI_PaintSurface" /> <TranslateTransform/>
</Border> </TransformGroup>
</Viewbox> </ComboBox.RenderTransform>
<GridSplitter Grid.Column="3" Width="5" Background="Gray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> <ComboBox.Background>
<Border Grid.Column="4" Background="LightBlue" > <LinearGradientBrush EndPoint="0,1">
<ScrollViewer VerticalScrollBarVisibility="Auto"> <GradientStop Color="#FFF0F0F0"/>
<Grid Background="LightGray"> <GradientStop Color="#FF963333" Offset="1"/>
<TextBox x:Name="AIAssistantText" HorizontalAlignment="Left" VerticalAlignment="Top"> </LinearGradientBrush>
传给 AI 的文本 </ComboBox.Background>
</TextBox> <ComboBoxItem Content="选项 1" />
<Button x:Name="AIAssistantButton" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,30,0,0" Click="AIAssistantButton_Click" > <ComboBoxItem Content="选项 2" />
测试 </ComboBox>
</Button> <Label Content="Label" Height="28" Width="112" RenderTransformOrigin="0.5,0.5">
</Grid> <Label.RenderTransform>
</ScrollViewer> <TransformGroup>
</Border> <ScaleTransform/>
<GridSplitter Grid.Row="1" Grid.ColumnSpan="5" Height="5" Background="Gray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> <SkewTransform/>
<Border Grid.ColumnSpan="5" Grid.Row="2" Background="LightSalmon"> <RotateTransform Angle="0.017"/>
<ScrollViewer x:Name="timelineViewer" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <TranslateTransform/>
<Canvas x:Name="timelineCanvas" Background="LightGray" /> </TransformGroup>
</ScrollViewer> </Label.RenderTransform>
</Border> </Label>
</Grid> <ListView Height="65" Width="192" d:ItemsSource="{d:SampleData ItemCount=5}">
</Grid> <ListView.View>
<GridView>
<GridViewColumn/>
</GridView>
</ListView.View>
</ListView>
</ItemsControl>
</ScrollViewer>
</Border>
<GridSplitter Grid.Column="1" Width="5" Background="Gray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<Viewbox Grid.Row="0" Grid.Column="2" Stretch="Uniform">
<Border Background="LightGray" Width="1600" Height="900">
<skia:SKElement x:Name="mainUI" PaintSurface="mainUI_PaintSurface" />
</Border>
</Viewbox>
<GridSplitter Grid.Column="3" Width="5" Background="Gray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<Border Grid.Column="4" Background="LightBlue" >
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid x:Name="timelineCanvas3" Background="LightGray" />
</ScrollViewer>
</Border>
<GridSplitter Grid.Row="1" Grid.ColumnSpan="5" Height="5" Background="Gray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<Border Grid.ColumnSpan="5" Grid.Row="2" Background="LightSalmon">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" x:Name="SlV">
<Canvas x:Name="timelineCanvas" Background="LightGray" >
</Canvas>
</ScrollViewer>
</Border>
</Grid>
</Grid>
</Window> </Window>
+22 -31
View File
@@ -21,10 +21,11 @@ namespace RDTKEditor
private Assistant Assistant = new(Assistant.Qwen_3); private Assistant Assistant = new(Assistant.Qwen_3);
private SKSizeI _vsScale = new(1600,900); private SKSizeI _vsScale = new(1600,900);
private readonly RDTKView viewModel = new(); private readonly RDTKView viewModel = new();
public MainWindow() /*public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
} SlV.Content = "Button";
}*/
private void OpenFile(object sender, RoutedEventArgs e) private void OpenFile(object sender, RoutedEventArgs e)
{ {
OpenFileDialog openFileDialog = new() OpenFileDialog openFileDialog = new()
@@ -57,33 +58,6 @@ namespace RDTKEditor
{ {
OnUpdateEventProperties(GetProperties(new MoveRow())); OnUpdateEventProperties(GetProperties(new MoveRow()));
//OnUpdateEventProperties([
// new(){
// Verifier = new RDTKPropertyVerifierDefault(),
// Name = "Name",
// Value = "RDTK Editor",
// Type = RDPropertyType.String,
// },
// new(){
// Verifier = new RDTKPropertyVerifierDefault(),
// Name = "Version",
// Value = "1.0.0",
// Type = RDPropertyType.String,
// },
// new(){
// Verifier = new RDTKPropertyVerifierEnum(typeof(EventType)),
// Name = "Description",
// Value = "RDTK Editor 是一个简单的节奏医生关卡编辑器。",
// Type = RDPropertyType.Enum,
// },
// new(){
// Verifier = new RDTKPropertyVerifierBool(),
// Name = "测试值",
// Value = "true",
// Type = RDPropertyType.Bool,
// }
// ]);
//MessageBox.Show("RDTK Editor 是一个简单的节奏医生关卡编辑器。", "关于 RDTK Editor");
} }
private RDTKProperty[] GetProperties(BaseEvent e) private RDTKProperty[] GetProperties(BaseEvent e)
{ {
@@ -255,13 +229,16 @@ namespace RDTKEditor
}); });
}*/ }*/
private void mainUI_PaintSurface(object sender, SKPaintSurfaceEventArgs e)
private void mainUI_PaintSurface(object sender, SKPaintSurfaceEventArgs e)
{ {
var sfc = e.Surface; var sfc = e.Surface;
var cvs = sfc.Canvas; var cvs = sfc.Canvas;
var info = e.Info; var info = e.Info;
cvs.Clear(SKColors.Black); cvs.Clear(SKColors.Black);
SKPoint scale = new(info.Width / _vsScale.Width, info.Height / _vsScale.Height); SKPoint scale = new((float)info.Width / _vsScale.Width, (float)info.Height / _vsScale.Height);
cvs.Save(); cvs.Save();
cvs.Scale(scale); cvs.Scale(scale);
Draw(cvs); Draw(cvs);
@@ -295,7 +272,21 @@ namespace RDTKEditor
} }
} }
public class MainViewModel : INotifyPropertyChanged public class MainViewModel : INotifyPropertyChanged
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
MessageBox.Show("已确认");
}
}
public class MainViewModel : INotifyPropertyChanged
{ {
public event PropertyChangedEventHandler? PropertyChanged; public event PropertyChangedEventHandler? PropertyChanged;
} }
} }