mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
mysterious wip
This commit is contained in:
BIN
assets/mods/basegame/sprites/fixtures/mysterious_atm.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/fixtures/mysterious_atm.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/fixtures/mysterious_atm_emsv.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/fixtures/mysterious_atm_emsv.tga
LFS
Normal file
Binary file not shown.
@@ -9,10 +9,7 @@ import net.torvald.terrarum.ControlPresets
|
|||||||
import net.torvald.terrarum.INGAME
|
import net.torvald.terrarum.INGAME
|
||||||
import net.torvald.terrarum.RunningEnvironment
|
import net.torvald.terrarum.RunningEnvironment
|
||||||
import net.torvald.terrarum.langpack.Lang
|
import net.torvald.terrarum.langpack.Lang
|
||||||
import net.torvald.terrarum.ui.Toolkit
|
import net.torvald.terrarum.ui.*
|
||||||
import net.torvald.terrarum.ui.UICanvas
|
|
||||||
import net.torvald.terrarum.ui.UIItemInventoryElemSimple
|
|
||||||
import net.torvald.terrarum.ui.UIItemRedeemCodeArea
|
|
||||||
import net.torvald.unicode.getKeycapPC
|
import net.torvald.unicode.getKeycapPC
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,13 +23,19 @@ class UIRedeemCodeMachine : UICanvas(
|
|||||||
override var width = Toolkit.drawWidth
|
override var width = Toolkit.drawWidth
|
||||||
override var height = App.scr.height
|
override var height = App.scr.height
|
||||||
|
|
||||||
|
val title = UIItemTextLabel(this, { "Enter the Code" },
|
||||||
|
(Toolkit.drawWidth - UIItemRedeemCodeArea.estimateWidth(14)) / 2,
|
||||||
|
App.scr.halfh - UIItemRedeemCodeArea.estimateHeight(4) - 48 - 48,
|
||||||
|
UIItemRedeemCodeArea.estimateWidth(14)
|
||||||
|
)
|
||||||
|
|
||||||
val inputPanel = UIItemRedeemCodeArea(this,
|
val inputPanel = UIItemRedeemCodeArea(this,
|
||||||
(Toolkit.drawWidth - UIItemRedeemCodeArea.estimateWidth(14)) / 2,
|
(Toolkit.drawWidth - UIItemRedeemCodeArea.estimateWidth(14)) / 2,
|
||||||
App.scr.halfh - UIItemRedeemCodeArea.estimateHeight(4) - 48,
|
App.scr.halfh - UIItemRedeemCodeArea.estimateHeight(4) - 48,
|
||||||
14, 4)
|
14, 4)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
addUIitem(title)
|
||||||
addUIitem(inputPanel)
|
addUIitem(inputPanel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
38
src/net/torvald/terrarum/ui/UIItemTextLabel.kt
Normal file
38
src/net/torvald/terrarum/ui/UIItemTextLabel.kt
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
package net.torvald.terrarum.ui
|
||||||
|
|
||||||
|
import com.badlogic.gdx.graphics.Color
|
||||||
|
import net.torvald.terrarum.BlendMode
|
||||||
|
import net.torvald.terrarum.ui.UIItemTextButton.Companion.Alignment
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by minjaesong on 2025-01-22.
|
||||||
|
*/
|
||||||
|
class UIItemTextLabel(
|
||||||
|
parentUI: UICanvas,
|
||||||
|
/** Stored text (independent to the Langpack) */
|
||||||
|
textfun: () -> String,
|
||||||
|
initialX: Int,
|
||||||
|
initialY: Int,
|
||||||
|
override val width: Int,
|
||||||
|
|
||||||
|
colour: Color = Color.WHITE,
|
||||||
|
|
||||||
|
hasBorder: Boolean = false,
|
||||||
|
|
||||||
|
paddingLeft: Int = 0,
|
||||||
|
paddingRight: Int = 0,
|
||||||
|
|
||||||
|
alignment: Alignment = Alignment.CENTRE,
|
||||||
|
|
||||||
|
tags: Array<String> = arrayOf("")
|
||||||
|
) : UIItemTextButton(
|
||||||
|
parentUI, textfun, initialX, initialY, width,
|
||||||
|
colour, colour, BlendMode.NORMAL, colour, colour, BlendMode.NORMAL,
|
||||||
|
|
||||||
|
hasBorder = hasBorder,
|
||||||
|
paddingLeft = paddingLeft,
|
||||||
|
paddingRight = paddingRight,
|
||||||
|
alignment = alignment,
|
||||||
|
tags = tags
|
||||||
|
|
||||||
|
)
|
||||||
BIN
work_files/graphics/sprites/fixtures/mysterious_atm.kra
LFS
Normal file
BIN
work_files/graphics/sprites/fixtures/mysterious_atm.kra
LFS
Normal file
Binary file not shown.
Reference in New Issue
Block a user