Add uniform back buttons everywhere in a subtle location

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8078 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-03-26 23:51:49 +00:00
parent 20be01e58a
commit 7377d6739e
23 changed files with 120 additions and 114 deletions

View File

@ -1,10 +1,14 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="1%" width="96%" height="99%" layout="vertical-row" >
<header width="100%" I18N="Section in arena tracks selection screen" text="Arenas"
<header width="80%" I18N="Section in arena tracks selection screen" text="Arenas"
align="center" text_align="center" />
<spacer width="20" height="5" />
<box proportion="1" width="100%" layout="vertical-row">
<ribbon_grid id="tracks" proportion="1" width="100%" square_items="true"
label_location="bottom" align="center" child_width="160" child_height="120" />
@ -17,7 +21,7 @@
<button id="all" I18N="track group" text="All"/>
</tabs>
<spacer width="20" height="13" />
<spacer width="20" height="3%" />
</div>

View File

@ -1,22 +1,20 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="5%" y="2%" width="90%" height="96%" layout="vertical-row" >
<header I18N="Title for challenges screen" text="Challenges : Trophy Room" text_align="center" width="100%" />
<box id="animated_area" width="100%" proportion="1" layout="vertical-row">
<ribbon_grid id="challenges" proportion="3" width="100%"
label_location="bottom" align="center" child_width="128" child_height="128" />
<header I18N="Title for challenges screen" text="Challenges : Trophy Room" text_align="center" align="center" width="80%" />
<spacer proportion="1" width="100%"/>
</box>
<spacer width="100%" height="45"/>
</div>
<button id="back" x="20" y="-40" height="35" align="left" text="Back to main menu"/>
<box id="animated_area" width="100%" height="5" layout="vertical-row">
<ribbon_grid id="challenges" proportion="3" width="100%"
label_location="bottom" align="center" child_width="128" child_height="128" />
<spacer proportion="1" width="100%"/>
</box>
</div>
</stkgui>

View File

@ -1,4 +1,6 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="5%" y="2%" width="90%" height="96%" layout="vertical-row" >
@ -9,11 +11,7 @@
<box id="animated_area" width="100%" proportion="10">
</box>
<spacer width="50" height="45" />
</div>
<button id="back" x="20" y="-40" height="35" align="left" text="Back to main menu"/>
</stkgui>

View File

@ -1,8 +1,10 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
<header align="center" width="100%" text="SuperTuxKart Help" text_align="center"/>
<header align="center" width="80%" text="SuperTuxKart Help" text_align="center"/>
<spacer height="15" width="10"/>
<tabs id="category" height="10%" max_height="110" width="100%" align="center">
@ -60,10 +62,6 @@
<spacer height="10" width="10"/>
</box>
<spacer width="50" height="45" />
</div>
<button id="back" x="20" y="-40" width="250" height="35" align="left"
I18N="In the help menu, to return to the previous screen" text="Back"/>
</stkgui>

View File

@ -1,8 +1,10 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
<header align="center" width="100%" text="SuperTuxKart Help" text_align="center"/>
<header align="center" width="80%" text="SuperTuxKart Help" text_align="center"/>
<spacer height="15" width="10"/>
<tabs id="category" height="10%" max_height="110" width="100%" align="center">
@ -64,9 +66,6 @@
</div>
</box>
<spacer width="50" height="45" />
</div>
<button id="back" x="20" y="-40" width="250" height="35" align="left"
I18N="In the help menu, to return to the previous screen" text="Back"/>
</stkgui>

View File

@ -1,8 +1,10 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
<header align="center" width="100%" text="SuperTuxKart Help" text_align="center"/>
<header align="center" width="80%" text="SuperTuxKart Help" text_align="center"/>
<spacer height="15" width="10"/>
<tabs id="category" height="10%" max_height="110" width="100%" align="center">
@ -55,10 +57,6 @@
text="* Most of these game modes can also be played in a Grand Prix fashion: instead of playing a single race, you play many in a row. The better you rank, the more points you get. In the end, the player with the most points wins the cup."/>
</box>
<spacer width="50" height="45" />
</div>
<button id="back" x="20" y="-40" width="250" height="35" align="left"
I18N="In the help menu, to return to the previous screen" text="Back"/>
</stkgui>

View File

@ -1,8 +1,10 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
<header align="center" width="100%" text="SuperTuxKart Help" text_align="center"/>
<header align="center" width="80%" text="SuperTuxKart Help" text_align="center"/>
<spacer height="15" width="10"/>
<tabs id="category" height="10%" max_height="110" width="100%" align="center">
@ -37,10 +39,6 @@
</div>
<spacer width="50" height="25" />
</box>
<spacer width="50" height="45" />
</div>
<button id="back" x="20" y="-40" width="250" height="35" align="left"
I18N="In the help menu, to return to the previous screen" text="Back"/>
</stkgui>

View File

@ -2,12 +2,12 @@
<div x="2%" y="1%" width="96%" height="99%" layout="vertical-row" >
<header width="100%"
<header width="80%"
I18N="In the kart selection (player setup) screen"
text="Choose a Kart"
align="center" text_align="center" />
<placeholder id="playerskarts" width="100%" proportion="4">
<placeholder id="playerskarts" width="100%" align="center" proportion="4">
<!-- Contents is added programatically -->
</placeholder>
@ -20,16 +20,10 @@
<!-- Groups will be added dynamically at runtime -->
<tabs width="100%" height="25" id="kartgroups">
<!--
<button id="standard" I18N="Kart group" text="Standard"/>
<button id="addons" I18N="Kart group" text="Add-Ons"/>
<button id="special" I18N="Kart group" text="Special"/>
<button id="all" I18N="Kart group" text="All"/>
-->
</tabs>
<spacer height="15" width="25"/>
<spacer width="100%" height="2%"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,8 +1,10 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
<header text_align="center" width="100%" text="SuperTuxKart Options"/>
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
<tabs id="options_choice" height="10%" max_height="110" width="100%" align="center">
@ -62,11 +64,6 @@
<spacer height="20" width="10"/>
</box>
<spacer width="50" height="10" />
<button id="back" x="20" width="250" align="left"
I18N="In the options menu, to go back to the main menu or game" text="Back"/>
</div>
</stkgui>

View File

@ -2,7 +2,7 @@
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
<header text_align="center" width="100%" text="SuperTuxKart Options"/>
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
<tabs id="options_choice" height="10%" max_height="110" width="100%" align="center">
@ -33,11 +33,8 @@
<spacer width="50" height="10" />
</box>
<spacer width="50" height="10" />
<button id="back" x="20" width="250" align="left"
I18N="In the options menu, to go back to the main menu or game" text="Back"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -2,7 +2,7 @@
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
<header text_align="center" width="100%" text="SuperTuxKart Options"/>
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
<tabs id="options_choice" height="10%" max_height="110" width="100%" align="center">
@ -32,11 +32,8 @@
<label text="* Which config to use will be inferred from which 'fire' key is pressed to join the game."
proportion="2" word_wrap="true"/>
</box>
<spacer width="50" height="10" />
<button id="back" x="20" width="250" align="left"
I18N="In the options menu, to go back to the main menu or game" text="Back"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -2,7 +2,7 @@
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
<header text_align="center" width="100%" text="SuperTuxKart Options"/>
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
<tabs id="options_choice" height="10%" max_height="110" width="100%" align="center">
@ -30,20 +30,11 @@
<button id="addplayer" x="20"
I18N="In players configuration menu"
text="Add Player" align="center"/>
<!--
<spacer width="50" height="10" />
<button id="renameplayer" x="20" width="35%" height="30" text="Rename Player" align="center"/>
<spacer width="50" height="10" />
<button id="rempayer" x="20" width="35%" height="30" text="Remove Player" align="center"/>
-->
<spacer width="20" height="15"/>
</box>
<spacer width="50" height="10" />
<button id="back" x="20" width="250" align="left"
I18N="In the options menu, to go back to the main menu or game" text="Back"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -2,7 +2,7 @@
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
<header text_align="center" width="100%" text="SuperTuxKart Options"/>
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
<tabs id="options_choice" height="10%" max_height="110" width="100%" align="center">
@ -36,11 +36,8 @@
<spacer height="4" width="4"/>
</box>
<spacer width="50" height="10" />
<button id="back" x="20" width="250" align="left"
I18N="In the options menu, to go back to the main menu or game" text="Back"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,8 +1,10 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
<header text_align="center" width="100%" text="SuperTuxKart Options"/>
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
<tabs id="options_choice" height="10%" max_height="110" width="100%" align="center">
@ -27,6 +29,8 @@
<gauge id="gfx_level" min_value="1" max_value="5" width="300" height="50"/>
</div>
<spacer height="15" width="10"/>
<!-- ************ VSYNC ************ -->
<!-- FIXME don't hardcode height, should depend on text height -->
<div width="75%" height="40" layout="horizontal-row" >
@ -35,7 +39,7 @@
<label height="100%" I18N="In the video settings" text="Vertical Sync (requires restart)"/>
</div>
<spacer width="20" height="20"/>
<spacer width="20" height="25"/>
<!-- ************ RESOLUTION CHOICE ************ -->
<spacer height="10" width="10"/>
@ -66,11 +70,6 @@
<spacer height="4" width="4"/>
</box>
<spacer width="50" height="10" />
<button id="back" x="20" width="250" align="left"
I18N="In the options menu, to go back to the main menu or game" text="Back"/>
</div>
</stkgui>

View File

@ -1,8 +1,10 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<header width="100%" text="Race Setup" align="center" text_align="center" />
<header width="80%" text="Race Setup" align="center" text_align="center" />
<spacer proportion="1" width="25"/>
@ -33,9 +35,7 @@
<scrollable_toolbar id="gamemode" height="135" width="85%" label_location="bottom" align="center"
child_width="135" child_height="135" />
<spacer proportion="2" width="25"/>
<spacer proportion="1" width="25" />
</div>
</stkgui>

View File

@ -1,8 +1,10 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="1%" width="96%" height="99%" layout="vertical-row" >
<header width="100%" I18N="Section in track selection screen" text="Grand Prix"
<header width="80%" I18N="Section in track selection screen" text="Grand Prix"
align="center" text_align="center" />
<box width="100%" height="195">
@ -22,9 +24,8 @@
<!-- Populated dynamically at runtime -->
<tabs width="100%" height="25" id="trackgroups"> </tabs>
<spacer width="20" height="13" />
<spacer width="100%" height="2%" />
</div>
</stkgui>

View File

@ -13,7 +13,9 @@
</div>
<button id="back" x="20" y="-40" height="35" align="left" text="Back to main menu"/>
<icon-button id="back" x="20" y="-40" height="64" width="128" align="left" icon="gui/screenback.png"
I18N="In the options menu, to go back to the main menu or game" text="Back to menu"/>
<button id="play" x="-200" y="-40" height="35" align="right" text="Play all"/>
</stkgui>

View File

@ -226,6 +226,8 @@ EventHandler* EventHandler::get()
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
const bool NAVIGATION_DEBUG = false;
#if 0
#pragma mark -
#pragma mark Private methods
@ -300,7 +302,7 @@ void EventHandler::navigateUp(const int playerID, Input::InputType type, const b
if (success)
{
//std::cout << "Navigating up to " << closest->getID() << std::endl;
if (NAVIGATION_DEBUG) std::cout << "Navigating up to " << closest->getID() << std::endl;
Widget* closestWidget = GUIEngine::getWidget( closest->getID() );
if (playerID != PLAYER_ID_GAME_MASTER && !closestWidget->m_supports_multiplayer) return;
@ -324,11 +326,24 @@ void EventHandler::navigateUp(const int playerID, Input::InputType type, const b
}
if (!found)
{
//std::cout << "EventHandler::navigateUp : warp around, selecting the last widget\n";
//if (el == NULL) std::cout << " because el is null\n";
//else if (el->getTabGroup() == NULL) std::cout << " because el's tab group is null\n";
//else if (!el->getTabGroup()->getNextElement(el->getTabOrder(), true, false, first, closest))std::cout << " because el (" << core::stringc(el->getText()).c_str() << ", tab order " << el->getTabOrder() << ") has no known previous\n";
{
if (NAVIGATION_DEBUG)
{
std::cout << "EventHandler::navigateUp : warp around, selecting the last widget\n";
if (el == NULL)
{
std::cout << " because el is null\n";
}
else if (el->getTabGroup() == NULL)
{
std::cout << " because el's tab group is null\n";
}
else if (!el->getTabGroup()->getNextElement(el->getTabOrder(), true, false, first, closest))
{
std::cout << " because el (" << core::stringc(el->getText()).c_str() << ", tab order "
<< el->getTabOrder() << ") has no known previous\n";
}
}
// select the last widget
Widget* lastWidget = NULL;
@ -412,14 +427,18 @@ void EventHandler::navigateDown(const int playerID, Input::InputType type, const
// if the current widget is e.g. 5, search for widget 6, 7, 8, 9, ..., 15 (up to 10 IDs may be missing)
for (int n=0; n<10 && !found; n++)
{
const bool success = el->getTabGroup()->getNextElement(el->getTabOrder()+n,
const bool success = el->getTabGroup()->getNextElement(el->getTabOrder() + n,
false, false, first, closest, true);
if (success)
if (success && closest->getID() != -1)
{
Widget* closestWidget = GUIEngine::getWidget( closest->getID() );
if (playerID != PLAYER_ID_GAME_MASTER && !closestWidget->m_supports_multiplayer) return;
if (NAVIGATION_DEBUG)
{
std::cout << "Navigating down to " << closestWidget->getID() << "\n";
}
assert( closestWidget != NULL );
closestWidget->setFocusForPlayer(playerID);
@ -440,6 +459,8 @@ void EventHandler::navigateDown(const int playerID, Input::InputType type, const
if (!found)
{
if (NAVIGATION_DEBUG) std::cout << "Navigating down : warp around\n";
// select the first widget
Widget* firstWidget = NULL;

View File

@ -59,7 +59,7 @@ void IconButtonWidget::add()
{
std::cerr << "IconButtonWidget::add() : error, cannot find texture "
<< m_properties[PROP_ICON].c_str() << std::endl;
assert(false); // catch this error in debug mode
m_texture = irr_driver->getTexture((file_manager->getDataDir() + "/gui/main_help.png").c_str());
return;
}
m_texture_w = m_texture->getSize().Width;

View File

@ -157,6 +157,10 @@ void ArenasScreen::eventCallback(Widget* widget, const std::string& name, const
{
buildTrackList();
}
else if (name == "back")
{
StateManager::get()->escapePressed();
}
} // eventCallback

View File

@ -1398,6 +1398,11 @@ void KartSelectionScreen::eventCallback(Widget* widget, const std::string& name,
{
playerConfirm(playerID);
}
else if (name == "back")
{
printf("back in kart screen\n");
StateManager::get()->escapePressed();
}
else
{
// Transmit to all subwindows, maybe *they* care about this event

View File

@ -138,6 +138,10 @@ void RaceSetupScreen::eventCallback(Widget* widget, const std::string& name, con
SpinnerWidget* w = dynamic_cast<SpinnerWidget*>(widget);
race_manager->setNumKarts( race_manager->getNumLocalPlayers() + w->getValue() );
}
else if (name == "back")
{
StateManager::get()->escapePressed();
}
}
// -----------------------------------------------------------------------------

View File

@ -179,7 +179,11 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name, const
{
buildTrackList();
}
else if (name == "back")
{
printf("back in tracks_screen\n");
StateManager::get()->escapePressed();
}
}
// -----------------------------------------------------------------------------------------------