generalised things so that they would work outside of ingame.world; title screen wip

This commit is contained in:
minjaesong
2017-07-21 19:59:51 +09:00
parent cb8d3fd8b9
commit f1391bea6f
68 changed files with 1141 additions and 328 deletions

View File

@@ -33,23 +33,6 @@ class IngameController(val ingame: Ingame) : InputAdapter() {
get() = (mouseY / FeaturesDrawer.TILE_SIZE).floorInt()
fun update(delta: Float) {
// actor process input
if (!ingame.consoleHandler.isTakingControl) {
if (ingame.canPlayerControl) {
ingame.actorContainer.forEach {
if (it is Controllable) {
// disable control of actor if the actor is riding something?
if ((it as ActorHumanoid).vehicleRiding != null) {
it.vehicleRiding!!.processInput(delta)
}
else {
it.processInput(delta)
}
}
}
}
}
///////////////////
// MOUSE CONTROL //
@@ -133,10 +116,10 @@ class IngameController(val ingame: Ingame) : InputAdapter() {
if (itemOnGrip != null) {
if (button == Terrarum.getConfigInt("mouseprimary")) {
itemOnGrip.endPrimaryUse(Gdx.graphics.deltaTime)
itemOnGrip.endPrimaryUse(Terrarum.deltaTime)
}
if (button == Terrarum.getConfigInt("mousesecondary")) {
itemOnGrip.endSecondaryUse(Gdx.graphics.deltaTime)
itemOnGrip.endSecondaryUse(Terrarum.deltaTime)
}
}
}