GaldurContainerScreen
classclient onlysince 0.1.0com.galdurstudio.galdurui.api.screen.GaldurContainerScreen
Themed screen for a slot menu: theme panel, a frame per slot, theme-coloured titles (the
screen title in the brand font). Drag and drop, Shift-click, number keys and item tooltips are
Minecraft's (AbstractContainerScreen).
Works as is for any menu, vanilla ones included, through factory():
// client side, on the mod busevent.register(MY_MENUS.CHEST.get(), GaldurContainerScreen.factory());The panel size is derived from the slots: the margin left of the first slot is repeated on
the right and at the bottom. A menu without slots gets the size of a vanilla chest
(176 × 166). A subclass can force its size with
GaldurContainerScreen() and
override renderBg or renderLabels to add content.
The "Inventory" label sits right above the player inventory when the menu has one, and is
hidden otherwise. The hovered slot gets a translucent accent veil and an
accent_hover outline, as does every slot targeted by a drag-spread. With JEI or EMI
installed, their item list avoids the panel and the getExclusionZones(). The panel rises
slightly when the screen opens.
Constructors 1
GaldurContainerScreen
2 overloadsCreates the screen, with a panel sized from the menu slots.
PARAMETERS
Methods 8
factory
staticRETURNSMenuScreens.ScreenConstructor<M, GaldurContainerScreen<M>> — a screen constructor for RegisterMenuScreensEvent.register, without a
subclass
getExclusionZones
RETURNSList<Rect2i> — extra screen areas, in screen coordinates, that JEI and EMI must keep clear besides the panel: side tabs, buttons sticking out...
added
Starts the opening animation, the first time the screen is shown only.
render
While opening, the panel and its contents rise slightly; tooltips stay under the cursor.
PARAMETERS
renderBackground
Background dim, then the panel (renderBg). The dim covers the whole screen and does not rise.
PARAMETERS
updateNarratedWidget
protectedNarrates the hovered slot item ("Iron Ingot, 32"), which Minecraft does not. Nested one level below the widgets so it does not replace the focused one.
PARAMETERS
renderBg
protectedDraws the panel, then a frame for each active slot, outlined when hovered or targeted by a drag-spread. Minecraft draws the items afterwards.
PARAMETERS
getSlotColor
PARAMETERS
RETURNSint — the hovered slot veil, drawn by Minecraft over the item: translucent accent