diff --git a/src/net/torvald/terrarum/blockproperties/BlockCodex.kt b/src/net/torvald/terrarum/blockproperties/BlockCodex.kt index 29adec9d5..24f07f7ac 100644 --- a/src/net/torvald/terrarum/blockproperties/BlockCodex.kt +++ b/src/net/torvald/terrarum/blockproperties/BlockCodex.kt @@ -104,7 +104,7 @@ object BlockCodex { prop.lumColB = floatVal(record, "lumb") / LightmapRenderer.MUL_FLOAT prop.lumColA = floatVal(record, "lumuv") / LightmapRenderer.MUL_FLOAT - prop.friction = intVal(record, "friction") + prop.friction = intVal(record, "fr") prop.viscosity = intVal(record, "vscs") //prop.isFluid = boolVal(record, "fluid") diff --git a/src/net/torvald/terrarum/debuggerapp/CSVEditor.java b/src/net/torvald/terrarum/debuggerapp/CSVEditor.java index 0ee4caf32..d33c6b759 100644 --- a/src/net/torvald/terrarum/debuggerapp/CSVEditor.java +++ b/src/net/torvald/terrarum/debuggerapp/CSVEditor.java @@ -1,5 +1,8 @@ package net.torvald.terrarum.debuggerapp; +import net.torvald.terrarum.utils.CSVFetcher; +import org.apache.commons.csv.CSVFormat; + import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; @@ -25,6 +28,8 @@ public class CSVEditor extends JFrame { 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}; private String[][] dummyData = new String[128][columns.length]; + private CSVFormat csvFormat = CSVFetcher.INSTANCE.getTerrarumCSVFormat(); + private JPanel panelSpreadSheet = new JPanel(); private JPanel panelComment = new JPanel(); private JSplitPane panelWorking = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panelSpreadSheet, panelComment); @@ -126,6 +131,14 @@ public class CSVEditor extends JFrame { new CSVEditor(); } + private String toCSV() { + StringBuilder sb = new StringBuilder(); + + // add + + + return sb.toString(); + } private String captionProperties = "" + // dummy string to make IDE happy with the auto indent diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UIBasicNotifier.kt b/src/net/torvald/terrarum/modulebasegame/ui/UIBasicNotifier.kt index 195269b5d..df3e58bcc 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UIBasicNotifier.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UIBasicNotifier.kt @@ -65,7 +65,12 @@ class UIBasicNotifier(private val player: ActorHumanoid?) : UICanvas() { private val mailCount: Int get() = 0 - private val lcdLitCol = Color(0x141414_ff) + private val drawCol = Color(1f,1f,1f,0.5f) + private val lcdLitColELoff = Color(0x141414_aa) + private val lcdLitColELon = Color(0x141414_ff) + + private val lcdLitCol: Color + get() = if (ELon) lcdLitColELon else lcdLitColELoff fun getTempStr(): String { val sb = StringBuilder() @@ -114,7 +119,7 @@ class UIBasicNotifier(private val player: ActorHumanoid?) : UICanvas() { } else { // backplate - batch.color = Color.WHITE + batch.color = drawCol batch.draw(atlas.get(0, 0), 0f, 0f) } diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UITierOneWatch.kt b/src/net/torvald/terrarum/modulebasegame/ui/UITierOneWatch.kt index 1f7850aba..98f0496e1 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UITierOneWatch.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UITierOneWatch.kt @@ -34,7 +34,12 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() { private var moonDial = TextureRegionPack(ModMgr.getPath("basegame", "fonts/watch_17pxmoondial.tga"), 17, 17) private var moonDialCount = moonDial.horizontalCount - private val lcdLitCol = Color(0x141414_ff) + private val drawCol = Color(1f,1f,1f,0.5f) + private val lcdLitColELoff = Color(0x141414_aa) + private val lcdLitColELon = Color(0x141414_ff) + + private val lcdLitCol: Color + get() = if (ELon) lcdLitColELon else lcdLitColELoff private val worldTime: WorldTime get() = (Terrarum.ingame!!.world as GameWorldExtension).time @@ -63,7 +68,7 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() { } else { // backplate - batch.color = Color.WHITE + batch.color = drawCol batch.draw(atlas.get(0, 0), 0f, 0f) } diff --git a/src/net/torvald/terrarum/utils/CSVFetcher.kt b/src/net/torvald/terrarum/utils/CSVFetcher.kt index f48c960ec..b4d344715 100644 --- a/src/net/torvald/terrarum/utils/CSVFetcher.kt +++ b/src/net/torvald/terrarum/utils/CSVFetcher.kt @@ -1,22 +1,22 @@ package net.torvald.terrarum.utils -import net.torvald.terrarum.AppLoader import net.torvald.terrarum.AppLoader.printdbg import net.torvald.terrarum.ModMgr import org.apache.commons.csv.CSVFormat -import org.apache.commons.csv.CSVParser -import org.apache.commons.csv.CSVRecord - -import java.io.IOException -import java.io.InputStreamReader -import java.nio.file.FileSystems -import java.nio.file.Files /** * Created by minjaesong on 2016-02-16. */ object CSVFetcher { + val terrarumCSVFormat: CSVFormat = org.apache.commons.csv.CSVFormat.DEFAULT.withIgnoreSurroundingSpaces() + .withHeader() + .withIgnoreEmptyLines() + .withDelimiter(';') + .withCommentMarker('#') + .withNullString("N/A") + .withRecordSeparator('\n') + private var csvString: StringBuffer? = null fun readFromFile(csvFilePath: String): List { @@ -27,13 +27,7 @@ object CSVFetcher { val csvParser = org.apache.commons.csv.CSVParser.parse( net.torvald.terrarum.utils.CSVFetcher.csvString!!.toString(), - org.apache.commons.csv.CSVFormat.DEFAULT.withIgnoreSurroundingSpaces() - .withHeader() - .withIgnoreEmptyLines() - .withDelimiter(';') - .withCommentMarker('#') - .withNullString("N/A") - .withRecordSeparator('\n') + terrarumCSVFormat ) val csvRecordList = csvParser.records @@ -47,13 +41,7 @@ object CSVFetcher { fun readFromString(csv: String): List { val csvParser = org.apache.commons.csv.CSVParser.parse( csv, - org.apache.commons.csv.CSVFormat.DEFAULT.withIgnoreSurroundingSpaces() - .withHeader() - .withIgnoreEmptyLines() - .withDelimiter(';') - .withCommentMarker('#') - .withNullString("N/A") - .withRecordSeparator('\n') + terrarumCSVFormat ) val csvRecordList = csvParser.records