Fix some gui interface bugs:

1. Fix credits fading effect

2. Display have many no of (addons mostly) arenas are hidden due to
   missing of navigation mesh

3. Fix wrong size of kart stats bar
This commit is contained in:
Benau 2015-12-10 10:25:52 +08:00
parent ca6da8c537
commit cebefcf374
5 changed files with 29 additions and 9 deletions

View File

@ -1002,12 +1002,12 @@ void ScalableFont::doDraw(const core::stringw& text,
if (fallback[n] || m_type == T_BOLD)
{
video::SColor title_colors[] = {GUIEngine::getSkin()->getColor("font::top" ),
GUIEngine::getSkin()->getColor("font::bottom"),
GUIEngine::getSkin()->getColor("font::top" ),
GUIEngine::getSkin()->getColor("font::bottom")
};
video::SColor top = GUIEngine::getSkin()->getColor("font::top");
video::SColor bottom = GUIEngine::getSkin()->getColor("font::bottom");
top.setAlpha(color.getAlpha());
bottom.setAlpha(color.getAlpha());
video::SColor title_colors[] = {top, bottom, top, bottom};
if (charCollector != NULL)
{
charCollector->collectChar(texture,

View File

@ -46,6 +46,8 @@ DynamicRibbonWidget::DynamicRibbonWidget(const bool combo, const bool multi_row)
m_supports_multiplayer = true;
m_scrolling_enabled = true;
m_animated_contents = false;
// Don't initialize m_font here to make lazy loading characters work
m_font = NULL;
// by default, set all players to have no selection in this ribbon
for (unsigned int n=0; n<MAX_PLAYER_COUNT; n++)
@ -730,6 +732,16 @@ void DynamicRibbonWidget::onRibbonWidgetScroll(const int delta_x)
// -----------------------------------------------------------------------------
void DynamicRibbonWidget::setText(const wchar_t *text)
{
Widget::setText(text);
if (m_label != NULL)
m_label->setText(text);
}
// -----------------------------------------------------------------------------
void DynamicRibbonWidget::onRibbonWidgetFocus(RibbonWidget* emitter, const int playerID)
{
if (m_deactivated) return;

View File

@ -302,6 +302,8 @@ namespace GUIEngine
/** \brief callback from IRibbonListener */
virtual void onSelectionChange(){}
virtual void setText(const wchar_t *text);
virtual void update(float delta);
/** Set approximately how many items are expected to be in this ribbon; will help the layout

View File

@ -39,6 +39,7 @@ KartStatsWidget::KartStatsWidget(core::recti area, const int player_id,
std::string kart_group, bool multiplayer,
bool display_text) : Widget(WTYPE_DIV)
{
m_title_font = !multiplayer;
m_player_id = player_id;
const std::string default_kart = UserConfigParams::m_default_kart;
@ -153,7 +154,7 @@ void KartStatsWidget::setSize(const int x, const int y, const int w, const int h
// -- sizes
m_skill_bar_w = w;
m_skill_bar_h = GUIEngine::getTitleFontHeight();
m_skill_bar_h = (m_title_font ? GUIEngine::getTitleFontHeight() : GUIEngine::getFontHeight());
// for shrinking effect
if (h < 175)

View File

@ -218,6 +218,7 @@ void ArenasScreen::buildTrackList()
bool soccer_mode = race_manager->getMinorMode() == RaceManager::MINOR_MODE_SOCCER;
bool arenas_have_navmesh = false;
int skipped = 0;
if (curr_group_name == ALL_ARENA_GROUPS_ID)
{
@ -276,8 +277,11 @@ void ArenasScreen::buildTrackList()
(!(curr->hasNavMesh() ||
race_manager->getNumLocalPlayers() > 1 ||
UserConfigParams::m_artist_debug_mode)))
{
skipped++;
continue;
}
}
if (PlayerManager::getCurrentPlayer()->isLocked(curr->getIdent()))
{
@ -291,12 +295,13 @@ void ArenasScreen::buildTrackList()
}
}
}
if (arenas_have_navmesh || race_manager->getNumLocalPlayers() > 1 ||
UserConfigParams::m_artist_debug_mode)
if ((arenas_have_navmesh || race_manager->getNumLocalPlayers() > 1 ||
UserConfigParams::m_artist_debug_mode) && !skipped)
w->addItem(_("Random Arena"), "random_track", "/gui/track_random.png");
w->updateItemDisplay();
assert(w->getItems().size() > 0);
if (skipped > 0)
w->setText( _("%i arenas unavailable in single player", skipped) );
}
// ------------------------------------------------------------------------------------------------------