Class AbstractQuestGridScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
fr.pacdu.pacpackquests.client.screen.AbstractQuestGridScreen
- All Implemented Interfaces:
net.minecraft.client.gui.components.events.ContainerEventHandler,net.minecraft.client.gui.components.events.GuiEventListener,net.minecraft.client.gui.components.Renderable,net.minecraft.client.gui.components.TabOrderedElement
- Direct Known Subclasses:
ParentSelectionScreen,QuestScreen
public abstract class AbstractQuestGridScreen
extends net.minecraft.client.gui.screens.Screen
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final intprotected final intprotected final intprotected final intprotected Stringprotected final intprotected static final intprotected doubleprotected doubleprotected intprotected intprotected final intprotected intprotected intprotected intprotected floatFields inherited from class net.minecraft.client.gui.screens.Screen
CUBE_MAP, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, PANORAMA, screenExecutor, title, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractQuestGridScreen(net.minecraft.network.chat.Component title) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyZoom(float targetZoom, double relX, double relY) Adjusts the zoom level and scales panX/panY around the specified focal point (relX, relY) relative to the canvas.voidcenterOn(int canvasX, int canvasY) Centers the camera on specific canvas coordinates (canvasX, canvasY).protected voidprotected voiddrawBackgroundFrame(net.minecraft.client.gui.GuiGraphics context, net.minecraft.network.chat.Component titleText) protected voiddrawConnectionLine(net.minecraft.client.gui.GuiGraphics context, AbstractQuestGridScreen.GridNode parent, AbstractQuestGridScreen.GridNode child, int lineColor, int arrowColor, boolean isDragging) protected booleanprotected fr.pacdu.pacpackquests.client.screen.AbstractQuestGridScreen.BoundsComputes the bounding box of current nodes, including padding.protected abstract List<? extends AbstractQuestGridScreen.GridNode> getNodes()protected voidinit()protected booleanisHovering(double x, double y, double width, double height, double localMouseX, double localMouseY) protected booleanisHoveringNode(int nodeX, int nodeY, double localMouseX, double localMouseY) booleanmouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) booleanmouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) protected voidrenderNodeBase(net.minecraft.client.gui.GuiGraphics context, AbstractQuestGridScreen.GridNode node, int bgColor) voidResets zoom to 1.0f and adaptively positions the camera: - Horizontal: Centers if content fits; otherwise aligns leftmost quest to the left border with padding.Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearTooltipForNextRenderPass, clearWidgets, findNarratableWidget, getBackgroundMusic, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, keyPressed, onClose, onFilesDrop, rebuildWidgets, removed, removeWidget, render, renderBackground, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, repositionElements, resize, setInitialFocus, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseReleased, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
windowWidth
protected int windowWidth -
windowHeight
protected int windowHeight -
startX
protected int startX -
startY
protected int startY -
PADDING
protected static final int PADDING- See Also:
-
panX
protected double panX -
panY
protected double panY -
zoom
protected float zoom -
gridSpacing
protected final int gridSpacing- See Also:
-
canvasOffsetX
protected final int canvasOffsetX- See Also:
-
canvasOffsetY
protected final int canvasOffsetY- See Also:
-
tabWidth
protected int tabWidth -
tabHeight
protected final int tabHeight- See Also:
-
categMarginTop
protected final int categMarginTop- See Also:
-
categMarginBottom
protected final int categMarginBottom- See Also:
-
categoryNameMaxChars
protected final int categoryNameMaxChars- See Also:
-
draggedQuestId
-
-
Constructor Details
-
AbstractQuestGridScreen
protected AbstractQuestGridScreen(net.minecraft.network.chat.Component title)
-
-
Method Details
-
getNodes
-
init
protected void init()- Overrides:
initin classnet.minecraft.client.gui.screens.Screen
-
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) -
forceFullGridBounds
protected boolean forceFullGridBounds() -
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) -
applyZoom
protected void applyZoom(float targetZoom, double relX, double relY) Adjusts the zoom level and scales panX/panY around the specified focal point (relX, relY) relative to the canvas. -
clampPanning
protected void clampPanning() -
centerOn
public void centerOn(int canvasX, int canvasY) Centers the camera on specific canvas coordinates (canvasX, canvasY). -
resetCamera
public void resetCamera()Resets zoom to 1.0f and adaptively positions the camera: - Horizontal: Centers if content fits; otherwise aligns leftmost quest to the left border with padding. - Vertical: Centers on the leftmost quest(s) (or the whole tree if it fits), clamped within bounds so the starting quest never disappears. -
getNodeBounds
protected fr.pacdu.pacpackquests.client.screen.AbstractQuestGridScreen.Bounds getNodeBounds()Computes the bounding box of current nodes, including padding. Returns null if no nodes exist. -
drawBackgroundFrame
protected void drawBackgroundFrame(net.minecraft.client.gui.GuiGraphics context, net.minecraft.network.chat.Component titleText) -
renderNodeBase
protected void renderNodeBase(net.minecraft.client.gui.GuiGraphics context, AbstractQuestGridScreen.GridNode node, int bgColor) -
drawConnectionLine
protected void drawConnectionLine(net.minecraft.client.gui.GuiGraphics context, AbstractQuestGridScreen.GridNode parent, AbstractQuestGridScreen.GridNode child, int lineColor, int arrowColor, boolean isDragging) -
isHovering
protected boolean isHovering(double x, double y, double width, double height, double localMouseX, double localMouseY) -
isHoveringNode
protected boolean isHoveringNode(int nodeX, int nodeY, double localMouseX, double localMouseY)
-