mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
uicanvas: updateUI/renderUI to updateImpl/renderImpl to match the naming scheme with the actor
This commit is contained in:
@@ -115,11 +115,11 @@ class WearableWorldRadarUI(val device: VM) : UICanvas() {
|
|||||||
override var height = 140
|
override var height = 140
|
||||||
override var openCloseTime = 0f
|
override var openCloseTime = 0f
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
device.update(delta)
|
device.update(delta)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.end()
|
batch.end()
|
||||||
|
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
|
|||||||
@@ -47,10 +47,10 @@ internal class UIHomeComputer : UICanvas(
|
|||||||
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_S Reset\u3000" +
|
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_S Reset\u3000" +
|
||||||
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_Q SysRq"
|
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_Q SysRq"
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, otherBatch: SpriteBatch, otherCamera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, otherBatch: SpriteBatch, otherCamera: OrthographicCamera) {
|
||||||
otherBatch.end()
|
otherBatch.end()
|
||||||
|
|
||||||
fbo.inAction(camera, batch) {
|
fbo.inAction(camera, batch) {
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ class MusicPlayer(private val ingame: TerrarumIngame) : UICanvas() {
|
|||||||
private var mouseOnButton: Int? = null
|
private var mouseOnButton: Int? = null
|
||||||
private var mouseOnList: Int? = null
|
private var mouseOnList: Int? = null
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
val shouldPlayerBeDisabled = shouldPlayerBeDisabled
|
val shouldPlayerBeDisabled = shouldPlayerBeDisabled
|
||||||
|
|
||||||
// process transition request
|
// process transition request
|
||||||
@@ -655,7 +655,7 @@ class MusicPlayer(private val ingame: TerrarumIngame) : UICanvas() {
|
|||||||
get() = relativeMouseX.toFloat() in _posX-capsuleMosaicSize .. _posX+width+capsuleMosaicSize &&
|
get() = relativeMouseX.toFloat() in _posX-capsuleMosaicSize .. _posX+width+capsuleMosaicSize &&
|
||||||
relativeMouseY.toFloat() in _posY .. _posY+height
|
relativeMouseY.toFloat() in _posY .. _posY+height
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
widthForFreqMeter = if (transitionOngoing && modeNext >= MODE_MOUSE_UP || mode >= MODE_MOUSE_UP)
|
widthForFreqMeter = if (transitionOngoing && modeNext >= MODE_MOUSE_UP || mode >= MODE_MOUSE_UP)
|
||||||
uiWidthFromTextWidth(nameLength)
|
uiWidthFromTextWidth(nameLength)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ entrypoint=net.torvald.terrarum.musicplayer.EntryPoint
|
|||||||
releasedate=2024-02-10
|
releasedate=2024-02-10
|
||||||
version=1.0.0
|
version=1.0.0
|
||||||
jar=MusicPlayer.jar
|
jar=MusicPlayer.jar
|
||||||
jarhash=8e0220165a235b16f99bc93d40135a92f126a574f2ab306520fc811ebbddb85d
|
jarhash=9991cb83bfaf8b110a92dcc7565f057e0959025e24f02502fb8e61fe2086ead7
|
||||||
dependency=basegame 0.4.0
|
dependency=basegame 0.4.0
|
||||||
|
|||||||
@@ -87,12 +87,12 @@ class ModOptionsHost(val remoCon: UIRemoCon) : UICanvas() {
|
|||||||
ControlPanelCommon.register(this, width, "basegame.modcontrolpanel.$modname", modOptions)
|
ControlPanelCommon.register(this, width, "basegame.modcontrolpanel.$modname", modOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
deferred(); deferred = {}
|
deferred(); deferred = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
try {
|
try {
|
||||||
// the actual control panel
|
// the actual control panel
|
||||||
ControlPanelCommon.render("basegame.modcontrolpanel.$currentlySelectedModule", width, batch)
|
ControlPanelCommon.render("basegame.modcontrolpanel.$currentlySelectedModule", width, batch)
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import net.torvald.terrarum.gamecontroller.KeyToggler
|
|||||||
import net.torvald.terrarum.savegame.toHex
|
import net.torvald.terrarum.savegame.toHex
|
||||||
import net.torvald.terrarum.ui.BasicDebugInfoWindow
|
import net.torvald.terrarum.ui.BasicDebugInfoWindow
|
||||||
import net.torvald.terrarum.ui.Toolkit
|
import net.torvald.terrarum.ui.Toolkit
|
||||||
import net.torvald.terrarum.weather.WeatherMixer
|
|
||||||
import net.torvald.unsafe.UnsafeHelper
|
import net.torvald.unsafe.UnsafeHelper
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -159,7 +158,7 @@ object TerrarumPostProcessor : Disposable {
|
|||||||
|
|
||||||
if (KeyToggler.isOn(Input.Keys.F3)) {
|
if (KeyToggler.isOn(Input.Keys.F3)) {
|
||||||
if (!debugUI.isOpened && !debugUI.isOpening) debugUI.setAsOpen()
|
if (!debugUI.isOpened && !debugUI.isOpening) debugUI.setAsOpen()
|
||||||
batch.inUse { debugUI.renderUI(frameDelta, batch, camera) }
|
batch.inUse { debugUI.renderImpl(frameDelta, batch, camera) }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!debugUI.isClosed && !debugUI.isClosing) debugUI.setAsClose()
|
if (!debugUI.isClosed && !debugUI.isClosing) debugUI.setAsClose()
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ class UIFakeGradOverlay : UICanvas() {
|
|||||||
setAsAlwaysVisible()
|
setAsAlwaysVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {}
|
override fun updateImpl(delta: Float) {}
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.end()
|
batch.end()
|
||||||
val dither = App.getConfigBoolean("fx_dither")
|
val dither = App.getConfigBoolean("fx_dither")
|
||||||
|
|
||||||
@@ -90,8 +90,8 @@ class UIFakeBlurOverlay(val blurRadius: Float, val nodarken: Boolean) : UICanvas
|
|||||||
private val darkeningVarCol = Color(255)
|
private val darkeningVarCol = Color(255)
|
||||||
private val batchDrawCol = Color(-1)
|
private val batchDrawCol = Color(-1)
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {}
|
override fun updateImpl(delta: Float) {}
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batchDrawCol.a = openness
|
batchDrawCol.a = openness
|
||||||
batch.color = batchDrawCol
|
batch.color = batchDrawCol
|
||||||
if (App.getConfigBoolean("fx_backgroundblur")) {
|
if (App.getConfigBoolean("fx_backgroundblur")) {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ abstract class Actor : Comparable<Actor>, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun updateImpl(delta: Float) {}
|
abstract fun updateImpl(delta: Float)
|
||||||
|
|
||||||
var actorValue = ActorValue(this)
|
var actorValue = ActorValue(this)
|
||||||
@Volatile var flagDespawn = false
|
@Volatile var flagDespawn = false
|
||||||
|
|||||||
@@ -79,12 +79,12 @@ class UIBuildingMakerGetFilename : UICanvas() {
|
|||||||
addUIitem(buttonCancel)
|
addUIitem(buttonCancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
blendNormalStraightAlpha(batch)
|
blendNormalStraightAlpha(batch)
|
||||||
|
|
||||||
// draw border
|
// draw border
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class Noticelet : UICanvas() {
|
|||||||
setAsAlwaysVisible()
|
setAsAlwaysVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
// update timer and animation
|
// update timer and animation
|
||||||
messageQueue.forEach {
|
messageQueue.forEach {
|
||||||
it.akku += delta
|
it.akku += delta
|
||||||
@@ -75,7 +75,7 @@ class Noticelet : UICanvas() {
|
|||||||
|
|
||||||
private var ypos = 1f // 1: bottom, -1: top
|
private var ypos = 1f // 1: bottom, -1: top
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
val px = Toolkit.drawWidthf
|
val px = Toolkit.drawWidthf
|
||||||
val py = App.scr.halfhf + awayFromCentre * ypos - (if (ypos < 0) h else 0f)
|
val py = App.scr.halfhf + awayFromCentre * ypos - (if (ypos < 0) h else 0f)
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class Notification : UICanvas() {
|
|||||||
handler.alwaysUpdate = true
|
handler.alwaysUpdate = true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (messageDisplaying == null && messageQueue.notEmpty() && handler.isClosed) {
|
if (messageDisplaying == null && messageQueue.notEmpty() && handler.isClosed) {
|
||||||
messageDisplaying = messageQueue.removeFirst()
|
messageDisplaying = messageQueue.removeFirst()
|
||||||
displayTimer = 0f
|
displayTimer = 0f
|
||||||
@@ -66,7 +66,7 @@ class Notification : UICanvas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
blendNormalStraightAlpha(batch)
|
blendNormalStraightAlpha(batch)
|
||||||
fontCol.a = handler.opacity * OPACITY
|
fontCol.a = handler.opacity * OPACITY
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ object NullUI : UICanvas() {
|
|||||||
override var height: Int = 0
|
override var height: Int = 0
|
||||||
override var openCloseTime = 0f
|
override var openCloseTime = 0f
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun doOpening(delta: Float) {
|
override fun doOpening(delta: Float) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class UIBasicInfo() : UICanvas() {
|
|||||||
private val TEMP_KELVIN = 0
|
private val TEMP_KELVIN = 0
|
||||||
private val TEMP_CELCIUS = 1
|
private val TEMP_CELCIUS = 1
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (ELon) {
|
if (ELon) {
|
||||||
ELuptimer += delta
|
ELuptimer += delta
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ class UIBasicInfo() : UICanvas() {
|
|||||||
|
|
||||||
private val lcdLitCol: Color = lcdLitColELoff
|
private val lcdLitCol: Color = lcdLitColELoff
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.color = drawCol
|
batch.color = drawCol
|
||||||
batch.draw(atlas.get(0, 0), 0f, 0f)
|
batch.draw(atlas.get(0, 0), 0f, 0f)
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class UIBuildingMakerBlockChooser(val parent: BuildingMaker): UICanvas() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (!scrollBar.mouseUp) currentPalette.forEach { it.update(delta) }
|
if (!scrollBar.mouseUp) currentPalette.forEach { it.update(delta) }
|
||||||
tabs.update(delta)
|
tabs.update(delta)
|
||||||
closeButton.update(delta)
|
closeButton.update(delta)
|
||||||
@@ -166,7 +166,7 @@ class UIBuildingMakerBlockChooser(val parent: BuildingMaker): UICanvas() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
blendNormalStraightAlpha(batch)
|
blendNormalStraightAlpha(batch)
|
||||||
|
|
||||||
// border
|
// border
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
mouseVec.x = relativeMouseX.toDouble()
|
mouseVec.x = relativeMouseX.toDouble()
|
||||||
mouseVec.y = relativeMouseY.toDouble()
|
mouseVec.y = relativeMouseY.toDouble()
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
|
|||||||
parent.tappedOnUI = true
|
parent.tappedOnUI = true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// draw back
|
// draw back
|
||||||
batch.color = backCol
|
batch.color = backCol
|
||||||
Toolkit.fillCircle(batch,0, 0, SIZE, SIZE)
|
Toolkit.fillCircle(batch,0, 0, SIZE, SIZE)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class UIBuildingMakerToolbox : UICanvas() {
|
|||||||
tools[selectedTool].highlighted = true
|
tools[selectedTool].highlighted = true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
tools.forEachIndexed { counter, it ->
|
tools.forEachIndexed { counter, it ->
|
||||||
it.update(delta)
|
it.update(delta)
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ class UIBuildingMakerToolbox : UICanvas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
tools.forEach { it.render(frameDelta, batch, camera) }
|
tools.forEach { it.render(frameDelta, batch, camera) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class UICheatDetected : UICanvas() {
|
|||||||
|
|
||||||
private val backgroundCol = Color(0x00000080)
|
private val backgroundCol = Color(0x00000080)
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
Terrarum.ingame?.consoleHandler?.setAsClose()
|
Terrarum.ingame?.consoleHandler?.setAsClose()
|
||||||
Terrarum.ingame?.consoleHandler?.isVisible = false
|
Terrarum.ingame?.consoleHandler?.isVisible = false
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ class UICheatDetected : UICanvas() {
|
|||||||
App.fontGame.draw(batch, txt, width.minus(txtW).ushr(1).toFloat(), height.minus(txtH).ushr(1).toFloat())
|
App.fontGame.draw(batch, txt, width.minus(txtW).ushr(1).toFloat(), height.minus(txtH).ushr(1).toFloat())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
INGAME.pause()
|
INGAME.pause()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -408,14 +408,14 @@ class UICrafting(val full: UIInventoryFull?) : UICanvas(
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
// NO super.update due to an infinite recursion
|
// NO super.update due to an infinite recursion
|
||||||
this.uiItems.forEach { it.update(delta) }
|
this.uiItems.forEach { it.update(delta) }
|
||||||
|
|
||||||
if (openingClickLatched && !Terrarum.mouseDown) openingClickLatched = false
|
if (openingClickLatched && !Terrarum.mouseDown) openingClickLatched = false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// NO super.render due to an infinite recursion
|
// NO super.render due to an infinite recursion
|
||||||
this.uiItems.forEach { it.render(frameDelta, batch, camera) }
|
this.uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||||
|
|
||||||
|
|||||||
@@ -46,11 +46,11 @@ class UIGraphicsControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
|||||||
|
|
||||||
override var height = ControlPanelCommon.getMenuHeight("basegame.graphicscontrolpanel")
|
override var height = ControlPanelCommon.getMenuHeight("basegame.graphicscontrolpanel")
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
ControlPanelCommon.render("basegame.graphicscontrolpanel", width, batch)
|
ControlPanelCommon.render("basegame.graphicscontrolpanel", width, batch)
|
||||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ class UIIMEConfig(remoCon: UIRemoCon?) : UICanvas() {
|
|||||||
addUIitem(imeSelection)
|
addUIitem(imeSelection)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
keyboardTestPanel.mouseoverUpdateLatch =
|
keyboardTestPanel.mouseoverUpdateLatch =
|
||||||
(!keyboardLayoutSelection.paletteShowing &&
|
(!keyboardLayoutSelection.paletteShowing &&
|
||||||
!imeSelection.paletteShowing)
|
!imeSelection.paletteShowing)
|
||||||
@@ -173,7 +173,7 @@ class UIIMEConfig(remoCon: UIRemoCon?) : UICanvas() {
|
|||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
|
|
||||||
val txt1 = Lang["MENU_LABEL_KEYBOARD_LAYOUT"]; val tw1 = App.fontGame.getWidth(txt1)
|
val txt1 = Lang["MENU_LABEL_KEYBOARD_LAYOUT"]; val tw1 = App.fontGame.getWidth(txt1)
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class UIImportAvatar(val remoCon: UIRemoCon) : Advanceable() {
|
|||||||
private var mouseOnLink = false
|
private var mouseOnLink = false
|
||||||
private var pathW = 0
|
private var pathW = 0
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
|
|
||||||
pathW = App.fontGame.getWidth(App.importDir)
|
pathW = App.fontGame.getWidth(App.importDir)
|
||||||
@@ -113,7 +113,7 @@ class UIImportAvatar(val remoCon: UIRemoCon) : Advanceable() {
|
|||||||
}
|
}
|
||||||
private lateinit var wotKeys: List<String>
|
private lateinit var wotKeys: List<String>
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
val textboxWidth = wotKeys.maxOf { App.fontGame.getWidth(it) }
|
val textboxWidth = wotKeys.maxOf { App.fontGame.getWidth(it) }
|
||||||
val textX = (Toolkit.drawWidth - textboxWidth) / 2
|
val textX = (Toolkit.drawWidth - textboxWidth) / 2
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ internal class UIInventoryCells(
|
|||||||
itemList.rebuild(full.catBar.catIconsMeaning[newcat]) // have to manually rebuild, too!
|
itemList.rebuild(full.catBar.catIconsMeaning[newcat]) // have to manually rebuild, too!
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
itemList.update(delta)
|
itemList.update(delta)
|
||||||
equipped.update(delta)
|
equipped.update(delta)
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ internal class UIInventoryCells(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
//itemList.posX = itemList.initialX + inventoryScrOffX.roundToInt()
|
//itemList.posX = itemList.initialX + inventoryScrOffX.roundToInt()
|
||||||
itemList.render(frameDelta, batch, camera)
|
itemList.render(frameDelta, batch, camera)
|
||||||
//equipped.posX = equipped.initialX + inventoryScrOffX.roundToInt()
|
//equipped.posX = equipped.initialX + inventoryScrOffX.roundToInt()
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
val yeet = screens[screen]
|
val yeet = screens[screen]
|
||||||
if (oldScreen != screen) {
|
if (oldScreen != screen) {
|
||||||
val yeOlde = screens[oldScreen]
|
val yeOlde = screens[oldScreen]
|
||||||
@@ -336,7 +336,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
|||||||
yeet.update(delta)
|
yeet.update(delta)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
blendNormalStraightAlpha(batch)
|
blendNormalStraightAlpha(batch)
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
screenRenders[screen](frameDelta, batch, camera)
|
screenRenders[screen](frameDelta, batch, camera)
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ class UIInventoryFull(
|
|||||||
internal var offsetY = ((App.scr.height - internalHeight) / 2).toFloat()
|
internal var offsetY = ((App.scr.height - internalHeight) / 2).toFloat()
|
||||||
private set
|
private set
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (handler.openFired) {
|
if (handler.openFired) {
|
||||||
rebuildList()
|
rebuildList()
|
||||||
}
|
}
|
||||||
@@ -351,7 +351,7 @@ class UIInventoryFull(
|
|||||||
//private val gradHeight = 48f
|
//private val gradHeight = 48f
|
||||||
|
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
|
|
||||||
drawBackground(batch, 1f)
|
drawBackground(batch, 1f)
|
||||||
|
|
||||||
|
|||||||
@@ -59,13 +59,13 @@ class UIInventoryMinimap(val full: UIInventoryFull) : UICanvas() {
|
|||||||
private var oldPanX = minimapPanX
|
private var oldPanX = minimapPanX
|
||||||
private var oldPanY = minimapPanY
|
private var oldPanY = minimapPanY
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
MinimapComposer.setWorld(INGAME.world)
|
MinimapComposer.setWorld(INGAME.world)
|
||||||
// MinimapComposer.update()
|
// MinimapComposer.update()
|
||||||
minimapRerenderTimer += Gdx.graphics.deltaTime
|
minimapRerenderTimer += Gdx.graphics.deltaTime
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
blendNormalStraightAlpha(batch)
|
blendNormalStraightAlpha(batch)
|
||||||
val cellOffY = INVENTORY_CELLS_OFFSET_Y()
|
val cellOffY = INVENTORY_CELLS_OFFSET_Y()
|
||||||
val worldWidth = INGAME.world.width
|
val worldWidth = INGAME.world.width
|
||||||
|
|||||||
@@ -87,13 +87,13 @@ class UIJukebox : UICanvas(
|
|||||||
transitionPanel.hide()
|
transitionPanel.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
|
|
||||||
if (openingClickLatched && !Terrarum.mouseDown) openingClickLatched = false
|
if (openingClickLatched && !Terrarum.mouseDown) openingClickLatched = false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
UIInventoryFull.drawBackground(batch, 1f)
|
UIInventoryFull.drawBackground(batch, 1f)
|
||||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||||
|
|
||||||
|
|||||||
@@ -110,11 +110,11 @@ class UIJukeboxInventory(val parent: UIJukebox) : UICanvas() {
|
|||||||
rebuild()
|
rebuild()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||||
|
|
||||||
// chest name text
|
// chest name text
|
||||||
@@ -212,11 +212,11 @@ class UIJukeboxSonglistPanel(val parent: UIJukebox) : UICanvas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ class UIKeyboardControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
|||||||
}
|
}
|
||||||
internal var controlSelected = -1
|
internal var controlSelected = -1
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach {
|
uiItems.forEach {
|
||||||
it.update(delta)
|
it.update(delta)
|
||||||
if (it is UIItemKeycap && it.mousePushed && ControlPresets.presetLabels[presetSelector.selection] == "Custom") {
|
if (it is UIItemKeycap && it.mousePushed && ControlPresets.presetLabels[presetSelector.selection] == "Custom") {
|
||||||
@@ -206,7 +206,7 @@ class UIKeyboardControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
|||||||
controlPalette.update(delta)
|
controlPalette.update(delta)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// batch.color = borderNormal
|
// batch.color = borderNormal
|
||||||
// Toolkit.drawBoxBorder(batch, drawX, drawY, width, height)
|
// Toolkit.drawBoxBorder(batch, drawX, drawY, width, height)
|
||||||
// batch.color = fillCol
|
// batch.color = fillCol
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : Advanceable() {
|
|||||||
remoCon.setNewRemoConContents(menus[mode])
|
remoCon.setNewRemoConContents(menus[mode])
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
|
|
||||||
if (mode < 2) {
|
if (mode < 2) {
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : Advanceable() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
|
|
||||||
if (mode == 2) {
|
if (mode == 2) {
|
||||||
loadFired += 1
|
loadFired += 1
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class UILoadList(val full: UILoadSavegame) : UICanvas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (scrollTarget != listScroll) {
|
if (scrollTarget != listScroll) {
|
||||||
if (scrollAnimCounter < scrollAnimLen) {
|
if (scrollAnimCounter < scrollAnimLen) {
|
||||||
scrollAnimCounter += delta
|
scrollAnimCounter += delta
|
||||||
@@ -171,7 +171,7 @@ class UILoadList(val full: UILoadSavegame) : UICanvas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.end()
|
batch.end()
|
||||||
|
|
||||||
val cells = playerCells
|
val cells = playerCells
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
|||||||
totalTBH64 = maxOf(loadOrderPlayer.size, loadOrderWorld.size) * App.fontGame.lineHeight.toInt()
|
totalTBH64 = maxOf(loadOrderPlayer.size, loadOrderWorld.size) * App.fontGame.lineHeight.toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
altDown = Gdx.input.isKeyPressed(Keys.ALT_LEFT) || Gdx.input.isKeyPressed(Keys.ALT_RIGHT)
|
altDown = Gdx.input.isKeyPressed(Keys.ALT_LEFT) || Gdx.input.isKeyPressed(Keys.ALT_RIGHT)
|
||||||
|
|
||||||
when (mode) {
|
when (mode) {
|
||||||
@@ -344,7 +344,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
|||||||
|
|
||||||
private val icons = CommonResourcePool.getAsTextureRegionPack("inventory_category")
|
private val icons = CommonResourcePool.getAsTextureRegionPack("inventory_category")
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
if (mode != MODE_SHOW_LOAD_ORDER) {
|
if (mode != MODE_SHOW_LOAD_ORDER) {
|
||||||
val buttonYdelta = (full.titleTopGradEnd) - full.playerButtonSelected!!.posY
|
val buttonYdelta = (full.titleTopGradEnd) - full.playerButtonSelected!!.posY
|
||||||
full.playerButtonSelected!!.render(frameDelta, batch, camera, 0, buttonYdelta)
|
full.playerButtonSelected!!.render(frameDelta, batch, camera, 0, buttonYdelta)
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ class UILoadNewCharacter(val full: UILoadSavegame) : UICanvas() {
|
|||||||
override var width: Int = Toolkit.drawWidth
|
override var width: Int = Toolkit.drawWidth
|
||||||
override var height: Int = App.scr.height
|
override var height: Int = App.scr.height
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -143,11 +143,11 @@ class UILoadSavegame(val remoCon: UIRemoCon) : Advanceable() {
|
|||||||
transitionPanel.hide()
|
transitionPanel.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
transitionPanel.update(delta)
|
transitionPanel.update(delta)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
transitionPanel.render(frameDelta, batch, camera)
|
transitionPanel.render(frameDelta, batch, camera)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class UINewCharacter(val remoCon: UIRemoCon) : UICanvas() {
|
|||||||
addUIitem(backButton)
|
addUIitem(backButton)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (!uiLocked) {
|
if (!uiLocked) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,7 @@ class UINewCharacter(val remoCon: UIRemoCon) : UICanvas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
// ui title
|
// ui title
|
||||||
// val titlestr = Lang["CONTEXT_WORLD_NEW"]
|
// val titlestr = Lang["CONTEXT_WORLD_NEW"]
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
|
|||||||
importReturnCode = 0
|
importReturnCode = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (uiItemsChangeRequest != null) {
|
if (uiItemsChangeRequest != null) {
|
||||||
uiItemsChangeRequest!!()
|
uiItemsChangeRequest!!()
|
||||||
uiItemsChangeRequest = null
|
uiItemsChangeRequest = null
|
||||||
@@ -263,7 +263,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
|
|||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
// ui title
|
// ui title
|
||||||
// val titlestr = Lang["CONTEXT_WORLD_NEW"]
|
// val titlestr = Lang["CONTEXT_WORLD_NEW"]
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class UIPaletteSelector(val parent: BuildingMaker) : UICanvas() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// draw title bar
|
// draw title bar
|
||||||
batch.color = UINSMenu.DEFAULT_TITLEBACKCOL
|
batch.color = UINSMenu.DEFAULT_TITLEBACKCOL
|
||||||
blendNormalStraightAlpha(batch)
|
blendNormalStraightAlpha(batch)
|
||||||
@@ -96,7 +96,7 @@ class UIPaletteSelector(val parent: BuildingMaker) : UICanvas() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ class UIPerformanceControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
|||||||
|
|
||||||
override var height = ControlPanelCommon.getMenuHeight("basegame.performancecontrolpanel")
|
override var height = ControlPanelCommon.getMenuHeight("basegame.performancecontrolpanel")
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
ControlPanelCommon.render("basegame.performancecontrolpanel", width, batch)
|
ControlPanelCommon.render("basegame.performancecontrolpanel", width, batch)
|
||||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ class UIProxyLoadLatestSave(val remoCon: UIRemoCon) : UICanvas() {
|
|||||||
override var height: Int = 0
|
override var height: Int = 0
|
||||||
override var openCloseTime: Second = 0f
|
override var openCloseTime: Second = 0f
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun doOpening(delta: Float) {
|
override fun doOpening(delta: Float) {
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ class UIProxyNewBuildingMaker(val remoCon: UIRemoCon) : UICanvas() {
|
|||||||
override var height: Int = 0
|
override var height: Int = 0
|
||||||
override var openCloseTime: Second = 0f
|
override var openCloseTime: Second = 0f
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun doOpening(delta: Float) {
|
override fun doOpening(delta: Float) {
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ class UIProxyNewRandomGame(val remoCon: UIRemoCon) : UICanvas() {
|
|||||||
override var height: Int = 0
|
override var height: Int = 0
|
||||||
override var openCloseTime: Second = 0f
|
override var openCloseTime: Second = 0f
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun doOpening(delta: Float) {
|
override fun doOpening(delta: Float) {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class UIQuickslotBar : UICanvas() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
val newSelection = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.actorValue?.getAsInt(AVKey.__PLAYER_QUICKSLOTSEL) ?: 0
|
val newSelection = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.actorValue?.getAsInt(AVKey.__PLAYER_QUICKSLOTSEL) ?: 0
|
||||||
|
|
||||||
if (selection != newSelection) {
|
if (selection != newSelection) {
|
||||||
@@ -87,7 +87,7 @@ class UIQuickslotBar : UICanvas() {
|
|||||||
|
|
||||||
private val itemCntTextCol = Color(0x404040ff)
|
private val itemCntTextCol = Color(0x404040ff)
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
|
|
||||||
(Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.let { actor ->
|
(Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.let { actor ->
|
||||||
for (i in 0 until SLOT_COUNT) {
|
for (i in 0 until SLOT_COUNT) {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class UIQuickslotPie : UICanvas() {
|
|||||||
|
|
||||||
var selection: Int = -1
|
var selection: Int = -1
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (selection >= 0 && (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying != null)
|
if (selection >= 0 && (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying != null)
|
||||||
(Terrarum.ingame!! as TerrarumIngame).actorNowPlaying!!.actorValue[AVKey.__PLAYER_QUICKSLOTSEL] =
|
(Terrarum.ingame!! as TerrarumIngame).actorNowPlaying!!.actorValue[AVKey.__PLAYER_QUICKSLOTSEL] =
|
||||||
selection % slotCount
|
selection % slotCount
|
||||||
@@ -69,7 +69,7 @@ class UIQuickslotPie : UICanvas() {
|
|||||||
|
|
||||||
private val drawColor = Color(1f, 1f, 1f, 1f)
|
private val drawColor = Color(1f, 1f, 1f, 1f)
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// draw radial thingies
|
// draw radial thingies
|
||||||
for (i in 0 until slotCount) {
|
for (i in 0 until slotCount) {
|
||||||
val qs = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.inventory?.getQuickslotItem(i)
|
val qs = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.inventory?.getQuickslotItem(i)
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ open class UIRemoCon(val parent: TitleScreen, val treeRoot: QNDTreeNode<String>)
|
|||||||
private var oldSelectedItem: UIItemTextButton? = null
|
private var oldSelectedItem: UIItemTextButton? = null
|
||||||
private var openUI: UICanvas? = null
|
private var openUI: UICanvas? = null
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (mouseActionAvailable) {
|
if (mouseActionAvailable) {
|
||||||
mouseActionAvailable = false
|
mouseActionAvailable = false
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ open class UIRemoCon(val parent: TitleScreen, val treeRoot: QNDTreeNode<String>)
|
|||||||
openUI = external
|
openUI = external
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
remoConTray.render(frameDelta, batch, camera)
|
remoConTray.render(frameDelta, batch, camera)
|
||||||
openUI?.render(frameDelta, batch, camera)
|
openUI?.render(frameDelta, batch, camera)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ class UIScreenZoom : UICanvas(
|
|||||||
private val zoomMin = 1f
|
private val zoomMin = 1f
|
||||||
private val zoomMax = 2f
|
private val zoomMax = 2f
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
|
|
||||||
val offX = (App.scr.tvSafeGraphicsWidth * 1.25f).roundToInt().toFloat()
|
val offX = (App.scr.tvSafeGraphicsWidth * 1.25f).roundToInt().toFloat()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class UIShare : UICanvas() {
|
|||||||
private val drawX = (Toolkit.drawWidth - width) / 2
|
private val drawX = (Toolkit.drawWidth - width) / 2
|
||||||
private val drawY = (App.scr.height - height) / 2
|
private val drawY = (App.scr.height - height) / 2
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ class UIShare : UICanvas() {
|
|||||||
|
|
||||||
private lateinit var wotKeys: List<String>
|
private lateinit var wotKeys: List<String>
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
|
|
||||||
val textY = drawY + (height/2) - App.fontGame.lineHeight.toInt() * 4 - 2
|
val textY = drawY + (height/2) - App.fontGame.lineHeight.toInt() * 4 - 2
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ class UISmelterBasic(val smelter: FixtureSmelterBasic) : UICanvas(
|
|||||||
INGAME.setTooltipMessage(null)
|
INGAME.setTooltipMessage(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
|
|
||||||
oreItemSlot.item = ItemCodex[smelter.oreItem?.itm]
|
oreItemSlot.item = ItemCodex[smelter.oreItem?.itm]
|
||||||
@@ -502,7 +502,7 @@ class UISmelterBasic(val smelter: FixtureSmelterBasic) : UICanvas(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.color = backdropColour
|
batch.color = backdropColour
|
||||||
// batch.draw(smelterBackdrops.get(1,0), backdropX, backdropY, smelterBackdrops.tileW * 6f, smelterBackdrops.tileH * 6f)
|
// batch.draw(smelterBackdrops.get(1,0), backdropX, backdropY, smelterBackdrops.tileW * 6f, smelterBackdrops.tileH * 6f)
|
||||||
// batch.color = backdropColour mul Color(1f, 1f, 1f, smelter.temperature)
|
// batch.color = backdropColour mul Color(1f, 1f, 1f, smelter.temperature)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class UISoundControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
|||||||
|
|
||||||
private var oldBufferSize = App.getConfigInt("audio_buffer_size")
|
private var oldBufferSize = App.getConfigInt("audio_buffer_size")
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
|
|
||||||
App.getConfigInt("audio_buffer_size").let {
|
App.getConfigInt("audio_buffer_size").let {
|
||||||
@@ -55,7 +55,7 @@ class UISoundControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// undo sound fadeout/muting when this panel is opened
|
// undo sound fadeout/muting when this panel is opened
|
||||||
if (handler.openCloseCounter == 0f && App.audioMixer.fadeBus.getFilter<Lowpass>().cutoff < SAMPLING_RATE / 2) {
|
if (handler.openCloseCounter == 0f && App.audioMixer.fadeBus.getFilter<Lowpass>().cutoff < SAMPLING_RATE / 2) {
|
||||||
App.audioMixer.requestLowpassOut(0.25)
|
App.audioMixer.requestLowpassOut(0.25)
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ internal class UIStorageChest : UICanvas(
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
catBar.update(delta)
|
catBar.update(delta)
|
||||||
itemListChest.update(delta)
|
itemListChest.update(delta)
|
||||||
itemListPlayer.update(delta)
|
itemListPlayer.update(delta)
|
||||||
@@ -265,7 +265,7 @@ internal class UIStorageChest : UICanvas(
|
|||||||
else
|
else
|
||||||
"${App.gamepadLabelStart} ${Lang["GAME_ACTION_CLOSE"]}"
|
"${App.gamepadLabelStart} ${Lang["GAME_ACTION_CLOSE"]}"
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// background fill
|
// background fill
|
||||||
UIInventoryFull.drawBackground(batch, 1f)
|
UIInventoryFull.drawBackground(batch, 1f)
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class UITitleLanguage(remoCon: UIRemoCon?) : UICanvas() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (initialMouseBlock && !Terrarum.mouseDown) {
|
if (initialMouseBlock && !Terrarum.mouseDown) {
|
||||||
initialMouseBlock = false
|
initialMouseBlock = false
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ class UITitleLanguage(remoCon: UIRemoCon?) : UICanvas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
|
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
textArea1.render(frameDelta, batch, camera)
|
textArea1.render(frameDelta, batch, camera)
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() {
|
|||||||
catch (e: UninitializedPropertyAccessException) {}
|
catch (e: UninitializedPropertyAccessException) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (scrollTarget != listScroll) {
|
if (scrollTarget != listScroll) {
|
||||||
if (scrollAnimCounter < scrollAnimLen) {
|
if (scrollAnimCounter < scrollAnimLen) {
|
||||||
scrollAnimCounter += delta
|
scrollAnimCounter += delta
|
||||||
@@ -138,7 +138,7 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() {
|
|||||||
moduleCells.clear()
|
moduleCells.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.end()
|
batch.end()
|
||||||
|
|
||||||
lateinit var savePixmap: Pixmap
|
lateinit var savePixmap: Pixmap
|
||||||
|
|||||||
@@ -44,12 +44,12 @@ open class UITitleWallOfText(private val text: List<String>) : UICanvas() {
|
|||||||
init {
|
init {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
textArea.update(delta)
|
textArea.update(delta)
|
||||||
scrollbar?.update(delta)
|
scrollbar?.update(delta)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
textArea.render(frameDelta, batch, camera)
|
textArea.render(frameDelta, batch, camera)
|
||||||
scrollbar?.render(frameDelta, batch, camera)
|
scrollbar?.render(frameDelta, batch, camera)
|
||||||
@@ -116,11 +116,11 @@ class UISystemInfo(val remoCon: UIRemoCon) : UICanvas() {
|
|||||||
tb2x = tb1x + tb1w + gap
|
tb2x = tb1x + tb1w + gap
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uptime = App.getTIME_T() - App.startupTime
|
uptime = App.getTIME_T() - App.startupTime
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
var i = 0
|
var i = 0
|
||||||
|
|
||||||
v.forEach { (k, v0) ->
|
v.forEach { (k, v0) ->
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class UITooltip : UICanvas() {
|
|||||||
set(value) { throw Error("You are not supposed to set the height of the tooltip manually.") }
|
set(value) { throw Error("You are not supposed to set the height of the tooltip manually.") }
|
||||||
|
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
val mouseXoff = 28f
|
val mouseXoff = 28f
|
||||||
val mouseYoff = 0f
|
val mouseYoff = 0f
|
||||||
val txtW = msgWidth + 2f * textMarginX
|
val txtW = msgWidth + 2f * textMarginX
|
||||||
@@ -102,7 +102,7 @@ class UITooltip : UICanvas() {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
setPosition(Terrarum.mouseScreenX, Terrarum.mouseScreenY)
|
setPosition(Terrarum.mouseScreenX, Terrarum.mouseScreenY)
|
||||||
|
|
||||||
if (isVisible && tooltipShowing.values.all { !it }) {
|
if (isVisible && tooltipShowing.values.all { !it }) {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class UIVitalMetre(
|
|||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
handler.setPosition(
|
handler.setPosition(
|
||||||
App.scr.halfw,
|
App.scr.halfw,
|
||||||
App.scr.halfh
|
App.scr.halfh
|
||||||
@@ -63,7 +63,7 @@ class UIVitalMetre(
|
|||||||
/**
|
/**
|
||||||
* g must be same as World Graphics!
|
* g must be same as World Graphics!
|
||||||
*/
|
*/
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// TODO now that we just can't draw arcs, we need to re-think about this
|
// TODO now that we just can't draw arcs, we need to re-think about this
|
||||||
|
|
||||||
/*if (vitalGetterVal() != null && vitalGetterMax() != null && player != null) {
|
/*if (vitalGetterVal() != null && vitalGetterMax() != null && player != null) {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class UIWallCalendar : UICanvas(
|
|||||||
private var mouseOverCell = -1
|
private var mouseOverCell = -1
|
||||||
private var mouseOverSeason = -1
|
private var mouseOverSeason = -1
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
mouseOverCell = if (relativeMouseX in drawStartX until drawStartX + 8 * (cellWidth + 1) &&
|
mouseOverCell = if (relativeMouseX in drawStartX until drawStartX + 8 * (cellWidth + 1) &&
|
||||||
relativeMouseY in cellsStartY - 1 until cellsStartY - 1 + 17 * (cellHeight + 3)) {
|
relativeMouseY in cellsStartY - 1 until cellsStartY - 1 + 17 * (cellHeight + 3)) {
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ class UIWallCalendar : UICanvas(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
UIInventoryFull.drawBackground(batch, 1f)
|
UIInventoryFull.drawBackground(batch, 1f)
|
||||||
|
|
||||||
val thisYear = INGAME.world.worldTime.years
|
val thisYear = INGAME.world.worldTime.years
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class UIWatchLargeAnalogue() : UICanvas() {
|
|||||||
|
|
||||||
private val TWO_PI = 2.0 * Math.PI
|
private val TWO_PI = 2.0 * Math.PI
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
TerrarumIngame.setCameraPosition(batch, App.shapeRender, camera, posX.toFloat(), posY.toFloat())
|
TerrarumIngame.setCameraPosition(batch, App.shapeRender, camera, posX.toFloat(), posY.toFloat())
|
||||||
|
|
||||||
val day = INGAME.world.worldTime.calendarDay - 1
|
val day = INGAME.world.worldTime.calendarDay - 1
|
||||||
@@ -101,7 +101,7 @@ class UIWatchLargeAnalogue() : UICanvas() {
|
|||||||
batch.draw(dialPin, moondialOffX - 1, moondialOffY - 1)
|
batch.draw(dialPin, moondialOffX - 1, moondialOffY - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun dispose() {
|
override fun dispose() {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class UIWatchLargeDigital() : UICanvas() {
|
|||||||
get() = INGAME.world.worldTime
|
get() = INGAME.world.worldTime
|
||||||
|
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
if (ELon) {
|
if (ELon) {
|
||||||
ELuptimer += delta
|
ELuptimer += delta
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ class UIWatchLargeDigital() : UICanvas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// disabling light button
|
// disabling light button
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
batch.draw(watchface, -1f, -1f)
|
batch.draw(watchface, -1f, -1f)
|
||||||
|
|||||||
@@ -116,11 +116,11 @@ class UIWorldPortal : UICanvas(
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
transitionPanel.update(delta)
|
transitionPanel.update(delta)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
drawBackground(batch, 1f)
|
drawBackground(batch, 1f)
|
||||||
|
|
||||||
// UI items
|
// UI items
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ class UIWorldPortalCargo(val full: UIWorldPortal) : UICanvas(), HasInventory {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
catBar.update(delta)
|
catBar.update(delta)
|
||||||
itemListChest.update(delta)
|
itemListChest.update(delta)
|
||||||
itemListPlayer.update(delta)
|
itemListPlayer.update(delta)
|
||||||
@@ -201,7 +201,7 @@ class UIWorldPortalCargo(val full: UIWorldPortal) : UICanvas(), HasInventory {
|
|||||||
else
|
else
|
||||||
"${App.gamepadLabelStart} ${Lang["GAME_ACTION_CLOSE"]} "
|
"${App.gamepadLabelStart} ${Lang["GAME_ACTION_CLOSE"]} "
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// background fill
|
// background fill
|
||||||
UIInventoryFull.drawBackground(batch, 1f)
|
UIInventoryFull.drawBackground(batch, 1f)
|
||||||
|
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ class UIWorldPortalDelete(private val full: UIWorldPortal) : UICanvas() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
full.selectedButton?.let {
|
full.selectedButton?.let {
|
||||||
val buttonYdelta = (App.scr.tvSafeGraphicsHeight + 172 + 36) - it.posY
|
val buttonYdelta = (App.scr.tvSafeGraphicsHeight + 172 + 36) - it.posY
|
||||||
val buttonXdelta = (Toolkit.drawWidth - it.width) / 2 - it.posX
|
val buttonXdelta = (Toolkit.drawWidth - it.width) / 2 - it.posX
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ class UIWorldPortalListing(val full: UIWorldPortal) : UICanvas() {
|
|||||||
else -> "CONTEXT_DESCRIPTION_HUGE"
|
else -> "CONTEXT_DESCRIPTION_HUGE"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
if (::worldCells.isInitialized) worldCells.forEach { it.update(delta) }
|
if (::worldCells.isInitialized) worldCells.forEach { it.update(delta) }
|
||||||
|
|
||||||
@@ -390,7 +390,7 @@ class UIWorldPortalListing(val full: UIWorldPortal) : UICanvas() {
|
|||||||
private var selectedWorldThumb: TextureRegion? = null
|
private var selectedWorldThumb: TextureRegion? = null
|
||||||
|
|
||||||
val icons = CommonResourcePool.getAsTextureRegionPack("terrarum-basegame-worldportalicons")
|
val icons = CommonResourcePool.getAsTextureRegionPack("terrarum-basegame-worldportalicons")
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
val memoryGaugeXpos = hx - memoryGaugeWidth - gridGap/2
|
val memoryGaugeXpos = hx - memoryGaugeWidth - gridGap/2
|
||||||
val memoryGaugeYpos = y + listHeight - buttonHeight
|
val memoryGaugeYpos = y + listHeight - buttonHeight
|
||||||
val textXpos = memoryGaugeXpos + 3
|
val textXpos = memoryGaugeXpos + 3
|
||||||
|
|||||||
@@ -58,13 +58,13 @@ class UIWorldPortalRename(private val full: UIWorldPortal) : UICanvas() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
private var oldPosX = full.posX
|
private var oldPosX = full.posX
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
val posXDelta = posX - oldPosX
|
val posXDelta = posX - oldPosX
|
||||||
|
|
||||||
// ugh why won't you just scroll along??
|
// ugh why won't you just scroll along??
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ class UIWorldPortalSearch(val full: UIWorldPortal) : UICanvas() {
|
|||||||
|
|
||||||
private var oldPosX = full.posX
|
private var oldPosX = full.posX
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ class UIWorldPortalSearch(val full: UIWorldPortal) : UICanvas() {
|
|||||||
val icons = CommonResourcePool.getAsTextureRegionPack("terrarum-basegame-worldportalicons")
|
val icons = CommonResourcePool.getAsTextureRegionPack("terrarum-basegame-worldportalicons")
|
||||||
|
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
val memoryGaugeXpos = hx - memoryGaugeWidth/2
|
val memoryGaugeXpos = hx - memoryGaugeWidth/2
|
||||||
val memoryGaugeYpos = drawY + sizeSelY + buttonHeight + 10
|
val memoryGaugeYpos = drawY + sizeSelY + buttonHeight + 10
|
||||||
val textXpos = memoryGaugeXpos + 3
|
val textXpos = memoryGaugeXpos + 3
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class UIWorldPortalShare(private val full: UIWorldPortal) : UICanvas() {
|
|||||||
addUIitem(backButton)
|
addUIitem(backButton)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ class UIWorldPortalShare(private val full: UIWorldPortal) : UICanvas() {
|
|||||||
|
|
||||||
private lateinit var wotKeys: List<String>
|
private lateinit var wotKeys: List<String>
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
|
|
||||||
val textY = drawY + (height/2) - App.fontGame.lineHeight.toInt() * 4 - 2
|
val textY = drawY + (height/2) - App.fontGame.lineHeight.toInt() * 4 - 2
|
||||||
|
|||||||
@@ -108,11 +108,11 @@ class UIWorldPortalUseInvitation(val full: UIWorldPortal) : UICanvas() {
|
|||||||
importReturnCode = 0
|
importReturnCode = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// error messages
|
// error messages
|
||||||
if (importReturnCode != 0) {
|
if (importReturnCode != 0) {
|
||||||
batch.color = Toolkit.Theme.COL_RED
|
batch.color = Toolkit.Theme.COL_RED
|
||||||
|
|||||||
@@ -118,11 +118,11 @@ class DummyTogglePane : UICanvas() {
|
|||||||
uiItems.add(textin)
|
uiItems.add(textin)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
uiItems.forEach { it.update(delta) }
|
uiItems.forEach { it.update(delta) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
batch.inUse {
|
batch.inUse {
|
||||||
batch.color = Color.CORAL
|
batch.color = Color.CORAL
|
||||||
Toolkit.fillArea(batch, 0f, 0f, 800f, 600f)
|
Toolkit.fillArea(batch, 0f, 0f, 800f, 600f)
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class BasicDebugInfoWindow : UICanvas() {
|
|||||||
world = ingame?.world
|
world = ingame?.world
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
val player = ingame?.actorNowPlaying
|
val player = ingame?.actorNowPlaying
|
||||||
val hitbox = player?.hitbox
|
val hitbox = player?.hitbox
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ class BasicDebugInfoWindow : UICanvas() {
|
|||||||
|
|
||||||
private val tileCursX = 0; private val tileCursY = 4
|
private val tileCursX = 0; private val tileCursY = 4
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
TerrarumIngame.setCameraPosition(batch, App.shapeRender, camera, 0f, 0f)
|
TerrarumIngame.setCameraPosition(batch, App.shapeRender, camera, 0f, 0f)
|
||||||
|
|
||||||
// toggle show-something
|
// toggle show-something
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class ConsoleWindow : UICanvas() {
|
|||||||
|
|
||||||
private val lb = ArrayList<String>()
|
private val lb = ArrayList<String>()
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
Terrarum.ingame?.let {
|
Terrarum.ingame?.let {
|
||||||
if (Authenticator.b()) {
|
if (Authenticator.b()) {
|
||||||
lb.clear()
|
lb.clear()
|
||||||
@@ -104,7 +104,7 @@ class ConsoleWindow : UICanvas() {
|
|||||||
textinput.isEnabled = (isOpened && !isClosing)
|
textinput.isEnabled = (isOpened && !isClosing)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
// background
|
// background
|
||||||
batch.color = UIColour
|
batch.color = UIColour
|
||||||
Toolkit.fillArea(batch, drawOffX, drawOffY, width.toFloat(), height.toFloat())
|
Toolkit.fillArea(batch, drawOffX, drawOffY, width.toFloat(), height.toFloat())
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class UIAutosaveNotifier : UICanvas() {
|
|||||||
private var normalCol = Color.WHITE
|
private var normalCol = Color.WHITE
|
||||||
private var errorCol = Toolkit.Theme.COL_RED
|
private var errorCol = Toolkit.Theme.COL_RED
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
spinnerTimer += delta
|
spinnerTimer += delta
|
||||||
while (spinnerTimer > spinnerInterval) {
|
while (spinnerTimer > spinnerInterval) {
|
||||||
spinnerFrame = (spinnerFrame + 1) % 32
|
spinnerFrame = (spinnerFrame + 1) % 32
|
||||||
@@ -56,7 +56,7 @@ class UIAutosaveNotifier : UICanvas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
val spin = spinner.get(spinnerFrame % 8, spinnerFrame / 8)
|
val spin = spinner.get(spinnerFrame % 8, spinnerFrame / 8)
|
||||||
val offX = App.scr.width - WIDTH - (App.scr.tvSafeGraphicsWidth * 1.25f).roundToInt().toFloat()
|
val offX = App.scr.width - WIDTH - (App.scr.tvSafeGraphicsWidth * 1.25f).roundToInt().toFloat()
|
||||||
val offY = App.scr.height - HEIGHT - App.scr.tvSafeGraphicsHeight - 9f // +9 to align to quickslot and watch UI
|
val offY = App.scr.height - HEIGHT - App.scr.tvSafeGraphicsHeight - 9f // +9 to align to quickslot and watch UI
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
package net.torvald.terrarum.ui
|
package net.torvald.terrarum.ui
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Camera
|
|
||||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||||
import com.badlogic.gdx.utils.Disposable
|
import com.badlogic.gdx.utils.Disposable
|
||||||
import net.torvald.terrarum.App
|
import net.torvald.terrarum.App
|
||||||
import net.torvald.terrarum.App.printdbg
|
|
||||||
import net.torvald.terrarum.Second
|
import net.torvald.terrarum.Second
|
||||||
import net.torvald.terrarum.Terrarum
|
import net.torvald.terrarum.Terrarum
|
||||||
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent
|
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent
|
||||||
@@ -145,7 +143,7 @@ abstract class UICanvas(
|
|||||||
/** **DO NOT CALL THIS FUNCTION FOR THE ACTUAL UPDATING OF THE UI — USE update() INSTEAD**
|
/** **DO NOT CALL THIS FUNCTION FOR THE ACTUAL UPDATING OF THE UI — USE update() INSTEAD**
|
||||||
*
|
*
|
||||||
* Override this for the actual update. Note that you must update uiItems by yourself. */
|
* Override this for the actual update. Note that you must update uiItems by yourself. */
|
||||||
abstract fun updateUI(delta: Float)
|
abstract fun updateImpl(delta: Float)
|
||||||
/** **DO NOT CALL THIS FUNCTION FOR THE ACTUAL RENDERING OF THE UI — USE render() INSTEAD**
|
/** **DO NOT CALL THIS FUNCTION FOR THE ACTUAL RENDERING OF THE UI — USE render() INSTEAD**
|
||||||
*
|
*
|
||||||
* Override this for the actual render. Note that you must render uiItems by yourself.
|
* Override this for the actual render. Note that you must render uiItems by yourself.
|
||||||
@@ -156,7 +154,7 @@ abstract class UICanvas(
|
|||||||
* The transparency of the handler is independent of the draw, you must set the drawing color yourself
|
* The transparency of the handler is independent of the draw, you must set the drawing color yourself
|
||||||
* (use handler.opacity or handler.opacityColour)
|
* (use handler.opacity or handler.opacityColour)
|
||||||
*/
|
*/
|
||||||
abstract fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera)
|
abstract fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do not modify ui.handler.openCloseCounter here.
|
* Do not modify ui.handler.openCloseCounter here.
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package net.torvald.terrarum.ui
|
|||||||
|
|
||||||
import com.badlogic.gdx.Gdx
|
import com.badlogic.gdx.Gdx
|
||||||
import com.badlogic.gdx.Input
|
import com.badlogic.gdx.Input
|
||||||
import com.badlogic.gdx.graphics.Camera
|
|
||||||
import com.badlogic.gdx.graphics.Color
|
import com.badlogic.gdx.graphics.Color
|
||||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||||
@@ -227,7 +226,7 @@ void main() {
|
|||||||
|
|
||||||
|
|
||||||
if (isVisible || alwaysUpdate) {
|
if (isVisible || alwaysUpdate) {
|
||||||
ui.updateUI(delta)
|
ui.updateImpl(delta)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isOpening) {
|
if (isOpening) {
|
||||||
@@ -301,7 +300,7 @@ void main() {
|
|||||||
|
|
||||||
batch.shader = shader
|
batch.shader = shader
|
||||||
shader.setUniformf("opacity", opacity * parentOpacity)
|
shader.setUniformf("opacity", opacity * parentOpacity)
|
||||||
ui.renderUI(frameDelta, batch, camera)
|
ui.renderImpl(frameDelta, batch, camera)
|
||||||
//ingameGraphics.flush()
|
//ingameGraphics.flush()
|
||||||
|
|
||||||
batch.shader = null
|
batch.shader = null
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
package net.torvald.terrarum.ui
|
package net.torvald.terrarum.ui
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Camera
|
|
||||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||||
import com.badlogic.gdx.utils.Disposable
|
|
||||||
import net.torvald.terrarum.App
|
import net.torvald.terrarum.App
|
||||||
import net.torvald.terrarum.Terrarum
|
import net.torvald.terrarum.Terrarum
|
||||||
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,7 +154,7 @@ abstract class UIItem(var parentUI: UICanvas, val initialX: Int, val initialY: I
|
|||||||
mouseOverCall?.setAsOpen()
|
mouseOverCall?.setAsOpen()
|
||||||
}
|
}
|
||||||
|
|
||||||
mouseOverCall?.updateUI(delta)
|
mouseOverCall?.updateImpl(delta)
|
||||||
mouseUpListener.invoke(itemRelativeMouseX, itemRelativeMouseY)
|
mouseUpListener.invoke(itemRelativeMouseX, itemRelativeMouseY)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -179,7 +176,7 @@ abstract class UIItem(var parentUI: UICanvas, val initialX: Int, val initialY: I
|
|||||||
mouseOverCall?.render(frameDelta, batch, camera)
|
mouseOverCall?.render(frameDelta, batch, camera)
|
||||||
|
|
||||||
if (mouseUp) {
|
if (mouseUp) {
|
||||||
mouseOverCall?.renderUI(frameDelta, batch, camera)
|
mouseOverCall?.renderImpl(frameDelta, batch, camera)
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ class UINSMenu(
|
|||||||
width -= poppedUIItem.ui.width
|
width -= poppedUIItem.ui.width
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateUI(delta: Float) {
|
override fun updateImpl(delta: Float) {
|
||||||
/*listStack.forEach {
|
/*listStack.forEach {
|
||||||
it.list.update(delta)
|
it.list.update(delta)
|
||||||
}*/ // fucking concurrent modification
|
}*/ // fucking concurrent modification
|
||||||
@@ -186,7 +186,7 @@ class UINSMenu(
|
|||||||
|
|
||||||
private val borderCol = Color(1f, 1f, 1f, 0.35f)
|
private val borderCol = Color(1f, 1f, 1f, 0.35f)
|
||||||
|
|
||||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||||
listStack.forEach {
|
listStack.forEach {
|
||||||
// draw title bar
|
// draw title bar
|
||||||
batch.color = titleBackCol
|
batch.color = titleBackCol
|
||||||
|
|||||||
Reference in New Issue
Block a user