Fix widgets
This commit is contained in:
parent
6390857959
commit
e20fc1274c
@ -28,7 +28,7 @@ import java.util.*
|
||||
import kotlin.math.ceil
|
||||
|
||||
object MatteryGUI {
|
||||
private val BARS = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/player_bars.png"), 80f, 35f)
|
||||
private val BARS = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/player_bars.png"), 80f, 36f)
|
||||
val CHARGE = BARS.sprite(height = 9f)
|
||||
val CHARGE_BG = BARS.sprite(y = 9f, height = 9f)
|
||||
|
||||
|
@ -22,6 +22,6 @@ data class MatteryAtlas(
|
||||
winding: UVWindingOrder = this.winding,
|
||||
) = MatterySprite(texture, x = x, y = y, width = width, height = height, atlasHeight = this.height, atlasWidth = this.width, winding = winding)
|
||||
|
||||
fun grid(rows: Int, columns: Int) = GridAtlas(texture, this.width / rows, this.height / columns, rows = rows, columns = columns)
|
||||
fun grid(rows: Int, columns: Int) = GridAtlas(texture, this.width / columns, this.height / rows, rows = rows, columns = columns)
|
||||
fun grid(width: Float, height: Float, rows: Int, columns: Int) = GridAtlas(texture, width, height, rows, columns)
|
||||
}
|
||||
|
@ -53,8 +53,8 @@ data class MatterySprite @JvmOverloads constructor(
|
||||
require(atlasWidth > 0f) { "Invalid image width $atlasWidth" }
|
||||
require(atlasHeight > 0f) { "Invalid image height $atlasHeight" }
|
||||
|
||||
require(width <= atlasWidth) { "$width <= $atlasWidth" }
|
||||
require(height <= atlasHeight) { "$height <= $atlasHeight" }
|
||||
require(x + width <= atlasWidth) { "${x + width} <= $atlasWidth" }
|
||||
require(y + height <= atlasHeight) { "${y + height} <= $atlasHeight" }
|
||||
}
|
||||
|
||||
override val u0 = this.x / atlasWidth
|
||||
|
@ -6,7 +6,7 @@ import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
object WidgetLocation {
|
||||
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 MISC_18 = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/misc18.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)
|
||||
|
@ -4,7 +4,7 @@ import net.minecraft.resources.ResourceLocation
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
|
||||
object Widgets8 {
|
||||
val GRID = GridAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets_8.png"), 8f, 8f, 64 / 8, 32 / 8)
|
||||
val GRID = GridAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets_8.png"), 8f, 8f, columns = 64 / 8, rows = 32 / 8)
|
||||
|
||||
val BUTTON_IDLE = GRID[0, 0]
|
||||
val BUTTON_HOVERED = GRID[0, 1]
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 290 B |
Loading…
Reference in New Issue
Block a user