custom keyboard handling wip

This commit is contained in:
minjaesong
2021-10-20 12:57:56 +09:00
parent d5eef2a687
commit 8a8e97d4b2
26 changed files with 765 additions and 214 deletions

View File

@@ -133,7 +133,7 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
}
// primary click
if (Gdx.input.isButtonPressed(App.getConfigInt("config_mouseprimary"))) {
if (Terrarum.mouseDown) {
// close by clicking close button or out-of-boud
if (mouseVec.distanceSquared(RADIUS, RADIUS) !in CLOSE_BUTTON_RADIUS.sqr()..RADIUSF.sqr()) {
closeGracefully()
@@ -175,7 +175,7 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
batch.draw(ItemCodex.getItemImage(slotConfig[i]), x - 16, y - 16, 32f, 32f)
// update as well while looping
if (i == mouseOnBlocksSlot && Gdx.input.isButtonPressed(App.getConfigInt("config_mouseprimary"))) {
if (i == mouseOnBlocksSlot && Terrarum.mouseDown) {
parent.setPencilColour(slotConfig[i])
closeGracefully()
}