Atmosphäre-Tools, EZ-Tree-Fixes, i18n, AnimSet, Baum-Export
- blight-lang: TextResolver + EN/DE Sprachpakete (TextReference i18n) - AnimSet: Clips + ActionMap in .animset.json zusammengeführt - EZ-Tree: Branch-Parameter-Fixes (length/radius/children/force nicht senden, twist Grad→Radiant, leaves.size ×5); Ordner-ComboBox mit Auto-Refresh - Logging beim Baum-Export in allen drei Generatoren (EZ-Tree, Blight, Palme) - Atmosphäre-Tools: Emitter, Licht, Wasser, Sound-/Musikbereiche, Spiel-Starten - AnimPreviewState, RetargetingSystem, AnimationLibrary (Animations-Editor) - Terrain-Transparenz-Fix, Schatten-Fix, ThirdPersonCamera-Fix - DayNightState, WeatherState, CloudsNode, JmeConsole - MapIO v6, neue blight-common Modell-Klassen (GameCharacter, NPC, Quests…) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
11
blight-lang/build.gradle
Normal file
11
blight-lang/build.gradle
Normal file
@@ -0,0 +1,11 @@
|
||||
// Sprachpakete — enthält TextResolver und die .properties-Dateien für alle Sprachen.
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':blight-common')
|
||||
compileOnly 'org.projectlombok:lombok:1.18.38'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.38'
|
||||
implementation 'org.slf4j:slf4j-api:2.0.17'
|
||||
}
|
||||
71
blight-lang/src/main/java/de/blight/lang/TextResolver.java
Normal file
71
blight-lang/src/main/java/de/blight/lang/TextResolver.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package de.blight.lang;
|
||||
|
||||
import de.blight.common.model.TextReference;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* Löst TextReference-IDs zur Laufzeit in den lokalisierten Text auf.
|
||||
* Vor dem ersten Aufruf von resolve() muss init(Locale) aufgerufen werden.
|
||||
* Ohne explizites init() wird Englisch als Standard verwendet.
|
||||
*/
|
||||
public class TextResolver {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(TextResolver.class);
|
||||
private static final String BASE_NAME = "lang/messages";
|
||||
|
||||
private static TextResolver instance;
|
||||
|
||||
private final ResourceBundle bundle;
|
||||
private final ResourceBundle fallback;
|
||||
|
||||
private TextResolver(Locale locale) {
|
||||
this.fallback = ResourceBundle.getBundle(BASE_NAME, Locale.ENGLISH);
|
||||
if (locale.equals(Locale.ENGLISH)) {
|
||||
this.bundle = this.fallback;
|
||||
} else {
|
||||
ResourceBundle loaded;
|
||||
try {
|
||||
loaded = ResourceBundle.getBundle(BASE_NAME, locale);
|
||||
} catch (MissingResourceException e) {
|
||||
LOG.warn("Kein Sprachpaket für {} gefunden, falle auf Englisch zurück.", locale);
|
||||
loaded = this.fallback;
|
||||
}
|
||||
this.bundle = loaded;
|
||||
}
|
||||
}
|
||||
|
||||
public static void init(Locale locale) {
|
||||
instance = new TextResolver(locale);
|
||||
}
|
||||
|
||||
public static TextResolver get() {
|
||||
if (instance == null) {
|
||||
instance = new TextResolver(Locale.ENGLISH);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public String resolve(TextReference ref) {
|
||||
if (ref == null) return "";
|
||||
return resolveId(ref.id());
|
||||
}
|
||||
|
||||
public String resolveId(String id) {
|
||||
if (id == null || id.isBlank()) return "";
|
||||
try {
|
||||
return bundle.getString(id);
|
||||
} catch (MissingResourceException e) {
|
||||
try {
|
||||
return fallback.getString(id);
|
||||
} catch (MissingResourceException ex) {
|
||||
LOG.warn("Unbekannte Text-ID: {}", id);
|
||||
return "[" + id + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
blight-lang/src/main/resources/lang/messages_de.properties
Normal file
18
blight-lang/src/main/resources/lang/messages_de.properties
Normal file
@@ -0,0 +1,18 @@
|
||||
# ── Items ────────────────────────────────────────────────────────────────────
|
||||
item.driftwood.name=Treibholz
|
||||
item.driftwood.description=Ein ans Ufer gespültes Stück Holz. Könnte nützlich sein.
|
||||
|
||||
item.rope.name=Seil
|
||||
item.rope.description=Ein ausgefranstes Stück Seil. Hält noch.
|
||||
|
||||
item.knife.name=Messer
|
||||
item.knife.description=Eine einfache, aber scharfe Klinge.
|
||||
|
||||
# ── Quests ───────────────────────────────────────────────────────────────────
|
||||
quest.intro.title=An Land gespült
|
||||
quest.intro.description=Du hast den Schiffbruch überlebt. Finde Unterschlupf bevor die Nacht anbricht.
|
||||
quest.intro.success=Du hast einen Unterschlupf gefunden. Ruh dich aus — morgen bringt neue Gefahren.
|
||||
|
||||
# ── Dialog ───────────────────────────────────────────────────────────────────
|
||||
dialog.fisherman.greet.hero=Hallo? Ist da jemand?
|
||||
dialog.fisherman.greet.npc=Hier drüben! Dem Himmel sei Dank, du lebst noch.
|
||||
18
blight-lang/src/main/resources/lang/messages_en.properties
Normal file
18
blight-lang/src/main/resources/lang/messages_en.properties
Normal file
@@ -0,0 +1,18 @@
|
||||
# ── Items ────────────────────────────────────────────────────────────────────
|
||||
item.driftwood.name=Driftwood
|
||||
item.driftwood.description=A piece of wood washed ashore. Could be useful.
|
||||
|
||||
item.rope.name=Rope
|
||||
item.rope.description=A frayed piece of rope. Still holds.
|
||||
|
||||
item.knife.name=Knife
|
||||
item.knife.description=A simple but sharp blade.
|
||||
|
||||
# ── Quests ───────────────────────────────────────────────────────────────────
|
||||
quest.intro.title=Washed Ashore
|
||||
quest.intro.description=You survived the shipwreck. Find shelter before nightfall.
|
||||
quest.intro.success=You have found shelter. Rest now — tomorrow brings new dangers.
|
||||
|
||||
# ── Dialog ───────────────────────────────────────────────────────────────────
|
||||
dialog.fisherman.greet.hero=Hello? Is someone there?
|
||||
dialog.fisherman.greet.npc=Over here! Thank the gods you are alive.
|
||||
Reference in New Issue
Block a user