mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 10:34:06 +09:00
watch is semitransparent when EL is off
This commit is contained in:
@@ -104,7 +104,7 @@ object BlockCodex {
|
|||||||
prop.lumColB = floatVal(record, "lumb") / LightmapRenderer.MUL_FLOAT
|
prop.lumColB = floatVal(record, "lumb") / LightmapRenderer.MUL_FLOAT
|
||||||
prop.lumColA = floatVal(record, "lumuv") / 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.viscosity = intVal(record, "vscs")
|
||||||
|
|
||||||
//prop.isFluid = boolVal(record, "fluid")
|
//prop.isFluid = boolVal(record, "fluid")
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package net.torvald.terrarum.debuggerapp;
|
package net.torvald.terrarum.debuggerapp;
|
||||||
|
|
||||||
|
import net.torvald.terrarum.utils.CSVFetcher;
|
||||||
|
import org.apache.commons.csv.CSVFormat;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.ListSelectionEvent;
|
import javax.swing.event.ListSelectionEvent;
|
||||||
import javax.swing.event.ListSelectionListener;
|
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 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 String[][] dummyData = new String[128][columns.length];
|
||||||
|
|
||||||
|
private CSVFormat csvFormat = CSVFetcher.INSTANCE.getTerrarumCSVFormat();
|
||||||
|
|
||||||
private JPanel panelSpreadSheet = new JPanel();
|
private JPanel panelSpreadSheet = new JPanel();
|
||||||
private JPanel panelComment = new JPanel();
|
private JPanel panelComment = new JPanel();
|
||||||
private JSplitPane panelWorking = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panelSpreadSheet, panelComment);
|
private JSplitPane panelWorking = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panelSpreadSheet, panelComment);
|
||||||
@@ -126,6 +131,14 @@ public class CSVEditor extends JFrame {
|
|||||||
new CSVEditor();
|
new CSVEditor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String toCSV() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
// add
|
||||||
|
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
private String captionProperties =
|
private String captionProperties =
|
||||||
"" + // dummy string to make IDE happy with the auto indent
|
"" + // dummy string to make IDE happy with the auto indent
|
||||||
|
|||||||
@@ -65,7 +65,12 @@ class UIBasicNotifier(private val player: ActorHumanoid?) : UICanvas() {
|
|||||||
private val mailCount: Int
|
private val mailCount: Int
|
||||||
get() = 0
|
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 {
|
fun getTempStr(): String {
|
||||||
val sb = StringBuilder()
|
val sb = StringBuilder()
|
||||||
@@ -114,7 +119,7 @@ class UIBasicNotifier(private val player: ActorHumanoid?) : UICanvas() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// backplate
|
// backplate
|
||||||
batch.color = Color.WHITE
|
batch.color = drawCol
|
||||||
batch.draw(atlas.get(0, 0), 0f, 0f)
|
batch.draw(atlas.get(0, 0), 0f, 0f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 moonDial = TextureRegionPack(ModMgr.getPath("basegame", "fonts/watch_17pxmoondial.tga"), 17, 17)
|
||||||
private var moonDialCount = moonDial.horizontalCount
|
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
|
private val worldTime: WorldTime
|
||||||
get() = (Terrarum.ingame!!.world as GameWorldExtension).time
|
get() = (Terrarum.ingame!!.world as GameWorldExtension).time
|
||||||
@@ -63,7 +68,7 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// backplate
|
// backplate
|
||||||
batch.color = Color.WHITE
|
batch.color = drawCol
|
||||||
batch.draw(atlas.get(0, 0), 0f, 0f)
|
batch.draw(atlas.get(0, 0), 0f, 0f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
package net.torvald.terrarum.utils
|
package net.torvald.terrarum.utils
|
||||||
|
|
||||||
import net.torvald.terrarum.AppLoader
|
|
||||||
import net.torvald.terrarum.AppLoader.printdbg
|
import net.torvald.terrarum.AppLoader.printdbg
|
||||||
import net.torvald.terrarum.ModMgr
|
import net.torvald.terrarum.ModMgr
|
||||||
import org.apache.commons.csv.CSVFormat
|
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.
|
* Created by minjaesong on 2016-02-16.
|
||||||
*/
|
*/
|
||||||
object CSVFetcher {
|
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
|
private var csvString: StringBuffer? = null
|
||||||
|
|
||||||
fun readFromFile(csvFilePath: String): List<org.apache.commons.csv.CSVRecord> {
|
fun readFromFile(csvFilePath: String): List<org.apache.commons.csv.CSVRecord> {
|
||||||
@@ -27,13 +27,7 @@ object CSVFetcher {
|
|||||||
|
|
||||||
val csvParser = org.apache.commons.csv.CSVParser.parse(
|
val csvParser = org.apache.commons.csv.CSVParser.parse(
|
||||||
net.torvald.terrarum.utils.CSVFetcher.csvString!!.toString(),
|
net.torvald.terrarum.utils.CSVFetcher.csvString!!.toString(),
|
||||||
org.apache.commons.csv.CSVFormat.DEFAULT.withIgnoreSurroundingSpaces()
|
terrarumCSVFormat
|
||||||
.withHeader()
|
|
||||||
.withIgnoreEmptyLines()
|
|
||||||
.withDelimiter(';')
|
|
||||||
.withCommentMarker('#')
|
|
||||||
.withNullString("N/A")
|
|
||||||
.withRecordSeparator('\n')
|
|
||||||
)
|
)
|
||||||
|
|
||||||
val csvRecordList = csvParser.records
|
val csvRecordList = csvParser.records
|
||||||
@@ -47,13 +41,7 @@ object CSVFetcher {
|
|||||||
fun readFromString(csv: String): List<org.apache.commons.csv.CSVRecord> {
|
fun readFromString(csv: String): List<org.apache.commons.csv.CSVRecord> {
|
||||||
val csvParser = org.apache.commons.csv.CSVParser.parse(
|
val csvParser = org.apache.commons.csv.CSVParser.parse(
|
||||||
csv,
|
csv,
|
||||||
org.apache.commons.csv.CSVFormat.DEFAULT.withIgnoreSurroundingSpaces()
|
terrarumCSVFormat
|
||||||
.withHeader()
|
|
||||||
.withIgnoreEmptyLines()
|
|
||||||
.withDelimiter(';')
|
|
||||||
.withCommentMarker('#')
|
|
||||||
.withNullString("N/A")
|
|
||||||
.withRecordSeparator('\n')
|
|
||||||
)
|
)
|
||||||
|
|
||||||
val csvRecordList = csvParser.records
|
val csvRecordList = csvParser.records
|
||||||
|
|||||||
Reference in New Issue
Block a user