adding some comments and fixing the kart selection screen bug

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/hilnius@13688 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hilnius 2013-09-15 09:45:22 +00:00
parent 20418a82af
commit 5f4270acc6
8 changed files with 22 additions and 7 deletions

View File

@ -38,6 +38,9 @@ class NetworkInterface : public Singleton<NetworkInterface>
friend class Singleton<NetworkInterface>; friend class Singleton<NetworkInterface>;
public: public:
/*! \brief Used to init the network.
* \param server : True if we're a server.
*/
void initNetwork(bool server); void initNetwork(bool server);
protected: protected:

View File

@ -32,6 +32,10 @@
typedef unsigned char uchar; typedef unsigned char uchar;
/** \class NetworkString
* \brief Describes a chain of 8-bit unsigned integers.
* This class allows you to easily create and parse 8-bit strings.
*/
class NetworkString class NetworkString
{ {
union { union {

View File

@ -24,6 +24,12 @@
#include "network/game_setup.hpp" #include "network/game_setup.hpp"
#include "network/network_string.hpp" #include "network/network_string.hpp"
class RaceConfig
{
int m_world_type;
}
/*! /*!
* \class LobbyRoomProtocol * \class LobbyRoomProtocol
* \brief Class used while the game is being prepared. * \brief Class used while the game is being prepared.

View File

@ -339,7 +339,7 @@ void RaceManager::startNew(bool from_overworld)
} }
m_track_number = 0; m_track_number = 0;
if(m_major_mode==MAJOR_MODE_GRAND_PRIX) if(m_major_mode==MAJOR_MODE_GRAND_PRIX && !NetworkWorld::getInstance()->isRunning()) // offline mode only
{ {
//We look if Player 1 has a saved version of this GP. //We look if Player 1 has a saved version of this GP.
// ================================================= // =================================================
@ -480,7 +480,7 @@ void RaceManager::next()
m_track_number++; m_track_number++;
if(m_track_number<(int)m_tracks.size()) if(m_track_number<(int)m_tracks.size())
{ {
if(m_major_mode==MAJOR_MODE_GRAND_PRIX) if(m_major_mode==MAJOR_MODE_GRAND_PRIX && !NetworkWorld::getInstance()->isRunning())
{ {
//Saving GP state //Saving GP state
//We look if Player 1 has already saved this GP. //We look if Player 1 has already saved this GP.
@ -624,7 +624,7 @@ void RaceManager::exitRace(bool delete_world)
if (m_major_mode==MAJOR_MODE_GRAND_PRIX && m_track_number==(int)m_tracks.size()) if (m_major_mode==MAJOR_MODE_GRAND_PRIX && m_track_number==(int)m_tracks.size())
{ {
unlock_manager->getCurrentSlot()->grandPrixFinished(); unlock_manager->getCurrentSlot()->grandPrixFinished();
if(m_major_mode==MAJOR_MODE_GRAND_PRIX) if(m_major_mode==MAJOR_MODE_GRAND_PRIX&& !NetworkWorld::getInstance()->isRunning())
{ {
//Delete saved GP //Delete saved GP
SavedGrandPrix* gp = SavedGrandPrix* gp =

View File

@ -845,7 +845,7 @@ void KartHoverListener::onSelectionChanged(DynamicRibbonWidget* theWidget,
// ============================================================================ // ============================================================================
KartSelectionScreen::KartSelectionScreen() : Screen("karts.stkgui") KartSelectionScreen::KartSelectionScreen(const char* filename) : Screen(filename)
{ {
m_removed_widget = NULL; m_removed_widget = NULL;
m_multiplayer_message = NULL; m_multiplayer_message = NULL;
@ -934,6 +934,8 @@ void KartSelectionScreen::init()
Widget* placeholder = getWidget("playerskarts"); Widget* placeholder = getWidget("playerskarts");
assert(placeholder != NULL); assert(placeholder != NULL);
// FIXME : The reserved id value is -1 when we switch from KSS to NKSS and vice-versa
g_dispatcher->setRootID(placeholder->m_reserved_id); g_dispatcher->setRootID(placeholder->m_reserved_id);
g_root_id = placeholder->m_reserved_id; g_root_id = placeholder->m_reserved_id;

View File

@ -70,7 +70,7 @@ protected:
bool m_must_delete_on_back; //!< To delete the screen if back is pressed bool m_must_delete_on_back; //!< To delete the screen if back is pressed
KartSelectionScreen(); KartSelectionScreen(const char* filename);
/** Stores whether any player confirmed their choice; then, some things /** Stores whether any player confirmed their choice; then, some things
* are "frozen", for instance the selected kart group tab * are "frozen", for instance the selected kart group tab

View File

@ -18,7 +18,7 @@ using namespace GUIEngine;
DEFINE_SCREEN_SINGLETON( NetworkKartSelectionScreen ); DEFINE_SCREEN_SINGLETON( NetworkKartSelectionScreen );
NetworkKartSelectionScreen::NetworkKartSelectionScreen() : KartSelectionScreen() NetworkKartSelectionScreen::NetworkKartSelectionScreen() : KartSelectionScreen("karts_online.stkgui")
{ {
KartSelectionScreen::m_instance_ptr = this; KartSelectionScreen::m_instance_ptr = this;
} }

View File

@ -2,7 +2,7 @@
DEFINE_SCREEN_SINGLETON( OfflineKartSelectionScreen ); DEFINE_SCREEN_SINGLETON( OfflineKartSelectionScreen );
OfflineKartSelectionScreen::OfflineKartSelectionScreen() : KartSelectionScreen() OfflineKartSelectionScreen::OfflineKartSelectionScreen() : KartSelectionScreen("karts.stkgui")
{ {
KartSelectionScreen::m_instance_ptr = this; KartSelectionScreen::m_instance_ptr = this;
} }