mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
add missing translation, minor speedup generating map
This commit is contained in:
@@ -244,7 +244,7 @@ public class SaveLoadScene extends UIScene {
|
|||||||
loaded = false;
|
loaded = false;
|
||||||
if (WorldSave.load(currentSlot)) {
|
if (WorldSave.load(currentSlot)) {
|
||||||
WorldSave.getCurrentSave().clearChanges();
|
WorldSave.getCurrentSave().clearChanges();
|
||||||
WorldSave.getCurrentSave().getWorld().generateNew(0);
|
if (WorldSave.getCurrentSave().getWorld().generateNew(0)) {
|
||||||
if (difficulty != null)
|
if (difficulty != null)
|
||||||
Current.player().updateDifficulty(Config.instance().getConfigData().difficulties[difficulty.getSelectedIndex()]);
|
Current.player().updateDifficulty(Config.instance().getConfigData().difficulties[difficulty.getSelectedIndex()]);
|
||||||
Current.player().setWorldPosY((int) (WorldSave.getCurrentSave().getWorld().getData().playerStartPosY * WorldSave.getCurrentSave().getWorld().getData().height * WorldSave.getCurrentSave().getWorld().getTileSize()));
|
Current.player().setWorldPosY((int) (WorldSave.getCurrentSave().getWorld().getData().playerStartPosY * WorldSave.getCurrentSave().getWorld().getData().height * WorldSave.getCurrentSave().getWorld().getTileSize()));
|
||||||
@@ -259,6 +259,9 @@ public class SaveLoadScene extends UIScene {
|
|||||||
} else {
|
} else {
|
||||||
Forge.clearTransitionScreen();
|
Forge.clearTransitionScreen();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Forge.clearTransitionScreen();
|
||||||
|
}
|
||||||
}, null, false, true, Forge.getLocalizer().getMessage("lblGeneratingWorld")));
|
}, null, false, true, Forge.getLocalizer().getMessage("lblGeneratingWorld")));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
loaded = false;
|
loaded = false;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public class ColorMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ColorMap(FileHandle file) {
|
public ColorMap(FileHandle file) {
|
||||||
|
if (file.exists()) {
|
||||||
Pixmap pdata=new Pixmap(file);
|
Pixmap pdata=new Pixmap(file);
|
||||||
width=pdata.getWidth();
|
width=pdata.getWidth();
|
||||||
height=pdata.getHeight();
|
height=pdata.getHeight();
|
||||||
@@ -29,6 +30,12 @@ public class ColorMap
|
|||||||
data[x+y*width]=new Color(pdata.getPixel(x,y));
|
data[x+y*width]=new Color(pdata.getPixel(x,y));
|
||||||
}
|
}
|
||||||
pdata.dispose();
|
pdata.dispose();
|
||||||
|
} else {
|
||||||
|
width = 0;
|
||||||
|
height = 0;
|
||||||
|
data = new Color[0];
|
||||||
|
System.err.println("Cannot find file for ColorMap: " + file.path());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWidth() {
|
public int getWidth() {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import forge.gui.GuiBase;
|
|||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class that will create the world from the configuration
|
* Class that will create the world from the configuration
|
||||||
@@ -289,7 +290,8 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
return currentTime;
|
return currentTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public World generateNew(long seed) {
|
public boolean generateNew(long seed) {
|
||||||
|
try {
|
||||||
if (GuiBase.isAndroid())
|
if (GuiBase.isAndroid())
|
||||||
GuiBase.getInterface().preventSystemSleep(true);
|
GuiBase.getInterface().preventSystemSleep(true);
|
||||||
final long[] currentTime = {System.currentTimeMillis()};
|
final long[] currentTime = {System.currentTimeMillis()};
|
||||||
@@ -328,20 +330,26 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
//////////////////
|
//////////////////
|
||||||
///////// calculation structure position with wavefunctioncollapse
|
///////// calculation structure position with wavefunctioncollapse
|
||||||
//////////////////
|
//////////////////
|
||||||
|
List<CompletableFuture<Long>> futures = new ArrayList<>();
|
||||||
for (BiomeData biome : data.GetBiomes()) {
|
for (BiomeData biome : data.GetBiomes()) {
|
||||||
if (biome.structures != null) {
|
if (biome.structures != null) {
|
||||||
int biomeWidth = (int) Math.round(biome.width * (double) width);
|
int biomeWidth = (int) Math.round(biome.width * (double) width);
|
||||||
int biomeHeight = (int) Math.round(biome.height * (double) height);
|
int biomeHeight = (int) Math.round(biome.height * (double) height);
|
||||||
for (BiomeStructureData data : biome.structures) {
|
for (BiomeStructureData data : biome.structures) {
|
||||||
long localSeed = seed;
|
long localSeed = seed;
|
||||||
|
futures.add(CompletableFuture.supplyAsync(()-> {
|
||||||
long threadStartTime = System.currentTimeMillis();
|
long threadStartTime = System.currentTimeMillis();
|
||||||
BiomeStructure structure = new BiomeStructure(data, localSeed, biomeWidth, biomeHeight);
|
BiomeStructure structure = new BiomeStructure(data, localSeed, biomeWidth, biomeHeight);
|
||||||
structure.initialize();
|
structure.initialize();
|
||||||
structureDataMap.put(data, structure);
|
structureDataMap.put(data, structure);
|
||||||
measureGenerationTime("wavefunctioncollapse " + data.sourcePath, threadStartTime);
|
return measureGenerationTime("wavefunctioncollapse " + data.sourcePath, threadStartTime);
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CompletableFuture<?>[] futuresArray = futures.toArray(new CompletableFuture<?>[0]);
|
||||||
|
CompletableFuture.allOf(futuresArray).join();
|
||||||
|
futures.clear();
|
||||||
|
|
||||||
//////////////////
|
//////////////////
|
||||||
///////// calculation each biome position based on noise and radius
|
///////// calculation each biome position based on noise and radius
|
||||||
@@ -612,7 +620,7 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
|
|
||||||
//reset terrain path to the next town
|
//reset terrain path to the next town
|
||||||
for (Pair<PointOfInterest, PointOfInterest> poiToTown : allPOIPathsToNextTown) {
|
for (Pair<PointOfInterest, PointOfInterest> poiToTown : allPOIPathsToNextTown) {
|
||||||
|
futures.add(CompletableFuture.supplyAsync(()-> {
|
||||||
int startX = (int) poiToTown.getKey().getTilePosition(data.tileSize).x;
|
int startX = (int) poiToTown.getKey().getTilePosition(data.tileSize).x;
|
||||||
int startY = (int) poiToTown.getKey().getTilePosition(data.tileSize).y;
|
int startY = (int) poiToTown.getKey().getTilePosition(data.tileSize).y;
|
||||||
int x1 = (int) poiToTown.getValue().getTilePosition(data.tileSize).x;
|
int x1 = (int) poiToTown.getValue().getTilePosition(data.tileSize).x;
|
||||||
@@ -639,10 +647,14 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
startY = startY + sy;
|
startY = startY + sy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 0l;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
futuresArray = futures.toArray(new CompletableFuture<?>[0]);
|
||||||
|
CompletableFuture.allOf(futuresArray).join();
|
||||||
|
futures.clear();
|
||||||
for (Pair<PointOfInterest, PointOfInterest> townPair : allSortedTowns) {
|
for (Pair<PointOfInterest, PointOfInterest> townPair : allSortedTowns) {
|
||||||
|
futures.add(CompletableFuture.supplyAsync(()-> {
|
||||||
int startX = (int) townPair.getKey().getTilePosition(data.tileSize).x;
|
int startX = (int) townPair.getKey().getTilePosition(data.tileSize).x;
|
||||||
int startY = (int) townPair.getKey().getTilePosition(data.tileSize).y;
|
int startY = (int) townPair.getKey().getTilePosition(data.tileSize).y;
|
||||||
int x1 = (int) townPair.getValue().getTilePosition(data.tileSize).x;
|
int x1 = (int) townPair.getValue().getTilePosition(data.tileSize).x;
|
||||||
@@ -676,7 +688,12 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
startY = startY + sy;
|
startY = startY + sy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 0l;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
futuresArray = futures.toArray(new CompletableFuture<?>[0]);
|
||||||
|
CompletableFuture.allOf(futuresArray).join();
|
||||||
|
futures.clear();
|
||||||
currentTime[0] = measureGenerationTime("roads", currentTime[0]);
|
currentTime[0] = measureGenerationTime("roads", currentTime[0]);
|
||||||
|
|
||||||
//////////////////
|
//////////////////
|
||||||
@@ -784,7 +801,11 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
|
|
||||||
if (GuiBase.isAndroid())
|
if (GuiBase.isAndroid())
|
||||||
GuiBase.getInterface().preventSystemSleep(false);
|
GuiBase.getInterface().preventSystemSleep(false);
|
||||||
return this;
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
HashMap<String, Pair<Pixmap, HashMap<String, Pixmap>>> pixmapHash = new HashMap<>();
|
HashMap<String, Pair<Pixmap, HashMap<String, Pixmap>>> pixmapHash = new HashMap<>();
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ public class WorldSave {
|
|||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("Generating New World");
|
System.err.println("Generating New World");
|
||||||
currentSave.world.generateNew(0);
|
if (!currentSave.world.generateNew(0))
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentSave.onLoadList.emit();
|
currentSave.onLoadList.emit();
|
||||||
|
|||||||
@@ -3445,3 +3445,16 @@ lblSnapshot=Schnappschuss
|
|||||||
lblNewSnapshotVersion=NEU FORGE-{0}!
|
lblNewSnapshotVersion=NEU FORGE-{0}!
|
||||||
cbSnapshotUpdate=Überprüfen Sie Snapshot-Updates beim Start.
|
cbSnapshotUpdate=Überprüfen Sie Snapshot-Updates beim Start.
|
||||||
nlSnapshotUpdate=Wenn diese Option aktiviert ist, werden Snapshot-Updates beim Start automatisch überprüft und die Benachrichtigung in der Titelleiste angezeigt.
|
nlSnapshotUpdate=Wenn diese Option aktiviert ist, werden Snapshot-Updates beim Start automatisch überprüft und die Benachrichtigung in der Titelleiste angezeigt.
|
||||||
|
lblAddCommander=Satz
|
||||||
|
lblaspartnercommander=als Partnerkommandant
|
||||||
|
lblfromattractiondeck=vom Attraktionsdeck
|
||||||
|
lbltoattractiondeck=zum Attraktionsdeck
|
||||||
|
lblAddDeckSection=Variantenabschnitt hinzufügen...
|
||||||
|
lblAddDeckSectionSelect=Wählen Sie den Abschnitt zum Hinzufügen aus
|
||||||
|
lblFrom=aus
|
||||||
|
lblAttractions=Attraktionen
|
||||||
|
lblConspiracies=Verschwörungen
|
||||||
|
lblChooseOrderCardsPutIntoAttractionDeck=Wählen Sie die Reihenfolge der Karten aus, die in den Attraktionsstapel gelegt werden sollen
|
||||||
|
lblAttractionRollResult={0} gewürfelt, um ihre Attraktionen zu besuchen. Ergebnis: {1}.
|
||||||
|
lblAttractionDeckZone=Attraktionsdeck
|
||||||
|
lblLights=Lichter
|
||||||
@@ -3459,3 +3459,10 @@ lblSnapshot=Instantánea
|
|||||||
lblNewSnapshotVersion=NUEVO FORGE-{0}!
|
lblNewSnapshotVersion=NUEVO FORGE-{0}!
|
||||||
cbSnapshotUpdate=Verifique las actualizaciones de instantáneas al inicio.
|
cbSnapshotUpdate=Verifique las actualizaciones de instantáneas al inicio.
|
||||||
nlSnapshotUpdate=Cuando está habilitado, verifica automáticamente las actualizaciones de instantáneas al inicio y muestra la notificación en la barra de título.
|
nlSnapshotUpdate=Cuando está habilitado, verifica automáticamente las actualizaciones de instantáneas al inicio y muestra la notificación en la barra de título.
|
||||||
|
lblaspartnercommander=como comandante compañero
|
||||||
|
lblfromattractiondeck=desde la plataforma de atracción
|
||||||
|
lbltoattractiondeck=a la plataforma de atracción
|
||||||
|
lblFrom=de
|
||||||
|
lblChooseOrderCardsPutIntoAttractionDeck=Elige el orden de las cartas para colocarlas en el mazo de atracciones.
|
||||||
|
lblAttractionRollResult={0} rodó para visitar sus atracciones. Resultado: {1}.
|
||||||
|
lblLights=Luces
|
||||||
@@ -3453,3 +3453,16 @@ lblSnapshot=Instantané
|
|||||||
lblNewSnapshotVersion=NOUVEAU FORGE–{0}!
|
lblNewSnapshotVersion=NOUVEAU FORGE–{0}!
|
||||||
cbSnapshotUpdate=Vérifiez les mises à jour des instantanés au démarrage.
|
cbSnapshotUpdate=Vérifiez les mises à jour des instantanés au démarrage.
|
||||||
nlSnapshotUpdate=Lorsqu'il est activé, vérifie automatiquement les mises à jour des instantanés au démarrage et affiche la notification sur la barre de titre.
|
nlSnapshotUpdate=Lorsqu'il est activé, vérifie automatiquement les mises à jour des instantanés au démarrage et affiche la notification sur la barre de titre.
|
||||||
|
lblAddCommander=Ensemble
|
||||||
|
lblaspartnercommander=en tant que commandant partenaire
|
||||||
|
lblfromattractiondeck=depuis le pont d'attraction
|
||||||
|
lbltoattractiondeck=au pont d'attraction
|
||||||
|
lblAddDeckSection=Ajouter une section de variante...
|
||||||
|
lblAddDeckSectionSelect=Sélectionnez la section à ajouter
|
||||||
|
lblFrom=depuis
|
||||||
|
lblAttractions=Attractions
|
||||||
|
lblConspiracies=Conspirations
|
||||||
|
lblChooseOrderCardsPutIntoAttractionDeck=Choisissez l'ordre des cartes à mettre dans le jeu d'attraction
|
||||||
|
lblAttractionRollResult={0} ont lancé un jet pour visiter leurs attractions. Résultat: {1}.
|
||||||
|
lblAttractionDeckZone=pont d'attraction
|
||||||
|
lblLights=Lumières
|
||||||
@@ -3451,3 +3451,16 @@ lblSnapshot=Istantanea
|
|||||||
lblNewSnapshotVersion=NUOVO FORGE-{0}!
|
lblNewSnapshotVersion=NUOVO FORGE-{0}!
|
||||||
cbSnapshotUpdate=Controlla gli aggiornamenti delle istantanee all'avvio.
|
cbSnapshotUpdate=Controlla gli aggiornamenti delle istantanee all'avvio.
|
||||||
nlSnapshotUpdate=Se abilitato, controlla automaticamente gli aggiornamenti delle istantanee all'avvio e visualizza la notifica sulla barra del titolo.
|
nlSnapshotUpdate=Se abilitato, controlla automaticamente gli aggiornamenti delle istantanee all'avvio e visualizza la notifica sulla barra del titolo.
|
||||||
|
lblAddCommander=Impostato
|
||||||
|
lblaspartnercommander=come comandante partner
|
||||||
|
lblfromattractiondeck=dal ponte delle attrazioni
|
||||||
|
lbltoattractiondeck=al ponte delle attrazioni
|
||||||
|
lblAddDeckSection=Aggiungi sezione variante...
|
||||||
|
lblAddDeckSectionSelect=Seleziona la sezione da aggiungere
|
||||||
|
lblFrom=da
|
||||||
|
lblAttractions=Attrazioni
|
||||||
|
lblConspiracies=Cospirazioni
|
||||||
|
lblChooseOrderCardsPutIntoAttractionDeck=Scegli l'ordine delle carte da inserire nel mazzo delle attrazioni
|
||||||
|
lblAttractionRollResult={0} ha rotolato per visitare le sue attrazioni. Risultato: {1}.
|
||||||
|
lblAttractionDeckZone=attrazione
|
||||||
|
lblLights=Luci
|
||||||
@@ -3447,3 +3447,16 @@ lblSnapshot=スナップショット
|
|||||||
lblNewSnapshotVersion=新しい FORGE-{0}!
|
lblNewSnapshotVersion=新しい FORGE-{0}!
|
||||||
cbSnapshotUpdate=起動時にスナップショットの更新を確認します。
|
cbSnapshotUpdate=起動時にスナップショットの更新を確認します。
|
||||||
nlSnapshotUpdate=有効にすると、起動時にスナップショットの更新が自動的にチェックされ、タイトル バーに通知が表示されます。
|
nlSnapshotUpdate=有効にすると、起動時にスナップショットの更新が自動的にチェックされ、タイトル バーに通知が表示されます。
|
||||||
|
lblAddCommander=セット
|
||||||
|
lblaspartnercommander=パートナー指揮官として
|
||||||
|
lblfromattractiondeck=アトラクションデッキから
|
||||||
|
lbltoattractiondeck=アトラクションデッキへ
|
||||||
|
lblAddDeckSection=バリアント セクションを追加...
|
||||||
|
lblAddDeckSectionSelect=追加するセクションを選択してください
|
||||||
|
lblFrom=から
|
||||||
|
lblAttractions=アトラクション
|
||||||
|
lblConspiracies=陰謀
|
||||||
|
lblChooseOrderCardsPutIntoAttractionDeck=アトラクションデッキに入れるカードの順番を選択してください
|
||||||
|
lblAttractionRollResult={0} はアトラクションを訪れるために転がりました。結果: {1}。
|
||||||
|
lblAttractionDeckZone=アトラクションデッキ
|
||||||
|
lblLights=ライト
|
||||||
@@ -3537,3 +3537,16 @@ lblSnapshot=Instantâneo
|
|||||||
lblNewSnapshotVersion=NOVO FORGE-{0}!
|
lblNewSnapshotVersion=NOVO FORGE-{0}!
|
||||||
cbSnapshotUpdate=Verifique as atualizações de instantâneos na inicialização.
|
cbSnapshotUpdate=Verifique as atualizações de instantâneos na inicialização.
|
||||||
nlSnapshotUpdate=Quando ativado, verifica automaticamente as atualizações do snapshot na inicialização e exibe a notificação na barra de título.
|
nlSnapshotUpdate=Quando ativado, verifica automaticamente as atualizações do snapshot na inicialização e exibe a notificação na barra de título.
|
||||||
|
lblAddCommander=Definir
|
||||||
|
lblaspartnercommander=como comandante parceiro
|
||||||
|
lblfromattractiondeck=do deck de atração
|
||||||
|
lbltoattractiondeck=para o deck de atração
|
||||||
|
lblAddDeckSection=Adicionar seção de variante...
|
||||||
|
lblAddDeckSectionSelect=Selecione a seção a ser adicionada
|
||||||
|
lblFrom=de
|
||||||
|
lblAttractions=Atrações
|
||||||
|
lblConspiracies=Conspirações
|
||||||
|
lblChooseOrderCardsPutIntoAttractionDeck=Escolha a ordem das cartas para colocar no baralho de atração
|
||||||
|
lblAttractionRollResult={0} rolou para visitar suas atrações. Resultado: {1}.
|
||||||
|
lblAttractionDeckZone=deck de atração
|
||||||
|
lblLights=Luzes
|
||||||
@@ -3438,3 +3438,16 @@ lblSnapshot=快照
|
|||||||
lblNewSnapshotVersion=新 FORGE-{0}!
|
lblNewSnapshotVersion=新 FORGE-{0}!
|
||||||
cbSnapshotUpdate=启动时检查快照更新。
|
cbSnapshotUpdate=启动时检查快照更新。
|
||||||
nlSnapshotUpdate=启用后,启动时自动检查快照更新并在标题栏上显示通知。
|
nlSnapshotUpdate=启用后,启动时自动检查快照更新并在标题栏上显示通知。
|
||||||
|
lblAddCommander=放
|
||||||
|
lblaspartnercommander=作为伙伴指挥官
|
||||||
|
lblfromattractiondeck=从景点甲板
|
||||||
|
lbltoattractiondeck=到景点甲板
|
||||||
|
lblAddDeckSection=添加变体部分...
|
||||||
|
lblAddDeckSectionSelect=选择要添加的部分
|
||||||
|
lblFrom=从
|
||||||
|
lblAttractions=景点
|
||||||
|
lblConspiracies=阴谋
|
||||||
|
lblChooseOrderCardsPutIntoAttractionDeck=选择放入景点牌组的卡片顺序
|
||||||
|
lblAttractionRollResult={0} 滚动访问他们的景点。结果:{1}。
|
||||||
|
lblAttractionDeckZone=吸引力甲板
|
||||||
|
lblLights=灯
|
||||||
Reference in New Issue
Block a user