Weitere Anpassungen bezüglich der Voxel und des Zoning Systems
This commit is contained in:
@@ -68,4 +68,23 @@ public class TextResolver {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Wie resolveId(), gibt aber bei fehlendem Key den Key selbst zurück statt [key]. */
|
||||
public String resolveOrId(String id) {
|
||||
if (id == null || id.isBlank()) return "";
|
||||
try {
|
||||
return bundle.getString(id);
|
||||
} catch (MissingResourceException e) {
|
||||
try {
|
||||
return fallback.getString(id);
|
||||
} catch (MissingResourceException ex) {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String resolve(TextReference ref, String fallbackText) {
|
||||
if (ref == null || ref.id() == null || ref.id().isBlank()) return fallbackText;
|
||||
return resolveOrId(ref.id()).equals(ref.id()) ? fallbackText : resolveOrId(ref.id());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,4 +93,7 @@ dialog.silas.wer_seid_ihr.textnpc
|
||||
erzmoss.description
|
||||
erzmoss.name
|
||||
hero.name
|
||||
location.neu_1786533928723
|
||||
location.neu_1786546178407
|
||||
location.test
|
||||
silas.name
|
||||
|
||||
Reference in New Issue
Block a user