Abstract. Called when saving the game to a savefile. This is where you'll need to save any data you might need to properly display the text in-between game sessions. General rule when saving: any run-time data (ie. employees, game projects) that can be removed (ie. employees) should not be saved directly (ie. their unique IDs), and you should instead save data related to that object. (ie. the employee name config)
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}
end
})