Deprecated: str_replace(): Passing null to parameter #1 ($search) of type array|string is deprecated in /var/www/vhosts/gamedevstudiogame.com/httpdocs/classes/client.php on line 124

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /var/www/vhosts/gamedevstudiogame.com/httpdocs/classes/client.php on line 124
Game dev studio

Classes

Concepts

Libraries

Objects

contractor »

conversationAnswerData »

engineStatData »

issueData »

playerPlatformSpecialistData »

projectReviewConclusion »

projectReviewRemark »

randomEventData »

statusIcon »

switchCallback

Description

Called when toggling the preference.

Arguments

1 bool newState

the new state of the preference.

Example

-- 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
})