musicplayer: click on the music title to close the list

This commit is contained in:
minjaesong
2024-01-10 00:17:59 +09:00
parent c4c76a41fb
commit 9c3aeab74f
5 changed files with 17 additions and 2 deletions

View File

@@ -18,5 +18,6 @@
<orderEntry type="library" scope="PROVIDED" name="jetbrains.kotlin.test" level="project" />
<orderEntry type="library" scope="PROVIDED" name="jetbrains.kotlinx.coroutines.core" level="project" />
<orderEntry type="library" scope="PROVIDED" name="io.airlift.aircompressor" level="project" />
<orderEntry type="library" scope="PROVIDED" name="jetbrains.kotlin.test1" level="project" />
</component>
</module>

View File

@@ -7,11 +7,12 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="jetbrains.kotlin.test" level="project" />
<orderEntry type="library" scope="PROVIDED" name="jetbrains.kotlin.test" level="project" />
<orderEntry type="module" module-name="TerrarumBuild" scope="PROVIDED" />
<orderEntry type="library" scope="PROVIDED" name="badlogicgames.gdx" level="project" />
<orderEntry type="library" scope="PROVIDED" name="io.airlift.aircompressor" level="project" />
<orderEntry type="library" scope="PROVIDED" name="TerrarumSansBitmap" level="project" />
<orderEntry type="library" name="apache.commons.math3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="apache.commons.math3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="jetbrains.kotlin.test1" level="project" />
</component>
</module>

View File

@@ -440,6 +440,11 @@ class MusicPlayer(private val ingame: TerrarumIngame) : UICanvas() {
}
}
}
// click on the music title to return to MODE_MOUSE_UP
else if (mouseUp && relativeMouseY.toFloat() in _posY + height - capsuleHeight .. _posY + height && Terrarum.mouseDown && !transitionOngoing && mode > MODE_MOUSE_UP) {
playControlButtonLatched = true
transitionRequest = MODE_MOUSE_UP
}
// unlatch the click latch
else if (!Terrarum.mouseDown) {
playControlButtonLatched = false

View File

@@ -30,5 +30,6 @@
<orderEntry type="library" name="github.psambit9791.jdsp" level="project" />
<orderEntry type="library" name="github.wendykierp.JTransforms" level="project" />
<orderEntry type="library" name="io.airlift.aircompressor" level="project" />
<orderEntry type="library" name="jetbrains.kotlin.test1" level="project" />
</component>
</module>

View File

@@ -0,0 +1,7 @@
package net.torvald.terrarum
/**
* Created by minjaesong on 2024-01-10.
*/
class MouseLatch {
}