diff --git a/src/Etterna/Actor/Gameplay/NoteField.cpp b/src/Etterna/Actor/Gameplay/NoteField.cpp index e23e005b9d..7903d796fc 100644 --- a/src/Etterna/Actor/Gameplay/NoteField.cpp +++ b/src/Etterna/Actor/Gameplay/NoteField.cpp @@ -256,6 +256,10 @@ NoteField::ensure_note_displays_have_skin() if (sNoteSkinLower.empty()) { sNoteSkinLower = make_lower(CommonMetrics::DEFAULT_NOTESKIN_NAME); } + + // force this to work whether you like it or not + if (!NOTESKIN->DoesNoteSkinExist(sNoteSkinLower)) + sNoteSkinLower = make_lower(NOTESKIN->GetFirstWorkingNoteSkin()); CacheNoteSkin(sNoteSkinLower); } diff --git a/src/Etterna/Actor/Gameplay/NoteFieldPreview.cpp b/src/Etterna/Actor/Gameplay/NoteFieldPreview.cpp index ff0603617c..c736009e65 100644 --- a/src/Etterna/Actor/Gameplay/NoteFieldPreview.cpp +++ b/src/Etterna/Actor/Gameplay/NoteFieldPreview.cpp @@ -16,6 +16,7 @@ #include #include "Etterna/Models/Misc/CommonMetrics.h" +#include "Etterna/Singletons/NoteSkinManager.h" REGISTER_ACTOR_CLASS(NoteFieldPreview); @@ -214,6 +215,10 @@ NoteFieldPreview::ensure_note_displays_have_skin() sNoteSkinLower = make_lower(CommonMetrics::DEFAULT_NOTESKIN_NAME); } + // force this to work whether you like it or not + if (!NOTESKIN->DoesNoteSkinExist(sNoteSkinLower)) + sNoteSkinLower = make_lower(NOTESKIN->GetFirstWorkingNoteSkin()); + CacheNoteSkin(sNoteSkinLower); // if we already have a display loaded with the "correct" number of diff --git a/src/Etterna/Singletons/NoteSkinManager.cpp b/src/Etterna/Singletons/NoteSkinManager.cpp index 786d9f71be..09f88b93cb 100644 --- a/src/Etterna/Singletons/NoteSkinManager.cpp +++ b/src/Etterna/Singletons/NoteSkinManager.cpp @@ -290,6 +290,16 @@ NoteSkinManager::ValidateNoteSkinName(std::string& name) } } +std::string +NoteSkinManager::GetFirstWorkingNoteSkin() +{ + vector all_names; + GetAllNoteSkinNamesForGame(GAMESTATE->m_pCurGame, all_names); + if (all_names.size() > 0) + return all_names[0]; + return ""; +} + void NoteSkinManager::GetAllNoteSkinNamesForGame(const Game* pGame, vector& AddTo) diff --git a/src/Etterna/Singletons/NoteSkinManager.h b/src/Etterna/Singletons/NoteSkinManager.h index ba8cf370f2..0847289ff7 100644 --- a/src/Etterna/Singletons/NoteSkinManager.h +++ b/src/Etterna/Singletons/NoteSkinManager.h @@ -31,6 +31,8 @@ class NoteSkinManager void ValidateNoteSkinName(std::string& name); + auto GetFirstWorkingNoteSkin() -> std::string; + void SetCurrentNoteSkin(const std::string& sNoteSkin) { m_sCurrentNoteSkin = sNoteSkin;