mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-19 23:14:05 +09:00
Keyboard strobing moved to a new thread so that fast typing is possible even if the game's update method is running slowly
This commit is contained in:
@@ -6,6 +6,7 @@ import com.badlogic.gdx.utils.Disposable
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
|
||||
@@ -219,6 +220,12 @@ abstract class UICanvas(
|
||||
|
||||
return false
|
||||
}
|
||||
open fun inputStrobed(e: TerrarumKeyboardEvent) {
|
||||
if (this.isVisible) {
|
||||
uiItems.forEach { it.inputStrobed(e) }
|
||||
handler.subUIs.forEach { it.inputStrobed(e) }
|
||||
}
|
||||
}
|
||||
|
||||
open fun resize(width: Int, height: Int) {
|
||||
this.width = width
|
||||
|
||||
Reference in New Issue
Block a user