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">
<label id="message" width="80%" align="center" text_align="left"/>
</div>
<spacer width="20" height="25"/>
<buttonbar id="options" width="90%" height="13%" align="bottom">
<icon-button id="ok" width="64" height="64" icon="gui/green_check.png"
I18N="In the user screen" text="OK" label_location="bottom"/>
<icon-button id="new_user" width="64" height="64" icon="gui/blue_plus.png"
I18N="In the user screen" text="Add user" label_location="bottom"/>
<icon-button id="delete" width="64" height="64" icon="gui/remove.png"
I18N="In the user screen" text="Delete" label_location="bottom"/>
<icon-button id="rename" width="64" height="64" icon="gui/rename.png"
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>
<spacer width="20" proportion="1"/>
<div width="90%" align="center" layout="vertical-row" height="13%" height="fit" align="bottom">
<buttonbar id="options" width="100%" height="100%" align="center">
<icon-button id="ok" width="64" height="64" icon="gui/green_check.png"
I18N="In the user screen" text="OK" label_location="bottom"/>
<icon-button id="new_user" width="64" height="64" icon="gui/blue_plus.png"
I18N="In the user screen" text="Add user" label_location="bottom"/>
<icon-button id="delete" width="64" height="64" icon="gui/remove.png"
I18N="In the user screen" text="Delete" label_location="bottom"/>
<icon-button id="rename" width="64" height="64" icon="gui/rename.png"
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>
<spacer width="20" height="15"/>
</div>

View File

@ -57,7 +57,8 @@ GamePadDevice::GamePadDevice(const int irr_index, const std::string &name,
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;
} // GamePadDevice
@ -66,6 +67,7 @@ GamePadDevice::GamePadDevice(const int irr_index, const std::string &name,
*/
GamePadDevice::~GamePadDevice()
{
delete[] m_buttonPressed;
delete[] m_prev_axis_directions;
delete[] m_prev_axis_value;
delete[] m_axis_ok;

View File

@ -31,7 +31,7 @@ class GamepadConfig;
class GamePadDevice : public InputDevice
{
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;

View File

@ -926,8 +926,8 @@ void KartSelectionScreen::addMultiplayerMessage()
{
m_multiplayer_message = new BubbleWidget();
m_multiplayer_message->m_properties[PROP_TEXT_ALIGN] = "center";
m_multiplayer_message->setText( _("Everyone:\nPress 'Select' now to "
"join the game!") );
m_multiplayer_message->setText( _("Everyone:\nPress the 'Select' button to "
"join the game") );
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_w = (int) (splitWidth * 0.6f);

View File

@ -181,6 +181,27 @@ void BaseUserScreen::tearDown()
Screen::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
* entry fields.

View File

@ -23,7 +23,7 @@
#include "guiengine/screen.hpp"
#include "guiengine/widgets/spinner_widget.hpp"
#include "input/input.hpp"
namespace GUIEngine
{
class CheckBoxWidget;
@ -125,6 +125,12 @@ public:
void loginError(const irr::core::stringw &error_message);
void logoutSuccessful();
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
// ============================================================================