Problem
The incomeMouseHandler in src/main.lua accepts eventUsed in its signature but does not check it before processing and does not return it.
Current code (src/main.lua ~line 81):
function incomeMouseHandler:mouseEvent(posX, posY, isDown, isUp, button, eventUsed)
if im and im.incomeHUD then
im.incomeHUD:onMouseEvent(posX, posY, isDown, isUp, button)
end
end
The parameter is declared but silently ignored. This means:
- Events already consumed by a vehicle camera or another listener still trigger HUD processing
- When the HUD does consume an event, the flag is never passed back to the engine
Impact
In vehicles, the camera system consumes RMB events before mod listeners run. With no eventUsed guard, the income HUD can respond to those already-consumed events, potentially entering edit mode with a stale cursor position.
Fix
function incomeMouseHandler:mouseEvent(posX, posY, isDown, isUp, button, eventUsed)
if not eventUsed and im and im.incomeHUD then
eventUsed = im.incomeHUD:onMouseEvent(posX, posY, isDown, isUp, button, eventUsed) or eventUsed
end
return eventUsed
end
IncomeHUD:onMouseEvent also needs to accept eventUsed and return true when it consumes an event, false otherwise.
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
incomeMouseHandlerinsrc/main.luaacceptseventUsedin its signature but does not check it before processing and does not return it.Current code (src/main.lua ~line 81):
The parameter is declared but silently ignored. This means:
Impact
In vehicles, the camera system consumes RMB events before mod listeners run. With no
eventUsedguard, the income HUD can respond to those already-consumed events, potentially entering edit mode with a stale cursor position.Fix
IncomeHUD:onMouseEventalso needs to accepteventUsedand returntruewhen it consumes an event,falseotherwise.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).