Fix two sound credits (#4020)

This commit is contained in:
SomeTroglodyte 2021-05-30 20:05:46 +02:00 committed by GitHub
parent a51978c960
commit ab4441ad1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 2 deletions

View File

@ -14,6 +14,7 @@ private enum class UncivSoundConstants (val value: String) {
Whoosh("whoosh"),
Bombard("bombard"),
Slider("slider"),
Construction("construction"),
Silent(""),
Custom("")
}
@ -52,6 +53,7 @@ class UncivSound private constructor (
val Whoosh = UncivSound(UncivSoundConstants.Whoosh)
val Bombard = UncivSound(UncivSoundConstants.Bombard)
val Slider = UncivSound(UncivSoundConstants.Slider)
val Construction = UncivSound(UncivSoundConstants.Construction)
val Silent = UncivSound(UncivSoundConstants.Silent)
/** Creates an UncivSound instance for a custom sound.
* @param filename The base filename without extension.

View File

@ -284,7 +284,9 @@ class CityConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBase
if (!cannotAddConstructionToQueue(construction, cityScreen.city, cityScreen.city.cityConstructions)) {
val addToQueueButton = ImageGetter.getImage("OtherIcons/New").apply { color = Color.BLACK }.surroundWithCircle(40f)
addToQueueButton.onClick { addConstructionToQueue(construction, cityScreen.city.cityConstructions) }
addToQueueButton.onClick(getConstructionSound(construction)) {
addConstructionToQueue(construction, cityScreen.city.cityConstructions)
}
pickConstructionButton.add(addToQueueButton)
}
pickConstructionButton.row()
@ -338,7 +340,9 @@ class CityConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBase
|| cannotAddConstructionToQueue(construction, city, cityConstructions)) {
button.disable()
} else {
button.onClick { addConstructionToQueue(construction, cityConstructions) }
button.onClick(getConstructionSound(construction)) {
addConstructionToQueue(construction, cityConstructions)
}
}
}
@ -360,6 +364,15 @@ class CityConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBase
cityScreen.game.settings.addCompletedTutorialTask("Pick construction")
}
fun getConstructionSound(construction: IConstruction): UncivSound {
return when(construction) {
is Building -> UncivSound.Construction
is BaseUnit -> UncivSound.Promote
PerpetualConstruction.gold -> UncivSound.Coin
PerpetualConstruction.science -> UncivSound.Paper
else -> UncivSound.Click
}
}
fun purchaseConstruction(construction: IConstruction) {
val city = cityScreen.city

View File

@ -566,6 +566,8 @@ Sounds are from FreeSound.org and are either Creative Commons or Public Domain
* [Woosh](https://soundbible.com/2068-Woosh.html) by Mark DiAngelo as 'slider' sound (CC Attribution 3.0 license)
* [Tornado-Siren-II](https://soundbible.com/1937-Tornado-Siren-II.html) by Delilah as part of 'nuke' sound (CC Attribution 3.0 license)
* [Explosion-Ultra-Bass](https://soundbible.com/1807-Explosion-Ultra-Bass.html) by Mark DiAngelo as part of 'nuke' sound (CC Attribution 3.0 license)
* [Short Choir](https://freesound.org/people/Breviceps/sounds/444491/) by Breviceps as 'choir' for free great person pick
# Music
The following music is from https://filmmusic.io