"Draw building guide" checkbox
This commit is contained in:
parent
6f75ca785d
commit
583b9dc208
@ -853,6 +853,7 @@ private fun androidFeatures(provider: MatteryLanguageProvider) {
|
|||||||
|
|
||||||
private fun gui(provider: MatteryLanguageProvider) {
|
private fun gui(provider: MatteryLanguageProvider) {
|
||||||
with(provider.english) {
|
with(provider.english) {
|
||||||
|
gui("draw_multiblock_guide", "Draw building guide")
|
||||||
gui("ago", "%s ago")
|
gui("ago", "%s ago")
|
||||||
|
|
||||||
gui("time.short.5s", "5s")
|
gui("time.short.5s", "5s")
|
||||||
|
@ -857,6 +857,7 @@ private fun androidFeatures(provider: MatteryLanguageProvider) {
|
|||||||
|
|
||||||
private fun gui(provider: MatteryLanguageProvider) {
|
private fun gui(provider: MatteryLanguageProvider) {
|
||||||
with(provider.russian) {
|
with(provider.russian) {
|
||||||
|
gui("draw_multiblock_guide", "Отображать помощника постройки")
|
||||||
gui("ago", "%s тому назад")
|
gui("ago", "%s тому назад")
|
||||||
|
|
||||||
gui("time.short.5s", "5с")
|
gui("time.short.5s", "5с")
|
||||||
|
@ -16,6 +16,7 @@ object WidgetLocation {
|
|||||||
val PATTERN_PANEL_TABS = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/pattern_panel_tabs.png"), 60f, 23f)
|
val PATTERN_PANEL_TABS = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/pattern_panel_tabs.png"), 60f, 23f)
|
||||||
|
|
||||||
val CHECKBOX = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/checkbox.png"), 30f, 60f)
|
val CHECKBOX = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/checkbox.png"), 30f, 60f)
|
||||||
|
val RADIO = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/radio.png"), 30f, 60f)
|
||||||
val PROGRESS_ARROWS = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/progress_arrows.png"), 22f, 31f)
|
val PROGRESS_ARROWS = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/progress_arrows.png"), 22f, 31f)
|
||||||
val HORIZONTAL_GAUGES = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/horizontal_gauges.png"), 96f, 108f)
|
val HORIZONTAL_GAUGES = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/horizontal_gauges.png"), 96f, 108f)
|
||||||
val VERTICAL_GAUGES = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/vertical_gauges.png"), 90f, 48f)
|
val VERTICAL_GAUGES = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/vertical_gauges.png"), 90f, 48f)
|
||||||
|
@ -17,8 +17,8 @@ class BlackHoleGeneratorRenderer(private val context: BlockEntityRendererProvide
|
|||||||
packedLight: Int,
|
packedLight: Int,
|
||||||
packedOverlay: Int
|
packedOverlay: Int
|
||||||
) {
|
) {
|
||||||
//if (!tile.drawBuildingGuide) return
|
if (tile.drawBuildingGuide) {
|
||||||
val multiblock = tile.multiblock ?: return
|
tile.multiblock?.render(poseStack, DynamicBufferSource.WORLD, tile.blockPos)
|
||||||
multiblock.render(poseStack, DynamicBufferSource.WORLD, tile.blockPos)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,14 +16,14 @@ open class CheckBoxPanel<out S : Screen>(
|
|||||||
height: Float = REGULAR_DIMENSIONS,
|
height: Float = REGULAR_DIMENSIONS,
|
||||||
open val isChecked: Delegate<Boolean> = Delegate.Box(false)
|
open val isChecked: Delegate<Boolean> = Delegate.Box(false)
|
||||||
) : AbstractButtonPanel<S>(screen, parent, x, y, width, height) {
|
) : AbstractButtonPanel<S>(screen, parent, x, y, width, height) {
|
||||||
open val IDLE_UNCHECKED: AbstractMatterySprite = Companion.IDLE_UNCHECKED
|
open val IDLE_UNCHECKED: AbstractMatterySprite get() = Companion.IDLE_UNCHECKED
|
||||||
open val IDLE_CHECKED: AbstractMatterySprite = Companion.IDLE_CHECKED
|
open val IDLE_CHECKED: AbstractMatterySprite get() = Companion.IDLE_CHECKED
|
||||||
open val HOVERED_UNCHECKED: AbstractMatterySprite = Companion.HOVERED_UNCHECKED
|
open val HOVERED_UNCHECKED: AbstractMatterySprite get() = Companion.HOVERED_UNCHECKED
|
||||||
open val HOVERED_CHECKED: AbstractMatterySprite = Companion.HOVERED_CHECKED
|
open val HOVERED_CHECKED: AbstractMatterySprite get() = Companion.HOVERED_CHECKED
|
||||||
open val PRESSED_UNCHECKED: AbstractMatterySprite = Companion.PRESSED_UNCHECKED
|
open val PRESSED_UNCHECKED: AbstractMatterySprite get() = Companion.PRESSED_UNCHECKED
|
||||||
open val PRESSED_CHECKED: AbstractMatterySprite = Companion.PRESSED_CHECKED
|
open val PRESSED_CHECKED: AbstractMatterySprite get() = Companion.PRESSED_CHECKED
|
||||||
open val DISABLED_UNCHECKED: AbstractMatterySprite = Companion.DISABLED_UNCHECKED
|
open val DISABLED_UNCHECKED: AbstractMatterySprite get() = Companion.DISABLED_UNCHECKED
|
||||||
open val DISABLED_CHECKED: AbstractMatterySprite = Companion.DISABLED_CHECKED
|
open val DISABLED_CHECKED: AbstractMatterySprite get() = Companion.DISABLED_CHECKED
|
||||||
|
|
||||||
protected fun renderCheckboxBackground(graphics: MGUIGraphics, mouseX: Float, mouseY: Float, partialTick: Float) {
|
protected fun renderCheckboxBackground(graphics: MGUIGraphics, mouseX: Float, mouseY: Float, partialTick: Float) {
|
||||||
if (isDisabled) {
|
if (isDisabled) {
|
||||||
|
@ -2,36 +2,33 @@ package ru.dbotthepony.mc.otm.client.screen.tech
|
|||||||
|
|
||||||
import net.minecraft.network.chat.Component
|
import net.minecraft.network.chat.Component
|
||||||
import net.minecraft.world.entity.player.Inventory
|
import net.minecraft.world.entity.player.Inventory
|
||||||
import ru.dbotthepony.mc.otm.client.render.RenderGravity
|
|
||||||
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
|
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
|
||||||
import ru.dbotthepony.mc.otm.client.screen.panels.Dock
|
import ru.dbotthepony.mc.otm.client.screen.panels.Dock
|
||||||
import ru.dbotthepony.mc.otm.client.screen.panels.DockResizeMode
|
|
||||||
import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
|
import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
|
||||||
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
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.widget.ProfiledMatterGaugePanel
|
import ru.dbotthepony.mc.otm.client.screen.widget.ProfiledMatterGaugePanel
|
||||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProfiledPowerGaugePanel
|
import ru.dbotthepony.mc.otm.client.screen.widget.ProfiledPowerGaugePanel
|
||||||
import ru.dbotthepony.mc.otm.client.screen.widget.TallHorizontalProfiledPowerGaugePanel
|
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||||
import ru.dbotthepony.mc.otm.client.screen.widget.WideProfiledPowerGaugePanel
|
|
||||||
import ru.dbotthepony.mc.otm.menu.tech.BlackHoleGeneratorMenu
|
import ru.dbotthepony.mc.otm.menu.tech.BlackHoleGeneratorMenu
|
||||||
import ru.dbotthepony.mc.otm.menu.tech.CobblerMenu
|
|
||||||
|
|
||||||
class BlackHoleGeneratorScreen(menu: BlackHoleGeneratorMenu, inventory: Inventory, title: Component) : MatteryScreen<BlackHoleGeneratorMenu>(menu, inventory, title) {
|
class BlackHoleGeneratorScreen(menu: BlackHoleGeneratorMenu, inventory: Inventory, title: Component) : MatteryScreen<BlackHoleGeneratorMenu>(menu, inventory, title) {
|
||||||
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
|
||||||
val frame = FramePanel.padded(this, 200f, 60f, title)
|
val frame = FramePanel.padded(this, 200f, 60f, title)
|
||||||
|
|
||||||
val left = EditablePanel(this, frame)
|
|
||||||
|
|
||||||
val energy = ProfiledPowerGaugePanel(this, frame, menu.energy)
|
val energy = ProfiledPowerGaugePanel(this, frame, menu.energy)
|
||||||
val matter = ProfiledMatterGaugePanel(this, frame, menu.matter)
|
val matter = ProfiledMatterGaugePanel(this, frame, menu.matter)
|
||||||
|
|
||||||
left.width = energy.width + matter.width + 1f
|
|
||||||
energy.parent = left
|
|
||||||
matter.parent = left
|
|
||||||
matter.dockLeft = 1f
|
matter.dockLeft = 1f
|
||||||
left.dock = Dock.LEFT
|
|
||||||
energy.dock = Dock.LEFT
|
energy.dock = Dock.LEFT
|
||||||
matter.dock = Dock.LEFT
|
matter.dock = Dock.LEFT
|
||||||
|
|
||||||
|
matter.dockRight = 4f
|
||||||
|
|
||||||
|
val drawGuide = CheckBoxLabelInputPanel(this, frame, menu.drawBuildingGuide, TranslatableComponent("otm.gui.draw_multiblock_guide"))
|
||||||
|
drawGuide.dock = Dock.TOP
|
||||||
|
drawGuide.dockBottom = 2f
|
||||||
|
|
||||||
return frame
|
return frame
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,42 +218,42 @@ class ShapedMultiblockBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new node relative to this node at [diff], which behaves as if being [Or] node
|
* Creates new node relative to this node at [diff], which behaves by default as [Strategy.OR_EITHER]
|
||||||
*/
|
*/
|
||||||
fun relative(diff: Vec3i): Node {
|
fun relative(diff: Vec3i): Node {
|
||||||
return node(pos + diff)
|
return node(pos + diff)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new node relative to this node at [dir] side, which behaves as if being [Or] node
|
* Creates new node relative to this node at [dir] side, which behaves by default as [Strategy.OR_EITHER]
|
||||||
*/
|
*/
|
||||||
fun relative(dir: Direction): Node {
|
fun relative(dir: Direction): Node {
|
||||||
return relative(dir.normal)
|
return relative(dir.normal)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new node relative to this node at [dir] side, which behaves as if being [Or] node
|
* Creates new node relative to this node at [dir] side, which behaves by default as [Strategy.OR_EITHER]
|
||||||
*/
|
*/
|
||||||
fun relative(dir: RelativeSide): Node {
|
fun relative(dir: RelativeSide): Node {
|
||||||
return relative(dir.default)
|
return relative(dir.default)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new node relative to this node at [diff], and configures it in-place using provided [configurator] expression, which behaves as if being [Or] node
|
* Creates new node relative to this node at [diff], and configures it in-place using provided [configurator] expression, which behaves by default as [Strategy.OR_EITHER]
|
||||||
*/
|
*/
|
||||||
fun relative(diff: Vec3i, configurator: Node.() -> Unit): Node {
|
fun relative(diff: Vec3i, configurator: Node.() -> Unit): Node {
|
||||||
return node(pos + diff).also(configurator)
|
return node(pos + diff).also(configurator)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new node relative to this node at [dir] side, and configures it in-place using provided [configurator] expression, which behaves as if being [Or] node
|
* Creates new node relative to this node at [dir] side, and configures it in-place using provided [configurator] expression, which behaves by default as [Strategy.OR_EITHER]
|
||||||
*/
|
*/
|
||||||
fun relative(dir: Direction, configurator: Node.() -> Unit): Node {
|
fun relative(dir: Direction, configurator: Node.() -> Unit): Node {
|
||||||
return relative(dir.normal).also(configurator)
|
return relative(dir.normal).also(configurator)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new node relative to this node at [dir] side, and configures it in-place using provided [configurator] expression, which behaves as if being [Or] node
|
* Creates new node relative to this node at [dir] side, and configures it in-place using provided [configurator] expression, which behaves by default as [Strategy.OR_EITHER]
|
||||||
*/
|
*/
|
||||||
fun relative(dir: RelativeSide, configurator: Node.() -> Unit): Node {
|
fun relative(dir: RelativeSide, configurator: Node.() -> Unit): Node {
|
||||||
return relative(dir.default).also(configurator)
|
return relative(dir.default).also(configurator)
|
||||||
|
Loading…
Reference in New Issue
Block a user