实现第一个输出beat左对齐

This commit is contained in:
2025-04-24 21:05:14 +08:00
parent 65dc344f79
commit 6cb66cde36
4 changed files with 67 additions and 23 deletions
+46 -15
View File
@@ -2,6 +2,7 @@
using Ollama;
using RDTKEditor.AIAssistant;
using RDTKEditor.Models;
using RhythmBase.Components;
using RhythmBase.Events;
using SkiaSharp;
using SkiaSharp.Views.Desktop;
@@ -9,6 +10,7 @@ using System.ComponentModel;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
namespace RDTKEditor
@@ -21,11 +23,32 @@ namespace RDTKEditor
private Assistant Assistant = new(Assistant.Qwen_3);
private SKSizeI _vsScale = new(1600,900);
private readonly RDTKView viewModel = new();
/*public MainWindow()
public MainWindow()
{
InitializeComponent();
SlV.Content = "Button";
}*/
viewModel.Level = RDLevel.Default;
viewModel.Level.Add(new Comment() { Beat = new RDBeat(1,2.33f) });
foreach (var item in viewModel.Level)
{
var time = item.Beat.BeatOnly;
Label label = new();
label.Content = time;
label.Background = new SolidColorBrush(Colors.Red);
if (time < 2)
{
label.Margin = new Thickness(0, 0, 0, 0);
}else
{
label.Margin = new Thickness(time*10, 0, 0, 0);
}
timelineCanvas.Children.Add(label);
}
}
private void OpenFile(object sender, RoutedEventArgs e)
{
OpenFileDialog openFileDialog = new()
@@ -109,7 +132,8 @@ namespace RDTKEditor
Type = RDPropertyType.String,
};
}
internal void OnUpdateEventProperties(RDTKProperty[] properties)
private readonly List<BaseEvent> selectedEvents = new();
internal void OnUpdateEventProperties(RDTKProperty[] properties)
{
ItemProperties.Items.Clear();
foreach (var property in properties)
@@ -261,7 +285,11 @@ namespace RDTKEditor
IsStroke = true,
});
}
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
MessageBox.Show("已确认");
}
private async void AIAssistantButton_Click(object sender, RoutedEventArgs e)
{
string input = AIAssistantText.Text;
@@ -271,22 +299,25 @@ namespace RDTKEditor
AIAssistantText.Text = responce.Content;
}
}
public class MainViewModel : INotifyPropertyChanged
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
MessageBox.Show("已确认");
}
}
public class MainViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
}
private bool _isButtonEnabled = true;
public bool IsButtonEnabled
{
get => _isButtonEnabled;
set
{
_isButtonEnabled = value;
}
}
}
}