Problem
The taxMouseHandler in main.lua accepts eventUsed in its signature but ignores it.
Current code (main.lua ~line 538):
function taxMouseHandler:mouseEvent(posX, posY, isDown, isUp, button, eventUsed)
if taxHUD then taxHUD:onMouseEvent(posX, posY, isDown, isUp, button) end
end
eventUsed is declared but never checked or returned. This means:
- Events consumed by a vehicle camera or another listener still reach the tax HUD
- When the HUD consumes an event, downstream listeners are never notified
TaxHUD:onMouseEvent (src/ui/TaxHUD.lua ~line 252) also has the same gap — no eventUsed parameter, no return value.
Impact
In vehicles, the camera system consumes RMB events before mod listeners run. With no guard, the tax HUD can respond to those already-consumed events and trigger edit mode with a stale cursor position.
Fix
main.lua:
function taxMouseHandler:mouseEvent(posX, posY, isDown, isUp, button, eventUsed)
if not eventUsed and taxHUD then
eventUsed = taxHUD:onMouseEvent(posX, posY, isDown, isUp, button, eventUsed) or eventUsed
end
return eventUsed
end
TaxHUD:onMouseEvent:
function TaxHUD:onMouseEvent(posX, posY, isDown, isUp, button, eventUsed)
-- ... existing logic ...
-- return true when consuming, false otherwise
end
Use Input.MOUSE_BUTTON_RIGHT (= 3) and Input.MOUSE_BUTTON_LEFT (= 1) constants — confirmed in LUADOC.
Reference
Fixed in FS25_SoilFertilizer commit d5b8f31 (issue TheCodingDad-TisonK/FS25_SoilFertilizer#130).
Problem
The
taxMouseHandlerinmain.luaacceptseventUsedin its signature but ignores it.Current code (main.lua ~line 538):
eventUsedis declared but never checked or returned. This means:TaxHUD:onMouseEvent(src/ui/TaxHUD.lua ~line 252) also has the same gap — noeventUsedparameter, no return value.Impact
In vehicles, the camera system consumes RMB events before mod listeners run. With no guard, the tax HUD can respond to those already-consumed events and trigger edit mode with a stale cursor position.
Fix
main.lua:
TaxHUD:onMouseEvent:
Use
Input.MOUSE_BUTTON_RIGHT(= 3) andInput.MOUSE_BUTTON_LEFT(= 1) constants — confirmed in LUADOC.Reference
Fixed in FS25_SoilFertilizer commit
d5b8f31(issue TheCodingDad-TisonK/FS25_SoilFertilizer#130).