diff --git a/src/guiengine/skin.hpp b/src/guiengine/skin.hpp index 73b9ddd07..5fe623aa2 100644 --- a/src/guiengine/skin.hpp +++ b/src/guiengine/skin.hpp @@ -242,11 +242,13 @@ namespace GUIEngine irr::video::ITexture* bg_image; - +#ifdef USE_PER_LINE_BACKGROUND + public: +#endif void drawBoxFromStretchableTexture(SkinWidgetContainer* w, const irr::core::rect< irr::s32 > &dest, BoxRenderParams& params, bool deactivated=false, const irr::core::rect* clipRect=NULL); - + private: // my utility methods, to work around irrlicht's very Windows-95-like-look-enforcing skin system void process3DPane(irr::gui::IGUIElement *element, const irr::core::rect< irr::s32 > &rect, const bool pressed); void drawButton(Widget* w, const irr::core::rect< irr::s32 > &rect, const bool pressed, const bool focused); diff --git a/src/states_screens/race_result_gui.cpp b/src/states_screens/race_result_gui.cpp index 5745ffea6..c29b64c0c 100644 --- a/src/states_screens/race_result_gui.cpp +++ b/src/states_screens/race_result_gui.cpp @@ -23,6 +23,7 @@ #include "guiengine/engine.hpp" #include "guiengine/scalable_font.hpp" #include "guiengine/widget.hpp" +#include "io/file_manager.hpp" #include "modes/world_with_rank.hpp" #include "states_screens/dialogs/race_over_dialog.hpp" #include "states_screens/main_menu_screen.hpp" @@ -293,8 +294,8 @@ void RaceResultGUI::determineTableLayout() m_time_for_points = 1.0f; // Determine text height - r = m_font->getDimension(L"Y"); - m_distance_between_rows = (int)(1.5f*r.Height); + r = m_font->getDimension(L"Y"); + m_distance_between_rows = (int)(1.5f*r.Height); // If there are too many karts, reduce size between rows if(m_distance_between_rows * num_karts > height) @@ -314,18 +315,18 @@ void RaceResultGUI::determineTableLayout() core::dimension2du r_all_p = m_font->getDimension(L"999"); unsigned int width_all_points = r_all_p.Width; - unsigned int table_width = m_width_icon + m_width_column_space - + m_width_kart_name; + m_table_width = m_width_icon + m_width_column_space + + m_width_kart_name; if(race_manager->getMinorMode()!=RaceManager::MINOR_MODE_FOLLOW_LEADER) - table_width += m_width_finish_time + m_width_column_space; + m_table_width += m_width_finish_time + m_width_column_space; // Only in GP mode are the points displayed. if (race_manager->getMajorMode()==RaceManager::MAJOR_MODE_GRAND_PRIX) - table_width += m_width_new_points + width_all_points - + 2 * m_width_column_space; + m_table_width += m_width_new_points + width_all_points + + 2 * m_width_column_space; - m_leftmost_column = table_area->m_x + (table_area->m_w - table_width)/2; + m_leftmost_column = table_area->m_x + (table_area->m_w - m_table_width)/2; } // determineTableLayout //----------------------------------------------------------------------------- @@ -583,6 +584,16 @@ void RaceResultGUI::displayOneEntry(unsigned int x, unsigned int y, video::SColor color = ri->m_is_player_kart ? video::SColor(255,255,0, 0 ) : video::SColor(255,255,255,255); +#ifdef USE_PER_LINE_BACKGROUND + // Draw the background image + core::rect dest(x-50, y, + x+50+m_table_width, + (int)(y+m_distance_between_rows)); + ri->m_box_params.setTexture(irr_driver->getTexture( (file_manager->getGUIDir() + "skins/glass/glassbutton_focused.png").c_str() ) ); + GUIEngine::getSkin()->drawBoxFromStretchableTexture(&(ri->m_widget_container), + dest, + ri->m_box_params); +#endif unsigned int current_x = x; // First draw the icon diff --git a/src/states_screens/race_result_gui.hpp b/src/states_screens/race_result_gui.hpp index a19849763..8385f63a0 100644 --- a/src/states_screens/race_result_gui.hpp +++ b/src/states_screens/race_result_gui.hpp @@ -95,6 +95,12 @@ private: video::ITexture *m_kart_icon; /** The times of all karts in the right order. */ core::stringw m_finish_time_string; +#ifdef USE_PER_LINE_BACKGROUND + /** For the background bar behind each line. */ + GUIEngine::SkinWidgetContainer m_widget_container; + /** The parameter for rendering the background box. */ + GUIEngine::BoxRenderParams m_box_params; +#endif }; // Rowinfo std::vector m_all_row_infos; @@ -140,6 +146,9 @@ private: /** Size of space between columns. */ unsigned int m_width_column_space; + + /** The overall width of the table. */ + unsigned int m_table_width; /** The font to use. */ gui::ScalableFont *m_font;