diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-28 01:07:55 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-28 01:07:55 +1000 |
commit | 59ab7dabe6b24fe998764f23d0da15aa7d4af3f9 (patch) | |
tree | c3a318aa247027be531227f1d71238dbb0bee94b /source/frontend/StarInventory.cpp | |
parent | a1e428fafa61b98d5405914290f251978cd9ac31 (diff) |
Misc internal UI fixes
Diffstat (limited to 'source/frontend/StarInventory.cpp')
-rw-r--r-- | source/frontend/StarInventory.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/frontend/StarInventory.cpp b/source/frontend/StarInventory.cpp index e54f288..a5a17e1 100644 --- a/source/frontend/StarInventory.cpp +++ b/source/frontend/StarInventory.cpp @@ -286,10 +286,12 @@ void InventoryPane::update() { } if (ItemPtr swapSlot = inventory->swapSlotItem()) { - for (auto pair : m_itemGrids) { - if (pair.first != m_selectedTab && PlayerInventory::itemAllowedInBag(swapSlot, pair.first)) { - selectTab(pair.first); - break; + if (!PlayerInventory::itemAllowedInBag(swapSlot, m_selectedTab)) { + for (auto& pair : m_itemGrids) { + if (pair.first != m_selectedTab && PlayerInventory::itemAllowedInBag(swapSlot, pair.first)) { + selectTab(pair.first); + break; + } } } } @@ -304,14 +306,14 @@ void InventoryPane::update() { m_itemGrids[m_selectedTab]->clearChangedSlots(); - for (auto pair : m_newItemMarkers) { + for (auto& pair : m_newItemMarkers) { if (m_itemGrids[pair.first]->slotsChanged()) pair.second->show(); else pair.second->hide(); } - for (auto techOverlay : m_disabledTechOverlays) + for (auto& techOverlay : m_disabledTechOverlays) techOverlay->setVisibility(m_player->techOverridden()); auto healthLabel = fetchChild<LabelWidget>("healthtext"); @@ -408,6 +410,8 @@ void InventoryPane::update() { context->playAudio(RandomSource().randFrom(m_putDownSounds)); m_currentSwapSlotItem = {}; } + + m_title = m_player->name(); } void InventoryPane::selectTab(String const& selected) { |