Even more resizing BS

This commit is contained in:
PeytonPlayz595 2023-07-17 03:01:02 -04:00
parent e18721a4db
commit 863b03a722
4 changed files with 2269 additions and 2248 deletions

4488
js/app.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -48,7 +48,7 @@ public final class Minecraft implements Runnable {
public GameMode gamemode = new SurvivalGameMode(this); public GameMode gamemode = new SurvivalGameMode(this);
public int width; public int width;
public int height; public int height;
private Timer timer = new Timer(20.0F); public Timer timer = new Timer(20.0F);
public Level level; public Level level;
public LevelRenderer levelRenderer; public LevelRenderer levelRenderer;
public Player player; public Player player;
@ -245,6 +245,7 @@ public final class Minecraft implements Runnable {
} }
if(this.width != GL11.parent.getClientWidth() || this.height != GL11.parent.getClientHeight()) { if(this.width != GL11.parent.getClientWidth() || this.height != GL11.parent.getClientHeight()) {
GuiScreen gui = this.currentScreen;
this.width = GL11.parent.getClientWidth(); this.width = GL11.parent.getClientWidth();
this.height = GL11.parent.getClientHeight(); this.height = GL11.parent.getClientHeight();
GL11.canvas.setWidth(width); GL11.canvas.setWidth(width);
@ -254,7 +255,7 @@ public final class Minecraft implements Runnable {
ScaledResolution scaledresolution = new ScaledResolution(width, height); ScaledResolution scaledresolution = new ScaledResolution(width, height);
int k = scaledresolution.getScaledWidth(); int k = scaledresolution.getScaledWidth();
int l = scaledresolution.getScaledHeight(); int l = scaledresolution.getScaledHeight();
currentScreen.setWorldAndResolution(this, k, l); currentScreen.setWorldAndResolution(this, k, l, gui);
} }
} }

View File

@ -74,14 +74,20 @@ public class GuiScreen extends Screen {
protected void onButtonClick(Button var1) {} protected void onButtonClick(Button var1) {}
public void setWorldAndResolution(Minecraft minecraft, int i, int j) { public void setWorldAndResolution(Minecraft minecraft, int i, int j, GuiScreen gui) {
this.minecraft = minecraft; if(gui != null) {
fontRenderer = minecraft.fontRenderer; gui.minecraft = minecraft;
width = i; gui.fontRenderer = minecraft.fontRenderer;
height = j; gui.width = i;
buttons.clear(); gui.height = j;
onOpen(); 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) { public final void open(Minecraft var1, int var2, int var3) {
this.minecraft = var1; this.minecraft = var1;