def _set_taxes_and_permissions(self, sailor_taxes, pioneer_taxes, settler_taxes, citizen_taxes, sailor_upgrades, pioneer_upgrades, settler_upgrades): """Set new tax settings and building permissions.""" if abs(self.settlement.tax_settings[TIER.SAILORS] - sailor_taxes) > 1e-9: self.log.info("%s set sailors' taxes from %.1f to %.1f", self, self.settlement.tax_settings[TIER.SAILORS], sailor_taxes) SetTaxSetting(self.settlement, TIER.SAILORS, sailor_taxes).execute(self.land_manager.session) if abs(self.settlement.tax_settings[TIER.PIONEERS] - pioneer_taxes) > 1e-9: self.log.info("%s set pioneers' taxes from %.1f to %.1f", self, self.settlement.tax_settings[TIER.PIONEERS], pioneer_taxes) SetTaxSetting(self.settlement, TIER.PIONEERS, pioneer_taxes).execute(self.land_manager.session) if abs(self.settlement.tax_settings[TIER.SETTLERS] - settler_taxes) > 1e-9: self.log.info("%s set settlers' taxes from %.1f to %.1f", self, self.settlement.tax_settings[TIER.SETTLERS], settler_taxes) SetTaxSetting(self.settlement, TIER.SETTLERS, settler_taxes).execute(self.land_manager.session) if abs(self.settlement.tax_settings[TIER.CITIZENS] - citizen_taxes) > 1e-9: self.log.info("%s set citizens' taxes from %.1f to %.1f", self, self.settlement.tax_settings[TIER.CITIZENS], citizen_taxes) SetTaxSetting(self.settlement, TIER.CITIZENS, citizen_taxes).execute(self.land_manager.session) if self.settlement.upgrade_permissions[ TIER.SAILORS] != sailor_upgrades: self.log.info('%s set sailor upgrade permissions to %s', self, sailor_upgrades) SetSettlementUpgradePermissions(self.settlement, TIER.SAILORS, sailor_upgrades).execute( self.land_manager.session) if self.settlement.upgrade_permissions[ TIER.PIONEERS] != pioneer_upgrades: self.log.info('%s set pioneer upgrade permissions to %s', self, pioneer_upgrades) SetSettlementUpgradePermissions(self.settlement, TIER.PIONEERS, pioneer_upgrades).execute( self.land_manager.session) if self.settlement.upgrade_permissions[ TIER.SETTLERS] != settler_upgrades: self.log.info('%s set settler upgrade permissions to %s', self, settler_upgrades) SetSettlementUpgradePermissions(self.settlement, TIER.SETTLERS, settler_upgrades).execute( self.land_manager.session)
def on_slider_change(): tax = round( slider.getValue() / 0.5 ) * 0.5 slider.setValue(tax) if(settlement.tax_setting != tax): SetTaxSetting(settlement, tax).execute(settlement.session)
def on_slider_change(): val_label.text = unicode(slider.value) if settlement.tax_settings[level] != slider.value: SetTaxSetting(settlement, level, slider.value).execute(settlement.session)
def on_slider_change(): val_label.text = unicode(slider.getValue()) if (settlement.tax_setting != slider.getValue()): SetTaxSetting(settlement, slider.getValue()).execute(settlement.session)