1
0
mirror of synced 2024-11-27 17:00:50 +01:00

oops, that change breaks towers (#707)

This commit is contained in:
DragonRatTiger / リュウコ 2024-10-19 13:16:33 -05:00 committed by GitHub
parent c0fea95c59
commit 92b096c159
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,9 +44,6 @@ namespace OpenTaiko {
var bgOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.BACKGROUND}"); var bgOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.BACKGROUND}");
var preset = HScenePreset.GetBGPreset(); var preset = HScenePreset.GetBGPreset();
if (preset == null) return;
if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) {
bgOrigindir += "Tower"; bgOrigindir += "Tower";
} else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) {
@ -63,18 +60,15 @@ namespace OpenTaiko {
var upDirs = System.IO.Directory.GetDirectories($@"{bgOrigindir}{Path.DirectorySeparatorChar}Up"); var upDirs = System.IO.Directory.GetDirectories($@"{bgOrigindir}{Path.DirectorySeparatorChar}Up");
// If there is a preset upper background and this preset exists on the skin use it, else random upper background // If there is a preset upper background and this preset exists on the skin use it, else random upper background
if (preset.UpperBackground != null) { var _presetPath = (preset != null && preset.UpperBackground != null) ? $@"{bgOrigindir}{Path.DirectorySeparatorChar}Up{Path.DirectorySeparatorChar}" + preset.UpperBackground[random.Next(0, preset.UpperBackground.Length)] : "";
var _presetPath = (preset.UpperBackground.Length > 0) ? $@"{bgOrigindir}{Path.DirectorySeparatorChar}Up{Path.DirectorySeparatorChar}" + preset.UpperBackground[random.Next(0, preset.UpperBackground.Length)] : ""; var upPath = (preset != null && System.IO.Directory.Exists(_presetPath))
var upPath = (Directory.Exists(_presetPath)) ? _presetPath
? _presetPath : upDirs[random.Next(0, upDirs.Length)];
: (upDirs.Length > 0 ? upDirs[random.Next(0, upDirs.Length)] : "");
UpScript = new ScriptBG($@"{upPath}{Path.DirectorySeparatorChar}Script.lua"); UpScript = new ScriptBG($@"{upPath}{Path.DirectorySeparatorChar}Script.lua");
UpScript.Init(); UpScript.Init();
}
if (UpScript == null) IsUpNotFound = true; IsUpNotFound = false;
else IsUpNotFound = !UpScript.Exists();
} else { } else {
IsUpNotFound = true; IsUpNotFound = true;
} }