Add waiting screen for networking
This commit is contained in:
parent
96a10ce92c
commit
14c8ecddb5
11
data/gui/online/waiting_for_others.stkgui
Normal file
11
data/gui/online/waiting_for_others.stkgui
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<stkgui>
|
||||
<div x="2%" y="5%" width="96%" height="90%" layout="vertical-row" >
|
||||
|
||||
<header id="title" width="96%" height="fit" text_align="center" I18N="Networking screen" text="Waiting for the others..."/>
|
||||
|
||||
<spacer height="40" width="50"/>
|
||||
|
||||
Waiting...
|
||||
</div>
|
||||
</stkgui>
|
@ -33,6 +33,7 @@
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "states_screens/track_info_screen.hpp"
|
||||
#include "states_screens/gp_info_screen.hpp"
|
||||
#include "states_screens/waiting_for_others.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "tracks/track_manager.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
@ -96,7 +97,7 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name,
|
||||
ClientLobbyRoomProtocol* clrp =
|
||||
static_cast<ClientLobbyRoomProtocol*>(protocol);
|
||||
clrp->voteTrack(selection);
|
||||
|
||||
WaitingForOthersScreen::getInstance()->push();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
60
src/states_screens/waiting_for_others.cpp
Normal file
60
src/states_screens/waiting_for_others.cpp
Normal file
@ -0,0 +1,60 @@
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2009-2015 Marianne Gagnon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "states_screens/waiting_for_others.hpp"
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
#include "guiengine/widget.hpp"
|
||||
#include "guiengine/widgets/list_widget.hpp"
|
||||
#include "guiengine/widgets/ribbon_widget.hpp"
|
||||
#include "input/device_manager.hpp"
|
||||
#include "input/input_manager.hpp"
|
||||
#include "input/keyboard_device.hpp"
|
||||
#include "karts/kart_properties_manager.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
|
||||
using namespace GUIEngine;
|
||||
|
||||
DEFINE_SCREEN_SINGLETON( WaitingForOthersScreen );
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
WaitingForOthersScreen::WaitingForOthersScreen() : Screen("online/waiting_for_others.stkgui")
|
||||
{
|
||||
} // WaitingForOthersScreen
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void WaitingForOthersScreen::loadedFromFile()
|
||||
{
|
||||
} // loadedFromFile
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void WaitingForOthersScreen::eventCallback(Widget* widget, const std::string& name, const int playerID)
|
||||
{
|
||||
} // eventCallback
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void WaitingForOthersScreen::init()
|
||||
{
|
||||
Screen::init();
|
||||
} //init
|
||||
|
||||
// -----------------------------------------------------------------------------
|
47
src/states_screens/waiting_for_others.hpp
Normal file
47
src/states_screens/waiting_for_others.hpp
Normal file
@ -0,0 +1,47 @@
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2009-2015 Marianne Gagnon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef HEADER_WAITING_FOR_OTHERS_HPP
|
||||
#define HEADER_WAITING_FOR_OTHERS_HPP
|
||||
|
||||
#include "guiengine/screen.hpp"
|
||||
|
||||
namespace GUIEngine { class Widget; }
|
||||
|
||||
/**
|
||||
* \brief Help screen, part 1
|
||||
* \ingroup states_screens
|
||||
*/
|
||||
class WaitingForOthersScreen : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<WaitingForOthersScreen>
|
||||
{
|
||||
friend class GUIEngine::ScreenSingleton<WaitingForOthersScreen>;
|
||||
WaitingForOthersScreen();
|
||||
|
||||
public:
|
||||
|
||||
/** \brief implement callback from parent class GUIEngine::Screen */
|
||||
virtual void loadedFromFile() OVERRIDE;
|
||||
|
||||
/** \brief implement callback from parent class GUIEngine::Screen */
|
||||
virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,
|
||||
const int playerID) OVERRIDE;
|
||||
|
||||
/** \brief implement callback from parent class GUIEngine::Screen */
|
||||
virtual void init() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user