Skip to content

Commit

Permalink
fixes hotbar inaccessible when opening double chest... round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
blackd committed Aug 22, 2021
1 parent d8cb872 commit 41862c1
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ object InsertWidgetHandler : ScreenEventListener {


fun insertWidget(widgets: List<Widget>?) {
currentWidgets.clear()
currentScreen = null
if (widgets != null) {
currentWidgets.addAll(widgets)
currentScreen = Vanilla.screen()
} else {
currentWidgets.clear()
currentScreen = null
}
}
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class PlayerUICollectionWidget(override val screen: ContainerScreen<*>): Inserta
partialTicks: Float) {
rStandardGlState()
rClearDepth()
overflow = Overflow.VISIBLE
//overflow = Overflow.VISIBLE
val parentBounds = screen.`(containerBounds)`
absoluteBounds = parentBounds.copy(y = parentBounds.bottom + 3, height = 20)
init()
Expand Down Expand Up @@ -165,6 +165,11 @@ class PlayerUICollectionWidget(override val screen: ContainerScreen<*>): Inserta
mouseY)
}
}
override fun mouseClicked(x: Int,
y: Int,
button: Int): Boolean {
return super.mouseClicked(x,y,button) && visible
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ object InsertWidgetHandler : ScreenEventListener {


fun insertWidget(widgets: List<Widget>?) {
currentWidgets.clear()
currentScreen = null
if (widgets != null) {
currentWidgets.addAll(widgets)
currentScreen = Vanilla.screen()
} else {
currentWidgets.clear()
currentScreen = null
}
}
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ class PlayerUICollectionWidget(override val screen: ContainerScreen<*>): Inserta
val flex = BiFlex(this,
Axis.HORIZONTAL)

override var visible: Boolean
get() = super.visible
set(value) {
super.visible = value
}

}

inner class ActiveProfileButtonWidget(onClick: () -> Unit): ButtonWidget(onClick) {
Expand All @@ -165,6 +171,11 @@ class PlayerUICollectionWidget(override val screen: ContainerScreen<*>): Inserta
mouseY)
}
}
override fun mouseClicked(x: Int,
y: Int,
button: Int): Boolean {
return super.mouseClicked(x,y,button) && visible
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ object InsertWidgetHandler : ScreenEventListener {


fun insertWidget(widgets: List<Widget>?) {
currentWidgets.clear()
currentScreen = null
if (widgets != null) {
currentWidgets.addAll(widgets)
currentScreen = Vanilla.screen()
} else {
currentWidgets.clear()
currentScreen = null
}
}
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class PlayerUICollectionWidget(override val screen: ContainerScreen<*>): Inserta
partialTicks: Float) {
rStandardGlState()
rClearDepth()
overflow = Overflow.VISIBLE
//overflow = Overflow.VISIBLE
val parentBounds = screen.`(containerBounds)`
absoluteBounds = parentBounds.copy(y = parentBounds.bottom + 3, height = 20)
init()
Expand Down Expand Up @@ -165,6 +165,11 @@ class PlayerUICollectionWidget(override val screen: ContainerScreen<*>): Inserta
mouseY)
}
}
override fun mouseClicked(x: Int,
y: Int,
button: Int): Boolean {
return super.mouseClicked(x,y,button) && visible
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion platforms/forge-1.17/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ val supported_minecraft_versions = listOf("1.17.1")
val mod_loader = "forge"
val mod_version = project.version
val minecraft_version = "1.17.1"
val forge_version = "37.0.36"
val forge_version = "37.0.42"


logger.lifecycle("""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ object InsertWidgetHandler : ScreenEventListener {


fun insertWidget(widgets: List<Widget>?) {
currentWidgets.clear()
currentScreen = null
if (widgets != null) {
currentWidgets.addAll(widgets)
currentScreen = Vanilla.screen()
} else {
currentWidgets.clear()
currentScreen = null
}
}
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class PlayerUICollectionWidget(override val screen: ContainerScreen<*>): Inserta
partialTicks: Float) {
rStandardGlState()
rClearDepth()
overflow = Overflow.VISIBLE
//overflow = Overflow.VISIBLE
val parentBounds = screen.`(containerBounds)`
absoluteBounds = parentBounds.copy(y = parentBounds.bottom + 3, height = 20)
init()
Expand Down Expand Up @@ -165,6 +165,11 @@ class PlayerUICollectionWidget(override val screen: ContainerScreen<*>): Inserta
mouseY)
}
}
override fun mouseClicked(x: Int,
y: Int,
button: Int): Boolean {
return super.mouseClicked(x,y,button) && visible
}
}
}

Expand Down

0 comments on commit 41862c1

Please sign in to comment.