Beispiel #1
0
 public void setAvatarIndex(int newAvatarIndex) {
   avatarIndex = newAvatarIndex;
   if (avatarIndex != -1) {
     avatarLabel.setIcon(new FTextureRegionImage(FSkin.getAvatars().get(newAvatarIndex)));
   } else {
     avatarLabel.setIcon(null);
   }
 }
Beispiel #2
0
  void update() {
    avatarLabel.setEnabled(mayEdit);
    avatarLabel.setIcon(
        FSkin.getAvatars().get(Integer.valueOf(type == LobbySlotType.OPEN ? -1 : avatarIndex)));
    avatarLabel.repaintSelf();

    txtPlayerName.setEnabled(mayEdit);
    txtPlayerName.setText(type == LobbySlotType.OPEN ? StringUtils.EMPTY : playerName);
    nameRandomiser.setEnabled(mayEdit);
    deckLabel.setVisible(mayEdit);
    deckBtn.setVisible(mayEdit);
    chkReady.setVisible(type == LobbySlotType.LOCAL || type == LobbySlotType.REMOTE);
    chkReady.setEnabled(mayEdit);

    closeBtn.setVisible(mayRemove);

    if (mayRemove) {
      radioHuman.setEnabled(mayControl);
      radioAi.setEnabled(mayControl);
      radioOpen.setEnabled(mayControl);
    } else {
      radioHuman.setVisible(mayControl);
      radioAi.setVisible(mayControl);
      radioOpen.setVisible(mayControl);
    }

    radioHuman.setSelected(type == LobbySlotType.LOCAL);
    radioAi.setSelected(type == LobbySlotType.AI);
    radioOpen.setSelected(type == LobbySlotType.OPEN);

    updateVariantControlsVisibility();
  }
Beispiel #3
0
  private void createAvatar() {
    final String[] currentPrefs = FModel.getPreferences().getPref(FPref.UI_AVATARS).split(",");
    if (index < currentPrefs.length) {
      avatarIndex = Integer.parseInt(currentPrefs[index]);
      avatarLabel.setIcon(FSkin.getAvatars().get(avatarIndex));
    } else {
      setRandomAvatar(false);
    }

    avatarLabel.setToolTipText("L-click: Select avatar. R-click: Randomize avatar.");
    avatarLabel.addFocusListener(avatarFocusListener);
    avatarLabel.addMouseListener(avatarMouseListener);
  }
Beispiel #4
0
 public void setAvatarIndex(final int avatarIndex0) {
   avatarIndex = avatarIndex0;
   final SkinImage icon = FSkin.getAvatars().get(avatarIndex);
   avatarLabel.setIcon(icon);
   avatarLabel.repaintSelf();
 }