From: <hik...@us...> - 2010-07-21 01:09:18
|
Revision: 5701 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5701&view=rev Author: hikerstk Date: 2010-07-21 01:09:12 +0000 (Wed, 21 Jul 2010) Log Message: ----------- Disabled new (and unfinished) race result gui again, which was accidentally enabled in previous commit. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-07-21 00:01:22 UTC (rev 5700) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-07-21 01:09:12 UTC (rev 5701) @@ -29,7 +29,7 @@ */ RaceResultGUI::RaceResultGUI() { -#define USE_NEW_RACE_RESULT +#undef USE_NEW_RACE_RESULT #ifndef USE_NEW_RACE_RESULT // FIXME: for now disable the new race result display This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-07-30 00:11:34
|
Revision: 5711 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5711&view=rev Author: hikerstk Date: 2010-07-30 00:11:28 +0000 (Fri, 30 Jul 2010) Log Message: ----------- Fixed crash in case that a kart does not have an icon. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-07-29 23:03:20 UTC (rev 5710) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-07-30 00:11:28 UTC (rev 5711) @@ -342,10 +342,15 @@ // First draw the icon // ------------------- - core::recti source_rect(core::vector2di(0,0), m_kart_icons[n]->getSize()); - core::recti dest_rect(x, y, x+m_width_icon, y+m_width_icon); - irr_driver->getVideoDriver()->draw2DImage(m_kart_icons[n], dest_rect, - source_rect, NULL, NULL, true); + if(m_kart_icons[n]) + { + core::recti source_rect(core::vector2di(0,0), + m_kart_icons[n]->getSize()); + core::recti dest_rect(x, y, x+m_width_icon, y+m_width_icon); + irr_driver->getVideoDriver()->draw2DImage(m_kart_icons[n], dest_rect, + source_rect, NULL, NULL, + true); + } // Draw the name // ------------- core::recti pos_name(x+m_width_icon+m_width_column_space, y, @@ -359,7 +364,7 @@ + m_width_kart_name + m_width_column_space; bool mono = m_font->getMonospaceDigits(); - dest_rect = core::recti(x_time, y, x_time+100, y+10); + core::recti dest_rect = core::recti(x_time, y, x_time+100, y+10); m_font->draw(m_finish_time_string[n], dest_rect, color); m_font->setMonospaceDigits(mono); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-07-30 00:31:58
|
Revision: 5712 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5712&view=rev Author: hikerstk Date: 2010-07-30 00:31:52 +0000 (Fri, 30 Jul 2010) Log Message: ----------- Changed direction in which the GP entries are resorted: karts going up towards the top will be moving to the left side, karts going down to the right side. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-07-30 00:11:28 UTC (rev 5711) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-07-30 00:31:52 UTC (rev 5712) @@ -265,7 +265,7 @@ m_current_displayed_points[i] = (float)m_new_overall_points[i]; break; case RR_RESORT_TABLE: - x = m_x_pos[i] +m_radius[i]*sin(m_timer/m_time_rotation*M_PI); + x = m_x_pos[i] -m_radius[i]*sin(m_timer/m_time_rotation*M_PI); y = m_centre_point[i]+m_radius[i]*cos(m_timer/m_time_rotation*M_PI); break; case RR_WAIT_TILL_END: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-08-24 23:33:36
|
Revision: 5771 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5771&view=rev Author: hikerstk Date: 2010-08-24 23:33:30 +0000 (Tue, 24 Aug 2010) Log Message: ----------- Bugfix (stupid windows caseless file system). Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-08-24 23:19:14 UTC (rev 5770) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-08-24 23:33:30 UTC (rev 5771) @@ -26,7 +26,7 @@ #include "modes/world.hpp" #include "states_screens/dialogs/race_over_dialog.hpp" #include "states_screens/main_menu_screen.hpp" -#include "states_screens/race_setup_Screen.hpp" +#include "states_screens/race_setup_screen.hpp" #include "utils/string_utils.hpp" DEFINE_SCREEN_SINGLETON( RaceResultGUI ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-08-24 23:35:49
|
Revision: 5772 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5772&view=rev Author: hikerstk Date: 2010-08-24 23:35:43 +0000 (Tue, 24 Aug 2010) Log Message: ----------- Removed compiler warnings. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-08-24 23:33:30 UTC (rev 5771) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-08-24 23:35:43 UTC (rev 5772) @@ -66,8 +66,6 @@ m_timer = 0; - GUIEngine::Widget *div_widget = getWidget("div"); - getWidget("top")->setVisible(false); getWidget("middle")->setVisible(false); getWidget("bottom")->setVisible(false); @@ -220,7 +218,7 @@ } else { - fprintf(stderr, "Incorrect event '%s' for normal race '%s'.\n", + fprintf(stderr, "Incorrect event '%s' for normal race.\n", name.c_str()); } } // eventCallback @@ -445,6 +443,7 @@ switch(m_animation_state) { // Both states use the same scrolling: + case RR_INIT: break; // Remove compiler warning case RR_RACE_RESULT: case RR_OLD_GP_RESULTS: if(m_timer > ri->m_start_at) @@ -528,7 +527,6 @@ void RaceResultGUI::displayOneEntry(unsigned int x, unsigned int y, unsigned int n, bool display_points) { - World *world = World::getWorld(); RowInfo *ri = &(m_all_row_infos[n]); video::SColor color = ri->m_is_player_kart ? video::SColor(255,255,0, 0 ) : video::SColor(255,255,255,255); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-08-25 00:58:51
|
Revision: 5774 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5774&view=rev Author: hikerstk Date: 2010-08-25 00:58:45 +0000 (Wed, 25 Aug 2010) Log Message: ----------- Fixed comment, and removed debug code to test unlocking. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-08-25 00:28:58 UTC (rev 5773) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-08-25 00:58:45 UTC (rev 5774) @@ -54,9 +54,9 @@ } // loadedFromFile //----------------------------------------------------------------------------- -/** Besides calling init in the base class this removes all buttons from the - * screen. The buttons will only displayed once the animation is over. The - * order in which these buttons +/** Besides calling init in the base class this makes all buttons of this + * screen invisible. The buttons will only displayed once the animation is + * over. */ void RaceResultGUI::init() { @@ -147,9 +147,7 @@ unlock_manager->getRecentlyUnlockedFeatures(); unlock_manager->clearUnlocked(); FeatureUnlockedCutScene* scene = FeatureUnlockedCutScene::getInstance(); - scene->addUnlockedKart( const_cast<KartProperties*>(kart_properties_manager->getKart("tux")), - L"Unlocked"); - //scene->addUnlockedThings(unlocked); + scene->addUnlockedThings(unlocked); StateManager::get()->popMenu(); StateManager::get()->pushScreen(scene); World::deleteWorld(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-08-29 23:18:03
|
Revision: 5816 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5816&view=rev Author: hikerstk Date: 2010-08-29 23:17:56 +0000 (Sun, 29 Aug 2010) Log Message: ----------- As default the top button is now set to have to focus when the race result buttons are being displayed. This avoids the problem that a player might accidentally trigger 'abort GP' when pressing 'fire' repeatedly to skip animations. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-08-29 23:13:28 UTC (rev 5815) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-08-29 23:17:56 UTC (rev 5816) @@ -73,60 +73,51 @@ */ void RaceResultGUI::enableAllButtons() { + GUIEngine::Widget *top = getWidget("top"); + GUIEngine::Widget *middle = getWidget("middle"); + GUIEngine::Widget *bottom = getWidget("bottom"); + // If something was unlocked // ------------------------- int n = unlock_manager->getRecentlyUnlockedFeatures().size(); if(n>0) { - GUIEngine::Widget *top = getWidget("top"); top->setText(n==1 ? _("See unlocked feature") : _("See unlocked features")); top->setVisible(true); - return; } else if (race_manager->getMajorMode() == RaceManager::MAJOR_MODE_GRAND_PRIX) { - // In case of a GP: - // ---------------- - GUIEngine::Widget *top = getWidget("top"); + // In case of a GP: + // ---------------- top->setText( _("Continue") ); top->setVisible(true); - GUIEngine::Widget *middle = getWidget("middle"); middle->setText( _("Restart") ); middle->setVisible(true); - GUIEngine::Widget *bottom = getWidget("bottom"); bottom->setText( _("Abort Grand Prix") ); bottom->setVisible(true); - return; } else { // Normal race // ----------- - GUIEngine::Widget *top = getWidget("top"); top->setText( _("Setup New Race") ); top->setVisible(true); - GUIEngine::Widget *middle = getWidget("middle"); middle->setText( _("Restart") ); middle->setVisible(true); - GUIEngine::Widget *bottom = getWidget("bottom"); bottom->setText( _("Back to the menu") ); bottom->setVisible(true); } - // FIXME: what happens if e.g. the 'abort' button has the focus (e.g. - // because the mouse cursors was at exactly that spot before it was - // hidden)? So if someone presses repeatedly 'fire', this might select - // the abort button here. Is this good enough to prevent this? - // Or should we have a way of setting the players focus (e.g. to - // the 'top' bottom, which should be the default)? The code below - // actually appears not to do anything(?) + // Make sure that when 'fire' is pressed accidentally (e.g. pressing fire + // very often to skip all results) that a good default is chosen (to + // avoid aborting a GP by accident). for(unsigned int i=0; i<MAX_PLAYER_COUNT; i++) - GUIEngine::focusNothingForPlayer(i); + top->setFocusForPlayer(i); } // enableAllButtons @@ -162,24 +153,19 @@ // ----------------- if (race_manager->getMajorMode() == RaceManager::MAJOR_MODE_GRAND_PRIX) { - if(name=="top") // Next GP + StateManager::get()->popMenu(); + if(name=="top") // Next GP { - StateManager::get()->popMenu(); race_manager->next(); - return; } else if (name=="middle") // Restart { - StateManager::get()->popMenu(); race_manager->rerunRace(); - return; } - else if (name=="bottom") // Abort + else if (name=="bottom") // Abort { - StateManager::get()->popMenu(); race_manager->exitRace(); StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance()); - return; } else { @@ -187,38 +173,35 @@ name.c_str()); assert(false); } + return; } // This is a normal race, nothing was unlocked // ------------------------------------------- - if(name=="top") // Setup new race + StateManager::get()->popMenu(); + if(name=="top") // Setup new race { - StateManager::get()->popMenu(); race_manager->exitRace(); Screen* newStack[] = {MainMenuScreen::getInstance(), RaceSetupScreen::getInstance(), NULL}; StateManager::get()->resetAndSetStack( newStack ); - return; } else if (name=="middle") // Restart { - StateManager::get()->popMenu(); race_manager->rerunRace(); - return; } - else if (name=="bottom") // Back to main + else if (name=="bottom") // Back to main { - StateManager::get()->popMenu(); race_manager->exitRace(); StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance()); - return; } else { fprintf(stderr, "Incorrect event '%s' for normal race.\n", name.c_str()); } + return; } // eventCallback //----------------------------------------------------------------------------- @@ -324,7 +307,7 @@ m_width_new_points = r_new_p.Width; // Determine width of overall points column - core::dimension2du r_all_p = m_font->getDimension(L"9999"); + 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_kart_name @@ -609,12 +592,9 @@ unsigned int x_time = x + m_width_icon + m_width_column_space + m_width_kart_name + m_width_column_space; - bool mono = m_font->getMonospaceDigits(); core::recti dest_rect = core::recti(x_time, y, x_time+100, y+10); m_font->draw(ri->m_finish_time_string, dest_rect, color); - m_font->setMonospaceDigits(mono); - // Only display points in GP mode and when the GP results are displayed. // ===================================================================== if(race_manager->getMajorMode()!=RaceManager::MAJOR_MODE_GRAND_PRIX || @@ -631,7 +611,7 @@ { core::stringw point_string = core::stringw("+") + core::stringw((int)ri->m_new_points); - // With mono-space digits space has the same width as each character, so + // With mono-space digits space has the same width as each digit, so // we can simply fill up the string with spaces to get the right aligned. while(point_string.size()<3) point_string = core::stringw(" ")+point_string; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-02 22:35:23
|
Revision: 5873 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5873&view=rev Author: hikerstk Date: 2010-09-02 22:35:16 +0000 (Thu, 02 Sep 2010) Log Message: ----------- Fixed problem with result screen in follow the leader moder. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-09-02 16:41:10 UTC (rev 5872) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-09-02 22:35:16 UTC (rev 5873) @@ -257,6 +257,9 @@ m_width_kart_name = rect.Width; } // for i < order.size() + // Make sure the empty rows (due to deleted karts) are not used anymore + m_all_row_infos.resize(num_karts); + std::string max_time = StringUtils::timeToString(max_finish_time); core::stringw string_max_time(max_time.c_str()); core::dimension2du r = m_font->getDimension(string_max_time.c_str()); @@ -385,7 +388,7 @@ m_timer += dt; World *world = World::getWorld(); assert(world->getPhase()==WorldStatus::RESULT_DISPLAY_PHASE); - unsigned int num_karts = world->getNumKarts(); + unsigned int num_karts = m_all_row_infos.size(); // First: Update the finite state machine // ====================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-06 11:11:44
|
Revision: 5902 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5902&view=rev Author: hikerstk Date: 2010-09-06 11:11:38 +0000 (Mon, 06 Sep 2010) Log Message: ----------- Fixed skipping of the first result table (see bug 3059531). Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-09-06 11:07:41 UTC (rev 5901) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-09-06 11:11:38 UTC (rev 5902) @@ -408,6 +408,13 @@ case RR_RACE_RESULT: if(m_timer > m_time_overall_scroll) { + // Make sure that all lines are aligned to the left + // (in case that the animation was skipped). + for(unsigned int i=0; i<num_karts; i++) + { + RowInfo *ri = &(m_all_row_infos[i]); + ri->m_x_pos = (float)m_leftmost_column; + } if(race_manager->getMajorMode()!=RaceManager::MAJOR_MODE_GRAND_PRIX) { m_animation_state = RR_WAIT_TILL_END; @@ -510,7 +517,7 @@ break; } // switch displayOneEntry((unsigned int)x, (unsigned int)y, i, true); - } + } // for i } // renderGlobal //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-09-06 17:01:12
|
Revision: 5904 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5904&view=rev Author: auria Date: 2010-09-06 17:01:06 +0000 (Mon, 06 Sep 2010) Log Message: ----------- Fixed warning Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-09-06 16:59:00 UTC (rev 5903) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-09-06 17:01:06 UTC (rev 5904) @@ -116,7 +116,7 @@ // Make sure that when 'fire' is pressed accidentally (e.g. pressing fire // very often to skip all results) that a good default is chosen (to // avoid aborting a GP by accident). - for(unsigned int i=0; i<MAX_PLAYER_COUNT; i++) + for(int i=0; i<MAX_PLAYER_COUNT; i++) top->setFocusForPlayer(i); } // enableAllButtons This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-07 23:05:37
|
Revision: 5915 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5915&view=rev Author: hikerstk Date: 2010-09-07 23:05:31 +0000 (Tue, 07 Sep 2010) Log Message: ----------- Improved race-result screen not to show the times in FTL mode. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-09-07 18:04:22 UTC (rev 5914) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-09-07 23:05:31 UTC (rev 5915) @@ -314,9 +314,12 @@ 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_kart_name - + m_width_finish_time + 2*m_width_column_space; + unsigned int 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; + // 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 @@ -580,32 +583,37 @@ video::SColor color = ri->m_is_player_kart ? video::SColor(255,255,0, 0 ) : video::SColor(255,255,255,255); + unsigned int current_x = x; + // First draw the icon // ------------------- if(ri->m_kart_icon) { core::recti source_rect(core::vector2di(0,0), ri->m_kart_icon->getSize()); - core::recti dest_rect(x, y, x+m_width_icon, y+m_width_icon); + core::recti dest_rect(current_x, y, + current_x+m_width_icon, y+m_width_icon); irr_driver->getVideoDriver()->draw2DImage(ri->m_kart_icon, dest_rect, source_rect, NULL, NULL, true); + current_x += m_width_icon + m_width_column_space; } // Draw the name // ------------- - core::recti pos_name(x+m_width_icon+m_width_column_space, y, + core::recti pos_name(current_x, y, UserConfigParams::m_width, y+m_distance_between_rows); - m_font->draw(ri->m_kart_name, pos_name, color); + current_x += m_width_kart_name + m_width_column_space; - // Draw the time - // ------------- - unsigned int x_time = x + m_width_icon + m_width_column_space - + m_width_kart_name + m_width_column_space; + // Draw the time except in FTL mode + // -------------------------------- + if(race_manager->getMinorMode()!=RaceManager::MINOR_MODE_FOLLOW_LEADER) + { + core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10); + m_font->draw(ri->m_finish_time_string, dest_rect, color); + current_x += m_width_finish_time + m_width_column_space; + } - core::recti dest_rect = core::recti(x_time, y, x_time+100, y+10); - m_font->draw(ri->m_finish_time_string, dest_rect, color); - // Only display points in GP mode and when the GP results are displayed. // ===================================================================== if(race_manager->getMajorMode()!=RaceManager::MAJOR_MODE_GRAND_PRIX || @@ -614,28 +622,23 @@ // Draw the new points // ------------------- - unsigned int x_point = x + m_width_icon + m_width_column_space - + m_width_kart_name + m_width_column_space - + m_width_finish_time + m_width_column_space; - dest_rect = core::recti(x_point, y, x_point+100, y+10); if(ri->m_new_points>0) { + core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10); core::stringw point_string = core::stringw("+") + core::stringw((int)ri->m_new_points); // With mono-space digits space has the same width as each digit, so - // we can simply fill up the string with spaces to get the right aligned. + // we can simply fill up the string with spaces to get the right + // aligned. while(point_string.size()<3) point_string = core::stringw(" ")+point_string; m_font->draw(point_string, dest_rect, color); } + current_x += m_width_new_points +m_width_column_space; // Draw the old_points plus increase value // --------------------------------------- - unsigned int x_point_inc = x + m_width_icon + m_width_column_space - + m_width_kart_name + m_width_column_space - + m_width_finish_time + m_width_column_space - + m_width_new_points +m_width_column_space; - dest_rect = core::recti(x_point_inc, y, x_point_inc+100, y+10); + core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10); core::stringw point_inc_string = core::stringw((int)(ri->m_current_displayed_points)); while(point_inc_string.size()<3) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-11-20 12:15:20
|
Revision: 6662 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6662&view=rev Author: hikerstk Date: 2010-11-20 12:15:13 +0000 (Sat, 20 Nov 2010) Log Message: ----------- Fixed compiler warning. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-11-20 11:55:08 UTC (rev 6661) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-11-20 12:15:13 UTC (rev 6662) @@ -391,8 +391,7 @@ void RaceResultGUI::renderGlobal(float dt) { m_timer += dt; - World *world = World::getWorld(); - assert(world->getPhase()==WorldStatus::RESULT_DISPLAY_PHASE); + assert(World::getWorld()->getPhase()==WorldStatus::RESULT_DISPLAY_PHASE); unsigned int num_karts = m_all_row_infos.size(); // First: Update the finite state machine This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-12-20 17:52:45
|
Revision: 7115 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=7115&view=rev Author: auria Date: 2010-12-20 17:52:39 +0000 (Mon, 20 Dec 2010) Log Message: ----------- Don't allow restartign a race in GP mode Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2010-12-20 16:42:04 UTC (rev 7114) +++ main/trunk/src/states_screens/race_result_gui.cpp 2010-12-20 17:52:39 UTC (rev 7115) @@ -91,10 +91,9 @@ { // In case of a GP: // ---------------- - top->setText( _("Continue") ); - top->setVisible(true); + top->setVisible(false); - middle->setText( _("Restart") ); + middle->setText( _("Continue") ); middle->setVisible(true); bottom->setText( _("Abort Grand Prix") ); @@ -154,17 +153,14 @@ // ----------------- if (race_manager->getMajorMode() == RaceManager::MAJOR_MODE_GRAND_PRIX) { - StateManager::get()->popMenu(); - if(name=="top") // Next GP + if (name == "middle") // Next GP { + StateManager::get()->popMenu(); race_manager->next(); } - else if (name=="middle") // Restart + else if (name == "bottom") // Abort { - race_manager->rerunRace(); - } - else if (name=="bottom") // Abort - { + StateManager::get()->popMenu(); race_manager->exitRace(); StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-04-19 23:24:22
|
Revision: 8387 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8387&view=rev Author: auria Date: 2011-04-19 23:24:16 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Fix RTL issue Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2011-04-19 22:58:52 UTC (rev 8386) +++ main/trunk/src/states_screens/race_result_gui.cpp 2011-04-19 23:24:16 UTC (rev 8387) @@ -237,7 +237,7 @@ // Save a pointer to the current row_info entry RowInfo *ri = &(m_all_row_infos[position-first_position]); ri->m_is_player_kart = kart->getController()->isPlayerController(); - ri->m_kart_name = kart->getName(); + ri->m_kart_name = translations->fribidize(kart->getName()); video::ITexture *icon = kart->getKartProperties()->getIconMaterial()->getTexture(); @@ -248,7 +248,7 @@ std::string time_string = StringUtils::timeToString(time); ri->m_finish_time_string = time_string.c_str(); - core::dimension2d<u32> rect = m_font->getDimension(kart->getName()); + core::dimension2d<u32> rect = m_font->getDimension(ri->m_kart_name); if(rect.Width > m_width_kart_name) m_width_kart_name = rect.Width; } // for position @@ -533,7 +533,7 @@ RowInfo *ri = &(m_all_row_infos[rank]); ri->m_kart_icon = kart->getKartProperties()->getIconMaterial()->getTexture(); - ri->m_kart_name = kart->getName(); + ri->m_kart_name = translations->fribidize(kart->getName()); ri->m_is_player_kart = kart->getController()->isPlayerController(); float time = race_manager->getOverallTime(kart_id); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-05-26 00:44:24
|
Revision: 8712 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8712&view=rev Author: auria Date: 2011-05-26 00:44:17 +0000 (Thu, 26 May 2011) Log Message: ----------- Show highscores in a reasonably visible way Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2011-05-25 07:18:34 UTC (rev 8711) +++ main/trunk/src/states_screens/race_result_gui.cpp 2011-05-26 00:44:17 UTC (rev 8712) @@ -591,6 +591,12 @@ video::SColor color = ri->m_is_player_kart ? video::SColor(255,255,0, 0 ) : video::SColor(255,255,255,255); + // if we have highscores, move items to the left to have some more room... + if (m_highscore_player != NULL) + { + x -= m_table_width/3.0f; + } + #ifdef USE_PER_LINE_BACKGROUND // Draw the background image core::rect<s32> dest(x-50, y, @@ -636,8 +642,11 @@ if (m_highscore_player != NULL && ri->m_player == m_highscore_player) { + current_x += 20; + core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10); - m_font->draw(_("New highscore!"), dest_rect, color, false, false, NULL, true /* ignoreRTL */); + GUIEngine::getSmallFont()->draw(_("New highscore on position %i!", m_highscore_rank), dest_rect, video::SColor(255,255,166,0), + false, false, NULL, true /* ignoreRTL */); //printf("==== Highscore by %s ====\n", core::stringc(m_highscore_player->getProfile()->getName().c_str()).c_str()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-11-08 01:50:37
|
Revision: 10136 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10136&view=rev Author: auria Date: 2011-11-08 01:50:31 +0000 (Tue, 08 Nov 2011) Log Message: ----------- Show GP progress even if something is unlocked Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2011-11-08 01:30:57 UTC (rev 10135) +++ main/trunk/src/states_screens/race_result_gui.cpp 2011-11-08 01:50:31 UTC (rev 10136) @@ -84,6 +84,11 @@ GUIEngine::Widget *middle = getWidget("middle"); GUIEngine::Widget *bottom = getWidget("bottom"); + if (race_manager->getMajorMode()==RaceManager::MAJOR_MODE_GRAND_PRIX) + { + enableGPProgress(); + } + // If something was unlocked // ------------------------- int n = unlock_manager->getRecentlyUnlockedFeatures().size(); @@ -96,7 +101,6 @@ } else if (race_manager->getMajorMode()==RaceManager::MAJOR_MODE_GRAND_PRIX) { - enableGPProgress(); // In case of a GP: // ---------------- top->setVisible(false); @@ -139,6 +143,11 @@ { if(name=="top") { + if (race_manager->getMajorMode() == RaceManager::MAJOR_MODE_GRAND_PRIX) + { + cleanupGPProgress(); + } + std::vector<const ChallengeData*> unlocked = unlock_manager->getRecentlyUnlockedFeatures(); unlock_manager->clearUnlocked(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2013-01-20 20:28:53
|
Revision: 12397 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=12397&view=rev Author: auria Date: 2013-01-20 20:28:47 +0000 (Sun, 20 Jan 2013) Log Message: ----------- Add check to not crash when a kart has a null icon Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2013-01-20 19:43:57 UTC (rev 12396) +++ main/trunk/src/states_screens/race_result_gui.cpp 2013-01-20 20:28:47 UTC (rev 12397) @@ -970,18 +970,21 @@ const std::string &icon_path = prop->getAbsoluteIconFile(); video::ITexture* kart_icon_texture = irr_driver->getTexture( icon_path ); - core::recti source_rect(core::vector2di(0,0), - kart_icon_texture->getSize()); + if (kart_icon_texture != NULL) + { + core::recti source_rect(core::vector2di(0,0), + kart_icon_texture->getSize()); - core::recti dest_rect(current_x, current_y, - current_x+m_width_icon, current_y+m_width_icon); + core::recti dest_rect(current_x, current_y, + current_x+m_width_icon, current_y+m_width_icon); - irr_driver->getVideoDriver()->draw2DImage( - kart_icon_texture, dest_rect, - source_rect, NULL, NULL, - true); + irr_driver->getVideoDriver()->draw2DImage( + kart_icon_texture, dest_rect, + source_rect, NULL, NULL, + true); - current_x += m_width_icon + m_width_column_space; + current_x += m_width_icon + m_width_column_space; + } } // draw the player name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2013-05-16 06:53:09
|
Revision: 12774 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=12774&view=rev Author: hikerstk Date: 2013-05-16 06:53:01 +0000 (Thu, 16 May 2013) Log Message: ----------- Renamed 'back to track selectin' to 'back to challenge selection', which (imho) describes a bit better where this goes to. Removed "Setup New race" when selecting a challenge from the overworld, since it is confusing to come from the overworld and end up on the game mode selection screen. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2013-05-16 06:50:41 UTC (rev 12773) +++ main/trunk/src/states_screens/race_result_gui.cpp 2013-05-16 06:53:01 UTC (rev 12774) @@ -124,18 +124,19 @@ { // Normal race // ----------- - top->setText( _("Setup New Race") ); - top->setVisible(true); middle->setText( _("Restart") ); middle->setVisible(true); if (race_manager->raceWasStartedFromOverworld()) { - bottom->setText( _("Back to track selection") ); + top->setVisible(false); + bottom->setText( _("Back to challenge selection") ); } else { + top->setText( _("Setup New Race") ); + top->setVisible(true); bottom->setText( _("Back to the menu") ); } bottom->setVisible(true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2013-09-14 19:20:11
|
Revision: 13682 http://sourceforge.net/p/supertuxkart/code/13682 Author: deveee Date: 2013-09-14 19:20:08 +0000 (Sat, 14 Sep 2013) Log Message: ----------- First version of race result gui in soccer mode Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2013-09-14 19:19:40 UTC (rev 13681) +++ main/trunk/src/states_screens/race_result_gui.cpp 2013-09-14 19:20:08 UTC (rev 13682) @@ -35,6 +35,7 @@ #include "modes/cutscene_world.hpp" #include "modes/demo_world.hpp" #include "modes/overworld.hpp" +#include "modes/soccer_world.hpp" #include "modes/world_with_rank.hpp" #include "race/highscores.hpp" #include "states_screens/feature_unlocked.hpp" @@ -735,6 +736,12 @@ void RaceResultGUI::displayOneEntry(unsigned int x, unsigned int y, unsigned int n, bool display_points) { + SoccerWorld* soccerWorld = (SoccerWorld*)World::getWorld(); + bool isSoccerMode = race_manager->getMinorMode() == RaceManager::MINOR_MODE_SOCCER; + int m_team_goals[2] = {soccerWorld->getScore(0), soccerWorld->getScore(1)}; + + if (isSoccerMode && n > 0) return; + RowInfo *ri = &(m_all_row_infos[n]); video::SColor color = ri->m_is_player_kart ? video::SColor(255,255,0, 0 ) @@ -755,7 +762,8 @@ // First draw the icon // ------------------- - if(ri->m_kart_icon) + + if(ri->m_kart_icon && !isSoccerMode) { core::recti source_rect(core::vector2di(0,0), ri->m_kart_icon->getSize()); @@ -770,12 +778,35 @@ // Draw the name // ------------- - core::recti pos_name(current_x, y, - UserConfigParams::m_width, y+m_distance_between_rows); - m_font->draw(ri->m_kart_name, pos_name, color, false, false, NULL, - true /* ignoreRTL */); - current_x += m_width_kart_name + m_width_column_space; + if (!isSoccerMode) + { + core::recti pos_name(current_x, y, + UserConfigParams::m_width, y+m_distance_between_rows); + m_font->draw(ri->m_kart_name, pos_name, color, false, false, NULL, + true /* ignoreRTL */); + current_x += m_width_kart_name + m_width_column_space; + } + // Draw name of team which won in soccer mode + // ------------------------------------------ + if (isSoccerMode) + { + core::stringw text; + core::recti pos_name(current_x, y, + UserConfigParams::m_width, y+m_distance_between_rows); + + if (m_team_goals[0] > m_team_goals[1]) + text = core::stringw(_("Red team won")); + else if (m_team_goals[0] < m_team_goals[1]) + text = core::stringw(_("Blue team won")); + else + text = core::stringw(_("Draw")); + + m_font->draw(text, pos_name, color, false, false, NULL, true /* ignoreRTL */); + core::dimension2du rect = m_font->getDimension(text.c_str()); + current_x += rect.Width + m_width_column_space; + } + // Draw the time except in FTL mode // -------------------------------- if(race_manager->getMinorMode()!=RaceManager::MINOR_MODE_FOLLOW_LEADER) @@ -819,6 +850,15 @@ m_font->draw(point_inc_string, dest_rect, color, false, false, NULL, true /* ignoreRTL */); } + + if (isSoccerMode) + { + char score[256]; + sprintf(score, "%d : %d", m_team_goals[0], m_team_goals[1]); + core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10); + m_font->draw(score, dest_rect, color, false, false, NULL, + true /* ignoreRTL */); + } } // displayOneEntry This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-05-26 01:02:23
|
Revision: 8714 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8714&view=rev Author: auria Date: 2011-05-26 01:02:16 +0000 (Thu, 26 May 2011) Log Message: ----------- Improve highscores message Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2011-05-26 00:55:33 UTC (rev 8713) +++ main/trunk/src/states_screens/race_result_gui.cpp 2011-05-26 01:02:16 UTC (rev 8714) @@ -645,9 +645,12 @@ current_x += 20; core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10); - GUIEngine::getSmallFont()->draw(_("New highscore on position %i!", m_highscore_rank), dest_rect, video::SColor(255,255,166,0), - false, false, NULL, true /* ignoreRTL */); + core::stringw message = (m_highscore_rank == 1 ? _("You topped the highscore list!") : _("New highscore!")); + + GUIEngine::getSmallFont()->draw(message.c_str(), dest_rect, video::SColor(255,255,166,0), + false, false, NULL, true /* ignoreRTL */); + //printf("==== Highscore by %s ====\n", core::stringc(m_highscore_player->getProfile()->getName().c_str()).c_str()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-06-30 13:14:27
|
Revision: 9114 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9114&view=rev Author: hikerstk Date: 2011-06-30 13:14:21 +0000 (Thu, 30 Jun 2011) Log Message: ----------- Applied computerfreak97's patch to fix #286. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2011-06-29 00:53:58 UTC (rev 9113) +++ main/trunk/src/states_screens/race_result_gui.cpp 2011-06-30 13:14:21 UTC (rev 9114) @@ -391,7 +391,10 @@ { try { - music_manager->startMusic( music_manager->getMusicInformation("race_summary.music") ); + music_manager->startMusic( + music_manager->getMusicInformation( + file_manager->getMusicFile("race_summary.music")) + ); } catch (std::exception& e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-07-10 20:46:16
|
Revision: 9235 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9235&view=rev Author: auria Date: 2011-07-10 20:46:10 +0000 (Sun, 10 Jul 2011) Log Message: ----------- Fixed highscore display in GPs Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2011-07-10 20:31:33 UTC (rev 9234) +++ main/trunk/src/states_screens/race_result_gui.cpp 2011-07-10 20:46:10 UTC (rev 9235) @@ -688,18 +688,22 @@ current_x += m_width_all_points + m_width_column_space; } - if (m_highscore_player != NULL && ri->m_player == m_highscore_player) + if (race_manager->getMajorMode() != RaceManager::MAJOR_MODE_GRAND_PRIX || + m_animation_state == RR_RACE_RESULT) { - current_x += 20; - - core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10); - - core::stringw message = (m_highscore_rank == 1 ? _("You topped the highscore list!") : _("New highscore!")); - - GUIEngine::getSmallFont()->draw(message.c_str(), dest_rect, video::SColor(255,255,166,0), - false, false, NULL, true /* ignoreRTL */); - - //printf("==== Highscore by %s ====\n", core::stringc(m_highscore_player->getProfile()->getName().c_str()).c_str()); + if (m_highscore_player != NULL && ri->m_player == m_highscore_player) + { + current_x += 20; + + core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10); + + core::stringw message = (m_highscore_rank == 1 ? _("You topped the highscore list!") : _("New highscore!")); + + GUIEngine::getSmallFont()->draw(message.c_str(), dest_rect, video::SColor(255,255,166,0), + false, false, NULL, true /* ignoreRTL */); + + //printf("==== Highscore by %s ====\n", core::stringc(m_highscore_player->getProfile()->getName().c_str()).c_str()); + } } } // displayOneEntry This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-08-21 16:54:56
|
Revision: 9585 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9585&view=rev Author: auria Date: 2011-08-21 16:54:50 +0000 (Sun, 21 Aug 2011) Log Message: ----------- Better defaults for focusd button in race end screen Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2011-08-21 16:48:53 UTC (rev 9584) +++ main/trunk/src/states_screens/race_result_gui.cpp 2011-08-21 16:54:50 UTC (rev 9585) @@ -88,6 +88,7 @@ top->setText(n==1 ? _("See unlocked feature") : _("See unlocked features")); top->setVisible(true); + top->setFocusForPlayer(PLAYER_ID_GAME_MASTER); } else if (race_manager->getMajorMode() == RaceManager::MAJOR_MODE_GRAND_PRIX) { @@ -100,6 +101,8 @@ bottom->setText( _("Abort Grand Prix") ); bottom->setVisible(true); + + middle->setFocusForPlayer(PLAYER_ID_GAME_MASTER); } else { @@ -113,14 +116,9 @@ bottom->setText( _("Back to the menu") ); bottom->setVisible(true); + + bottom->setFocusForPlayer(PLAYER_ID_GAME_MASTER); } - - // Make sure that when 'fire' is pressed accidentally (e.g. pressing fire - // very often to skip all results) that a good default is chosen (to - // avoid aborting a GP by accident). - for(int i=0; i<MAX_PLAYER_COUNT; i++) - top->setFocusForPlayer(i); - } // enableAllButtons //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-10-15 23:46:49
|
Revision: 9987 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9987&view=rev Author: auria Date: 2011-10-15 23:46:43 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Silence silly warning Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2011-10-15 23:40:50 UTC (rev 9986) +++ main/trunk/src/states_screens/race_result_gui.cpp 2011-10-15 23:46:43 UTC (rev 9987) @@ -774,4 +774,4 @@ m_widgets.remove(trackWidget); delete trackWidget; } -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-10-26 05:01:58
|
Revision: 10042 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10042&view=rev Author: hikerstk Date: 2011-10-26 05:01:51 +0000 (Wed, 26 Oct 2011) Log Message: ----------- Cosmetic changes. Modified Paths: -------------- main/trunk/src/states_screens/race_result_gui.cpp Modified: main/trunk/src/states_screens/race_result_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_result_gui.cpp 2011-10-25 20:48:36 UTC (rev 10041) +++ main/trunk/src/states_screens/race_result_gui.cpp 2011-10-26 05:01:51 UTC (rev 10042) @@ -41,7 +41,8 @@ /** Constructor, initialises internal data structures. */ -RaceResultGUI::RaceResultGUI() : Screen("race_result.stkgui", /*pause race*/ false) +RaceResultGUI::RaceResultGUI() : Screen("race_result.stkgui", + /*pause race*/ false) { } // RaceResultGUI @@ -93,7 +94,7 @@ top->setVisible(true); top->setFocusForPlayer(PLAYER_ID_GAME_MASTER); } - else if (race_manager->getMajorMode() == RaceManager::MAJOR_MODE_GRAND_PRIX) + else if (race_manager->getMajorMode()==RaceManager::MAJOR_MODE_GRAND_PRIX) { enableGPProgress(); // In case of a GP: @@ -141,7 +142,8 @@ std::vector<const ChallengeData*> unlocked = unlock_manager->getRecentlyUnlockedFeatures(); unlock_manager->clearUnlocked(); - FeatureUnlockedCutScene* scene = FeatureUnlockedCutScene::getInstance(); + FeatureUnlockedCutScene* scene = + FeatureUnlockedCutScene::getInstance(); scene->addUnlockedThings(unlocked); StateManager::get()->popMenu(); StateManager::get()->pushScreen(scene); @@ -168,7 +170,8 @@ cleanupGPProgress(); StateManager::get()->popMenu(); race_manager->exitRace(); - StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance()); + StateManager::get()->resetAndGoToScreen( + MainMenuScreen::getInstance()); } else if (!getWidget(name.c_str())->isVisible()) { @@ -248,7 +251,8 @@ RowInfo *ri = &(m_all_row_infos[position-first_position]); ri->m_is_player_kart = kart->getController()->isPlayerController(); ri->m_kart_name = translations->fribidize(kart->getName()); - ri->m_player = (ri->m_is_player_kart ? kart->getController()->getPlayer() : NULL); + ri->m_player = ri->m_is_player_kart + ? kart->getController()->getPlayer() : NULL; video::ITexture *icon = kart->getKartProperties()->getIconMaterial()->getTexture(); @@ -259,7 +263,8 @@ std::string time_string = StringUtils::timeToString(time); ri->m_finish_time_string = time_string.c_str(); - core::dimension2d<u32> rect = m_font->getDimension(ri->m_kart_name.c_str()); + core::dimension2du rect = + m_font->getDimension(ri->m_kart_name.c_str()); if(rect.Width > m_width_kart_name) m_width_kart_name = rect.Width; } // for position @@ -368,10 +373,10 @@ * here and trigger the next phase. */ GUIEngine::EventPropagation RaceResultGUI::filterActions(PlayerAction action, - int deviceID, - const unsigned int value, - Input::InputType type, - int playerId) + int deviceID, + const unsigned int value, + Input::InputType type, + int playerId) { if(action!=PA_FIRE) return GUIEngine::EVENT_LET; @@ -392,7 +397,8 @@ { renderGlobal(dt); - if (m_finish_sound != NULL && m_finish_sound->getStatus() != SFXManager::SFX_PLAYING) + if (m_finish_sound != NULL && + m_finish_sound->getStatus() != SFXManager::SFX_PLAYING) { try { @@ -403,7 +409,8 @@ } catch (std::exception& e) { - fprintf(stderr, "[RaceResultGUI] WARNING: exception caught when trying to load music: %s\n", e.what()); + fprintf(stderr, "[RaceResultGUI] WARNING: exception caught when " + "trying to load music: %s\n", e.what()); } } } // onUpdate @@ -443,7 +450,8 @@ RowInfo *ri = &(m_all_row_infos[i]); ri->m_x_pos = (float)m_leftmost_column; } - if(race_manager->getMajorMode()!=RaceManager::MAJOR_MODE_GRAND_PRIX) + if(race_manager->getMajorMode() != + RaceManager::MAJOR_MODE_GRAND_PRIX) { m_animation_state = RR_WAIT_TILL_END; enableAllButtons(); @@ -485,7 +493,8 @@ { RowInfo *ri = &(m_all_row_infos[i]); ri->m_new_points = 0; - ri->m_current_displayed_points = (float)ri->m_new_overall_points; + ri->m_current_displayed_points = + (float)ri->m_new_overall_points; } } @@ -535,14 +544,20 @@ ri->m_current_displayed_points += dt*race_manager->getPositionScore(1)/m_time_for_points; if(ri->m_current_displayed_points>ri->m_new_overall_points) - ri->m_current_displayed_points = (float)ri->m_new_overall_points; - ri->m_new_points -= dt*race_manager->getPositionScore(1)/m_time_for_points; + { + ri->m_current_displayed_points = + (float)ri->m_new_overall_points; + } + ri->m_new_points -= + dt*race_manager->getPositionScore(1)/m_time_for_points; if(ri->m_new_points<0) ri->m_new_points = 0; break; case RR_RESORT_TABLE: - x = ri->m_x_pos -ri->m_radius*sin(m_timer/m_time_rotation*M_PI); - y = ri->m_centre_point+ri->m_radius*cos(m_timer/m_time_rotation*M_PI); + x = ri->m_x_pos + - ri->m_radius*sin(m_timer/m_time_rotation*M_PI); + y = ri->m_centre_point + + ri->m_radius*cos(m_timer/m_time_rotation*M_PI); break; case RR_WAIT_TILL_END: break; @@ -571,7 +586,8 @@ kart->getKartProperties()->getIconMaterial()->getTexture(); ri->m_kart_name = translations->fribidize(kart->getName()); ri->m_is_player_kart = kart->getController()->isPlayerController(); - ri->m_player = (ri->m_is_player_kart ? kart->getController()->getPlayer() : NULL); + ri->m_player = ri->m_is_player_kart + ? kart->getController()->getPlayer() : NULL; float time = race_manager->getOverallTime(kart_id); ri->m_finish_time_string @@ -595,8 +611,8 @@ int gp_position = race_manager->getKartGPRank(i); m_gp_position_was_changed |= j!=gp_position; RowInfo *ri = &(m_all_row_infos[j]); - ri->m_radius = (j-gp_position)*(int)m_distance_between_rows*0.5f; - ri->m_centre_point = m_top+(gp_position+j)*m_distance_between_rows*0.5f; + ri->m_radius = (j-gp_position)*(int)m_distance_between_rows*0.5f; + ri->m_centre_point= m_top+(gp_position+j)*m_distance_between_rows*0.5f; int p = race_manager->getKartScore(i); ri->m_new_overall_points = p; } // i < num_karts @@ -611,18 +627,20 @@ unsigned int n, bool display_points) { RowInfo *ri = &(m_all_row_infos[n]); - video::SColor color = ri->m_is_player_kart ? video::SColor(255,255,0, 0 ) - : video::SColor(255,255,255,255); + 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<s32> 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); + 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; @@ -645,7 +663,8 @@ // ------------- core::recti pos_name(current_x, y, UserConfigParams::m_width, y+m_distance_between_rows); - m_font->draw(ri->m_kart_name, pos_name, color, false, false, NULL, true /* ignoreRTL */); + m_font->draw(ri->m_kart_name, pos_name, color, false, false, NULL, + true /* ignoreRTL */); current_x += m_width_kart_name + m_width_column_space; // Draw the time except in FTL mode @@ -653,7 +672,8 @@ if(race_manager->getMinorMode()!=RaceManager::MINOR_MODE_FOLLOW_LEADER) { core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10); - m_font->draw(ri->m_finish_time_string, dest_rect, color, false, false, NULL, true /* ignoreRTL */); + m_font->draw(ri->m_finish_time_string, dest_rect, color, false, false, + NULL, true /* ignoreRTL */); current_x += m_width_finish_time + m_width_column_space; } @@ -666,15 +686,17 @@ // ------------------- if(ri->m_new_points > 0) { - core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10); + core::recti dest_rect = core::recti(current_x, y, + current_x+100, y+10); core::stringw point_string = core::stringw("+") + core::stringw((int)ri->m_new_points); - // With mono-space digits space has the same width as each digit, so - // we can simply fill up the string with spaces to get the right - // aligned. + // With mono-space digits space has the same width as each digit, + // so we can simply fill up the string with spaces to get the + // right aligned. while(point_string.size()<3) point_string = core::stringw(" ")+point_string; - m_font->draw(point_string, dest_rect, color, false, false, NULL, true /* ignoreRTL */); + m_font->draw(point_string, dest_rect, color, false, false, NULL, + true /* ignoreRTL */); } current_x += m_width_new_points + m_width_column_space; @@ -685,7 +707,8 @@ core::stringw((int)(ri->m_current_displayed_points)); while(point_inc_string.size()<3) point_inc_string = core::stringw(" ")+point_inc_string; - m_font->draw(point_inc_string, dest_rect, color, false, false, NULL, true /* ignoreRTL */); + m_font->draw(point_inc_string, dest_rect, color, false, false, NULL, + true /* ignoreRTL */); } if (race_manager->getMajorMode() != RaceManager::MAJOR_MODE_GRAND_PRIX || @@ -693,12 +716,13 @@ { if (m_highscore_player != NULL && ri->m_player == m_highscore_player) { - core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10); - core::stringw message = (m_highscore_rank == 1 ? _("You topped the highscore list!") : _("New highscore!")); - GUIEngine::getSmallFont()->draw(message.c_str(), dest_rect, video::SColor(255,255,166,0), - false, false, NULL, true /* ignoreRTL */); - - //printf("==== Highscore by %s ====\n", core::stringc(m_highscore_player->getProfile()->getName().c_str()).c_str()); + core::recti dest_rect = core::recti(current_x, y, + current_x+100, y+10); + core::stringw message = (m_highscore_rank == 1 + ? _("You topped the highscore list!") : _("New highscore!")); + GUIEngine::getSmallFont()->draw(message.c_str(), dest_rect, + video::SColor(255,255,166,0), + false, false, NULL, true /* ignoreRTL */); } } @@ -712,39 +736,48 @@ m_highscore_player = NULL; m_highscore_rank = 0; m_highscore_time = -1; -} +} // clearHighscores //----------------------------------------------------------------------------- -void RaceResultGUI::setHighscore(std::string who, StateManager::ActivePlayer* player, int rank, int time) +void RaceResultGUI::setHighscore(std::string who, + StateManager::ActivePlayer* player, int rank, + int time) { m_highscore_who = who; m_highscore_player = player; m_highscore_rank = rank; m_highscore_time = time; -} +} // setHighscore +// ---------------------------------------------------------------------------- void RaceResultGUI::enableGPProgress() { if (race_manager->getMajorMode() == RaceManager::MAJOR_MODE_GRAND_PRIX) { - const std::vector<std::string>& tracks = race_manager->getGrandPrix()->getTracks(); + const std::vector<std::string>& tracks = + race_manager->getGrandPrix()->getTracks(); size_t currentTrack = race_manager->getTrackNumber(); for(size_t i=0; i<tracks.size(); i++) { Track* track = track_manager->getTrack(tracks[i]); - GUIEngine::IconButtonWidget* m_screenshot_widget = new GUIEngine::IconButtonWidget(GUIEngine::IconButtonWidget::SCALE_MODE_KEEP_CUSTOM_ASPECT_RATIO, - false, false, GUIEngine::IconButtonWidget::ICON_PATH_TYPE_ABSOLUTE); + GUIEngine::IconButtonWidget* m_screenshot_widget = + new GUIEngine::IconButtonWidget(GUIEngine::IconButtonWidget:: + SCALE_MODE_KEEP_CUSTOM_ASPECT_RATIO, + false, false, + GUIEngine::IconButtonWidget::ICON_PATH_TYPE_ABSOLUTE); m_screenshot_widget->setCustomAspectRatio(4.0f / 3.0f); m_screenshot_widget->m_x = (int)(UserConfigParams::m_width*0.67); - m_screenshot_widget->m_y = (int)(UserConfigParams::m_height*(0.10+i*0.135)); + m_screenshot_widget->m_y = + (int)(UserConfigParams::m_height*(0.10+i*0.135)); m_screenshot_widget->m_w = (int)(UserConfigParams::m_width*0.17); - m_screenshot_widget->m_h = (int)(UserConfigParams::m_height*0.1275); + m_screenshot_widget->m_h = + (int)(UserConfigParams::m_height*0.1275); - m_screenshot_widget->m_properties[GUIEngine::PROP_ICON] = (track != NULL ? - track->getScreenshotFile().c_str() : - file_manager->getDataDir() + "gui/main_help.png"); + m_screenshot_widget->m_properties[GUIEngine::PROP_ICON] = + (track ? track->getScreenshotFile() + : file_manager->getDataDir() + "gui/main_help.png"); m_screenshot_widget->m_properties[GUIEngine::PROP_ID] = tracks[i]; if(i <= currentTrack) @@ -752,10 +785,12 @@ m_screenshot_widget->add(); m_widgets.push_back(m_screenshot_widget); - } - } -} + } // for + } // if MAJOR_MODE_GRAND_PRIX) +} // enableGPProgress + +// ---------------------------------------------------------------------------- void RaceResultGUI::displayGPProgress() { video::SColor color = video::SColor(255,255,0,0); @@ -763,15 +798,17 @@ core::stringw message("Grand Prix progress:"); m_font->draw(message.c_str(), dest_rect, color, false, false, NULL, true); -} +} // displayGPProgress +// ---------------------------------------------------------------------------- void RaceResultGUI::cleanupGPProgress() { - const std::vector<std::string>& tracks = race_manager->getGrandPrix()->getTracks(); + const std::vector<std::string>& tracks = + race_manager->getGrandPrix()->getTracks(); for(size_t i=0; i<tracks.size(); i++) { GUIEngine::Widget *trackWidget = getWidget(tracks[i].c_str()); m_widgets.remove(trackWidget); delete trackWidget; } -} +} // cleanupGPProgress This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |