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:
parent
20418a82af
commit
5f4270acc6
@ -38,6 +38,9 @@ class NetworkInterface : public Singleton<NetworkInterface>
|
||||
friend class Singleton<NetworkInterface>;
|
||||
public:
|
||||
|
||||
/*! \brief Used to init the network.
|
||||
* \param server : True if we're a server.
|
||||
*/
|
||||
void initNetwork(bool server);
|
||||
|
||||
protected:
|
||||
|
@ -32,6 +32,10 @@
|
||||
|
||||
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
|
||||
{
|
||||
union {
|
||||
|
@ -24,6 +24,12 @@
|
||||
#include "network/game_setup.hpp"
|
||||
#include "network/network_string.hpp"
|
||||
|
||||
|
||||
class RaceConfig
|
||||
{
|
||||
int m_world_type;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \class LobbyRoomProtocol
|
||||
* \brief Class used while the game is being prepared.
|
||||
|
@ -339,7 +339,7 @@ void RaceManager::startNew(bool from_overworld)
|
||||
}
|
||||
|
||||
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.
|
||||
// =================================================
|
||||
@ -480,7 +480,7 @@ void RaceManager::next()
|
||||
m_track_number++;
|
||||
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
|
||||
//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())
|
||||
{
|
||||
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
|
||||
SavedGrandPrix* gp =
|
||||
|
@ -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_multiplayer_message = NULL;
|
||||
@ -934,6 +934,8 @@ void KartSelectionScreen::init()
|
||||
Widget* placeholder = getWidget("playerskarts");
|
||||
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_root_id = placeholder->m_reserved_id;
|
||||
|
@ -70,7 +70,7 @@ protected:
|
||||
|
||||
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
|
||||
* are "frozen", for instance the selected kart group tab
|
||||
|
@ -18,7 +18,7 @@ using namespace GUIEngine;
|
||||
|
||||
DEFINE_SCREEN_SINGLETON( NetworkKartSelectionScreen );
|
||||
|
||||
NetworkKartSelectionScreen::NetworkKartSelectionScreen() : KartSelectionScreen()
|
||||
NetworkKartSelectionScreen::NetworkKartSelectionScreen() : KartSelectionScreen("karts_online.stkgui")
|
||||
{
|
||||
KartSelectionScreen::m_instance_ptr = this;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
DEFINE_SCREEN_SINGLETON( OfflineKartSelectionScreen );
|
||||
|
||||
OfflineKartSelectionScreen::OfflineKartSelectionScreen() : KartSelectionScreen()
|
||||
OfflineKartSelectionScreen::OfflineKartSelectionScreen() : KartSelectionScreen("karts.stkgui")
|
||||
{
|
||||
KartSelectionScreen::m_instance_ptr = this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user