./gis_grain.lua

  1. Gis_grain_doc_handle = -1 
  2. local Grain_anim_h = -1 
  3. local Is_paused = -1 
  4.  
  5. function gis_grain_init() 
  6. 	 
  7. 	vint_dataitem_add_subscription("game_paused_item", "update", "gis_grain_game_is_paused") --to check if game is paused..  
  8.  
  9. 	Gis_grain_doc_handle = vint_document_find("gis_grain") 
  10. 	Grain_anim_h 	= vint_object_find("grain_anim") 
  11. 	 
  12. 	local twn_h 	= vint_object_find("end_event_twn", Grain_anim_h) 
  13. 	vint_set_property(twn_h, "end_event", "vint_anim_loop_callback") 
  14. 	vint_apply_start_values(Grain_anim_h) 
  15. 	 
  16. 	if Is_paused == false then 
  17. 		lua_play_anim(Grain_anim_h) 
  18. 	end 
  19. 	 
  20. end 
  21.  
  22.  
  23.  
  24.  
  25.  
  26. function gis_grain_game_is_paused(di_h) 
  27. 	Is_paused = vint_dataitem_get(di_h) 
  28. 	if Is_paused == true then 
  29. 		vint_set_property(Grain_anim_h, "is_paused", true) 
  30. 	else vint_set_property(Grain_anim_h, "is_paused", false) 
  31. 	end	 
  32. end  
  33.  
  34. function gis_grain_cleanup() 
  35. 	 
  36. end 
  37.  
  38.  
  39.  
  40.  
  41.