Skip to content

l10n: Danish translation + HUD edit mode fix#16

Open
TheCodingDad-TisonK wants to merge 17 commits into
mainfrom
development
Open

l10n: Danish translation + HUD edit mode fix#16
TheCodingDad-TisonK wants to merge 17 commits into
mainfrom
development

Conversation

@TheCodingDad-TisonK

Copy link
Copy Markdown
Member

Summary

  • Add Danish (da) translation — all 23 strings, native speaker contribution by DJWestDK — closes Community Translations — Help Wanted #13
  • Fix HUD edit mode entry via TM_HUD_DRAG key binding instead of RMB
  • Fix RMB being unconditionally consumed in TaxHUD mouse handler

Test plan

  • Launch game with Danish language — confirm all Tax Mod UI strings appear in Danish
  • Confirm HUD drag/edit mode works correctly
  • Confirm RMB behaves normally outside the Tax HUD

TaxHUD returned true for every RMB event regardless of whether the cursor
was over the HUD, silently starving IncomeMod, NPCFavor, and other mods of
their right-click events. Now returns false when neither in edit mode nor
cursor-over-HUD, matching the SoilFertilizer pattern.

Fixes #51 (reported via FS25_FarmTablet)
Ports the SoilFertilizer pattern: edit mode is entered exclusively via a
dedicated key binding (TM_HUD_DRAG). RMB now only exits edit mode when
already active, and never consumes the event otherwise — preserving
CoursePlay, AutoDrive, and all other mods that rely on right-click.

Added TM_HUD_DRAG input action with PLAYER context registration and cleanup.
Replace all 23 [EN] placeholder da entries with full Danish translations
contributed by DJWestDK (native speaker) via issue #13.

Closes #13
applyAnnualTax ran addMoney on every machine (the tax updateable is not server-
guarded), so in MP every client deducted the tax. Guard only the addMoney with
getIsServer so the server deducts once and the engine syncs the balance; the
accumulation reset and stats stay on every machine (TaxMod has no MP stat sync,
so gating the whole function would drift client HUDs).
g_TaxManager.recordExpense(farmId, amount, label) records a tracked
money adjustment in a per-farm credit/debit ledger. Positive amount is
a credit, negative is a debit. Bookkeeping only: it never moves money
and never touches any tax computation.

- Server-authoritative: rejected with a warning on non-server peers
- Input validation: farmId positive number, amount finite non-zero,
  label optional string (defaulted), bad input warns and returns false
- Lifetime credit/debit totals persist per farm in the existing
  settings XML via the Mission00.saveToXMLFile hook path
- Recent entries kept in memory (last 10), same as the HUD tax history
- Surfaced as a new "Tracked credits/debits" HUD row and a Companion
  Ledger section in the taxStatistics console output
Registers Tax Mod's settings with FS25_SettingsHub (no-op when it is not
installed) so the FarmTablet System Settings app can list them. Resolves
the hub via g_currentMission.settingsHub (the cross-mod handle FarmTablet
reads); the bare g_settingsHub global is only visible inside SettingsHub's
own mod environment and reads back nil from here.
…isplay only

The mod owns its own persistence (FS25_TaxMod.xml) and loads it before the bridge
registers. Without selfPersisted the hub could restore its own stale copy and replay
it back through onChange on load, clobbering the real value (the SoilFertilizer
enabled=false reset-on-load bug class). Approved rollout to all self-persisted
companion bridges.
Migrates Tax Mod onto two of the four core-API bedrock engines, strictly
delegate-when-present so the standalone build is unchanged when bedrock is absent.

StateLedger (TaxMod_Data): serialize/apply the state portion (running stats + the
recordExpense companion ledger + day/month cursors), NOT settings (SettingsHub owns
those). serializeState/applyState are in-memory twins of the state half of
saveSettings/loadSettings; the own FS25_TaxMod.xml stays the standalone safety copy
and the first-load import when the ledger is absent. Same parseFile timing guard as
IncomeMod/WorkerCosts (state loads in loadMission00Finished). ledger.farms rebuilt in
place so the HUD's table reference stays valid.

MasterHUD (TaxMod_HUD): subscribe the tax HUD draw so MasterHUD owns the single
suspend-aware loop; the own FSBaseMission.draw hook stands down when active, sharing
one drawStack body so the two paths cannot diverge.

No NetworkSync bridge: Tax Mod ships zero own network events and its only
cross-client state is settings (SettingsHub's domain) plus a server-only ledger; there
is no existing transport to migrate. Money path already server-gated (F15), untouched.

Verified: all touched files parse Lua 5.1; TaxMod_Data round-trips through the real
StateLedger serializer with the sparse farmId ledger and integer keys intact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Community Translations — Help Wanted

1 participant