Improve keyboard-only navgation. See #3131

This commit is contained in:
auria.mg 2018-03-11 18:50:55 -04:00
parent 2d86adce3c
commit 2087a72cf3
4 changed files with 15 additions and 7 deletions

View File

@ -375,7 +375,10 @@ void EventHandler::processGUIAction(const PlayerAction action,
case PA_RESCUE:
case PA_MENU_CANCEL:
if (pressedDown) GUIEngine::getStateManager()->escapePressed();
if (pressedDown&& !isWithinATextBox())
{
GUIEngine::getStateManager()->escapePressed();
}
break;
case PA_FIRE:

View File

@ -27,6 +27,7 @@
#include "guiengine/engine.hpp"
#include "guiengine/widgets/model_view_widget.hpp"
#include "guiengine/widgets/spinner_widget.hpp"
#include "states_screens/state_manager.hpp"
using namespace GUIEngine;
@ -36,10 +37,11 @@ KartColorSliderDialog::KartColorSliderDialog(PlayerProfile* pp)
{
loadFromFile("kart_color_slider.stkgui");
m_player_profile = pp;
getWidget<SpinnerWidget>("color-slider")->setValue(
int(pp->getDefaultKartColor() * 100.0f));
m_model_view->getModelViewRenderInfo()->setHue(
float(getWidget<SpinnerWidget>("color-slider")->getValue()) / 100.0f);
SpinnerWidget* color_slider = getWidget<SpinnerWidget>("color-slider");
color_slider->setValue(int(pp->getDefaultKartColor() * 100.0f));
m_model_view->getModelViewRenderInfo()->setHue(float(color_slider->getValue()) / 100.0f);
color_slider->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
} // KartColorSliderDialog
// ----------------------------------------------------------------------------

View File

@ -96,7 +96,8 @@ void RegisterScreen::init()
username = getenv("LOGNAME");
}
getWidget<TextBoxWidget>("local_username")->setText(username);
TextBoxWidget* local_username = getWidget<TextBoxWidget>("local_username");
local_username->setText(username);
m_password_widget->setPasswordBox(true, L'*');
getWidget<TextBoxWidget>("password_confirm")->setPasswordBox(true, L'*');
@ -106,6 +107,8 @@ void RegisterScreen::init()
onDialogClose();
makeEntryFieldsVisible();
local_username->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
} // init
// -----------------------------------------------------------------------------

View File

@ -197,8 +197,8 @@ EventPropagation BaseUserScreen::filterActions(PlayerAction action,
|| (m_password_tb != NULL && m_password_tb->isFocusedForPlayer(PLAYER_ID_GAME_MASTER)))
{
login();
return EVENT_BLOCK;
}
return EVENT_BLOCK;
}
return EVENT_LET;