Skip to content

confirm_selection returns "ok" but does not close NDeckEnchantSelectScreen (enchant screens from Kifuda / Gnarled Hammer / Beautiful Bracelet) #118

Description

@DeLaMoraRodrigo

Summary

Calling confirm_selection on the enchant card-selection screen (NDeckEnchantSelectScreen) returns
{"status": "ok"} but the screen never closes. The game does not process the confirmation.
select_card works correctly on this screen (visual selection toggles as expected); only the confirm
step fails.

Steps to reproduce

  1. Obtain a Kifuda relic, Gnarled Hammer relic, or Beautiful Bracelet relic that triggers an enchant
    selection screen.
  2. Call select_card with a valid card index — the card is visually highlighted in-game. ✅
  3. Call confirm_selection — the API returns {"status": "ok", "message": "Confirming selection"}. ❌
  4. Poll the game state — state_type is still card_select, screen_type is still
    NDeckEnchantSelectScreen. The screen has not closed.

Expected behavior

confirm_selection closes the enchant screen and applies the enchant, matching the behavior when a
player physically clicks the checkmark button.

Actual behavior

The API returns ok but the screen remains open indefinitely. Repeated calls have no effect. The only
way to close the screen is via physical mouse input (e.g. pyautogui.click at the checkmark's screen
coordinates).

Source code note

ExecuteConfirmSelection() in McpMod.Actions.cs contains a fallback at lines ~702-716 with the
comment:

// Fallback: find ANY enabled NConfirmButton in the screen tree.
// Covers NCardGridSelectionScreen subclasses (like NDeckEnchantSelectScreen)
// whose confirm button isn't in any of the known container paths above.
var allConfirmButtons = FindAll(screen);
foreach (var btn in allConfirmButtons)
{
if (btn.IsEnabled && btn.IsVisibleInTree())
{
btn.ForceClick();
return ...ok...
}
}

The fallback does find the button (it returns ok rather than the "no confirm button is currently
enabled" error), so btn.IsEnabled && btn.IsVisibleInTree() is true. The problem is that ForceClick()
on that button does not trigger the game's enchant confirmation logic for this screen type.

Environment

  • STS2 Early Access (current version as of 2026-07)
  • STS2MCP mod (current main branch)
  • Single-player run, Ironclad character
  • Screen appears mid-run from Kifuda triple-enchant trigger

Workaround

Physically clicking the checkmark button at approximately (94.5%, 76%) of the game window rect works
correctly. We are using pyautogui as a workaround on our end until this is fixed in the mod.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions