aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-07-30 17:23:41 +0200
committerLinnea Gräf <nea@nea.moe>2025-07-30 17:25:04 +0200
commit6300ff493fe90fd06162d2f4ce91339c07a50d11 (patch)
tree5ee5bc676567ab2b025067d6bebd992f659144b9 /src/main/kotlin
parenta30e0810604ee9122758879205434563ccc94738 (diff)
downloadFirmament-6300ff493fe90fd06162d2f4ce91339c07a50d11.tar.gz
Firmament-6300ff493fe90fd06162d2f4ce91339c07a50d11.tar.bz2
Firmament-6300ff493fe90fd06162d2f4ce91339c07a50d11.zip
feat(dev): unpleasant gradient cape
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/features/macros/MacroUI.kt12
-rw-r--r--src/main/kotlin/features/misc/CustomCapes.kt7
-rw-r--r--src/main/kotlin/util/mc/CustomRenderPassHelper.kt2
-rw-r--r--src/main/kotlin/util/render/CustomRenderLayers.kt2
-rw-r--r--src/main/kotlin/util/render/RenderCircleProgress.kt2
5 files changed, 18 insertions, 7 deletions
diff --git a/src/main/kotlin/features/macros/MacroUI.kt b/src/main/kotlin/features/macros/MacroUI.kt
index 8c22c5c..5a7d406 100644
--- a/src/main/kotlin/features/macros/MacroUI.kt
+++ b/src/main/kotlin/features/macros/MacroUI.kt
@@ -1,7 +1,9 @@
package moe.nea.firmament.features.macros
+import io.github.notenoughupdates.moulconfig.common.text.StructuredText
import io.github.notenoughupdates.moulconfig.gui.CloseEventListener
import io.github.notenoughupdates.moulconfig.observer.ObservableList
+import io.github.notenoughupdates.moulconfig.platform.MoulConfigPlatform
import io.github.notenoughupdates.moulconfig.xml.Bind
import moe.nea.firmament.annotations.Subscribe
import moe.nea.firmament.commands.thenExecute
@@ -62,6 +64,9 @@ class MacroUI {
val parent: Wheel,
) {
@Bind
+ fun textR() = StructuredText.of(text)
+
+ @Bind
fun delete() {
parent.editableCommands.removeIf { it === this }
parent.editableCommands.update()
@@ -82,7 +87,7 @@ class MacroUI {
}
@Bind("keyCombo")
- fun text() = binding.format().string
+ fun text() = MoulConfigPlatform.wrap(binding.format())
@field:Bind("commands")
val commands = commands.mapTo(ObservableList(mutableListOf())) { Command(it.command, this) }
@@ -246,12 +251,15 @@ class MacroUI {
@field:Bind("command")
var command: String = (action.action as CommandAction).command
+ @Bind
+ fun commandR() = StructuredText.of(command)
+
@field:Bind("combo")
val combo = action.keys.map { KeyBindingEditor(it, this) }.toObservableList()
@Bind
fun formattedCombo() =
- combo.joinToString(" > ") { it.binding.toString() }
+ StructuredText.of(combo.joinToString(" > ") { it.binding.toString() }) // TODO: this can be joined without .toString()
@Bind
fun addStep() {
diff --git a/src/main/kotlin/features/misc/CustomCapes.kt b/src/main/kotlin/features/misc/CustomCapes.kt
index d353b38..77a5c2d 100644
--- a/src/main/kotlin/features/misc/CustomCapes.kt
+++ b/src/main/kotlin/features/misc/CustomCapes.kt
@@ -121,7 +121,10 @@ object CustomCapes : FirmamentFeature {
110.seconds
)
),
-
+ UNPLEASANT_GRADIENT(
+ "unpleasant_gradient",
+ TexturedCapeRenderer(Firmament.identifier("textures/cape/unpleasant_gradient.png"))
+ ),
FURFSKY_STATIC(
"FurfSky",
TexturedCapeRenderer(Firmament.identifier("textures/cape/fsr_static.png"))
@@ -140,7 +143,7 @@ object CustomCapes : FirmamentFeature {
val byUuid =
listOf(
listOf(
- Devs.nea to AllCapes.FIRMAMENT_ANIMATED,
+ Devs.nea to AllCapes.UNPLEASANT_GRADIENT,
Devs.kath to AllCapes.FIRMAMENT_STATIC,
Devs.jani to AllCapes.FIRMAMENT_ANIMATED,
),
diff --git a/src/main/kotlin/util/mc/CustomRenderPassHelper.kt b/src/main/kotlin/util/mc/CustomRenderPassHelper.kt
index 1bd1148..12f98e4 100644
--- a/src/main/kotlin/util/mc/CustomRenderPassHelper.kt
+++ b/src/main/kotlin/util/mc/CustomRenderPassHelper.kt
@@ -109,7 +109,7 @@ class CustomRenderPassHelper(
}
fun allocateByteBuf(size: Int, init: (Std140Builder) -> Unit): ByteBuffer {
- return Std140Builder.intoBuffer(
+ return Std140Builder.intoBuffer( // TODO: i really dont know about this 16 align? but it seems to be generally correct.
ByteBuffer
.allocateDirect(MathHelper.roundUpToMultiple(size, 16))
.order(ByteOrder.nativeOrder())
diff --git a/src/main/kotlin/util/render/CustomRenderLayers.kt b/src/main/kotlin/util/render/CustomRenderLayers.kt
index 912ffdf..13412ec 100644
--- a/src/main/kotlin/util/render/CustomRenderLayers.kt
+++ b/src/main/kotlin/util/render/CustomRenderLayers.kt
@@ -45,7 +45,7 @@ object CustomRenderPipelines {
RenderPipeline.builder(RenderPipelines.POSITION_TEX_COLOR_SNIPPET)
.withVertexFormat(VertexFormats.POSITION_TEXTURE_COLOR, DrawMode.TRIANGLES)
.withLocation(Firmament.identifier("gui_textured_overlay_tris_circle"))
- .withUniform("InnerCutoutRadius", UniformType.UNIFORM_BUFFER)
+ .withUniform("CutoutRadius", UniformType.UNIFORM_BUFFER)
.withFragmentShader(Firmament.identifier("circle_discard_color"))
.withBlend(BlendFunction.TRANSLUCENT)
.build()
diff --git a/src/main/kotlin/util/render/RenderCircleProgress.kt b/src/main/kotlin/util/render/RenderCircleProgress.kt
index bbc4ace..2c837d3 100644
--- a/src/main/kotlin/util/render/RenderCircleProgress.kt
+++ b/src/main/kotlin/util/render/RenderCircleProgress.kt
@@ -98,7 +98,7 @@ object RenderCircleProgress {
).use { renderPass ->
renderPass.uploadVertices(buffer)
renderPass.setPipeline(state.layer.pipeline)
- renderPass.setUniform("InnerCutoutRadius", 4) {
+ renderPass.setUniform("CutoutRadius", 4) {
it.putFloat(state.innerCutoutRadius)
}
renderPass.draw()