Ability picker shows now the name of the object instead of {this] in ability text..

This commit is contained in:
LevelX2 2013-11-06 14:32:50 +01:00
parent e8a7a66b52
commit 33c6bf1385
9 changed files with 37 additions and 20 deletions

View file

@ -44,9 +44,13 @@ public class AbilityPickerView implements Serializable {
private Map<UUID, String> choices = new LinkedHashMap<UUID, String>();
public AbilityPickerView(List<? extends Ability> abilities) {
public AbilityPickerView(String objectName, List<? extends Ability> abilities) {
for (Ability ability: abilities) {
choices.put(ability.getId(), ability.getRule(true));
if (objectName == null) {
choices.put(ability.getId(), ability.getRule(true));
} else {
choices.put(ability.getId(), ability.getRule(objectName));
}
}
}