|
1 | 1 | package com.coflnet.gui; |
2 | 2 |
|
| 3 | +import CoflCore.commands.models.FlipData; |
3 | 4 | import com.coflnet.CoflModClient; |
4 | 5 | import com.coflnet.gui.widget.ItemWidget; |
5 | 6 | import net.minecraft.client.MinecraftClient; |
@@ -27,23 +28,31 @@ public abstract class BinGUI extends Screen { |
27 | 28 | protected final int CONFIRMATION_CANCEL_SLOT = 15; |
28 | 29 | protected ItemWidget itemWidget; |
29 | 30 | protected ItemStack currentItem; |
| 31 | + protected FlipData flipData = null; |
30 | 32 |
|
31 | 33 | protected AuctionStatus auctionStatus; |
32 | 34 | protected GenericContainerScreenHandler gcsh; |
33 | 35 | protected GenericContainerScreen gcs; |
34 | | - protected BinGUI(Text title, GenericContainerScreen gcs) { |
| 36 | + protected BinGUI(Text title, GenericContainerScreen gcs, int p, int r) { |
35 | 37 | super(title); |
36 | | - screenWidth = MinecraftClient.getInstance().currentScreen.width; |
37 | | - screenHeight = MinecraftClient.getInstance().currentScreen.height; |
38 | | - |
39 | 38 | this.gcs = gcs; |
40 | 39 | this.gcsh = gcs.getScreenHandler(); |
| 40 | + this.p = p; |
| 41 | + this.r = r; |
41 | 42 |
|
42 | 43 | if (gcsh.getType() == ScreenHandlerType.GENERIC_9X3){ |
43 | 44 | this.auctionStatus = AuctionStatus.CONFIRMING; |
44 | 45 | } else this.auctionStatus = AuctionStatus.INIT; |
45 | 46 |
|
| 47 | + flipData = CoflModClient.popFlipData(); |
| 48 | + |
| 49 | + screenWidth = MinecraftClient.getInstance().currentScreen.width; |
| 50 | + screenHeight = MinecraftClient.getInstance().currentScreen.height; |
| 51 | + initSize(screenWidth, screenHeight); |
| 52 | + clearAndInitWidgets(screenWidth, screenHeight); |
| 53 | + } |
46 | 54 |
|
| 55 | + private void initSize(int screenWidth, int screenHeight){ |
47 | 56 | this.width = MinecraftClient.getInstance().currentScreen.width / 2; |
48 | 57 | if (width < 300) this.width = 300; |
49 | 58 |
|
@@ -88,6 +97,7 @@ public void renderBackground(DrawContext context, int mouseX, int mouseY, float |
88 | 97 | || screenHeight != MinecraftClient.getInstance().currentScreen.height){ |
89 | 98 | screenWidth = MinecraftClient.getInstance().currentScreen.width; |
90 | 99 | screenHeight = MinecraftClient.getInstance().currentScreen.height; |
| 100 | + initSize(screenWidth, screenHeight); |
91 | 101 | clearAndInitWidgets(screenWidth, screenHeight); |
92 | 102 | } |
93 | 103 | } |
|
0 commit comments