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 openCloseTime = 0f
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
device.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.end()
|
||||
|
||||
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_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()
|
||||
|
||||
fbo.inAction(camera, batch) {
|
||||
|
||||
@@ -184,7 +184,7 @@ class MusicPlayer(private val ingame: TerrarumIngame) : UICanvas() {
|
||||
private var mouseOnButton: Int? = null
|
||||
private var mouseOnList: Int? = null
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
val shouldPlayerBeDisabled = shouldPlayerBeDisabled
|
||||
|
||||
// process transition request
|
||||
@@ -655,7 +655,7 @@ class MusicPlayer(private val ingame: TerrarumIngame) : UICanvas() {
|
||||
get() = relativeMouseX.toFloat() in _posX-capsuleMosaicSize .. _posX+width+capsuleMosaicSize &&
|
||||
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)
|
||||
uiWidthFromTextWidth(nameLength)
|
||||
else
|
||||
|
||||
@@ -6,5 +6,5 @@ entrypoint=net.torvald.terrarum.musicplayer.EntryPoint
|
||||
releasedate=2024-02-10
|
||||
version=1.0.0
|
||||
jar=MusicPlayer.jar
|
||||
jarhash=8e0220165a235b16f99bc93d40135a92f126a574f2ab306520fc811ebbddb85d
|
||||
jarhash=9991cb83bfaf8b110a92dcc7565f057e0959025e24f02502fb8e61fe2086ead7
|
||||
dependency=basegame 0.4.0
|
||||
|
||||
@@ -87,12 +87,12 @@ class ModOptionsHost(val remoCon: UIRemoCon) : UICanvas() {
|
||||
ControlPanelCommon.register(this, width, "basegame.modcontrolpanel.$modname", modOptions)
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
deferred(); deferred = {}
|
||||
}
|
||||
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
try {
|
||||
// the actual control panel
|
||||
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.ui.BasicDebugInfoWindow
|
||||
import net.torvald.terrarum.ui.Toolkit
|
||||
import net.torvald.terrarum.weather.WeatherMixer
|
||||
import net.torvald.unsafe.UnsafeHelper
|
||||
|
||||
/**
|
||||
@@ -159,7 +158,7 @@ object TerrarumPostProcessor : Disposable {
|
||||
|
||||
if (KeyToggler.isOn(Input.Keys.F3)) {
|
||||
if (!debugUI.isOpened && !debugUI.isOpening) debugUI.setAsOpen()
|
||||
batch.inUse { debugUI.renderUI(frameDelta, batch, camera) }
|
||||
batch.inUse { debugUI.renderImpl(frameDelta, batch, camera) }
|
||||
}
|
||||
else {
|
||||
if (!debugUI.isClosed && !debugUI.isClosing) debugUI.setAsClose()
|
||||
|
||||
@@ -38,8 +38,8 @@ class UIFakeGradOverlay : UICanvas() {
|
||||
setAsAlwaysVisible()
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {}
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun updateImpl(delta: Float) {}
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.end()
|
||||
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 batchDrawCol = Color(-1)
|
||||
|
||||
override fun updateUI(delta: Float) {}
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun updateImpl(delta: Float) {}
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batchDrawCol.a = openness
|
||||
batch.color = batchDrawCol
|
||||
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)
|
||||
@Volatile var flagDespawn = false
|
||||
|
||||
@@ -79,12 +79,12 @@ class UIBuildingMakerGetFilename : UICanvas() {
|
||||
addUIitem(buttonCancel)
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
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)
|
||||
|
||||
// draw border
|
||||
|
||||
@@ -47,7 +47,7 @@ class Noticelet : UICanvas() {
|
||||
setAsAlwaysVisible()
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
// update timer and animation
|
||||
messageQueue.forEach {
|
||||
it.akku += delta
|
||||
@@ -75,7 +75,7 @@ class Noticelet : UICanvas() {
|
||||
|
||||
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 py = App.scr.halfhf + awayFromCentre * ypos - (if (ypos < 0) h else 0f)
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class Notification : UICanvas() {
|
||||
handler.alwaysUpdate = true
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
if (messageDisplaying == null && messageQueue.notEmpty() && handler.isClosed) {
|
||||
messageDisplaying = messageQueue.removeFirst()
|
||||
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)
|
||||
fontCol.a = handler.opacity * OPACITY
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@ object NullUI : UICanvas() {
|
||||
override var height: Int = 0
|
||||
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) {
|
||||
|
||||
@@ -42,7 +42,7 @@ class UIBasicInfo() : UICanvas() {
|
||||
private val TEMP_KELVIN = 0
|
||||
private val TEMP_CELCIUS = 1
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
if (ELon) {
|
||||
ELuptimer += delta
|
||||
}
|
||||
@@ -87,7 +87,7 @@ class UIBasicInfo() : UICanvas() {
|
||||
|
||||
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.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) }
|
||||
tabs.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)
|
||||
|
||||
// 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.y = relativeMouseY.toDouble()
|
||||
|
||||
@@ -150,7 +150,7 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
|
||||
parent.tappedOnUI = true
|
||||
}
|
||||
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// draw back
|
||||
batch.color = backCol
|
||||
Toolkit.fillCircle(batch,0, 0, SIZE, SIZE)
|
||||
|
||||
@@ -30,7 +30,7 @@ class UIBuildingMakerToolbox : UICanvas() {
|
||||
tools[selectedTool].highlighted = true
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
tools.forEachIndexed { counter, it ->
|
||||
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) }
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class UICheatDetected : UICanvas() {
|
||||
|
||||
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?.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())
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
INGAME.pause()
|
||||
}
|
||||
|
||||
|
||||
@@ -408,14 +408,14 @@ class UICrafting(val full: UIInventoryFull?) : UICanvas(
|
||||
return false
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
// NO super.update due to an infinite recursion
|
||||
this.uiItems.forEach { it.update(delta) }
|
||||
|
||||
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
|
||||
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 fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
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)
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ class UIIMEConfig(remoCon: UIRemoCon?) : UICanvas() {
|
||||
addUIitem(imeSelection)
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
keyboardTestPanel.mouseoverUpdateLatch =
|
||||
(!keyboardLayoutSelection.paletteShowing &&
|
||||
!imeSelection.paletteShowing)
|
||||
@@ -173,7 +173,7 @@ class UIIMEConfig(remoCon: UIRemoCon?) : UICanvas() {
|
||||
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
|
||||
|
||||
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 pathW = 0
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
|
||||
pathW = App.fontGame.getWidth(App.importDir)
|
||||
@@ -113,7 +113,7 @@ class UIImportAvatar(val remoCon: UIRemoCon) : Advanceable() {
|
||||
}
|
||||
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
|
||||
val textboxWidth = wotKeys.maxOf { App.fontGame.getWidth(it) }
|
||||
val textX = (Toolkit.drawWidth - textboxWidth) / 2
|
||||
|
||||
@@ -126,7 +126,7 @@ internal class UIInventoryCells(
|
||||
itemList.rebuild(full.catBar.catIconsMeaning[newcat]) // have to manually rebuild, too!
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
itemList.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.render(frameDelta, batch, camera)
|
||||
//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]
|
||||
if (oldScreen != screen) {
|
||||
val yeOlde = screens[oldScreen]
|
||||
@@ -336,7 +336,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
yeet.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
batch.color = Color.WHITE
|
||||
screenRenders[screen](frameDelta, batch, camera)
|
||||
|
||||
@@ -337,7 +337,7 @@ class UIInventoryFull(
|
||||
internal var offsetY = ((App.scr.height - internalHeight) / 2).toFloat()
|
||||
private set
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
if (handler.openFired) {
|
||||
rebuildList()
|
||||
}
|
||||
@@ -351,7 +351,7 @@ class UIInventoryFull(
|
||||
//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)
|
||||
|
||||
|
||||
@@ -59,13 +59,13 @@ class UIInventoryMinimap(val full: UIInventoryFull) : UICanvas() {
|
||||
private var oldPanX = minimapPanX
|
||||
private var oldPanY = minimapPanY
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
MinimapComposer.setWorld(INGAME.world)
|
||||
// MinimapComposer.update()
|
||||
minimapRerenderTimer += Gdx.graphics.deltaTime
|
||||
}
|
||||
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
val cellOffY = INVENTORY_CELLS_OFFSET_Y()
|
||||
val worldWidth = INGAME.world.width
|
||||
|
||||
@@ -87,13 +87,13 @@ class UIJukebox : UICanvas(
|
||||
transitionPanel.hide()
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
|
||||
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)
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
|
||||
@@ -110,11 +110,11 @@ class UIJukeboxInventory(val parent: UIJukebox) : UICanvas() {
|
||||
rebuild()
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
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) }
|
||||
|
||||
// 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) }
|
||||
}
|
||||
|
||||
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) }
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ class UIKeyboardControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
}
|
||||
internal var controlSelected = -1
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
uiItems.forEach {
|
||||
it.update(delta)
|
||||
if (it is UIItemKeycap && it.mousePushed && ControlPresets.presetLabels[presetSelector.selection] == "Custom") {
|
||||
@@ -206,7 +206,7 @@ class UIKeyboardControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
controlPalette.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// batch.color = borderNormal
|
||||
// Toolkit.drawBoxBorder(batch, drawX, drawY, width, height)
|
||||
// batch.color = fillCol
|
||||
|
||||
@@ -267,7 +267,7 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : Advanceable() {
|
||||
remoCon.setNewRemoConContents(menus[mode])
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
|
||||
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) {
|
||||
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 (scrollAnimCounter < scrollAnimLen) {
|
||||
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()
|
||||
|
||||
val cells = playerCells
|
||||
|
||||
@@ -310,7 +310,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
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)
|
||||
|
||||
when (mode) {
|
||||
@@ -344,7 +344,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
|
||||
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) {
|
||||
val buttonYdelta = (full.titleTopGradEnd) - full.playerButtonSelected!!.posY
|
||||
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 height: Int = App.scr.height
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
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")
|
||||
}
|
||||
|
||||
|
||||
@@ -143,11 +143,11 @@ class UILoadSavegame(val remoCon: UIRemoCon) : Advanceable() {
|
||||
transitionPanel.hide()
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ class UINewCharacter(val remoCon: UIRemoCon) : UICanvas() {
|
||||
addUIitem(backButton)
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
if (!uiLocked) {
|
||||
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
|
||||
// ui title
|
||||
// val titlestr = Lang["CONTEXT_WORLD_NEW"]
|
||||
|
||||
@@ -254,7 +254,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
|
||||
importReturnCode = 0
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
if (uiItemsChangeRequest != null) {
|
||||
uiItemsChangeRequest!!()
|
||||
uiItemsChangeRequest = null
|
||||
@@ -263,7 +263,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
|
||||
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
|
||||
// ui title
|
||||
// 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
|
||||
batch.color = UINSMenu.DEFAULT_TITLEBACKCOL
|
||||
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 fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
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)
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ class UIProxyLoadLatestSave(val remoCon: UIRemoCon) : UICanvas() {
|
||||
override var height: Int = 0
|
||||
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) {
|
||||
|
||||
@@ -19,10 +19,10 @@ class UIProxyNewBuildingMaker(val remoCon: UIRemoCon) : UICanvas() {
|
||||
override var height: Int = 0
|
||||
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) {
|
||||
|
||||
@@ -22,10 +22,10 @@ class UIProxyNewRandomGame(val remoCon: UIRemoCon) : UICanvas() {
|
||||
override var height: Int = 0
|
||||
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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
if (selection != newSelection) {
|
||||
@@ -87,7 +87,7 @@ class UIQuickslotBar : UICanvas() {
|
||||
|
||||
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 ->
|
||||
for (i in 0 until SLOT_COUNT) {
|
||||
|
||||
@@ -48,7 +48,7 @@ class UIQuickslotPie : UICanvas() {
|
||||
|
||||
var selection: Int = -1
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
if (selection >= 0 && (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying != null)
|
||||
(Terrarum.ingame!! as TerrarumIngame).actorNowPlaying!!.actorValue[AVKey.__PLAYER_QUICKSLOTSEL] =
|
||||
selection % slotCount
|
||||
@@ -69,7 +69,7 @@ class UIQuickslotPie : UICanvas() {
|
||||
|
||||
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
|
||||
for (i in 0 until slotCount) {
|
||||
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 openUI: UICanvas? = null
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
if (mouseActionAvailable) {
|
||||
mouseActionAvailable = false
|
||||
|
||||
@@ -220,7 +220,7 @@ open class UIRemoCon(val parent: TitleScreen, val treeRoot: QNDTreeNode<String>)
|
||||
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)
|
||||
openUI?.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ class UIScreenZoom : UICanvas(
|
||||
private val zoomMin = 1f
|
||||
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
|
||||
|
||||
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 drawY = (App.scr.height - height) / 2
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class UIShare : UICanvas() {
|
||||
|
||||
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
|
||||
|
||||
val textY = drawY + (height/2) - App.fontGame.lineHeight.toInt() * 4 - 2
|
||||
|
||||
@@ -404,7 +404,7 @@ class UISmelterBasic(val smelter: FixtureSmelterBasic) : UICanvas(
|
||||
INGAME.setTooltipMessage(null)
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
|
||||
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.draw(smelterBackdrops.get(1,0), backdropX, backdropY, smelterBackdrops.tileW * 6f, smelterBackdrops.tileH * 6f)
|
||||
// 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")
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
|
||||
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
|
||||
if (handler.openCloseCounter == 0f && App.audioMixer.fadeBus.getFilter<Lowpass>().cutoff < SAMPLING_RATE / 2) {
|
||||
App.audioMixer.requestLowpassOut(0.25)
|
||||
|
||||
@@ -226,7 +226,7 @@ internal class UIStorageChest : UICanvas(
|
||||
return false
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
catBar.update(delta)
|
||||
itemListChest.update(delta)
|
||||
itemListPlayer.update(delta)
|
||||
@@ -265,7 +265,7 @@ internal class UIStorageChest : UICanvas(
|
||||
else
|
||||
"${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
|
||||
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) {
|
||||
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
|
||||
textArea1.render(frameDelta, batch, camera)
|
||||
|
||||
@@ -99,7 +99,7 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() {
|
||||
catch (e: UninitializedPropertyAccessException) {}
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
if (scrollTarget != listScroll) {
|
||||
if (scrollAnimCounter < scrollAnimLen) {
|
||||
scrollAnimCounter += delta
|
||||
@@ -138,7 +138,7 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() {
|
||||
moduleCells.clear()
|
||||
}
|
||||
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.end()
|
||||
|
||||
lateinit var savePixmap: Pixmap
|
||||
|
||||
@@ -44,12 +44,12 @@ open class UITitleWallOfText(private val text: List<String>) : UICanvas() {
|
||||
init {
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
textArea.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
|
||||
textArea.render(frameDelta, batch, camera)
|
||||
scrollbar?.render(frameDelta, batch, camera)
|
||||
@@ -116,11 +116,11 @@ class UISystemInfo(val remoCon: UIRemoCon) : UICanvas() {
|
||||
tb2x = tb1x + tb1w + gap
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
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
|
||||
|
||||
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.") }
|
||||
|
||||
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val mouseXoff = 28f
|
||||
val mouseYoff = 0f
|
||||
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)
|
||||
|
||||
if (isVisible && tooltipShowing.values.all { !it }) {
|
||||
|
||||
@@ -53,7 +53,7 @@ class UIVitalMetre(
|
||||
return c
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
handler.setPosition(
|
||||
App.scr.halfw,
|
||||
App.scr.halfh
|
||||
@@ -63,7 +63,7 @@ class UIVitalMetre(
|
||||
/**
|
||||
* 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
|
||||
|
||||
/*if (vitalGetterVal() != null && vitalGetterMax() != null && player != null) {
|
||||
|
||||
@@ -58,7 +58,7 @@ class UIWallCalendar : UICanvas(
|
||||
private var mouseOverCell = -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) &&
|
||||
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)
|
||||
|
||||
val thisYear = INGAME.world.worldTime.years
|
||||
|
||||
@@ -49,7 +49,7 @@ class UIWatchLargeAnalogue() : UICanvas() {
|
||||
|
||||
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())
|
||||
|
||||
val day = INGAME.world.worldTime.calendarDay - 1
|
||||
@@ -101,7 +101,7 @@ class UIWatchLargeAnalogue() : UICanvas() {
|
||||
batch.draw(dialPin, moondialOffX - 1, moondialOffY - 1)
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
|
||||
@@ -54,7 +54,7 @@ class UIWatchLargeDigital() : UICanvas() {
|
||||
get() = INGAME.world.worldTime
|
||||
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
if (ELon) {
|
||||
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
|
||||
batch.color = Color.WHITE
|
||||
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)
|
||||
}
|
||||
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
drawBackground(batch, 1f)
|
||||
|
||||
// UI items
|
||||
|
||||
@@ -182,7 +182,7 @@ class UIWorldPortalCargo(val full: UIWorldPortal) : UICanvas(), HasInventory {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
catBar.update(delta)
|
||||
itemListChest.update(delta)
|
||||
itemListPlayer.update(delta)
|
||||
@@ -201,7 +201,7 @@ class UIWorldPortalCargo(val full: UIWorldPortal) : UICanvas(), HasInventory {
|
||||
else
|
||||
"${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
|
||||
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) }
|
||||
}
|
||||
|
||||
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
full.selectedButton?.let {
|
||||
val buttonYdelta = (App.scr.tvSafeGraphicsHeight + 172 + 36) - it.posY
|
||||
val buttonXdelta = (Toolkit.drawWidth - it.width) / 2 - it.posX
|
||||
|
||||
@@ -347,7 +347,7 @@ class UIWorldPortalListing(val full: UIWorldPortal) : UICanvas() {
|
||||
else -> "CONTEXT_DESCRIPTION_HUGE"
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
uiItems.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
|
||||
|
||||
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 memoryGaugeYpos = y + listHeight - buttonHeight
|
||||
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) }
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
// ugh why won't you just scroll along??
|
||||
|
||||
@@ -145,7 +145,7 @@ class UIWorldPortalSearch(val full: UIWorldPortal) : UICanvas() {
|
||||
|
||||
private var oldPosX = full.posX
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ class UIWorldPortalSearch(val full: UIWorldPortal) : UICanvas() {
|
||||
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 memoryGaugeYpos = drawY + sizeSelY + buttonHeight + 10
|
||||
val textXpos = memoryGaugeXpos + 3
|
||||
|
||||
@@ -43,7 +43,7 @@ class UIWorldPortalShare(private val full: UIWorldPortal) : UICanvas() {
|
||||
addUIitem(backButton)
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class UIWorldPortalShare(private val full: UIWorldPortal) : UICanvas() {
|
||||
|
||||
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
|
||||
|
||||
val textY = drawY + (height/2) - App.fontGame.lineHeight.toInt() * 4 - 2
|
||||
|
||||
@@ -108,11 +108,11 @@ class UIWorldPortalUseInvitation(val full: UIWorldPortal) : UICanvas() {
|
||||
importReturnCode = 0
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
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
|
||||
if (importReturnCode != 0) {
|
||||
batch.color = Toolkit.Theme.COL_RED
|
||||
|
||||
@@ -118,11 +118,11 @@ class DummyTogglePane : UICanvas() {
|
||||
uiItems.add(textin)
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
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.color = Color.CORAL
|
||||
Toolkit.fillArea(batch, 0f, 0f, 800f, 600f)
|
||||
|
||||
@@ -91,7 +91,7 @@ class BasicDebugInfoWindow : UICanvas() {
|
||||
world = ingame?.world
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
val player = ingame?.actorNowPlaying
|
||||
val hitbox = player?.hitbox
|
||||
|
||||
@@ -135,7 +135,7 @@ class BasicDebugInfoWindow : UICanvas() {
|
||||
|
||||
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)
|
||||
|
||||
// toggle show-something
|
||||
|
||||
@@ -71,7 +71,7 @@ class ConsoleWindow : UICanvas() {
|
||||
|
||||
private val lb = ArrayList<String>()
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
Terrarum.ingame?.let {
|
||||
if (Authenticator.b()) {
|
||||
lb.clear()
|
||||
@@ -104,7 +104,7 @@ class ConsoleWindow : UICanvas() {
|
||||
textinput.isEnabled = (isOpened && !isClosing)
|
||||
}
|
||||
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderImpl(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// background
|
||||
batch.color = UIColour
|
||||
Toolkit.fillArea(batch, drawOffX, drawOffY, width.toFloat(), height.toFloat())
|
||||
|
||||
@@ -40,7 +40,7 @@ class UIAutosaveNotifier : UICanvas() {
|
||||
private var normalCol = Color.WHITE
|
||||
private var errorCol = Toolkit.Theme.COL_RED
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
spinnerTimer += delta
|
||||
while (spinnerTimer > spinnerInterval) {
|
||||
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 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
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package net.torvald.terrarum.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.utils.Disposable
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.App.printdbg
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
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**
|
||||
*
|
||||
* 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**
|
||||
*
|
||||
* 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
|
||||
* (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.
|
||||
|
||||
@@ -2,7 +2,6 @@ package net.torvald.terrarum.ui
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
@@ -227,7 +226,7 @@ void main() {
|
||||
|
||||
|
||||
if (isVisible || alwaysUpdate) {
|
||||
ui.updateUI(delta)
|
||||
ui.updateImpl(delta)
|
||||
}
|
||||
|
||||
if (isOpening) {
|
||||
@@ -301,7 +300,7 @@ void main() {
|
||||
|
||||
batch.shader = shader
|
||||
shader.setUniformf("opacity", opacity * parentOpacity)
|
||||
ui.renderUI(frameDelta, batch, camera)
|
||||
ui.renderImpl(frameDelta, batch, camera)
|
||||
//ingameGraphics.flush()
|
||||
|
||||
batch.shader = null
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package net.torvald.terrarum.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.utils.Disposable
|
||||
import net.torvald.terrarum.App
|
||||
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?.updateUI(delta)
|
||||
mouseOverCall?.updateImpl(delta)
|
||||
mouseUpListener.invoke(itemRelativeMouseX, itemRelativeMouseY)
|
||||
}
|
||||
else {
|
||||
@@ -179,7 +176,7 @@ abstract class UIItem(var parentUI: UICanvas, val initialX: Int, val initialY: I
|
||||
mouseOverCall?.render(frameDelta, batch, camera)
|
||||
|
||||
if (mouseUp) {
|
||||
mouseOverCall?.renderUI(frameDelta, batch, camera)
|
||||
mouseOverCall?.renderImpl(frameDelta, batch, camera)
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ class UINSMenu(
|
||||
width -= poppedUIItem.ui.width
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
override fun updateImpl(delta: Float) {
|
||||
/*listStack.forEach {
|
||||
it.list.update(delta)
|
||||
}*/ // fucking concurrent modification
|
||||
@@ -186,7 +186,7 @@ class UINSMenu(
|
||||
|
||||
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 {
|
||||
// draw title bar
|
||||
batch.color = titleBackCol
|
||||
|
||||
Reference in New Issue
Block a user