Improve main menu based on feedback received
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10381 178a84e3-b1eb-0310-8ba1-8eac791a3b58
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 3.9 KiB |
@ -29,16 +29,16 @@
|
|||||||
|
|
||||||
<buttonbar id="menu_toprow" proportion="3" width="75%" align="center">
|
<buttonbar id="menu_toprow" proportion="3" width="75%" align="center">
|
||||||
<icon-button id="story" width="128" height="128"
|
<icon-button id="story" width="128" height="128"
|
||||||
icon="gui/challenge.png" label_location="hover"
|
icon="gui/menu_story.png" focus_icon="gui/menu_story_focus.png"
|
||||||
I18N="Main menu button" text="Story Mode"/>
|
I18N="Main menu button" text="Story Mode"/>
|
||||||
<icon-button id="new" width="128" height="128" icon="gui/main_race.png"
|
<icon-button id="new" width="128" height="128"
|
||||||
label_location="hover"
|
icon="gui/menu_race.png" focus_icon="gui/menu_race_focus.png"
|
||||||
I18N="Main menu button" text="Single-player"/>
|
I18N="Main menu button" text="Single-player"/>
|
||||||
<icon-button id="multiplayer" width="128" height="128" icon="gui/main_race_multi.png"
|
<icon-button id="multiplayer" width="128" height="128"
|
||||||
label_location="hover"
|
icon="gui/menu_multi.png" focus_icon="gui/menu_multi_focus.png"
|
||||||
I18N="Main menu button" text="Multiplayer"/>
|
I18N="Main menu button" text="Multiplayer"/>
|
||||||
<icon-button id="addons" width="128" height="128"
|
<icon-button id="addons" width="128" height="128"
|
||||||
icon="gui/addons.png" label_location="hover"
|
icon="gui/menu_addons.png" focus_icon="gui/menu_addons_focus.png"
|
||||||
I18N="Main menu button" text="Addons"/>
|
I18N="Main menu button" text="Addons"/>
|
||||||
</buttonbar>
|
</buttonbar>
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 16 KiB |
BIN
data/gui/menu_addons.png
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
data/gui/menu_addons_focus.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
data/gui/menu_multi.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
data/gui/menu_multi_focus.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
data/gui/menu_race.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
data/gui/menu_race_focus.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
data/gui/menu_story.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
data/gui/menu_story_focus.png
Normal file
After Width: | Height: | Size: 34 KiB |
@ -66,6 +66,7 @@ namespace GUIEngine
|
|||||||
\li \ref prop1
|
\li \ref prop1
|
||||||
\li \ref prop2
|
\li \ref prop2
|
||||||
\li \ref prop3
|
\li \ref prop3
|
||||||
|
\li \ref prop3.1
|
||||||
\li \ref prop4
|
\li \ref prop4
|
||||||
\li \ref prop5
|
\li \ref prop5
|
||||||
\li \ref prop6
|
\li \ref prop6
|
||||||
@ -171,6 +172,7 @@ namespace GUIEngine
|
|||||||
area without caring for aspect ratio, and another to respect an aspect
|
area without caring for aspect ratio, and another to respect an aspect
|
||||||
ratio other than the texture's (useful for track screenshots, which
|
ratio other than the texture's (useful for track screenshots, which
|
||||||
are 4:3 compressed to fit in a power-of-two 256x256 texture)
|
are 4:3 compressed to fit in a power-of-two 256x256 texture)
|
||||||
|
\note Supports property PROP_FOCUS_ICON
|
||||||
|
|
||||||
\n
|
\n
|
||||||
\subsection widget5 WTYPE_CHECKBOX
|
\subsection widget5 WTYPE_CHECKBOX
|
||||||
@ -300,6 +302,12 @@ namespace GUIEngine
|
|||||||
IconButtonWidget and DynamicRibbon can enable you to use absolute paths if
|
IconButtonWidget and DynamicRibbon can enable you to use absolute paths if
|
||||||
you wish, however).
|
you wish, however).
|
||||||
|
|
||||||
|
\n
|
||||||
|
\subsection prop3.1 PROP_FOCUS_ICON
|
||||||
|
<em> Name in XML files: </em> \c "focus_icon"
|
||||||
|
|
||||||
|
For icon buttons. A different icon to show when the item is focused.
|
||||||
|
|
||||||
\n
|
\n
|
||||||
\subsection prop4 PROP_TEXT_ALIGN
|
\subsection prop4 PROP_TEXT_ALIGN
|
||||||
<em> Name in XML files: </em> \c "text_align"
|
<em> Name in XML files: </em> \c "text_align"
|
||||||
@ -441,12 +449,15 @@ namespace GUIEngine
|
|||||||
\subsection prop16 PROP_LABELS_LOCATION
|
\subsection prop16 PROP_LABELS_LOCATION
|
||||||
<em> Name in XML files: </em> \c "label_location"
|
<em> Name in XML files: </em> \c "label_location"
|
||||||
|
|
||||||
Currently only used by dynamic ribbons. Decides where the label is. Value
|
In dynamic ribbons : Decides where the label is. Value
|
||||||
can be "each", "bottom", or "none" (if ommitted, "none" is the default).
|
can be "each", "bottom", or "none" (if ommitted, "none" is the default).
|
||||||
"each" means that every item has its own label. "bottom" means there is a
|
"each" means that every item has its own label. "bottom" means there is a
|
||||||
single label for all at the bottom, that displays the name of the current
|
single label for all at the bottom, that displays the name of the current
|
||||||
item.
|
item.
|
||||||
|
|
||||||
|
In non-dynamic ribbons, you can also use value "hover" which will make the
|
||||||
|
label only visible when the icon is hovered with the mouse.
|
||||||
|
|
||||||
\n
|
\n
|
||||||
\subsection prop17 PROP_MAX_ROWS
|
\subsection prop17 PROP_MAX_ROWS
|
||||||
<em> Name in XML files: </em> \c "max_rows"
|
<em> Name in XML files: </em> \c "max_rows"
|
||||||
|
@ -204,6 +204,7 @@ if(prop_name != NULL) widget.m_properties[prop_flag] = core::stringc(prop_name).
|
|||||||
READ_PROPERTY(align, PROP_ALIGN);
|
READ_PROPERTY(align, PROP_ALIGN);
|
||||||
|
|
||||||
READ_PROPERTY(icon, PROP_ICON);
|
READ_PROPERTY(icon, PROP_ICON);
|
||||||
|
READ_PROPERTY(focus_icon, PROP_FOCUS_ICON);
|
||||||
READ_PROPERTY(text_align, PROP_TEXT_ALIGN);
|
READ_PROPERTY(text_align, PROP_TEXT_ALIGN);
|
||||||
READ_PROPERTY(min_value, PROP_MIN_VALUE);
|
READ_PROPERTY(min_value, PROP_MIN_VALUE);
|
||||||
READ_PROPERTY(max_value, PROP_MAX_VALUE);
|
READ_PROPERTY(max_value, PROP_MAX_VALUE);
|
||||||
|
@ -1398,6 +1398,11 @@ void Skin::drawIconButton(const core::recti &rect, Widget* widget,
|
|||||||
{
|
{
|
||||||
video::ITexture* t = icon_widget->m_texture;
|
video::ITexture* t = icon_widget->m_texture;
|
||||||
|
|
||||||
|
if (focused && icon_widget->m_highlight_texture != NULL)
|
||||||
|
{
|
||||||
|
t = icon_widget->m_highlight_texture;
|
||||||
|
}
|
||||||
|
|
||||||
const bool mouseInside =
|
const bool mouseInside =
|
||||||
rect.isPointInside(irr_driver->getDevice()->getCursorControl()
|
rect.isPointInside(irr_driver->getDevice()->getCursorControl()
|
||||||
->getPosition());
|
->getPosition());
|
||||||
|
@ -90,6 +90,7 @@ namespace GUIEngine
|
|||||||
PROP_ALIGN,
|
PROP_ALIGN,
|
||||||
// PROP_TEXT, // this one is a bit special, can't go along others since it's wide strings
|
// PROP_TEXT, // this one is a bit special, can't go along others since it's wide strings
|
||||||
PROP_ICON,
|
PROP_ICON,
|
||||||
|
PROP_FOCUS_ICON,
|
||||||
PROP_TEXT_ALIGN,
|
PROP_TEXT_ALIGN,
|
||||||
PROP_MIN_VALUE,
|
PROP_MIN_VALUE,
|
||||||
PROP_MAX_VALUE,
|
PROP_MAX_VALUE,
|
||||||
|
@ -74,6 +74,20 @@ void IconButtonWidget::add()
|
|||||||
m_texture_w = m_texture->getSize().Width;
|
m_texture_w = m_texture->getSize().Width;
|
||||||
m_texture_h = m_texture->getSize().Height;
|
m_texture_h = m_texture->getSize().Height;
|
||||||
|
|
||||||
|
if (m_properties[PROP_FOCUS_ICON].size() > 0)
|
||||||
|
{
|
||||||
|
if (m_icon_path_type == ICON_PATH_TYPE_ABSOLUTE)
|
||||||
|
{
|
||||||
|
m_highlight_texture = irr_driver->getTexture(m_properties[PROP_FOCUS_ICON].c_str());
|
||||||
|
}
|
||||||
|
else if (m_icon_path_type == ICON_PATH_TYPE_RELATIVE)
|
||||||
|
{
|
||||||
|
m_highlight_texture = irr_driver->getTexture((file_manager->getDataDir() + "/" +
|
||||||
|
m_properties[PROP_FOCUS_ICON]).c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// irrlicht widgets don't support scaling while keeping aspect ratio
|
// irrlicht widgets don't support scaling while keeping aspect ratio
|
||||||
// so, happily, let's implement it ourselves
|
// so, happily, let's implement it ourselves
|
||||||
float useAspectRatio = -1.0f;
|
float useAspectRatio = -1.0f;
|
||||||
|