[orx-olive] Fix problem with requestAssets and produceAssets events

This commit is contained in:
Edwin Jakobs
2021-11-07 19:18:22 +01:00
parent ad2b5da4f5
commit 6705ef9737
2 changed files with 4 additions and 4 deletions

View File

@@ -87,7 +87,10 @@ class Olive<P : Program>(val resources: Resources? = null, private var scriptMod
program.window.minimized,
program.window.moved,
program.window.sized,
program.window.unfocused)
program.window.unfocused,
program.requestAssets,
program.produceAssets
)
trackedListeners.forEach { it.saveListeners(store) }

View File

@@ -8,8 +8,6 @@ import java.nio.file.Paths
import kotlin.reflect.KProperty
import kotlin.streams.toList
open class OliveProgram(private val sourceLocation: String, private val scriptHost: OliveScriptHost, resources: Resources?) : Program() {
val olive = extend(Olive<OliveProgram>(scriptMode = ScriptMode.OLIVE_PROGRAM, resources = resources)) {
script = sourceLocation
@@ -28,7 +26,6 @@ class Once<T:Any>(val build:() -> T) {
operator fun getValue(thisRef:Any?, property:KProperty<*>) : T = values.getOrPut(property.name) { build() } as T
}
fun stackRootClassName(thread: Thread = Thread.currentThread(), sanitize: Boolean = true): String {
val root = Thread.currentThread().stackTrace.last()
val rootClass = root.className