Use atlas for android research icons, again
@ -34,30 +34,30 @@ object ResearchIcons {
|
||||
val KOT = ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/block/ph_kitty.png").element(0f, 0f, 32f, 32f, 32f, 32f)
|
||||
|
||||
init {
|
||||
var i = 0
|
||||
val grid = SubSkinGrid(AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_upgrades"), 126f, 126f), 18f, 18f, 7, 7)
|
||||
|
||||
ICON_TRANSFER = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_ATTACK_BOOST = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_PLASMA_SHIELD_BOOST = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_CLOAK = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_GRAVITATIONAL_STABILIZER = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_AIR_BAGS = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_JUMP_BOOST = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_FEATHER_FALLING = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_ITEM_MAGNET = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_ARROW = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_ARMOR = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_NANOBOTS = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_NIGHT_VISION = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_OXYGEN_SUPPLY = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_PLASMA_SHIELD = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_SHOCKWAVE = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_LIMB_OVERCLOCKING = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_STEP_ASSIST = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_ENDER_TELEPORT = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_WIRELESS_CHARGING = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_UNKNOWN = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_EXTENDED_REACH = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_PHANTOM_ATTRACTOR = AtlasSkinElement(ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research/android_stuff-${i++}"), 18f, 18f)
|
||||
ICON_TRANSFER = grid.next()
|
||||
ICON_ATTACK_BOOST = grid.next()
|
||||
ICON_PLASMA_SHIELD_BOOST = grid.next()
|
||||
ICON_CLOAK = grid.next()
|
||||
ICON_GRAVITATIONAL_STABILIZER = grid.next()
|
||||
ICON_AIR_BAGS = grid.next()
|
||||
ICON_JUMP_BOOST = grid.next()
|
||||
ICON_FEATHER_FALLING = grid.next()
|
||||
ICON_ITEM_MAGNET = grid.next()
|
||||
ICON_ARROW = grid.next()
|
||||
ICON_ARMOR = grid.next()
|
||||
ICON_NANOBOTS = grid.next()
|
||||
ICON_NIGHT_VISION = grid.next()
|
||||
ICON_OXYGEN_SUPPLY = grid.next()
|
||||
ICON_PLASMA_SHIELD = grid.next()
|
||||
ICON_SHOCKWAVE = grid.next()
|
||||
ICON_LIMB_OVERCLOCKING = grid.next()
|
||||
ICON_STEP_ASSIST = grid.next()
|
||||
ICON_ENDER_TELEPORT = grid.next()
|
||||
ICON_WIRELESS_CHARGING = grid.next()
|
||||
ICON_UNKNOWN = grid.next()
|
||||
ICON_EXTENDED_REACH = grid.next()
|
||||
ICON_PHANTOM_ATTRACTOR = grid.next()
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,53 @@
|
||||
package ru.dbotthepony.mc.otm.client.render
|
||||
|
||||
@Suppress("unused")
|
||||
data class SubSkinGrid(
|
||||
val parent: AbstractSkinElement,
|
||||
val width: Float,
|
||||
val height: Float,
|
||||
val rows: Int = 16,
|
||||
val columns: Int = 16,
|
||||
) {
|
||||
var row = 0
|
||||
var column = 0
|
||||
|
||||
val currentX: Float get() = column * width
|
||||
val currentY: Float get() = row * height
|
||||
|
||||
fun skip(): SubSkinGrid {
|
||||
column++
|
||||
|
||||
if (column >= columns) {
|
||||
jump()
|
||||
}
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
fun jump(): SubSkinGrid {
|
||||
row++
|
||||
column = 0
|
||||
return this
|
||||
}
|
||||
|
||||
fun next(): AbstractSkinElement {
|
||||
val element = parent.subElement(currentX, currentY, width, height)
|
||||
skip()
|
||||
return element
|
||||
}
|
||||
|
||||
fun reset(): SubSkinGrid {
|
||||
row = 0
|
||||
column = 0
|
||||
return this
|
||||
}
|
||||
|
||||
fun seek(row: Int, column: Int): SubSkinGrid {
|
||||
this.row = row
|
||||
this.column = column
|
||||
return this
|
||||
}
|
||||
|
||||
operator fun get(column: Int, row: Int) =
|
||||
parent.subElement(column * width, row * height, width, height)
|
||||
}
|
Before Width: | Height: | Size: 417 B |
Before Width: | Height: | Size: 443 B |
Before Width: | Height: | Size: 430 B |
Before Width: | Height: | Size: 399 B |
Before Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 445 B |
Before Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 408 B |
Before Width: | Height: | Size: 413 B |
Before Width: | Height: | Size: 436 B |
Before Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 417 B |
Before Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 403 B |
Before Width: | Height: | Size: 402 B |
Before Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 433 B |
Before Width: | Height: | Size: 413 B |
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 433 B |
Before Width: | Height: | Size: 440 B |
Before Width: | Height: | Size: 406 B |
After Width: | Height: | Size: 2.7 KiB |