Skip to content

[10/10] Simplify features carried from upstream - #373

Merged
netniV merged 5 commits into
refactor/09-alignmentfrom
refactor/10-cleanup
Nov 14, 2026
Merged

netniV merged 5 commits into
refactor/09-alignmentfrom
refactor/10-cleanup

Conversation

@friendly-ripper

Copy link
Copy Markdown
Collaborator

Part 10 of 10 · base refactor/09-alignment · 5 commits

Several features carried from upstream guard against things another layer already handles: SPUD measures hook targets and refuses ones too small, a hook set installs whole or not at all and reports why, bindings report missing members and contain managed exceptions, and the dump checker catches drift before a release. This PR removes those repeats, replaces bookkeeping with the game's own calls where the metadata shows them, and fixes one shortcut regression. Net −1,519 lines.

What changes

  • Alliance Games Store. The alliance store's context handler is an empty method, so none of the regular store's refresh reaches it. Instead of a per-widget registry with epochs, GC roots, debounce and restore passes, the feature gives each card the game's own action tooltip once when it first binds, calls UpdateStoreCurrency() once bundles are ready, and after a regeneration calls the scroller's own scroll callback once it stops spawning. 516 → 109 lines, bindings 194 → 103; il2cpp::Object::TryCall and il2cpp::GcRoots go with it.
  • Queue fixes and fleet watch. Kir'Shara recovery keeps one record per dock slot instead of weak handles, serials, expiry and a mutex. The post-resume re-read that always matched, the address-guard re-checks, always-true parameters, the 8-target cap and il2cpp::Unbox are gone. The fleet sync watcher polls the 10 slots instead of running a staged state machine.
  • HUD and camera. The anomaly timer hides its panel instead of destroying it and looks the HUD up per tick; the Haven road pass keeps no handles; Haven zoom, backdrop scale and instant cargo drop checks of values the config reader or the game already guarantee.
  • Shortcuts and badges. The keyboard pan gate is CanUseShortcuts() alone, which already covers tutorials, text focus and popups. A modified movement binding such as move_left = "CTRL-LEFT" pans again. Released keys are cleared in Matches itself, so plain PGUP works right after CTRL-PGUP outside the system view too. Keybind badges install by [patches] only.
  • Toasts, audio and build identity. il2cpp::Guarded is gone; toast text reads bindings directly. CI checks the full identity marker in the build job and the attest job only attests. Identity values go to the resource compiler only; the marker format is unchanged.

Behavior changes

  • Kir'Shara recovery state is no longer cleared on toggle or session end; a stale record only matches the same fleet, target and attempt time. Thin protection resumes queues longer than 8 targets.
  • Fleet state records arrive within about 1 s; the login snapshot goes 5 s after the last slot change, without the 30 s cap.
  • Haven road bias is reapplied every 5 s instead of every 1 s.
  • Badges install even when the toggle shortcut is unbound.

Not yet checked in game

  1. Alliance Games Store: VIEW RESEARCH on eligible materials, no new buttons on other cards or in the regular store, every currency on first open and after a purchase, rows and Research actions after buying while scrolled down.
  2. Kir'Shara: removing a queued target mid-course starts the next one; moving another ship keeps the deployed fleet's queue.
  3. Fleet sync: a fleets-only target still gets its login snapshot and no records during login fill-in.
  4. Anomaly countdown shows, counts and hides; backdrops scale once in cached and fresh systems; cargo bars still snap.
  5. CTRL-LEFT panning; Windows toasts for battles, armadas and parameterised toasts.

Checks

Every commit: zig build test-il2cpp test-mod test-sync and the Windows cross build on Zig 0.16, and the macOS build in Debug and ReleaseFast. Tip: Zig 0.17 tests, Windows install with the identity check, zig build fmt, git diff --check, and the dump checker (no new problems).

tashcan added 5 commits November 12, 2026 14:45
The store's cards carry only a plain tooltip trigger and no action locale
assets, so their tooltip widget has nothing to put Research actions on. The
first time a card binds in the Alliance Games store, it now gets an action
trigger with the plain one's appearance and the assets of a loaded widget,
and the widget's own code picks the actions on every later bind. Nothing
tracks cards, and nothing is restored.

The store's context handler is an empty override, so it never rebuilds the
currency list or rebinds cards that spawn after a regeneration. After each
regeneration, once the scroller stops spawning, the store's currency list is
rebuilt and the cards in view are bound at the current position.

TryCall and GcRoots lose their only caller and are removed with their tests.
Faster queue recovery keeps one attempt per dock slot: the fleet,
the head it went for and the queue's attempt time. Those three name
the attempt, so the weak queue handles, serials, 30 s expiry, mutex,
session-end hook and toggle reset go. The hooks run on the game
thread like every Config::Get() caller. The course response handler
now only notes whether a failed response's queue was engaging; the
fleet, queue and target it compared restate the game's own lookup,
and il2cpp::Unbox loses its only caller.

Thin queue protection reads the whole queue instead of eight
targets, so a longer queue is no longer ineligible; the game bounds
its length. The second snapshot before resuming read the same state
in the same hook and is gone, as are parameters every caller passed
as true and the engage result name table.

The address guard no longer re-checks that the fleet owns a
non-empty queue or that the deployment looked up by its id has its
id. The native check walks that fleet's own queue. Three bindings
used only for it go.

Fleet sync reads every slot once a second. A slot that fills,
empties or changes hands schedules a snapshot after five quiet
seconds; until then state changes ride in that snapshot. This
replaces the seed, discovery and probe modes and their nine flags.

Fleet labels drop their installed flag, since a set that did not
commit tracks nothing, and no longer require NavigationZoom.Update,
which camera.cc stages and reports itself.
The anomaly timer looks up the navigation HUD on each tick through
ScreenManager::View, which already returns only a live HUD on a
visible canvas, so the held handle, the rediscovery throttle and
the replacement logic go. The panel lives under the alliance
drawer and is hidden rather than destroyed; Unity tears it down
with the drawer and the next tick builds it again. The clean-up
branches, the warning and its back-off, the hand-rolled clock and
the installer go with it, and unity::Destroy loses its only user.

Haven's road bias is one pass every 5 s over the visuals holder,
with no stored material handles, owner handle or dedupe set. The
road shader defines both offsets, so HasProperty goes, and the
zoom hook no longer re-checks finiteness, aliasing and ranges of
values the game and the settings reader already guarantee.

Backdrop scaling compares the remembered scale exactly, so an
authored scale reloaded from a cache never matches and is scaled
again. The authored flag, the revision counter and the popData
bindings that worked around the old 0.1 tolerance go.

The instant cargo counter decides on the bar's data class alone.
The X-of-Y label identifier is shared with other bars, so its
check and the warning it caused go.
A modified movement binding such as move_left = "CTRL-LEFT" pans
again. The pan hook switched keyboard panning off while any arrow
was owned by a modified chord, and the screen shortcuts claim the
arrow for that very binding earlier in the frame. Shortcut matching
already keeps a plain move binding waiting while its arrow belongs
to a CTRL-arrow chord, so the hook's own arrow check and
Shortcut::Owns go.

That per-frame Owns call was also what forgot released keys outside
a plain key press. Matching now prunes them itself, so CTRL-PGUP
followed by a fresh PGUP works in every view, not only where the pan
hook runs.

- The pan gate is ShortcutsManager.CanUseShortcuts alone. The game's
  gate already checks the tutorial input lock that
  TutorialManager.IsSceneInputAllowed reads, and its own text focus
  check, so the tutorial binding goes.
- The keybind badges install with the hotkey hooks, whatever
  toggle_shortcut_hints is bound to. Only [patches] decides which
  hooks install. HasBinding loses its last caller.
- A shortcut default that fails to parse is no longer handled at
  runtime; the defaults fixture pins every shortcut to a valid chord
  and now fails on one missing from it.
- The badge table's compile-time self-checks, the toggle's warning
  for a missing shortcut manager, the one-use camera helper and the
  ship badge test cases that repeat the gap and reorder cases go.
Toast text reads go straight through the bindings. il2cpp::Guarded
caught Windows access violations from raw offset reads, but every
read now goes through named, kind-checked bindings that report a
missing member and read it as zero, and macOS already ran the same
code unguarded. Guarded, its fault report and its doc row go.

Notify no longer handles a toast state without a title: settings
only yield catalog states and the title table names all of them.
Hull key names are title-cased once, by the battle body.

The notification cue cache drops its once_flags and range check.
Only the toast hooks call it, on the game thread, and the cue
always comes from the settings catalog. The test that fed it
out-of-range cues goes with them. The macOS player drops an ARC
branch; the build never enables ARC.

Build identity values reach only the resource compiler, as plain
-D options; version.rc composes the unchanged stfc-identity-v1
marker. The C++ macros, the never-used header defaults and the
environment fallbacks, which made Zig 0.17 reconfigure on every
run, are removed. CI checks the full marker with
verify-windows-binary.py --identity in the build job, so the
attest job only downloads and attests the DLL that job built.

FEATURES.md no longer limits chest-purchase sliders to Windows.
@netniV
netniV added this pull request to the merge queue Nov 14, 2026
Merged via the queue into dev with commit 98aa14e Nov 14, 2026
14 of 15 checks passed
@netniV
netniV deleted the refactor/10-cleanup branch November 14, 2026 00:06
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.

2 participants