mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 20:14:05 +09:00
tooltip and smelter ui fixes
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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?
|
||||||
|
|||||||
Reference in New Issue
Block a user