diff --git a/build.gradle b/build.gradle index 2b3d907b..08bcc2e2 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ buildscript { } } -version = "1.10.0.7-SNAPSHOT" +version = "1.10.0.7" mainClassName = 'gdx.liftoff.MainKt' sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/src/main/kotlin/gdx/liftoff/views/MainView.kt b/src/main/kotlin/gdx/liftoff/views/MainView.kt index 41ca1afa..5593154d 100644 --- a/src/main/kotlin/gdx/liftoff/views/MainView.kt +++ b/src/main/kotlin/gdx/liftoff/views/MainView.kt @@ -13,6 +13,7 @@ import com.badlogic.gdx.scenes.scene2d.InputEvent import com.badlogic.gdx.scenes.scene2d.InputListener import com.badlogic.gdx.scenes.scene2d.actions.Actions import com.badlogic.gdx.scenes.scene2d.ui.Button +import com.badlogic.gdx.scenes.scene2d.utils.ClickListener import com.badlogic.gdx.utils.Align import com.github.czyzby.autumn.annotation.Destroy import com.github.czyzby.autumn.annotation.Inject @@ -36,6 +37,7 @@ import gdx.liftoff.config.inject import gdx.liftoff.config.threadPool import gdx.liftoff.data.platforms.Android import gdx.liftoff.data.project.Project +import gdx.liftoff.data.templates.official.ClassicTemplate import gdx.liftoff.preferences.SdkVersionPreference import org.lwjgl.BufferUtils import org.lwjgl.glfw.GLFW @@ -227,7 +229,7 @@ class MainView : ActionContainer { @LmlAction("jvmLanguages") fun getLanguages(): Array = languagesData.languages @LmlAction("jvmLanguagesVersions") fun getLanguagesVersions(): Array = languagesData.versions @LmlAction("templates") fun getOfficialTemplates(): Array = - templatesData.officialTemplates.map { it.id }.sortedWith { left, right -> left.compareTo(right) } + templatesData.officialTemplates.map { it.id }.sortedWith { left, right -> if(left == "classic") -1 else if (right == "classic") 1 else left.compareTo(right) } .toTypedArray() @LmlAction("thirdPartyTemplates") fun getThirdPartyTemplates(): Array = @@ -296,6 +298,23 @@ class MainView : ActionContainer { }) } + /** + * I have no idea how to register this on an LML Actor. LML docs are no help. Agh. + */ + fun assignScrollFocus(actor: Actor) { + actor.addListener(object : ClickListener() { + override fun enter(event: InputEvent?, x: Float, y: Float, pointer: Int, fromActor: Actor?) { + actor.stage?.scrollFocus = actor + } + + override fun exit(event: InputEvent?, x: Float, y: Float, pointer: Int, toActor: Actor?) { + super.exit(event, x, y, pointer, toActor) + if(actor.stage?.scrollFocus == actor) + actor.stage?.scrollFocus = null + } + }) + } + /** * Explicitly forces saving of Android SDK versions. They might not be properly updated as change events are not * fired on programmatic SDK and tools versions changes. diff --git a/src/main/resources/i18n/nls.properties b/src/main/resources/i18n/nls.properties index 8cce0c76..f8ba94e2 100644 --- a/src/main/resources/i18n/nls.properties +++ b/src/main/resources/i18n/nls.properties @@ -339,12 +339,12 @@ templatesTip=Hover over radio buttons for more info. templatesLink=Missing your favorite setup? Propose a new template! emptyTemplateTip=Generates no ApplicationListener implementation. applicationListenerTip=Generates a main class implementing ApplicationListener. -applicationAdapterTip=Generates a main class extending ApplicationListener. +applicationAdapterTip=Generates a main class extending ApplicationAdapter. inputProcessorTip=Generates a main class with input events handling. gameTemplateTip=Generates a main class extending Game. superKoalioTip=A sample self-contained 2D platformer game. scene2dTemplateTip=A sample project using Scene2D to build GUI. -classicTip=Generates a main class drawing the libGDX logo. +classicTip=Generates a main class drawing the libGDX logo. Start here! kotlinTemplateTip=A Kotlin project template with Kotlin application launchers. ktxTemplateTip=A Kotlin project template with KTX utilities. lmlTemplateTip=Uses LML to build Scene2D GUI. @@ -355,7 +355,7 @@ lmlMvcVisTemplateTip=A project using the Autumn MVC framework with VisUI. lmlMvcBox2dTemplateTip=A project using the Autumn MVC framework with Box2D. noise4jTemplateTip=Noise4J sample generating random maps after clicking. squidLibBasicTemplateTip=A sample application using SquidLib framework. -visUiBasicTemplateTip=A project using VisUI to build Scene2D GUI. +visUiBasicTemplateTip=A project using VisUI to build a Scene2D GUI. visUiShowcaseTemplateTip=The VisUI framework showcase. visEditorBasicTemplateTip=A sample application using exported VisEditor project.