diff --git a/src/guiengine/skin.cpp b/src/guiengine/skin.cpp index bdcc07a36..0dc5e97f5 100644 --- a/src/guiengine/skin.cpp +++ b/src/guiengine/skin.cpp @@ -651,6 +651,9 @@ void Skin::drawRibbonChild(const core::rect< s32 > &rect, Widget* widget, const 0 /* no clipping */, 0, true /* alpha */); } + // if multiple player selected the same ribbon item, we need to know to make it visible + int nPlayersOnThisItem = 0; + if (mark_focused) { if (use_glow) @@ -696,6 +699,7 @@ void Skin::drawRibbonChild(const core::rect< s32 > &rect, Widget* widget, const //core::rect source_area = core::rect(0, 0, texture_w, texture_h); drawBoxFromStretchableTexture(w, rect, SkinConfig::m_render_params["squareFocusHalo::neutral"]); + nPlayersOnThisItem++; } } // end if mark_focused @@ -703,11 +707,35 @@ void Skin::drawRibbonChild(const core::rect< s32 > &rect, Widget* widget, const if (parent_focused) { if (widget->isFocusedForPlayer(1)) - drawBoxFromStretchableTexture(w, rect, SkinConfig::m_render_params["squareFocusHalo2::neutral"]); + { + if (nPlayersOnThisItem > 0) + { + core::rect< s32 > rect2 = rect; + const int enlarge = nPlayersOnThisItem*6; + rect2.UpperLeftCorner.X -= enlarge; + rect2.UpperLeftCorner.Y -= enlarge; + rect2.LowerRightCorner.X += enlarge; + rect2.LowerRightCorner.Y += enlarge; + drawBoxFromStretchableTexture(w, rect2, SkinConfig::m_render_params["squareFocusHalo2::neutral"]); + } + else + { + drawBoxFromStretchableTexture(w, rect, SkinConfig::m_render_params["squareFocusHalo2::neutral"]); + } + + nPlayersOnThisItem++; + } + if (widget->isFocusedForPlayer(2)) + { drawBoxFromStretchableTexture(w, rect, SkinConfig::m_render_params["squareFocusHalo3::neutral"]); + nPlayersOnThisItem++; + } + if (widget->isFocusedForPlayer(3)) + { drawBoxFromStretchableTexture(w, rect, SkinConfig::m_render_params["squareFocusHalo4::neutral"]); + } } } // end if icon ribbons diff --git a/src/guiengine/widgets/ribbon_widget.cpp b/src/guiengine/widgets/ribbon_widget.cpp index 80cb61eec..ccbb919a5 100644 --- a/src/guiengine/widgets/ribbon_widget.cpp +++ b/src/guiengine/widgets/ribbon_widget.cpp @@ -230,7 +230,7 @@ bool RibbonWidget::rightPressed(const int playerID) else m_selection[playerID] = 0; } updateSelection(); - m_focus = m_children.get(m_selection[playerID]); + if (playerID == 0) m_focus = m_children.get(m_selection[playerID]); return m_ribbon_type != RIBBON_TOOLBAR; } @@ -248,7 +248,8 @@ bool RibbonWidget::leftPressed(const int playerID) else m_selection[playerID] = m_children.size()-1; } updateSelection(); - m_focus = m_children.get(m_selection[playerID]); + + if (playerID == 0) m_focus = m_children.get(m_selection[playerID]); return m_ribbon_type != RIBBON_TOOLBAR; } diff --git a/src/guiengine/widgets/ribbon_widget.hpp b/src/guiengine/widgets/ribbon_widget.hpp index 23292d04f..03b598af6 100644 --- a/src/guiengine/widgets/ribbon_widget.hpp +++ b/src/guiengine/widgets/ribbon_widget.hpp @@ -68,7 +68,8 @@ namespace GUIEngine public: - /** Contains which element within the ribbon is currently focused (used by the skin) */ + /** Contains which element within the ribbon is currently focused (used by the skin to + show mouse hovers over items that are not selected) */ Widget* m_focus; RibbonWidget(const RibbonType type=RIBBON_COMBO);