macbook notch area on the overlay

This commit is contained in:
minjaesong
2024-07-18 20:55:01 +09:00
parent d9c1cfb3b2
commit 0757764654
3 changed files with 25 additions and 5 deletions

View File

@@ -102,10 +102,7 @@ object DefaultConfig {
//"safetywarning" to true,
"maxparticles" to 768,
"temperatureunit" to 1, // -1: american, 0: kelvin, 1: celcius
"maxparticles" to 1024,
// "fancy" graphics settings
"fx_dither" to true,

View File

@@ -10,6 +10,7 @@ import com.badlogic.gdx.utils.Disposable
import com.jme3.math.FastMath
import net.torvald.random.HQRNG
import net.torvald.terrarum.App.IS_DEVELOPMENT_BUILD
import net.torvald.terrarum.TerrarumScreenSize.Companion.TV_SAFE_ACTION
import net.torvald.terrarum.gamecontroller.KeyToggler
import net.torvald.terrarum.savegame.toHex
import net.torvald.terrarum.ui.BasicDebugInfoWindow
@@ -41,6 +42,7 @@ object TerrarumPostProcessor : Disposable {
private val safeAreaCol = Color(0xffffff66.toInt())
private val safeAreaCol2 = Color(0xffffff44.toInt())
private val currentResCol = Color(0xfff066_88.toInt())
private val noGoAreaCol = Color(0xff444466.toInt())
internal val debugUI = BasicDebugInfoWindow()
@@ -286,6 +288,10 @@ object TerrarumPostProcessor : Disposable {
val rectW = tvSafeAreaW * magn
val rectH = tvSafeAreaH * magn
val macbookNotchRatio = 35f / 290f
val macbookNotchWidth = scrw * macbookNotchRatio
val macbookNotchHeight = rect2H
shapeRenderer.inUse(ShapeRenderer.ShapeType.Line) {
// centre ind
@@ -293,6 +299,23 @@ object TerrarumPostProcessor : Disposable {
shapeRenderer.line(0f, 0f, scrw, scrh)
shapeRenderer.line(0f, scrh, scrw, 0f)
// macos notch border
shapeRenderer.color = noGoAreaCol
shapeRenderer.rect(
(scrw - macbookNotchWidth) / 2f,
0f,
macbookNotchWidth,
macbookNotchHeight,
)
for (k in 0 until 8) {
val y1 = macbookNotchHeight * (k / 8f)
val y2 = y1
val x1 = (scrw - macbookNotchWidth) / 2f
val x2 = (scrw - macbookNotchWidth) / 2f + macbookNotchWidth
shapeRenderer.line(x1, y1, x2, y2)
}
// safe action area
shapeRenderer.color = safeAreaCol2
shapeRenderer.rect(

View File

@@ -29,7 +29,7 @@ class UIGraphicsControlPanel(remoCon: UIRemoCon?) : UICanvas() {
arrayOf("", { Lang["CREDITS_VFX", true] }, "h1"),
arrayOf("fx_dither", { Lang["MENU_OPTIONS_DITHER", true] }, "toggle"),
arrayOf("fx_backgroundblur", { Lang["MENU_OPTIONS_BLUR", true] }, "toggle"),
arrayOf("maxparticles", { Lang["MENU_OPTIONS_PARTICLES", true] }, "spinner,256,1024,256"),
arrayOf("maxparticles", { Lang["MENU_OPTIONS_PARTICLES", true] }, "spinner,512,2048,512"),
arrayOf("lightpasses", { Lang["MENU_OPTIONS_LIGHT_UPDATE_PASSES", true] }, "spinner,2,4,1"),
arrayOf("", { Lang["MENU_OPTIONS_DISPLAY", true] }, "h1"),
arrayOf("", { "(${Lang["MENU_LABEL_RESTART_REQUIRED"]})" }, "p"),