Skip to content

Commit

Permalink
use the current rate mod as the base when adding a chart to a playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 15, 2017
1 parent 5f4ab03 commit 39580f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/SongManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ void Chart::FromKey(const string& ck) {
loaded = true;
songptr = song;
stepsptr = steps;
LOG->Trace(songptr->GetDisplayMainTitle());
return;
}
loaded = false;
Expand Down Expand Up @@ -185,6 +184,16 @@ void Chart::LoadFromNode(const XNode* node) {
FromKey(key);
}

void Playlist::AddChart(const string & ck)
{
float rate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
Chart ch;
ch.FromKey(ck);
ch.rate = rate;
chartlist.emplace_back(ch);
chartrates.emplace_back(rate);
}

XNode* Playlist::CreateNode() const {
XNode* pl = new XNode("Playlist");
pl->AppendAttr("Name", name);
Expand Down
2 changes: 1 addition & 1 deletion src/SongManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct Playlist {
vector<Chart> chartlist;
vector<float> chartrates;
void Add(Chart ch) { chartlist.emplace_back(ch); }
void AddChart(const string& ck) { Chart ch; ch.FromKey(ck); chartlist.emplace_back(ch); chartrates.emplace_back(1.f); }
void AddChart(const string& ck);
void SwapPosition();

void Create();
Expand Down

0 comments on commit 39580f8

Please sign in to comment.