Skip to content

Return to part gui when pressing escape in part sub-guis - #1713

Merged
rubensworks merged 2 commits into
master-1.21-ltsfrom
claude/aspect-settings-escape-back
Aug 30, 2026
Merged

Return to part gui when pressing escape in part sub-guis#1713
rubensworks merged 2 commits into
master-1.21-ltsfrom
claude/aspect-settings-escape-back

Conversation

@rubensworks

@rubensworks rubensworks commented Aug 30, 2026

Copy link
Copy Markdown
Member

Pressing escape in the aspect settings, part settings, or part offsets gui closed all guis, forcing the player to re-open the part and navigate back to where they were.

Escape now does the same as the button that already exists in each of these guis for leaving it: it saves the current values and reopens the part gui the player came from.

Changes

Each of these three screens overrides keyPressed and delegated the escape key to super.keyPressed, which ends up calling closeContainer. Instead, they now trigger the press callback of their existing exit/save button:

Screen Button reused Server action
ContainerScreenAspectSettings the << button (top-left) ContainerAspectSettings.BUTTON_EXIT
ContainerScreenPartSettings the Save button ContainerPartSettings.BUTTON_SAVE
ContainerScreenPartOffset the Save button ContainerPartOffset.BUTTON_SAVE

All three of those button actions already call PartHelpers.openContainerPart(...) server-side, so the part gui reopens instead of everything closing. The client-side half of each callback (saveSetting() / onSave()) still runs, so escape keeps saving exactly as it did before.

Reusing the buttons' callbacks rather than duplicating their logic keeps the two ways of leaving each gui from drifting apart.

These guis are only ever opened from a part gui (ContainerMultipart / ContainerMultipartAspects, via PartHelpers.openContainerPartSettings / openContainerPartOffsets / openContainerAspectSettings), so the part gui is always the correct place to return to.

Testing

./gradlew compileJava passes. The change is client-side gui input handling only, so it isn't covered by unit or game tests; verified by reading the existing exit/save button flows it now reuses.

Pressing escape in an aspect's property gui closed all guis.
Instead, it now saves the setting and reopens the part's aspect
overview gui, just like the existing "<<" exit button does.
@coveralls

coveralls commented Aug 30, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 46.771% (-0.06%) from 46.829% — claude/aspect-settings-escape-back into master-1.21-lts

Just like in the aspect settings gui, escape now reuses the existing
"Save" button action, which saves the values and reopens the part gui,
instead of closing all guis.
@rubensworks rubensworks changed the title Return to part gui when pressing escape in aspect settings gui Return to part gui when pressing escape in part sub-guis Aug 30, 2026
@rubensworks
rubensworks merged commit 0c4c502 into master-1.21-lts Aug 30, 2026
7 checks passed
@rubensworks
rubensworks deleted the claude/aspect-settings-escape-back branch August 30, 2026 12:55
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.

3 participants