Exemplo n.º 1
0
  protected String getConf(Profile profile) {
    if (profile == null) return null;

    String conf = userMapping.get(profile.getName());
    if (conf == null || conf.isEmpty()) return "";

    if (!GuiManager.mainWindow.getPanelManageUsers().hasConfWithName(conf)) return "";

    return conf;
  }
Exemplo n.º 2
0
  protected void loadProfiles() {
    if (GuiManager.mainWindow != null && GuiManager.mainWindow.getLblNewLabel() != null) {
      GuiManager.mainWindow.clearAction();
      GuiManager.mainWindow.pushAction(
          I18NHelper.getFormattedLocalization("gui.action.scanningProfiles"));
    }
    if (GuiManager.mainWindow != null && GuiManager.mainWindow.getProgressBar() != null)
      GuiManager.mainWindow.getProgressBar().setValue(0);
    scanner.scanForProfiles();
    if (GuiManager.mainWindow != null && GuiManager.mainWindow.getProgressBar() != null)
      GuiManager.mainWindow.getProgressBar().setValue(50);
    model.clear();
    for (Profile profile : scanner.getProfiles()) model.add(profile.getName());
    if (GuiManager.mainWindow != null && GuiManager.mainWindow.getLblNewLabel() != null)
      GuiManager.mainWindow.clearAction();
    if (GuiManager.mainWindow != null && GuiManager.mainWindow.getProgressBar() != null)
      GuiManager.mainWindow.getProgressBar().setValue(100);

    readProfilesConf();
  }
Exemplo n.º 3
0
  protected void refreshProfile() {
    int index = list.getSelectedIndex();
    if (index < 0) {
      lblSelectedArchive.setText(
          I18NHelper.getFormattedLocalization("gui.tabs.selectProfile.versionNameEmpty"));
      lblGameVersion.setText(
          I18NHelper.getFormattedLocalization("gui.tabs.selectProfile.mcVersionEmpty"));

      comboBox.setSelectedIndex(0);
      comboBox.setEnabled(false);

      btnforge.setEnabled(false);
      btnmod.setEnabled(false);
      btnexe.setEnabled(false);

      btnLaunch.setEnabled(false);

      return;
    }

    Profile profile = scanner.getProfiles().get(index);
    lblSelectedArchive.setText(
        I18NHelper.getFormattedLocalization(
            "gui.tabs.selectProfile.versionName", profile.getName()));
    lblGameVersion.setText(
        I18NHelper.getFormattedLocalization("gui.tabs.selectProfile.mcVersion", profile.getId()));

    comboBox.setSelectedIndex(getConfNamePositionInModel(getConf(profile)));
    comboBox.setEnabled(true);

    // TODO: should check whether Forge has been installed
    btnforge.setEnabled(true);
    btnmod.setEnabled(true);
    btnexe.setEnabled(true);

    btnLaunch.setEnabled(true);
  }
Exemplo n.º 4
0
  protected boolean hasSuchProfile(String name) {
    for (Profile profile : scanner.getProfiles()) if (profile.getName().equals(name)) return true;

    return false;
  }