Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## Unreleased — 2.0.2

- Add Java recipe-chain helpers for concurrent stages, stock targets, pending
input protection, saved cycles and bounded recipe-path discovery. See
[recipe chains](docs/recipe-chains.md).
- Add a shared recipe drawer and optional JEI presentation adapter. Narrow
layouts open inward without covering recipe content with the tab rail;
foreground element popups retain input priority over the drawer.
- Add front-face item displays and rectangular, optionally emissive frame
overlays to machine appearances. Both `<item-display>` and `<entity-display>`
belong inside `<appearance>`; move existing root-level entity displays there.
- Tint grouped slot and gauge backgrounds while preserving item/fluid colours;
reserve group outlines for hover and selection.
- Update NeoForge to 21.1.265 (from 21.1.247); it is now the minimum NeoForge
version MMDLib requires. Update the Gradle wrapper to 9.9.1 (from 9.8.2).
- Machines (#105):
Expand Down
11 changes: 9 additions & 2 deletions docs/gauge-textures.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Textures for the planned GUI fill gauge, styled as a glass graduated cylinder. T
These textures supply `<gauge>` and the matching slim background of `<energy-gauge>`. The energy
renderer draws thin red charge bars with a soft reflection, without a terminal or graduations.
Bars are at most four pixels thick, separated by one-pixel gaps.
Both empty interiors use neutral dark grey `#555555`.
Both empty interiors use neutral dark grey `#555555` as their base. Glass tanks add
subtle cylindrical shading and reflection over the empty portion.

## Files

Expand Down Expand Up @@ -37,7 +38,9 @@ For a gauge of length *L* (≥ 10) at (*x*, *y*):
3. **Glass**: flush preceding buffered GUI draws, enable source-alpha blending, then draw
the three `glass_*` pieces in the same arrangement as the body. The renderer restores the
caller's blend enable/function, depth-test state and shader color after drawing the gauge.
The overlay is clipped to the filled portion, leaving the empty interior flat medium grey.
The overlay uses full strength over the filled portion and 35% strength over the empty
portion, with separate clips meeting at the fluid level. This keeps partially filled and
completely empty tanks rounded without changing the lighting over their contents.
Fluid textures remain visible beneath it; the cylinder effect comes from lighting, not a new
outline. The energy gauge uses only the body textures, without this glass overlay.
4. **Graduations**, drawn in code: colour `#EEF3F6` at 85% opacity, with a 35% black shadow
Expand Down Expand Up @@ -115,3 +118,7 @@ under 12 px. Thicker gauges keep a 1 px gap-coloured margin on each side.
- Segments are flat. Only segments at least 4 px in both directions get a bevel (top/left edge
35% toward white, bottom/right edge at 70%; 12% and 85% when unlit). Smaller segments drawn
with a bevel blur into the gaps and their proportions read wrong.

Gauge body textures receive the same subtle group-colour background wash as item slots.
The fluid, glass and charged energy bars retain their original colours. Group outlines
appear when the associated automation button is highlighted, not continuously.
58 changes: 53 additions & 5 deletions docs/gui-screens.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,10 @@ provider, a rectangular outline uses the request's colour and outset. Highlights
targets and run with viewport clipping and isolated pose/colour state.

`ElementHighlight` distinguishes persistent `DECORATION`, `EMPHASIS` of an existing decoration,
and a control's `SELECTION` marker. Factory methods supply the usual zero/one-pixel outsets;
and a control's `SELECTION` marker. Factory methods supply a two-pixel outset;
providers may reuse `request.outline(bounds)` or `request.render(graphics, bounds)`.
`GroupBehavior` supplies panel captions. `ColouredGroupBehavior` suppresses duplicate persistent
decoration, emphasizes its own coloured outline, and retains the requesting control's selection
`GroupBehavior` supplies panel captions. `ColouredGroupBehavior` suppresses persistent
decoration, draws its coloured outline on emphasis, and retains the requesting control's selection
style. The inline side-config renderer and side-config drawer depend only on these contracts;
they do not recognize concrete group classes or construct temporary group wrappers.

Expand Down Expand Up @@ -2167,12 +2167,25 @@ processor arrow composes a `ProgressSpriteElement`, retaining its default arrow
darkened custom-icon background.

`ColouredGroupElement` decorates exactly one inner element, which can itself contain any number
of children. It preserves that child's dimensions and stretching and paints its outline after
the child backgrounds. Generated resource-group inventories use this wrapper; automation
of children. It preserves that child's dimensions and stretching. Group outlines appear only
when the corresponding group control is hovered or selected, without covering the original casing.
Hover and selection outlines extend two pixels beyond the element bounds. Outlines clip to the
viewport rather than the child rectangle; layout and hit areas remain unchanged, so leave
room between neighbouring groups for their decoration. Generated resource-group inventories
use this wrapper; automation
selection highlights the whole inventory once. Older hand-authored highlight targets still
work through the generic highlight service's outline fallback; mod targets can provide their
own `HighlightPresentation`.

Grouped slot backgrounds and fluid/energy gauge casings receive a 40% group-colour
wash, preserving their original shading and any explicit slot tint. Fluid contents, energy
bars, items, empty icons, ghost previews and stack counts retain their colours. Automation
no longer draws persistent identification outlines; hovering a group button or selecting it
in the open drawer emphasizes its associated elements. The nearest group wins without stacking tints: registered behaviors can provide
`GroupColourProvider`, and host resource associations supply colours for older screens without
wrappers. `ElementRenderAccess.groupColour` resolves these through ordinary parent traversal,
including in fragments. Ungrouped slots retain their original appearance.

```xml
<coloured-group id="input_group" color="#55AA88">
<inventory storage="input" columns="2" spacing="2">
Expand Down Expand Up @@ -2694,3 +2707,38 @@ client preview is cached per open screen and rebuilt only when the data or clien
level changes. It never spawns, ticks or searches for a live world entity, and
does not load passenger trees. The preview cache is discarded when the screen
closes. Entity data should be updated by the processor when its occupant changes.

## Shared recipe drawer

`RecipeDrawer` in `gui.client.recipe` hosts a `RecipeCatalog` with named groups
and paged choices. Register a `DrawerDefinition` using `DrawerRegistry` on both
sides, then register its `DrawerFactories` client factory:

```java
DrawerFactories.GLOBAL.register(RECIPE_DRAWER_TYPE, (screen, definition) ->
new RecipeDrawer(screen, definition, new MyRecipeCatalog(screen)));
```

The catalog returns a stable list until recipes change and implements `select`
by submitting a server-validated element action. `initialGroup()` can select the
machine's current source. Opening and paging are client presentation only.
An element behavior opens it through
`access.service(DrawerOpener.class).map(opener -> opener.open(drawerId))`.

Each choice has a `RecipePresentation`: dimensions, item positions and roles,
extra item tooltips, indexed fluid requirements, tooltip areas and background
drawing. Its coordinates are local; background drawing must not draw the items.
The drawer supplies native item rendering. An optional JEI category extends
`PresentedRecipeCategory<T>` and returns the same presentation from
`presentation(T recipe)`; its adapter creates JEI ingredient slots and tooltip
areas, preserving ingredient lookup without duplicating layout/artwork.

The recipe API itself has no JEI dependency. Consumers keep machine-specific
recipe policy, catalog construction and action validation. Refresh cached catalogs
when synchronized recipes/tags change. Drawer choices are previews, never authority.
The drawer keeps native GUI scale and uses the side margin when available. At narrow
widths it opens inward over the machine, keeping recipe content clear of the tab rail.
Its body reserves space in JEI and blocks underlying slot/control hover. Foreground
element popups retain input priority above the drawer and remain clipped to the viewport.
Existing drawers can opt into the same behavior through
`Drawer.renderForeground` and `Drawer.covers`.
3 changes: 3 additions & 0 deletions docs/mod-author-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ including inherited storage, generated screens and dynamic recipes. More special
machines and custom world entities use their dedicated typed factory APIs.
The manual wiring below remains an alternative; do not queue objects twice.

Machines with a selected material path can use [recipe chains](recipe-chains.md)
for concurrent stages, per-stage stock targets and processing-first extraction.

Java machines spanning several blocks can use [multiblock placement and lifecycle](multiblocks.md),
with one controller, linked physical parts and guarded resource ports.

Expand Down
Loading
Loading