Skip to content

Commit

Permalink
Merge pull request #4 from Siketyan/develop
Browse files Browse the repository at this point in the history
1.3.1
  • Loading branch information
siketyan authored Jun 10, 2017
2 parents 7ad7d00 + 6c60c2d commit 0373e43
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
3 changes: 0 additions & 3 deletions DisabledSongsWIndow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using System.Collections.ObjectModel;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;

namespace osu_Player
{
Expand Down
13 changes: 11 additions & 2 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,19 @@ private async void InitAsync(object sender, RoutedEventArgs e)
var hsrc = PresentationSource.FromVisual(this) as HwndSource;
hsrc.AddHook(WndProc);

if (!File.Exists("settings.json")) new Settings().Write();
if (!File.Exists("settings.json"))
{
new Settings { Version = Settings.VERSION }.Write();
}

settings = Settings.Read();
if (settings.DisabledSongs == null) settings.DisabledSongs = new List<Song>();
if (settings.Version != Settings.VERSION)
{
MessageBox.Show("設定ファイルのバージョンが異なるため、使用できません。\n削除または移動してから再試行してください。");
Environment.Exit(0);
}

if (settings.DisabledSongs == null) settings.DisabledSongs = new List<Song>();
if (settings.OsuPath == null)
{
if (Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\osu!"))
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0.12")]
[assembly: AssemblyFileVersion("1.3.0.12")]
[assembly: AssemblyVersion("1.3.1.13")]
[assembly: AssemblyFileVersion("1.3.1.13")]
[assembly: Guid("05EA8BF5-DA65-4EF0-BE35-B5CE28169F5E")]

4 changes: 4 additions & 0 deletions Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ namespace osu_Player
{
public class Settings
{
public const int VERSION = 0x01;
private const string PATH = "settings.json";

[JsonProperty("version")]
public int? Version { get; set; }

[JsonProperty("use_splash")]
public bool UseSplashScreen { get; set; } = true;

Expand Down
1 change: 0 additions & 1 deletion SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Windows;
using osu_Player.Properties;
using Un4seen.Bass;

namespace osu_Player
Expand Down
4 changes: 2 additions & 2 deletions Song.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public Song(DirectoryInfo folder) : this()
ThumbnailPath = MainWindow.GetInstance().settings.OsuPath + @"\Data\bt\" + id + ".jpg";

if (!File.Exists(ThumbnailPath))
{
ThumbnailPath = MainWindow.GetInstance().settings.OsuPath + @"\Data\bt\" + id + "l.jpg";
if (!File.Exists(ThumbnailPath))
ThumbnailPath = "Resources/unknown.png";
}

stream.Dispose();
}
Expand Down

0 comments on commit 0373e43

Please sign in to comment.