mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
World Click events
let's hope it works w/o tests as I can't get to the Ingame now
This commit is contained in:
@@ -77,6 +77,9 @@ open class UIRemoCon(treeRepresentation: QNDTreeNode<String>) : UICanvas() {
|
||||
return UIRemoConElement(this, dynamicStrArray)
|
||||
}
|
||||
|
||||
// currently there's no resetter for this!
|
||||
private var startNewGameCalled = false
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
if (mouseActionAvailable) {
|
||||
remoConTray.update(delta)
|
||||
@@ -105,20 +108,24 @@ open class UIRemoCon(treeRepresentation: QNDTreeNode<String>) : UICanvas() {
|
||||
}
|
||||
}
|
||||
else if (it.labelText.contains("Start New Random Game")) {
|
||||
if (!startNewGameCalled) {
|
||||
startNewGameCalled = true
|
||||
|
||||
printdbg(this, 1)
|
||||
|
||||
val ingame = Ingame(Terrarum.batch)
|
||||
ingame.gameLoadInfoPayload = Ingame.NewWorldParameters(2400, 800, HQRNG().nextLong())
|
||||
ingame.gameLoadMode = Ingame.GameLoadMode.CREATE_NEW
|
||||
printdbg(this, 1)
|
||||
|
||||
printdbg(this, 2)
|
||||
val ingame = Ingame(Terrarum.batch)
|
||||
ingame.gameLoadInfoPayload = Ingame.NewWorldParameters(2400, 800, HQRNG().nextLong())
|
||||
ingame.gameLoadMode = Ingame.GameLoadMode.CREATE_NEW
|
||||
|
||||
Terrarum.ingame = ingame
|
||||
LoadScreen.screenToLoad = ingame
|
||||
Terrarum.setScreen(LoadScreen)
|
||||
printdbg(this, 2)
|
||||
|
||||
printdbg(this, 3)
|
||||
Terrarum.ingame = ingame
|
||||
LoadScreen.screenToLoad = ingame
|
||||
Terrarum.setScreen(LoadScreen)
|
||||
|
||||
printdbg(this, 3)
|
||||
}
|
||||
}
|
||||
else {
|
||||
// check if target exists
|
||||
|
||||
@@ -36,6 +36,7 @@ object UITitleRemoConYaml {
|
||||
- Development Tools $
|
||||
- Building Maker
|
||||
- Start New Random Game
|
||||
- MENU_LABEL_RETURN
|
||||
""".trimIndent()
|
||||
|
||||
operator fun invoke() = if (AppLoader.IS_DEVELOPMENT_BUILD)
|
||||
|
||||
Reference in New Issue
Block a user