This commit is contained in:
hiker 2016-04-14 11:04:28 +10:00
commit ff7556130a
6 changed files with 52 additions and 18 deletions

View File

@ -48,19 +48,24 @@
<div width="80%" align="center" layout="vertical-row" height="fit"> <div width="80%" align="center" layout="vertical-row" height="fit">
<label id="message" width="80%" align="center" text_align="left"/> <label id="message" width="80%" align="center" text_align="left"/>
</div> </div>
<spacer width="20" height="25"/>
<buttonbar id="options" width="90%" height="13%" align="bottom"> <spacer width="20" proportion="1"/>
<icon-button id="ok" width="64" height="64" icon="gui/green_check.png"
I18N="In the user screen" text="OK" label_location="bottom"/> <div width="90%" align="center" layout="vertical-row" height="13%" height="fit" align="bottom">
<icon-button id="new_user" width="64" height="64" icon="gui/blue_plus.png" <buttonbar id="options" width="100%" height="100%" align="center">
I18N="In the user screen" text="Add user" label_location="bottom"/> <icon-button id="ok" width="64" height="64" icon="gui/green_check.png"
<icon-button id="delete" width="64" height="64" icon="gui/remove.png" I18N="In the user screen" text="OK" label_location="bottom"/>
I18N="In the user screen" text="Delete" label_location="bottom"/> <icon-button id="new_user" width="64" height="64" icon="gui/blue_plus.png"
<icon-button id="rename" width="64" height="64" icon="gui/rename.png" I18N="In the user screen" text="Add user" label_location="bottom"/>
I18N="In the user screen" text="Rename" label_location="bottom"/> <icon-button id="delete" width="64" height="64" icon="gui/remove.png"
<icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png" I18N="In the user screen" text="Delete" label_location="bottom"/>
I18N="In the user screen" text="Cancel" label_location="bottom"/> <icon-button id="rename" width="64" height="64" icon="gui/rename.png"
</buttonbar> I18N="In the user screen" text="Rename" label_location="bottom"/>
<icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png"
I18N="In the user screen" text="Cancel" label_location="bottom"/>
</buttonbar>
</div>
<spacer width="20" height="25"/>
</box> </box>
<spacer width="20" height="15"/> <spacer width="20" height="15"/>
</div> </div>

View File

@ -57,7 +57,8 @@ GamePadDevice::GamePadDevice(const int irr_index, const std::string &name,
m_axis_ok[i] = false; m_axis_ok[i] = false;
} }
for(int n=0; n<SEvent::SJoystickEvent::NUMBER_OF_BUTTONS; n++) m_buttonPressed = new bool[button_count];
for(int n=0; n<button_count; n++)
m_buttonPressed[n] = false; m_buttonPressed[n] = false;
} // GamePadDevice } // GamePadDevice
@ -66,6 +67,7 @@ GamePadDevice::GamePadDevice(const int irr_index, const std::string &name,
*/ */
GamePadDevice::~GamePadDevice() GamePadDevice::~GamePadDevice()
{ {
delete[] m_buttonPressed;
delete[] m_prev_axis_directions; delete[] m_prev_axis_directions;
delete[] m_prev_axis_value; delete[] m_prev_axis_value;
delete[] m_axis_ok; delete[] m_axis_ok;

View File

@ -31,7 +31,7 @@ class GamepadConfig;
class GamePadDevice : public InputDevice class GamePadDevice : public InputDevice
{ {
void resetAxisDirection(const int axis, Input::AxisDirection direction); void resetAxisDirection(const int axis, Input::AxisDirection direction);
bool m_buttonPressed[SEvent::SJoystickEvent::NUMBER_OF_BUTTONS]; bool* m_buttonPressed;
Input::AxisDirection *m_prev_axis_directions; Input::AxisDirection *m_prev_axis_directions;

View File

@ -926,8 +926,8 @@ void KartSelectionScreen::addMultiplayerMessage()
{ {
m_multiplayer_message = new BubbleWidget(); m_multiplayer_message = new BubbleWidget();
m_multiplayer_message->m_properties[PROP_TEXT_ALIGN] = "center"; m_multiplayer_message->m_properties[PROP_TEXT_ALIGN] = "center";
m_multiplayer_message->setText( _("Everyone:\nPress 'Select' now to " m_multiplayer_message->setText( _("Everyone:\nPress the 'Select' button to "
"join the game!") ); "join the game") );
m_multiplayer_message->m_x = message_x; m_multiplayer_message->m_x = message_x;
m_multiplayer_message->m_y = (int) (fullarea->m_y + fullarea->m_h * 0.3f); m_multiplayer_message->m_y = (int) (fullarea->m_y + fullarea->m_h * 0.3f);
m_multiplayer_message->m_w = (int) (splitWidth * 0.6f); m_multiplayer_message->m_w = (int) (splitWidth * 0.6f);

View File

@ -181,6 +181,27 @@ void BaseUserScreen::tearDown()
Screen::tearDown(); Screen::tearDown();
} // tearDown } // tearDown
// ----------------------------------------------------------------------------
EventPropagation BaseUserScreen::filterActions(PlayerAction action,
int deviceID,
const unsigned int value,
Input::InputType type,
int playerId)
{
if (action == PA_MENU_SELECT)
{
if ((m_username_tb != NULL && m_username_tb->isFocusedForPlayer(PLAYER_ID_GAME_MASTER))
|| (m_password_tb != NULL && m_password_tb->isFocusedForPlayer(PLAYER_ID_GAME_MASTER)))
{
login();
}
return EVENT_BLOCK;
}
return EVENT_LET;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/** Called when a user is selected. It updates the online checkbox and /** Called when a user is selected. It updates the online checkbox and
* entry fields. * entry fields.

View File

@ -23,7 +23,7 @@
#include "guiengine/screen.hpp" #include "guiengine/screen.hpp"
#include "guiengine/widgets/spinner_widget.hpp" #include "guiengine/widgets/spinner_widget.hpp"
#include "input/input.hpp"
namespace GUIEngine namespace GUIEngine
{ {
class CheckBoxWidget; class CheckBoxWidget;
@ -125,6 +125,12 @@ public:
void loginError(const irr::core::stringw &error_message); void loginError(const irr::core::stringw &error_message);
void logoutSuccessful(); void logoutSuccessful();
void logoutError(const irr::core::stringw &error_message); void logoutError(const irr::core::stringw &error_message);
virtual GUIEngine::EventPropagation filterActions(PlayerAction action,
int deviceID,
const unsigned int value,
Input::InputType type,
int playerId) OVERRIDE;
}; // class BaseUserScreen }; // class BaseUserScreen
// ============================================================================ // ============================================================================