diff --git a/osu! Player/MainWindow.xaml.cs b/osu! Player/MainWindow.xaml.cs index 7e4f77f..37a2b27 100644 --- a/osu! Player/MainWindow.xaml.cs +++ b/osu! Player/MainWindow.xaml.cs @@ -134,10 +134,15 @@ private async void Init(object sender, RoutedEventArgs e) { var splash = new SplashWindow(); splash.Show(); + await Task.Run(() => Thread.Sleep(1000)); await RefreshList(); + splash.Close(); + } + if (settings.UseAnimation) + { Storyboard sb = FindResource("StartAnimation") as Storyboard; Storyboard.SetTarget(sb, this); sb.Completed += (s, a) => @@ -149,8 +154,10 @@ private async void Init(object sender, RoutedEventArgs e) else { Opacity = 1f; - await RefreshList(); + ShowInTaskbar = true; } + + if (!settings.UseSplashScreen) await RefreshList(); } private void PlaySong(string tag) @@ -378,7 +385,7 @@ private void OnClosing(object sender, CancelEventArgs e) StopSong(); var isAnimationCompleted = false; - if (!isAnimationCompleted) + if (!isAnimationCompleted && settings.UseAnimation) { e.Cancel = true; Storyboard sb = FindResource("CloseAnimation") as Storyboard; diff --git a/osu! Player/Properties/AssemblyInfo.cs b/osu! Player/Properties/AssemblyInfo.cs index f6abc03..bc44d57 100644 --- a/osu! Player/Properties/AssemblyInfo.cs +++ b/osu! Player/Properties/AssemblyInfo.cs @@ -51,7 +51,7 @@ // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.2.9")] -[assembly: AssemblyFileVersion("1.1.2.9")] +[assembly: AssemblyVersion("1.2.0.10")] +[assembly: AssemblyFileVersion("1.2.0.10")] [assembly: Guid("05EA8BF5-DA65-4EF0-BE35-B5CE28169F5E")] diff --git a/osu! Player/Settings.cs b/osu! Player/Settings.cs index 6156dfd..5e26955 100644 --- a/osu! Player/Settings.cs +++ b/osu! Player/Settings.cs @@ -10,6 +10,7 @@ public class Settings { // 設定項目を追加する場合は、bool型→string型→数値型→リスト→それ以外で、配列は使用しない。 public bool UseSplashScreen { get; set; } = true; + public bool UseAnimation { get; set; } = true; public string OsuPath { get; set; } public int AudioDevice { get; set; } = 0; public List DisabledSongs { get; set; } diff --git a/osu! Player/SettingsWindow.xaml b/osu! Player/SettingsWindow.xaml index 186020a..5face7d 100644 --- a/osu! Player/SettingsWindow.xaml +++ b/osu! Player/SettingsWindow.xaml @@ -4,7 +4,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Style="{StaticResource ToolWindowStyle}" - Title="Settings - osu! Player" Height="213" Width="360" WindowStartupLocation="CenterOwner" + Title="Settings - osu! Player" Height="247" Width="360" WindowStartupLocation="CenterOwner" ResizeMode="NoResize"> @@ -32,7 +32,10 @@ - diff --git a/osu! Player/SettingsWindow.xaml.cs b/osu! Player/SettingsWindow.xaml.cs index 3bf8957..ba63eac 100644 --- a/osu! Player/SettingsWindow.xaml.cs +++ b/osu! Player/SettingsWindow.xaml.cs @@ -32,6 +32,8 @@ public SettingsWindow() OsuPath.Text = _currentOsuPath = _settings.OsuPath; AudioDevice.SelectedIndex = _currentAudioDevice = _settings.AudioDevice; + UseAnimation.IsChecked = _settings.UseAnimation; + UseSplashScreen.IsChecked = _settings.UseSplashScreen; } private void OpenFolderDialog(object sender, RoutedEventArgs e) @@ -59,6 +61,8 @@ private async void CloseWindow(object sender, RoutedEventArgs e) { _settings.OsuPath = OsuPath.Text; _settings.AudioDevice = AudioDevice.SelectedIndex; + _settings.UseAnimation = (bool)UseAnimation.IsChecked; + _settings.UseSplashScreen = (bool)UseSplashScreen.IsChecked; _instance.settings = _settings; SettingsManager.WriteSettings("settings.osp", _settings); diff --git a/osu! Player/SplashWindow.xaml b/osu! Player/SplashWindow.xaml index 2e5c5a4..6aee54f 100644 --- a/osu! Player/SplashWindow.xaml +++ b/osu! Player/SplashWindow.xaml @@ -7,18 +7,12 @@ mc:Ignorable="d" AllowsTransparency="True" Background="Transparent" Title="Loading - osu! Player" Height="256" Width="256" WindowStyle="None" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" - Closing="OnClosing" Topmost="True" Opacity="0"> - - - - - - - - - + Closing="OnClosing" Topmost="True" Opacity="0" Loaded="Init"> + + + diff --git a/osu! Player/SplashWindow.xaml.cs b/osu! Player/SplashWindow.xaml.cs index 06d5f19..2134dc3 100644 --- a/osu! Player/SplashWindow.xaml.cs +++ b/osu! Player/SplashWindow.xaml.cs @@ -11,15 +11,32 @@ namespace osu_Player public partial class SplashWindow : Window { private bool _isAnimationCompleted; + private MainWindow _instance; public SplashWindow() { + _instance = MainWindow.GetInstance(); + InitializeComponent(); } - public void OnClosing(object sender, CancelEventArgs e) + private void Init(object sender, RoutedEventArgs e) + { + if (_instance.settings.UseAnimation) + { + Storyboard sb = FindResource("StartAnimation") as Storyboard; + Storyboard.SetTarget(sb, this); + sb.Begin(); + } + else + { + Opacity = 1f; + } + } + + private void OnClosing(object sender, CancelEventArgs e) { - if (!_isAnimationCompleted) + if (!_isAnimationCompleted && _instance.settings.UseAnimation) { e.Cancel = true; Storyboard sb = FindResource("CloseAnimation") as Storyboard; @@ -28,7 +45,7 @@ public void OnClosing(object sender, CancelEventArgs e) } } - public void OnAnimationCompleted(object sender, EventArgs e) + private void OnAnimationCompleted(object sender, EventArgs e) { _isAnimationCompleted = true; Close();