diff --git a/stepmania/NEWS b/stepmania/NEWS index 2b074203fc..b9f293442e 100644 --- a/stepmania/NEWS +++ b/stepmania/NEWS @@ -1,3 +1,15 @@ +------------------------CVS after 3.00 beta 6---------------- +NEW FEATURE: Package Exporter now can export Announcers, BGAnimations, + Courses, NoteSkins, RandomMovies, Themes, and Visualizations. +NEW FEATURE: Package Exporter now has two options: "Export As One", and + "Export As Individual". Export As One will create a package of all + selected items, and Export As Individual will create packages for each + of the selected items. +CHANGE: Renamed "Skins" folder to "NoteSkins" to avoid confusion with DWI + and KIU. +NEW FEATURE: F6 during gameplay to toggle assist tick. +CHANGE: While AutoPlay is ON, life will not change and score/dance points + will not accumulate. NEW FEATURE: Song list can handle any number of groups. BUG FIX: Fix joystick Y axis. NEW FEATURE: Add level 8 judge difficulty. diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 6843396e29..9a3c9f81c6 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -119,13 +119,15 @@ void Background::LoadFromSong( Song* pSong ) m_BackgroundMode = MODE_ANIMATIONS; + const CString sSongBackgroundPath = sSongBackgroundPath; + // // Load the static background that will before notes start and after notes end // BackgroundAnimation* pTempBGA; pTempBGA = new BackgroundAnimation; - pTempBGA->LoadFromStaticGraphic( pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathTo("Graphics","fallback background") ); + pTempBGA->LoadFromStaticGraphic( sSongBackgroundPath ); m_BackgroundAnimations.Add( pTempBGA ); @@ -153,7 +155,7 @@ void Background::LoadFromSong( Song* pSong ) if( asFiles.GetSize() > 0 ) { pTempBGA = new BackgroundAnimation; - pTempBGA->LoadFromMovie( asFiles[0], true, true ); + pTempBGA->LoadFromMovie( asFiles[0], true, true, i==0/*first BGChange*/, sSongBackgroundPath ); m_BackgroundAnimations.Add( pTempBGA ); m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BackgroundAnimations.GetSize()-1) ); // add to the plan @@ -165,7 +167,7 @@ void Background::LoadFromSong( Song* pSong ) if( asFiles.GetSize() > 0 ) { pTempBGA = new BackgroundAnimation; - pTempBGA->LoadFromAniDir( asFiles[0], pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathTo("Graphics","fallback background") ); + pTempBGA->LoadFromAniDir( asFiles[0], sSongBackgroundPath ); m_BackgroundAnimations.Add( pTempBGA ); m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BackgroundAnimations.GetSize()-1) ); // add to the plan @@ -179,7 +181,7 @@ void Background::LoadFromSong( Song* pSong ) if( asFiles.GetSize() > 0 ) { pTempBGA = new BackgroundAnimation; - pTempBGA->LoadFromMovie( asFiles[0], true, false ); + pTempBGA->LoadFromMovie( asFiles[0], true, false, i==0/*first BGChange*/, sSongBackgroundPath ); m_BackgroundAnimations.Add( pTempBGA ); m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BackgroundAnimations.GetSize()-1) ); // add to the plan @@ -191,18 +193,20 @@ void Background::LoadFromSong( Song* pSong ) if( asFiles.GetSize() > 0 ) { pTempBGA = new BackgroundAnimation; - pTempBGA->LoadFromAniDir( asFiles[0], pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathTo("Graphics","fallback background") ); + pTempBGA->LoadFromAniDir( asFiles[0], sSongBackgroundPath ); m_BackgroundAnimations.Add( pTempBGA ); m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BackgroundAnimations.GetSize()-1) ); // add to the plan continue; // stop looking for this background } + + // if we make it here, ignore the background change } // end showing the static song background m_aBGSegments.Add( BGSegment(pSong->m_fLastBeat,0) ); - SortBGSegmentArray( m_aBGSegments ); // Need to sort in case the song has a background change after the last beat + SortBGSegmentArray( m_aBGSegments ); // Need to sort in case there is a background change after the last beat (not likely) } else // pSong doesn't have an animation plan { @@ -230,7 +234,7 @@ void Background::LoadFromSong( Song* pSong ) { int index = rand() % arrayPossibleMovies.GetSize(); pTempBGA = new BackgroundAnimation; - pTempBGA->LoadFromVisualization( arrayPossibleMovies[index], pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathTo("Graphics","fallback background") ); + pTempBGA->LoadFromVisualization( arrayPossibleMovies[index], sSongBackgroundPath ); m_BackgroundAnimations.Add( pTempBGA ); arrayPossibleMovies.RemoveAt( index ); } @@ -244,7 +248,7 @@ void Background::LoadFromSong( Song* pSong ) { int index = rand() % arrayPossibleAnims.GetSize(); pTempBGA = new BackgroundAnimation; - pTempBGA->LoadFromAniDir( arrayPossibleAnims[index], pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathTo("Graphics","fallback background") ); + pTempBGA->LoadFromAniDir( arrayPossibleAnims[index], sSongBackgroundPath ); m_BackgroundAnimations.Add( pTempBGA ); arrayPossibleAnims.RemoveAt( index ); } @@ -260,7 +264,7 @@ void Background::LoadFromSong( Song* pSong ) { int index = rand() % arrayPossibleMovies.GetSize(); pTempBGA = new BackgroundAnimation; - pTempBGA->LoadFromMovie( arrayPossibleMovies[index], true, false ); + pTempBGA->LoadFromMovie( arrayPossibleMovies[index], true, false, false, "" ); m_BackgroundAnimations.Add( pTempBGA ); arrayPossibleMovies.RemoveAt( index ); } diff --git a/stepmania/src/GameDef.cpp b/stepmania/src/GameDef.cpp index 7ac1a0664a..831e30c365 100644 --- a/stepmania/src/GameDef.cpp +++ b/stepmania/src/GameDef.cpp @@ -43,7 +43,7 @@ CString GameDef::ElementToGraphicSuffix( const SkinElement gbg ) const CString GameDef::GetPathToGraphic( const CString sSkinName, const CString sButtonName, const SkinElement gbg ) const { - const CString sSkinDir = ssprintf("Skins\\%s\\%s\\", m_szName, sSkinName); + const CString sSkinDir = ssprintf("NoteSkins\\%s\\%s\\", m_szName, sSkinName); const CString sGraphicSuffix = ElementToGraphicSuffix( gbg ); CStringArray arrayPossibleFileNames; // fill this with the possible files diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 2f78466170..9362bda6d7 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -362,6 +362,10 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary ) max_grade = max( max_grade, grade[p] ); + bool bNewRecord[NUM_PLAYERS]; + for( p=0; p pNotes->m_iTopScore ) { pNotes->m_iTopScore = (int)fScore[p]; - m_bNewRecord[p] = true; + bNewRecord[p] = true; } if( grade[p] > pNotes->m_TopGrade ) @@ -590,7 +594,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary ) } // Chris: If EZ2 wants to hide these things, place them off screen using theme metrics - if( m_bNewRecord[p] ) + if( bNewRecord[p] ) { m_textNewRecord[p].LoadFromFont( THEME->GetPathTo("Fonts","header1") ); m_textNewRecord[p].SetXY( NEW_RECORD_X(p), NEW_RECORD_Y ); diff --git a/stepmania/src/ScreenEvaluation.h b/stepmania/src/ScreenEvaluation.h index 20a7f37076..700886f7f1 100644 --- a/stepmania/src/ScreenEvaluation.h +++ b/stepmania/src/ScreenEvaluation.h @@ -73,7 +73,6 @@ protected: Sprite m_sprScoreLabel; ScoreDisplayNormal m_ScoreDisplay[NUM_PLAYERS]; - bool m_bNewRecord[NUM_PLAYERS]; BitmapText m_textNewRecord[NUM_PLAYERS]; bool m_bTryExtraStage; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index fae75b0c44..32f203d4b4 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -880,7 +880,7 @@ void ScreenGameplay::Update( float fDeltaTime ) // fPositionSeconds ahead if( GAMESTATE->m_SongOptions.m_AssistType == SongOptions::ASSIST_TICK ) { - fPositionSeconds += (SOUND->GetPlayLatency()+0.01f) * m_soundMusic.GetPlaybackRate(); // HACK: Add 0.02 seconds to account for the fact that the sound file has 0.01 seconds of silence at the beginning + fPositionSeconds += (SOUND->GetPlayLatency()+0.015f) * m_soundMusic.GetPlaybackRate(); // HACK: Add 0.015 seconds to account for the fact that the middle of the tick sounds occurs 0.015 seconds into playing. GAMESTATE->m_pCurSong->GetBeatAndBPSFromElapsedTime( fPositionSeconds, fSongBeat, fBPS, bFreeze ); int iRowNow = BeatToNoteRowNotRounded( fSongBeat ); @@ -951,6 +951,18 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ { switch( DeviceI.button ) { + case DIK_F7: + if( GAMESTATE->m_SongOptions.m_AssistType == SongOptions::ASSIST_NONE ) + GAMESTATE->m_SongOptions.m_AssistType = SongOptions::ASSIST_TICK; + else + GAMESTATE->m_SongOptions.m_AssistType = SongOptions::ASSIST_NONE; + m_textDebug.SetText( ssprintf( "Assist tick is %s.", (GAMESTATE->m_SongOptions.m_AssistType==SongOptions::ASSIST_NONE)?"OFF":"ON") ); + m_textDebug.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); + m_textDebug.StopTweening(); + m_textDebug.BeginTweeningQueued( 3 ); // sleep + m_textDebug.BeginTweeningQueued( 0.5f ); // fade out + m_textDebug.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) ); + break; case DIK_F8: PREFSMAN->m_bAutoPlay = !PREFSMAN->m_bAutoPlay; break; diff --git a/stepmania/src/smpackage/resource.h b/stepmania/src/smpackage/resource.h index d1100a07b6..b85d8257c0 100644 --- a/stepmania/src/smpackage/resource.h +++ b/stepmania/src/smpackage/resource.h @@ -9,12 +9,16 @@ #define INSTALL 133 #define MANAGE 135 #define IDC_LIST_SONGS 1000 +#define IDC_LIST 1000 #define IDC_BUTTON_PLAY 1001 #define IDC_BUTTON_EXPORT 1002 +#define IDC_BUTTON_EXPORT_AS_ONE 1002 #define IDC_BUTTON_BACK 1003 +#define IDC_BUTTON_EXPORT_AS_INDIVIDUAL 1003 #define IDC_EDIT_MESSAGE1 1005 #define IDC_EDIT_MESSAGE3 1006 #define IDC_EDIT_MESSAGE2 1007 +#define IDC_TREE1 1008 // Next default values for new objects // @@ -22,7 +26,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 137 #define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1007 +#define _APS_NEXT_CONTROL_VALUE 1009 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/stepmania/src/smpackage/smpackage.clw b/stepmania/src/smpackage/smpackage.clw index 9f78f5fc63..fad2a223a3 100644 --- a/stepmania/src/smpackage/smpackage.clw +++ b/stepmania/src/smpackage/smpackage.clw @@ -13,9 +13,9 @@ Class2=CSmpackageDlg ResourceCount=3 Resource1=IDR_MAINFRAME -Resource2=IDD_INSTALL +Resource2=IDD_MANAGER Class3=CSMPackageInstallDlg -Resource3=IDD_MANAGER +Resource3=IDD_INSTALL [CLS:CSmpackageApp] Type=0 @@ -23,6 +23,8 @@ HeaderFile=smpackage.h ImplementationFile=smpackage.cpp Filter=N LastObject=CSmpackageApp +BaseClass=CWinApp +VirtualFilter=AC [CLS:CSmpackageDlg] Type=0 @@ -38,12 +40,13 @@ VirtualFilter=dWC [DLG:IDD_MANAGER] Type=1 Class=CSmpackageDlg -ControlCount=5 +ControlCount=6 Control1=IDOK,button,1342242817 -Control2=IDC_LIST_SONGS,listbox,1352728835 +Control2=IDC_LIST,listbox,1352728843 Control3=IDC_BUTTON_PLAY,button,1342242816 -Control4=IDC_BUTTON_EXPORT,button,1476460544 +Control4=IDC_BUTTON_EXPORT_AS_ONE,button,1476460544 Control5=IDC_STATIC,static,1342177294 +Control6=IDC_BUTTON_EXPORT_AS_INDIVIDUAL,button,1476460544 [DLG:IDD_INSTALL] Type=1 diff --git a/stepmania/src/smpackage/smpackage.cpp b/stepmania/src/smpackage/smpackage.cpp index 3110467f61..ffb73a8493 100644 --- a/stepmania/src/smpackage/smpackage.cpp +++ b/stepmania/src/smpackage/smpackage.cpp @@ -19,9 +19,7 @@ static char THIS_FILE[] = __FILE__; BEGIN_MESSAGE_MAP(CSmpackageApp, CWinApp) //{{AFX_MSG_MAP(CSmpackageApp) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - //}}AFX_MSG + //}}AFX_MSG_MAP ON_COMMAND(ID_HELP, CWinApp::OnHelp) END_MESSAGE_MAP() diff --git a/stepmania/src/smpackage/smpackage.h b/stepmania/src/smpackage/smpackage.h index fab6370972..f15f4cec93 100644 --- a/stepmania/src/smpackage/smpackage.h +++ b/stepmania/src/smpackage/smpackage.h @@ -34,8 +34,6 @@ public: // Implementation //{{AFX_MSG(CSmpackageApp) - // NOTE - the ClassWizard will add and remove member functions here. - // DO NOT EDIT what you see in these blocks of generated code ! //}}AFX_MSG DECLARE_MESSAGE_MAP() }; diff --git a/stepmania/src/smpackage/smpackage.rc b/stepmania/src/smpackage/smpackage.rc index fa9f3e7a17..88f10867dc 100644 --- a/stepmania/src/smpackage/smpackage.rc +++ b/stepmania/src/smpackage/smpackage.rc @@ -80,12 +80,15 @@ EXSTYLE WS_EX_APPWINDOW CAPTION "Stepmania Package Manager" FONT 8, "MS Sans Serif" BEGIN - DEFPUSHBUTTON "Close",IDOK,260,215,65,14 - LISTBOX IDC_LIST_SONGS,5,45,260,160,LBS_SORT | + DEFPUSHBUTTON "Close",IDOK,259,215,65,14 + LISTBOX IDC_LIST,5,45,247,160,LBS_SORT | LBS_MULTIPLESEL | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Play Stepmania",IDC_BUTTON_PLAY,5,215,70,15 - PUSHBUTTON "Export",IDC_BUTTON_EXPORT,275,75,50,15,WS_DISABLED - CONTROL 135,IDC_STATIC,"Static",SS_BITMAP,0,0,295,30 + PUSHBUTTON "Export As One",IDC_BUTTON_EXPORT_AS_ONE,256,75,68,15, + WS_DISABLED + CONTROL 135,IDC_STATIC,"Static",SS_BITMAP,0,0,332,38 + PUSHBUTTON "Export As Individual",IDC_BUTTON_EXPORT_AS_INDIVIDUAL, + 256,108,68,15,WS_DISABLED END IDD_INSTALL DIALOG DISCARDABLE 0, 0, 332, 234 @@ -163,7 +166,7 @@ BEGIN IDD_MANAGER, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 325 + RIGHTMARGIN, 324 TOPMARGIN, 7 BOTTOMMARGIN, 227 END diff --git a/stepmania/src/smpackage/smpackageDlg.cpp b/stepmania/src/smpackage/smpackageDlg.cpp index da7c032b7a..31a1108fce 100644 --- a/stepmania/src/smpackage/smpackageDlg.cpp +++ b/stepmania/src/smpackage/smpackageDlg.cpp @@ -5,6 +5,7 @@ #include "smpackage.h" #include "smpackageDlg.h" #include "../RageUtil.h" +#include "ZipArchive\ZipArchive.h" #ifdef _DEBUG @@ -30,8 +31,9 @@ void CSmpackageDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CSmpackageDlg) - DDX_Control(pDX, IDC_BUTTON_EXPORT, m_buttonExport); - DDX_Control(pDX, IDC_LIST_SONGS, m_listBoxSongs); + DDX_Control(pDX, IDC_BUTTON_EXPORT_AS_ONE, m_buttonExportAsOne); + DDX_Control(pDX, IDC_BUTTON_EXPORT_AS_INDIVIDUAL, m_buttonExportAsIndividual); + DDX_Control(pDX, IDC_LIST, m_listBox); //}}AFX_DATA_MAP } @@ -39,8 +41,9 @@ BEGIN_MESSAGE_MAP(CSmpackageDlg, CDialog) //{{AFX_MSG_MAP(CSmpackageDlg) ON_WM_PAINT() ON_WM_QUERYDRAGICON() - ON_LBN_SELCHANGE(IDC_LIST_SONGS, OnSelchangeListSongs) - ON_BN_CLICKED(IDC_BUTTON_EXPORT, OnButtonExport) + ON_LBN_SELCHANGE(IDC_LIST, OnSelchangeList) + ON_BN_CLICKED(IDC_BUTTON_EXPORT_AS_ONE, OnButtonExportAsOne) + ON_BN_CLICKED(IDC_BUTTON_EXPORT_AS_INDIVIDUAL, OnButtonExportAsIndividual) ON_BN_CLICKED(IDC_BUTTON_PLAY, OnButtonPlay) //}}AFX_MSG_MAP END_MESSAGE_MAP() @@ -61,22 +64,53 @@ BOOL CSmpackageDlg::OnInitDialog() // TODO: Add extra initialization here // - // Find all song directories - CStringArray arrayGroupDirs; - GetDirListing( "Songs\\*.*", arrayGroupDirs, true ); - - for( int i=0; i', ',', '?', '/' }; for( int i=0; i 0 ) + { + GetDirListing( asDirectoriesToExplore[0] + "\\*.*", asPathToFilesOut, false, true ); + GetDirListing( asDirectoriesToExplore[0] + "\\*.*", asDirectoriesToExplore, true, true ); + asDirectoriesToExplore.RemoveAt( 0 ); + } +} + +bool ExportPackage( CString sPackageName, const CStringArray& asDirectoriesToExport ) +{ + CZipArchive zip; + + const CString sDesktopPath = CString(getenv("USERPROFILE")) + "/Desktop/"; + + // + // Create the package zip file + // + const CString sPackagePath = sDesktopPath + sPackageName; try { - m_zip.Open( sZipFilePath, CZipArchive::zipCreate ); + zip.Open( sPackagePath, CZipArchive::zipCreate ); } catch( CException* e ) { - MessageBox( ssprintf("Error creating zip file '%s'", sDesktopPath), "", MB_OK ); - m_zip.Close(); + AfxMessageBox( ssprintf("Error creating zip file '%s'", sPackagePath) ); + zip.Close(); e->Delete(); - return; + return false; } - CStringArray arrayFiles; + // + // Add files to zip + // + for( int i=0; iDelete(); + return false; + } + } + } + +/* CStringArray arrayFiles; GetDirListing( sSongDir + "\\*.*", arrayFiles ); //m_zip.AddNewFile( sRelPathToSelectedSong, 0, true ); // add the directory @@ -195,7 +259,7 @@ void CSmpackageDlg::OnButtonExport() for( i=0; i 0 ) + sMessage += ssprintf(" The packages %s failed to export.", join(", ",asFailedPackages) ); + AfxMessageBox( sMessage ); +} + void CSmpackageDlg::OnButtonPlay() { diff --git a/stepmania/src/smpackage/smpackageDlg.h b/stepmania/src/smpackage/smpackageDlg.h index 9788b18c44..95e296c372 100644 --- a/stepmania/src/smpackage/smpackageDlg.h +++ b/stepmania/src/smpackage/smpackageDlg.h @@ -12,9 +12,6 @@ // CSmpackageDlg dialog -#include "ZipArchive\ZipArchive.h" - - class CSmpackageDlg : public CDialog { // Construction @@ -24,8 +21,9 @@ public: // Dialog Data //{{AFX_DATA(CSmpackageDlg) enum { IDD = IDD_SMPACKAGE_DIALOG }; - CButton m_buttonExport; - CListBox m_listBoxSongs; + CButton m_buttonExportAsOne; + CButton m_buttonExportAsIndividual; + CListBox m_listBox; //}}AFX_DATA // ClassWizard generated virtual function overrides @@ -37,7 +35,6 @@ public: // Implementation protected: HICON m_hIcon; - CZipArchive m_zip; // Generated message map functions @@ -45,8 +42,9 @@ protected: virtual BOOL OnInitDialog(); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); - afx_msg void OnSelchangeListSongs(); - afx_msg void OnButtonExport(); + afx_msg void OnSelchangeList(); + afx_msg void OnButtonExportAsOne(); + afx_msg void OnButtonExportAsIndividual(); afx_msg void OnButtonPlay(); //}}AFX_MSG DECLARE_MESSAGE_MAP()