From 0c6bc77eca6f94a7b9a141ceb81d0326ceb2ef07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?DragonRatTiger=20/=20=E3=83=AA=E3=83=A5=E3=82=A6=E3=82=B3?= Date: Sun, 28 Jul 2024 03:45:49 -0500 Subject: [PATCH] Adjust Score.ini Importer (#665) Now accounts for multiple song paths --- OpenTaiko/src/Songs/CScoreIni_Importer.cs | 10 +++++++--- OpenTaiko/src/Stages/01.StartUp/CStage起動.cs | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/OpenTaiko/src/Songs/CScoreIni_Importer.cs b/OpenTaiko/src/Songs/CScoreIni_Importer.cs index 4911edaf..acc9a608 100644 --- a/OpenTaiko/src/Songs/CScoreIni_Importer.cs +++ b/OpenTaiko/src/Songs/CScoreIni_Importer.cs @@ -12,12 +12,16 @@ namespace TJAPlayer3 { SqliteConnection? connection = DBSaves.GetSavesDBConnection(); if (connection == null) { Trace.TraceError("Could not establish a connection to Saves.db3 database. Aborting score import."); + Status = ""; return; } Status = "Searching for scores..."; - string[] _scoreFiles = Directory.GetFiles(TJAPlayer3.ConfigIni.strSongsPath, "*.score.ini", SearchOption.AllDirectories); - Trace.TraceInformation($"{_scoreFiles.Length} score.ini files have been found. Beginning import."); + List _scoreFiles = new List(); + foreach (string path in TJAPlayer3.ConfigIni.strSongsPath.Split(';', StringSplitOptions.RemoveEmptyEntries)) { + _scoreFiles.AddRange(Directory.GetFiles(path, "*.score.ini", SearchOption.AllDirectories)); + } + Trace.TraceInformation($"{_scoreFiles.Count} score.ini files have been found. Beginning import."); int importcount = 0; Status = "Importing scores..."; @@ -228,7 +232,7 @@ namespace TJAPlayer3 { Trace.TraceWarning($"Failed to import {_score} into new database. More details:\n{ex}"); } } - Trace.TraceInformation($"Imported {importcount} of {_scoreFiles.Length} scores from score.ini files."); + Trace.TraceInformation($"Imported {importcount} of {_scoreFiles.Count} scores from score.ini files."); Status = ""; } diff --git a/OpenTaiko/src/Stages/01.StartUp/CStage起動.cs b/OpenTaiko/src/Stages/01.StartUp/CStage起動.cs index 742f6ef5..18e6ec34 100644 --- a/OpenTaiko/src/Stages/01.StartUp/CStage起動.cs +++ b/OpenTaiko/src/Stages/01.StartUp/CStage起動.cs @@ -176,7 +176,6 @@ namespace TJAPlayer3 { TJAPlayer3.actTextConsole.tPrint((int)(x * TJAPlayer3.Skin.Resolution[0] / 1280.0), (int)(y * TJAPlayer3.Skin.Resolution[1] / 720.0), CTextConsole.EFontType.White, this.list進行文字列[i]); y += 24; } - TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, this.str現在進行中); //----------------- #endregion } else if (TJAPlayer3.ConfigIsNew && !bLanguageSelected) // Prompt language selection if Config.ini is newly generated