Project Zomboid

Project Zomboid

SpiffUI - Inventory
Albrekdt Feb 26, 2024 @ 8:47am
Tarkov UI flicker when clicking external containers.
So this bug is very specifik, but I will try to explain:

When you use this mod together with Tarkov UI, the Tarkov menu will pop up for a brief moment every time I click on a container, like a short flicker. This ONLY happens if:

1. the Equipment UI (Tarkov) is docked to the inventory
2. SpiffUI inventory rules are turned ON.
3. you have clicked anywhere in your inventory menu (EXCEPT the tarkov menu itself, or any external container)

In short: the flicker accurs only when the main inventory has been touched in any way, like if the tarkov menu has to be the selected window at all times to not freak out.

I hope this was not too confusing.
< >
Showing 1-2 of 2 comments
Biotwister May 27 @ 10:20pm 
Worked through a fix for the flickering of the EquipmentUI panel attached to the Inventory panel when hovering on and away from the Loot Panel when using the auto-hide feature of SpiffUI Inventory (sandbox option ‘Enable SpiffUI Inventory Rules’). All code changes are in the SUI_InventoryPage.lua file:

First need to decouple both panels autohiding together, by removing:
line 223: self.friend:setVisibleReal(spiff.Conf.invVisible)
line 244: self.friend:setVisibleReal(true)

Second change is related to the update function (starts line 567), and further prevents a trigger of the Inventory panel when interacting with the Loot Panel:
Adding/Changing the lines starting at 720 (would end at 729):
if self.onCharacter then
if self:isMouseInTop() or self:isMouseOverEquipmentUi() then
self:Collapse(false, "MouseMoveIn Player Inv")
self.autoHide = true
end
else -- For the loot panel, it should only show if its top is moused over.
if self:isMouseInTop() then
self:Collapse(false, "MouseMoveIn Loot Inv")
self.autoHide = true
end
end

Remove the following:
line 733 - 734:
else
self:Collapse(false, "force visible")

These following changes allow the auto-hide feature without the flickering of the EquipmentUI
Biotwister May 27 @ 10:21pm 
Also possible fix for autohide not working when drag to floor

Not sure if intended with auto-hide, but dragging an item to the floor causes the inventory/loot panel to remain open even with auto-hide enabled. Will collapse upon mouse clicks. The following changes to the SUI_InventoryPage.lua file can fix this

Within the function ISInventoryPage:update()

... (existing code) ...

if not self.isCollapsed then
if not self.fVisible then
if (not ISMouseDrag.dragging or #ISMouseDrag.dragging == 0) then
if self.fromDrag then
self.fromDrag = false
self.autoHide = true

if not self:isMouseInBuffer() and not self.friend:isMouseInBuffer() then -- Check if mouse is NOT in either panel
self.holdOpen = false -- Ensure holdOpen is reset to allow auto-hide
self.wasDrag = false -- Also clear wasDrag if not hovering over a friend
else
self.wasDrag = self.friend.mouseOver -- Keep existing logic if hovering over friend
self.holdOpen = not self.wasDrag -- Keep existing holdOpen logic based on wasDrag
end

end

…(rest of code) …
end
Last edited by Biotwister; May 27 @ 10:22pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50