def __init(self, loading=False, last_tax_payed=0): self.level_max = TIER.CURRENT_MAX # for now self._update_level_data(loading=loading, initial=True) self.last_tax_payed = last_tax_payed UpgradePermissionsChanged.subscribe( self._on_change_upgrade_permissions, sender=self.settlement) self._upgrade_production = None # referenced here for quick access
def remove(self): #Send update to ingamegui for removing the size of this settlement. self.session.message_bus.broadcast(SettlerInhabitantsChanged(self, -self.inhabitants)) self.session.message_bus.unsubscribe_locally(UpgradePermissionsChanged, self.settlement, self._on_change_upgrade_permissions) UpgradePermissionsChanged.unsubscribe(self._on_change_upgrade_permissions, sender=self.settlement) super(Settler, self).remove()
def set_upgrade_permissions(self, level, allowed): if self.upgrade_permissions[level] != allowed: self.upgrade_permissions[level] = allowed UpgradePermissionsChanged.broadcast(self)
def hide(self): super(MainSquareSettlerLevelTab, self).hide() UpgradePermissionsChanged.discard(self.refresh_via_message, sender=self.settlement)
def show(self): super(MainSquareSettlerLevelTab, self).show() UpgradePermissionsChanged.subscribe(self.refresh_via_message, sender=self.settlement)
def remove(self): SettlerInhabitantsChanged.broadcast(self, -self.inhabitants) UpgradePermissionsChanged.unsubscribe( self._on_change_upgrade_permissions, sender=self.settlement) super(Settler, self).remove()
def hide(self): super(MainSquareSettlerLevelTab, self).hide() UpgradePermissionsChanged.unsubscribe(self.refresh_via_message, sender=self.settlement)
def __init(self, loading=False, last_tax_payed=0): self.level_max = TIER.CURRENT_MAX # for now self._update_level_data(loading=loading, initial=True) self.last_tax_payed = last_tax_payed UpgradePermissionsChanged.subscribe(self._on_change_upgrade_permissions, sender=self.settlement) self._upgrade_production = None # referenced here for quick access
def remove(self): SettlerInhabitantsChanged.broadcast(self, -self.inhabitants) UpgradePermissionsChanged.unsubscribe(self._on_change_upgrade_permissions, sender=self.settlement) super(Settler, self).remove()
def hide(self): super().hide() UpgradePermissionsChanged.discard(self.refresh_via_message, sender=self.settlement)
def show(self): super().show() UpgradePermissionsChanged.subscribe(self.refresh_via_message, sender=self.settlement)
def __init(self, loading = False, last_tax_payed=0): self.level_max = SETTLER.CURRENT_MAX_INCR # for now self._update_level_data(loading = loading) self.last_tax_payed = last_tax_payed UpgradePermissionsChanged.subscribe(self._on_change_upgrade_permissions, sender=self.settlement)
def remove(self): UpgradePermissionsChanged.unsubscribe(self._on_change_upgrade_permissions, sender=self.settlement) super(Settler, self).remove()