예제 #1
0
  public void tick() {
    if (mc.socketTimeout > 0) {
      mc.socketTimeout--;
    }

    switch (loginStage) {
      case 0:
        welcomeMenu.mouseClick(mc.mouseX, mc.mouseY, mc.lastMouseButton, mc.mouseButton);

        if (welcomeMenu.hasClicked(newUserButton)) {
          loginStage = 1;
        } else if (welcomeMenu.hasClicked(existingUserButton)) {
          loginStage = 2;
          loginMenu.setText(loginStatusLabel, "Please enter your username and password");
          loginMenu.setText(usernameInput, "");
          loginMenu.setText(passwordInput, "");
          loginMenu.setFocus(usernameInput);
        }
        break;
      case 1:
        newUserMenu.mouseClick(mc.mouseX, mc.mouseY, mc.lastMouseButton, mc.mouseButton);

        if (newUserMenu.hasClicked(newUserOkButton)) {
          loginStage = 0;
        }
        break;
      case 2:
        loginMenu.mouseClick(mc.mouseX, mc.mouseY, mc.lastMouseButton, mc.mouseButton);

        if (loginMenu.hasClicked(loginCancel)) {
          loginStage = 0;
        }

        if (loginMenu.hasClicked(usernameInput)) {
          loginMenu.setFocus(passwordInput);
        }

        if (loginMenu.hasClicked(passwordInput) || loginMenu.hasClicked(loginOk)) {
          mc.currentUser = loginMenu.getText(usernameInput);
          mc.currentPass = loginMenu.getText(passwordInput);
          mc.login(mc.currentUser, mc.currentPass, false);
        }
        break;
    }
  }
예제 #2
0
  public void render(JagGraphics graphics) {
    mc.loginScreenShown = false;
    graphics.interlace = false;
    graphics.clearScreen();

    if (loginStage <= 2 && loginStage >= 0) {
      int timer = (mc.tick * 2) % 3072;

      if (timer < 1024) {
        graphics.drawPicture(0, 10, mudclient.SPRITE_TEXTURE_START);

        if (timer > 768) {
          graphics.drawTransparentPicture(0, 10, mudclient.SPRITE_TEXTURE_START + 1, timer - 768);
        }
      } else {
        if (timer < 2048) {
          graphics.drawPicture(0, 10, mudclient.SPRITE_TEXTURE_START + 1);

          if (timer > 1792) {
            graphics.drawTransparentPicture(0, 10, mudclient.SPRITE_MEDIA_START + 10, timer - 1792);
          }
        } else {
          graphics.drawPicture(0, 10, mudclient.SPRITE_MEDIA_START + 10);

          if (timer > 2816) {
            graphics.drawTransparentPicture(0, 10, mudclient.SPRITE_TEXTURE_START, timer - 2816);
          }
        }
      }
    }

    if (loginStage == 0) {
      welcomeMenu.drawMenu();
    } else if (loginStage == 1) {
      newUserMenu.drawMenu();
    } else if (loginStage == 2) {
      loginMenu.drawMenu();
    }

    graphics.drawPicture(0, mc.windowHeight, mudclient.SPRITE_MEDIA_START + 22);
    graphics.drawImage(mc.aGraphics936, 0, 0);
  }