mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
Locales using CSV, added language sheet from Polyglot Project
Former-commit-id: 6cbb8643ca82e26db3a2ea90db9bee132c22c2ce Former-commit-id: cd6489fab6b988af8939fab167b69119d77eff8f
This commit is contained in:
@@ -14,9 +14,10 @@ import java.util.List;
|
||||
*/
|
||||
public class CSVFetcher {
|
||||
|
||||
private static StringBuffer csvString = new StringBuffer();
|
||||
private static StringBuffer csvString;
|
||||
|
||||
public static List<CSVRecord> readCSV(String csvFilePath) throws IOException {
|
||||
csvString = new StringBuffer();
|
||||
readCsvFileAsString(csvFilePath);
|
||||
|
||||
CSVParser csvParser = CSVParser.parse(csvString.toString()
|
||||
|
||||
@@ -12,9 +12,10 @@ import java.nio.file.Files;
|
||||
*/
|
||||
public class JsonFetcher {
|
||||
|
||||
private static StringBuffer jsonString = new StringBuffer();
|
||||
private static StringBuffer jsonString;
|
||||
|
||||
public static JsonObject readJson(String jsonFilePath) throws IOException {
|
||||
jsonString = new StringBuffer();
|
||||
readJsonFileAsString(jsonFilePath);
|
||||
|
||||
JsonParser jsonParser = new JsonParser();
|
||||
|
||||
@@ -27,6 +27,12 @@ public class CommandInterpreter {
|
||||
else if (single_command.getName().equalsIgnoreCase("zoom")) {
|
||||
new Zoom().execute(single_command.toStringArray());
|
||||
}
|
||||
else if (single_command.getName().equalsIgnoreCase("setlocale")) {
|
||||
new SetLocale().execute(single_command.toStringArray());
|
||||
}
|
||||
else if (single_command.getName().equalsIgnoreCase("getlocale")) {
|
||||
new GetLocale().execute(single_command.toStringArray());
|
||||
}
|
||||
else {
|
||||
if (Terrarum.game.auth.b()) {
|
||||
ConsoleCommand commandObj = CommandDict.getCommand(
|
||||
|
||||
@@ -15,22 +15,13 @@ public class SetLocale implements ConsoleCommand {
|
||||
public void execute(String[] args) {
|
||||
if (args.length == 2) {
|
||||
String prevLocale = Terrarum.gameLocale;
|
||||
Terrarum.gameLocale = args[1].toLowerCase();
|
||||
Terrarum.gameLocale = args[1];
|
||||
try {
|
||||
new Lang();
|
||||
new Echo().execute("Set locale to '" + Terrarum.gameLocale + "'.");
|
||||
|
||||
if ((!prevLocale.contains("cn") && Terrarum.gameLocale.contains("cn"))
|
||||
|| (prevLocale.contains("cn") && !Terrarum.gameLocale.contains("cn"))) {
|
||||
try { ((GameFontBase) Terrarum.gameFontWhite).reloadUnihan(); }
|
||||
catch (SlickException e) { e.printStackTrace(); }
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
new Echo().execute("Locale '"
|
||||
+ args[1].toLowerCase()
|
||||
+ "' does not exist or could not read file."
|
||||
);
|
||||
new Echo().execute("could not read lang file.");
|
||||
Terrarum.gameLocale = prevLocale;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
package com.Torvald.Terrarum.LangPack;
|
||||
|
||||
import com.Torvald.CSVFetcher;
|
||||
import com.Torvald.ImageFont.GameFontWhite;
|
||||
import com.Torvald.Terrarum.Terrarum;
|
||||
import org.apache.commons.csv.CSVRecord;
|
||||
import org.newdawn.slick.SlickException;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
@@ -12,12 +18,18 @@ import java.util.Properties;
|
||||
*/
|
||||
public class Lang {
|
||||
|
||||
private static Properties lang;
|
||||
private static Properties langFallback;
|
||||
private static final String FALLBACK_LANG_CODE = "en";
|
||||
private static final String CSV_COLUMN_FIRST = "STRING_ID";
|
||||
/**
|
||||
* Get record by its STRING_ID
|
||||
*/
|
||||
private static Hashtable<String, CSVRecord> lang;
|
||||
private static final String FALLBACK_LANG_CODE = "enUS";
|
||||
|
||||
private static final int HANGUL_SYL_START = 0xAC00;
|
||||
|
||||
private static final String PATH_TO_CSV = "./res/locales/";
|
||||
private static final String CSV_MAIN = "polyglot.csv";
|
||||
|
||||
private static final int[] HANGUL_POST_INDEX_ALPH = { // 0: 는, 가, ... 1: 은, 이, ...
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
@@ -37,22 +49,42 @@ public class Lang {
|
||||
};
|
||||
|
||||
public Lang() throws IOException {
|
||||
lang = new Properties();
|
||||
lang.load(new BufferedReader(new InputStreamReader(new FileInputStream(
|
||||
"res/locales/" + Terrarum.gameLocale + ".lang"), StandardCharsets.UTF_8)));
|
||||
lang = new Hashtable<>();
|
||||
|
||||
List<CSVRecord> langPackCSV = CSVFetcher.readCSV(PATH_TO_CSV + CSV_MAIN);
|
||||
|
||||
File file = new File(PATH_TO_CSV);
|
||||
FilenameFilter filter = new FilenameFilter() {
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.contains(".csv") && !name.contains(CSV_MAIN);
|
||||
}
|
||||
};
|
||||
for (String csvfilename : file.list(filter)) {
|
||||
List<CSVRecord> csv = CSVFetcher.readCSV(PATH_TO_CSV + csvfilename);
|
||||
csv.forEach(langPackCSV::add);
|
||||
}
|
||||
|
||||
// Fill lang table
|
||||
langPackCSV.forEach(this::appendToLangByStringID);
|
||||
|
||||
langFallback = new Properties();
|
||||
langFallback.load(new BufferedReader(new InputStreamReader(new FileInputStream(
|
||||
"res/locales/" + FALLBACK_LANG_CODE + ".lang"), StandardCharsets.UTF_8)));
|
||||
|
||||
Arrays.sort(ENGLISH_WORD_NORMAL_PLURAL);
|
||||
Arrays.sort(FRENCH_WORD_NORMAL_PLURAL);
|
||||
|
||||
try { ((GameFontWhite)Terrarum.gameFontWhite).reloadUnihan(); }
|
||||
catch (SlickException e) {}
|
||||
}
|
||||
|
||||
private void appendToLangByStringID(CSVRecord record) {
|
||||
lang.put(record.get(CSV_COLUMN_FIRST), record);
|
||||
}
|
||||
|
||||
public static String get(String key) {
|
||||
return lang.getProperty(key
|
||||
,langFallback.getProperty(key
|
||||
, key)
|
||||
);
|
||||
String value = null;
|
||||
try { value = lang.get(key).get(Terrarum.gameLocale); }
|
||||
catch (IllegalArgumentException e) { value = key; }
|
||||
return value;
|
||||
}
|
||||
|
||||
public static String pluraliseLang(String key, int count) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.Torvald.Terrarum.MapGenerator;
|
||||
|
||||
import com.Torvald.Rand.HQRNG;
|
||||
import com.Torvald.Terrarum.GameMap.GameMap;
|
||||
import com.Torvald.Terrarum.TileProperties.TileNameCode;
|
||||
import com.jme3.math.FastMath;
|
||||
import com.sun.istack.internal.NotNull;
|
||||
|
||||
@@ -45,37 +46,6 @@ public class MapGenerator {
|
||||
private static final int CAVEGEN_LARGEST_FEATURE = 256;
|
||||
private static final int CAVEGEN_LARGEST_FEATURE_PERTURB = 128;
|
||||
|
||||
private static final byte AIR = 0;
|
||||
|
||||
private static final byte STONE = 1;
|
||||
private static final byte DIRT = 2;
|
||||
private static final byte GRASS = 3;
|
||||
|
||||
private static final byte SAND = 13;
|
||||
private static final byte GRAVEL = 14;
|
||||
|
||||
private static final byte COPPER = 15;
|
||||
private static final byte IRON = 16;
|
||||
private static final byte GOLD = 17;
|
||||
private static final byte SILVER = 18;
|
||||
private static final byte ILMENITE = 19;
|
||||
private static final byte AURICHALCUM = 20;
|
||||
|
||||
private static final byte DIAMOND = 25;
|
||||
private static final byte RUBY = 21;
|
||||
private static final byte EMERALD = 22;
|
||||
private static final byte SAPPHIRE = 23;
|
||||
private static final byte TOPAZ = 24;
|
||||
private static final byte AMETHYST = 26;
|
||||
|
||||
private static final byte SNOW = 27;
|
||||
private static final byte ICE_FRAGILE = 28;
|
||||
private static final byte ICE_NATURAL = 29;
|
||||
private static final byte ICE_MAGICAL = 30;
|
||||
|
||||
private static final byte WATER = (byte) 239;
|
||||
private static final byte LAVA = (byte) 255;
|
||||
|
||||
@NotNull private static int worldOceanPosition;
|
||||
private static final int TYPE_OCEAN_LEFT = 0;
|
||||
private static final int TYPE_OCEAN_RIGHT = 1;
|
||||
@@ -121,36 +91,36 @@ public class MapGenerator {
|
||||
|
||||
carveCave(
|
||||
caveGen(1, 1.2f)
|
||||
, AIR
|
||||
, TileNameCode.AIR
|
||||
, "Carving out cave..."
|
||||
);
|
||||
|
||||
fillByMapNoFilterUnderground(
|
||||
generate2DSimplexNoiseWorldSize(1f, 1f)
|
||||
, 0.9f
|
||||
, AIR
|
||||
, STONE
|
||||
, TileNameCode.AIR
|
||||
, TileNameCode.STONE
|
||||
, "Collapsing caves..."
|
||||
);
|
||||
|
||||
/*fillByMapInverseGradFilter(
|
||||
generate2DSimplexNoiseWorldSize(2.5f, 2.5f)
|
||||
, 1.02f
|
||||
, DIRT
|
||||
, STONE
|
||||
, TileNameCode.DIRT
|
||||
, TileNameCode.STONE
|
||||
, "Planting stones on dirt layers..."
|
||||
);
|
||||
fillByMapInverseGradFilter(
|
||||
generate2DSimplexNoiseWorldSize(2.5f, 2.5f)
|
||||
, 0.98f
|
||||
, STONE
|
||||
, DIRT
|
||||
, TileNameCode.STONE
|
||||
, TileNameCode.DIRT
|
||||
, "Planting dirts..."
|
||||
);
|
||||
fillByMapInverseGradFilter(
|
||||
generate2DSimplexNoiseWorldSize(2.5f, 2.5f)
|
||||
, 0.92f
|
||||
, STONE
|
||||
, TileNameCode.STONE
|
||||
, GRAVEL
|
||||
, "Planting gravels..."
|
||||
);*/
|
||||
@@ -161,7 +131,7 @@ public class MapGenerator {
|
||||
/*fillByMap(
|
||||
generate2DSimplexNoiseWorldSize(5, 5)
|
||||
, 0.78f
|
||||
, STONE
|
||||
, TileNameCode.STONE
|
||||
, DIAMOND
|
||||
, "Planting diamonds..."
|
||||
);
|
||||
@@ -170,7 +140,7 @@ public class MapGenerator {
|
||||
fillByMap(
|
||||
generate2DSimplexNoiseWorldSize(5, 5)
|
||||
, 0.8f
|
||||
, STONE
|
||||
, TileNameCode.STONE
|
||||
, berylsArray
|
||||
, "Planting beryls..."
|
||||
);
|
||||
@@ -178,21 +148,21 @@ public class MapGenerator {
|
||||
fillByMap(
|
||||
generate2DSimplexNoiseWorldSize(5, 5)
|
||||
, 0.80f
|
||||
, STONE
|
||||
, TileNameCode.STONE
|
||||
, GOLD
|
||||
, "Planting golds..."
|
||||
);
|
||||
fillByMap(
|
||||
generate2DSimplexNoiseWorldSize(5, 5)
|
||||
, 0.866f
|
||||
, STONE
|
||||
, TileNameCode.STONE
|
||||
, IRON
|
||||
, "Planting irons..."
|
||||
);
|
||||
fillByMap(
|
||||
generate2DSimplexNoiseWorldSize(5, 5)
|
||||
, 0.88f
|
||||
, STONE
|
||||
, TileNameCode.STONE
|
||||
, COPPER
|
||||
, "Planting coppers..."
|
||||
);*/
|
||||
@@ -539,11 +509,11 @@ public class MapGenerator {
|
||||
for (int i = 0; i < height - pillarOffset; i++) {
|
||||
|
||||
if (i < dirtThickness) {
|
||||
map.getTerrainArray()[i + pillarOffset][x] = DIRT;
|
||||
map.getWallArray()[i + pillarOffset][x] = DIRT;
|
||||
map.getTerrainArray()[i + pillarOffset][x] = TileNameCode.DIRT;
|
||||
map.getWallArray()[i + pillarOffset][x] = TileNameCode.DIRT;
|
||||
} else {
|
||||
map.getTerrainArray()[i + pillarOffset][x] = STONE;
|
||||
map.getWallArray()[i + pillarOffset][x] = STONE;
|
||||
map.getTerrainArray()[i + pillarOffset][x] = TileNameCode.STONE;
|
||||
map.getWallArray()[i + pillarOffset][x] = TileNameCode.STONE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -659,7 +629,7 @@ public class MapGenerator {
|
||||
for (int j = 0; j < width; j++) {
|
||||
if (map[i][j] > noiseGradientStart * scarcity
|
||||
&& MapGenerator.map.getTileFromTerrain(j, i) == replaceFrom
|
||||
&& MapGenerator.map.getTileFromWall(j, i) == STONE) {
|
||||
&& MapGenerator.map.getTileFromWall(j, i) == TileNameCode.STONE) {
|
||||
MapGenerator.map.getTerrainArray()[i][j] = tile;
|
||||
}
|
||||
}
|
||||
@@ -867,7 +837,7 @@ public class MapGenerator {
|
||||
for (int i = height * 14 / 15; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
if (map.getTerrainArray()[i][j] == 0) {
|
||||
map.getTerrainArray()[i][j] = LAVA;
|
||||
map.getTerrainArray()[i][j] = TileNameCode.LAVA;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -896,8 +866,8 @@ public class MapGenerator {
|
||||
try { nearbyWallTile = map.getTileFromWall(x + (i % 3) - 1, y + (i / 3) - 1); }
|
||||
catch (ArrayIndexOutOfBoundsException e) {}
|
||||
|
||||
if (i != 4 && thisTile == DIRT && nearbyWallTile == AIR) {
|
||||
map.getTerrainArray()[y][x] = GRASS;
|
||||
if (i != 4 && thisTile == TileNameCode.DIRT && nearbyWallTile == TileNameCode.AIR) {
|
||||
map.getTerrainArray()[y][x] = TileNameCode.GRASS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -907,7 +877,7 @@ public class MapGenerator {
|
||||
}
|
||||
|
||||
private static boolean isGrassOrDirt(int x, int y) {
|
||||
return map.getTileFromTerrain(x, y) == GRASS || map.getTileFromTerrain(x, y) == DIRT;
|
||||
return map.getTileFromTerrain(x, y) == TileNameCode.GRASS || map.getTileFromTerrain(x, y) == TileNameCode.DIRT;
|
||||
}
|
||||
|
||||
private static void replaceIfTerrain(byte ifTile, int x, int y, byte replaceTile) {
|
||||
@@ -933,7 +903,7 @@ public class MapGenerator {
|
||||
; y < getTerrainHeightFromHeightMap(ix)
|
||||
; y++) {
|
||||
map.getTerrainArray()
|
||||
[y][ix] = WATER;
|
||||
[y][ix] = TileNameCode.WATER;
|
||||
}
|
||||
}
|
||||
else if (worldOceanPosition == TYPE_OCEAN_RIGHT) {
|
||||
@@ -941,7 +911,7 @@ public class MapGenerator {
|
||||
; y < getTerrainHeightFromHeightMap(map.width - 1 - ix)
|
||||
; y++) {
|
||||
map.getTerrainArray()
|
||||
[y][map.width - 1 - ix] = WATER;
|
||||
[y][map.width - 1 - ix] = TileNameCode.WATER;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -953,20 +923,20 @@ public class MapGenerator {
|
||||
|
||||
map.getTerrainArray()
|
||||
[terrainPoint + iy]
|
||||
[ix] = SAND;
|
||||
[ix] = TileNameCode.SAND;
|
||||
map.getTerrainArray()
|
||||
[terrainPoint + iy - 1] // clear grass and make the sheet thicker
|
||||
[ix] = SAND;
|
||||
[ix] = TileNameCode.SAND;
|
||||
}
|
||||
else if (worldOceanPosition == TYPE_OCEAN_RIGHT) {
|
||||
int terrainPoint = getTerrainHeightFromHeightMap(map.width - 1 - ix);
|
||||
|
||||
map.getTerrainArray()
|
||||
[terrainPoint + iy]
|
||||
[map.width - 1 - ix] = SAND;
|
||||
[map.width - 1 - ix] = TileNameCode.SAND;
|
||||
map.getTerrainArray()
|
||||
[terrainPoint + iy - 1] // clear grass and make the sheet thicker
|
||||
[map.width - 1 - ix] = SAND;
|
||||
[map.width - 1 - ix] = TileNameCode.SAND;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -976,18 +946,18 @@ public class MapGenerator {
|
||||
for (int y = 0; y < map.height - 1; y++) {
|
||||
for (int x = 0; x < getFrozenAreaWidth(y); x++) {
|
||||
if (worldOceanPosition == TYPE_OCEAN_RIGHT) {
|
||||
replaceIfTerrain(DIRT, x, y, SNOW);
|
||||
replaceIfTerrain(STONE, x, y, ICE_NATURAL);
|
||||
replaceIfTerrain(TileNameCode.DIRT, x, y, TileNameCode.SNOW);
|
||||
replaceIfTerrain(TileNameCode.STONE, x, y, TileNameCode.ICE_NATURAL);
|
||||
|
||||
replaceIfWall(DIRT, x, y, SNOW);
|
||||
replaceIfWall(STONE, x, y, ICE_NATURAL);
|
||||
replaceIfWall(TileNameCode.DIRT, x, y, TileNameCode.SNOW);
|
||||
replaceIfWall(TileNameCode.STONE, x, y, TileNameCode.ICE_NATURAL);
|
||||
}
|
||||
else {
|
||||
replaceIfTerrain(DIRT, map.width - 1 - x, y, SNOW);
|
||||
replaceIfTerrain(STONE, map.width - 1 - x, y, ICE_NATURAL);
|
||||
replaceIfTerrain(TileNameCode.DIRT, map.width - 1 - x, y, TileNameCode.SNOW);
|
||||
replaceIfTerrain(TileNameCode.STONE, map.width - 1 - x, y, TileNameCode.ICE_NATURAL);
|
||||
|
||||
replaceIfWall(DIRT, map.width - 1 - x, y, SNOW);
|
||||
replaceIfWall(STONE, map.width - 1 - x, y, ICE_NATURAL);
|
||||
replaceIfWall(TileNameCode.DIRT, map.width - 1 - x, y, TileNameCode.SNOW);
|
||||
replaceIfWall(TileNameCode.STONE, map.width - 1 - x, y, TileNameCode.ICE_NATURAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Terrarum extends StateBasedGame {
|
||||
public static String defaultDir;
|
||||
public static String defaultSaveDir;
|
||||
|
||||
public static String gameLocale = "jp";
|
||||
public static String gameLocale = "jaJP";
|
||||
|
||||
public static Font gameFontWhite;
|
||||
|
||||
@@ -60,7 +60,6 @@ public class Terrarum extends StateBasedGame {
|
||||
createDirs();
|
||||
try {
|
||||
createFiles();
|
||||
new Lang();
|
||||
}
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@@ -71,6 +70,9 @@ public class Terrarum extends StateBasedGame {
|
||||
public void initStatesList(GameContainer gc) throws SlickException {
|
||||
gameFontWhite = new GameFontWhite();
|
||||
|
||||
try { new Lang(); }
|
||||
catch (IOException e) { e.printStackTrace(); }
|
||||
|
||||
hasController = (gc.getInput().getControllerCount() > 0);
|
||||
if (hasController) {
|
||||
for (int c = 0; c < Controllers.getController(0).getAxisCount(); c++) {
|
||||
|
||||
58
src/com/Torvald/Terrarum/TileProperties/TileNameCode.java
Normal file
58
src/com/Torvald/Terrarum/TileProperties/TileNameCode.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package com.Torvald.Terrarum.TileProperties;
|
||||
|
||||
import com.Torvald.Terrarum.Terrarum;
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 16-02-21.
|
||||
*/
|
||||
public class TileNameCode {
|
||||
|
||||
public static final byte AIR = 0;
|
||||
|
||||
public static final byte STONE = 1;
|
||||
public static final byte DIRT = 2;
|
||||
public static final byte GRASS = 3;
|
||||
|
||||
public static final byte PLANK_NORMAL = 4;
|
||||
public static final byte PLANK_EBONY = 5;
|
||||
public static final byte PLANK_BIRCH = 6;
|
||||
public static final byte PLANK_BLOODROSE = 7;
|
||||
|
||||
public static final byte TRUNK_NORMAL = 8;
|
||||
public static final byte TRUNK_EBONY = 9;
|
||||
public static final byte TRUNK_BIRCH = 10;
|
||||
public static final byte TRUNK_BLOODROSE = 11;
|
||||
|
||||
public static final byte STONE_QUARRIED = 12;
|
||||
public static final byte SAND = 13;
|
||||
public static final byte GRAVEL = 14;
|
||||
|
||||
public static final byte ORE_COPPER = 15;
|
||||
public static final byte ORE_IRON = 16;
|
||||
public static final byte ORE_GOLD = 17;
|
||||
public static final byte ORE_SILVER = 18;
|
||||
public static final byte ORE_ILMENITE = 19;
|
||||
public static final byte ORE_AURICHALCUM = 20;
|
||||
|
||||
public static final byte RAW_RUBY = 21;
|
||||
public static final byte RAW_EMERALD = 22;
|
||||
public static final byte RAW_SAPPHIRE = 23;
|
||||
public static final byte RAW_TOPAZ = 24;
|
||||
public static final byte RAW_DIAMOND = 25;
|
||||
public static final byte RAW_AMETHYST = 26;
|
||||
|
||||
public static final byte SNOW = 27;
|
||||
public static final byte ICE_FRAGILE = 28;
|
||||
public static final byte ICE_NATURAL = 29;
|
||||
public static final byte ICE_MAGICAL = 30;
|
||||
|
||||
public static final byte PLATFORM_STONE = 31;
|
||||
public static final byte PLATFORM_WOODEN = 32;
|
||||
public static final byte PLATFORM_EBONY = 33;
|
||||
public static final byte PLATFORM_BIRCH = 34;
|
||||
public static final byte PLATFORM_BLOODROSE = 35;
|
||||
|
||||
public static final byte WATER = (byte) 239;
|
||||
public static final byte LAVA = (byte) 255;
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.Torvald.Terrarum.GameMap.MapLayer;
|
||||
import org.apache.commons.csv.CSVRecord;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -22,6 +23,7 @@ public class TilePropCodex {
|
||||
}
|
||||
|
||||
try {
|
||||
// todo verify CSV using pre-calculated SHA256 hash
|
||||
List<CSVRecord> records = CSVFetcher.readCSV("" +
|
||||
"./src/com/Torvald/Terrarum/TileProperties/propdata" +
|
||||
".csv");
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"9";"TILE_TRUNK_EBONY" ; "5"; "12"; "0"; "N/A"; "1"; "0"; "0"; "9"; "0";"16"
|
||||
"10";"TILE_TRUNK_BIRCH" ; "5"; "12"; "0"; "N/A"; "1"; "0"; "0"; "10"; "0";"16"
|
||||
"11";"TILE_TRUNK_BLOODROSE" ; "5"; "12"; "0"; "N/A"; "1"; "0"; "0"; "11"; "0";"16"
|
||||
"12";"TILE_STONE" ; "5"; "25"; "0"; "N/A"; "1"; "1"; "0"; "12"; "0";"16"
|
||||
"12";"TILE_STONE_QUARRIED" ; "5"; "25"; "0"; "N/A"; "1"; "1"; "0"; "12"; "0";"16"
|
||||
"13";"TILE_SAND" ; "5"; "6"; "0"; "N/A"; "1"; "1"; "0"; "13"; "1";"16"
|
||||
"14";"TILE_GRAVEL" ; "5"; "6"; "0"; "N/A"; "1"; "0"; "0"; "14"; "1";"16"
|
||||
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 1 and column 12.
|
@@ -69,12 +69,7 @@ public class BasicDebugInfoWindow implements UICanvas {
|
||||
printLine(g, 4, "veloY : " + String.valueOf(playerDbg.veloY()));
|
||||
printLine(g, 5, "grounded : " + String.valueOf(playerDbg.grounded()));
|
||||
printLine(g, 6, "noClip : " + String.valueOf(playerDbg.noClip()));
|
||||
printLine(g, 7, Lang.get("DBG_TOTAL_ACCEL_X") + " : " + String.valueOf(
|
||||
(float) playerDbg.actorValue().get("accel")
|
||||
* (float) playerDbg.actorValue().get("accelmult")
|
||||
)
|
||||
+ " (" + String.valueOf(playerDbg.getPlayer().readonly_totalX) + ")");
|
||||
printLine(g, 8
|
||||
printLine(g, 7
|
||||
, Lang.get("TERM_PHYS_MASS")
|
||||
+ " : "
|
||||
+ String.valueOf(playerDbg.mass())
|
||||
@@ -95,7 +90,7 @@ public class BasicDebugInfoWindow implements UICanvas {
|
||||
catch (ArrayIndexOutOfBoundsException e) {
|
||||
lightVal = "out of bounds";
|
||||
}
|
||||
printLine(g, 9, "light at cursor : " + lightVal);
|
||||
printLine(g, 8, "light at cursor : " + lightVal);
|
||||
|
||||
String tileNo;
|
||||
try {
|
||||
@@ -104,7 +99,7 @@ public class BasicDebugInfoWindow implements UICanvas {
|
||||
catch (ArrayIndexOutOfBoundsException e) {
|
||||
tileNo = "out of bounds";
|
||||
}
|
||||
printLine(g, 10, "tile : " + tileNo);
|
||||
printLine(g, 9, "tile : " + tileNo);
|
||||
|
||||
// Memory allocation
|
||||
long memInUse = Terrarum.game.memInUse;
|
||||
|
||||
Reference in New Issue
Block a user