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:
parent
ca6da8c537
commit
cebefcf374
@ -1002,12 +1002,12 @@ void ScalableFont::doDraw(const core::stringw& text,
|
|||||||
|
|
||||||
if (fallback[n] || m_type == T_BOLD)
|
if (fallback[n] || m_type == T_BOLD)
|
||||||
{
|
{
|
||||||
video::SColor title_colors[] = {GUIEngine::getSkin()->getColor("font::top" ),
|
video::SColor top = GUIEngine::getSkin()->getColor("font::top");
|
||||||
GUIEngine::getSkin()->getColor("font::bottom"),
|
video::SColor bottom = GUIEngine::getSkin()->getColor("font::bottom");
|
||||||
GUIEngine::getSkin()->getColor("font::top" ),
|
top.setAlpha(color.getAlpha());
|
||||||
GUIEngine::getSkin()->getColor("font::bottom")
|
bottom.setAlpha(color.getAlpha());
|
||||||
};
|
|
||||||
|
|
||||||
|
video::SColor title_colors[] = {top, bottom, top, bottom};
|
||||||
if (charCollector != NULL)
|
if (charCollector != NULL)
|
||||||
{
|
{
|
||||||
charCollector->collectChar(texture,
|
charCollector->collectChar(texture,
|
||||||
|
@ -46,6 +46,8 @@ DynamicRibbonWidget::DynamicRibbonWidget(const bool combo, const bool multi_row)
|
|||||||
m_supports_multiplayer = true;
|
m_supports_multiplayer = true;
|
||||||
m_scrolling_enabled = true;
|
m_scrolling_enabled = true;
|
||||||
m_animated_contents = false;
|
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
|
// by default, set all players to have no selection in this ribbon
|
||||||
for (unsigned int n=0; n<MAX_PLAYER_COUNT; n++)
|
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)
|
void DynamicRibbonWidget::onRibbonWidgetFocus(RibbonWidget* emitter, const int playerID)
|
||||||
{
|
{
|
||||||
if (m_deactivated) return;
|
if (m_deactivated) return;
|
||||||
|
@ -302,6 +302,8 @@ namespace GUIEngine
|
|||||||
/** \brief callback from IRibbonListener */
|
/** \brief callback from IRibbonListener */
|
||||||
virtual void onSelectionChange(){}
|
virtual void onSelectionChange(){}
|
||||||
|
|
||||||
|
virtual void setText(const wchar_t *text);
|
||||||
|
|
||||||
virtual void update(float delta);
|
virtual void update(float delta);
|
||||||
|
|
||||||
/** Set approximately how many items are expected to be in this ribbon; will help the layout
|
/** Set approximately how many items are expected to be in this ribbon; will help the layout
|
||||||
|
@ -39,6 +39,7 @@ KartStatsWidget::KartStatsWidget(core::recti area, const int player_id,
|
|||||||
std::string kart_group, bool multiplayer,
|
std::string kart_group, bool multiplayer,
|
||||||
bool display_text) : Widget(WTYPE_DIV)
|
bool display_text) : Widget(WTYPE_DIV)
|
||||||
{
|
{
|
||||||
|
m_title_font = !multiplayer;
|
||||||
m_player_id = player_id;
|
m_player_id = player_id;
|
||||||
|
|
||||||
const std::string default_kart = UserConfigParams::m_default_kart;
|
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
|
// -- sizes
|
||||||
m_skill_bar_w = w;
|
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
|
// for shrinking effect
|
||||||
if (h < 175)
|
if (h < 175)
|
||||||
|
@ -218,6 +218,7 @@ void ArenasScreen::buildTrackList()
|
|||||||
|
|
||||||
bool soccer_mode = race_manager->getMinorMode() == RaceManager::MINOR_MODE_SOCCER;
|
bool soccer_mode = race_manager->getMinorMode() == RaceManager::MINOR_MODE_SOCCER;
|
||||||
bool arenas_have_navmesh = false;
|
bool arenas_have_navmesh = false;
|
||||||
|
int skipped = 0;
|
||||||
|
|
||||||
if (curr_group_name == ALL_ARENA_GROUPS_ID)
|
if (curr_group_name == ALL_ARENA_GROUPS_ID)
|
||||||
{
|
{
|
||||||
@ -276,8 +277,11 @@ void ArenasScreen::buildTrackList()
|
|||||||
(!(curr->hasNavMesh() ||
|
(!(curr->hasNavMesh() ||
|
||||||
race_manager->getNumLocalPlayers() > 1 ||
|
race_manager->getNumLocalPlayers() > 1 ||
|
||||||
UserConfigParams::m_artist_debug_mode)))
|
UserConfigParams::m_artist_debug_mode)))
|
||||||
|
{
|
||||||
|
skipped++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (PlayerManager::getCurrentPlayer()->isLocked(curr->getIdent()))
|
if (PlayerManager::getCurrentPlayer()->isLocked(curr->getIdent()))
|
||||||
{
|
{
|
||||||
@ -291,12 +295,13 @@ void ArenasScreen::buildTrackList()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (arenas_have_navmesh || race_manager->getNumLocalPlayers() > 1 ||
|
if ((arenas_have_navmesh || race_manager->getNumLocalPlayers() > 1 ||
|
||||||
UserConfigParams::m_artist_debug_mode)
|
UserConfigParams::m_artist_debug_mode) && !skipped)
|
||||||
w->addItem(_("Random Arena"), "random_track", "/gui/track_random.png");
|
w->addItem(_("Random Arena"), "random_track", "/gui/track_random.png");
|
||||||
w->updateItemDisplay();
|
w->updateItemDisplay();
|
||||||
|
|
||||||
assert(w->getItems().size() > 0);
|
if (skipped > 0)
|
||||||
|
w->setText( _("%i arenas unavailable in single player", skipped) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user