Bug fixes
BUGS FIXED
-
HUD toggle desync — SettingsGUI.lua:consoleCommandToggleHUD
The persistent flag (settings.showHUD) and the runtime I-key flag (incomeHUD.visible) are both checked before drawing. The console command only set the persistent flag, leaving the runtime flag
untouched. If a player pressed I to hide the HUD, then called IncomeToggleHUD true, nothing would visually change. Now both flags are synced together when the console command fires. -
Missing showHUD in settings dump — SettingsGUI.lua:consoleCommandShowSettings
IncomeShowSettings printed all 9 settings except showHUD. Added it. Console troubleshooting dumps are now complete.
CODE NOT HOOKED UP
- IncomeReportDialog:onOpen — IncomeReportDialog.lua
The XML declares onOpen="onOpen" which FS25 fires on every open. The class had no override, so the base ScreenElement.onOpen ran silently. Added an explicit override that calls updateDisplay() — now
the dialog refreshes its data on every open, not just through the show() path.
DANGLING REFERENCE
- IncomeManager:delete() — IncomeManager.lua
The action event IDs were properly nilled, the HUD was properly deleted, but incomeReportDialog was left holding a live reference after shutdown. Added self.incomeReportDialog = nil alongside the
other cleanup.
POLISH
-
Double blank lines — UIHelper.lua
Stray double blank lines left after opt.onClickCallback = "handleChange" in both createBinaryOption and createMultiOption. Removed. -
Ring buffer clarification — IncomeReportDialog.lua:updateStats
Added a doc comment noting that totalEarnedText and avgPaymentText reflect only the last 10 payments from the ring buffer, not all-time earnings.