Added sound effect for purchasing constructions and tiles

This commit is contained in:
Yair Morgenstern 2018-12-17 13:24:48 +02:00
parent fd2d55876d
commit 319cfd1fe9
4 changed files with 5 additions and 3 deletions

View file

@ -399,4 +399,5 @@ Sounds are from FreeSound.org and are either Creative Commons or Public Domain
* [SawInOut01](https://freesound.org/people/kingof_thelab/sounds/340243/) By kingof_thelab for construction picking?
* [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
* [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

Binary file not shown.

View file

@ -182,6 +182,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
shouldToggleTilesWorked=true
}
}
tileGroup.onClick {
selectedTile = tileInfo
if (shouldToggleTilesWorked) {
@ -251,7 +252,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
if(tile.getOwner()==null && tile.neighbors.any{it.getCity()==city}){
val goldCostOfTile = city.expansion.getGoldCostOfTile(tile)
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()
tileTable.add(buyTileButton)
}

View file

@ -66,7 +66,7 @@ class CityStatsTable(val cityScreen: CityScreen) : Table(){
row()
val buildingGoldCost = construction.getGoldCost(city.civInfo.policies.getAdoptedPolicies())
val buildingBuyButton = TextButton("Buy for [$buildingGoldCost] gold".tr(), CameraStageBaseScreen.skin)
buildingBuyButton.onClick {
buildingBuyButton.onClick("coin") {
city.cityConstructions.purchaseBuilding(city.cityConstructions.currentConstruction)
update()
}