Skip to content

feat: auto-confirm the alliance max-level contribution warning - #336

Merged
netniV merged 1 commit into
STFC-Mod:devfrom
GingerNinja-STFC:feat/auto-confirm-alliance-contribution
Oct 20, 2026
Merged

netniV merged 1 commit into
STFC-Mod:devfrom
GingerNinja-STFC:feat/auto-confirm-alliance-contribution

Conversation

@GingerNinja-STFC

Copy link
Copy Markdown
Contributor

Summary

Adds a new ui.auto_confirm_alliance_contribution setting (default false) that
skips the confirmation popup shown when contributing to an alliance that has already
reached level 60. When enabled, the warning is answered with "Yes" automatically and
the contribution goes through without interruption.

How it works

The level-60 warning is shown through the game's shared MessageBox API. Its callback
(AllianceContributionViewController.<>c__DisplayClass72_0.<RequestAction>b__0) only
proceeds on MessageBox.ButtonResult.Yes (value 3, verified against the client
disassembly). Rather than installing new hooks, the existing shared
MessageBox.Show/MessageBox.ShowWithCallback detours now recognize this callback
(via IsAllianceContributionMaxLevelWarning()) and — when the setting is enabled —
invoke it directly with Yes instead of showing the popup.

Implementation notes

  • The detours behind this patch now own two auto-confirm behaviors (Forbidden Tech
    upgrades and the alliance contribution warning), so the patch entry label was
    renamed from ForbiddenTechConfirm to MessageBoxConfirmations. This is cosmetic;
    the installer, hook set, and the existing [patches] forbiddentechconfirmhooks
    toggle are unchanged, so existing user configs are unaffected.
  • Hook installation stays unconditional (gated only by the existing [patches]
    install toggle, default on). The ui.auto_confirm_alliance_contribution feature
    setting is checked inside the hook; when it is disabled, the native popup behavior
    is preserved exactly.
  • The default (false) keeps stock behavior; the setting is opt-in, mirroring
    auto_confirm_ft_upgrade and auto_confirm_reveal_ability.
  • example_community_patch_settings_en.toml updated with the new setting (other
    locales left untouched per repo convention).

Testing

  • xmake -y mods builds clean on macOS (arm64, debug, --target_minver=14.6)
  • git diff --check passes; no whitespace/conflict artifacts
  • macOS in-game verification: setting off → warning shows as usual; setting on →
    warning suppressed and contribution applied (also sanity-check that other
    MessageBox popups — event ads, store offers, generic OK/Cancel dialogs — are
    unaffected)
  • Windows build and runtime testing still needed — the MessageBox detours and
    the ButtonResult.Yes (= 3) constant should be verified against the Windows
    client (_WIN32/_M_X64), and the popup should be exercised in-game with the
    setting both off (native warning appears) and on (warning is skipped, the
    contribution registers normally)

Add a ui.auto_confirm_alliance_contribution TOML setting (default false)
that skips the level-60 warning popup shown before contributing to a
max-level alliance.

The warning's MessageBox callback
(AllianceContributionViewController.<>c__DisplayClass72_0.<RequestAction>b__0)
only proceeds on MessageBox.ButtonResult.Yes (= 3, verified against the
client disassembly), so the existing shared MessageBox.Show detours now
invoke it with Yes instead of showing the popup. The detours are
consolidated behind the existing install gate, which now triggers on
either the Forbidden Tech or the new setting.

Cherry-picked from stfc-mod-personal (3f202ff). Adapted to this tree's
design: the MessageBox hooks stay installed unconditionally via the
[patches] installForbiddenTechConfirmationHooks toggle with the feature
setting checked inside the hook, and the patch entry label is renamed to
MessageBoxConfirmations since the detours now own two auto-confirm
behaviors.
@netniV
netniV merged commit 5ae1ede into STFC-Mod:dev Oct 20, 2026
6 checks passed
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