feat: add notification for buildings sold due to insufficient gold

Handle 'buildingSold' events to inform players when their buildings are
automatically sold to cover upkeep costs, displaying the building name
and city where the sale occurred.
This commit is contained in:
Brian Fertig 2026-07-24 16:26:57 -06:00
parent 93b4877c2d
commit 79c18c595e
1 changed files with 5 additions and 0 deletions

View File

@ -1483,6 +1483,11 @@ export default class CivilizationGame extends Phaser.Scene {
});
},
});
} else if (e.type === 'buildingSold' && e.civ === human) {
const city = Logic.cityById(this.state, e.cityId);
const building = this.rules.buildings[e.building];
if (!city || !building) continue;
this.announceStatus(`Not enough gold! ${building.name} in ${city.name} was sold to cover upkeep.`);
} else if (e.type === 'spaceshipPart' && e.civ === human) {
const city = Logic.cityById(this.state, e.cityId);
const part = this.rules.units[e.part];