./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. 		 
  6. 		vint_document_set_depth(Reward_granted_doc, -125) 
  7. 		--local h = vint_object_find("phone_clip", 0, Reward_granted_doc) 
  8. 		--vint_set_property(h, "clip_enabled", true) 
  9. 		--vint_set_property(h, "visible", true) 
  10. 	end 
  11. 	 
  12. 	-- Populate data and start screen... 
  13. 	vint_dataresponder_request("cmp_rewards_success", "cmp_rewards_populate", 0) 
  14. end 
  15.  
  16. function cmp_rewards_cleanup() 
  17. end 
  18.  
  19. ------------------------------------------------------------------------------- 
  20. -- Populate function for rewards... 
  21. ------------------------------------------------------------------------------- 
  22. function cmp_rewards_populate(unlockables_to_follow) 
  23. 	--Set rewards count so it knows how many screens to display... 
  24. 	reward_granted_set_reward_count(unlockables_to_follow) 
  25. 	--Set callback on the reward screen, so we know when it is over... 
  26. 	set_reward_granted_end_cb(cmp_rewards_end) 
  27. 	--Start reward screen... 
  28. 	reward_granted_start() 
  29. end 
  30.  
  31. ------------------------------------------------------------------------------- 
  32. -- Remove screen... 
  33. ------------------------------------------------------------------------------- 
  34. function cmp_rewards_end() 
  35. 	pop_screen() 
  36. end 
  37.