Compare commits
1 Commits
3e66d7439a
...
84e2c6d6e9
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 84e2c6d6e9 |
|
@ -134,17 +134,16 @@ class TerminalRequestAmountViewController(
|
|||
private fun doRequest() {
|
||||
screen.requestItem(stack, field.number ?: 1)
|
||||
window!!.removeFromScreen()
|
||||
screen.amountVC = null
|
||||
}
|
||||
|
||||
class AmountField(val vc: TerminalRequestAmountViewController): NumberField(1) {
|
||||
override fun keyPressed(keyCode: Int, modifiers: KeyModifiers): Boolean {
|
||||
return if (super.keyPressed(keyCode, modifiers)) {
|
||||
true
|
||||
} else if (keyCode == GLFW.GLFW_KEY_ENTER) {
|
||||
return if (keyCode == GLFW.GLFW_KEY_ENTER) {
|
||||
vc.doRequest()
|
||||
true
|
||||
} else {
|
||||
false
|
||||
super.keyPressed(keyCode, modifiers)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.mojang.blaze3d.systems.RenderSystem
|
|||
import net.minecraft.client.MinecraftClient
|
||||
import net.minecraft.client.gui.DrawableHelper
|
||||
import net.minecraft.client.gui.Element
|
||||
import net.minecraft.client.gui.screen.TickableElement
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget
|
||||
import net.minecraft.client.render.Tessellator
|
||||
import net.minecraft.client.render.VertexConsumerProvider
|
||||
|
@ -25,7 +24,6 @@ import net.shadowfacts.phycon.networking.C2STerminalUpdateDisplayedItems
|
|||
import net.shadowfacts.phycon.util.SortMode
|
||||
import java.math.RoundingMode
|
||||
import java.text.DecimalFormat
|
||||
import java.util.LinkedList
|
||||
import kotlin.math.ceil
|
||||
import kotlin.math.min
|
||||
|
||||
|
@ -43,8 +41,6 @@ class TerminalScreen(handler: TerminalScreenHandler, playerInv: PlayerInventory,
|
|||
val backgroundHeight: Int
|
||||
get() = backgroundHeight
|
||||
|
||||
// val tickableElements = LinkedList<TickableElement>()
|
||||
|
||||
val terminalVC = TerminalViewController(this, handler, handler.terminal)
|
||||
var amountVC: TerminalRequestAmountViewController? = null
|
||||
|
||||
|
@ -164,10 +160,6 @@ class TerminalScreen(handler: TerminalScreenHandler, playerInv: PlayerInventory,
|
|||
requestItem(stack, ceil(min(stack.count, stack.maxCount) / 2f).toInt())
|
||||
} else {
|
||||
showRequestAmountDialog(stack)
|
||||
// todo
|
||||
// dialogStack = stack
|
||||
// showingAmountDialog = true
|
||||
// searchBox.setSelected(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue