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 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);
}
}

View File

@ -74,13 +74,19 @@ 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) {