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 »

loadData

Description

This method is called when loading a savefile. This is where all the data you've given to this object will need to be processed.

Arguments

1 guiElementInstance targetElement

the event box element this data is being displayed on.

2 any data

the data you gave to this element via game.addToEventBox().

Example

-- taken from game/game/project.lua


eventBoxText:registerNew({
	id = "review_published",
	getText = function(self, data)
		return _format(_T("REVIEWER_HAS_REVIEWED_LAYOUT", "'REVIEWER' has published a review of 'GAME_PROJECT'"), "REVIEWER", data.review:getReviewer():getName(), "GAME_PROJECT", data.game:getName())
	end,
	saveData = function(self, data)
		return {reviewer = data.review:getReviewer():getID(), game = data.game:getUniqueID()}
	end,
	loadData = function(self, targetElement, data)
		local gameObj = studio:getGameByUniqueID(data.game)
		local review = gameObj:getReviewObject(data.reviewer)
		targetElement:setReview(review)
		
		return {review = review, game = gameObj} --studio:getGameByUniqueID(data)

	end
})