Fix #166: minimal race gui shows item messages.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8782 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-05-30 06:58:33 +00:00
parent 13c166eae5
commit 430c86a020
3 changed files with 15 additions and 2 deletions

View File

@ -53,6 +53,9 @@ MinimalRaceGUI::MinimalRaceGUI()
{ {
m_enabled = true; m_enabled = true;
// Ignore item messages.
ignoreUnimportantMessages();
// Originally m_map_height was 100, and we take 480 as minimum res // Originally m_map_height was 100, and we take 480 as minimum res
const float scaling = irr_driver->getFrameSize().Height / 480.0f; const float scaling = irr_driver->getFrameSize().Height / 480.0f;
// Marker texture has to be power-of-two for (old) OpenGL compliance // Marker texture has to be power-of-two for (old) OpenGL compliance

View File

@ -46,6 +46,7 @@
RaceGUIBase::RaceGUIBase() RaceGUIBase::RaceGUIBase()
{ {
m_ignore_unimportant_messages = false;
m_lightning = 0.0f; m_lightning = 0.0f;
m_max_font_height = GUIEngine::getFontHeight() + 10; m_max_font_height = GUIEngine::getFontHeight() + 10;
m_small_font_max_height = GUIEngine::getSmallFontHeight() + 5; m_small_font_max_height = GUIEngine::getSmallFontHeight() + 5;
@ -204,9 +205,10 @@ void RaceGUIBase::drawAllMessages(const Kart* kart,
const int x = (viewport.LowerRightCorner.X + viewport.UpperLeftCorner.X)/2; const int x = (viewport.LowerRightCorner.X + viewport.UpperLeftCorner.X)/2;
const int w = (viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X); const int w = (viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X);
// draw less important first, at the very bottom of the screen // Draw less important messages first, at the very bottom of the screen
// unimportant messages are skipped in multiplayer, they take too much screen space // unimportant messages are skipped in multiplayer, they take too much screen space
if (race_manager->getNumLocalPlayers() < 2) if (race_manager->getNumLocalPlayers() < 2 &&
!m_ignore_unimportant_messages)
{ {
for (AllMessageType::const_iterator i = m_messages.begin(); for (AllMessageType::const_iterator i = m_messages.begin();
i != m_messages.end(); ++i) i != m_messages.end(); ++i)

View File

@ -68,6 +68,10 @@ private:
/** Delight in seconds between lightnings. */ /** Delight in seconds between lightnings. */
float m_lightning; float m_lightning;
/** True if unimportant messags (like item messages) should not
* be displayed. */
bool m_ignore_unimportant_messages;
class TimedMessage class TimedMessage
{ {
public: public:
@ -147,6 +151,10 @@ protected:
void drawGlobalMusicDescription(); void drawGlobalMusicDescription();
void drawGlobalReadySetGo (); void drawGlobalReadySetGo ();
/** Instructs the base gui to ignore unimportant messages (like
* item messages).
*/
void ignoreUnimportantMessages() { m_ignore_unimportant_messages = true; }
public: public:
bool m_enabled; bool m_enabled;