@@ -1620,21 +1620,15 @@ void BuyMenuGUI::Update() {
1620
1620
1621
1621
GUIListPanel::Item* pItem = m_pShopList->GetItem (mousePosX, mousePosY);
1622
1622
1623
+ // If the player clicked on a loadout preset, deploy it
1623
1624
if (pItem && m_MenuCategory == PRESETS) {
1624
- // The presets list must have a mouse-down event to select an item, whereas we implicitly select items on hover in other categories
1625
- m_LastHoveredMouseIndex = pItem->m_ID ;
1626
-
1627
- // Play select sound if new index
1628
- if (m_ListItemIndex != pItem->m_ID ) {
1629
- g_GUISound.SelectionChangeSound ()->Play (m_pController->GetPlayer ());
1625
+ // Beep if there's an error
1626
+ if (!DeployLoadout (m_ListItemIndex)) {
1627
+ g_GUISound.UserErrorSound ()->Play (m_pController->GetPlayer ());
1630
1628
}
1631
-
1632
- m_pShopList->SetSelectedIndex (m_CategoryItemIndex[m_MenuCategory] = m_ListItemIndex = pItem->m_ID );
1633
1629
}
1634
-
1635
-
1636
1630
// If a module group list item, toggle its expansion and update the list
1637
- if (pItem && pItem->m_ExtraIndex >= 0 ) {
1631
+ else if (pItem && pItem->m_ExtraIndex >= 0 ) {
1638
1632
// Make appropriate sound
1639
1633
if (!m_aExpandedModules[pItem->m_ExtraIndex ])
1640
1634
g_GUISound.ItemChangeSound ()->Play (m_pController->GetPlayer ());
@@ -1646,12 +1640,6 @@ void BuyMenuGUI::Update() {
1646
1640
// Re-populate the item list with the new module expansion configuation
1647
1641
CategoryChange (false );
1648
1642
}
1649
- // Special case: user clicked on a loadout set, so load it into the menu
1650
- else if (pItem && m_MenuCategory == PRESETS) {
1651
- // Beep if there's an error
1652
- if (!DeployLoadout (m_ListItemIndex))
1653
- g_GUISound.UserErrorSound ()->Play (m_pController->GetPlayer ());
1654
- }
1655
1643
// Normal: only add an item if there's an entity attached to the list item
1656
1644
else if (pItem && pItem->m_pEntity ) {
1657
1645
m_CategoryItemIndex[m_MenuCategory] = m_ListItemIndex = m_pShopList->GetSelectedIndex ();
@@ -1714,8 +1702,7 @@ void BuyMenuGUI::Update() {
1714
1702
// See if it's hovering over any item
1715
1703
GUIListPanel::Item* pItem = m_pShopList->GetItem (mousePosX, mousePosY);
1716
1704
if (pItem) {
1717
- // On presets Menu, you must actively click to select an item. Anywhere else, an implicit hover will select
1718
- if (m_MenuCategory != PRESETS && m_LastHoveredMouseIndex != pItem->m_ID ) {
1705
+ if (m_LastHoveredMouseIndex != pItem->m_ID ) {
1719
1706
// Don't let mouse movement change the index if it's still hovering inside the same item.
1720
1707
// This is to avoid erratic selection curosr if using both mouse and keyboard to work the menu
1721
1708
m_LastHoveredMouseIndex = pItem->m_ID ;
0 commit comments