Mercurial > rinkhals
changeset 172:f7f29f1d434b
Don't allow occupied buildings to be sold (dialog can probably be dropped once buildings show their number of occupants).
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Thu, 03 Sep 2009 23:03:39 +0000 |
parents | 9ea53eb919cf |
children | b2eed9977e35 |
files | gamelib/gameboard.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gamelib/gameboard.py Thu Sep 03 23:00:29 2009 +0000 +++ b/gamelib/gameboard.py Thu Sep 03 23:03:39 2009 +0000 @@ -327,7 +327,7 @@ tbl.td(widget, colspan=2) tbl.tr() tbl.td(gui.Spacer(100, 0)) - tbl.td(close_button) + tbl.td(close_button, align=1) self.disp.open(tbl) return tbl @@ -438,6 +438,10 @@ building = self.get_building(tile_pos) if building is None: return + if list(building.occupants()): + warning = gui.Button("Occupied buildings may not be sold.") + self.open_dialog(warning) + return self.add_cash(building.sell_price()) building.remove(self.tv) self.remove_building(building)