diff --git a/src/guiengine/widgets/dynamic_ribbon_widget.cpp b/src/guiengine/widgets/dynamic_ribbon_widget.cpp index ce6428911..cd3d16c05 100644 --- a/src/guiengine/widgets/dynamic_ribbon_widget.cpp +++ b/src/guiengine/widgets/dynamic_ribbon_widget.cpp @@ -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; } diff --git a/src/guiengine/widgets/dynamic_ribbon_widget.hpp b/src/guiengine/widgets/dynamic_ribbon_widget.hpp index a46a28202..d2e842cf8 100644 --- a/src/guiengine/widgets/dynamic_ribbon_widget.hpp +++ b/src/guiengine/widgets/dynamic_ribbon_widget.hpp @@ -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];