mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-06 08:38:30 +09:00
fixing bug where the crafting table (or something) would placed and ui opened at the same time
This commit is contained in:
@@ -46,6 +46,8 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var worldPrimaryClickLatched = false
|
||||||
|
|
||||||
fun update(delta: Float) {
|
fun update(delta: Float) {
|
||||||
|
|
||||||
///////////////////
|
///////////////////
|
||||||
@@ -61,13 +63,18 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
|
|||||||
// also, some UIs should NOT affect item usage (e.g. quickslot) and ingame's uiOpened property is doing
|
// also, some UIs should NOT affect item usage (e.g. quickslot) and ingame's uiOpened property is doing
|
||||||
// the very job.
|
// the very job.
|
||||||
|
|
||||||
if (Gdx.input.isButtonPressed(AppLoader.getConfigInt("config_mouseprimary"))) {
|
if (Gdx.input.isButtonPressed(AppLoader.getConfigInt("config_mouseprimary")) && !worldPrimaryClickLatched) {
|
||||||
terrarumIngame.worldPrimaryClickStart(AppLoader.UPDATE_RATE)
|
terrarumIngame.worldPrimaryClickStart(AppLoader.UPDATE_RATE)
|
||||||
|
worldPrimaryClickLatched = true
|
||||||
}
|
}
|
||||||
/*if Gdx.input.isButtonPressed(AppLoader.getConfigInt("config_mousesecondary")) {
|
/*if Gdx.input.isButtonPressed(AppLoader.getConfigInt("config_mousesecondary")) {
|
||||||
ingame.worldSecondaryClickStart(AppLoader.UPDATE_RATE)
|
ingame.worldSecondaryClickStart(AppLoader.UPDATE_RATE)
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
if (!Gdx.input.isButtonPressed(AppLoader.getConfigInt("config_mouseprimary"))) {
|
||||||
|
worldPrimaryClickLatched = false
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -399,6 +399,8 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
|
|||||||
}// END enter
|
}// END enter
|
||||||
|
|
||||||
override fun worldPrimaryClickStart(delta: Float) {
|
override fun worldPrimaryClickStart(delta: Float) {
|
||||||
|
//println("[Ingame] worldPrimaryClickStart $delta")
|
||||||
|
|
||||||
// bring up the UIs of the fixtures (e.g. crafting menu from a crafting table)
|
// bring up the UIs of the fixtures (e.g. crafting menu from a crafting table)
|
||||||
var uiOpened = false
|
var uiOpened = false
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user