diff options
author | syeyoung <cyoung06@naver.com> | 2022-09-08 13:04:21 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2022-09-08 13:04:21 +0900 |
commit | c9ef55f2df21c94a96f44497ac4986d90a52dace (patch) | |
tree | 08946b690f44c12f715b82ae29dd47030bd859e1 /loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui | |
parent | bd0576d13fb6b801ebd42532599d37d7c0d68709 (diff) | |
download | Skyblock-Dungeons-Guide-c9ef55f2df21c94a96f44497ac4986d90a52dace.tar.gz Skyblock-Dungeons-Guide-c9ef55f2df21c94a96f44497ac4986d90a52dace.tar.bz2 Skyblock-Dungeons-Guide-c9ef55f2df21c94a96f44497ac4986d90a52dace.zip |
- temp
Diffstat (limited to 'loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui')
-rw-r--r-- | loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/GuiPrivacyPolicy.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/GuiPrivacyPolicy.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/GuiPrivacyPolicy.java new file mode 100644 index 00000000..b7d21b16 --- /dev/null +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/GuiPrivacyPolicy.java @@ -0,0 +1,53 @@ +package kr.syeyoung.dungeonsguide.launcher.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.*; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraftforge.fml.common.FMLCommonHandler; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; + +public class GuiPrivacyPolicy extends GuiScreen { + @Override + public void initGui() { + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + this.buttonList.add(new GuiButton(0, sr.getScaledWidth()/2+50,sr.getScaledHeight()-40, 300, 20,"Accept Privacy Policy")); + this.buttonList.add(new GuiButton(1, sr.getScaledWidth()/2-50-300,sr.getScaledHeight()-40, 300, 20,"Deny and Play Without DG")); + } + + + @Override + protected void actionPerformed(GuiButton button) throws IOException { + super.actionPerformed(button); + if (button.id == 0) { + // accept + } else if (button.id == 1) { + Minecraft.getMinecraft().displayGuiScreen(null); + } + } + + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawBackground(0); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; + + fontRenderer.drawString("", (sr.getScaledWidth()-fontRenderer.getStringWidth("Please accept or deny Dungeons Guide Privacy Policy to continue"))/2,40,0xFFFF0000); + + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public static void clip(ScaledResolution resolution, int x, int y, int width, int height) { + if (width < 0 || height < 0) return; + + int scale = resolution.getScaleFactor(); + GL11.glScissor((x ) * scale, Minecraft.getMinecraft().displayHeight - (y + height) * scale, (width) * scale, height * scale); + } +} |