l10n: Danish translation + HUD edit mode fix#16
Open
TheCodingDad-TisonK wants to merge 22 commits into
Open
Conversation
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.
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.
…CS-011) Add a read-only integration that mirrors SeasonalCropStress irrigation operating cost into the TaxMod ledger once per in-game day, via the SCS B3.2b companion facade (getIrrigationSystems / getIrrigationCostsEnabled on g_currentMission.cropStressManager). - Bookkeeping only: uses the existing recordExpense companion API, which moves no money. SCS already deducts the operating cost each active hour, so this reflects a charge the player is already paying and never adds a second one (no double charge; the design's CC-1 decision). - Run-time is derived from each system's schedule with the same day-of-week and wrap-around window math SCS uses to flip a system active, so the accrual lands on the days SCS actually runs. Documented as an approximation (it cannot see a lost water source or a mid-day placement), matching the brief. - Attributes to the local player's farm via g_currentMission:getFarmId(), the same farm SCS's FinanceIntegration charges, so the mirror never disagrees with what SCS moved, and it skips (records nothing) when no farm resolves (e.g. dedicated server) exactly as SCS charges nothing there. This resolves the brief's OI-1 more precisely than its pivot-ownership assumption. - Gated on SCS's own costsEnabled so it never reports a cost the player disabled. Aggregates to one daily entry (the ledger keeps only 10). Depreciation is wired but ships neutral at 0 (needs capital value + useful life from the balance pass, OI-2). - Neutral and safe when SCS is absent or mid-load (pcall, server-only). Two EN l10n labels added. Wired into the existing daily tick in main.lua. Lua 5.1 syntax verified.
…tingsHub bridges + SCS-011 shipped; NetworkSync stays open)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TM_HUD_DRAGkey binding instead of RMBTest plan