mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 22:01:52 +09:00
tags on ingame blocks
This commit is contained in:
@@ -210,6 +210,9 @@ class BlockCodex {
|
||||
|
||||
prop.reflectance = record.floatVal("refl")
|
||||
|
||||
prop.tags = record.get("tags").split(',').map { it.trim() }.toHashSet()
|
||||
prop.material = record.get("mate")
|
||||
|
||||
blockProps[prop.id] = prop
|
||||
|
||||
printdbg(this, "Setting prop ${prop.id} ->>\t${prop.nameKey}\tsolid:${prop.isSolid}")
|
||||
@@ -221,12 +224,9 @@ fun CSVRecord.str16ToInt(s: String): Int {
|
||||
try {
|
||||
ret = this.get(s).toLong(16).toInt()
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
}
|
||||
catch (e1: IllegalStateException) {
|
||||
}
|
||||
catch (e2: NullPointerException) {
|
||||
}
|
||||
catch (e: NumberFormatException) { }
|
||||
catch (e1: IllegalStateException) { }
|
||||
catch (e2: NullPointerException) { }
|
||||
|
||||
return ret
|
||||
}
|
||||
@@ -236,12 +236,9 @@ fun CSVRecord.intVal(s: String): Int {
|
||||
try {
|
||||
ret = this.get(s).toInt()
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
}
|
||||
catch (e1: IllegalStateException) {
|
||||
}
|
||||
catch (e2: NullPointerException) {
|
||||
}
|
||||
catch (e: NumberFormatException) { }
|
||||
catch (e1: IllegalStateException) { }
|
||||
catch (e2: NullPointerException) { }
|
||||
|
||||
return ret
|
||||
}
|
||||
@@ -251,12 +248,9 @@ fun CSVRecord.floatVal(s: String): Float {
|
||||
try {
|
||||
ret = this.get(s).toFloat()
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
}
|
||||
catch (e1: IllegalStateException) {
|
||||
}
|
||||
catch (e2: NullPointerException) {
|
||||
}
|
||||
catch (e: NumberFormatException) { }
|
||||
catch (e1: IllegalStateException) { }
|
||||
catch (e2: NullPointerException) { }
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ class BlockProp {
|
||||
var strength: Int = 0
|
||||
var density: Int = 0
|
||||
var viscosity: Int = 0
|
||||
/** Fluid colour */
|
||||
var colour: Int = 0
|
||||
|
||||
/** isSolid is NOT SAME AS !isOpaqueis
|
||||
@@ -98,6 +99,8 @@ class BlockProp {
|
||||
@Transient var rngBase1 = Math.random().toFloat() // flicker P0, etc
|
||||
@Transient var rngBase2 = Math.random().toFloat() // flicker P1, etc
|
||||
|
||||
var tags = HashSet<String>()
|
||||
|
||||
/**
|
||||
* Mainly intended to be used by third-party modules
|
||||
*/
|
||||
|
||||
@@ -28,12 +28,12 @@ import java.util.Properties;
|
||||
public class CSVEditor extends JFrame {
|
||||
|
||||
/** Default columns. When you open existing csv, it should overwrite this. */
|
||||
private String[] columns = new String[]{"id", "drop", "name", "shdr", "shdg", "shdb", "shduv", "str", "dsty", "mate", "solid", "plat", "wall", "grav", "dlfn", "fv", "fr", "lumr", "lumg", "lumb", "lumuv", "colour", "vscs", "refl"};
|
||||
private String[] columns = new String[]{"id", "drop", "name", "shdr", "shdg", "shdb", "shduv", "str", "dsty", "mate", "solid", "plat", "wall", "grav", "dlfn", "fv", "fr", "lumr", "lumg", "lumb", "lumuv", "colour", "vscs", "refl","tags"};
|
||||
private final int FOUR_DIGIT = 42;
|
||||
private final int SIX_DIGIT = 50;
|
||||
private final int TWO_DIGIT = 30;
|
||||
private final int ARBITRARY = 240;
|
||||
private int[] colWidth = new int[]{FOUR_DIGIT, FOUR_DIGIT, ARBITRARY, SIX_DIGIT, SIX_DIGIT, SIX_DIGIT, SIX_DIGIT, TWO_DIGIT, FOUR_DIGIT, FOUR_DIGIT, TWO_DIGIT, TWO_DIGIT, TWO_DIGIT, TWO_DIGIT, TWO_DIGIT, TWO_DIGIT, TWO_DIGIT, SIX_DIGIT, SIX_DIGIT, SIX_DIGIT, SIX_DIGIT, FOUR_DIGIT * 2, TWO_DIGIT, SIX_DIGIT};
|
||||
private int[] colWidth = new int[]{FOUR_DIGIT, FOUR_DIGIT, ARBITRARY, SIX_DIGIT, SIX_DIGIT, SIX_DIGIT, SIX_DIGIT, TWO_DIGIT, FOUR_DIGIT, FOUR_DIGIT, TWO_DIGIT, TWO_DIGIT, TWO_DIGIT, TWO_DIGIT, TWO_DIGIT, TWO_DIGIT, TWO_DIGIT, SIX_DIGIT, SIX_DIGIT, SIX_DIGIT, SIX_DIGIT, FOUR_DIGIT * 2, TWO_DIGIT, SIX_DIGIT, ARBITRARY};
|
||||
|
||||
private final int UNDO_BUFFER_SIZE = 10;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user