Implemented #463 (pressing ESC in the casting GUI while in the middle of drawing a pattern erases the in-progress pattern rather than closing the screen).
This commit is contained in:
parent
a10b096402
commit
a9c859f56d
1 changed files with 8 additions and 1 deletions
|
@ -122,7 +122,7 @@ class GuiSpellcasting constructor(
|
|||
if (player != null) {
|
||||
val heldItem = player.getItemInHand(handOpenedWith)
|
||||
if (heldItem.isEmpty || !heldItem.`is`(HexTags.Items.STAVES))
|
||||
onClose()
|
||||
closeForReal()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,6 +287,13 @@ class GuiSpellcasting constructor(
|
|||
}
|
||||
|
||||
override fun onClose() {
|
||||
if (drawState == PatternDrawState.BetweenPatterns)
|
||||
closeForReal()
|
||||
else
|
||||
drawState = PatternDrawState.BetweenPatterns
|
||||
}
|
||||
|
||||
fun closeForReal() {
|
||||
Minecraft.getInstance().soundManager.stop(HexSounds.CASTING_AMBIANCE.location, null)
|
||||
|
||||
super.onClose()
|
||||
|
|
Loading…
Reference in a new issue