Add missing close buttons
This commit is contained in:
parent
1ad0a41786
commit
90dc9060cf
@ -12,6 +12,10 @@ import ru.dbotthepony.mc.otm.menu.decorative.CargoCrateMenu
|
||||
class CargoCrateScreen(menu: CargoCrateMenu, inventory: Inventory, title: Component) : MatteryScreen<CargoCrateMenu>(menu, inventory, title) {
|
||||
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
||||
val frame = FramePanel(this, null, 0f, 0f, INVENTORY_FRAME_WIDTH, 22f + 4f + 6f * 18f, getTitle())
|
||||
|
||||
frame.makeCloseButton()
|
||||
frame.onClose { onClose() }
|
||||
|
||||
val grid = GridPanel(this, frame, 8f, 18f, 9f * 18f, 6f * 18f, 9, 6)
|
||||
|
||||
for (slot in menu.storageSlots)
|
||||
|
@ -16,6 +16,9 @@ class HoloSignScreen(menu: HoloSignMenu, inventory: Inventory, title: Component)
|
||||
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
||||
val frame = FramePanel(this, null, 0f, 0f, 200f, 200f, getTitle())
|
||||
|
||||
frame.makeCloseButton()
|
||||
frame.onClose { onClose() }
|
||||
|
||||
val input = NetworkedStringInputPanel(this, frame, backend = menu.text)
|
||||
input.dock = Dock.FILL
|
||||
input.multiLine = true
|
||||
|
@ -11,6 +11,10 @@ import ru.dbotthepony.mc.otm.menu.decorative.MinecartCargoCrateMenu
|
||||
class MinecartCargoCrateScreen(menu: MinecartCargoCrateMenu, inventory: Inventory, title: Component) : MatteryScreen<MinecartCargoCrateMenu>(menu, inventory, title) {
|
||||
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
||||
val frame = FramePanel(this, null, 0f, 0f, INVENTORY_FRAME_WIDTH, 22f + 4f + 6f * 18f, getTitle())
|
||||
|
||||
frame.makeCloseButton()
|
||||
frame.onClose { onClose() }
|
||||
|
||||
val grid = GridPanel(this, frame, 8f, 18f, 9f * 18f, 6f * 18f, 9, 6)
|
||||
|
||||
for (slot in menu.storageSlots)
|
||||
|
@ -49,6 +49,9 @@ class MatterPanelScreen(
|
||||
val frame = FramePanel.padded(this, null, GRID_WIDTH * AbstractSlotPanel.SIZE + ScrollBarConstants.WIDTH + 4f, GRID_HEIGHT * AbstractSlotPanel.SIZE + 2f, title)
|
||||
frame.dockPadding = frame.dockPadding.copy(top = frame.dockPadding.top + 2f)
|
||||
|
||||
frame.makeCloseButton()
|
||||
frame.onClose { onClose() }
|
||||
|
||||
val controls = DeviceControls(this, frame)
|
||||
|
||||
LargeBooleanRectangleButtonPanel(this, controls,
|
||||
|
@ -1,6 +1,5 @@
|
||||
package ru.dbotthepony.mc.otm.client.screen.storage
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
@ -28,6 +27,9 @@ class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Comp
|
||||
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
||||
val frame = FramePanel(this, null, 0f, 0f, FRAME_WIDTH, FRAME_HEIGHT, getTitle())
|
||||
|
||||
frame.makeCloseButton()
|
||||
frame.onClose { onClose() }
|
||||
|
||||
val views = ArrayList<EditablePanel<*>>()
|
||||
val settings = ArrayList<EditablePanel<*>>()
|
||||
|
||||
|
@ -42,6 +42,9 @@ class ItemMonitorScreen(menu: ItemMonitorMenu, inventory: Inventory, title: Comp
|
||||
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
||||
val frame = FramePanel(this@ItemMonitorScreen, null, 0f, 0f, 1f, 1f, getTitle())
|
||||
|
||||
frame.makeCloseButton()
|
||||
frame.onClose { onClose() }
|
||||
|
||||
val topPanel = EditablePanel(this, frame)
|
||||
topPanel.height = ITEM_GRID_HEIGHT * 18f
|
||||
topPanel.dock = Dock.TOP
|
||||
|
@ -15,7 +15,7 @@ import ru.dbotthepony.mc.otm.menu.storage.StorageBusMenu
|
||||
|
||||
class StorageBusScreen(menu: StorageBusMenu, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<StorageBusMenu>(menu, inventory, title) {
|
||||
override fun makeMainFrame(): FramePanel<out MatteryScreen<*>> {
|
||||
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
||||
val frame = super.makeMainFrame()!!
|
||||
|
||||
WidePowerGaugePanel(this, frame, menu.energyWidget, LEFT_MARGIN, GAUGE_TOP_WITH_SLOT)
|
||||
|
@ -15,7 +15,7 @@ import ru.dbotthepony.mc.otm.menu.storage.StorageExporterMenu
|
||||
|
||||
class StorageExporterScreen(menu: StorageExporterMenu, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<StorageExporterMenu>(menu, inventory, title) {
|
||||
override fun makeMainFrame(): FramePanel<out MatteryScreen<*>> {
|
||||
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
||||
val frame = super.makeMainFrame()!!
|
||||
|
||||
WidePowerGaugePanel(this, frame, menu.energyWidget, LEFT_MARGIN, GAUGE_TOP_WITH_SLOT)
|
||||
|
@ -15,7 +15,7 @@ import ru.dbotthepony.mc.otm.menu.storage.StorageImporterMenu
|
||||
|
||||
class StorageImporterScreen(menu: StorageImporterMenu, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<StorageImporterMenu>(menu, inventory, title) {
|
||||
override fun makeMainFrame(): FramePanel<out MatteryScreen<*>> {
|
||||
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
||||
val frame = super.makeMainFrame()!!
|
||||
|
||||
WidePowerGaugePanel(this, frame, menu.energyWidget, LEFT_MARGIN, GAUGE_TOP_WITH_SLOT)
|
||||
|
@ -18,6 +18,9 @@ class StoragePowerSupplierScreen(menu: StoragePowerSupplierMenu, inventory: Inve
|
||||
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
||||
val frame = FramePanel(this, width = 200f, height = 60f, title)
|
||||
|
||||
frame.makeCloseButton()
|
||||
frame.onClose { onClose() }
|
||||
|
||||
HorizontalPowerGaugePanel(this, frame, menu.energyWidget).also {
|
||||
it.dock = Dock.BOTTOM
|
||||
it.dockResize = DockResizeMode.NONE
|
||||
|
@ -656,6 +656,9 @@ class AndroidStationScreen constructor(p_97741_: AndroidStationMenu, p_97742_: I
|
||||
override fun makeMainFrame(): FramePanel<AndroidStationScreen> {
|
||||
val frame = FramePanel(this, 200f, 108f, title)
|
||||
|
||||
frame.makeCloseButton()
|
||||
frame.onClose { onClose() }
|
||||
|
||||
object : Label<AndroidStationScreen>(this@AndroidStationScreen, frame, height = 11f, shadow = true) {
|
||||
init {
|
||||
dock = Dock.BOTTOM
|
||||
|
@ -25,6 +25,9 @@ class EnergyServoScreen(menu: EnergyServoMenu, inventory: Inventory, title: Comp
|
||||
width = AbstractSlotPanel.SIZE * 2f + HorizontalPowerGaugePanel.GAUGE_BACKGROUND_TALL.width + 8f + ProgressGaugePanel.GAUGE_BACKGROUND.width * 2f,
|
||||
AbstractSlotPanel.SIZE + PlayerEquipmentPanel.HEIGHT + 4f, title)
|
||||
|
||||
frame.makeCloseButton()
|
||||
frame.onClose { onClose() }
|
||||
|
||||
val equipment = PlayerEquipmentPanel(this, frame, armorSlots = menu.equipment.armorSlots)
|
||||
equipment.dock = Dock.FILL
|
||||
equipment.dockResize = DockResizeMode.NONE
|
||||
|
@ -34,6 +34,9 @@ class EssenceStorageScreen(menu: EssenceStorageMenu, inventory: Inventory, title
|
||||
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
||||
val frame = FramePanel.padded(this, width = DEFAULT_FRAME_WIDTH, height = 18f * 2f + 36f + 25f, title)
|
||||
|
||||
frame.makeCloseButton()
|
||||
frame.onClose { onClose() }
|
||||
|
||||
val inputs = HorizontalStripPanel(this, frame, height = 18f)
|
||||
inputs.dock = Dock.TOP
|
||||
inputs.dockMargin = DockProperty(bottom = 3f, top = 3f)
|
||||
|
Loading…
Reference in New Issue
Block a user