Even more resizing BS
This commit is contained in:
parent
e18721a4db
commit
863b03a722
File diff suppressed because one or more lines are too long
|
@ -48,7 +48,7 @@ public final class Minecraft implements Runnable {
|
|||
public GameMode gamemode = new SurvivalGameMode(this);
|
||||
public int width;
|
||||
public int height;
|
||||
private Timer timer = new Timer(20.0F);
|
||||
public Timer timer = new Timer(20.0F);
|
||||
public Level level;
|
||||
public LevelRenderer levelRenderer;
|
||||
public Player player;
|
||||
|
@ -245,6 +245,7 @@ public final class Minecraft implements Runnable {
|
|||
}
|
||||
|
||||
if(this.width != GL11.parent.getClientWidth() || this.height != GL11.parent.getClientHeight()) {
|
||||
GuiScreen gui = this.currentScreen;
|
||||
this.width = GL11.parent.getClientWidth();
|
||||
this.height = GL11.parent.getClientHeight();
|
||||
GL11.canvas.setWidth(width);
|
||||
|
@ -254,7 +255,7 @@ public final class Minecraft implements Runnable {
|
|||
ScaledResolution scaledresolution = new ScaledResolution(width, height);
|
||||
int k = scaledresolution.getScaledWidth();
|
||||
int l = scaledresolution.getScaledHeight();
|
||||
currentScreen.setWorldAndResolution(this, k, l);
|
||||
currentScreen.setWorldAndResolution(this, k, l, gui);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,14 +74,20 @@ public class GuiScreen extends Screen {
|
|||
|
||||
protected void onButtonClick(Button var1) {}
|
||||
|
||||
public void setWorldAndResolution(Minecraft minecraft, int i, int j) {
|
||||
this.minecraft = minecraft;
|
||||
fontRenderer = minecraft.fontRenderer;
|
||||
width = i;
|
||||
height = j;
|
||||
buttons.clear();
|
||||
onOpen();
|
||||
}
|
||||
public void setWorldAndResolution(Minecraft minecraft, int i, int j, GuiScreen gui) {
|
||||
if(gui != null) {
|
||||
gui.minecraft = minecraft;
|
||||
gui.fontRenderer = minecraft.fontRenderer;
|
||||
gui.width = i;
|
||||
gui.height = j;
|
||||
gui.buttons.clear();
|
||||
gui.minecraft.setCurrentScreen(gui);
|
||||
}
|
||||
minecraft.hud = null;
|
||||
HUDScreen hud = new HUDScreen(minecraft, minecraft.width, minecraft.height);
|
||||
hud.render(minecraft.timer.delta, minecraft.currentScreen != null, GL11.mouseGetX() * minecraft.width * 240 / minecraft.height / minecraft.width, minecraft.height * 240 / minecraft.height - GL11.mouseGetY() * minecraft.height * 240 / minecraft.height / minecraft.height - 1);
|
||||
minecraft.hud = hud;
|
||||
}
|
||||
|
||||
public final void open(Minecraft var1, int var2, int var3) {
|
||||
this.minecraft = var1;
|
||||
|
|
Loading…
Reference in New Issue
Block a user