mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
Renamed AppLoader into App
This commit is contained in:
@@ -2,7 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.utils.Disposable
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
|
||||
/**
|
||||
@@ -13,7 +13,7 @@ object FloatDrawer : Disposable {
|
||||
val tile = TextureRegionPack("assets/graphics/gui/message_black_tileable.tga", 36, 36)
|
||||
|
||||
init {
|
||||
AppLoader.disposableSingletonsPool.add(this)
|
||||
App.disposableSingletonsPool.add(this)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.blendNormal
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -26,7 +26,7 @@ class Notification : UICanvas() {
|
||||
|
||||
override var height: Int = 0
|
||||
private val visibleTime = Math.min(
|
||||
AppLoader.getConfigInt("notificationshowuptime"),
|
||||
App.getConfigInt("notificationshowuptime"),
|
||||
SHOWUP_MAX
|
||||
) / 1000f
|
||||
private var displayTimer = 0f
|
||||
@@ -55,15 +55,15 @@ class Notification : UICanvas() {
|
||||
fontCol.a = handler.opacity
|
||||
|
||||
val realTextWidth = 12 + if (message.size == 1)
|
||||
AppLoader.fontGame.getWidth(message[0])
|
||||
App.fontGame.getWidth(message[0])
|
||||
else
|
||||
message.map { AppLoader.fontGame.getWidth(it) }.sorted().last()
|
||||
message.map { App.fontGame.getWidth(it) }.sorted().last()
|
||||
val displayedTextWidth = maxOf(240, realTextWidth)
|
||||
|
||||
// force the UI to the centre of the screen
|
||||
this.posX = (AppLoader.screenSize.screenW - displayedTextWidth) / 2
|
||||
this.posX = (App.scr.width - displayedTextWidth) / 2
|
||||
|
||||
val textHeight = message.size * AppLoader.fontGame.lineHeight
|
||||
val textHeight = message.size * App.fontGame.lineHeight
|
||||
|
||||
batch.color = drawColor
|
||||
|
||||
@@ -72,8 +72,8 @@ class Notification : UICanvas() {
|
||||
batch.color = fontCol
|
||||
message.forEachIndexed { index, s ->
|
||||
val xoff = 6 + (displayedTextWidth - realTextWidth) / 2
|
||||
val y = -textHeight + AppLoader.fontGame.lineHeight * index
|
||||
AppLoader.fontGame.draw(batch, s, LRmargin + xoff, y)
|
||||
val y = -textHeight + App.fontGame.lineHeight * index
|
||||
App.fontGame.draw(batch, s, LRmargin + xoff, y)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class UIBasicInfo() : UICanvas() {
|
||||
ELuptimer += delta
|
||||
}
|
||||
|
||||
if (mouseUp || Gdx.input.isKeyPressed(AppLoader.getConfigInt("config_keyinteract"))) {
|
||||
if (mouseUp || Gdx.input.isKeyPressed(App.getConfigInt("config_keyinteract"))) {
|
||||
ELuptimer = 0f
|
||||
ELon = true
|
||||
}
|
||||
|
||||
@@ -4,18 +4,15 @@ import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.blendNormal
|
||||
import net.torvald.terrarum.blockproperties.BlockCodex
|
||||
import net.torvald.terrarum.fillRect
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.BuildingMaker
|
||||
import net.torvald.terrarum.modulebasegame.ui.ItemSlotImageFactory.CELLCOLOUR_WHITE
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.ui.UIItemImageButton
|
||||
import net.torvald.terrarum.ui.UIItemTextButtonList
|
||||
import net.torvald.terrarum.ui.UIItemTextButtonList.Companion.DEFAULT_BACKGROUNDCOL
|
||||
import net.torvald.terrarum.worlddrawer.CreateTileAtlas
|
||||
import kotlin.math.roundToInt
|
||||
import net.torvald.terrarum.*
|
||||
|
||||
@@ -89,7 +86,7 @@ class UIBuildingMakerBlockChooser(val parent: BuildingMaker): UICanvas() {
|
||||
}
|
||||
|
||||
// respond to click
|
||||
if (Gdx.input.isButtonPressed(AppLoader.getConfigInt("config_mouseprimary"))) {
|
||||
if (Gdx.input.isButtonPressed(App.getConfigInt("config_mouseprimary"))) {
|
||||
// scroll bar
|
||||
if (relativeMouseX in width - SCROLLBAR_SIZE until width && relativeMouseY in 0 until height) {
|
||||
mouseOnScroll = true
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.blockproperties.Block
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.BuildingMaker
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.ui.UIItemImageButton
|
||||
@@ -71,8 +70,8 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
|
||||
{
|
||||
parent.uiPalette.isVisible = true
|
||||
parent.uiPalette.setPosition(Gdx.input.x - parent.uiPalette.width / 2, Gdx.input.y - parent.uiPalette.height / 2)
|
||||
parent.uiPalette.posX = parent.uiPalette.posX.coerceIn(0, AppLoader.screenSize.screenW - parent.uiPalette.width)
|
||||
parent.uiPalette.posY = parent.uiPalette.posY.coerceIn(0, AppLoader.screenSize.screenH - parent.uiPalette.height)
|
||||
parent.uiPalette.posX = parent.uiPalette.posX.coerceIn(0, App.scr.width - parent.uiPalette.width)
|
||||
parent.uiPalette.posY = parent.uiPalette.posY.coerceIn(0, App.scr.height - parent.uiPalette.height)
|
||||
},
|
||||
{
|
||||
parent.currentPenMode = BuildingMaker.PENMODE_PENCIL_ERASE
|
||||
@@ -100,7 +99,7 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
|
||||
uiItems.add(button)
|
||||
|
||||
button.clickOnceListener = { _, _, b ->
|
||||
if (b == AppLoader.getConfigInt("config_mouseprimary")) {
|
||||
if (b == App.getConfigInt("config_mouseprimary")) {
|
||||
toolButtonsJob[index].invoke()
|
||||
closeGracefully()
|
||||
}
|
||||
@@ -134,7 +133,7 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
|
||||
}
|
||||
|
||||
// primary click
|
||||
if (Gdx.input.isButtonPressed(AppLoader.getConfigInt("config_mouseprimary"))) {
|
||||
if (Gdx.input.isButtonPressed(App.getConfigInt("config_mouseprimary"))) {
|
||||
// close by clicking close button or out-of-boud
|
||||
if (mouseVec.distanceSquared(RADIUS, RADIUS) !in CLOSE_BUTTON_RADIUS.sqr()..RADIUSF.sqr()) {
|
||||
closeGracefully()
|
||||
@@ -176,7 +175,7 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
|
||||
batch.draw(ItemCodex.getItemImage(slotConfig[i]), x - 16, y - 16, 32f, 32f)
|
||||
|
||||
// update as well while looping
|
||||
if (i == mouseOnBlocksSlot && Gdx.input.isButtonPressed(AppLoader.getConfigInt("config_mouseprimary"))) {
|
||||
if (i == mouseOnBlocksSlot && Gdx.input.isButtonPressed(App.getConfigInt("config_mouseprimary"))) {
|
||||
parent.setPencilColour(slotConfig[i])
|
||||
closeGracefully()
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.fillRect
|
||||
@@ -16,11 +16,11 @@ import net.torvald.terrarum.ui.UICanvas
|
||||
class UICheatDetected : UICanvas() {
|
||||
|
||||
override var width: Int
|
||||
get() = AppLoader.screenSize.screenW
|
||||
get() = App.scr.width
|
||||
set(value) { throw UnsupportedOperationException() }
|
||||
|
||||
override var height: Int
|
||||
get() = AppLoader.screenSize.screenH
|
||||
get() = App.scr.height
|
||||
set(value) { throw UnsupportedOperationException() }
|
||||
|
||||
override var openCloseTime: Second = 0f
|
||||
@@ -38,10 +38,10 @@ class UICheatDetected : UICanvas() {
|
||||
|
||||
batch.color = Color.WHITE
|
||||
val txt = Lang["ERROR_GENERIC_CHEATING"]
|
||||
val txtW = AppLoader.fontGame.getWidth(txt)
|
||||
val txtH = AppLoader.fontGame.lineHeight.toInt()
|
||||
val txtW = App.fontGame.getWidth(txt)
|
||||
val txtH = App.fontGame.lineHeight.toInt()
|
||||
|
||||
AppLoader.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) {
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.gameactors.ActorWithBody
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.FixtureInventory
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIInventoryFull.Companion.CELLS_HOR
|
||||
@@ -22,8 +21,8 @@ internal class UIInventoryCells(
|
||||
val full: UIInventoryFull
|
||||
) : UICanvas() {
|
||||
|
||||
override var width: Int = AppLoader.screenSize.screenW
|
||||
override var height: Int = AppLoader.screenSize.screenH
|
||||
override var width: Int = App.scr.width
|
||||
override var height: Int = App.scr.height
|
||||
override var openCloseTime: Second = 0.0f
|
||||
|
||||
companion object {
|
||||
@@ -53,7 +52,7 @@ internal class UIInventoryCells(
|
||||
private val equipped: UIItemInventoryEquippedView =
|
||||
UIItemInventoryEquippedView(
|
||||
full,
|
||||
internalWidth - UIItemInventoryEquippedView.WIDTH + (AppLoader.screenSize.screenW - internalWidth) / 2,
|
||||
internalWidth - UIItemInventoryEquippedView.WIDTH + (App.scr.width - internalWidth) / 2,
|
||||
INVENTORY_CELLS_OFFSET_Y,
|
||||
{ rebuildList() }
|
||||
)
|
||||
@@ -64,7 +63,7 @@ internal class UIInventoryCells(
|
||||
}
|
||||
|
||||
fun rebuildList() {
|
||||
AppLoader.printdbg(this, "rebuilding list")
|
||||
App.printdbg(this, "rebuilding list")
|
||||
|
||||
itemList.rebuild(full.catBar.catIconsMeaning[full.catBar.selectedIcon])
|
||||
equipped.rebuild()
|
||||
@@ -94,21 +93,21 @@ internal class UIInventoryCells(
|
||||
val controlHintXPos = full.offsetX
|
||||
blendNormal(batch)
|
||||
batch.color = Color.WHITE
|
||||
AppLoader.fontGame.draw(batch, full.listControlHelp, controlHintXPos, full.yEnd - 20)
|
||||
App.fontGame.draw(batch, full.listControlHelp, controlHintXPos, full.yEnd - 20)
|
||||
|
||||
|
||||
// encumbrance meter
|
||||
val encumbranceText = Lang["GAME_INVENTORY_ENCUMBRANCE"]
|
||||
// encumbrance bar will go one row down if control help message is too long
|
||||
val encumbBarXPos = full.xEnd - weightBarWidth
|
||||
val encumbBarTextXPos = encumbBarXPos - 6 - AppLoader.fontGame.getWidth(encumbranceText)
|
||||
val encumbBarTextXPos = encumbBarXPos - 6 - App.fontGame.getWidth(encumbranceText)
|
||||
val encumbBarYPos = full.yEnd-20 + 3f +
|
||||
if (AppLoader.fontGame.getWidth(full.listControlHelp) + 2 + controlHintXPos >= encumbBarTextXPos)
|
||||
AppLoader.fontGame.lineHeight
|
||||
if (App.fontGame.getWidth(full.listControlHelp) + 2 + controlHintXPos >= encumbBarTextXPos)
|
||||
App.fontGame.lineHeight
|
||||
else 0f
|
||||
Companion.encumbBarYPos = encumbBarYPos // q&d hack to share some numbers
|
||||
|
||||
AppLoader.fontGame.draw(batch,
|
||||
App.fontGame.draw(batch,
|
||||
encumbranceText,
|
||||
encumbBarTextXPos,
|
||||
encumbBarYPos - 3f
|
||||
@@ -136,7 +135,7 @@ internal class UIInventoryCells(
|
||||
// debug text
|
||||
batch.color = Color.LIGHT_GRAY
|
||||
if (INVEN_DEBUG_MODE) {
|
||||
AppLoader.fontSmallNumbers.draw(batch,
|
||||
App.fontSmallNumbers.draw(batch,
|
||||
"${full.actor.inventory.capacity}/${full.actor.inventory.maxCapacity}",
|
||||
encumbBarTextXPos,
|
||||
encumbBarYPos + controlHelpHeight - 4f
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.TitleScreen
|
||||
import net.torvald.terrarum.blendNormal
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIInventoryFull.Companion.INVENTORY_CELLS_OFFSET_Y
|
||||
@@ -15,8 +15,8 @@ import net.torvald.terrarum.ui.UIItemTextButtonList.Companion.DEFAULT_LINE_HEIGH
|
||||
|
||||
class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
|
||||
override var width: Int = AppLoader.screenSize.screenW
|
||||
override var height: Int = AppLoader.screenSize.screenH
|
||||
override var width: Int = App.scr.width
|
||||
override var height: Int = App.scr.height
|
||||
override var openCloseTime = 0.0f
|
||||
|
||||
private val gameMenu = arrayOf("MENU_LABEL_MAINMENU", "MENU_LABEL_DESKTOP", "MENU_OPTIONS_CONTROLS", "MENU_OPTIONS_SOUND", "MENU_LABEL_GRAPHICS")
|
||||
@@ -24,7 +24,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
private val gameMenuListWidth = 400
|
||||
private val gameMenuButtons = UIItemTextButtonList(
|
||||
this, DEFAULT_LINE_HEIGHT, gameMenu,
|
||||
(AppLoader.screenSize.screenW - gameMenuListWidth) / 2,
|
||||
(App.scr.width - gameMenuListWidth) / 2,
|
||||
INVENTORY_CELLS_OFFSET_Y + (INVENTORY_CELLS_UI_HEIGHT - gameMenuListHeight) / 2,
|
||||
gameMenuListWidth, gameMenuListHeight,
|
||||
readFromLang = true,
|
||||
@@ -41,7 +41,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
|
||||
gameMenuButtons.selectionChangeListener = { _, new ->
|
||||
when (new) {
|
||||
0 -> AppLoader.setScreen(TitleScreen(AppLoader.batch))
|
||||
0 -> App.setScreen(TitleScreen(App.batch))
|
||||
1 -> Gdx.app.exit()
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
// control hints
|
||||
blendNormal(batch)
|
||||
batch.color = Color.WHITE
|
||||
AppLoader.fontGame.draw(batch, full.gameMenuControlHelp, full.offsetX, full.yEnd - 20)
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, full.offsetX, full.yEnd - 20)
|
||||
|
||||
// text buttons
|
||||
gameMenuButtons.render(batch, camera)
|
||||
|
||||
@@ -5,12 +5,11 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer
|
||||
import net.torvald.ENDASH
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.AppLoader.*
|
||||
import net.torvald.terrarum.App.*
|
||||
import net.torvald.terrarum.blockstats.MinimapComposer
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.ActorHumanoid
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.Pocketed
|
||||
import net.torvald.terrarum.ui.*
|
||||
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
|
||||
@@ -18,7 +17,7 @@ import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
* Created by minjaesong on 2017-10-21.
|
||||
*/
|
||||
class UIInventoryFull(
|
||||
toggleKeyLiteral: Int? = AppLoader.getConfigInt("config_keyinventory"), toggleButtonLiteral: Int? = AppLoader.getConfigInt("config_gamepadstart"),
|
||||
toggleKeyLiteral: Int? = App.getConfigInt("config_keyinventory"), toggleButtonLiteral: Int? = App.getConfigInt("config_gamepadstart"),
|
||||
// UI positions itself? (you must g.flush() yourself after the g.translate(Int, Int))
|
||||
customPositioning: Boolean = false, // mainly used by vital meter
|
||||
doNotWarnConstant: Boolean = false
|
||||
@@ -27,8 +26,8 @@ class UIInventoryFull(
|
||||
val actor: ActorHumanoid
|
||||
get() = Terrarum.ingame!!.actorNowPlaying!!
|
||||
|
||||
override var width: Int = AppLoader.screenSize.screenW
|
||||
override var height: Int = AppLoader.screenSize.screenH
|
||||
override var width: Int = App.scr.width
|
||||
override var height: Int = App.scr.height
|
||||
override var openCloseTime: Second = 0.0f
|
||||
|
||||
companion object {
|
||||
@@ -36,7 +35,7 @@ class UIInventoryFull(
|
||||
|
||||
const val REQUIRED_MARGIN: Int = 138 // hard-coded value. Don't know the details. Range: [91-146]. I chose MAX-8 because cell gap is 8
|
||||
const val CELLS_HOR = 10
|
||||
val CELLS_VRT: Int; get() = (AppLoader.screenSize.screenH - REQUIRED_MARGIN - 134 + UIItemInventoryItemGrid.listGap) / // 134 is another magic number
|
||||
val CELLS_VRT: Int; get() = (App.scr.height - REQUIRED_MARGIN - 134 + UIItemInventoryItemGrid.listGap) / // 134 is another magic number
|
||||
(UIItemInventoryElemSimple.height + UIItemInventoryItemGrid.listGap)
|
||||
|
||||
const val itemListToEquipViewGap = UIItemInventoryItemGrid.listGap // used to be 24; figured out that the extra gap does nothig
|
||||
@@ -47,8 +46,8 @@ class UIInventoryFull(
|
||||
val itemListHeight: Int = CELLS_VRT * UIItemInventoryElemSimple.height + (CELLS_VRT - 1) * net.torvald.terrarum.modulebasegame.ui.UIItemInventoryItemGrid.Companion.listGap
|
||||
|
||||
val INVENTORY_CELLS_UI_HEIGHT: Int = CELLS_VRT * UIItemInventoryElemSimple.height + (CELLS_VRT - 1) * UIItemInventoryItemGrid.listGap
|
||||
val INVENTORY_CELLS_OFFSET_X = 0 + (AppLoader.screenSize.screenW - internalWidth) / 2
|
||||
val INVENTORY_CELLS_OFFSET_Y: Int = 107 + (AppLoader.screenSize.screenH - internalHeight) / 2
|
||||
val INVENTORY_CELLS_OFFSET_X = 0 + (App.scr.width - internalWidth) / 2
|
||||
val INVENTORY_CELLS_OFFSET_Y: Int = 107 + (App.scr.height - internalHeight) / 2
|
||||
|
||||
val catBarWidth = 330
|
||||
|
||||
@@ -56,7 +55,7 @@ class UIInventoryFull(
|
||||
val gradEndCol = Color(0x000000_70)
|
||||
val gradHeight = 48f
|
||||
|
||||
val controlHelpHeight = AppLoader.fontGame.lineHeight
|
||||
val controlHelpHeight = App.fontGame.lineHeight
|
||||
}
|
||||
|
||||
//val REQUIRED_MARGIN: Int = 138 // hard-coded value. Don't know the details. Range: [91-146]. I chose MAX-8 because cell gap is 8
|
||||
@@ -86,7 +85,7 @@ class UIInventoryFull(
|
||||
|
||||
private val SP = "${0x3000.toChar()} "
|
||||
val listControlHelp: String
|
||||
get() = if (AppLoader.environment == RunningEnvironment.PC)
|
||||
get() = if (App.environment == RunningEnvironment.PC)
|
||||
"${0xe031.toChar()} ${Lang["GAME_ACTION_CLOSE"]}$SP" +
|
||||
"${0xe006.toChar()} ${Lang["GAME_INVENTORY_USE"]}$SP" +
|
||||
"${0xe011.toChar()}$ENDASH${0x2009.toChar()}${0xe010.toChar()} ${Lang["GAME_INVENTORY_REGISTER"]}$SP" +
|
||||
@@ -99,7 +98,7 @@ class UIInventoryFull(
|
||||
"$gamepadLabelNorth$gamepadLabelLStick ${Lang["GAME_INVENTORY_REGISTER"]}$SP" +
|
||||
"$gamepadLabelEast ${Lang["GAME_INVENTORY_DROP"]}"
|
||||
val minimapControlHelp: String
|
||||
get() = if (AppLoader.environment == RunningEnvironment.PC)
|
||||
get() = if (App.environment == RunningEnvironment.PC)
|
||||
"${0xe031.toChar()} ${Lang["GAME_ACTION_CLOSE"]}$SP" +
|
||||
"${0xe006.toChar()} ${Lang["GAME_ACTION_MOVE_VERB"]}"
|
||||
else
|
||||
@@ -107,7 +106,7 @@ class UIInventoryFull(
|
||||
"$gamepadLabelRStick ${Lang["GAME_ACTION_MOVE_VERB"]}$SP" +
|
||||
"$gamepadLabelRT ${Lang["GAME_INVENTORY"]}"
|
||||
val gameMenuControlHelp: String
|
||||
get() = if (AppLoader.environment == RunningEnvironment.PC)
|
||||
get() = if (App.environment == RunningEnvironment.PC)
|
||||
"${0xe031.toChar()} ${Lang["GAME_ACTION_CLOSE"]}"
|
||||
else
|
||||
"$gamepadLabelStart ${Lang["GAME_ACTION_CLOSE"]}$SP" +
|
||||
@@ -115,8 +114,8 @@ class UIInventoryFull(
|
||||
|
||||
val catBar = UIItemInventoryCatBar(
|
||||
this,
|
||||
(AppLoader.screenSize.screenW - catBarWidth) / 2,
|
||||
42 + (AppLoader.screenSize.screenH - internalHeight) / 2,
|
||||
(App.scr.width - catBarWidth) / 2,
|
||||
42 + (App.scr.height - internalHeight) / 2,
|
||||
internalWidth,
|
||||
catBarWidth,
|
||||
true,
|
||||
@@ -129,10 +128,10 @@ class UIInventoryFull(
|
||||
private val transitionalEscMenu = UIInventoryEscMenu(this)
|
||||
private val transitionPanel = UIItemHorizontalFadeSlide(
|
||||
this,
|
||||
(AppLoader.screenSize.screenW - internalWidth) / 2,
|
||||
(App.scr.width - internalWidth) / 2,
|
||||
INVENTORY_CELLS_OFFSET_Y,
|
||||
AppLoader.screenSize.screenW,
|
||||
AppLoader.screenSize.screenH,
|
||||
App.scr.width,
|
||||
App.scr.height,
|
||||
1f,
|
||||
transitionalMinimap, transitionalItemCells, transitionalEscMenu
|
||||
)
|
||||
@@ -153,9 +152,9 @@ class UIInventoryFull(
|
||||
|
||||
}
|
||||
|
||||
internal var offsetX = ((AppLoader.screenSize.screenW - internalWidth) / 2).toFloat()
|
||||
internal var offsetX = ((App.scr.width - internalWidth) / 2).toFloat()
|
||||
private set
|
||||
internal var offsetY = ((AppLoader.screenSize.screenH - internalHeight) / 2).toFloat()
|
||||
internal var offsetY = ((App.scr.height - internalHeight) / 2).toFloat()
|
||||
private set
|
||||
|
||||
fun requestTransition(target: Int) = transitionPanel.requestTransition(target)
|
||||
@@ -174,9 +173,9 @@ class UIInventoryFull(
|
||||
//private val gradHeight = 48f
|
||||
private val shapeRenderer = ShapeRenderer()
|
||||
|
||||
internal var xEnd = (AppLoader.screenSize.screenW + internalWidth).div(2).toFloat()
|
||||
internal var xEnd = (App.scr.width + internalWidth).div(2).toFloat()
|
||||
private set
|
||||
internal var yEnd = (AppLoader.screenSize.screenH + internalHeight).div(2).toFloat()
|
||||
internal var yEnd = (App.scr.height + internalHeight).div(2).toFloat()
|
||||
private set
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
@@ -187,17 +186,17 @@ class UIInventoryFull(
|
||||
gdxSetBlendNormal()
|
||||
|
||||
|
||||
val gradTopStart = (AppLoader.screenSize.screenH - internalHeight).div(2).toFloat()
|
||||
val gradBottomEnd = AppLoader.screenSize.screenH - gradTopStart
|
||||
val gradTopStart = (App.scr.height - internalHeight).div(2).toFloat()
|
||||
val gradBottomEnd = App.scr.height - gradTopStart
|
||||
|
||||
shapeRenderer.inUse {
|
||||
shapeRenderer.rect(0f, gradTopStart, AppLoader.screenSize.screenWf, gradHeight, gradStartCol, gradStartCol, gradEndCol, gradEndCol)
|
||||
shapeRenderer.rect(0f, gradBottomEnd, AppLoader.screenSize.screenWf, -gradHeight, gradStartCol, gradStartCol, gradEndCol, gradEndCol)
|
||||
shapeRenderer.rect(0f, gradTopStart, App.scr.wf, gradHeight, gradStartCol, gradStartCol, gradEndCol, gradEndCol)
|
||||
shapeRenderer.rect(0f, gradBottomEnd, App.scr.wf, -gradHeight, gradStartCol, gradStartCol, gradEndCol, gradEndCol)
|
||||
|
||||
shapeRenderer.rect(0f, gradTopStart + gradHeight, AppLoader.screenSize.screenWf, internalHeight - (2 * gradHeight), gradEndCol, gradEndCol, gradEndCol, gradEndCol)
|
||||
shapeRenderer.rect(0f, gradTopStart + gradHeight, App.scr.wf, internalHeight - (2 * gradHeight), gradEndCol, gradEndCol, gradEndCol, gradEndCol)
|
||||
|
||||
shapeRenderer.rect(0f, 0f, AppLoader.screenSize.screenWf, gradTopStart, gradStartCol, gradStartCol, gradStartCol, gradStartCol)
|
||||
shapeRenderer.rect(0f, AppLoader.screenSize.screenHf, AppLoader.screenSize.screenWf, -(AppLoader.screenSize.screenHf - gradBottomEnd), gradStartCol, gradStartCol, gradStartCol, gradStartCol)
|
||||
shapeRenderer.rect(0f, 0f, App.scr.wf, gradTopStart, gradStartCol, gradStartCol, gradStartCol, gradStartCol)
|
||||
shapeRenderer.rect(0f, App.scr.hf, App.scr.wf, -(App.scr.hf - gradBottomEnd), gradStartCol, gradStartCol, gradStartCol, gradStartCol)
|
||||
}
|
||||
|
||||
|
||||
@@ -257,11 +256,11 @@ class UIInventoryFull(
|
||||
override fun resize(width: Int, height: Int) {
|
||||
super.resize(width, height)
|
||||
|
||||
offsetX = ((AppLoader.screenSize.screenW - internalWidth) / 2).toFloat()
|
||||
offsetY = ((AppLoader.screenSize.screenH - internalHeight) / 2).toFloat()
|
||||
offsetX = ((App.scr.width - internalWidth) / 2).toFloat()
|
||||
offsetY = ((App.scr.height - internalHeight) / 2).toFloat()
|
||||
|
||||
xEnd = (AppLoader.screenSize.screenW + internalWidth).div(2).toFloat()
|
||||
yEnd = (AppLoader.screenSize.screenH + internalHeight).div(2).toFloat()
|
||||
xEnd = (App.scr.width + internalWidth).div(2).toFloat()
|
||||
yEnd = (App.scr.height + internalHeight).div(2).toFloat()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ class UIInventoryMinimap(val full: UIInventoryFull) : UICanvas() {
|
||||
|
||||
private val debugvals = true
|
||||
|
||||
override var width: Int = AppLoader.screenSize.screenW
|
||||
override var height: Int = AppLoader.screenSize.screenH
|
||||
override var width: Int = App.scr.width
|
||||
override var height: Int = App.scr.height
|
||||
override var openCloseTime = 0.0f
|
||||
|
||||
private val MINIMAP_WIDTH = 800f
|
||||
@@ -44,7 +44,7 @@ class UIInventoryMinimap(val full: UIInventoryFull) : UICanvas() {
|
||||
|
||||
// update map panning
|
||||
// if left click is down and cursor is in the map area
|
||||
if (Gdx.input.isButtonPressed(AppLoader.getConfigInt("config_mouseprimary")) &&
|
||||
if (Gdx.input.isButtonPressed(App.getConfigInt("config_mouseprimary")) &&
|
||||
Terrarum.mouseScreenY in INVENTORY_CELLS_OFFSET_Y..INVENTORY_CELLS_OFFSET_Y + INVENTORY_CELLS_UI_HEIGHT) {
|
||||
minimapPanX += Terrarum.mouseDeltaX * 2f / minimapZoom
|
||||
minimapPanY += Terrarum.mouseDeltaY * 2f / minimapZoom
|
||||
@@ -115,23 +115,23 @@ class UIInventoryMinimap(val full: UIInventoryFull) : UICanvas() {
|
||||
batch.begin()
|
||||
|
||||
if (debugvals) {
|
||||
AppLoader.fontSmallNumbers.draw(batch, "$minimapPanX, $minimapPanY; x$minimapZoom", (AppLoader.screenSize.screenW - MINIMAP_WIDTH) / 2, -10f + INVENTORY_CELLS_OFFSET_Y)
|
||||
App.fontSmallNumbers.draw(batch, "$minimapPanX, $minimapPanY; x$minimapZoom", (App.scr.width - MINIMAP_WIDTH) / 2, -10f + INVENTORY_CELLS_OFFSET_Y)
|
||||
}
|
||||
|
||||
batch.projectionMatrix = camera.combined
|
||||
// 1px stroke
|
||||
batch.color = Color.WHITE
|
||||
batch.fillRect((AppLoader.screenSize.screenW - MINIMAP_WIDTH) / 2, -1 + INVENTORY_CELLS_OFFSET_Y.toFloat(), MINIMAP_WIDTH, 1f)
|
||||
batch.fillRect((AppLoader.screenSize.screenW - MINIMAP_WIDTH) / 2, INVENTORY_CELLS_OFFSET_Y + MINIMAP_HEIGHT, MINIMAP_WIDTH, 1f)
|
||||
batch.fillRect(-1 + (AppLoader.screenSize.screenW - MINIMAP_WIDTH) / 2, INVENTORY_CELLS_OFFSET_Y.toFloat(), 1f, MINIMAP_HEIGHT)
|
||||
batch.fillRect((AppLoader.screenSize.screenW - MINIMAP_WIDTH) / 2 + MINIMAP_WIDTH, INVENTORY_CELLS_OFFSET_Y.toFloat(), 1f, MINIMAP_HEIGHT)
|
||||
batch.fillRect((App.scr.width - MINIMAP_WIDTH) / 2, -1 + INVENTORY_CELLS_OFFSET_Y.toFloat(), MINIMAP_WIDTH, 1f)
|
||||
batch.fillRect((App.scr.width - MINIMAP_WIDTH) / 2, INVENTORY_CELLS_OFFSET_Y + MINIMAP_HEIGHT, MINIMAP_WIDTH, 1f)
|
||||
batch.fillRect(-1 + (App.scr.width - MINIMAP_WIDTH) / 2, INVENTORY_CELLS_OFFSET_Y.toFloat(), 1f, MINIMAP_HEIGHT)
|
||||
batch.fillRect((App.scr.width - MINIMAP_WIDTH) / 2 + MINIMAP_WIDTH, INVENTORY_CELLS_OFFSET_Y.toFloat(), 1f, MINIMAP_HEIGHT)
|
||||
|
||||
// control hints
|
||||
batch.color = Color.WHITE
|
||||
AppLoader.fontGame.draw(batch, full.minimapControlHelp, full.offsetX, full.yEnd - 20)
|
||||
App.fontGame.draw(batch, full.minimapControlHelp, full.offsetX, full.yEnd - 20)
|
||||
|
||||
// the minimap
|
||||
batch.draw(minimapFBO.colorBufferTexture, (AppLoader.screenSize.screenW - MINIMAP_WIDTH) / 2, INVENTORY_CELLS_OFFSET_Y.toFloat())
|
||||
batch.draw(minimapFBO.colorBufferTexture, (App.scr.width - MINIMAP_WIDTH) / 2, INVENTORY_CELLS_OFFSET_Y.toFloat())
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) {}
|
||||
|
||||
@@ -38,7 +38,7 @@ class UIItemPlayerInfoCell(
|
||||
private val backColInactive = ItemSlotImageFactory.CELLCOLOUR_BLACK
|
||||
private val backColActive = ItemSlotImageFactory.CELLCOLOUR_BLACK_ACTIVE
|
||||
|
||||
private val textRow1 = (((height / 2) - AppLoader.fontGame.lineHeight) / 2).toFloat()
|
||||
private val textRow1 = (((height / 2) - App.fontGame.lineHeight) / 2).toFloat()
|
||||
private val textRow2 = textRow1 + (height / 2)
|
||||
|
||||
private val creationTimeStr: String
|
||||
@@ -62,7 +62,7 @@ class UIItemPlayerInfoCell(
|
||||
|
||||
|
||||
worldCountStr = Lang["CONTEXT_WORLD_COUNT"] + saveInfo.get("worlds").asIntArray().size
|
||||
worldCountStrWidth = AppLoader.fontGame.getWidth(worldCountStr)
|
||||
worldCountStrWidth = App.fontGame.getWidth(worldCountStr)
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
|
||||
@@ -2,8 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.ui.UIItem
|
||||
import java.io.File
|
||||
@@ -21,7 +20,7 @@ class UIItemSavegameInfoCell(
|
||||
initialY: Int
|
||||
) : UIItem(parent, initialX, initialY) {
|
||||
|
||||
override val height: Int = AppLoader.fontGame.lineHeight.toInt() * 2
|
||||
override val height: Int = App.fontGame.lineHeight.toInt() * 2
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
|
||||
|
||||
@@ -5,12 +5,11 @@ import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.Pixmap
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.blendNormal
|
||||
import net.torvald.terrarum.blockproperties.Block
|
||||
import net.torvald.terrarum.fillRect
|
||||
import net.torvald.terrarum.gameitem.ItemID
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.BuildingMaker
|
||||
import net.torvald.terrarum.modulebasegame.ui.ItemSlotImageFactory.CELLCOLOUR_BLACK
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -28,7 +27,7 @@ class UIPaletteSelector(val parent: BuildingMaker) : UICanvas() {
|
||||
|
||||
val LINE_HEIGHT = 24
|
||||
val TEXT_OFFSETX = 3f
|
||||
val TEXT_OFFSETY = (LINE_HEIGHT - AppLoader.fontGame.lineHeight) / 2f
|
||||
val TEXT_OFFSETY = (LINE_HEIGHT - App.fontGame.lineHeight) / 2f
|
||||
|
||||
fun mouseOnTitleBar() =
|
||||
relativeMouseX in 0 until width && relativeMouseY in 0 until LINE_HEIGHT
|
||||
@@ -80,7 +79,7 @@ class UIPaletteSelector(val parent: BuildingMaker) : UICanvas() {
|
||||
|
||||
// draw "Pal."
|
||||
batch.color = UINSMenu.DEFAULT_TITLETEXTCOL
|
||||
AppLoader.fontGame.draw(batch, titleText, TEXT_OFFSETX, TEXT_OFFSETY)
|
||||
App.fontGame.draw(batch, titleText, TEXT_OFFSETX, TEXT_OFFSETY)
|
||||
|
||||
// draw background
|
||||
batch.color = CELLCOLOUR_BLACK
|
||||
@@ -91,7 +90,7 @@ class UIPaletteSelector(val parent: BuildingMaker) : UICanvas() {
|
||||
// TODO carve the overlap
|
||||
batch.draw(ItemCodex.getItemImage(back), 14f, 41f)
|
||||
batch.draw(ItemCodex.getItemImage(fore), 6f, 33f)
|
||||
AppLoader.fontSmallNumbers.draw(batch, fore.toString(), 3f, 61f)
|
||||
App.fontSmallNumbers.draw(batch, fore.toString(), 3f, 61f)
|
||||
|
||||
// draw swap icon
|
||||
batch.color = Color.WHITE
|
||||
|
||||
@@ -2,7 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.SanicLoadScreen
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
@@ -32,11 +32,11 @@ class UIProxyNewBuildingMaker : UICanvas() {
|
||||
}
|
||||
|
||||
override fun endOpening(delta: Float) {
|
||||
val ingame = BuildingMaker(AppLoader.batch)
|
||||
val ingame = BuildingMaker(App.batch)
|
||||
|
||||
Terrarum.setCurrentIngameInstance(ingame)
|
||||
SanicLoadScreen.screenToLoad = ingame
|
||||
AppLoader.setLoadScreen(SanicLoadScreen)
|
||||
App.setLoadScreen(SanicLoadScreen)
|
||||
}
|
||||
|
||||
override fun endClosing(delta: Float) {
|
||||
|
||||
@@ -3,8 +3,8 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.random.HQRNG
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.AppLoader.printdbg
|
||||
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.modulebasegame.TerrarumIngame
|
||||
@@ -37,7 +37,7 @@ class UIProxyNewRandomGame : UICanvas() {
|
||||
printdbg(this, "endOpening")
|
||||
|
||||
|
||||
val ingame = TerrarumIngame(AppLoader.batch)
|
||||
val ingame = TerrarumIngame(App.batch)
|
||||
// val worldParam = TerrarumIngame.NewWorldParameters(2400, 1280, 0x51621DL)
|
||||
val worldParam = TerrarumIngame.NewWorldParameters(2400, 1280, HQRNG().nextLong())
|
||||
|
||||
@@ -52,7 +52,7 @@ class UIProxyNewRandomGame : UICanvas() {
|
||||
//LoadScreen.screenToLoad = ingame
|
||||
//AppLoader.setScreen(LoadScreen)
|
||||
val loadScreen = WorldgenLoadScreen(ingame, worldParam.width, worldParam.height)
|
||||
AppLoader.setLoadScreen(loadScreen)
|
||||
App.setLoadScreen(loadScreen)
|
||||
}
|
||||
|
||||
override fun endClosing(delta: Float) {
|
||||
|
||||
@@ -3,12 +3,11 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
import net.torvald.terrarum.gameworld.fmod
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.*
|
||||
@@ -23,7 +22,7 @@ class UIQuickslotBar : UICanvas() {
|
||||
|
||||
private val gutter = 10 - 6 // do -6 to get a gutter size of not-enlarged cells
|
||||
override var width: Int = cellSize * SLOT_COUNT + gutter * (SLOT_COUNT - 1) // 452
|
||||
override var height: Int = ItemSlotImageFactory.slotImage.tileH + 4 + AppLoader.fontGame.lineHeight.toInt()
|
||||
override var height: Int = ItemSlotImageFactory.slotImage.tileH + 4 + App.fontGame.lineHeight.toInt()
|
||||
/**
|
||||
* In milliseconds
|
||||
*/
|
||||
|
||||
@@ -4,11 +4,10 @@ import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIQuickslotBar.Companion.COMMON_OPEN_CLOSE
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIQuickslotBar.Companion.SLOT_COUNT
|
||||
@@ -50,7 +49,7 @@ class UIQuickslotPie : UICanvas() {
|
||||
// update controls
|
||||
if (handler.isOpened || handler.isOpening) {
|
||||
val cursorPos = Vector2(Terrarum.mouseScreenX.toDouble(), Terrarum.mouseScreenY.toDouble())
|
||||
val centre = Vector2(AppLoader.screenSize.halfScreenW.toDouble(), AppLoader.screenSize.halfScreenH.toDouble())
|
||||
val centre = Vector2(App.scr.halfw.toDouble(), App.scr.halfh.toDouble())
|
||||
val deg = -(centre - cursorPos).direction.toFloat()
|
||||
|
||||
selection = Math.round(deg * slotCount / FastMath.TWO_PI)
|
||||
|
||||
@@ -5,8 +5,8 @@ import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.AppLoader.printdbgerr
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.App.printdbgerr
|
||||
import net.torvald.terrarum.QNDTreeNode
|
||||
import net.torvald.terrarum.Yaml
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -295,7 +295,7 @@ open class UIRemoCon(treeRepresentation: QNDTreeNode<String>) : UICanvas() {
|
||||
val remoConWidth = 300
|
||||
fun getRemoConHeight(menu: ArrayList<String>) = DEFAULT_LINE_HEIGHT * menu.size.plus(1)
|
||||
fun getRemoConHeight(menu: Array<String>) = DEFAULT_LINE_HEIGHT * menu.size.plus(1)
|
||||
val menubarOffX: Int; get() = (0.11 * AppLoader.screenSize.screenW).toInt()
|
||||
val menubarOffY: Int; get() = (0.82 * AppLoader.screenSize.screenH).toInt()
|
||||
val menubarOffX: Int; get() = (0.11 * App.scr.width).toInt()
|
||||
val menubarOffY: Int; get() = (0.82 * App.scr.height).toInt()
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.EMDASH
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.TerrarumScreenSize
|
||||
import net.torvald.terrarum.keyToIcon
|
||||
@@ -17,13 +17,13 @@ import net.torvald.terrarum.ui.UICanvas
|
||||
* Created by minjaesong on 2019-08-11.
|
||||
*/
|
||||
class UIScreenZoom : UICanvas(
|
||||
AppLoader.getConfigInt("config_keyzoom")
|
||||
App.getConfigInt("config_keyzoom")
|
||||
) {
|
||||
|
||||
val zoomText = "${keyToIcon(handler.toggleKeyLiteral!!)} $EMDASH Zoom Out"
|
||||
|
||||
override var width = AppLoader.fontGame.getWidth(zoomText)
|
||||
override var height = AppLoader.fontGame.lineHeight.toInt()
|
||||
override var width = App.fontGame.getWidth(zoomText)
|
||||
override var height = App.fontGame.lineHeight.toInt()
|
||||
|
||||
override var openCloseTime = 0.15f
|
||||
|
||||
@@ -38,10 +38,10 @@ class UIScreenZoom : UICanvas(
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
batch.color = Color.WHITE
|
||||
|
||||
AppLoader.fontGame.draw(
|
||||
App.fontGame.draw(
|
||||
batch, zoomText,
|
||||
(AppLoader.screenSize.screenW * TerrarumScreenSize.TV_SAFE_GRAPHICS + 1).toInt().toFloat(),
|
||||
(AppLoader.screenSize.screenH - height - AppLoader.screenSize.tvSafeGraphicsHeight).toFloat()
|
||||
(App.scr.width * TerrarumScreenSize.TV_SAFE_GRAPHICS + 1).toInt().toFloat(),
|
||||
(App.scr.height - height - App.scr.tvSafeGraphicsHeight).toFloat()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.ActorHumanoid
|
||||
import net.torvald.terrarum.gameworld.WorldTime
|
||||
import net.torvald.terrarum.modulebasegame.imagefont.WatchFont
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -46,7 +45,7 @@ class UITierOneWatch() : UICanvas() {
|
||||
ELuptimer += delta
|
||||
}
|
||||
|
||||
if (mouseUp || Gdx.input.isKeyPressed(AppLoader.getConfigInt("config_keyinteract"))) {
|
||||
if (mouseUp || Gdx.input.isKeyPressed(App.getConfigInt("config_keyinteract"))) {
|
||||
ELuptimer = 0f
|
||||
ELon = true
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.blendNormal
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -19,8 +19,8 @@ class UITitleCharactersList : UICanvas() {
|
||||
private val moduleAreaHMargin = 48
|
||||
private val moduleAreaBorder = 8
|
||||
|
||||
override var width = AppLoader.screenSize.screenW - UIRemoCon.remoConWidth - moduleAreaHMargin
|
||||
override var height = AppLoader.screenSize.screenH - moduleAreaHMargin * 2
|
||||
override var width = App.scr.width - UIRemoCon.remoConWidth - moduleAreaHMargin
|
||||
override var height = App.scr.height - moduleAreaHMargin * 2
|
||||
|
||||
private val moduleInfoCells = ArrayList<UIItemSavegameInfoCell>()
|
||||
// build characters list
|
||||
|
||||
@@ -3,7 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -20,14 +20,14 @@ class UITitleLanguage : UICanvas() {
|
||||
|
||||
|
||||
private val textAreaHMargin = 48
|
||||
override var width = (AppLoader.screenSize.screenW * 0.75).toInt()
|
||||
override var height = AppLoader.screenSize.screenH - textAreaHMargin * 2
|
||||
override var width = (App.scr.width * 0.75).toInt()
|
||||
override var height = App.scr.height - textAreaHMargin * 2
|
||||
|
||||
private val localeList = Lang.languageList.toList().sorted()
|
||||
private val textArea = UIItemTextButtonList(this,
|
||||
24,
|
||||
localeList.map { Lang.langpack["MENU_LANGUAGE_THIS_$it"] ?: "!ERR: $it" }.toTypedArray(),
|
||||
AppLoader.screenSize.screenW - width, textAreaHMargin,
|
||||
App.scr.width - width, textAreaHMargin,
|
||||
width, height,
|
||||
textAreaWidth = width,
|
||||
readFromLang = false,
|
||||
@@ -51,7 +51,7 @@ class UITitleLanguage : UICanvas() {
|
||||
|
||||
// attach listeners
|
||||
textArea.selectionChangeListener = { _, newSelectionIndex ->
|
||||
AppLoader.GAME_LOCALE = localeList[newSelectionIndex]
|
||||
App.GAME_LOCALE = localeList[newSelectionIndex]
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.ModMgr
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.blendNormal
|
||||
@@ -21,8 +21,8 @@ class UITitleModules : UICanvas() {
|
||||
private val moduleAreaHMargin = 48
|
||||
private val moduleAreaBorder = 8
|
||||
|
||||
override var width = AppLoader.screenSize.screenW - UIRemoCon.remoConWidth - moduleAreaHMargin
|
||||
override var height = AppLoader.screenSize.screenH - moduleAreaHMargin * 2
|
||||
override var width = App.scr.width - UIRemoCon.remoConWidth - moduleAreaHMargin
|
||||
override var height = App.scr.height - moduleAreaHMargin * 2
|
||||
|
||||
|
||||
private val moduleInfoCells = ArrayList<UIItemModuleInfoCell>()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Yaml
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ object UITitleRemoConYaml {
|
||||
- MENU_LABEL_RETURN
|
||||
""".trimIndent()*/
|
||||
|
||||
operator fun invoke() = if (AppLoader.IS_DEVELOPMENT_BUILD)
|
||||
operator fun invoke() = if (App.IS_DEVELOPMENT_BUILD)
|
||||
Yaml(menus + "\n" + debugTools).parse()
|
||||
else
|
||||
Yaml(menus).parse()
|
||||
|
||||
@@ -3,7 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.CreditSingleton
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -15,8 +15,8 @@ open class UITitleWallOfText(private val text: List<String>) : UICanvas() {
|
||||
|
||||
|
||||
private val textAreaHMargin = 48
|
||||
override var width = AppLoader.screenSize.screenW - UIRemoCon.remoConWidth - textAreaHMargin
|
||||
override var height = AppLoader.screenSize.screenH - textAreaHMargin * 2
|
||||
override var width = App.scr.width - UIRemoCon.remoConWidth - textAreaHMargin
|
||||
override var height = App.scr.height - textAreaHMargin * 2
|
||||
private val textArea = UIItemTextArea(this,
|
||||
UIRemoCon.remoConWidth, textAreaHMargin,
|
||||
width, height
|
||||
|
||||
@@ -3,7 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -28,7 +28,7 @@ class UITooltip : UICanvas() {
|
||||
msgWidth = msgBuffer.maxOf { font.getWidth(it) }
|
||||
}
|
||||
|
||||
private val font = AppLoader.fontGame
|
||||
private val font = App.fontGame
|
||||
private var msgWidth = 0
|
||||
|
||||
val textMarginX = 4
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.colourutil.darkerLab
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.ActorHumanoid
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -50,8 +50,8 @@ class UIVitalMetre(
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
handler.setPosition(
|
||||
AppLoader.screenSize.halfScreenW,
|
||||
AppLoader.screenSize.halfScreenH
|
||||
App.scr.halfw,
|
||||
App.scr.halfh
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user