Called when toggling the preference.
Called when toggling the preference.
1 bool newState
the new state of the preference.
-- taken from game/preferences.lua preferences:registerNew({ id = developer.AUTO_SPEND_AP_PREFERENCE, display = _T("AUTO_SPEND_ATTRIBUTE_POINTS", "Auto-spend attribute points"), description = _T("AUTO_SPEND_ATTRIBUTE_POINTS_DESCRIPTION", "When employees level up they gain 1 attribute point, and you have to manually assign it. Enabling this preference will make employees automatically spend gained attribute points into attributes which are the most important to their role."), switchCallback = function(self, state) if state then for key, employee in ipairs(studio:getEmployees()) do employee:autoSpendAttributePoints() end end end })