mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
module UI now has margin; game update will drop consecutive updates if its try count is exhausted (reduced lag after window move/resize)
This commit is contained in:
@@ -31,13 +31,14 @@ class UIItemList<Item: UIItem>(
|
||||
val inactiveCol: Color = Color(0xc0c0c0_ff.toInt()),
|
||||
val backgroundCol: Color = Color(0x242424_80),
|
||||
val backgroundBlendMode: String = BlendMode.NORMAL,
|
||||
val kinematic: Boolean = false
|
||||
val kinematic: Boolean = false,
|
||||
val border: Int = 0
|
||||
) : UIItem(parentUI) {
|
||||
|
||||
init {
|
||||
itemList.forEachIndexed { index, item ->
|
||||
item.posX = this.posX
|
||||
item.posY = if (index == 0) this.posY else itemList[index - 1].posY + itemList[index - 1].height
|
||||
item.posX = this.posX + border
|
||||
item.posY = if (index == 0) this.posY + border else itemList[index - 1].posY + itemList[index - 1].height
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@ class UITitleRemoConModules(val superMenu: UICanvas) : UICanvas() {
|
||||
|
||||
|
||||
private val moduleAreaHMargin = 48
|
||||
|
||||
private val moduleAreaBorder = 8
|
||||
|
||||
private val moduleAreaWidth = (Terrarum.WIDTH * 0.75).toInt() - moduleAreaHMargin
|
||||
private val moduleAreaHeight = Terrarum.HEIGHT - moduleAreaHMargin * 2
|
||||
|
||||
@@ -50,7 +53,7 @@ class UITitleRemoConModules(val superMenu: UICanvas) : UICanvas() {
|
||||
moduleInfoCells.add(UIItemModuleInfoCell(
|
||||
this,
|
||||
it.first,
|
||||
moduleAreaWidth,
|
||||
moduleAreaWidth - 2 * moduleAreaBorder,
|
||||
0, 0 // placeholder
|
||||
))
|
||||
}
|
||||
@@ -62,7 +65,8 @@ class UITitleRemoConModules(val superMenu: UICanvas) : UICanvas() {
|
||||
(Terrarum.WIDTH * 0.25f).toInt(), moduleAreaHMargin,
|
||||
moduleAreaWidth,
|
||||
moduleAreaHeight,
|
||||
inactiveCol = Color.WHITE
|
||||
inactiveCol = Color.WHITE,
|
||||
border = moduleAreaBorder
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user