aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/hud
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-06-08 00:11:46 +0200
committernea <nea@nea.moe>2023-06-08 00:11:46 +0200
commitf98a1f5d53792c026c3688fa89dea3e69910cb3a (patch)
tree873ee14abe51b1d229149c62f4958252026505fa /src/main/kotlin/moe/nea/firmament/hud
parentb65382a7b74836e13d8d9c9104971737288d1496 (diff)
downloadFirmament-f98a1f5d53792c026c3688fa89dea3e69910cb3a.tar.gz
Firmament-f98a1f5d53792c026c3688fa89dea3e69910cb3a.tar.bz2
Firmament-f98a1f5d53792c026c3688fa89dea3e69910cb3a.zip
Update to 1.20
- Remove some devenv mods that are not updated yet - Replace lib39 with fletchingtable for automixins - Use non kotlin entrypoints - Make use of DrawContext in a bunch of places
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/hud')
-rw-r--r--src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt b/src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt
index 69e0384..827835a 100644
--- a/src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt
+++ b/src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt
@@ -25,6 +25,7 @@ import io.github.cottonmc.cotton.gui.widget.data.Insets
import net.minecraft.client.util.math.MatrixStack
import kotlin.math.roundToInt
import kotlin.math.sin
+import net.minecraft.client.gui.DrawContext
val Insets.vertical get() = bottom + top
@@ -49,8 +50,8 @@ class ProgressBar(
}
- override fun paint(matrices: MatrixStack, x: Int, y: Int, mouseX: Int, mouseY: Int) {
- ScreenDrawing.coloredRect(matrices, x, y, width, height, 0xFF808080.toInt())
+ override fun paint(context: DrawContext, x: Int, y: Int, mouseX: Int, mouseY: Int) {
+ ScreenDrawing.coloredRect(context, x, y, width, height, 0xFF808080.toInt())
val (l, prog) = synchronized(this) {
label to (progress to total)
}
@@ -58,7 +59,7 @@ class ProgressBar(
if (t == null) {
ScreenDrawing.coloredRect(
- matrices,
+ context,
(x + (1 + sin(System.currentTimeMillis().toDouble() / 1000)) * width * 3 / 4 / 2).roundToInt(),
y,
width / 4,
@@ -66,10 +67,10 @@ class ProgressBar(
0xFF00FF00.toInt()
)
} else {
- ScreenDrawing.coloredRect(matrices, x, y, width * p / t, height, 0xFF00FF00.toInt())
+ ScreenDrawing.coloredRect(context, x, y, width * p / t, height, 0xFF00FF00.toInt())
}
ScreenDrawing.drawString(
- matrices,
+ context,
if (t != null) "$l ($p/$t)" else l,
HorizontalAlignment.CENTER,
x + insets.left,