|
From: Tapio V. <aa...@us...> - 2009-12-11 12:43:39
|
Module: performous
Branch: dance
Commit: b89f9d6634daf6150009e967f00bbf186e7112e0
Author: Markus Raab <un...@ma...>
Date: Mon Nov 30 21:36:07 2009 +0100
Quick hack to show scores in players menu
---
game/database.cc | 2 +-
game/screen_players.cc | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index c53a57d..5b06dda 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -120,7 +120,7 @@ void Database::queryPerSongHiscore (std::ostream & os, boost::shared_ptr<Song> s
void Database::queryPerPlayerHiscore (std::ostream & os, std::string const& track) const {
int playerid = m_players.lookup(m_players.current().name);
- std::vector<HiscoreItem> hi = m_hiscores.queryHiscore(10, playerid, -1, track);
+ std::vector<HiscoreItem> hi = m_hiscores.queryHiscore(3, playerid, -1, track);
for (size_t i=0; i<hi.size(); ++i)
{
os << i+1 << ".\t"
diff --git a/game/screen_players.cc b/game/screen_players.cc
index 8caa6ba..ec4cd2c 100644
--- a/game/screen_players.cc
+++ b/game/screen_players.cc
@@ -102,7 +102,7 @@ void ScreenPlayers::draw() {
std::string music, songbg, video;
double videoGap = 0.0;
std::ostringstream oss_song, oss_order;
- // Test if there are no songs
+ // Test if there are no players currently selected
if (m_players.empty()) {
// Format the song information text
if (m_search.text.empty()) {
@@ -118,8 +118,9 @@ void ScreenPlayers::draw() {
oss_song << m_database.scores.front().track << "\n";
oss_song << "You reached " << m_database.scores.front().score << " points!";
oss_order << "Please enter your Name!\n"
- << "Name: " << m_players.current().name << '\n'
- << "Search Text: "
+ << "Name: " << m_players.current().name << '\n';
+ m_database.queryPerPlayerHiscore(oss_order);
+ oss_order << "\nSearch Text: "
<< (m_search.text.empty() ? std::string("please enter") : m_search.text)
<< '\n';
double spos = m_players.currentPosition(); // This needs to be polled to run the animation
|