Skip to content

Commit 60b1252

Browse files
committed
wip pride animations
1 parent 53da67b commit 60b1252

12 files changed

Lines changed: 56 additions & 6 deletions

File tree

‎src/main/kotlin/dartzee/core/bean/DateFilterPanel.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DateFilterPanel : JPanel() {
5050

5151
private fun getDtFrom() = cbDateFrom.date.atTime(0, 0)
5252

53-
private fun getDtTo() = cbDateTo.date.atTime(0, 0)
53+
private fun getDtTo() = cbDateTo.date.atTime(23, 59)
5454

5555
private fun makeDatePickerSettings(): DatePickerSettings {
5656
val settings = DatePickerSettings()

‎src/main/kotlin/dartzee/screen/animation/Animation.kt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ interface IAnimation {
66
fun getAnimation(): Animation
77

88
fun getAllSounds(): List<String>
9+
10+
fun getAllImages(): List<String>
911
}
1012

1113
data class Animation(
@@ -18,10 +20,14 @@ data class Animation(
1820
override fun getAnimation() = this
1921

2022
override fun getAllSounds() = listOf(wavResource)
23+
24+
override fun getAllImages() = listOfNotNull(imgResourcePath)
2125
}
2226

2327
data class CompositeAnimation(val animationOptions: List<Animation>) : IAnimation {
2428
override fun getAnimation() = animationOptions.random()
2529

2630
override fun getAllSounds() = animationOptions.map { it.wavResource }
31+
32+
override fun getAllImages() = animationOptions.mapNotNull { it.imgResourcePath }
2733
}

‎src/main/kotlin/dartzee/theme/Pride.kt‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
package dartzee.theme
22

3+
import dartzee.game.GameType
4+
import dartzee.screen.animation.Animation
5+
import dartzee.screen.animation.BadLuckTrigger
6+
import dartzee.screen.animation.BruceyBonusTrigger
7+
import dartzee.screen.animation.CompositeAnimation
8+
import dartzee.screen.animation.DartScoreTrigger
9+
import dartzee.screen.animation.IAnimation
10+
import dartzee.screen.animation.IAnimationTrigger
311
import java.awt.Color
412
import java.awt.Point
513
import java.awt.Rectangle
@@ -117,6 +125,19 @@ private fun getBannerDetails(
117125
return listOf(topBanner)
118126
}
119127

128+
private val bingpotAnimation =
129+
CompositeAnimation((1..2).map { Animation("bingpot$it", "/theme/pride/horrific/holt.png") })
130+
131+
private val prideAnimations: List<Pair<IAnimationTrigger, IAnimation>> =
132+
GameType.values().flatMap { gameType ->
133+
listOf(
134+
DartScoreTrigger(gameType, 50) to bingpotAnimation,
135+
DartScoreTrigger(gameType, 25) to bingpotAnimation,
136+
BadLuckTrigger to Animation("hooray", "/theme/pride/horrific/todd.png"),
137+
BruceyBonusTrigger to Animation("betterEfforts", "/theme/pride/horrific/julian.png"),
138+
)
139+
}
140+
120141
val Themes.PRIDE: Theme
121142
get() =
122143
Theme(
@@ -134,6 +155,7 @@ val Themes.PRIDE: Theme
134155
festivalInfo = FestivalInfo(::findPride, "The next parade begins"),
135156
customIcons = mapOf("/flags/humanFlag.png" to ::randomHumanFlag),
136157
unlockDate = LocalDate.of(2026, Month.JUNE, 1),
158+
animations = prideAnimations.toMap(),
137159
)
138160

139161
private fun findPride(year: Int): Pair<LocalDate, LocalDate> =
205 KB
Loading
246 KB
Loading
77.4 KB
Loading
145 KB
Binary file not shown.
59.8 KB
Binary file not shown.
132 KB
Binary file not shown.

‎src/main/resources/wav/hooray.wav‎

280 KB
Binary file not shown.

0 commit comments

Comments
 (0)