mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-12 22:56:06 +09:00
hacked the titlescreen to fix resize-related UI shit
This commit is contained in:
@@ -369,7 +369,10 @@ class TitleScreen(val batch: SpriteBatch) : Screen {
|
|||||||
if (loadDone) {
|
if (loadDone) {
|
||||||
// resize UI by re-creating it (!!)
|
// resize UI by re-creating it (!!)
|
||||||
uiMenu.resize(Terrarum.WIDTH, Terrarum.HEIGHT)
|
uiMenu.resize(Terrarum.WIDTH, Terrarum.HEIGHT)
|
||||||
uiMenu.setPosition(0, UITitleRemoConRoot.menubarOffY)
|
//uiMenu.setPosition(0, UITitleRemoConRoot.menubarOffY)
|
||||||
|
uiMenu.setPosition(0, 0) // shitty hack. Could be:
|
||||||
|
// 1: Init code and resize code are different
|
||||||
|
// 2: The UI is coded shit
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lightmapInitialised) {
|
if (lightmapInitialised) {
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class UIItemInventoryDynamicList(
|
|||||||
itemImage = null,
|
itemImage = null,
|
||||||
mouseoverBackCol = Color(0x282828_ff),
|
mouseoverBackCol = Color(0x282828_ff),
|
||||||
mouseoverBackBlendMode = BlendMode.SCREEN,
|
mouseoverBackBlendMode = BlendMode.SCREEN,
|
||||||
backCol = Color(0x303030_58),
|
backCol = Color(0x404040_88),
|
||||||
backBlendMode = BlendMode.NORMAL,
|
backBlendMode = BlendMode.NORMAL,
|
||||||
drawBackOnNull = true,
|
drawBackOnNull = true,
|
||||||
inactiveTextCol = defaultTextColour
|
inactiveTextCol = defaultTextColour
|
||||||
@@ -98,7 +98,7 @@ class UIItemInventoryDynamicList(
|
|||||||
itemImage = null,
|
itemImage = null,
|
||||||
mouseoverBackCol = Color(0x282828_ff),
|
mouseoverBackCol = Color(0x282828_ff),
|
||||||
mouseoverBackBlendMode = BlendMode.SCREEN,
|
mouseoverBackBlendMode = BlendMode.SCREEN,
|
||||||
backCol = Color(0x303030_58),
|
backCol = Color(0x404040_88),
|
||||||
backBlendMode = BlendMode.NORMAL,
|
backBlendMode = BlendMode.NORMAL,
|
||||||
drawBackOnNull = true,
|
drawBackOnNull = true,
|
||||||
inactiveTextCol = defaultTextColour
|
inactiveTextCol = defaultTextColour
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class UIItemInventoryEquippedView(
|
|||||||
lateinit var inventorySortList: Array<GameItem?>
|
lateinit var inventorySortList: Array<GameItem?>
|
||||||
private var rebuildList = true
|
private var rebuildList = true
|
||||||
|
|
||||||
val spriteViewBackCol: Color; get() = Color(0x303030_58.toInt())//Color(0xd4d4d4_ff.toInt())
|
val spriteViewBackCol: Color; get() = Color(0x404040_88.toInt())//Color(0xd4d4d4_ff.toInt())
|
||||||
|
|
||||||
private val itemGrid = Array<UIItemInventoryCellBase>(
|
private val itemGrid = Array<UIItemInventoryCellBase>(
|
||||||
2 * 5, {
|
2 * 5, {
|
||||||
@@ -51,7 +51,7 @@ class UIItemInventoryEquippedView(
|
|||||||
itemImage = null,
|
itemImage = null,
|
||||||
mouseoverBackCol = Color(0x282828_ff),
|
mouseoverBackCol = Color(0x282828_ff),
|
||||||
mouseoverBackBlendMode = BlendMode.SCREEN,
|
mouseoverBackBlendMode = BlendMode.SCREEN,
|
||||||
backCol = Color(0x303030_58),
|
backCol = Color(0x404040_88),
|
||||||
backBlendMode = BlendMode.NORMAL,
|
backBlendMode = BlendMode.NORMAL,
|
||||||
drawBackOnNull = true
|
drawBackOnNull = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -674,10 +674,13 @@ object LightmapRenderer {
|
|||||||
// excluiding overscans; only reckon echo lights
|
// excluiding overscans; only reckon echo lights
|
||||||
for (y in overscan_open..render_height + overscan_open + 1) {
|
for (y in overscan_open..render_height + overscan_open + 1) {
|
||||||
for (x in overscan_open..render_width + overscan_open + 1) {
|
for (x in overscan_open..render_width + overscan_open + 1) {
|
||||||
val colour = lightmap[y][x]
|
try {
|
||||||
reds [minOf(CHANNEL_MAX, colour.r.times(MUL).floorInt())] += 1
|
val colour = lightmap[y][x]
|
||||||
greens[minOf(CHANNEL_MAX, colour.g.times(MUL).floorInt())] += 1
|
reds[minOf(CHANNEL_MAX, colour.r.times(MUL).floorInt())] += 1
|
||||||
blues [minOf(CHANNEL_MAX, colour.b.times(MUL).floorInt())] += 1
|
greens[minOf(CHANNEL_MAX, colour.g.times(MUL).floorInt())] += 1
|
||||||
|
blues[minOf(CHANNEL_MAX, colour.b.times(MUL).floorInt())] += 1
|
||||||
|
}
|
||||||
|
catch (e: ArrayIndexOutOfBoundsException) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Histogram(reds, greens, blues)
|
return Histogram(reds, greens, blues)
|
||||||
|
|||||||
Reference in New Issue
Block a user