mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 04:38:18 +07:00
Added sound effect for purchasing constructions and tiles
This commit is contained in:
@ -400,3 +400,4 @@ Sounds are from FreeSound.org and are either Creative Commons or Public Domain
|
|||||||
* [Chain Snare #1](https://freesound.org/people/lovesbody/sounds/322079/) By lovesbody for Fortify
|
* [Chain Snare #1](https://freesound.org/people/lovesbody/sounds/322079/) By lovesbody for Fortify
|
||||||
* [Level up](https://freesound.org/people/Marregheriti/sounds/266100/) By Marregheriti for Promote action
|
* [Level up](https://freesound.org/people/Marregheriti/sounds/266100/) By Marregheriti for Promote action
|
||||||
* [levelup](https://freesound.org/people/Seidhepriest/sounds/382915/) By Seidhepriest for special actions (free tech, build city, hhurry wonder etc.
|
* [levelup](https://freesound.org/people/Seidhepriest/sounds/382915/) By Seidhepriest for special actions (free tech, build city, hhurry wonder etc.
|
||||||
|
* [Coin](https://freesound.org/people/TheDJoe93/sounds/97373/) By TheDJoe93 for purchasing tiles and constructions
|
BIN
android/assets/sounds/coin.mp3
Normal file
BIN
android/assets/sounds/coin.mp3
Normal file
Binary file not shown.
@ -182,6 +182,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
|
|||||||
shouldToggleTilesWorked=true
|
shouldToggleTilesWorked=true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tileGroup.onClick {
|
tileGroup.onClick {
|
||||||
selectedTile = tileInfo
|
selectedTile = tileInfo
|
||||||
if (shouldToggleTilesWorked) {
|
if (shouldToggleTilesWorked) {
|
||||||
@ -251,7 +252,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
|
|||||||
if(tile.getOwner()==null && tile.neighbors.any{it.getCity()==city}){
|
if(tile.getOwner()==null && tile.neighbors.any{it.getCity()==city}){
|
||||||
val goldCostOfTile = city.expansion.getGoldCostOfTile(tile)
|
val goldCostOfTile = city.expansion.getGoldCostOfTile(tile)
|
||||||
val buyTileButton = TextButton("Buy for [$goldCostOfTile] gold".tr(),skin)
|
val buyTileButton = TextButton("Buy for [$goldCostOfTile] gold".tr(),skin)
|
||||||
buyTileButton.onClick { city.expansion.buyTile(tile); game.screen = CityScreen(city); dispose() }
|
buyTileButton.onClick("coin") { city.expansion.buyTile(tile); game.screen = CityScreen(city); dispose() }
|
||||||
if(goldCostOfTile>city.civInfo.gold) buyTileButton.disable()
|
if(goldCostOfTile>city.civInfo.gold) buyTileButton.disable()
|
||||||
tileTable.add(buyTileButton)
|
tileTable.add(buyTileButton)
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ class CityStatsTable(val cityScreen: CityScreen) : Table(){
|
|||||||
row()
|
row()
|
||||||
val buildingGoldCost = construction.getGoldCost(city.civInfo.policies.getAdoptedPolicies())
|
val buildingGoldCost = construction.getGoldCost(city.civInfo.policies.getAdoptedPolicies())
|
||||||
val buildingBuyButton = TextButton("Buy for [$buildingGoldCost] gold".tr(), CameraStageBaseScreen.skin)
|
val buildingBuyButton = TextButton("Buy for [$buildingGoldCost] gold".tr(), CameraStageBaseScreen.skin)
|
||||||
buildingBuyButton.onClick {
|
buildingBuyButton.onClick("coin") {
|
||||||
city.cityConstructions.purchaseBuilding(city.cityConstructions.currentConstruction)
|
city.cityConstructions.purchaseBuilding(city.cityConstructions.currentConstruction)
|
||||||
update()
|
update()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user