./cmp_rewards.lua

  1. function cmp_rewards_init() 
  2. 	--Check to see if we want to crop to the cellphone... and change document depths... 
  3. 	local cell_foreground_doc_h = vint_document_find("cell_foreground") 
  4. 	if cell_foreground_doc_h ~= nil and cell_foreground_doc_h ~= 0 then 
  5. 		vint_document_set_depth(Reward_granted_doc, -125) 
  6. 		local h = vint_object_find("phone_clip", 0, Reward_granted_doc) 
  7. 		vint_set_property(h, "clip_enabled", true) 
  8. 		vint_set_property(h, "visible", true) 
  9. 	end 
  10. 	 
  11. 	-- Populate data and start screen... 
  12. 	vint_dataresponder_request("cmp_rewards_success", "cmp_rewards_populate", 0) 
  13. end 
  14.  
  15. function cmp_rewards_cleanup() 
  16. end 
  17.  
  18. ------------------------------------------------------------------------------- 
  19. -- Populate function for rewards... 
  20. ------------------------------------------------------------------------------- 
  21. function cmp_rewards_populate(unlockables_to_follow) 
  22. 	--Set rewards count so it knows how many screens to display... 
  23. 	reward_granted_set_reward_count(unlockables_to_follow) 
  24. 	--Set callback on the reward screen, so we know when it is over... 
  25. 	set_reward_granted_end_cb(cmp_rewards_end) 
  26. 	--Start reward screen... 
  27. 	reward_granted_start() 
  28. end 
  29.  
  30. ------------------------------------------------------------------------------- 
  31. -- Remove screen... 
  32. ------------------------------------------------------------------------------- 
  33. function cmp_rewards_end() 
  34. 	pop_screen() 
  35. end 
  36.