tooltip and smelter ui fixes

This commit is contained in:
minjaesong
2024-01-30 19:57:32 +09:00
parent cbe11ce5dc
commit 7fb068517a
3 changed files with 20 additions and 15 deletions

View File

@@ -44,21 +44,25 @@ class UISmelterBasic(val smelter: FixtureSmelterBasic) : UICanvas(
// oreslot // oreslot
if (amount != null && gameItem != null) { if (amount != null && gameItem != null) {
if (clickedOn == 1) { if (clickedOn == 1) {
getPlayerInventory().remove(gameItem.dynamicID, amount) if (smelter.oreItem == null) {
getPlayerInventory().remove(gameItem.dynamicID, amount)
if (smelter.oreItem == null)
smelter.oreItem = InventoryPair(gameItem.dynamicID, amount) smelter.oreItem = InventoryPair(gameItem.dynamicID, amount)
else }
else if (smelter.oreItem!!.itm == gameItem.dynamicID) {
getPlayerInventory().remove(gameItem.dynamicID, amount)
smelter.oreItem!!.qty += amount smelter.oreItem!!.qty += amount
}
} }
// firebox // firebox
else if (clickedOn == 2) { else if (clickedOn == 2) {
getPlayerInventory().remove(gameItem.dynamicID, amount) if (smelter.fireboxItem == null) {
getPlayerInventory().remove(gameItem.dynamicID, amount)
if (smelter.fireboxItem == null)
smelter.fireboxItem = InventoryPair(gameItem.dynamicID, amount) smelter.fireboxItem = InventoryPair(gameItem.dynamicID, amount)
else }
else if (smelter.fireboxItem!!.itm == gameItem.dynamicID) {
getPlayerInventory().remove(gameItem.dynamicID, amount)
smelter.fireboxItem!!.qty += amount smelter.fireboxItem!!.qty += amount
}
} }
} }

View File

@@ -145,10 +145,6 @@ class UIItemInventoryElemSimple(
tooltipShowing[hash] = true tooltipShowing[hash] = true
// printdbg(this, tooltipShowing.entries) // printdbg(this, tooltipShowing.entries)
} }
else if (item == null || !mouseUp) {
tooltipShowing[hash] = false
}
} }
else { else {
@@ -160,6 +156,10 @@ class UIItemInventoryElemSimple(
} }
if (item == null || !mouseUp) {
tooltipShowing[hash] = false
}
// see IFs above? // see IFs above?
batch.color = Color.WHITE batch.color = Color.WHITE

View File

@@ -177,9 +177,10 @@ class UIItemInventoryElemWide(
tooltipShowing[hash] = true tooltipShowing[hash] = true
// printdbg(this, tooltipShowing.entries) // printdbg(this, tooltipShowing.entries)
} }
else if (item == null || !mouseUp) { }
tooltipShowing[hash] = false
} if (item == null || !mouseUp) {
tooltipShowing[hash] = false
} }
// see IFs above? // see IFs above?