tags on ingame blocks

This commit is contained in:
minjaesong
2022-03-11 15:05:06 +09:00
parent 6c7cbc02ae
commit b5aacd976c
4 changed files with 134 additions and 136 deletions

View File

@@ -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
}

View File

@@ -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
*/

View File

@@ -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;