diff --git a/build.gradle.kts b/build.gradle.kts index 39cdc08..7b5dfe1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,5 @@ @file:Suppress("MayBeConstant") -import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar - fun DependencyHandler.impl(vararg dep: Any) = dep.forEach { implementation(it) } fun DependencyHandler.testImpl(vararg dep: Any) = dep.forEach { testImplementation(it) } @@ -9,7 +7,6 @@ plugins { java id("org.jetbrains.kotlin.jvm") version "1.3.72" application - id("com.github.johnrengelman.shadow") version "5.2.0" id("org.openjfx.javafxplugin") version "0.0.8" } @@ -19,6 +16,8 @@ repositories { maven { setUrl("https://plugins.gradle.org/m2") } } +defaultTasks(ApplicationPlugin.TASK_RUN_NAME) + object This { val artifactId = "chip8" } @@ -28,26 +27,13 @@ dependencies { testImpl(kotlin("test"), "org.testng:testng:7.0.0", "org.assertj:assertj-core:3.10.0") } -val test by tasks.getting(Test::class) { - useTestNG() -} - application { mainClassName = "com.beust.chip8.MainKt" } tasks { - named("shadowJar") { - archiveBaseName.set(This.artifactId) - mergeServiceFiles() - manifest { - attributes(mapOf( - "Implementation-Title" to rootProject.name, - "Implementation-Version" to rootProject.version, - "Implementation-Vendor-Id" to rootProject.group, - "Created-By" to "Gradle "+ gradle.gradleVersion, - "Main-Class" to "com.beust.cedlinks.MainKt")) - } + withType { + useTestNG() } } diff --git a/src/main/kotlin/com/beust/chip8/Main.kt b/src/main/kotlin/com/beust/chip8/Main.kt index 517a79b..7283841 100644 --- a/src/main/kotlin/com/beust/chip8/Main.kt +++ b/src/main/kotlin/com/beust/chip8/Main.kt @@ -45,7 +45,7 @@ class MyFxApp : Application() { // Computer is paused // Update the pause button label - pauseButton?.text = if (newVal) "Resume" else "Pause" + pauseButton?.text = if (newVal) "_Resume" else "_Pause" // Display the disassembly updateDisassembly(disassembly!!, computer.disassemble()) @@ -187,10 +187,14 @@ class MyFxApp : Application() { exitProcess(0) } KeyCode.P -> { - computer.pause() + if (computer.paused) { + computer.start() + } else { + computer.pause() + } } else -> { - if (computer.paused) computer.start() + if (computer.paused && event.code != KeyCode.ALT) computer.start() else { try { val key = Integer.parseInt(event.code.char, 16) diff --git a/src/main/resources/main.fxml b/src/main/resources/main.fxml index f4c3db9..99e45bd 100644 --- a/src/main/resources/main.fxml +++ b/src/main/resources/main.fxml @@ -26,7 +26,7 @@ -