Advertisement
Guest User

Untitled

a guest
Jul 5th, 2017
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.77 KB | None | 0 0
  1. private void drawLoginScreen(boolean flag) {
  2. resetImageProducers();
  3. titleScreen.initDrawingArea();
  4. DrawingArea474.drawFilledPixels(0, 0, clientWidth, clientHeight, 0);
  5. int alpha = 0;
  6. titleAlpha += titleAlpha < 250 ? 10 : 0;
  7. if (alpha < 250)
  8. title.drawSprite1((clientWidth / 2) - (title.myWidth / 2), (clientHeight / 2) - (title.myHeight / 2), titleAlpha);
  9. else
  10. title.drawSprite((clientWidth / 2) - (title.myWidth / 2), (clientHeight / 2) - (title.myHeight / 2));
  11. int centerX = clientWidth / 2;
  12. int centerY = clientHeight / 2;
  13. if (titleAlpha >= 250) {
  14. if (loginScreenState != 2) {
  15. titleButton[2].drawSprite(clientWidth - 37, clientHeight - 36);
  16. if (mouseInRegion(clientWidth - 37, clientHeight - 36, clientWidth - 5, clientHeight - 5)) {
  17. optionsWidth += optionsWidth >= 0 && optionsWidth <= 92 ? 5 : 0;
  18. optionsWidth = optionsWidth > 92 ? optionsWidth = 92 : optionsWidth;
  19. titleButtonH[2] = new Sprite("titlescreen/titlebutton_hover 2", 32 + optionsWidth, 31);
  20. titleButtonH[2].drawSprite(clientWidth - 37 - optionsWidth, clientHeight - 36);
  21. hoverPiece.drawSprite(clientWidth - 37, clientHeight - 36);
  22. } else {
  23. optionsWidth -= optionsWidth >= 0 && optionsWidth <= 92 ? 5 : 0;
  24. optionsWidth = optionsWidth < 0 ? optionsWidth = 0 : optionsWidth;
  25. if (optionsWidth > 0) {
  26. titleButtonH[2] = new Sprite("titlescreen/titlebutton_hover 2", 32 + optionsWidth, 31);
  27. titleButtonH[2].drawSprite(clientWidth - 37 - optionsWidth, clientHeight - 36);
  28. hoverPiece.drawSprite(clientWidth - 37, clientHeight - 36);
  29. }
  30. }
  31. optionsIcon.drawSprite(clientWidth - 31, clientHeight - 31);
  32. }
  33. if (loginScreenState == 0) {
  34. drawTitleBox(centerX - (266 / 2), centerY - (225 / 2), 266, 225, 0);
  35. titleText.drawSprite(centerX - (titleText.myWidth / 2), centerY - 90);
  36. /* Username */
  37. titleButton[0].drawSprite(centerX - (titleButton[0].myWidth / 2), centerY - 44);
  38. if (mouseInRegion(centerX - (titleButton[0].myWidth / 2), centerY - 44, centerX + (titleButton[0].myWidth / 2), centerY - 9))
  39. titleButtonH[0].drawSprite(centerX - (titleButton[0].myWidth / 2), centerY - 44);
  40. /* Password */
  41. titleButton[0].drawSprite(centerX - (titleButton[0].myWidth / 2), centerY + 9);
  42. if (mouseInRegion(centerX - (titleButton[0].myWidth / 2), centerY + 9, centerX + (titleButton[0].myWidth / 2), centerY + 36))
  43. titleButtonH[0].drawSprite(centerX - (titleButton[0].myWidth / 2), centerY + 9);
  44. /* Log In */
  45. titleButton[1].drawSprite(centerX - (titleButton[1].myWidth / 2), centerY + 47);
  46. if (mouseInRegion(centerX - (titleButton[1].myWidth / 2), centerY + 47, centerX + (titleButton[1].myWidth / 2), centerY + 78))
  47. titleButtonH[1].drawSprite(centerX - (titleButton[1].myWidth / 2), centerY + 47);
  48. regularText.method389(true, centerX - (titleButton[0].myWidth / 2), 0xffffff, "Username:", centerY - 48);
  49. regularText.method389(true, centerX - (titleButton[0].myWidth / 2) + 5, 0xffffff, capitalize(myUsername) + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), centerY - 25);
  50. regularText.method389(true, centerX - (titleButton[0].myWidth / 2), 0xffffff, "Password:", centerY + 5);
  51. regularText.method389(true, centerX - (titleButton[0].myWidth / 2) + 5, 0xffffff, TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), centerY + 28);
  52. if (loginMessage1.length() > 0 || loginMessage2.length() > 0) {
  53. int x1 = centerX - (266 / 2);
  54. int y1 = centerY - (225 / 2) + 227;
  55. drawTitleBox(x1, y1, 266, 45, 0);
  56. titleButton[3].drawSprite(x1 + 246, y1 + 4);
  57. if (mouseInRegion(x1 + 246, y1 + 4, x1 + 262, y1 + 20))
  58. titleButtonH[3].drawSprite(x1 + 246, y1 + 4);
  59. if (loginMessage1.length() > 0) {
  60. regularText.method382(0xffffff, centerX, loginMessage1, y1 + 20, true);
  61. regularText.method382(0xffffff, centerX, loginMessage2, y1 + 35, true);
  62. } else {
  63. regularText.method382(0xffffff, centerX, loginMessage2, y1 + 27, true);
  64. }
  65. }
  66. }
  67. if (loginScreenState == 1) {
  68. int accountX = centerX - 125;
  69. int accountY = centerY - (((50 * account.length) / 2) + 12);
  70. drawTitleBox(accountX, accountY, 250, (50 * account.length) + 25, 1);
  71. regularText.method382(0xffffff, centerX, "Accounts", accountY + 16, true);
  72. if (account.length > 0) {
  73. for (int a = 0; a < account.length; a++) {
  74. titleButton[0].drawSprite(centerX - (titleButton[0].myWidth / 2), accountY + 30 + (a * 30));
  75. }
  76. }
  77. }
  78. if (loginScreenState == 2) {
  79. drawTitleBox(centerX - (225 / 2), centerY - (settingHeight / 2), 225, settingHeight, 1);
  80. titleButton[3].drawSprite(centerX - (225 / 2) + 206, centerY - (settingHeight / 2) + 3);
  81. if (mouseInRegion(centerX - (225 / 2) + 206, centerY - (settingHeight / 2) + 3, centerX - (225 / 2) + 222, centerY - (settingHeight / 2) + 19))
  82. titleButtonH[3].drawSprite(centerX - (225 / 2) + 206, centerY - (settingHeight / 2) + 3);
  83. regularText.method382(0xffffff, centerX, "Client Settings", centerY - (settingHeight / 2) + 16, true);
  84. if (!settingsEnabled) {
  85. smallText.method382(0xff9933, centerX, "There are no settings", centerY - (settingHeight / 2) + 40, true);
  86. smallText.method382(0xff9933, centerX, "that have been enabled.", centerY - (settingHeight / 2) + 50, true);
  87. } else {
  88. for (int i1 = 0, yPos = centerY - (settingHeight / 2) + 40; i1 < settingNames.length; i1++, yPos += 16) {
  89. smallText.method389(true, centerX - 85, 0xffffff, settingNames[i1], yPos);
  90. if (settingEnabled[i1])
  91. selectedOption.drawSprite(centerX - 102, yPos - 13);
  92. else
  93. unselectedOption.drawSprite(centerX - 102, yPos - 13);
  94. }
  95. }
  96. }
  97. }
  98. titleScreen.drawGraphics(0, super.graphics, 0);
  99. if(welcomeScreenRaised) {
  100. welcomeScreenRaised = false;
  101. }
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement