Skip to content

Commit

Permalink
Fix resources display when hovering upgrade slot inside building scre…
Browse files Browse the repository at this point in the history
…en. Updated the version.
  • Loading branch information
remmintan committed Jan 10, 2025
1 parent fd95f39 commit e6b02b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx4G
loader_version=0.14.24

# Mod Properties
mod_version=1.13.0-beta
mod_version=1.14.0-beta
maven_group = org.minefortress
archives_base_name = minefortress

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class BlueprintUpgradeSlot(
private val costsX: Int,
private val costsY: Int,
private val index: Int,
private val textRenderer: TextRenderer
private val textRenderer: TextRenderer,
private val showItems: Boolean
) : Drawable {

private val slotEndX = slotX + UPGRADE_SLOT_SIDE_SIZE
Expand Down Expand Up @@ -60,7 +61,7 @@ class BlueprintUpgradeSlot(
hovered = slot.isEnoughResources

val fortressManager = CoreModUtils.getFortressManager()
if (fortressManager.isSurvival) {
if (fortressManager.isSurvival && showItems) {
val stacks: List<ItemInfo> = slot.blockData.getStacks()
for (i1 in stacks.indices) {
val stack = stacks[i1]
Expand Down Expand Up @@ -115,11 +116,12 @@ class BlueprintUpgradeSlot(
costsX: Int,
costsY: Int,
slot: BlueprintSlot,
textRenderer: TextRenderer
textRenderer: TextRenderer,
showItems: Boolean = true
): BlueprintUpgradeSlot {
val slotX = x + index * (UPGRADE_SLOT_SIDE_SIZE + 4)
val slotY = y
return BlueprintUpgradeSlot(slot, slotX, slotY, costsX, costsY, index, textRenderer)
return BlueprintUpgradeSlot(slot, slotX, slotY, costsX, costsY, index, textRenderer, showItems)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class EditUpgradesScreen(private val handler: EditUpgradesScreenHandler) : Scree

private val upgradeSlots: List<BlueprintUpgradeSlot> by lazy {
handler.upgrades.mapIndexed { index, slot ->
BlueprintUpgradeSlot.create(SLOT_X, SLOT_Y, index, 0, 0, slot, this.textRenderer)
BlueprintUpgradeSlot.create(SLOT_X, SLOT_Y, index, 0, 0, slot, this.textRenderer, false)
}
}

Expand Down

0 comments on commit e6b02b2

Please sign in to comment.