Removed unimportant messages (item messages), some code cleanup.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7664 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-02-09 21:45:30 +00:00
parent fef9084e77
commit 75d757d411
2 changed files with 2 additions and 28 deletions

View File

@ -80,8 +80,6 @@ MinimalRaceGUI::MinimalRaceGUI()
m_map_left = UserConfigParams::m_width - m_map_width;
}
m_speed_meter_icon = material_manager->getMaterial("speedback.png");
m_speed_bar_icon = material_manager->getMaterial("speedfore.png");
m_plunger_face = material_manager->getMaterial("plungerface.png");
m_music_icon = material_manager->getMaterial("notes.png");
createMarkerTexture();
@ -638,29 +636,7 @@ void MinimalRaceGUI::drawAllMessages(const Kart* kart,
int y = viewport.LowerRightCorner.Y - m_small_font_max_height - 10;
const int x = (viewport.LowerRightCorner.X + viewport.UpperLeftCorner.X)/2;
const int w = (viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X);
// draw less important first, at the very bottom of the screen
// unimportant messages are skipped in multiplayer, they take too much screen space
if (race_manager->getNumLocalPlayers() < 2)
{
for (AllMessageType::const_iterator i = m_messages.begin();
i != m_messages.end(); ++i)
{
TimedMessage const &msg = *i;
if (!msg.m_important)
{
// Display only messages for all karts, or messages for this kart
if (msg.m_kart && msg.m_kart!=kart) continue;
core::rect<s32> pos(x - w/2, y, x + w/2, y + m_max_font_height);
GUIEngine::getSmallFont()->draw(
core::stringw(msg.m_message.c_str()).c_str(),
pos, msg.m_color, true /* hcenter */, true /* vcenter */);
y -= m_small_font_max_height;
}
}
}
const int w = (viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X);
// First line of text somewhat under the top of the viewport.
y = (int)(viewport.UpperLeftCorner.Y + 164*scaling.Y);
@ -681,7 +657,7 @@ void MinimalRaceGUI::drawAllMessages(const Kart* kart,
{
TimedMessage const &msg = *i;
// less important messages were already displayed
// less important messages are not displayed in minimal mode
if (!msg.m_important) continue;
// Display only messages for all karts, or messages for this kart

View File

@ -76,8 +76,6 @@ private:
}; // TimedMessage
// ---------------------------------------------------------
Material *m_speed_meter_icon;
Material *m_speed_bar_icon;
Material *m_plunger_face;
typedef std::vector<TimedMessage> AllMessageType;
AllMessageType m_messages;