mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-16 10:49:17 +07:00
Fix two sound credits (#4020)
This commit is contained in:
@ -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.
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user