УРА БОЛЬШЕ ВСРАТЫХ ИКОНОК (перенос чекбокса блокировки содержимого вправо + тултип для переключения ресайза)

This commit is contained in:
YuRaNnNzZZ 2024-10-24 05:54:08 +03:00
parent 84da57719d
commit 29ab315e43
Signed by: YuRaNnNzZZ
GPG Key ID: 5F71738C85A6006D
6 changed files with 26 additions and 7 deletions

View File

@ -164,8 +164,12 @@ private fun misc(provider: MatteryLanguageProvider) {
misc("needs_no_power", "Requires no power to operate")
gui("lock_holo_screen", "Lock contents")
gui("lock_holo_screen.unlocked", "Unlock contents")
gui("lock_holo_screen.tip", "Locking and unlocking contents is only possible in creative.\nWhen locked, text boundaries are removed.")
gui("holo_screen.resize_text", "Resize text automatically")
gui("holo_screen.do_not_resize_text", "Do not resize text")
gui("ticks", "Ticks")
gui("power_cost_per_use", "Power cost per use: %s")

View File

@ -176,8 +176,12 @@ private fun misc(provider: MatteryLanguageProvider) {
misc("needs_no_power", "Не требует энергии для работы")
gui("lock_holo_screen", "Заблокировать содержимое")
gui("lock_holo_screen.unlocked", "Разблокировать содержимое")
gui("lock_holo_screen.tip", "Блокировка и разблокировка содержимого возможна только в режиме творчества.\nКогда заблокировано, границы ввода текста отключены.")
gui("holo_screen.resize_text", "Изменять размер текста автоматически")
gui("holo_screen.do_not_resize_text", "Не менять размер текста")
gui("ticks", "Тиков")
gui("power_cost_per_use", "Энергии на операцию: %s")

View File

@ -180,4 +180,7 @@ object Widgets18 {
val COLOR_PALETTE = controlsGrid.next()
val TEXT_SCALE_DISABLED = controlsGrid.next()
val TEXT_SCALE_ENABLED = controlsGrid.next()
val LOCK_UNLOCKED = controlsGrid.next()
val LOCK_LOCKED = controlsGrid.next()
}

View File

@ -5,9 +5,7 @@ import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
import ru.dbotthepony.mc.otm.client.screen.panels.ColorPickerPanel
import ru.dbotthepony.mc.otm.client.screen.panels.Dock
import ru.dbotthepony.mc.otm.client.screen.panels.DockProperty
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
import ru.dbotthepony.mc.otm.client.screen.panels.button.CheckBoxLabelInputPanel
import ru.dbotthepony.mc.otm.client.screen.panels.button.LargeRectangleButtonPanel
import ru.dbotthepony.mc.otm.client.screen.panels.button.makeDeviceControls
import ru.dbotthepony.mc.otm.client.screen.panels.input.NetworkedStringInputPanel
@ -23,16 +21,14 @@ class HoloSignScreen(menu: HoloSignMenu, inventory: Inventory, title: Component)
frame.makeCloseButton()
frame.onClose { onClose() }
frame.makeHelpButton().apply {
tooltips.add(TranslatableComponent("otm.gui.lock_holo_screen.tip"))
}
val input = NetworkedStringInputPanel(this, frame, backend = menu.text)
input.dock = Dock.FILL
input.isMultiLine = true
val lock = CheckBoxLabelInputPanel(this, frame, menu.locked, TranslatableComponent("otm.gui.lock_holo_screen"))
lock.dock = Dock.BOTTOM
lock.dockMargin = DockProperty(2f, 2f, 2f, 2f)
lock.tooltips.add(TranslatableComponent("otm.gui.lock_holo_screen.tip"))
val controls = makeDeviceControls(this, frame, redstoneConfig = menu.redstone)
controls.addButton(object : LargeRectangleButtonPanel<HoloSignScreen>(this@HoloSignScreen, frame, onPress = {
@ -60,6 +56,18 @@ class HoloSignScreen(menu: HoloSignMenu, inventory: Inventory, title: Component)
prop = menu.textAutoScale,
iconActive = Widgets18.TEXT_SCALE_ENABLED,
iconInactive = Widgets18.TEXT_SCALE_DISABLED,
tooltipActive = TranslatableComponent("otm.gui.holo_screen.resize_text"),
tooltipInactive = TranslatableComponent("otm.gui.holo_screen.do_not_resize_text"),
))
controls.addButton(LargeBooleanRectangleButtonPanel(
this@HoloSignScreen,
frame,
prop = menu.locked,
iconActive = Widgets18.LOCK_LOCKED,
iconInactive = Widgets18.LOCK_UNLOCKED,
tooltipActive = TranslatableComponent("otm.gui.lock_holo_screen"),
tooltipInactive = TranslatableComponent("otm.gui.lock_holo_screen.unlocked")
))
return frame

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB