Various compilation fixes, some cosmetic changes.

This commit is contained in:
hiker 2014-02-10 08:41:54 +11:00
parent 97be85777d
commit 5acf3e1681
7 changed files with 88 additions and 74 deletions

View File

@ -18,7 +18,6 @@
#include "achievements/achievements_manager.hpp" #include "achievements/achievements_manager.hpp"
#include "challenges/unlock_manager.hpp"
#include "config/player.hpp" #include "config/player.hpp"
#include "config/player_manager.hpp" #include "config/player_manager.hpp"
#include "config/user_config.hpp" #include "config/user_config.hpp"
@ -234,10 +233,10 @@ void AchievementsManager::updateCurrentPlayer()
} }
else else
{ {
m_active_slot = getSlot(unlock_manager->getCurrentPlayer()->getUniqueID(), false); m_active_slot = getSlot(PlayerManager::get()->getCurrentPlayer()->getUniqueID(), false);
if(m_active_slot == NULL) if(m_active_slot == NULL)
{ {
m_active_slot = createNewSlot(unlock_manager->getCurrentPlayer()->getUniqueID(), false); m_active_slot = createNewSlot(PlayerManager::get()->getCurrentPlayer()->getUniqueID(), false);
save(); save();
} }
} }

View File

@ -151,10 +151,18 @@ public:
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
unsigned int getPoints() const { return m_game_slot->getPoints(); } unsigned int getPoints() const { return m_game_slot->getPoints(); }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
void setFirstTime(bool b) { m_game_slot->setFirstTime(b); }
// ------------------------------------------------------------------------
bool isFirstTime() const { return m_game_slot->isFirstTime(); } bool isFirstTime() const { return m_game_slot->isFirstTime(); }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
void clearUnlocked() { m_game_slot->clearUnlocked(); } void clearUnlocked() { m_game_slot->clearUnlocked(); }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** Returns the current challenge for this player. */
const Challenge* getCurrentChallenge() const
{
return m_game_slot->getCurrentChallenge();
} // getCurrentChallenge
// ------------------------------------------------------------------------
const Challenge* getChallenge(const std::string &id) const Challenge* getChallenge(const std::string &id)
{ {
return m_game_slot->getChallenge(id); return m_game_slot->getChallenge(id);

View File

@ -30,6 +30,7 @@
#include "audio/sfx_manager.hpp" #include "audio/sfx_manager.hpp"
#include "audio/sfx_base.hpp" #include "audio/sfx_base.hpp"
#include "challenges/unlock_manager.hpp" #include "challenges/unlock_manager.hpp"
#include "config/player_manager.hpp"
#include "config/user_config.hpp" #include "config/user_config.hpp"
#include "graphics/camera.hpp" #include "graphics/camera.hpp"
#include "graphics/explosion.hpp" #include "graphics/explosion.hpp"
@ -804,8 +805,8 @@ void Kart::finishedRace(float time)
m_controller)); m_controller));
if (m_controller->isPlayerController()) // if player is on this computer if (m_controller->isPlayerController()) // if player is on this computer
{ {
GameSlot *slot = unlock_manager->getCurrentSlot(); PlayerProfile *player = PlayerManager::get()->getCurrentPlayer();
const Challenge *challenge = slot->getCurrentChallenge(); const Challenge *challenge = player->getCurrentChallenge();
// In case of a GP challenge don't make the end animation depend // In case of a GP challenge don't make the end animation depend
// on if the challenge is fulfilled // on if the challenge is fulfilled
if(challenge && !challenge->getData()->isGrandPrix()) if(challenge && !challenge->getData()->isGrandPrix())

View File

@ -1193,7 +1193,8 @@ int main(int argc, char *argv[] )
addons_manager->initAddons(xml); addons_manager->initAddons(xml);
} }
} }
else if(!UserConfigParams::m_no_start_screen)
if(!UserConfigParams::m_no_start_screen)
{ {
StateManager::get()->pushScreen(StoryModeLobbyScreen::getInstance()); StateManager::get()->pushScreen(StoryModeLobbyScreen::getInstance());
#ifdef ENABLE_WIIUSE #ifdef ENABLE_WIIUSE

View File

@ -17,15 +17,12 @@
#include "modes/cutscene_world.hpp" #include "modes/cutscene_world.hpp"
#include <string>
#include <IMeshSceneNode.h>
#include <ISceneManager.h>
#include "animations/animation_base.hpp" #include "animations/animation_base.hpp"
#include "animations/three_d_animation.hpp" #include "animations/three_d_animation.hpp"
#include "audio/music_manager.hpp" #include "audio/music_manager.hpp"
#include "challenges/game_slot.hpp" #include "challenges/game_slot.hpp"
#include "challenges/unlock_manager.hpp" #include "challenges/unlock_manager.hpp"
#include "config/player_manager.hpp"
#include "graphics/irr_driver.hpp" #include "graphics/irr_driver.hpp"
#include "io/file_manager.hpp" #include "io/file_manager.hpp"
#include "karts/abstract_kart.hpp" #include "karts/abstract_kart.hpp"
@ -43,6 +40,11 @@
#include "utils/constants.hpp" #include "utils/constants.hpp"
#include "utils/ptr_vector.hpp" #include "utils/ptr_vector.hpp"
#include <IMeshSceneNode.h>
#include <ISceneManager.h>
#include <string>
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/** Constructor. Sets up the clock mode etc. /** Constructor. Sets up the clock mode etc.
*/ */
@ -376,13 +378,13 @@ void CutsceneWorld::enterRaceOverState()
else if (race_manager->getTrackName() == "introcutscene" || else if (race_manager->getTrackName() == "introcutscene" ||
race_manager->getTrackName() == "introcutscene2") race_manager->getTrackName() == "introcutscene2")
{ {
GameSlot* slot = unlock_manager->getCurrentSlot(); PlayerProfile *player = PlayerManager::get()->getCurrentPlayer();
if (slot->isFirstTime()) if (player->isFirstTime())
{ {
race_manager->exitRace(); race_manager->exitRace();
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance()); StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
slot->setFirstTime(false); player->setFirstTime(false);
unlock_manager->save(); unlock_manager->save();
KartSelectionScreen* s = OfflineKartSelectionScreen::getInstance(); KartSelectionScreen* s = OfflineKartSelectionScreen::getInstance();
s->setMultiplayer(false); s->setMultiplayer(false);

View File

@ -126,17 +126,18 @@ static FocusDispatcher* g_dispatcher = NULL;
/** A small extension to the spinner widget to add features like player ID /** A small extension to the spinner widget to add features like player ID
* management or badging */ * management or badging */
PlayerNameSpinner::PlayerNameSpinner(KartSelectionScreen* parent, const int playerID) PlayerNameSpinner::PlayerNameSpinner(KartSelectionScreen* parent,
const int player_id)
{ {
m_playerID = playerID; m_player_id = player_id;
m_incorrect = false; m_incorrect = false;
m_red_mark_widget = NULL; m_red_mark_widget = NULL;
m_parent = parent; m_parent = parent;
} // PlayerNameSpinner } // PlayerNameSpinner
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
void PlayerNameSpinner::setID(const int m_playerID) void PlayerNameSpinner::setID(const int m_player_id)
{ {
PlayerNameSpinner::m_playerID = m_playerID; PlayerNameSpinner::m_player_id = m_player_id;
} // setID } // setID
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** Add a red mark on the spinner to mean "invalid choice" */ /** Add a red mark on the spinner to mean "invalid choice" */
@ -184,22 +185,22 @@ void PlayerNameSpinner::markAsCorrect()
* number, name, the kart view, the kart's name) */ * number, name, the kart view, the kart's name) */
PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent, PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
StateManager::ActivePlayer* associatedPlayer, StateManager::ActivePlayer* associated_player,
Online::Profile* associatedUser, Online::Profile* associated_user,
core::recti area, const int playerID, core::recti area, const int player_id,
std::string kartGroup, std::string kart_group,
const int irrlichtWidgetID) : Widget(WTYPE_DIV) const int irrlicht_widget_id) : Widget(WTYPE_DIV)
{ {
#ifdef DEBUG #ifdef DEBUG
if (associatedPlayer) if (associated_player)
assert(associatedPlayer->ok()); assert(associated_player->ok());
m_magic_number = 0x33445566; m_magic_number = 0x33445566;
#endif #endif
m_ready_text = NULL; m_ready_text = NULL;
m_parent_screen = parent; m_parent_screen = parent;
m_associated_user = associatedUser; m_associated_user = associated_user;
m_associatedPlayer = associatedPlayer; m_associated_player = associated_player;
x_speed = 1.0f; x_speed = 1.0f;
y_speed = 1.0f; y_speed = 1.0f;
w_speed = 1.0f; w_speed = 1.0f;
@ -207,10 +208,10 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
m_ready = false; m_ready = false;
m_not_updated_yet = true; m_not_updated_yet = true;
m_irrlicht_widget_ID = irrlichtWidgetID; m_irrlicht_widget_id = irrlicht_widget_id;
m_playerID = playerID; m_player_id = player_id;
m_properties[PROP_ID] = StringUtils::insertValues("@p%i", m_playerID); m_properties[PROP_ID] = StringUtils::insertValues("@p%i", m_player_id);
setSize(area.UpperLeftCorner.X, area.UpperLeftCorner.Y, setSize(area.UpperLeftCorner.X, area.UpperLeftCorner.Y,
area.getWidth(), area.getHeight() ); area.getWidth(), area.getHeight() );
@ -222,19 +223,19 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
// ---- Player identity spinner // ---- Player identity spinner
m_player_ident_spinner = NULL; m_player_ident_spinner = NULL;
m_player_ident_spinner = new PlayerNameSpinner(parent, m_playerID); m_player_ident_spinner = new PlayerNameSpinner(parent, m_player_id);
m_player_ident_spinner->m_x = player_name_x; m_player_ident_spinner->m_x = player_name_x;
m_player_ident_spinner->m_y = player_name_y; m_player_ident_spinner->m_y = player_name_y;
m_player_ident_spinner->m_w = player_name_w; m_player_ident_spinner->m_w = player_name_w;
m_player_ident_spinner->m_h = player_name_h; m_player_ident_spinner->m_h = player_name_h;
if (parent->m_multiplayer && associatedPlayer) if (parent->m_multiplayer && associated_player)
{ {
if (associatedPlayer->getDevice()->getType() == DT_KEYBOARD) if (associated_player->getDevice()->getType() == DT_KEYBOARD)
{ {
m_player_ident_spinner->setBadge(KEYBOARD_BADGE); m_player_ident_spinner->setBadge(KEYBOARD_BADGE);
} }
else if (associatedPlayer->getDevice()->getType() == DT_GAMEPAD) else if (associated_player->getDevice()->getType() == DT_GAMEPAD)
{ {
m_player_ident_spinner->setBadge(GAMEPAD_BADGE); m_player_ident_spinner->setBadge(GAMEPAD_BADGE);
} }
@ -244,12 +245,12 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
m_player_ident_spinner->setBadge(OK_BADGE); m_player_ident_spinner->setBadge(OK_BADGE);
} }
if (irrlichtWidgetID == -1) if (irrlicht_widget_id == -1)
{ {
m_player_ident_spinner->m_tab_down_root = g_root_id; m_player_ident_spinner->m_tab_down_root = g_root_id;
} }
spinnerID = StringUtils::insertValues("@p%i_spinner", m_playerID); spinnerID = StringUtils::insertValues("@p%i_spinner", m_player_id);
m_player_ident_spinner->m_properties[PROP_ID] = spinnerID; m_player_ident_spinner->m_properties[PROP_ID] = spinnerID;
if (parent->m_multiplayer) if (parent->m_multiplayer)
@ -278,7 +279,7 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
m_model_view->m_w = model_w; m_model_view->m_w = model_w;
m_model_view->m_h = model_h; m_model_view->m_h = model_h;
m_model_view->m_properties[PROP_ID] = m_model_view->m_properties[PROP_ID] =
StringUtils::insertValues("@p%i_model", m_playerID); StringUtils::insertValues("@p%i_model", m_player_id);
//m_model_view->setParent(this); //m_model_view->setParent(this);
m_children.push_back(m_model_view); m_children.push_back(m_model_view);
@ -293,7 +294,7 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
// kart was used, but the addon package was removed), use the // kart was used, but the addon package was removed), use the
// first kart as a default. This way we don't have to hardcode // first kart as a default. This way we don't have to hardcode
// any kart names. // any kart names.
int id = kart_properties_manager->getKartByGroup(kartGroup, 0); int id = kart_properties_manager->getKartByGroup(kart_group, 0);
if (id == -1) if (id == -1)
{ {
props = kart_properties_manager->getKartById(0); props = kart_properties_manager->getKartById(0);
@ -340,7 +341,7 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
m_kart_name->setText(props->getName(), false); m_kart_name->setText(props->getName(), false);
m_kart_name->m_properties[PROP_TEXT_ALIGN] = "center"; m_kart_name->m_properties[PROP_TEXT_ALIGN] = "center";
m_kart_name->m_properties[PROP_ID] = m_kart_name->m_properties[PROP_ID] =
StringUtils::insertValues("@p%i_kartname", m_playerID); StringUtils::insertValues("@p%i_kartname", m_player_id);
m_kart_name->m_x = kart_name_x; m_kart_name->m_x = kart_name_x;
m_kart_name->m_y = kart_name_y; m_kart_name->m_y = kart_name_y;
m_kart_name->m_w = kart_name_w; m_kart_name->m_w = kart_name_w;
@ -352,9 +353,9 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
PlayerKartWidget::~PlayerKartWidget() PlayerKartWidget::~PlayerKartWidget()
{ {
if (GUIEngine::getFocusForPlayer(m_playerID) == this) if (GUIEngine::getFocusForPlayer(m_player_id) == this)
{ {
GUIEngine::focusNothingForPlayer(m_playerID); GUIEngine::focusNothingForPlayer(m_player_id);
} }
//if (m_player_ID_label->getIrrlichtElement() != NULL) //if (m_player_ID_label->getIrrlichtElement() != NULL)
@ -390,30 +391,30 @@ void PlayerKartWidget::setPlayerID(const int newPlayerID)
assert(m_magic_number == 0x33445566); assert(m_magic_number == 0x33445566);
if (StateManager::get()->getActivePlayer(newPlayerID) if (StateManager::get()->getActivePlayer(newPlayerID)
!= m_associatedPlayer) != m_associated_player)
{ {
std::cerr << "[KartSelectionScreen] WARNING: Internal " std::cerr << "[KartSelectionScreen] WARNING: Internal "
"inconsistency, PlayerKartWidget has IDs and " "inconsistency, PlayerKartWidget has IDs and "
"pointers that do not correspond to one player\n"; "pointers that do not correspond to one player\n";
fprintf(stderr, fprintf(stderr,
" Player: %p - Index: %d - m_associatedPlayer: %p\n", " Player: %p - Index: %d - m_associated_player: %p\n",
StateManager::get()->getActivePlayer(newPlayerID), StateManager::get()->getActivePlayer(newPlayerID),
newPlayerID, m_associatedPlayer); newPlayerID, m_associated_player);
assert(false); assert(false);
} }
// Remove current focus, but rembmer it // Remove current focus, but rembmer it
Widget* focus = GUIEngine::getFocusForPlayer(m_playerID); Widget* focus = GUIEngine::getFocusForPlayer(m_player_id);
GUIEngine::focusNothingForPlayer(m_playerID); GUIEngine::focusNothingForPlayer(m_player_id);
// Change the player ID // Change the player ID
m_playerID = newPlayerID; m_player_id = newPlayerID;
// restore previous focus, but with new player ID // restore previous focus, but with new player ID
if (focus != NULL) focus->setFocusForPlayer(m_playerID); if (focus != NULL) focus->setFocusForPlayer(m_player_id);
if (m_player_ident_spinner != NULL) if (m_player_ident_spinner != NULL)
m_player_ident_spinner->setID(m_playerID); m_player_ident_spinner->setID(m_player_id);
} // setPlayerID } // setPlayerID
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -421,7 +422,7 @@ void PlayerKartWidget::setPlayerID(const int newPlayerID)
int PlayerKartWidget::getPlayerID() const int PlayerKartWidget::getPlayerID() const
{ {
assert(m_magic_number == 0x33445566); assert(m_magic_number == 0x33445566);
return m_playerID; return m_player_id;
} // getPlayerID } // getPlayerID
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -432,7 +433,7 @@ void PlayerKartWidget::add()
assert(KartSelectionScreen::getRunningInstance() assert(KartSelectionScreen::getRunningInstance()
->m_kart_widgets.contains(this)); ->m_kart_widgets.contains(this));
if (m_associatedPlayer) // if player is local if (m_associated_player) // if player is local
{ {
bool mineInList = false; bool mineInList = false;
for (unsigned int p=0; p<StateManager::get()->activePlayerCount(); p++) for (unsigned int p=0; p<StateManager::get()->activePlayerCount(); p++)
@ -440,7 +441,7 @@ void PlayerKartWidget::add()
#ifdef DEBUG #ifdef DEBUG
assert(StateManager::get()->getActivePlayer(p)->ok()); assert(StateManager::get()->getActivePlayer(p)->ok());
#endif #endif
if (StateManager::get()->getActivePlayer(p) == m_associatedPlayer) if (StateManager::get()->getActivePlayer(p) == m_associated_player)
{ {
mineInList = true; mineInList = true;
} }
@ -452,8 +453,8 @@ void PlayerKartWidget::add()
// the first player will have an ID of its own to allow for keyboard // the first player will have an ID of its own to allow for keyboard
// navigation despite this widget being added last // navigation despite this widget being added last
if (m_irrlicht_widget_ID != -1) if (m_irrlicht_widget_id != -1)
m_player_ident_spinner->m_reserved_id = m_irrlicht_widget_ID; m_player_ident_spinner->m_reserved_id = m_irrlicht_widget_id;
else else
m_player_ident_spinner->m_reserved_id = Widget::getNewNoFocusID(); m_player_ident_spinner->m_reserved_id = Widget::getNewNoFocusID();
@ -469,8 +470,8 @@ void PlayerKartWidget::add()
m_player_ident_spinner->clearLabels(); m_player_ident_spinner->clearLabels();
irr::core::stringw name; // name of the player irr::core::stringw name; // name of the player
if (m_associatedPlayer) if (m_associated_player)
name = m_associatedPlayer->getProfile()->getName(); name = m_associated_player->getProfile()->getName();
if (m_associated_user) if (m_associated_user)
name = m_associated_user->getUserName(); name = m_associated_user->getUserName();
@ -500,7 +501,7 @@ void PlayerKartWidget::add()
StateManager::ActivePlayer* PlayerKartWidget::getAssociatedPlayer() StateManager::ActivePlayer* PlayerKartWidget::getAssociatedPlayer()
{ {
assert(m_magic_number == 0x33445566); assert(m_magic_number == 0x33445566);
return m_associatedPlayer; return m_associated_player;
} // getAssociatedPlayer } // getAssociatedPlayer
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -672,7 +673,7 @@ void PlayerKartWidget::onUpdate(float delta)
GUIEngine::EventPropagation PlayerKartWidget::transmitEvent( GUIEngine::EventPropagation PlayerKartWidget::transmitEvent(
Widget* w, Widget* w,
const std::string& originator, const std::string& originator,
const int m_playerID) const int m_player_id)
{ {
assert(m_magic_number == 0x33445566); assert(m_magic_number == 0x33445566);
// if it's declared ready, there is really nothing to process // if it's declared ready, there is really nothing to process
@ -692,7 +693,7 @@ GUIEngine::EventPropagation PlayerKartWidget::transmitEvent(
if(UserConfigParams::logGUI()) if(UserConfigParams::logGUI())
{ {
std::cout << "[KartSelectionScreen] Identity changed " std::cout << "[KartSelectionScreen] Identity changed "
"for player " << m_playerID "for player " << m_player_id
<< " : " << irr::core::stringc( << " : " << irr::core::stringc(
m_player_ident_spinner->getStringValue() m_player_ident_spinner->getStringValue()
.c_str()).c_str() .c_str()).c_str()
@ -701,7 +702,7 @@ GUIEngine::EventPropagation PlayerKartWidget::transmitEvent(
if (m_parent_screen->m_multiplayer) if (m_parent_screen->m_multiplayer)
{ {
m_associatedPlayer->setPlayerProfile( m_associated_player->setPlayerProfile(
PlayerManager::get()->getPlayer(m_player_ident_spinner PlayerManager::get()->getPlayer(m_player_ident_spinner
->getValue()) ); ->getValue()) );
} }
@ -783,7 +784,7 @@ const std::string& PlayerKartWidget::getKartInternalName() const
/** \brief Event callback from ISpinnerConfirmListener */ /** \brief Event callback from ISpinnerConfirmListener */
EventPropagation PlayerKartWidget::onSpinnerConfirmed() EventPropagation PlayerKartWidget::onSpinnerConfirmed()
{ {
KartSelectionScreen::getRunningInstance()->playerConfirm(m_playerID); KartSelectionScreen::getRunningInstance()->playerConfirm(m_player_id);
return EVENT_BLOCK; return EVENT_BLOCK;
} // onSpinnerConfirmed } // onSpinnerConfirmed
@ -2014,7 +2015,7 @@ void KartSelectionScreen::setKartsFromCurrentGroup()
{ {
const KartProperties* prop = const KartProperties* prop =
kart_properties_manager->getKartById(n); kart_properties_manager->getKartById(n);
if (unlock_manager->getCurrentSlot()->isLocked(prop->getIdent())) if (PlayerManager::get()->getCurrentPlayer()->isLocked(prop->getIdent()))
{ {
w->addItem( w->addItem(
_("Locked : solve active challenges to gain access " _("Locked : solve active challenges to gain access "
@ -2046,7 +2047,7 @@ void KartSelectionScreen::setKartsFromCurrentGroup()
kart_properties_manager->getKartById(group[n]); kart_properties_manager->getKartById(group[n]);
const std::string &icon_path = prop->getAbsoluteIconFile(); const std::string &icon_path = prop->getAbsoluteIconFile();
if (unlock_manager->getCurrentSlot()->isLocked(prop->getIdent())) if (PlayerManager::get()->getCurrentPlayer()->isLocked(prop->getIdent()))
{ {
w->addItem( w->addItem(
_("Locked : solve active challenges to gain access " _("Locked : solve active challenges to gain access "

View File

@ -199,7 +199,7 @@ public:
* management or badging */ * management or badging */
class PlayerNameSpinner : public GUIEngine::SpinnerWidget class PlayerNameSpinner : public GUIEngine::SpinnerWidget
{ {
int m_playerID; int m_player_id;
bool m_incorrect; bool m_incorrect;
irr::gui::IGUIImage* m_red_mark_widget; irr::gui::IGUIImage* m_red_mark_widget;
KartSelectionScreen* m_parent; KartSelectionScreen* m_parent;
@ -235,16 +235,19 @@ class PlayerKartWidget : public GUIEngine::Widget,
/** A reserved ID for this widget if any, -1 otherwise. (If no ID is /** A reserved ID for this widget if any, -1 otherwise. (If no ID is
* reserved, widget will not be in the regular tabbing order */ * reserved, widget will not be in the regular tabbing order */
int m_irrlicht_widget_ID; int m_irrlicht_widget_id;
/** For animation purposes (see method 'move') */ /** For animation purposes (see method 'move') */
int target_x, target_y, target_w, target_h; int target_x, target_y, target_w, target_h;
float x_speed, y_speed, w_speed, h_speed; float x_speed, y_speed, w_speed, h_speed;
/** Object representing this player */ /** Object representing this player */
StateManager::ActivePlayer* m_associatedPlayer; // local info /** Local info about the player. */
int m_playerID; StateManager::ActivePlayer* m_associated_player;
Online::Profile* m_associated_user; // network info int m_player_id;
/** Network info about the user. */
Online::Profile* m_associated_user;
/** Internal name of the spinner; useful to interpret spinner events, /** Internal name of the spinner; useful to interpret spinner events,
* which contain the name of the activated object */ * which contain the name of the activated object */
@ -259,7 +262,6 @@ public:
LEAK_CHECK() LEAK_CHECK()
/** Sub-widgets created by this widget */ /** Sub-widgets created by this widget */
//LabelWidget* m_player_ID_label;
PlayerNameSpinner* m_player_ident_spinner; PlayerNameSpinner* m_player_ident_spinner;
GUIEngine::ModelViewWidget* m_model_view; GUIEngine::ModelViewWidget* m_model_view;
GUIEngine::LabelWidget* m_kart_name; GUIEngine::LabelWidget* m_kart_name;
@ -275,11 +277,11 @@ public:
bool m_not_updated_yet; bool m_not_updated_yet;
PlayerKartWidget(KartSelectionScreen* parent, PlayerKartWidget(KartSelectionScreen* parent,
StateManager::ActivePlayer* associatedPlayer, StateManager::ActivePlayer* associated_player,
Online::Profile* associatedUser, Online::Profile* associated_user,
core::recti area, const int playerID, core::recti area, const int player_id,
std::string kartGroup, std::string kart_group,
const int irrlichtWidgetID=-1); const int irrlicht_idget_id=-1);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
~PlayerKartWidget(); ~PlayerKartWidget();
@ -322,7 +324,7 @@ public:
virtual GUIEngine::EventPropagation transmitEvent( virtual GUIEngine::EventPropagation transmitEvent(
GUIEngine::Widget* w, GUIEngine::Widget* w,
const std::string& originator, const std::string& originator,
const int m_playerID); const int m_player_id);
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
/** Sets the size of the widget as a whole, and placed children widgets /** Sets the size of the widget as a whole, and placed children widgets