Fix inventory buttons overlapping in storage overlay (also fixes skyblocker)
This commit is contained in:
@@ -21,14 +21,25 @@ public interface AccessorHandledScreen {
|
|||||||
@Accessor("backgroundWidth")
|
@Accessor("backgroundWidth")
|
||||||
int getBackgroundWidth_Firmament();
|
int getBackgroundWidth_Firmament();
|
||||||
|
|
||||||
|
@Accessor("backgroundWidth")
|
||||||
|
void setBackgroundWidth_Firmament(int newBackgroundWidth);
|
||||||
|
|
||||||
@Accessor("backgroundHeight")
|
@Accessor("backgroundHeight")
|
||||||
int getBackgroundHeight_Firmament();
|
int getBackgroundHeight_Firmament();
|
||||||
|
|
||||||
|
@Accessor("backgroundHeight")
|
||||||
|
void setBackgroundHeight_Firmament(int newBackgroundHeight);
|
||||||
|
|
||||||
@Accessor("x")
|
@Accessor("x")
|
||||||
int getX_Firmament();
|
int getX_Firmament();
|
||||||
|
|
||||||
|
@Accessor("x")
|
||||||
|
void setX_Firmament(int newX);
|
||||||
|
|
||||||
@Accessor("y")
|
@Accessor("y")
|
||||||
int getY_Firmament();
|
int getY_Firmament();
|
||||||
|
|
||||||
|
@Accessor("y")
|
||||||
|
void setY_Firmament(int newY);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import org.spongepowered.asm.mixin.Shadow;
|
|||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ class StorageOverlayCustom(
|
|||||||
|
|
||||||
override fun onInit() {
|
override fun onInit() {
|
||||||
overview.init(MinecraftClient.getInstance(), screen.width, screen.height)
|
overview.init(MinecraftClient.getInstance(), screen.width, screen.height)
|
||||||
|
overview.init()
|
||||||
|
screen as AccessorHandledScreen
|
||||||
|
screen.x_Firmament = overview.measurements.x
|
||||||
|
screen.y_Firmament = overview.measurements.y
|
||||||
|
screen.backgroundWidth_Firmament = overview.measurements.totalWidth
|
||||||
|
screen.backgroundHeight_Firmament = overview.measurements.totalHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isPointOverSlot(slot: Slot, xOffset: Int, yOffset: Int, pointX: Double, pointY: Double): Boolean {
|
override fun isPointOverSlot(slot: Slot, xOffset: Int, yOffset: Int, pointX: Double, pointY: Double): Boolean {
|
||||||
|
|||||||
@@ -48,12 +48,14 @@ class StorageOverlayScreen : Screen(Text.literal("")) {
|
|||||||
val y = height / 2 - (overviewHeight + PLAYER_HEIGHT) / 2
|
val y = height / 2 - (overviewHeight + PLAYER_HEIGHT) / 2
|
||||||
val playerX = width / 2 - PLAYER_WIDTH / 2
|
val playerX = width / 2 - PLAYER_WIDTH / 2
|
||||||
val playerY = y + overviewHeight - PLAYER_Y_INSET
|
val playerY = y + overviewHeight - PLAYER_Y_INSET
|
||||||
|
val totalWidth = overviewWidth
|
||||||
|
val totalHeight = overviewWidth - PLAYER_Y_INSET + PLAYER_HEIGHT
|
||||||
}
|
}
|
||||||
|
|
||||||
var measurements = Measurements()
|
var measurements = Measurements()
|
||||||
|
|
||||||
var lastRenderedInnerHeight = 0
|
var lastRenderedInnerHeight = 0
|
||||||
override fun init() {
|
public override fun init() {
|
||||||
super.init()
|
super.init()
|
||||||
pageWidthCount = StorageOverlay.TConfig.columns
|
pageWidthCount = StorageOverlay.TConfig.columns
|
||||||
.coerceAtMost((width - PADDING) / (PAGE_WIDTH + PADDING))
|
.coerceAtMost((width - PADDING) / (PAGE_WIDTH + PADDING))
|
||||||
|
|||||||
Reference in New Issue
Block a user