Skip to content

Pin auto-crafted items to the first row of ME terminals - #607

Open
programgames wants to merge 1 commit into
AE2-UEL:masterfrom
programgames:feature/pin-crafted-items
Open

Pin auto-crafted items to the first row of ME terminals#607
programgames wants to merge 1 commit into
AE2-UEL:masterfrom
programgames:feature/pin-crafted-items

Conversation

@programgames

@programgames programgames commented Sep 11, 2026

Copy link
Copy Markdown

What

When a player requests a crafting job, the requested item is pinned to the first row of that player's ME terminal. The pin stays until the terminal is closed after the job ends, so the player does not have to search for the result.

How

Side File Role
Server CraftingCPUCluster Sends a packet to the requesting player when a job starts, completes or is cancelled. resolveRequestingPlayer() is extracted from the existing notifyRequester().
Network PacketPinCraftedItem (new) Carries the IAEItemStack and a finished flag. The finished notice is always processed, so a pin cannot get stuck when the option is turned off mid-craft.
Network AppEngPacketHandlerBase Registers the packet type.
Client PinnedKeys (new) Static client-side registry, capped at MAX_PINNED = 9 (one row), evicting the oldest entry.
Client ClientHelper Clears the registry on disconnect, and prunes it on client tick only while no screen is open.
Client ItemRepo Reserves the first row for pinned entries. Opt-in via setPinnedRowEnabled(), off by default so GuiNetworkStatus and other consumers are unaffected.
Client GuiMEMonitorable Enables the row, passes perRow to setRowSize() for TerminalStyle.FULL, keeps the pinned row out of the scroll range, and highlights it.
Config AEConfig Adds the pinAutoCraftedItems client option, on by default.

Notes

  • Pinned entries ignore the search box and the view filters, so they stay visible while searching.
  • The pinned row does not scroll: it is excluded from the scrollbar range computation.
  • drawRect() leaves the GL colour tinted, so it is reset to opaque white right after the highlight is drawn.
  • The packet is not gated on AEFeature.CRAFTING_TOASTS: a player who disabled toasts still gets pinning.

When a player requests a crafting job, the requested item is pinned to the
first row of that player's ME terminal until the terminal is closed after
the job ends, so it stays visible without searching for it.

- Add PinnedKeys, a client-side registry of pinned item keys, capped at one
  terminal row
- Add PacketPinCraftedItem, sent by CraftingCPUCluster to the requesting
  player when a job starts, completes or is cancelled
- Reserve the first row of ItemRepo for pinned entries, opt-in so that
  non-terminal screens keep their current behaviour
- Highlight that row in GuiMEMonitorable and keep it out of the scroll range
- Add the pinAutoCraftedItems client config option, on by default

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEfWADSjczynwLCC6s8vVJ
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.

1 participant