Merge /AdditionalSongs into /Songs, and /AdditionalCourses into /Courses

Includes a backwards-compatibility mechanism to adapt paths when loading
Stats.xml.
This commit is contained in:
Martin Natano
2022-02-19 22:07:36 +01:00
parent 92ce8c6801
commit 0861ed45c7
24 changed files with 38 additions and 131 deletions
+5 -5
View File
@@ -5655,10 +5655,10 @@ local args = {
Returns the extra stage info (Song, Steps) for the specified Style <code>s</code>. If <code>b2ndExtra</code> is true, it will use the second Extra Stage data instead of the first.
</Function>
<Function name='GetNumAdditionalCourses' return='int' arguments=''>
Returns the number of courses loaded via Additional folders.
[Deprecated] Always returns <code>0</code>
</Function>
<Function name='GetNumAdditionalSongs' return='int' arguments=''>
Returns the number of songs loaded via Additional folders.
[Deprecated] Always returns <code>0</code>
</Function>
<Function name='GetNumCourseGroups' return='int' arguments=''>
Returns the number of course groups.
@@ -5733,10 +5733,10 @@ local args = {
Returns the preferred sort section name for the specified Song.
</Function>
<Function name='WasLoadedFromAdditionalCourses' return='bool' arguments='Course c'>
Returns <code>true</code> if the specified course was loaded from AdditionalCourses.
[Deprecated] Always returns <code>false</code>
</Function>
<Function name='WasLoadedFromAdditionalSongs' return='bool' arguments='Song s'>
Returns <code>true</code> if the specified song was loaded from AdditionalSongs.
[Deprecated] Always returns <code>false</code>
</Function>
</Class>
<Class name='SongOptions'>
@@ -6129,7 +6129,7 @@ local spr = Def.Sprite{
Returns <code>true</code> if this style locks the difficulty for both players.
</Function>
<Function name='NeedsZoomOutWith2Players' return='bool' arguments=''>
Deprecated. Always returns false.
[Deprecated] Always returns <code>false</code>.
</Function>
</Class>
<Class name='TapNote'>
-2
View File
@@ -414,7 +414,6 @@ Fail=Fail
FailOffForFirstStageEasy=If enabled, the first stage will be considered Fail Off on Easy.
FailOffInBeginner=If enabled, beginner will always be considered Fail Off.
FastLoad=If enabled, don't check songs for changes on load.
FastLoadAdditionalSongs=If enabled, don't check songs for changes to Additional Songs on load.
FastNoteRendering=If enabled, the z buffer is not cleared after every note. This causes 3d noteskins to collide, but substantially improves performance in gameplay.
Fill Machine Stats=
Game=Ändere den momentanen Spieltyp mit dieser Option.
@@ -1073,7 +1072,6 @@ Exit=Verlassen
Fail=Fehlschlag
Fakes=Fälschungen
FastLoad=Fast\nLoad
FastLoadAdditionalSongs=Fast Load\nAdditional Songs
File1 Global BGAnimation=File1 Global BGAnimation
File1 Global Movie=File1 Global Movie
File1 Global Movie (Group + Genre)=File1 Global Movie (Group + Genre)
-2
View File
@@ -421,7 +421,6 @@ Fail=Fail
FailOffForFirstStageEasy=If enabled, the first stage will be considered Fail Off on Easy.
FailOffInBeginner=If enabled, beginner will always be considered Fail Off.
FastLoad=If enabled, don't check songs for changes on load.
FastLoadAdditionalSongs=If enabled, don't check songs for changes to Additional Songs on load.
FastNoteRendering=If enabled, the z buffer is not cleared after every note. This causes 3d noteskins to collide, but substantially improves performance in gameplay.
Fill Machine Stats=
Game=Change the current game type with this option.
@@ -1101,7 +1100,6 @@ Exit=Exit
Fail=Fail
Fakes=Fakes
FastLoad=Fast\nLoad
FastLoadAdditionalSongs=Fast Load\nAdditional Songs
File1 Global BGAnimation=File1 Global BGAnimation
File1 Global Movie=File1 Global Movie
File1 Global Movie (Group + Genre)=File1 Global Movie (Group + Genre)
-2
View File
@@ -542,7 +542,6 @@ Disqualification=Si se apaga, los jugadores no se descalifican de la puntuación
EditRecordModeLeadIn=Ajusta el tiempo de entrada antes de iniciar una grabación.
FailOffForFirstStageEasy=Si se activa, la primera fase desactiva la pantalla de Fallo en Fácil.
FailOffInBeginner=Si se activa, el modo principiante siempre desactiva la pantalla de Fallo.
FastLoadAdditionalSongs=Si se activa, las canciones adicionales no se comprobarán al inicio.
FastNoteRendering=Si se activa, el búfer Z no se libera tras cada flecha. De esta forma, los diseños 3D colisionan, pero mejora el rendimiento del juego.
InputDebounceTime=Tiempo que necesita el panel para pulsarse. Utilízalo para tratar los pasos falsos que ocurren poco después de un paso real.
Invalid=Definición de fila no válida.
@@ -1259,7 +1258,6 @@ Disqualification=Descalificación
EditRecordModeLeadIn=Entrada récord
FailOffForFirstStageEasy=Fallo desactivado en fase 1 fácil
FailOffInBeginner=Fallo apagado principiante
FastLoadAdditionalSongs=Carga rápida\nCanciones adicionales
FastNoteRendering=Renderizado rápido
InputDebounceTime=Tiempo interruptor
Invalid=Inválido
-2
View File
@@ -411,7 +411,6 @@ Fail=Perdre
FailOffForFirstStageEasy=Si activé, le premier stage en mode Facile ne pourra pas être Échoué.
FailOffInBeginner=Si activé, les chansons en mode Débutant ne vont pas échouer.
FastLoad=Si activé, ne va pas vérifier pendant le chargement si les chansons ont changé.
FastLoadAdditionalSongs=Si activé, les changements de chansons dans Additional Songs ne seront pas vérifiées lors du chargement.
FastNoteRendering=If enabled, the z buffer is not cleared after every note. This causes 3d noteskins to collide, but substantially improves performance in gameplay.
Fill Machine Stats=
Game=Change the current game type with this option.
@@ -1198,7 +1197,6 @@ Edit time signature=Edit time signature
EffectsReceptor=Effets de Cible
EffectsArrow=Effets des Flèches
Entry %d=Entrée %d
FastLoadAdditionalSongs=Charge Rapide\n des Chansons Additionnelles
File1 Global BGAnimation=File1 Global BGAnimation
File1 Global Movie=File1 Global Movie
File1 Global Movie (Group + Genre)=File1 Global Movie (Group + Genre)
-2
View File
@@ -571,7 +571,6 @@ CourseSortOrder=ミュージックホイールでのコースの並び順を設
CreateNew=
Create New Course=新しいコースを作成します。
Fail=Fail
FastLoadAdditionalSongs=Onにすると、起動時にAdditional Songsフォルダとして\n指定したフォルダのチェックを簡略化します。
Fill Machine Stats=
Game=ゲームタイプを変更します。
Insert Credit=Insert Credit(s)
@@ -1145,7 +1144,6 @@ Exit=Exit
Fail=Fail
Fakes=Fakes
FastLoad=Fast\nLoad
FastLoadAdditionalSongs=Fast Load\nAdditional Songs
File1 Global BGAnimation=File1 Global BGAnimation
File1 Global Movie=File1 Global Movie
File1 Global Movie (Group + Genre)=File1 Global Movie (Group + Genre)
-2
View File
@@ -413,7 +413,6 @@ Fail=Faal
FailOffForFirstStageEasy=Als dit aan staat kan er niet gefaald worden in de eerste etappe, als op Makkelijk wordt gespeeld.
FailOffInBeginner=Als dit aan staat kan er niet gefaald worden op Beginner.
FastLoad=Als dit aan staat worden nummers niet op wijzigingen gecontroleerd.
FastLoadAdditionalSongs=Als dit aan staat wordt er niet gecontroleerd op veranderingen aan 'Additional Songs' nummers bij het laden.
FastNoteRendering=Als dit aan staat wordt de z-buffer niet geleegd na elke noot. Dit zorgt voor collisies bij 3d noteskins, maar verbeterd de game-prestaties aanzienlijk.
Fill Machine Stats=
Game=Verander het huidige speltype met deze optie.
@@ -1051,7 +1050,6 @@ FailOffForFirstStageEasy=Falen Uit Eerste Easy
FailOffInBeginner=Falen Uit Beginner
Fakes=Nep-noten
FastLoad=Snel\nLaden
FastLoadAdditionalSongs=Snel Laden\nAdditional Songs
FastNoteRendering=Snelle noot-rendering
File1 Global BGAnimation=Bestand1 Globale BGAnimatie
File1 Global Movie (Group + Genre)=Bestand1 Globale Film (Groep + Genre)
-2
View File
@@ -409,7 +409,6 @@ Fail=Porażka
FailOffForFirstStageEasy=Jeśli opcja jest włączona, w pierwszym etapie będą rozpatrywane Fail Off na Łatwym.
FailOffInBeginner=Jeśli opcja jest włączona, początkujący będą zawsze rozważane Fail Off.
FastLoad=Włączona opcja spowoduje przyśpieszenie wczytywania piosenek podczas startu programu, po przez pominięcie sprawdzania ew. zmian w plikach piosenki. Należy na to zwrócić uwagę w trakcie tworzenia nowych piosenek.
FastLoadAdditionalSongs=Włączona opcja spowoduje przyśpieszenie wczytywania piosenek z dodatkowych folderów podczas startu programu, po przez pominięcie sprawdzania ew. zmian w plikach piosenki. Należy na to zwrócić uwagę w trakcie tworzenia nowych piosenek.
FastNoteRendering=Jeśli opcja jest włączona, bufor nie jest czyszczony po każdej nucie. Powoduje to zderzanie 3d noteskins, ale znacznie poprawia wydajność w rozgrywce.
Fill Machine Stats=
Game=Zmiana aktualnego trybu gry.
@@ -1049,7 +1048,6 @@ FailOffForFirstStageEasy=Pierwszy Fail Wył. na Łatwym
FailOffInBeginner=Fail Wył. dla Początkujących
Fakes=Podróby
FastLoad=Szybkie\nŁadowanie
FastLoadAdditionalSongs=Szybkie Ładowanie\nDodatkowych Piosenek
FastNoteRendering=Rendering Szybkich Wskazówek
File1 Global BGAnimation=Globalne Animacje Tła Plik1
File1 Global Movie=Globalny Film Plik1
-2
View File
@@ -416,7 +416,6 @@ Fail=Fail
FailOffForFirstStageEasy=Ak je zapnuté, prvá úroveň na obtiažnosti Ľahká bude mať deaktivované faily.
FailOffInBeginner=Ak je zapnuté, začiatočník bude mať vždy deaktivované faily.
FastLoad=Ak je zapnuté, pri nahrávaní nebudú sledované zmeny v skladbách.
FastLoadAdditionalSongs=Ak je zapnuté, pri nahrávaní nebudú sledované zmeny v dodatočných skladbách.
FastNoteRendering=Ak je zapnuté, z-buffer nebude po každej note vyčistený. To spôsobí kolíziu nôt s 3D vzhľadom, ale výrazne zvýši výkon počas hry.
Fill Machine Stats=
Game=Pomocou tejto voľby zmeníte aktuálny typ hry.
@@ -1079,7 +1078,6 @@ Exit=Ukončiť
Fail=Fail
Fakes=Klamy
FastLoad=Rýchle\nnahrávanie
FastLoadAdditionalSongs=Rýchle nahrávanie\npre dodatočné skladby
File1 Global BGAnimation=Globálna animácia pozadia Súbor1
File1 Global Movie=Globálne video Súbor1
File1 Global Movie (Group + Genre)=Globálne video Súbor1 (Skupina + Žáner)
-2
View File
@@ -416,7 +416,6 @@ Fail=當你失敗時的系統行為設定.
FailOffForFirstStageEasy=是否允許第一關簡單難度關卡不失敗.
FailOffInBeginner=是否允許初心者難度關卡不失敗.
FastLoad=是否不進行檢查歌曲變動直接進行讀取歌曲.
FastLoadAdditionalSongs=是否不進行檢查追加歌曲變動直接進行讀取歌曲.
FastNoteRendering=若開啟,每一個箭頭的透視Z緩衝將不會清除,這會導致3D箭頭樣式發生不正常顯示,但大幅提高了遊戲性能.
Fill Machine Stats=
Game=改變目前的遊戲類型.
@@ -1076,7 +1075,6 @@ Exit=離開
Fail=失敗方式
Fakes=假箭頭
FastLoad=快速讀取
FastLoadAdditionalSongs=快速讀取\n追加歌曲
File1 Global BGAnimation=檔案1歌曲泛用BGA
File1 Global Movie=檔案1歌曲泛用動畫
File1 Global Movie (Group + Genre)=檔案1歌曲泛用動畫 (專輯 + 類型)
+3 -6
View File
@@ -70,11 +70,8 @@ Branch = {
end
end,
StartGame = function()
-- Check to see if there are 0 songs installed. Also make sure to check
-- that the additional song count is also 0, because there is
-- a possibility someone will use their existing StepMania simfile
-- collection with sm-ssc via AdditionalFolders/AdditionalSongFolders.
if SONGMAN:GetNumSongs() == 0 and SONGMAN:GetNumAdditionalSongs() == 0 then
-- Check to see if there are 0 songs installed.
if SONGMAN:GetNumSongs() == 0 then
return "ScreenHowToInstallSongs"
end
if PROFILEMAN:GetNumLocalProfiles() >= 2 then
@@ -93,7 +90,7 @@ Branch = {
end,
OptionsEdit = function()
-- Similar to above, don't let anyone in here with 0 songs.
if SONGMAN:GetNumSongs() == 0 and SONGMAN:GetNumAdditionalSongs() == 0 then
if SONGMAN:GetNumSongs() == 0 then
return "ScreenHowToInstallSongs"
end
return "ScreenOptionsEdit"
-3
View File
@@ -154,8 +154,6 @@ UnlockColor=color("1,0.5,0,1")
# Unlock harder/different steps based on passing easier steps.
AutoLockChallengeSteps=false
AutoLockEditSteps=false
# determine if songs loaded via AdditionalSongs should be locked.
SongsNotAdditional=true
UnlockNames=""
# useful commands:
@@ -3167,7 +3165,6 @@ Line16="conf,UseUnlockSystem"
Line28="conf,AutogenSteps"
Line29="conf,AutogenGroupCourses"
Line30="conf,FastLoad"
Line31="conf,FastLoadAdditionalSongs"
Line32="conf,AllowSongDeletion"
LineECPT="conf,EditClearPromptThreshold"
@@ -23,13 +23,11 @@ t[#t+1] = StandardDecorationFromFileOptional("SystemDirection","SystemDirection"
t[#t+1] = StandardDecorationFromFileOptional("NumSongs","NumSongs") .. {
SetCommand=function(self)
local InstalledSongs, AdditionalSongs, InstalledCourses, AdditionalCourses, Groups, Unlocked = 0;
local InstalledSongs, InstalledCourses, Groups, Unlocked = 0;
if SONGMAN:GetRandomSong() then
InstalledSongs, AdditionalSongs, InstalledCourses, AdditionalCourses, Groups, Unlocked =
InstalledSongs, InstalledCourses, Groups, Unlocked =
SONGMAN:GetNumSongs(),
SONGMAN:GetNumAdditionalSongs(),
SONGMAN:GetNumCourses(),
SONGMAN:GetNumAdditionalCourses(),
SONGMAN:GetNumSongGroups(),
SONGMAN:GetNumUnlockedSongs();
else
@@ -37,7 +35,6 @@ t[#t+1] = StandardDecorationFromFileOptional("NumSongs","NumSongs") .. {
end
self:settextf(THEME:GetString("ScreenTitleMenu","%i Songs (%i Groups), %i Courses"), InstalledSongs, Groups, InstalledCourses);
-- self:settextf("%i (+%i) Songs (%i Groups), %i (+%i) Courses", InstalledSongs, AdditionalSongs, Groups, InstalledCourses, AdditionalCourses);
end;
};
@@ -1,6 +1,6 @@
Branch.OptionsEdit = function()
if SONGMAN:GetNumSongs() == 0 and SONGMAN:GetNumAdditionalSongs() == 0 then
if SONGMAN:GetNumSongs() == 0 then
return "ScreenHowToInstallSongs"
end
return "ScreenEditMenu"
end
end
@@ -13,13 +13,11 @@ t[#t+1] = StandardDecorationFromFileOptional("SystemDirection","SystemDirection"
t[#t+1] = StandardDecorationFromFileOptional("NumSongs","NumSongs") .. {
SetCommand=function(self)
local InstalledSongs, AdditionalSongs, InstalledCourses, AdditionalCourses, Groups, Unlocked = 0;
local InstalledSongs, InstalledCourses, Groups, Unlocked = 0;
if SONGMAN:GetRandomSong() then
InstalledSongs, AdditionalSongs, InstalledCourses, AdditionalCourses, Groups, Unlocked =
InstalledSongs, InstalledCourses, Groups, Unlocked =
SONGMAN:GetNumSongs(),
SONGMAN:GetNumAdditionalSongs(),
SONGMAN:GetNumCourses(),
SONGMAN:GetNumAdditionalCourses(),
SONGMAN:GetNumSongGroups(),
SONGMAN:GetNumUnlockedSongs();
else
@@ -27,7 +25,6 @@ t[#t+1] = StandardDecorationFromFileOptional("NumSongs","NumSongs") .. {
end
self:settextf(THEME:GetString("ScreenTitleMenu","%i Songs (%i Groups), %i Courses"), InstalledSongs, Groups, InstalledCourses);
-- self:settextf("%i (+%i) Songs (%i Groups), %i (+%i) Courses", InstalledSongs, AdditionalSongs, Groups, InstalledCourses, AdditionalCourses);
end;
};
+4
View File
@@ -593,6 +593,10 @@ void CourseID::LoadFromNode( const XNode* pNode )
if( !pNode->GetAttrValue("Path", sPath) )
pNode->GetAttrValue( "FullTitle", sFullTitle );
m_Cache.Unset();
// HACK for backwards compatibility: /AdditionalCourses has been merged into /Courses
if (sPath.Left(18) == "AdditionalCourses/")
sPath.replace(0, 18, "Courses/");
}
RString CourseID::ToString() const
-1
View File
@@ -182,7 +182,6 @@ PrefsManager::PrefsManager() :
m_bDelayedModelDelete ( "DelayedModelDelete", false ),
m_ImageCache ( "ImageCache", IMGCACHE_LOW_RES_PRELOAD ),
m_bFastLoad ( "FastLoad", true ),
m_bFastLoadAdditionalSongs ( "FastLoadAdditionalSongs", true ),
m_NeverCacheList ( "NeverCacheList", ""),
m_bOnlyDedicatedMenuButtons ( "OnlyDedicatedMenuButtons", false ),
-1
View File
@@ -174,7 +174,6 @@ public:
Preference<bool> m_bDelayedModelDelete;
Preference<ImageCacheMode> m_ImageCache;
Preference<bool> m_bFastLoad;
Preference<bool> m_bFastLoadAdditionalSongs;
Preference<RString> m_NeverCacheList;
Preference<bool> m_bOnlyDedicatedMenuButtons;
-1
View File
@@ -780,7 +780,6 @@ static void InitializeConfOptions()
ADD( ConfOption( "AutogenGroupCourses", MovePref<bool>, "Off","On" ) );
ADD( ConfOption( "FastLoad", MovePref<bool>, "Off","On" ) );
ADD( ConfOption( "FastLoadAdditionalSongs", MovePref<bool>, "Off","On" ) );
{
ConfOption c("EditRecordModeLeadIn", EditRecordModeLeadIn);
for(int i= 0; i < 32; ++i)
+14 -70
View File
@@ -39,12 +39,9 @@
SongManager* SONGMAN = nullptr; // global and accessible from anywhere in our program
const RString ADDITIONAL_SONGS_DIR = "/AdditionalSongs/";
const RString ADDITIONAL_COURSES_DIR = "/AdditionalCourses/";
const RString EDIT_SUBDIR = "Edits/";
/** @brief The file that contains various random attacks. */
const RString ATTACK_FILE = "/Data/RandomAttacks.txt";
const RString EDIT_SUBDIR = "Edits/";
static const ThemeMetric<RageColor> EXTRA_COLOR ( "SongManager", "ExtraColor" );
static const ThemeMetric<int> EXTRA_COLOR_METER ( "SongManager", "ExtraColorMeter" );
@@ -116,9 +113,7 @@ static LocalizedString SANITY_CHECKING_GROUPS("SongManager", "Sanity checking gr
void SongManager::Reload( bool bAllowFastLoad, LoadingWindow *ld )
{
FILEMAN->FlushDirCache( SpecialFiles::SONGS_DIR );
FILEMAN->FlushDirCache( ADDITIONAL_SONGS_DIR );
FILEMAN->FlushDirCache( SpecialFiles::COURSES_DIR );
FILEMAN->FlushDirCache( ADDITIONAL_COURSES_DIR );
FILEMAN->FlushDirCache( EDIT_SUBDIR );
if( ld )
@@ -161,11 +156,6 @@ void SongManager::InitSongsFromDisk( LoadingWindow *ld )
SONGINDEX->delay_save_cache = true;
IMAGECACHE->delay_save_cache = true;
LoadStepManiaSongDir( SpecialFiles::SONGS_DIR, ld );
const bool bOldVal = PREFSMAN->m_bFastLoad;
PREFSMAN->m_bFastLoad.Set( PREFSMAN->m_bFastLoadAdditionalSongs );
LoadStepManiaSongDir( ADDITIONAL_SONGS_DIR, ld );
PREFSMAN->m_bFastLoad.Set( bOldVal );
LoadEnabledSongsFromPref();
SONGINDEX->SaveCacheIndex();
SONGINDEX->delay_save_cache= false;
@@ -799,11 +789,6 @@ int SongManager::GetNumSelectableAndUnlockedSongs() const
return std::count_if(m_pSongs.begin(), m_pSongs.end(), [](Song const *s) { return UNLOCKMAN->SongIsLocked(s) & ~(LOCKED_LOCK | LOCKED_SELECTABLE); });
}
int SongManager::GetNumAdditionalSongs() const
{
return std::count_if(m_pSongs.begin(), m_pSongs.end(), [&](Song const *s) { return WasLoadedFromAdditionalSongs(s); });
}
int SongManager::GetNumSongGroups() const
{
return m_sSongGroupNames.size();
@@ -814,11 +799,6 @@ int SongManager::GetNumCourses() const
return m_pCourses.size();
}
int SongManager::GetNumAdditionalCourses() const
{
return std::count_if(m_pCourses.begin(), m_pCourses.end(), [&](Course const *c) { return WasLoadedFromAdditionalCourses(c); });
}
int SongManager::GetNumCourseGroups() const
{
return m_mapCourseGroupToInfo.size();
@@ -841,18 +821,11 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld )
RageTimer loading_window_last_update_time;
loading_window_last_update_time.Touch();
vector<RString> vsCourseDirs;
vsCourseDirs.push_back( SpecialFiles::COURSES_DIR );
vsCourseDirs.push_back( ADDITIONAL_COURSES_DIR );
vector<RString> vsCourseGroupNames;
for (RString const &sDir : vsCourseDirs)
{
// Find all group directories in Courses dir
GetDirListing( sDir + "*", vsCourseGroupNames, true, true );
StripCvsAndSvn( vsCourseGroupNames );
StripMacResourceForks( vsCourseGroupNames );
}
// Find all group directories in Courses dir
GetDirListing( SpecialFiles::COURSES_DIR + "*", vsCourseGroupNames, true, true );
StripCvsAndSvn( vsCourseGroupNames );
StripMacResourceForks( vsCourseGroupNames );
// Search for courses both in COURSES_DIR and in subdirectories
vsCourseGroupNames.push_back( SpecialFiles::COURSES_DIR );
@@ -1185,18 +1158,6 @@ void SongManager::DeleteSteps( Steps *pSteps )
pSteps->m_pSong->DeleteSteps( pSteps );
}
bool SongManager::WasLoadedFromAdditionalSongs( const Song *pSong ) const
{
RString sDir = pSong->GetSongDir();
return BeginsWith( sDir, ADDITIONAL_SONGS_DIR );
}
bool SongManager::WasLoadedFromAdditionalCourses( const Course *pCourse ) const
{
RString sDir = pCourse->m_sPath;
return BeginsWith( sDir, ADDITIONAL_COURSES_DIR );
}
void SongManager::GetAllCourses( vector<Course*> &AddTo, bool bIncludeAutogen ) const
{
for( unsigned i=0; i<m_pCourses.size(); i++ )
@@ -1225,14 +1186,6 @@ bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredG
const RString sCourseSuffix = sPreferredGroup + (bExtra2 ? "/extra2.crs" : "/extra1.crs");
RString sCoursePath = SpecialFiles::SONGS_DIR + sCourseSuffix;
// Couldn't find course in DWI path or alternative song folders
if( !DoesFileExist(sCoursePath) )
{
sCoursePath = ADDITIONAL_SONGS_DIR + sCourseSuffix;
if( !DoesFileExist(sCoursePath) )
return false;
}
Course course;
CourseLoaderCRS::LoadFromCRSFile( sCoursePath, course );
if( course.GetEstimatedNumStages() <= 0 ) return false;
@@ -2022,11 +1975,12 @@ public:
static int GetNumLockedSongs( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumLockedSongs() ); return 1; }
static int GetNumUnlockedSongs( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumUnlockedSongs() ); return 1; }
static int GetNumSelectableAndUnlockedSongs( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumSelectableAndUnlockedSongs() ); return 1; }
static int GetNumAdditionalSongs( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumAdditionalSongs() ); return 1; }
static int GetNumAdditionalSongs( T* p, lua_State *L ) { lua_pushnumber( L, 0 ); return 1; } // deprecated
static int GetNumSongGroups( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumSongGroups() ); return 1; }
static int GetNumCourses( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumCourses() ); return 1; }
static int GetNumAdditionalCourses( T* p, lua_State *L ){ lua_pushnumber( L, p->GetNumAdditionalCourses() ); return 1; }
static int GetNumAdditionalCourses( T* p, lua_State *L ){ lua_pushnumber( L, 0 ); return 1; } // deprecated
static int GetNumCourseGroups( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumCourseGroups() ); return 1; }
/* Note: this could now be implemented as Luna<Steps>::GetSong */
static int GetSongFromSteps( T* p, lua_State *L )
{
@@ -2129,18 +2083,8 @@ public:
lua_pushstring(L, p->SongToPreferredSortSectionName(pSong));
return 1;
}
static int WasLoadedFromAdditionalSongs( T* p, lua_State *L )
{
const Song* pSong = Luna<Song>::check(L,1);
lua_pushboolean(L, p->WasLoadedFromAdditionalSongs(pSong));
return 1;
}
static int WasLoadedFromAdditionalCourses( T* p, lua_State *L )
{
const Course* pCourse = Luna<Course>::check(L,1);
lua_pushboolean(L, p->WasLoadedFromAdditionalCourses(pCourse));
return 1;
}
static int WasLoadedFromAdditionalSongs( T* p, lua_State *L ) { lua_pushboolean(L, false); return 1; } // deprecated
static int WasLoadedFromAdditionalCourses( T* p, lua_State *L ) { lua_pushboolean(L, false); return 1; } // deprecated
LunaSongManager()
{
@@ -2155,10 +2099,10 @@ public:
ADD_METHOD( GetNumLockedSongs );
ADD_METHOD( GetNumUnlockedSongs );
ADD_METHOD( GetNumSelectableAndUnlockedSongs );
ADD_METHOD( GetNumAdditionalSongs );
ADD_METHOD( GetNumAdditionalSongs ); // deprecated
ADD_METHOD( GetNumSongGroups );
ADD_METHOD( GetNumCourses );
ADD_METHOD( GetNumAdditionalCourses );
ADD_METHOD( GetNumAdditionalCourses ); // deprecated
ADD_METHOD( GetNumCourseGroups );
ADD_METHOD( GetSongFromSteps );
ADD_METHOD( GetExtraStageInfo );
@@ -2181,8 +2125,8 @@ public:
ADD_METHOD( GetPopularSongs );
ADD_METHOD( GetPopularCourses );
ADD_METHOD( SongToPreferredSortSectionName );
ADD_METHOD( WasLoadedFromAdditionalSongs );
ADD_METHOD( WasLoadedFromAdditionalCourses );
ADD_METHOD( WasLoadedFromAdditionalSongs ); // deprecated
ADD_METHOD( WasLoadedFromAdditionalCourses ); // deprecated
}
};
-4
View File
@@ -132,13 +132,11 @@ public:
int GetNumLockedSongs() const;
int GetNumUnlockedSongs() const;
int GetNumSelectableAndUnlockedSongs() const;
int GetNumAdditionalSongs() const;
int GetNumSongGroups() const;
/**
* @brief Retrieve the number of courses in the game.
* @return the number of courses. */
int GetNumCourses() const;
int GetNumAdditionalCourses() const;
int GetNumCourseGroups() const;
Song* GetRandomSong();
Course* GetRandomCourse();
@@ -148,8 +146,6 @@ public:
void GetStepsLoadedFromProfile( vector<Steps*> &AddTo, ProfileSlot slot ) const;
void DeleteSteps( Steps *pSteps ); // transfers ownership of pSteps
bool WasLoadedFromAdditionalSongs( const Song *pSong ) const;
bool WasLoadedFromAdditionalCourses( const Course *pCourse ) const;
void GetAllCourses( vector<Course*> &AddTo, bool bIncludeAutogen ) const;
void GetCourses( CourseType ct, vector<Course*> &AddTo, bool bIncludeAutogen ) const;
+4
View File
@@ -1147,6 +1147,10 @@ void SongID::LoadFromNode( const XNode* pNode )
ASSERT( pNode->GetName() == "Song" );
pNode->GetAttrValue("Dir", sDir);
m_Cache.Unset();
// HACK for backwards compatibility: /AdditionalSongs has been merged into /Songs
if (sDir.Left(16) == "AdditionalSongs/")
sDir.replace(0, 16, "Songs/");
}
RString SongID::ToString() const
+2 -2
View File
@@ -1034,14 +1034,14 @@ int sm_main(int argc, char* argv[])
vector<RString> dirs;
split( PREFSMAN->m_sAdditionalSongFolders, ",", dirs, true );
for( unsigned i=0; i < dirs.size(); i++)
FILEMAN->Mount( "dir", dirs[i], "/AdditionalSongs" );
FILEMAN->Mount( "dir", dirs[i], "/Songs" );
}
if( PREFSMAN->m_sAdditionalCourseFolders.Get() != "" )
{
vector<RString> dirs;
split( PREFSMAN->m_sAdditionalCourseFolders, ",", dirs, true );
for( unsigned i=0; i < dirs.size(); i++)
FILEMAN->Mount( "dir", dirs[i], "/AdditionalCourses" );
FILEMAN->Mount( "dir", dirs[i], "/Courses" );
}
MountTreeOfZips( SpecialFiles::PACKAGES_DIR );
-8
View File
@@ -25,7 +25,6 @@ UnlockManager* UNLOCKMAN = nullptr; // global and accessible from anywhere in ou
static ThemeMetric<bool> AUTO_LOCK_CHALLENGE_STEPS( "UnlockManager", "AutoLockChallengeSteps" );
static ThemeMetric<bool> AUTO_LOCK_EDIT_STEPS( "UnlockManager", "AutoLockEditSteps" );
static ThemeMetric<bool> SONGS_NOT_ADDITIONAL( "UnlockManager", "SongsNotAdditional" );
static const char *UnlockRequirementNames[] =
{
@@ -522,9 +521,6 @@ void UnlockManager::Load()
if( SongUtil::GetOneSteps(s, StepsType_Invalid, Difficulty_Challenge) == nullptr )
continue;
if( SONGS_NOT_ADDITIONAL && SONGMAN->WasLoadedFromAdditionalSongs(s) )
continue;
UnlockEntry ue;
ue.m_sEntryID = "_challenge_" + s->GetSongDir();
ue.m_Type = UnlockRewardType_Steps;
@@ -547,10 +543,6 @@ void UnlockManager::Load()
if (SongUtil::GetOneSteps(s, StepsType_Invalid, Difficulty_Edit) == nullptr)
continue;
// don't add additional songs.
if (SONGS_NOT_ADDITIONAL && SONGMAN->WasLoadedFromAdditionalSongs(s))
continue;
UnlockEntry ue;
ue.m_sEntryID = "_edit_" + s->GetSongDir();
ue.m_Type = UnlockRewardType_Steps;