Repository navigation
Add coloured inventory drawers and item-provided filter editors - #92
Merged
Merged
Conversation
Collaborator
|
Overall the design is right -- transfers are paid for with energy, extracted resources stay owned by the machine until delivered, starting points rotate so no slot is starved, and addon roles are enforced as unique. Spotted during review:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Machines can expose independently coloured item inventories, fluid tanks and energy buffers in one right-hand configuration drawer. Selecting a colour above the player inventory opens that group; a vertical selector stays inside the drawer. Information stays on the left, both drawers align at the top, and the main inventory panel remains centred. Six flat, grey-bordered side panels show small, faded neighbour models and cycle only the operations supported by the selected inventory. Input/output badges occupy separate right-hand corners, and tooltips show side, neighbour and mode on separate lines.
Each inventory has four capability-validated addon slots with conditional filter attachments. Transfer roles are unique per inventory across item IDs and tiers; bidirectional inventories may have one input and one output addon. Legacy duplicate installations recover the extra addon and its filter. Removing an addon returns its configured filter to the player or drops it when full, including in creative mode. Filters supply composed editors or registered custom controls inside the drawer. The drawer fits its content, expands downward for the editor and scrolls within the screen bounds. Info drawers remain capped at the main panel height. Filter edits use server-checked sessions, attachment generations and configuration revisions.
Concrete pullers/pushers, fluid pumps, energy relays, four example filters, a seven-group workbench and the Recovery Capsule belong to the optional companion mod. The library provides the interfaces, data and shared runtime/UI infrastructure. Item and fluid transfers pay RF for actual delivery; energy relays have no auxiliary fee so they can bootstrap an empty buffer.
Pending transfers retain ownership across save/reload and neighbour removal. Inbound resources finish delivery without consulting their old source, and outbound resources can use another enabled output face. Refunds that cannot fit remain persisted until space is available. Breaking a companion machine drops installed addons, configured filters, pending recovery items and item transfer remainders exactly once. Pending fluid, energy and refunds drop in a Recovery Capsule: use it on a compatible companion machine to restore what fits, leaving the remainder in the capsule. Unknown resource payloads are preserved. Ordinary tank/buffer contents retain the host's existing break policy. Library hosts must provide a recovery callback to the break hook; a failed handoff leaves pending data intact.
Neighbour capabilities use invalidation-aware caches, addon validation scans dirty groups, menu snapshots use revision counters, and resource membership uses indexed lookups. Filter hover checks examine only the selected inventory's four filter slots. Shared AutomationLayout geometry supplies rendering, real slot placement and hit bounds. Base machine slot counts now bound destination routing and reservation snapshots, and null-side energy access preserves the buffer's normal operations.
Companion mod — concrete content and machine setup
Shared library — reusable APIs, behaviour and UI
InventoryColorButtonBar, automatic UI ordering, overflow scrolling and consistent drawer/keyboard navigation.<inventory-controls>XML support.Validation:
check buildpassed with 123 JUnit tests, 67 library game tests and 36 companion game tests. Companion client smoke tests passed with and without JEI; screenshots were inspected for drawer alignment, colour selectors, neighbour previews and filter layout. The latest companion client smoke also verifies the shared toolbar, screen-ordered colour selection, centred lane display and compact filter-slot highlight. Unit coverage includes colour-bar ordering, overflow and resizing. Existing smoke checks cover fixed centring, content-driven sizing, internal scrolling, resize clamping and custom filter controls. Earlier library client smoke runs also passed with and without JEI.Server regression coverage includes all six transfer addons and four filters, duplicate-role validation and recovery, exact break drops, source removal, destination rerouting, save/reload, clipped refunds, full/partial capsule restoration, unknown recovery payloads, failed handoffs, cache invalidation/replacement, dirty validation, unsided energy access and base-slot reservation bounds.