Project Zomboid

Project Zomboid

B42/41 Dragon Radar v2.4
Remove item from the list if it's picked up
First I posted as a comment that it might be possible to do it, but then decided to actually try to do it myself, along with the help of deepseek I was able to get something that somewhat works but still with an error regarding the panel that appears when you press toggle list.

In the DR_ItemSearchPanel.lua you add the following function.
-- Override ISInventoryTransferAction_perform to check for picked-up items local original_ISInventoryTransferAction_perform = ISInventoryTransferAction.perform function ISInventoryTransferAction:perform() -- Check if the destination is the player's inventory or a container within it local playerInventory = self.character:getInventory() local needsCheck = false if self.destContainer == playerInventory then -- Directly into the player's main inventory needsCheck = true else -- Check if the destination is a container within the player's inventory local containingItem = self.destContainer:getContainingItem() if containingItem and playerInventory:containsRecursive(containingItem) then needsCheck = true end end if needsCheck then -- Check if the item is in the search list local item = self.item local itemID = item:getRegistry_id() if DR.looking_for:contains(itemID) then -- Remove the item from the search list DR.looking_for:remove(itemID) DR.looking_for_items:remove(item) DR.player:playSoundLocal("MapRemoveMarking") -- Notify the player DR.player:Say("Item removed from search list: " .. item:getName()) -- Simulate a double-click to remove the item from the UI panel -- THIS IS GIVING AN ERROR --if DR.ui_lkf then --DR.ui_lkf:chooseItem(item) --end end end -- Call the original function original_ISInventoryTransferAction_perform(self) end
Last edited by Marads~Yuuka; 29 Jan @ 2:59pm
< >
Showing 1-1 of 1 comments
The item is correctly being removed and won't get new markings on the map, but it still appears on that small panel and I wasn't able to make it disapear from that list.

Adding a toggle to the ui to use this new function would be the best course because it's different from how it works right now so people might actually preffer the current way instead of having it removed from the list when picked.
< >
Showing 1-1 of 1 comments
Per page: 1530 50