Guest User

GuiLoadingScreen

a guest
Aug 17th, 2017
633
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. public class GuiBOLoadingScreen extends GuiBOScreen {
  2.  
  3. private int Delay = 0;
  4. private int Delay2 = 0;
  5. private int guiDisplay = 0;
  6.  
  7. private static boolean flag = false;
  8.  
  9. private float white = 0.0F;
  10.  
  11. private float Loading1 = 0.0F;
  12. private float Loading2 = 0.0F;
  13.  
  14. public void updateScreen() {
  15. if (this.white < 1.0F) { this.white += 0.15F; return; }
  16. if (this.guiDisplay++ >= 100) {
  17. CManager.isGameLoading = false;
  18. Minecraft.getMinecraft().displayGuiScreen(new GuiBOMainMenu(this));
  19. if (!flag) {
  20. CManager.instance().performClientChecks();
  21. flag = true;
  22. }
  23. }
  24. if (this.Delay++ < 15) {return;}
  25. if (this.Loading1 < 1.0F) {this.Loading1 += 0.05F;}
  26. if (this.Delay2++ < 20) {return;}
  27. if (this.Loading2 < 1.0F) {this.Loading2 += 0.05F;}
  28. }
  29.  
  30. protected void keyTyped(char par1, int par2) {} protected void mouseClicked(int par1, int par2, int par3) {}
  31.  
  32. public void renderOnScreen(int par1, int par2, float par3) {
  33.  
  34. int width = 400;
  35. int height = 100;
  36.  
  37. BORenderHelper.drawRect(0, 0, this.width, this.height, "0xffffff", this.white);
  38.  
  39. GL11.glPushMatrix();
  40. GL11.glEnable(3042);
  41. GL11.glColor4f(1.0F, 1.0F, 1.0F, this.Loading1);
  42.  
  43. BORenderHelper.drawImage
  44. (this.width / 2 - width / 2, this.height / 2 - height / 2 - 65, new ResourceLocation("bo3:textures/gui/loading.png"), width, height);
  45. GL11.glPopMatrix();
  46.  
  47. GL11.glPushMatrix();
  48. GL11.glEnable(3042);
  49. GL11.glColor4f(1.0F, 1.0F, 1.0F, this.Loading2);
  50.  
  51. double scale = 1.0D;
  52. width = 300;
  53. height = 180;
  54.  
  55. BORenderHelper.drawImage
  56. (this.width / 2 - width / 2, this.height / 2 - height / 2 + 40, new ResourceLocation("bo3:textures/gui/loading2.png"), width, height);
  57. GL11.glPopMatrix();
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment