Merge branch 'master' of github.com:supertuxkart/stk-code
This commit is contained in:
commit
09f8ffb16e
@ -757,9 +757,9 @@ void DynamicRibbonWidget::onRibbonWidgetFocus(RibbonWidget* emitter, const int p
|
||||
#pragma mark Setters / Actions
|
||||
#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
|
||||
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))
|
||||
{
|
||||
// if we get here it means the item is scrolled out. Try to find it.
|
||||
scroll(1);
|
||||
scroll(1, evenIfDeactivated);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ namespace GUIEngine
|
||||
void buildInternalStructure();
|
||||
|
||||
/** 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 */
|
||||
int m_selected_item[MAX_PLAYER_COUNT];
|
||||
|
Loading…
Reference in New Issue
Block a user