kotlin update 1.8.20

This commit is contained in:
minjaesong
2023-05-03 21:40:03 +09:00
parent bae212e51f
commit c6a2a4199e
30 changed files with 147 additions and 103 deletions

View File

@@ -10,9 +10,11 @@
<orderEntry type="library" name="ModuleComputersLib" level="project" />
<orderEntry type="module" module-name="TerrarumBuild" />
<orderEntry type="library" name="graalvm-js-21.1.0 and graalvm-js-scriptengine-21.1.0" level="project" />
<orderEntry type="library" name="jetbrains.kotlinx.coroutines.core" level="project" />
<orderEntry type="library" name="TerrarumSansBitmap" level="project" />
<orderEntry type="library" name="badlogicgames.gdx" level="project" />
<orderEntry type="library" name="badlogicgames.gdx.backend.lwjgl3" level="project" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
<orderEntry type="library" name="jetbrains.kotlin.reflect" level="project" />
<orderEntry type="library" name="jetbrains.kotlin.test" level="project" />
</component>
</module>

View File

@@ -6,6 +6,6 @@ module ModuleComputers {
requires Terrarum;
requires TerrarumSansBitmap;
requires kotlin.stdlib;
requires kotlinx.coroutines.core;
requires kotlin.coroutines.core;
requires TerrarumTSVM;
}

View File

@@ -6,10 +6,7 @@ import com.badlogic.gdx.graphics.*
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer
import com.badlogic.gdx.utils.Disposable
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import kotlin.coroutines.*
import net.torvald.terrarum.*
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE
import net.torvald.terrarum.gameactors.AVKey
@@ -35,7 +32,7 @@ class FixtureHomeComputer : FixtureBase {
VMProgramRom(ModMgr.getGdxFile("dwarventech", "bios/tsvmbios.js").path())
))
@Transient private lateinit var vmRunner: VMRunner
@Transient private lateinit var coroutineJob: Job
// @Transient private lateinit var coroutineJob: Job
@Transient private var vmStarted = false
@Transient private lateinit var disposableObj: Disposable
@@ -76,7 +73,7 @@ class FixtureHomeComputer : FixtureBase {
}
fun startVM() {
if (!vmStarted) {
/*if (!vmStarted) {
vmStarted = true
coroutineJob = GlobalScope.launch {
@@ -89,11 +86,11 @@ class FixtureHomeComputer : FixtureBase {
vm.dispose()
}
INGAME.disposables.add(disposableObj)
}
}*/
}
fun stopVM() {
if (vmStarted) {
/*if (vmStarted) {
vmStarted = false
vmRunner.close()
@@ -101,7 +98,7 @@ class FixtureHomeComputer : FixtureBase {
vm.dispose()
INGAME.disposables.remove(disposableObj)
}
}*/
}
override fun reload() {

View File

@@ -5,10 +5,6 @@ import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.g2d.TextureRegion
import com.badlogic.gdx.utils.Disposable
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import net.torvald.terrarum.*
import net.torvald.terrarum.gameactors.ActorWithBody
import net.torvald.terrarum.gameitems.GameItem
@@ -26,8 +22,9 @@ import net.torvald.tsvm.peripheral.VMProgramRom
/**
* Created by minjaesong on 2021-12-03.
*/
class ItemWearableWorldRadar(originalID: String) : GameItem(originalID) {
class ItemWearableWorldRadar(originalID: String) {// : GameItem(originalID) {
/*
override var dynamicID: ItemID = originalID
override val originalName = "ITEM_COMPUTER_DIRTBOARD_FAKETM"
override var baseMass = 2.0
@@ -106,6 +103,9 @@ class ItemWearableWorldRadar(originalID: String) : GameItem(originalID) {
(Terrarum.ingame!! as TerrarumIngame).wearableDeviceUI = null
closeVM()
}
*/
}
class WearableWorldRadarUI(val device: VM) : UICanvas() {