From da1c75299674031ab96e53ba2e18e482a061dbcb Mon Sep 17 00:00:00 2001 From: minjaesong Date: Wed, 26 Jun 2019 19:32:27 +0900 Subject: [PATCH] new tiny numbers font --- assets/graphics/fonts/7x13_Tamzen7x14b.tga | 4 +- assets/graphics/fonts/milky.tga | 2 +- src/net/torvald/terrarum/AppLoader.java | 181 +++++++++++++----- src/net/torvald/terrarum/Terrarum.kt | 87 +-------- .../torvald/terrarum/imagefont/TinyAlphNum.kt | 6 +- src/net/torvald/terrarum/langpack/Lang.kt | 7 +- .../modulebasegame/ui/UIInventoryFull.kt | 16 +- .../terrarum/ui/BasicDebugInfoWindow.kt | 47 ++--- work_files/graphics/gui/composer/mockup.psd | 3 + .../graphics/gui/composer/note_block.psd | 3 + 10 files changed, 184 insertions(+), 172 deletions(-) create mode 100644 work_files/graphics/gui/composer/mockup.psd create mode 100644 work_files/graphics/gui/composer/note_block.psd diff --git a/assets/graphics/fonts/7x13_Tamzen7x14b.tga b/assets/graphics/fonts/7x13_Tamzen7x14b.tga index e3937e438..33d3b9c5b 100644 --- a/assets/graphics/fonts/7x13_Tamzen7x14b.tga +++ b/assets/graphics/fonts/7x13_Tamzen7x14b.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1b5a5fe181fa98c705df6e508433ef44b83016a0fc9de9f07b96637c898c4bfc -size 34988 +oid sha256:27ced0df21293f95493c98f1342a8924e8440471264bb4478395ce31a87c5b46 +size 93228 diff --git a/assets/graphics/fonts/milky.tga b/assets/graphics/fonts/milky.tga index 952f63cb9..ac79f1049 100644 --- a/assets/graphics/fonts/milky.tga +++ b/assets/graphics/fonts/milky.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b8b963d91e07266a2f525186a4ef36793b5f56d649308afe80dc3bc1df1d3d4c +oid sha256:413dc509f81afd37941192cc939678c1deebbc8cc7fafe5a9961354b47c48db7 size 98348 diff --git a/src/net/torvald/terrarum/AppLoader.java b/src/net/torvald/terrarum/AppLoader.java index a4f81c28c..0cc5f9d37 100644 --- a/src/net/torvald/terrarum/AppLoader.java +++ b/src/net/torvald/terrarum/AppLoader.java @@ -198,51 +198,6 @@ public class AppLoader implements ApplicationListener { public static final int minimumW = 1080; public static final int minimumH = 720; - public static void main(String[] args) { - // load configs - getDefaultDirectory(); - createDirs(); - readConfigJson(); - - - try { processor = GetCpuName.getModelName(); } - catch (IOException e1) { processor = "Unknown CPU"; } - try { processorVendor = GetCpuName.getCPUID(); } - catch (IOException e2) { processorVendor = "Unknown CPU"; } - - - ShaderProgram.pedantic = false; - - LwjglApplicationConfiguration appConfig = new LwjglApplicationConfiguration(); - appConfig.useGL30 = true; // utilising some GL trickeries, need this to be TRUE - appConfig.vSyncEnabled = getConfigBoolean("usevsync"); - appConfig.resizable = false;//true; - //appConfig.width = 1110; // photographic ratio (1.5:1) - //appConfig.height = 740; // photographic ratio (1.5:1) - appConfig.width = getConfigInt("screenwidth"); - appConfig.height = getConfigInt("screenheight"); - appConfig.backgroundFPS = getConfigInt("displayfps"); - appConfig.foregroundFPS = getConfigInt("displayfps"); - appConfig.title = GAME_NAME; - appConfig.forceExit = false; - - // load app icon - int[] appIconSizes = new int[]{256,128,64,32,16}; - for (int size : appIconSizes) { - String name = "assets/appicon" + size + ".png"; - if (new File("./" + name).exists()) { - appConfig.addIcon(name, Files.FileType.Internal); - } - } - - if (args.length == 1 && args[0].equals("isdev=true")) { - IS_DEVELOPMENT_BUILD = true; - // safe area box - //KeyToggler.INSTANCE.forceSet(Input.Keys.F11, true); - } - - new LwjglApplication(new AppLoader(appConfig), appConfig); - } private static ShaderProgram shaderBayerSkyboxFill; @@ -288,6 +243,76 @@ public class AppLoader implements ApplicationListener { public static HashSet tempFilePool = new HashSet(); public static HashSet disposableSingletonsPool = new HashSet(); + public static char gamepadLabelStart = 0xE000; // lateinit + public static char gamepadLabelSelect = 0xE000; // lateinit + public static char gamepadLabelEast = 0xE000; // lateinit + public static char gamepadLabelSouth = 0xE000; // lateinit + public static char gamepadLabelNorth = 0xE000; // lateinit + public static char gamepadLabelWest = 0xE000; // lateinit + public static char gamepadLabelLB = 0xE000; // lateinit + public static char gamepadLabelRB = 0xE000; // lateinit + public static char gamepadLabelLT = 0xE000; // lateinit + public static char gamepadLabelRT = 0xE000; // lateinit + public static char gamepadLabelLEFT = 0xE068; + public static char gamepadLabelDOWN = 0xE069; + public static char gamepadLabelUP = 0xE06A; + public static char gamepadLabelRIGHT = 0xE06B; + public static char gamepadLabelUPDOWN = 0xE072; + public static char gamepadLabelLEFTRIGHT = 0xE071; + public static char gamepadLabelDPAD = 0xE070; + public static char gamepadLabelLStick = 0xE044; + public static char gamepadLabelRStick = 0xE045; + public static char gamepadLabelLStickPush = 0xE046; + public static char gamepadLabelRStickPush = 0xE047; + + public static void main(String[] args) { + // load configs + getDefaultDirectory(); + createDirs(); + readConfigJson(); + + setGamepadButtonLabels(); + + + try { processor = GetCpuName.getModelName(); } + catch (IOException e1) { processor = "Unknown CPU"; } + try { processorVendor = GetCpuName.getCPUID(); } + catch (IOException e2) { processorVendor = "Unknown CPU"; } + + + ShaderProgram.pedantic = false; + + LwjglApplicationConfiguration appConfig = new LwjglApplicationConfiguration(); + appConfig.useGL30 = true; // utilising some GL trickeries, need this to be TRUE + appConfig.vSyncEnabled = getConfigBoolean("usevsync"); + appConfig.resizable = false;//true; + //appConfig.width = 1110; // photographic ratio (1.5:1) + //appConfig.height = 740; // photographic ratio (1.5:1) + appConfig.width = getConfigInt("screenwidth"); + appConfig.height = getConfigInt("screenheight"); + appConfig.backgroundFPS = getConfigInt("displayfps"); + appConfig.foregroundFPS = getConfigInt("displayfps"); + appConfig.title = GAME_NAME; + appConfig.forceExit = false; + + // load app icon + int[] appIconSizes = new int[]{256,128,64,32,16}; + for (int size : appIconSizes) { + String name = "assets/appicon" + size + ".png"; + if (new File("./" + name).exists()) { + appConfig.addIcon(name, Files.FileType.Internal); + } + } + + if (args.length == 1 && args[0].equals("isdev=true")) { + IS_DEVELOPMENT_BUILD = true; + // safe area box + //KeyToggler.INSTANCE.forceSet(Input.Keys.F11, true); + } + + new LwjglApplication(new AppLoader(appConfig), appConfig); + } + @Override public void create() { resourcePool = CommonResourcePool.INSTANCE; @@ -637,6 +662,72 @@ public class AppLoader implements ApplicationListener { fullscreenQuad.setIndices(new short[]{0, 1, 2, 2, 3, 0}); } + public static void setGamepadButtonLabels() { + switch (getConfigString("gamepadlabelstyle")) { + case "nwii" : gamepadLabelStart = 0xE04B; break; // + mark + case "logitech" : gamepadLabelStart = 0xE05A; break; // number 10 + case "msxbone" : gamepadLabelStart = 0xE049; break; // trifold equal sign? + default : gamepadLabelStart = 0xE042; break; // |> mark (sonyps, msxb360, generic) + } + + switch (getConfigString("gamepadlabelstyle")) { + case "nwii" : gamepadLabelSelect = 0xE04D; break; // - mark + case "logitech" : gamepadLabelSelect = 0xE059; break; // number 9 + case "sonyps" : gamepadLabelSelect = 0xE043; break; // solid rectangle + case "msxb360" : gamepadLabelSelect = 0xE041; break; // <| mark + case "msxbone" : gamepadLabelSelect = 0xE048; break; // multitask button? + default : gamepadLabelSelect = 0xE043; break; // solid rectangle + } + + + switch (getConfigString("gamepadlabelstyle")) { + case "msxb360": case "msxbone" : { + gamepadLabelSouth = 0xE061; + gamepadLabelEast = 0xE062; + gamepadLabelWest = 0xE078; + gamepadLabelNorth = 0xE079; + gamepadLabelLB = 0xE06D; + gamepadLabelRB = 0xE06E; + gamepadLabelLT = 0xE06C; + gamepadLabelRT = 0xE06F; + break; + } + case "nwii": { + gamepadLabelSouth = 0xE062; + gamepadLabelEast = 0xE061; + gamepadLabelWest = 0xE079; + gamepadLabelNorth = 0xE078; + gamepadLabelLB = 0xE065; + gamepadLabelRB = 0xE066; + gamepadLabelLT = 0xE064; + gamepadLabelRT = 0xE067; + break; + } + case "sonyps": { + gamepadLabelSouth = 0xE063; + gamepadLabelEast = 0xE050; + gamepadLabelWest = 0xE073; + gamepadLabelNorth = 0xE074; + gamepadLabelLB = 0xE07B; + gamepadLabelRB = 0xE07C; + gamepadLabelLT = 0xE07A; + gamepadLabelRT = 0xE07D; + break; + } + case "logitech": { + gamepadLabelSouth = 0xE052; + gamepadLabelEast = 0xE053; + gamepadLabelWest = 0xE051; + gamepadLabelNorth = 0xE054; + gamepadLabelLB = 0xE055; + gamepadLabelRB = 0xE056; + gamepadLabelLT = 0xE057; + gamepadLabelRT = 0xE058; + break; + } + } + } + public static void requestScreenshot() { screenshotRequested = true; } diff --git a/src/net/torvald/terrarum/Terrarum.kt b/src/net/torvald/terrarum/Terrarum.kt index fc5aa18af..070d28e5b 100644 --- a/src/net/torvald/terrarum/Terrarum.kt +++ b/src/net/torvald/terrarum/Terrarum.kt @@ -83,6 +83,7 @@ object Terrarum : Screen, Disposable { var previousScreen: Screen? = null // to be used with temporary states like StateMonitorCheck + /** Current ingame instance the game is holding */ var ingame: IngameInstance? = null private val javaHeapCircularArray = CircularArray(64) @@ -122,28 +123,6 @@ object Terrarum : Screen, Disposable { val fontGame: GameFontBase = AppLoader.fontGame val fontSmallNumbers: TinyAlphNum = AppLoader.fontSmallNumbers - var gamepadLabelStart = 0xE000.toChar() // lateinit - var gamepadLabelSelect = 0xE000.toChar() // lateinit - var gamepadLabelEast = 0xE000.toChar() // lateinit - var gamepadLabelSouth = 0xE000.toChar() // lateinit - var gamepadLabelNorth = 0xE000.toChar() // lateinit - var gamepadLabelWest = 0xE000.toChar() // lateinit - var gamepadLabelLB = 0xE000.toChar() // lateinit - var gamepadLabelRB = 0xE000.toChar() // lateinit - var gamepadLabelLT = 0xE000.toChar() // lateinit - var gamepadLabelRT = 0xE000.toChar() // lateinit - val gamepadLabelLEFT = 0xE068.toChar() - val gamepadLabelDOWN = 0xE069.toChar() - val gamepadLabelUP = 0xE06A.toChar() - val gamepadLabelRIGHT = 0xE06B.toChar() - val gamepadLabelUPDOWN = 0xE072.toChar() - val gamepadLabelLEFTRIGHT = 0xE071.toChar() - val gamepadLabelDPAD = 0xE070.toChar() - val gamepadLabelLStick = 0xE044.toChar() - val gamepadLabelRStick = 0xE045.toChar() - val gamepadLabelLStickPush = 0xE046.toChar() - val gamepadLabelRStickPush = 0xE047.toChar() - // 0x0 - 0xF: Game-related // 0x10 - 0x1F: Config // 0x100 and onward: unit tests for dev @@ -206,9 +185,6 @@ object Terrarum : Screen, Disposable { println("[Terrarum] vendor = $processorVendor") - setGamepadButtonLabels() - - AppLoader.disposableSingletonsPool.add(this) @@ -216,67 +192,6 @@ object Terrarum : Screen, Disposable { println("[Terrarum] init complete") } - private fun setGamepadButtonLabels() { - gamepadLabelStart = when (getConfigString("gamepadlabelstyle")) { - "nwii" -> 0xE04B.toChar() // + mark - "logitech" -> 0xE05A.toChar() // number 10 - "msxbone" -> 0xE049.toChar() // trifold equal sign? - else -> 0xE042.toChar() // |> mark (sonyps, msxb360, generic) - } - gamepadLabelSelect = when (getConfigString("gamepadlabelstyle")) { - "nwii" -> 0xE04D.toChar() // - mark - "logitech" -> 0xE059.toChar() // number 9 - "sonyps" -> 0xE043.toChar() // solid rectangle - "msxb360" -> 0xE041.toChar() // <| mark - "msxbone" -> 0xE048.toChar() // multitask button? - else -> 0xE043.toChar() // solid rectangle - } - - - when (getConfigString("gamepadlabelstyle")) { - "msxb360", "msxbone" -> { - gamepadLabelSouth = 0xE061.toChar() - gamepadLabelEast = 0xE062.toChar() - gamepadLabelWest = 0xE078.toChar() - gamepadLabelNorth = 0xE079.toChar() - gamepadLabelLB = 0xE06D.toChar() - gamepadLabelRB = 0xE06E.toChar() - gamepadLabelLT = 0xE06C.toChar() - gamepadLabelRT = 0xE06F.toChar() - } - "nwii" -> { - gamepadLabelSouth = 0xE062.toChar() - gamepadLabelEast = 0xE061.toChar() - gamepadLabelWest = 0xE079.toChar() - gamepadLabelNorth = 0xE078.toChar() - gamepadLabelLB = 0xE065.toChar() - gamepadLabelRB = 0xE066.toChar() - gamepadLabelLT = 0xE064.toChar() - gamepadLabelRT = 0xE067.toChar() - } - "sonyps" -> { - gamepadLabelSouth = 0xE063.toChar() - gamepadLabelEast = 0xE050.toChar() - gamepadLabelWest = 0xE073.toChar() - gamepadLabelNorth = 0xE074.toChar() - gamepadLabelLB = 0xE07B.toChar() - gamepadLabelRB = 0xE07C.toChar() - gamepadLabelLT = 0xE07A.toChar() - gamepadLabelRT = 0xE07D.toChar() - } - "logitech" -> { - gamepadLabelSouth = 0xE052.toChar() - gamepadLabelEast = 0xE053.toChar() - gamepadLabelWest = 0xE051.toChar() - gamepadLabelNorth = 0xE054.toChar() - gamepadLabelLB = 0xE055.toChar() - gamepadLabelRB = 0xE056.toChar() - gamepadLabelLT = 0xE057.toChar() - gamepadLabelRT = 0xE058.toChar() - } - } - } - val RENDER_FPS = getConfigInt("displayfps") val USE_VSYNC = getConfigBoolean("usevsync") diff --git a/src/net/torvald/terrarum/imagefont/TinyAlphNum.kt b/src/net/torvald/terrarum/imagefont/TinyAlphNum.kt index 2502c7db6..544d65563 100644 --- a/src/net/torvald/terrarum/imagefont/TinyAlphNum.kt +++ b/src/net/torvald/terrarum/imagefont/TinyAlphNum.kt @@ -12,10 +12,10 @@ import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack */ object TinyAlphNum : BitmapFont() { - internal val W = 8 - internal val H = 8 + internal val W = 7 + internal val H = 13 - internal val fontSheet = TextureRegionPack("./assets/graphics/fonts/milky.tga", W, H) + internal val fontSheet = TextureRegionPack("./assets/graphics/fonts/7x13_Tamzen7x14b.tga", W, H) init { diff --git a/src/net/torvald/terrarum/langpack/Lang.kt b/src/net/torvald/terrarum/langpack/Lang.kt index 60d6790a7..1d5a70954 100644 --- a/src/net/torvald/terrarum/langpack/Lang.kt +++ b/src/net/torvald/terrarum/langpack/Lang.kt @@ -1,10 +1,9 @@ package net.torvald.terrarum.langpack -import net.torvald.terrarum.utils.JsonFetcher -import net.torvald.terrarum.Terrarum import net.torvald.terrarum.AppLoader import net.torvald.terrarum.AppLoader.printdbg -import java.io.* +import net.torvald.terrarum.utils.JsonFetcher +import java.io.File import java.util.* /** @@ -118,7 +117,7 @@ object Lang { // special treatment if (key.startsWith("MENU_LABEL_PRESS_START_SYMBOL")) - return ret2.replace('>', Terrarum.gamepadLabelStart).capitalize() + return ret2.replace('>', AppLoader.gamepadLabelStart).capitalize() return if (key.getEndTag().contains("bg")) "${AppLoader.fontGame.charsetOverrideBulgarian}${ret2.capitalize()}${AppLoader.fontGame.charsetOverrideDefault}" diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UIInventoryFull.kt b/src/net/torvald/terrarum/modulebasegame/ui/UIInventoryFull.kt index d5ecb9cd0..80d03cebb 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UIInventoryFull.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UIInventoryFull.kt @@ -10,14 +10,14 @@ import com.badlogic.gdx.graphics.Color import net.torvald.terrarum.* import net.torvald.terrarum.AppLoader.IS_DEVELOPMENT_BUILD import net.torvald.terrarum.AppLoader.printdbg -import net.torvald.terrarum.Terrarum.gamepadLabelEast -import net.torvald.terrarum.Terrarum.gamepadLabelLStick -import net.torvald.terrarum.Terrarum.gamepadLabelLT -import net.torvald.terrarum.Terrarum.gamepadLabelNorth -import net.torvald.terrarum.Terrarum.gamepadLabelRStick -import net.torvald.terrarum.Terrarum.gamepadLabelRT -import net.torvald.terrarum.Terrarum.gamepadLabelStart -import net.torvald.terrarum.Terrarum.gamepadLabelWest +import net.torvald.terrarum.AppLoader.gamepadLabelEast +import net.torvald.terrarum.AppLoader.gamepadLabelLStick +import net.torvald.terrarum.AppLoader.gamepadLabelLT +import net.torvald.terrarum.AppLoader.gamepadLabelNorth +import net.torvald.terrarum.AppLoader.gamepadLabelRStick +import net.torvald.terrarum.AppLoader.gamepadLabelRT +import net.torvald.terrarum.AppLoader.gamepadLabelStart +import net.torvald.terrarum.AppLoader.gamepadLabelWest import net.torvald.terrarum.blockstats.MinimapComposer import net.torvald.terrarum.gameactors.ActorWBMovable import net.torvald.terrarum.langpack.Lang diff --git a/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt b/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt index ba9855619..eda960880 100644 --- a/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt +++ b/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt @@ -9,6 +9,7 @@ import net.torvald.terrarum.Terrarum.mouseTileX import net.torvald.terrarum.Terrarum.mouseTileY import net.torvald.terrarum.controller.TerrarumController import net.torvald.terrarum.gameworld.GameWorld +import net.torvald.terrarum.imagefont.TinyAlphNum import net.torvald.terrarum.modulebasegame.Ingame import net.torvald.terrarum.modulebasegame.IngameRenderer import net.torvald.terrarum.modulebasegame.gameworld.GameWorldExtension @@ -151,8 +152,8 @@ class BasicDebugInfoWindow : UICanvas() { printLine(batch, 8, "light@cursor $ccG$lightVal") if (ingame != null) { - val wallNum = ingame!!.world.getTileFromWall(mouseTileX, mouseTileY) ?: -1 - val tileNum = ingame!!.world.getTileFromTerrain(mouseTileX, mouseTileY) ?: -1 + val wallNum = ingame!!.world.getTileFromWall(mouseTileX, mouseTileY) + val tileNum = ingame!!.world.getTileFromTerrain(mouseTileX, mouseTileY) val wireNum = ingame!!.world.getWiringBlocks(mouseTileX, mouseTileY) val fluid = ingame!!.world.getFluid(mouseTileX, mouseTileY) @@ -189,8 +190,8 @@ class BasicDebugInfoWindow : UICanvas() { } drawHistogram(batch, LightmapRenderer.histogram, - Terrarum.WIDTH - histogramW - 30, - Terrarum.HEIGHT - histogramH - 30 + Terrarum.WIDTH - histogramW - TinyAlphNum.W * 2, + Terrarum.HEIGHT - histogramH - TinyAlphNum.H * 4 ) batch.color = Color.WHITE @@ -200,8 +201,8 @@ class BasicDebugInfoWindow : UICanvas() { drawGamepadAxis(gamepad, batch, gamepad.getAxis(AppLoader.getConfigInt("gamepadaxislx")), gamepad.getAxis(AppLoader.getConfigInt("gamepadaxisly")), - Terrarum.WIDTH - 135, - 40 + Terrarum.WIDTH - 128 - TinyAlphNum.W * 2, + line(3).toInt() ) } @@ -210,21 +211,21 @@ class BasicDebugInfoWindow : UICanvas() { */ // memory pressure - Terrarum.fontSmallNumbers.draw(batch, "${ccY}MEM ", (Terrarum.WIDTH - 21 * 8 - 2).toFloat(), 2f) + Terrarum.fontSmallNumbers.draw(batch, "${ccY}MEM ", (Terrarum.WIDTH - 23 * TinyAlphNum.W - 2).toFloat(), line(1)) // thread count Terrarum.fontSmallNumbers.draw(batch, "${ccY}CPUs${if (Terrarum.MULTITHREAD) ccG else ccR}${Terrarum.THREADS.toString().padStart(2, ' ')}", - (Terrarum.WIDTH - 2 - 6 * 8).toFloat(), 10f) + (Terrarum.WIDTH - 2 - 8 * TinyAlphNum.W).toFloat(), line(2)) // memory texts Terrarum.fontSmallNumbers.draw(batch, "${Terrarum.memJavaHeap}M", - (Terrarum.WIDTH - 17 * 8 - 2).toFloat(), 2f) + (Terrarum.WIDTH - 19 * TinyAlphNum.W - 2).toFloat(), line(1)) Terrarum.fontSmallNumbers.draw(batch, "/${Terrarum.memNativeHeap}M/", - (Terrarum.WIDTH - 12 * 8 - 2).toFloat(), 2f) + (Terrarum.WIDTH - 14 * TinyAlphNum.W - 2).toFloat(), line(1)) Terrarum.fontSmallNumbers.draw(batch, "${Terrarum.memXmx}M", - (Terrarum.WIDTH - 5 * 8 - 2).toFloat(), 2f) + (Terrarum.WIDTH - 7 * TinyAlphNum.W - 2).toFloat(), line(1)) // FPS count Terrarum.fontSmallNumbers.draw(batch, "${ccY}FPS${ccG}${Gdx.graphics.framesPerSecond.toString().padStart(3, ' ')}", - (Terrarum.WIDTH - 2 - 13 * 8).toFloat(), 10F) + (Terrarum.WIDTH - 3 - 15 * TinyAlphNum.W).toFloat(), line(2)) /** * Bottom left @@ -232,21 +233,21 @@ class BasicDebugInfoWindow : UICanvas() { if (ingame != null) { Terrarum.fontSmallNumbers.draw(batch, "${ccY}Actors total $ccG${ingame!!.actorContainerActive.size + ingame!!.actorContainerInactive.size}", - 2f, Terrarum.HEIGHT - 10f) + TinyAlphNum.W * 2f, Terrarum.HEIGHT - TinyAlphNum.H * 2f) Terrarum.fontSmallNumbers.draw(batch, "${ccY}Active $ccG${ingame!!.actorContainerActive.size}", - (2 + 17 * 8).toFloat(), Terrarum.HEIGHT - 10f) + (TinyAlphNum.W * 2 + 17 * 8).toFloat(), Terrarum.HEIGHT - TinyAlphNum.H * 2f) Terrarum.fontSmallNumbers.draw(batch, "${ccY}Dormant $ccG${ingame!!.actorContainerInactive.size}", - (2 + 28 * 8).toFloat(), Terrarum.HEIGHT - 10f) + (TinyAlphNum.W * 2 + 28 * 8).toFloat(), Terrarum.HEIGHT - TinyAlphNum.H * 2f) if (ingame is Ingame) { Terrarum.fontSmallNumbers.draw(batch, "${ccM}Particles $ccG${(ingame as Ingame).particlesActive}", - (2 + 41 * 8).toFloat(), Terrarum.HEIGHT - 10f) + (TinyAlphNum.W * 2 + 41 * 8).toFloat(), Terrarum.HEIGHT - TinyAlphNum.H * 2f) } } Terrarum.fontSmallNumbers.draw(batch, "${ccY}Actors rendering $ccG${IngameRenderer.renderingActorsCount}", - 2f, Terrarum.HEIGHT - 18f) + TinyAlphNum.W * 2f, Terrarum.HEIGHT - TinyAlphNum.H * 3f) Terrarum.fontSmallNumbers.draw(batch, "${ccY}UIs rendering $ccG${IngameRenderer.renderingUIsCount}", - 2f + (21 * 8), Terrarum.HEIGHT - 18f) + TinyAlphNum.W * 2f + (21 * 8), Terrarum.HEIGHT - TinyAlphNum.H * 3f) /** * Bottom right @@ -254,7 +255,7 @@ class BasicDebugInfoWindow : UICanvas() { // processor and renderer Terrarum.fontSmallNumbers.draw(batch, "$ccY$totalHardwareName", - (Terrarum.WIDTH - 2 - totalHardwareName.length * 8).toFloat(), Terrarum.HEIGHT - 10f) + (Terrarum.WIDTH - (totalHardwareName.length + 2) * TinyAlphNum.W).toFloat(), Terrarum.HEIGHT - TinyAlphNum.H * 2f) } private val processorName = AppLoader.processor.replace(Regex(""" Processor|( CPU)? @ [0-9.]+GHz"""), "") + if (AppLoader.is32BitJVM) " (32-bit)" else "" @@ -263,13 +264,13 @@ class BasicDebugInfoWindow : UICanvas() { private fun printLine(batch: SpriteBatch, l: Int, s: String) { Terrarum.fontSmallNumbers.draw(batch, - s, 10f, line(l) + s, TinyAlphNum.W * 2f, line(l) ) } private fun printLineColumn(batch: SpriteBatch, col: Int, row: Int, s: String) { Terrarum.fontSmallNumbers.draw(batch, - s, (10 + column(col)), line(row) + s, (TinyAlphNum.W * 2f + column(col)), line(row) ) } @@ -341,11 +342,11 @@ class BasicDebugInfoWindow : UICanvas() { } batch.begin() - Terrarum.fontSmallNumbers.draw(batch, gamepad.getName(), Terrarum.WIDTH - (gamepad.getName().length) * 8f, uiY.toFloat() + h + 2) + Terrarum.fontSmallNumbers.draw(batch, gamepad.getName(), Terrarum.WIDTH - (gamepad.getName().length + 2f) * TinyAlphNum.W, uiY.toFloat() + h + 2) } - private fun line(i: Int): Float = i * 10f + private fun line(i: Int): Float = i * TinyAlphNum.H.toFloat() private fun column(i: Int): Float = 300f * (i - 1) diff --git a/work_files/graphics/gui/composer/mockup.psd b/work_files/graphics/gui/composer/mockup.psd new file mode 100644 index 000000000..bac54e0ea --- /dev/null +++ b/work_files/graphics/gui/composer/mockup.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f3a4e3071c2697c1afa74f18db2636a704f8d9307917e7cdacd2284fc6e50cd +size 479748 diff --git a/work_files/graphics/gui/composer/note_block.psd b/work_files/graphics/gui/composer/note_block.psd new file mode 100644 index 000000000..b8ed486fd --- /dev/null +++ b/work_files/graphics/gui/composer/note_block.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2563b29001f6eb092f1b563ee763803f851252f7fdbe0bd627477ec16ac3419 +size 21145