Adopted new Math and Widget changes
This commit is contained in:
parent
e608bf21fe
commit
ff77134ead
15 changed files with 62 additions and 51 deletions
|
@ -53,15 +53,12 @@ public class Button extends AbstractVanillaComponent<net.minecraft.client.gui.co
|
|||
@Override
|
||||
protected net.minecraft.client.gui.components.Button createVanillaComponent() {
|
||||
Button self = this;
|
||||
return new net.minecraft.client.gui.components.Button(
|
||||
0,
|
||||
0,
|
||||
relativeBounds.width,
|
||||
relativeBounds.height,
|
||||
component,
|
||||
(bt) -> onPress.onPress(self),
|
||||
(bt, stack, x, y) -> onTooltip.onTooltip(self, stack, x, y)
|
||||
);
|
||||
return net.minecraft.client.gui.components.Button
|
||||
.builder(component, (bt) -> onPress.onPress(self))
|
||||
.bounds(0, 0, relativeBounds.width, relativeBounds.height)
|
||||
.tooltip((bt, stack, x, y) -> onTooltip.onTooltip(self, stack, x, y))
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
public boolean isGlowing() {
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.betterx.ui.layout.components.input.RelativeContainerEventHandler;
|
|||
import org.betterx.ui.layout.values.Rectangle;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.gui.components.Widget;
|
||||
import net.minecraft.client.gui.components.Renderable;
|
||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||
import net.minecraft.client.gui.narration.NarratableEntry;
|
||||
import net.minecraft.client.gui.narration.NarrationElementOutput;
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class Panel implements ComponentWithBounds, RelativeContainerEventHandler, NarratableEntry, Widget {
|
||||
public class Panel implements ComponentWithBounds, RelativeContainerEventHandler, NarratableEntry, Renderable {
|
||||
protected LayoutComponent<?, ?> child;
|
||||
List<? extends GuiEventListener> listeners = List.of();
|
||||
public final Rectangle bounds;
|
||||
|
|
|
@ -7,11 +7,12 @@ import org.betterx.ui.layout.values.Size;
|
|||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.*;
|
||||
import com.mojang.math.Matrix4f;
|
||||
import net.minecraft.client.gui.GuiComponent;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
import org.joml.Matrix4f;
|
||||
|
||||
public class RenderHelper {
|
||||
public static void outline(PoseStack poseStack, int x0, int y0, int x1, int y1, int color) {
|
||||
outline(poseStack, x0, y0, x1, y1, color, color);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue