fixed EditMenu "Create from Autogen" weirdness
cleaned up some unnecessary header dependencies
This commit is contained in:
@@ -131,10 +131,9 @@ EditMenu::~EditMenu()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditMenu::Refresh()
|
void EditMenu::RefreshNotes()
|
||||||
{
|
{
|
||||||
ChangeToRow( (Row)0 );
|
OnRowValueChanged( ROW_SONG );
|
||||||
OnRowValueChanged( (Row)0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditMenu::DrawPrimitives()
|
void EditMenu::DrawPrimitives()
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public:
|
|||||||
return s[a];
|
return s[a];
|
||||||
}
|
}
|
||||||
|
|
||||||
void Refresh();
|
void RefreshNotes();
|
||||||
|
|
||||||
|
|
||||||
CString GetSelectedGroup() { return m_sGroups[m_iSelection[ROW_GROUP]]; }
|
CString GetSelectedGroup() { return m_sGroups[m_iSelection[ROW_GROUP]]; }
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Notes.h"
|
|
||||||
#include "GameInput.h"
|
#include "GameInput.h"
|
||||||
#include "MenuInput.h"
|
#include "MenuInput.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "SongManager.h"
|
#include "SongManager.h"
|
||||||
|
#include "Notes.h"
|
||||||
#include "NoteSkinManager.h"
|
#include "NoteSkinManager.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#ifndef _GrayArrow_H_
|
||||||
|
#define _GrayArrow_H_
|
||||||
/*
|
/*
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Class: GrayArrow
|
Class: GrayArrow
|
||||||
@@ -11,12 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef _GrayArrow_H_
|
|
||||||
#define _GrayArrow_H_
|
|
||||||
|
|
||||||
|
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "Notes.h"
|
|
||||||
|
|
||||||
class GrayArrow : public Sprite
|
class GrayArrow : public Sprite
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include "GameState.h"
|
#include "GameState.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
#include "Notes.h"
|
||||||
|
|
||||||
|
|
||||||
// WheelItem stuff
|
// WheelItem stuff
|
||||||
|
|||||||
+37
-43
@@ -140,43 +140,6 @@ void Notes::TidyUpData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
|
|
||||||
bool CompareNotesPointersByRadarValues(const Notes* pNotes1, const Notes* pNotes2)
|
|
||||||
{
|
|
||||||
float fScore1 = 0;
|
|
||||||
float fScore2 = 0;
|
|
||||||
|
|
||||||
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ )
|
|
||||||
{
|
|
||||||
fScore1 += pNotes1->GetRadarValues()[r];
|
|
||||||
fScore2 += pNotes2->GetRadarValues()[r];
|
|
||||||
}
|
|
||||||
|
|
||||||
return fScore1 < fScore2;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CompareNotesPointersByMeter(const Notes *pNotes1, const Notes* pNotes2)
|
|
||||||
{
|
|
||||||
return pNotes1->GetMeter() < pNotes2->GetMeter();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CompareNotesPointersByDifficulty(const Notes *pNotes1, const Notes *pNotes2)
|
|
||||||
{
|
|
||||||
return pNotes1->GetDifficulty() < pNotes2->GetDifficulty();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortNotesArrayByDifficulty( vector<Notes*> &arraySteps )
|
|
||||||
{
|
|
||||||
/* Sort in reverse order of priority. */
|
|
||||||
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByRadarValues );
|
|
||||||
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByMeter );
|
|
||||||
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByDifficulty );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Notes::Decompress() const
|
void Notes::Decompress() const
|
||||||
{
|
{
|
||||||
if(notes) return;
|
if(notes) return;
|
||||||
@@ -246,12 +209,6 @@ void Notes::AutogenFrom( Notes *parent_, NotesType ntTo )
|
|||||||
m_NotesType = ntTo;
|
m_NotesType = ntTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notes::BakeAutoGen()
|
|
||||||
{
|
|
||||||
Decompress();
|
|
||||||
parent = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Notes::CopyFrom( Notes* pSource, NotesType ntTo ) // pSource does not have to be of the same NotesType!
|
void Notes::CopyFrom( Notes* pSource, NotesType ntTo ) // pSource does not have to be of the same NotesType!
|
||||||
{
|
{
|
||||||
m_NotesType = ntTo;
|
m_NotesType = ntTo;
|
||||||
@@ -333,3 +290,40 @@ void Notes::AddScore( PlayerNumber pn, Grade grade, float fScore, bool& bNewReco
|
|||||||
m_MemCardScores[MEMORY_CARD_MACHINE].grade = grade;
|
m_MemCardScores[MEMORY_CARD_MACHINE].grade = grade;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Sorting stuff
|
||||||
|
//
|
||||||
|
|
||||||
|
bool CompareNotesPointersByRadarValues(const Notes* pNotes1, const Notes* pNotes2)
|
||||||
|
{
|
||||||
|
float fScore1 = 0;
|
||||||
|
float fScore2 = 0;
|
||||||
|
|
||||||
|
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ )
|
||||||
|
{
|
||||||
|
fScore1 += pNotes1->GetRadarValues()[r];
|
||||||
|
fScore2 += pNotes2->GetRadarValues()[r];
|
||||||
|
}
|
||||||
|
|
||||||
|
return fScore1 < fScore2;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CompareNotesPointersByMeter(const Notes *pNotes1, const Notes* pNotes2)
|
||||||
|
{
|
||||||
|
return pNotes1->GetMeter() < pNotes2->GetMeter();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CompareNotesPointersByDifficulty(const Notes *pNotes1, const Notes *pNotes2)
|
||||||
|
{
|
||||||
|
return pNotes1->GetDifficulty() < pNotes2->GetDifficulty();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SortNotesArrayByDifficulty( vector<Notes*> &arraySteps )
|
||||||
|
{
|
||||||
|
/* Sort in reverse order of priority. */
|
||||||
|
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByRadarValues );
|
||||||
|
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByMeter );
|
||||||
|
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByDifficulty );
|
||||||
|
}
|
||||||
+6
-10
@@ -23,10 +23,14 @@ public:
|
|||||||
Notes();
|
Notes();
|
||||||
~Notes();
|
~Notes();
|
||||||
|
|
||||||
void Decompress() const;
|
// initializers
|
||||||
|
void AutogenFrom( Notes *parent, NotesType ntTo );
|
||||||
|
void CopyFrom( Notes* pSource, NotesType ntTo );
|
||||||
|
void CreateBlank( NotesType ntTo );
|
||||||
|
|
||||||
public:
|
|
||||||
void Compress() const;
|
void Compress() const;
|
||||||
|
void Decompress() const;
|
||||||
|
void DeAutogen(); /* If this Notes is autogenerated, make it a real Notes. */
|
||||||
|
|
||||||
CString GetDescription() const { return Real()->m_sDescription; }
|
CString GetDescription() const { return Real()->m_sDescription; }
|
||||||
Difficulty GetDifficulty() const { return Real()->m_Difficulty; }
|
Difficulty GetDifficulty() const { return Real()->m_Difficulty; }
|
||||||
@@ -46,12 +50,6 @@ public:
|
|||||||
void SetSMNoteData( const CString &out );
|
void SetSMNoteData( const CString &out );
|
||||||
CString GetSMNoteData() const;
|
CString GetSMNoteData() const;
|
||||||
|
|
||||||
// initializers
|
|
||||||
void AutogenFrom( Notes *parent, NotesType ntTo );
|
|
||||||
void BakeAutoGen(); // makes into an AutoGen Notes into a regular Notes
|
|
||||||
void CopyFrom( Notes* pSource, NotesType ntTo );
|
|
||||||
void CreateBlank( NotesType ntTo );
|
|
||||||
|
|
||||||
|
|
||||||
// High scores
|
// High scores
|
||||||
struct MemCardScore
|
struct MemCardScore
|
||||||
@@ -85,8 +83,6 @@ protected:
|
|||||||
int m_iMeter; // difficulty rating from 1-10
|
int m_iMeter; // difficulty rating from 1-10
|
||||||
float m_fRadarValues[NUM_RADAR_CATEGORIES]; // between 0.0-1.2 starting from 12-o'clock rotating clockwise
|
float m_fRadarValues[NUM_RADAR_CATEGORIES]; // between 0.0-1.2 starting from 12-o'clock rotating clockwise
|
||||||
|
|
||||||
/* If this Notes is autogenerated, make it a real Notes. */
|
|
||||||
void DeAutogen();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool CompareNotesPointersByRadarValues(const Notes* pNotes1, const Notes* pNotes2);
|
bool CompareNotesPointersByRadarValues(const Notes* pNotes1, const Notes* pNotes2);
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PrefsManager.h" // for GameplayStatistics
|
#include "PrefsManager.h" // for GameplayStatistics
|
||||||
#include "Notes.h"
|
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "BitmapText.h"
|
#include "BitmapText.h"
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "RageInputDevice.h"
|
|
||||||
#include "ActorFrame.h"
|
#include "ActorFrame.h"
|
||||||
#include "ScreenMessage.h"
|
#include "ScreenMessage.h"
|
||||||
#include "InputFilter.h"
|
#include "InputFilter.h"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#include "SDL_keysym.h" // for SDLKeys
|
#include "SDL_keysym.h" // for SDLKeys
|
||||||
#include "ScreenMiniMenu.h"
|
#include "ScreenMiniMenu.h"
|
||||||
#include "NoteSkinManager.h"
|
#include "NoteSkinManager.h"
|
||||||
|
#include "Notes.h"
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
|
||||||
@@ -104,6 +104,8 @@ MiniMenuDefinition g_KeyboardShortcuts =
|
|||||||
{ "Home/End: jump to first/last beat", false, 1, 0, {""} },
|
{ "Home/End: jump to first/last beat", false, 1, 0, {""} },
|
||||||
{ "Ctrl + Up/Down: Change zoom", false, 1, 0, {""} },
|
{ "Ctrl + Up/Down: Change zoom", false, 1, 0, {""} },
|
||||||
{ "Shift + Up/Down: Drag area marker", false, 1, 0, {""} },
|
{ "Shift + Up/Down: Drag area marker", false, 1, 0, {""} },
|
||||||
|
{ "P: Play selection", false, 1, 0, {""} },
|
||||||
|
{ "Ctrl + P: Play whole song", false, 1, 0, {""} },
|
||||||
{ "F7/F8: Decrease/increase BPM at cur beat", false, 1, 0, {""} },
|
{ "F7/F8: Decrease/increase BPM at cur beat", false, 1, 0, {""} },
|
||||||
{ "F9/F10: Decrease/increase stop at cur beat", false, 1, 0, {""} },
|
{ "F9/F10: Decrease/increase stop at cur beat", false, 1, 0, {""} },
|
||||||
{ "F11/F12: Decrease/increase music offset", false, 1, 0, {""} },
|
{ "F11/F12: Decrease/increase music offset", false, 1, 0, {""} },
|
||||||
@@ -896,6 +898,16 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SDLK_p:
|
||||||
|
{
|
||||||
|
if( INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD,SDLK_LCTRL)) ||
|
||||||
|
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD,SDLK_RCTRL)) )
|
||||||
|
HandleMainMenuChoice( play_whole_song, NULL );
|
||||||
|
else
|
||||||
|
if( m_NoteFieldEdit.m_fBeginMarker!=-1 && m_NoteFieldEdit.m_fEndMarker!=-1 )
|
||||||
|
HandleAreaMenuChoice( play, NULL );
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "GameState.h"
|
#include "GameState.h"
|
||||||
#include "RageSoundManager.h"
|
#include "RageSoundManager.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
#include "Notes.h"
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -93,7 +94,7 @@ void ScreenEditMenu::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
switch( SM )
|
switch( SM )
|
||||||
{
|
{
|
||||||
case SM_RefreshSelector:
|
case SM_RefreshSelector:
|
||||||
m_Selector.Refresh();
|
m_Selector.RefreshNotes();
|
||||||
break;
|
break;
|
||||||
case SM_GoToPrevScreen:
|
case SM_GoToPrevScreen:
|
||||||
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
||||||
@@ -174,8 +175,8 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
|
|||||||
break;
|
break;
|
||||||
case EditMenu::ACTION_DELETE:
|
case EditMenu::ACTION_DELETE:
|
||||||
ASSERT( pNotes );
|
ASSERT( pNotes );
|
||||||
SCREENMAN->Prompt( SM_RefreshSelector, "These notes will be lost permanently.\nContinue with delete?", true, false, DeleteCurNotes );
|
SCREENMAN->Prompt( SM_RefreshSelector, "These notes will be lost permanently.\n\nContinue with delete?", true, false, DeleteCurNotes );
|
||||||
m_Selector.Refresh();
|
m_Selector.RefreshNotes();
|
||||||
return;
|
return;
|
||||||
case EditMenu::ACTION_COPY:
|
case EditMenu::ACTION_COPY:
|
||||||
ASSERT( !pNotes );
|
ASSERT( !pNotes );
|
||||||
@@ -190,7 +191,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
|
|||||||
|
|
||||||
SCREENMAN->SystemMessage( "Notes created from copy." );
|
SCREENMAN->SystemMessage( "Notes created from copy." );
|
||||||
m_soundCreate.PlayRandom();
|
m_soundCreate.PlayRandom();
|
||||||
m_Selector.Refresh();
|
m_Selector.RefreshNotes();
|
||||||
pSong->Save();
|
pSong->Save();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -202,13 +203,13 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
|
|||||||
// Song allocates all of the other Notes.
|
// Song allocates all of the other Notes.
|
||||||
Notes* pNewNotes = new Notes;
|
Notes* pNewNotes = new Notes;
|
||||||
pNewNotes->AutogenFrom( pSourceNotes, nt );
|
pNewNotes->AutogenFrom( pSourceNotes, nt );
|
||||||
pNewNotes->BakeAutoGen();
|
pNewNotes->DeAutogen();
|
||||||
pNewNotes->SetDifficulty( dc );
|
pNewNotes->SetDifficulty( dc ); // override difficulty with the user's choice
|
||||||
pSong->AddNotes( pNewNotes );
|
pSong->AddNotes( pNewNotes );
|
||||||
|
|
||||||
SCREENMAN->SystemMessage( "Notes created from AutoGen." );
|
SCREENMAN->SystemMessage( "Notes created from AutoGen." );
|
||||||
m_soundCreate.PlayRandom();
|
m_soundCreate.PlayRandom();
|
||||||
m_Selector.Refresh();
|
m_Selector.RefreshNotes();
|
||||||
pSong->Save();
|
pSong->Save();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -225,7 +226,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
|
|||||||
|
|
||||||
SCREENMAN->SystemMessage( "Blank Notes created." );
|
SCREENMAN->SystemMessage( "Blank Notes created." );
|
||||||
m_soundCreate.PlayRandom();
|
m_soundCreate.PlayRandom();
|
||||||
m_Selector.Refresh();
|
m_Selector.RefreshNotes();
|
||||||
pSong->Save();
|
pSong->Save();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -11,13 +11,9 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "global.h"
|
|
||||||
|
|
||||||
#include "ScreenEz2SelectMusic.h"
|
#include "ScreenEz2SelectMusic.h"
|
||||||
|
|
||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
#include "SDL_opengl.h"
|
#include "SDL_opengl.h"
|
||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
@@ -29,6 +25,8 @@
|
|||||||
#include "StyleDef.h"
|
#include "StyleDef.h"
|
||||||
#include "InputMapper.h"
|
#include "InputMapper.h"
|
||||||
#include "CodeDetector.h"
|
#include "CodeDetector.h"
|
||||||
|
#include "Notes.h"
|
||||||
|
|
||||||
|
|
||||||
#define SCROLLING_LIST_X THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListX")
|
#define SCROLLING_LIST_X THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListX")
|
||||||
#define SCROLLING_LIST_Y THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListY")
|
#define SCROLLING_LIST_Y THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListY")
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "RageTimer.h"
|
#include "RageTimer.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
|
#include "Screen.h"
|
||||||
|
|
||||||
|
|
||||||
ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our program
|
ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our program
|
||||||
|
|||||||
@@ -13,15 +13,17 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "RageInputDevice.h"
|
#include "RageInputDevice.h"
|
||||||
#include "song.h"
|
|
||||||
#include "Notes.h"
|
|
||||||
#include "Screen.h"
|
|
||||||
#include "BitmapText.h"
|
#include "BitmapText.h"
|
||||||
#include "Quad.h"
|
#include "Quad.h"
|
||||||
|
#include "ScreenMessage.h"
|
||||||
|
#include "InputFilter.h"
|
||||||
|
#include "GameInput.h"
|
||||||
|
#include "MenuInput.h"
|
||||||
|
#include "StyleInput.h"
|
||||||
|
class Screen;
|
||||||
struct MiniMenuDefinition;
|
struct MiniMenuDefinition;
|
||||||
|
|
||||||
|
|
||||||
class ScreenManager
|
class ScreenManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
#include "Notes.h"
|
||||||
|
|
||||||
|
|
||||||
#define BANNER_FRAME_X THEME->GetMetricF("ScreenSelectMusic","BannerFrameX")
|
#define BANNER_FRAME_X THEME->GetMetricF("ScreenSelectMusic","BannerFrameX")
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Notes.h"
|
|
||||||
#include "StyleInput.h"
|
#include "StyleInput.h"
|
||||||
#include "GameInput.h"
|
#include "GameInput.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user