Split widgets_18 to several files

This commit is contained in:
DBotThePony 2023-01-31 13:45:08 +07:00
parent b551044867
commit 6390857959
Signed by: DBot
GPG Key ID: DCC23B5715498507
12 changed files with 41 additions and 35 deletions

View File

@ -4,7 +4,10 @@ import net.minecraft.resources.ResourceLocation
import ru.dbotthepony.mc.otm.OverdriveThatMatters
object WidgetLocation {
val WIDGETS_18 = ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets_18.png")
val LARGE_BUTTON = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/large_button.png"), 72f, 18f)
val STORAGE_CONTROLS = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/storage_controls.png"), 90f, 18f)
val MISC_18 = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/misc_18.png"), 72f, 72f)
val SLOT_BACKGROUNDS = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/slot_backgrounds.png"), 72f, 72f)
val MISC = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/misc.png"), 64f, 64f)
val PATTERN_PANEL_TABS = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/pattern_panel_tabs.png"), 60f, 23f)

View File

@ -5,47 +5,50 @@ private fun makeButton(grid: GridAtlas): StretchingRectangleElement {
val y = grid.currentY
return StretchingRectangleElement(
topLeft = WidgetLocation.WIDGETS_18.sprite(x, y, 2f, 2f, grid.atlasWidth, grid.atlasHeight),
topRight = WidgetLocation.WIDGETS_18.sprite(x + 16f, y, 2f, 2f, grid.atlasWidth, grid.atlasHeight),
bottomLeft = WidgetLocation.WIDGETS_18.sprite(x, y + 16f, 2f, 2f, grid.atlasWidth, grid.atlasHeight),
bottomRight = WidgetLocation.WIDGETS_18.sprite(x + 16f, y + 16f, 2f, 2f, grid.atlasWidth, grid.atlasHeight),
middle = WidgetLocation.WIDGETS_18.sprite(x + 2f, y + 2f, 14f, 14f, grid.atlasWidth, grid.atlasHeight),
top = WidgetLocation.WIDGETS_18.sprite(x + 2f, y, 14f, 2f, grid.atlasWidth, grid.atlasHeight),
left = WidgetLocation.WIDGETS_18.sprite(x, y + 2f, 2f, 14f, grid.atlasWidth, grid.atlasHeight),
right = WidgetLocation.WIDGETS_18.sprite(x + 16f, y + 2f, 2f, 14f, grid.atlasWidth, grid.atlasHeight),
bottom = WidgetLocation.WIDGETS_18.sprite(x + 2f, y + 16f, 14f, 2f, grid.atlasWidth, grid.atlasHeight),
topLeft = grid.texture.sprite(x, y, 2f, 2f, grid.atlasWidth, grid.atlasHeight),
topRight = grid.texture.sprite(x + 16f, y, 2f, 2f, grid.atlasWidth, grid.atlasHeight),
bottomLeft = grid.texture.sprite(x, y + 16f, 2f, 2f, grid.atlasWidth, grid.atlasHeight),
bottomRight = grid.texture.sprite(x + 16f, y + 16f, 2f, 2f, grid.atlasWidth, grid.atlasHeight),
middle = grid.texture.sprite(x + 2f, y + 2f, 14f, 14f, grid.atlasWidth, grid.atlasHeight),
top = grid.texture.sprite(x + 2f, y, 14f, 2f, grid.atlasWidth, grid.atlasHeight),
left = grid.texture.sprite(x, y + 2f, 2f, 14f, grid.atlasWidth, grid.atlasHeight),
right = grid.texture.sprite(x + 16f, y + 2f, 2f, 14f, grid.atlasWidth, grid.atlasHeight),
bottom = grid.texture.sprite(x + 2f, y + 16f, 14f, 2f, grid.atlasWidth, grid.atlasHeight),
)
}
object Widgets18 {
val GRID = GridAtlas(WidgetLocation.WIDGETS_18, 18f, 18f)
private val buttonGrids = WidgetLocation.LARGE_BUTTON.grid(rows = 1, columns = 4)
val BUTTON_IDLE_STRETCHABLE = makeButton(GRID)
val BUTTON_IDLE = GRID.next()
val BUTTON_HOVERED_STRETCHABLE = makeButton(GRID)
val BUTTON_HOVERED = GRID.next()
val BUTTON_PRESSED_STRETCHABLE = makeButton(GRID)
val BUTTON_PRESSED = GRID.next()
val ARROW_DOWN = GRID.next()
val AZ = GRID.next()
val COUNT = GRID.next()
val COLON = GRID.next()
val C = GRID.next()
val CROSS = GRID.next()
val FORWARD_SLASH = GRID.next()
val BATTERY_SLOT_BACKGROUND = GRID.next()
val PATTERN_SLOT_BACKGROUND = GRID.next()
val EQUIPMENT_BATTERY_SLOT_BACKGROUND = GRID.next()
val MATTER_CAPACITOR_SLOT_BACKGROUND = GRID.next()
val RETURN_ARROW_LEFT = GRID.next()
val BUTTON_IDLE_STRETCHABLE = makeButton(buttonGrids)
val BUTTON_IDLE = buttonGrids.next()
val BUTTON_HOVERED_STRETCHABLE = makeButton(buttonGrids)
val BUTTON_HOVERED = buttonGrids.next()
val BUTTON_PRESSED_STRETCHABLE = makeButton(buttonGrids)
val BUTTON_PRESSED = buttonGrids.next()
val BUTTON_DISABLED_STRETCHABLE = makeButton(buttonGrids)
val BUTTON_DISABLED = buttonGrids.next()
init {
GRID.jump()
}
private val storageGrid = WidgetLocation.STORAGE_CONTROLS.grid(rows = 1, columns = 5)
val ARROW_DOWN = storageGrid.next()
val AZ = storageGrid.next()
val COUNT = storageGrid.next()
val COLON = storageGrid.next()
val C = storageGrid.next()
val BUTTON_DISABLED_STRETCHABLE = makeButton(GRID)
val BUTTON_DISABLED = GRID.next()
val COOLDOWN = GRID.next()
private val miscGrid = WidgetLocation.MISC_18.grid(4, 4)
val COOLDOWN = miscGrid.next()
val CROSS = miscGrid.next()
val FORWARD_SLASH = miscGrid.next()
val RETURN_ARROW_LEFT = miscGrid.next()
private val slotBgGrid = WidgetLocation.SLOT_BACKGROUNDS.grid(4, 4)
val BATTERY_SLOT_BACKGROUND = slotBgGrid.next()
val EQUIPMENT_BATTERY_SLOT_BACKGROUND = slotBgGrid.next()
val PATTERN_SLOT_BACKGROUND = slotBgGrid.next()
val MATTER_CAPACITOR_SLOT_BACKGROUND = slotBgGrid.next()
private val redstoneGrid = WidgetLocation.REDSTONE_CONTROLS.grid(rows = 1, columns = 3)

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 711 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB