예제 #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 updateLoginStatus(String top, String bottom) {
   if (loginStage == 2 && loginMenu != null) {
     loginMenu.setText(loginStatusLabel, top + " " + bottom);
   }
 }