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:
minjaesong
2018-10-01 23:51:04 +09:00
parent 6a1146f67b
commit f365156799
25 changed files with 341 additions and 226 deletions

View File

@@ -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