+
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/states_screens/kart_selection.cpp b/src/states_screens/kart_selection.cpp
index d4229e325..59102fa24 100644
--- a/src/states_screens/kart_selection.cpp
+++ b/src/states_screens/kart_selection.cpp
@@ -268,6 +268,28 @@ void KartSelectionScreen::loadedFromFile()
void KartSelectionScreen::beforeAddingWidget()
{
+ if (useContinueButton())
+ {
+ getWidget("kartlist")->m_properties[GUIEngine::PROP_WIDTH] = "90%";
+ getWidget("continue")->setVisible(true);
+ }
+ else
+ {
+ getWidget("kartlist")->m_properties[GUIEngine::PROP_WIDTH] = "100%";
+ getWidget("continue")->setVisible(false);
+ }
+ // Remove dispatcher from m_widgets before calculateLayout otherwise a
+ // dummy button is shown in kart screen
+ bool removed_dispatcher = false;
+ if (m_widgets.contains(m_dispatcher))
+ {
+ m_widgets.remove(m_dispatcher);
+ removed_dispatcher = true;
+ }
+ calculateLayout();
+ if (removed_dispatcher)
+ m_widgets.push_back(m_dispatcher);
+
// Dynamically add tabs
RibbonWidget* tabs = getWidget
("kartgroups");
assert( tabs != NULL );
@@ -1098,7 +1120,14 @@ void KartSelectionScreen::eventCallback(Widget* widget,
}
else if (name == "karts")
{
- if (m_kart_widgets.size() > unsigned(player_id))
+ if (!useContinueButton() &&
+ m_kart_widgets.size() > unsigned(player_id))
+ playerConfirm(player_id);
+ }
+ else if (name == "continue")
+ {
+ if (useContinueButton() &&
+ m_kart_widgets.size() > unsigned(player_id))
playerConfirm(player_id);
}
else if (name == "back")
@@ -1551,6 +1580,15 @@ void KartSelectionScreen::setKartsFromCurrentGroup()
}
// ----------------------------------------------------------------------------
+bool KartSelectionScreen::useContinueButton() const
+{
+ if (m_multiplayer)
+ return false;
+ bool multitouch_enabled = (UserConfigParams::m_multitouch_active == 1 &&
+ irr_driver->getDevice()->supportsTouchDevice()) ||
+ UserConfigParams::m_multitouch_active > 1;
+ return multitouch_enabled;
+} // useContinueButton
#if 0
#pragma mark -
diff --git a/src/states_screens/kart_selection.hpp b/src/states_screens/kart_selection.hpp
index c358a6d53..273f339a4 100644
--- a/src/states_screens/kart_selection.hpp
+++ b/src/states_screens/kart_selection.hpp
@@ -131,6 +131,7 @@ protected:
private:
PtrVector getUsableKarts(
const std::string& selected_kart_group);
+ bool useContinueButton() const;
public:
/** Returns the current instance */
static KartSelectionScreen* getRunningInstance();
diff --git a/src/states_screens/online/network_kart_selection.cpp b/src/states_screens/online/network_kart_selection.cpp
index 1b94dfc32..a2007a5e5 100644
--- a/src/states_screens/online/network_kart_selection.cpp
+++ b/src/states_screens/online/network_kart_selection.cpp
@@ -32,12 +32,18 @@
using namespace GUIEngine;
+// ----------------------------------------------------------------------------
+void NetworkKartSelectionScreen::beforeAddingWidget()
+{
+ m_multiplayer = NetworkConfig::get()->getNetworkPlayers().size() != 1;
+ KartSelectionScreen::beforeAddingWidget();
+} // beforeAddingWidget
+
// ----------------------------------------------------------------------------
void NetworkKartSelectionScreen::init()
{
assert(!NetworkConfig::get()->isAddingNetworkPlayers());
m_all_players_done = false;
- m_multiplayer = NetworkConfig::get()->getNetworkPlayers().size() != 1;
KartSelectionScreen::init();
m_timer = getWidget("timer");
diff --git a/src/states_screens/online/network_kart_selection.hpp b/src/states_screens/online/network_kart_selection.hpp
index d3fdb47e2..e71d53e10 100644
--- a/src/states_screens/online/network_kart_selection.hpp
+++ b/src/states_screens/online/network_kart_selection.hpp
@@ -64,6 +64,8 @@ private:
{ return m_available_karts.find(ident) == m_available_karts.end(); }
// ------------------------------------------------------------------------
void updateProgressBarText();
+ // ------------------------------------------------------------------------
+ virtual void beforeAddingWidget() OVERRIDE;
public:
/** \brief Implement per-frame callback. */