|
From: Tapio V. <aa...@us...> - 2010-01-09 15:57:25
|
Module: performous
Branch: master
Commit: d70acb792311050e91ed339154c01b1f80602e22
Author: Tapio Vierros <tap...@gm...>
Date: Sat Jan 9 17:56:14 2010 +0200
Append " (kbd)" to end of dance/drum tracks played with keyboard.
---
game/dancegraph.cc | 6 +++++-
game/guitargraph.cc | 6 +++++-
game/joystick.hh | 2 +-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 0d005ec..0ad5e25 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -130,7 +130,11 @@ bool DanceGraph::dead() const {
}
/// Get the difficulty as displayable string
-std::string DanceGraph::getDifficultyString() const { return diffv[m_level]; }
+std::string DanceGraph::getDifficultyString() const {
+ std::string ret = diffv[m_level];
+ if (m_input.isKeyboard()) ret += " (kbd)";
+ return ret;
+}
/// Attempt to change the difficulty by a step
void DanceGraph::difficultyDelta(int delta) {
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 25d5e6d..9805489 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -432,7 +432,11 @@ void GuitarGraph::nextTrack() {
}
/// Get the difficulty as displayable string
-std::string GuitarGraph::getDifficultyString() const { return diffv[m_level].name; }
+std::string GuitarGraph::getDifficultyString() const {
+ std::string ret = diffv[m_level].name;
+ if (m_drums && m_input.isKeyboard()) ret += " (kbd)";
+ return ret;
+}
/// Find an initial difficulty level to use
void GuitarGraph::difficultyAuto(bool tryKeep) {
diff --git a/game/joystick.hh b/game/joystick.hh
index e178a74..a7ddb7f 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -147,7 +147,7 @@ namespace input {
bool tryPoll(Event& _e) {return input::Private::devices.find(m_device_id)->second.tryPoll(_e);};
void addEvent(Event _e) {input::Private::devices.find(m_device_id)->second.addEvent(_e);};
bool pressed(int _button) {return input::Private::devices.find(m_device_id)->second.pressed(_button);}; // Current state
- bool isKeyboard() {return (m_device_id == input::Private::KEYBOARD_ID || m_device_id == input::Private::KEYBOARD_ID2 || m_device_id == input::Private::KEYBOARD_ID3);};
+ bool isKeyboard() const {return (m_device_id == input::Private::KEYBOARD_ID || m_device_id == input::Private::KEYBOARD_ID2 || m_device_id == input::Private::KEYBOARD_ID3);};
private:
unsigned int m_device_id; // should be some kind of reference
};
|