Skip to content

Commit

Permalink
add full pack reload shortcut for reloading wip packs and such
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Nov 1, 2018
1 parent 8939993 commit aa94450
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ScreenSelectMusic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,13 @@ ScreenSelectMusic::Input(const InputEventPlus& input)
AfterMusicChange();
return true;
}
} else if (holding_shift && bHoldingCtrl && c == 'P' &&
m_MusicWheel.IsSettled()) {
SONGMAN->ForceReloadSongGroup(
GetMusicWheel()->GetSelectedSection());
AfterMusicChange();
SCREENMAN->SystemMessage("Current pack reloaded");
return true;
} else if (bHoldingCtrl && c == 'F' && m_MusicWheel.IsSettled() &&
input.type == IET_FIRST_PRESS) {
// Favorite the currently selected song. -Not Kyz
Expand Down
13 changes: 13 additions & 0 deletions src/SongManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,19 @@ SongManager::GetSongs(const RString& sGroupName) const
return iter->second;
return vEmpty;
}
void
SongManager::ForceReloadSongGroup(const RString& sGroupName) const {
auto songs = GetSongs(sGroupName);
for (auto s : songs) {
auto stepses = s->GetAllSteps();
vector<string> oldChartkeys;
for (auto steps : stepses)
oldChartkeys.emplace_back(steps->GetChartKey());

s->ReloadFromSongDir();
SONGMAN->ReconcileChartKeysForReloadedSong(s, oldChartkeys);
}
}

void
SongManager::GetFavoriteSongs(vector<Song*>& songs) const
Expand Down
1 change: 1 addition & 0 deletions src/SongManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class SongManager
* @param sGroupName the name of the group.
* @return the songs that belong in the group. */
const vector<Song*>& GetSongs(const RString& sGroupName) const;
void ForceReloadSongGroup(const RString& sGroupName) const;
/**
* @brief Retrieve all of the songs in the game.
* @return all of the songs. */
Expand Down

0 comments on commit aa94450

Please sign in to comment.