diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-05-01 05:04:38 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-05-01 05:04:38 +1000 |
commit | 789597dde49bf8ce6e374ea9afd00dd7295e21ce (patch) | |
tree | 1928c2b2517dacae21c42ce329a5f98ffeac9a25 | |
parent | 9e3048ea16316e434fb899b97b2b48e314fae457 (diff) |
fix inventory hotbar links breaking when moving an item
-rw-r--r-- | assets/opensb/highlights.config.patch | 20 | ||||
-rw-r--r-- | source/game/StarPlayerInventory.cpp | 3 | ||||
-rw-r--r-- | source/rendering/StarWorldPainter.cpp | 4 |
3 files changed, 23 insertions, 4 deletions
diff --git a/assets/opensb/highlights.config.patch b/assets/opensb/highlights.config.patch new file mode 100644 index 0000000..082ff13 --- /dev/null +++ b/assets/opensb/highlights.config.patch @@ -0,0 +1,20 @@ +{ + "highlightDirectives" : { + "interactive" : { + "underlay" : "?outline=1;DDD;0000", + "overlay" : "?fade=AAA;0.1" + }, + "inspectable" : { + "underlay" : "?outline=1;66FC;0000", + "overlay" : "?scanlines=55AC;0.4;55FC;0.4" + }, + "interesting" : { + "underlay" : "?outline=1;8F8C;0000", + "overlay" : "?scanlines=6E6;0.5;5C5;0.5" + }, + "inspected" : { + "underlay" : "?outline=1;E98C;0000", + "overlay" : "?scanlines=B76;0.5;A65;0.5" + } + } +} diff --git a/source/game/StarPlayerInventory.cpp b/source/game/StarPlayerInventory.cpp index bacd58d..0fbcd66 100644 --- a/source/game/StarPlayerInventory.cpp +++ b/source/game/StarPlayerInventory.cpp @@ -547,8 +547,7 @@ void PlayerInventory::shiftSwap(InventorySlot const& slot) { } else if (auto bs = slot.ptr<BagSlot>()) { if (itemAllowedInBag(m_swapSlot, bs->first)) { m_swapSlot = m_bags[bs->first]->swapItems(bs->second, m_swapSlot); - if (m_swapSlot && !m_swapSlot->empty()) - swapCustomBarLinks(SwapSlot(), slot); + swapCustomBarLinks(SwapSlot(), slot); } } diff --git a/source/rendering/StarWorldPainter.cpp b/source/rendering/StarWorldPainter.cpp index e15f00b..8dc0f33 100644 --- a/source/rendering/StarWorldPainter.cpp +++ b/source/rendering/StarWorldPainter.cpp @@ -273,7 +273,7 @@ void WorldPainter::drawEntityLayer(List<Drawable> drawables, EntityHighlightEffe if (d.isImage()) { auto underlayDrawable = Drawable(d); underlayDrawable.fullbright = true; - underlayDrawable.color = Color::rgbaf(1, 1, 1, highlightEffect.level); + underlayDrawable.color = Color::rgbaf(1, 1, 1, highlightEffect.level * d.color.alphaF()); underlayDrawable.imagePart().addDirectives(underlayDirectives, true); drawDrawable(std::move(underlayDrawable)); } @@ -287,7 +287,7 @@ void WorldPainter::drawEntityLayer(List<Drawable> drawables, EntityHighlightEffe if (!overlayDirectives.empty() && d.isImage()) { auto overlayDrawable = Drawable(d); overlayDrawable.fullbright = true; - overlayDrawable.color = Color::rgbaf(1, 1, 1, highlightEffect.level); + overlayDrawable.color = Color::rgbaf(1, 1, 1, highlightEffect.level * d.color.alphaF()); overlayDrawable.imagePart().addDirectives(overlayDirectives, true); drawDrawable(std::move(overlayDrawable)); } |