Merge branch 'master' of github.com:supertuxkart/stk-code

This commit is contained in:
hiker 2014-10-16 07:40:43 +11:00
commit 09f8ffb16e
2 changed files with 5 additions and 5 deletions

View File

@ -757,9 +757,9 @@ void DynamicRibbonWidget::onRibbonWidgetFocus(RibbonWidget* emitter, const int p
#pragma mark Setters / Actions #pragma mark Setters / Actions
#endif #endif
void DynamicRibbonWidget::scroll(const int x_delta) void DynamicRibbonWidget::scroll(int x_delta, bool evenIfDeactivated)
{ {
if (m_deactivated) return; if (m_deactivated && !evenIfDeactivated) return;
// Refuse to scroll when everything is visible // Refuse to scroll when everything is visible
if ((int)m_items.size() <= m_row_amount*m_col_amount) return; if ((int)m_items.size() <= m_row_amount*m_col_amount) return;
@ -1081,11 +1081,11 @@ bool DynamicRibbonWidget::setSelection(int item_id, const int playerID,
while (!findItemInRows(name.c_str(), &row, &id)) while (!findItemInRows(name.c_str(), &row, &id))
{ {
// if we get here it means the item is scrolled out. Try to find it. // if we get here it means the item is scrolled out. Try to find it.
scroll(1); scroll(1, evenIfDeactivated);
if (iterations > 50) if (iterations > 50)
{ {
Log::fatal("DynamicRibbonWidget::setSelection", "Cannot find item %d (%s)", item_id, name.c_str()); Log::error("DynamicRibbonWidget::setSelection", "Cannot find item %d (%s)", item_id, name.c_str());
return false; return false;
} }

View File

@ -159,7 +159,7 @@ namespace GUIEngine
void buildInternalStructure(); void buildInternalStructure();
/** Call this to scroll within a scrollable ribbon */ /** Call this to scroll within a scrollable ribbon */
void scroll(const int x_delta); void scroll(int x_delta, bool evenIfDeactivated = false);
/** Used for combo ribbons, to contain the ID of the currently selected item for each player */ /** Used for combo ribbons, to contain the ID of the currently selected item for each player */
int m_selected_item[MAX_PLAYER_COUNT]; int m_selected_item[MAX_PLAYER_COUNT];