diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/WidgetLocation.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/WidgetLocation.kt index 8a10a2134..44502c2a7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/WidgetLocation.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/WidgetLocation.kt @@ -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) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/Widgets18.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/Widgets18.kt index 1acecb411..540fe2035 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/Widgets18.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/Widgets18.kt @@ -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) diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/large_button.png b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/large_button.png new file mode 100644 index 000000000..dbacdc975 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/large_button.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/large_button.xcf b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/large_button.xcf new file mode 100644 index 000000000..c8ec61762 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/large_button.xcf differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/misc18.png b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/misc18.png new file mode 100644 index 000000000..9a54260fb Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/misc18.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/misc18.xcf b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/misc18.xcf new file mode 100644 index 000000000..3d5a11d54 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/misc18.xcf differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/slot_backgrounds.png b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/slot_backgrounds.png new file mode 100644 index 000000000..33348815c Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/slot_backgrounds.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/slot_backgrounds.xcf b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/slot_backgrounds.xcf new file mode 100644 index 000000000..bbaeefede Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/slot_backgrounds.xcf differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/storage_controls.png b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/storage_controls.png new file mode 100644 index 000000000..9346529e2 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/storage_controls.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/storage_controls.xcf b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/storage_controls.xcf new file mode 100644 index 000000000..2e3d11ece Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/storage_controls.xcf differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets_18.png b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets_18.png deleted file mode 100644 index 765c4d40e..000000000 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets_18.png and /dev/null differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets_18.xcf b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets_18.xcf deleted file mode 100644 index edfaa6351..000000000 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets_18.xcf and /dev/null differ