/** * Generate the short name for a unit * <p/> * Sub-classes are allowed to override this method. The display name is in * the format [Chassis] [Model]. */ public void generateShortName() { StringBuffer nbuf = new StringBuffer(); nbuf.append(chassis); if ((model != null) && (model.length() > 0)) { nbuf.append(" ").append(model); } // if show unit id is on, append the id if (PreferenceManager.getClientPreferences().getShowUnitId()) { nbuf.append(" ID:").append(getId()); } else if (duplicateMarker > 1) { // if not, and a player has more than one unit with the same name, // append "#N" after the model to differentiate. nbuf.append(" #" + duplicateMarker); } shortName = nbuf.toString(); }
/** * Generates the display name for this entity. * <p/> * Sub-classes are allowed to override this method. The display name is in * the format [Chassis] [Model] ([Player Name]). */ public void generateDisplayName() { StringBuffer nbuf = new StringBuffer(); nbuf.append(chassis); if ((model != null) && (model.length() > 0)) { nbuf.append(" ").append(model); } // if show unit id is on, append the id if (PreferenceManager.getClientPreferences().getShowUnitId()) { nbuf.append(" ID:").append(getId()); } else if (duplicateMarker > 1) { // if not, and a player has more than one unit with the same name, // append "#N" after the model to differentiate. nbuf.append(" #" + duplicateMarker); } if (getOwner() != null) { nbuf.append(" (").append(getOwner().getName()).append(")"); } if (PreferenceManager.getClientPreferences().getShowUnitId()) { nbuf.append(" ID:").append(getId()); } displayName = nbuf.toString(); }
useAverageSkills.setSelected(cs.useAverageSkills()); generateNames.setSelected(cs.generateNames()); showUnitId.setSelected(cs.getShowUnitId());