Skip to content
Snippets Groups Projects
Commit 97aa9f3b authored by izajime's avatar izajime
Browse files

Fix: Ya se actualizan las monedas en el mapa de la ciudad al gastar en los edificios

parent a1f00b0a
No related branches found
No related tags found
2 merge requests!65Feature:,!60Ciudad
......@@ -15,6 +15,8 @@ class MapActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_map)
GameState.jugador.addObserver { actualizarMonedas() }
val mapButton: ImageButton= findViewById(R.id.mapButton)
val leaderboardButton: ImageButton = findViewById(R.id.leaderboardButton)
val shopButton: ImageButton = findViewById(R.id.shopButton)
......@@ -24,8 +26,7 @@ class MapActivity : AppCompatActivity() {
startActivity(intent)
}
GameState.jugador.monedas.toString().also { findViewById<TextView>(R.id.moneyText).text = it }
actualizarMonedas()
mapButton.setBackgroundResource(R.drawable.style_texto_border)
leaderboardButton.setBackgroundColor(Color.TRANSPARENT)
......@@ -55,4 +56,8 @@ class MapActivity : AppCompatActivity() {
startActivity(intent)
}
}
private fun actualizarMonedas(){
GameState.jugador.monedas.toString().also { findViewById<TextView>(R.id.moneyText).text = it }
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment