mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +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) {
|
||||
|
||||
///////////////////
|
||||
@@ -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
|
||||
// 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)
|
||||
worldPrimaryClickLatched = true
|
||||
}
|
||||
/*if Gdx.input.isButtonPressed(AppLoader.getConfigInt("config_mousesecondary")) {
|
||||
ingame.worldSecondaryClickStart(AppLoader.UPDATE_RATE)
|
||||
}*/
|
||||
|
||||
if (!Gdx.input.isButtonPressed(AppLoader.getConfigInt("config_mouseprimary"))) {
|
||||
worldPrimaryClickLatched = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user