./store_demo.lua

  1.  
  2. Store_demo_doc_handle 	= -1 
  3. Game_platform 				= -1 
  4.  
  5. ---------------------------------------------------------------------------  
  6. -- Initialize Clothing Store 
  7. --------------------------------------------------------------------------- 
  8. function store_demo_init() 
  9. 	Store_demo_doc_handle = vint_document_find("store_demo") 
  10.  
  11. 	Game_platform = game_get_platform() 
  12.  
  13. 	-- Set hints 
  14. 	Hint_bar = Vdo_hint_bar:new("hint_bar", 0, Store_common_doc_handle) 
  15. 	local hint_data = {	 
  16. 		{CTRL_MENU_BUTTON_B, "MENU_BACK"},			 
  17. 	} 
  18. 	Hint_bar:set_hints(hint_data)  
  19. 	Hint_bar:set_visible(true) 
  20. 	 
  21. 	if Game_platform == "PC" then 
  22. 		Mouse_input_tracker:subscribe(false)		 
  23. 		Hint_bar_mouse_input_tracker = Vdo_input_tracker:new() 
  24. 	end 
  25. 	 
  26. 	if game_is_active_input_gamepad() then 
  27. 		Hint_bar_rotate = Vdo_hint_bar:new("hint_rotate", 0, Store_common_doc_handle) 
  28. 		local hint_rotate_data = { 
  29. 			{CTRL_BUTTON_RS, "STORE_ZOOM_ROTATE"}, 
  30. 		} 
  31. 		Hint_bar_rotate:set_hints(hint_rotate_data) 	 
  32. 		Hint_bar_rotate:set_visible(true)	 
  33. 	end 
  34. 	 
  35. 	Store_header:set_visible(true) 
  36. 	 
  37. 	-- Set component colors 
  38. 	Store_header:set_color(COLOR_STORE_PLANET_PRIMARY, COLOR_STORE_CLOTHING_SECONDARY, COLOR_STORE_CLOTHING_TERTIARY)	 
  39. 	Store_popup:set_color(COLOR_STORE_PLANET_PRIMARY, COLOR_STORE_CLOTHING_SECONDARY, COLOR_STORE_CLOTHING_TERTIARY)		 
  40. 	Active_list:set_highlight_color(COLOR_STORE_PLANET_PRIMARY) 
  41. 	Color_grid:set_highlight_color(COLOR_STORE_PLANET_PRIMARY) 
  42. 	 
  43. 	bg_saints_show(true) 
  44. 	bg_saints_set_type(BG_TYPE_CENTER, false, 1290, false) 
  45. end 
  46.  
  47. function store_demo_populate_list(list_data, current_index) 
  48. 	Active_list:draw_items(list_data, current_index, STORE_COMMON_LIST_SIZE, 10, LIST_FONT_SCALE) 
  49. 	Active_list:set_visible(true) 
  50. 	 
  51. 	if Game_platform == "PC" then 
  52. 		Mouse_input_tracker:remove_all() 
  53. 		Active_list:set_store("store_clothing") 
  54. 		Active_list:add_mouse_inputs("store_common", Mouse_input_tracker) 
  55. 		Mouse_input_tracker:subscribe(true) 
  56. 	end 
  57. end 
  58.  
  59.