./msn_proto_select.lua

  1. local Msn_proto_select_doc = 0 
  2. local Input_tracker 
  3. local Mouse_input_tracker = 0 
  4. local Mouse_back_input_tracker = 0 
  5.  
  6. local Hint_bar = 0 
  7.  
  8. local Cur_audio_id = -1 
  9.  
  10. local MSN_PROTO_SELECT_STATE_INIT		= 0 
  11. local MSN_PROTO_SELECT_STATE_GRID 		= 1 
  12. local MSN_PROTO_SELECT_STATE_ACCEPT 	= 2 
  13.  
  14. local Msn_proto_select_state = MSN_PROTO_SELECT_STATE_INIT 
  15.  
  16. local MSN_PROTO_SWATCHES_SPACING_X = 206 
  17. local MSN_PROTO_SWATCHES_SPACING_X = 206 
  18. local MSN_PROTO_DEFAULT_SELECTOR_WIDTH = 612			--Default size of selector below swatches.. 
  19. local MSN_PROTO_DEFAULT_SELECTOR_X_OFFSET = 113		--offset from swatch corner... 
  20. local MSN_PROTO_DEFAULT_SELECTOR_Y_OFFSET = 206		--offset from swatch corner... 
  21. local MSN_PROTO_ACCEPT_SELECTOR_X = 113				--offset from swatch corner... 
  22. local MSN_PROTO_ACCEPT_SELECTOR_Y = 390				--offset from swatch corner... 
  23. local MSN_PROTO_COLOR_HIGHLIGHT 	= {R = 216/255, G = 105/255, B = 26/255} 
  24. local MSN_PROTO_COLOR_NORMAL 		= {R = 172/255, G = 84/255, B = 20/255} 
  25.  
  26. Right_side_twns = {} 
  27.  
  28. Msn_proto_disconnect_dialog_handle = 0 
  29. Msn_proto_select_update_thread_handle = -1 
  30. Msn_proto_intro_audio_id = -1 
  31. Msn_proto_outro_audio_id = -1 
  32.  
  33. Msn_proto_use_buttons_on_highlights = true 
  34.  
  35. local Msn_proto_swatches = { 
  36. 	[1] = { 
  37. 		image = "ui_msn_proto_bike", 
  38. 		item_name = "MSN_PROTO_SELECT_BIKE_TITLE", 
  39. 		item_description = "MSN_PROTO_SELECT_BIKE_DESC", 
  40. 		selector_x_offset = 0, 
  41. 	}, 
  42. 	[2] = { 
  43. 		image = "ui_msn_proto_satchel", 
  44. 		item_name = "MSN_PROTO_SELECT_SATCHEL_TITLE", 
  45. 		item_description = "MSN_PROTO_SELECT_SATCHEL_DESC", 
  46. 		selector_x_offset = 0, 
  47. 	}, 
  48. 	[3] = { 
  49. 		image = "ui_msn_proto_tank", 
  50. 		item_name = "MSN_PROTO_SELECT_TANK_TITLE", 
  51. 		item_description = "MSN_PROTO_SELECT_TANK_DESC", 
  52. 		selector_x_offset = 0, 
  53. 	}, 
  54. } 
  55. local Msn_proto_swatch_selected = 1 
  56. local Msn_items_selected = {} 
  57. local Msn_num_items_selected = 0 
  58.  
  59. local Selector_bmp_h = 0 
  60. local Msn_proto_select_is_host = true 
  61.  
  62. function msn_proto_select_init() 
  63. 	--Msn_proto_select_doc = vint_document_find("msn_proto_select") 
  64. 	 
  65. 	 
  66. 	if vint_is_std_res() then 
  67. 		--dim out parts that will flicker in standard def 
  68. 		local right_side_boxes_h = vint_object_find("right_side_boxes") 
  69. 		local right_side_elements_h = vint_object_find("right_side_elements") 
  70. 		vint_set_property(right_side_boxes_h, "alpha", .33) 
  71. 		vint_set_property(right_side_elements_h, "alpha", .33) 
  72. 	end 
  73. 	 
  74. 	--Figure out stuff for bottom line graph animation... 
  75. 	local anim_h = vint_object_find("bottom_graph_line_anim") 
  76. 	local bottom_graph_line_h = vint_object_find("bottom_graph_line") 
  77. 	local bottom_graph_cap_twn_h = vint_object_find("bottom_graph_cap_twn") 
  78. 	local bottom_graph_line_twn_h = vint_object_find("bottom_graph_line_twn") 
  79. 	local line_grp_h = bottom_graph_line_h 
  80. 	local cap_twn_h = bottom_graph_cap_twn_h  
  81. 	local line_twn_h = bottom_graph_line_twn_h  
  82. 	 
  83. 	local total_loops = 40 
  84. 	for i = 0, total_loops do 
  85. 		if i > 0 then 
  86. 			line_grp_h = vint_object_clone(bottom_graph_line_h) 
  87. 			cap_twn_h = vint_object_clone(bottom_graph_cap_twn_h) 
  88. 			line_twn_h = vint_object_clone(bottom_graph_line_twn_h) 
  89. 		end 
  90. 		local x, y = vint_get_property(line_grp_h, "anchor") 
  91. 		x = i * 4 
  92. 		vint_set_property(line_grp_h, "anchor", x, y) 
  93. 		local line_h = vint_object_find("bottom_vert_line", line_grp_h) 
  94. 		local cap_h = vint_object_find("bottom_vert_line_cap", line_grp_h) 
  95. 	 
  96. 		local rand_time = rand_float(.01,.2) 
  97. 		vint_set_property(cap_twn_h, "start_time", i * (.1 + rand_time)) 
  98. 		 
  99. 		vint_set_property(line_twn_h, "start_time", i * (.1 + rand_time)) 
  100. 		vint_set_property(line_twn_h, "duration", .5 + rand_time ) 
  101. 		vint_set_property(cap_twn_h, "duration", .5+ rand_time ) 
  102. 		vint_set_property(cap_twn_h, "target_handle", cap_h) 
  103. 		vint_set_property(line_twn_h, "target_handle", line_h)	 
  104. 	end 
  105. 	 
  106. 	--Play Bottom line graph animation.. 
  107. 	lua_play_anim(anim_h, -5) 
  108. 	 
  109. 	 
  110. 	--Figure out stuff for right line graph animation... 
  111. 	anim_h = vint_object_find("right_graph_line_anim") 
  112. 	 
  113. 	local right_graph_bar_h = vint_object_find("right_graph_bar") 
  114. 	local right_line_cap_h = vint_object_find("right_line_cap_anchor_twn") 
  115. 	local right_line_fill_h = vint_object_find("right_line_fill_scale_twn") 
  116.  
  117. 	local line_grp_h = right_graph_bar_h 
  118. 	local cap_twn_h = right_line_cap_h  
  119. 	local line_twn_h = right_line_fill_h  
  120.  
  121. 	--Figure out stuff for bottom line graph animation... 
  122. 	local total_loops = 8 
  123. 	for i = 0, total_loops do 
  124. 		if i > 0 then 
  125. 			line_grp_h = vint_object_clone(right_graph_bar_h) 
  126. 			cap_twn_h = vint_object_clone(right_line_cap_h) 
  127. 			line_twn_h = vint_object_clone(right_line_fill_h) 
  128. 		end 
  129. 		local x, y = vint_get_property(line_grp_h, "anchor") 
  130. 		y = i * 12 
  131. 		 
  132. 		vint_set_property(line_grp_h, "anchor", x, y) 
  133. 		 
  134. 		local line_h = vint_object_find("right_line_fill", line_grp_h) 
  135. 		local cap_h = vint_object_find("right_line_cap", line_grp_h) 
  136. 	 
  137. 		local rand_time = rand_float(.01,.2) 
  138. 		vint_set_property(cap_twn_h, "start_time", i * (.1 + rand_time)) 
  139. 		 
  140. 		local start_time = i * (.1 + rand_time) 
  141. 		if start_time < .1 then 
  142. 			start_time = .1 
  143. 		end 
  144. 		 
  145. 		vint_set_property(line_twn_h, "start_time", start_time) 
  146. 		vint_set_property(line_twn_h, "duration", .1 + rand_time ) 
  147. 		 
  148. 		local max_scale = 25.4 
  149. 		local min_scale = 0.1 
  150. 		local y_scale = 0.625 
  151. 		local min_x = 9 
  152. 		local max_x = 413 
  153. 		 
  154. 		local rand_min = rand_float(.1,1) 
  155. 		local rand_max = rand_float(.1,1) 
  156.  
  157. 		local target_min_scale = min_scale + (max_scale - min_scale) * rand_min 
  158. 		local target_max_scale = min_scale + (max_scale - min_scale) * rand_max 
  159. 		 
  160. 		local target_min_x = min_x + (max_x - min_x) * rand_min 
  161. 		local target_max_x = min_x + (max_x - min_x) * rand_max 
  162. 		 
  163. 		vint_set_property(line_twn_h, "start_value", target_min_scale, y_scale) 
  164. 		vint_set_property(line_twn_h, "end_value", target_max_scale, y_scale) 
  165. 		 
  166. 		vint_set_property(cap_twn_h, "start_value", target_min_x, 0 ) 
  167. 		vint_set_property(cap_twn_h, "end_value", target_max_x, 0 ) 
  168. 		 
  169. 		vint_set_property(cap_twn_h, "duration", 2 + rand_time ) 
  170. 		vint_set_property(line_twn_h, "duration", 2 + rand_time ) 
  171. 		 
  172. 		vint_set_property(cap_twn_h, "target_handle", cap_h) 
  173. 		vint_set_property(line_twn_h, "target_handle", line_h)	 
  174. 		 
  175. 		Right_side_twns[line_twn_h] = {cap_twn_h = cap_twn_h, cap_h = cap_h, line_h = line_h} 
  176. 		 
  177. 		vint_set_property(line_twn_h, "end_event", "msn_proto_right_side_cb")	 
  178. 	end 
  179. 	 
  180. 	--Play Right line graph animation..	 
  181. 	lua_play_anim(anim_h) 
  182. 	 
  183. 	local Msn_proto_select_update_thread_handle = thread_new("msn_proto_update_txt") 
  184. 	 
  185. 	--Check to see if we have an active gamepad... 
  186. 	if game_is_active_input_gamepad() == false then 
  187. 		--remove all buttons 
  188. 		Msn_proto_use_buttons_on_highlights = false 
  189. 	end 
  190.  
  191. 	--Build swatches... 
  192. 	msn_proto_swatches_build() 
  193. 	msn_proto_swatches_highlight(1) 
  194. 	 
  195. 	local header1_txt_h = vint_object_find("header1_txt") 
  196. 	local header2_txt_h = vint_object_find("header2_txt") 
  197. 	vint_set_property(header2_txt_h, "text_tag", "MSN_PROTO_SELECT_OPTION_1") 
  198. 	 
  199. 	--hide hintbar 
  200. 	Hint_bar = Vdo_hint_bar:new("main_hint_bar") 
  201. 	Hint_bar:set_visible(false) 
  202. 	Hint_bar:set_highlight(1, MSN_PROTO_COLOR_NORMAL) 
  203.  
  204. 	Msn_proto_select_is_host = game_get_is_host() 
  205. 	if Msn_proto_select_is_host then 
  206. 		--Do input subscription... 
  207. 		Input_tracker = Vdo_input_tracker:new() 
  208. 		Input_tracker:add_input("pause", 		"msn_proto_select_pause", 		50) 
  209. 		Input_tracker:add_input("select", 		"msn_proto_select_input_a", 	50) 
  210. 		Input_tracker:add_input("back", 			"msn_proto_select_input_b", 	50) 
  211. 		Input_tracker:add_input("nav_up", 		"msn_proto_select_input_nav", 50) 
  212. 		Input_tracker:add_input("nav_down", 	"msn_proto_select_input_nav", 50) 
  213. 		Input_tracker:add_input("nav_left", 	"msn_proto_select_input_nav", 50) 
  214. 		Input_tracker:add_input("nav_right", 	"msn_proto_select_input_nav", 50) 
  215. 		Input_tracker:subscribe(true) 
  216. 		 
  217. 		--Set button image on selector 
  218. 		local button = Vdo_hint_button:new("button", vint_object_find("selector")) 
  219. 		button:set_button(CTRL_MENU_BUTTON_A) 
  220. 	 
  221. 		if game_get_platform() == "PC" then 
  222. 			local selector_h = vint_object_find("selector") 
  223. 			Selector_bmp_h = vint_object_find("selector_bmp", selector_h) 
  224. 			 
  225. 			--Setup hints...	 
  226. 			local hint_data = { 
  227. 				{CTRL_MENU_BUTTON_B, "MENU_BACK"}, 
  228. 			} 
  229. 			Hint_bar:set_hints(hint_data) 
  230. 			 
  231. 			Mouse_input_tracker = Vdo_input_tracker:new() 
  232. 			msn_proto_mouse_input_add()	 
  233. 			Mouse_back_input_tracker = Vdo_input_tracker:new() 
  234. 			 
  235. 		end 
  236. 	else 
  237. 		--coop player gets no options and we should overwrite some values. 
  238. 		Input_tracker = Vdo_input_tracker:new() 
  239. 		Input_tracker:add_input("map", "msn_proto_coop_input", 50) 
  240. 		Input_tracker:subscribe(true) 
  241. 		--Hide selector 
  242. 		msn_proto_swatches_highlight(-1, true) 
  243. 		 
  244. 		--Setup hints...	 
  245. 		local hint_data = { 
  246. 			{CTRL_MENU_BUTTON_BACK, "COMPLETION_COOP_DISCONNECT"}, 
  247. 		} 
  248.  
  249. 		Hint_bar:set_hints(hint_data) 
  250. 		Hint_bar:set_visible(true) 
  251. 		 
  252. 		if game_get_platform() == "PC" then 
  253. 			Mouse_back_input_tracker = Vdo_input_tracker:new() 
  254. 			Hint_bar:add_mouse_inputs("msn_proto", Mouse_back_input_tracker)		 
  255. 			Mouse_back_input_tracker:subscribe(true) 
  256. 		end	 
  257. 		--set selector to say coop options... 
  258. 		msn_proto_selector_update("MSN_PROTO_COOP_WAIT_ACTION", "MSN_PROTO_COOP_WAIT_DESC", MSN_PROTO_ACCEPT_SELECTOR_X, MSN_PROTO_ACCEPT_SELECTOR_Y, false) 
  259. 	end 
  260. 	msn_proto_state_set(MSN_PROTO_SELECT_STATE_GRID) 
  261. 	 
  262. 	local intro_audio = "ui_stag_prototype_screen" 
  263. 	Msn_proto_intro_audio_id = audio_object_post_event(intro_audio) 
  264. 	 
  265. end 
  266.  
  267. function msn_proto_select_pause() 
  268. 	dialog_open_pause_display() 
  269. end 
  270.  
  271. function msn_proto_right_side_cb(tween_h) 
  272.  
  273. 		local line_twn_h = tween_h 
  274. 		local	cap_twn_h = Right_side_twns[tween_h].cap_twn_h 
  275. 		local	cap_h = Right_side_twns[tween_h].cap_h 
  276. 		local	line_h = Right_side_twns[tween_h].line_h 
  277. 	 
  278. 		 
  279.  
  280. 		local max_scale = 25.4 
  281. 		local min_scale = 0.1 
  282. 		local y_scale = 0.625 
  283. 		local min_x = 9 
  284. 		local max_x = 413 
  285. 		 
  286. 		local rand_min = rand_float(.1,1) 
  287. 		local rand_max = rand_float(.1,1) 
  288. 		local target_max_scale = min_scale + (max_scale - min_scale) * rand_max 
  289. 		local target_max_x = min_x + (max_x - min_x) * rand_max 
  290. 		 
  291. 		local start_scale_x, start_scale_y = vint_get_property(line_h, "scale") 
  292. 		local start_x, start_y = vint_get_property(cap_h, "anchor") 
  293. 		 
  294. 		local should_i_wait = rand_int(1,3) 
  295. 		if should_i_wait == 1 then 
  296. 			target_max_scale = start_scale_x 
  297. 			target_max_x = start_x 
  298. 		end 
  299. 		 
  300. 		vint_set_property(line_twn_h, "start_value", 	start_scale_x, 	y_scale) 
  301. 		vint_set_property(line_twn_h, "end_value",		target_max_scale, y_scale) 
  302. 		 
  303. 		vint_set_property(cap_twn_h, "start_value", 	start_x, 		0) 
  304. 		vint_set_property(cap_twn_h, "end_value",		target_max_x, 	0) 
  305. 		 
  306. 		local rand_time = rand_float(1.01,2.2) 
  307. 		vint_set_property(cap_twn_h, "duration", 		rand_time) 
  308. 		vint_set_property(line_twn_h, "duration", 	rand_time) 
  309. 		 
  310. 		 
  311. 		--algorithm... 
  312. 		local algorithms = {"ease_in_out_quad", "ease_in_out_exp"} 
  313. 		local algorithm = algorithms[rand_int(1, #algorithms-1)] 
  314. 		 
  315. 		vint_set_property(cap_twn_h, "algorithm", 	algorithm) 
  316. 		vint_set_property(line_twn_h, "algorithm",	algorithm) 
  317. 		 
  318. 		local time_index = vint_get_time_index(Msn_proto_select_doc) 
  319.  
  320. 		vint_set_property(cap_twn_h, "start_time", time_index) 
  321. 		vint_set_property(line_twn_h, "start_time", time_index) 
  322. end 
  323.  
  324.  
  325. function msn_proto_select_cleanup() 
  326. 	if Msn_proto_select_update_thread_handle ~= -1 then 
  327. 		thread_kill(Msn_proto_select_update_thread_handle) 
  328. 	end 
  329. end 
  330.  
  331. function msn_proto_swatches_build() 
  332. 	local swatch_handle 
  333. 	local swatch_handle_base = vint_object_find("swatch") 
  334. 	local x, y = vint_get_property(swatch_handle_base, "anchor") 
  335. 	local start_x = x 
  336. 	local start_y = y 
  337. 	local num_swatches = #Msn_proto_swatches 
  338. 	 
  339. 	for i = 1, num_swatches do 
  340. 		if i == 1 then 
  341. 			swatch_handle = swatch_handle_base 
  342. 		else 
  343. 			swatch_handle = vint_object_clone(swatch_handle_base) 
  344. 		end 
  345. 		 
  346. 		--reposition 
  347. 		x = start_x + (MSN_PROTO_SWATCHES_SPACING_X * (i - 1))  
  348. 		vint_set_property(swatch_handle, "anchor", x, y) 
  349. 		local image_h = vint_object_find("swatch_img", swatch_handle) 
  350. 		vint_set_property(image_h,"image", Msn_proto_swatches[i].image) 
  351. 		 
  352. 		--Set button image 
  353. 		local button = Vdo_hint_button:new("button", swatch_handle) 
  354. 		button:set_button(CTRL_MENU_BUTTON_A) 
  355. 		 
  356. 		--unselect every swatch... 
  357. 		msn_proto_swatches_select(i, false) 
  358. 		 
  359. 		Msn_proto_swatches[i].handle = swatch_handle 
  360. 		Msn_proto_swatches[i].is_selected = false 
  361. 	end 
  362. end 
  363.  
  364. function msn_proto_swatches_highlight(idx, selector_is_disabled) 
  365. 	local num_swatches = #Msn_proto_swatches 
  366. 	local swatch_selector_h = vint_object_find("swatch_selector") 
  367. 	if selector_is_disabled == true then 
  368. 		vint_set_property(swatch_selector_h, "visible", false) 
  369. 	else 
  370. 		vint_set_property(swatch_selector_h, "visible", true) 
  371. 	end 
  372. 	for i = 1, num_swatches do 
  373. 		local swatch_h = Msn_proto_swatches[i].handle 
  374. 		local button_h = vint_object_find("button", swatch_h) 
  375. 		 
  376. 		if i == idx then 
  377. 			--Move selector 
  378. 			local x, y = vint_get_property(swatch_h, "anchor") 
  379. 			vint_set_property(swatch_selector_h, "anchor", x, y) 
  380. 			 
  381. 			if not selector_is_disabled then 
  382. 				--only adjust the alpha if our selector is not disabled, weird i know but we override this when the selector is disabled somewhere else... 
  383. 				vint_set_property(swatch_h, "alpha", 1) 
  384. 			end 
  385.  
  386. 			if Msn_proto_use_buttons_on_highlights then 
  387. 				-- show (A) button  
  388. 				vint_set_property(button_h, "visible", true) 
  389. 			else 
  390. 				vint_set_property(button_h, "visible", false) 
  391. 			end 
  392. 			 
  393. 			--Move selector 
  394. 			local item_name = Msn_proto_swatches[i].item_name 
  395. 			local item_description = Msn_proto_swatches[i].item_description 
  396. 			msn_proto_selector_update(item_name, item_description, MSN_PROTO_DEFAULT_SELECTOR_X_OFFSET, MSN_PROTO_ACCEPT_SELECTOR_Y) 
  397. 		else 
  398. 			if not selector_is_disabled then 
  399. 				--only adjust the alpha if our selector is not disabled, weird i know but we override this when the selector is disabled somewhere else... 
  400. 				--set unselected.. 
  401. 				vint_set_property(swatch_h, "alpha", .8)  
  402. 			end 
  403. 			 
  404. 			-- hide (A) button 
  405. 			vint_set_property(button_h, "visible", false) 
  406. 		end 
  407. 		 
  408. 	end 
  409. 	 
  410. 	--override alpha on for all the swatches... 
  411. 	if Msn_proto_select_state == MSN_PROTO_SELECT_STATE_ACCEPT then 
  412. 		local item_1_selected = Msn_items_selected[0] 
  413. 		local item_2_selected = Msn_items_selected[1] 
  414. 		for loop_idx, val in pairs(Msn_proto_swatches) do		 
  415. 			local alpha = 1 
  416. 			if loop_idx ~= item_2_selected and loop_idx ~= item_1_selected then 
  417. 				--Dim non selected items.. 
  418. 				alpha = .2 
  419. 			end 
  420. 			vint_set_property(val.handle, "alpha", alpha) 
  421. 		end 
  422. 	end 
  423. end 
  424.  
  425. function msn_proto_swatches_select(idx, is_selected) 
  426. 	local swatch_h = Msn_proto_swatches[idx].handle 
  427. 	local checkbox_h = vint_object_find("checkbox", swatch_h) 
  428. 	vint_set_property(checkbox_h, "visible", is_selected) 
  429. 	 
  430. 	--Store selection... 
  431. 	Msn_proto_swatches[idx].is_selected = is_selected 
  432. end 
  433.  
  434. function msn_proto_selector_update(title_txt, description_txt, x, y, has_button) 
  435. 	local selector_h = vint_object_find("selector") 
  436. 	 
  437. 	--Set width of selector... 
  438. 	local selector_bmp_h = vint_object_find("selector_bmp", selector_h) 
  439. 	local selector_width, selector_height = element_get_actual_size(selector_bmp_h) 
  440. 	element_set_actual_size(selector_bmp_h, MSN_PROTO_DEFAULT_SELECTOR_WIDTH, selector_height) 
  441.  
  442. 	--Set text elements... 
  443. 	local selector_header_txt_h = vint_object_find("selector_header_txt", selector_h) 
  444. 	local selector_desc_txt_h = vint_object_find("selector_desc_txt", selector_h) 
  445. 	vint_set_property(selector_header_txt_h, "text_tag", title_txt) 
  446. 	vint_set_property(selector_desc_txt_h, "text_tag", description_txt) 
  447. 	 
  448. 	--Move selector 
  449. 	vint_set_property(selector_h, "anchor", x, y) 
  450. 	--Change text alignment 
  451. 		 
  452. 	local header_x, header_y = vint_get_property(selector_header_txt_h, "anchor") 
  453. 	local button_h = vint_object_find("button", selector_h) 
  454. 	 
  455. 	if has_button == true and Msn_proto_use_buttons_on_highlights then 
  456. 		vint_set_property(selector_header_txt_h, "anchor", 38, header_y) 
  457. 		vint_set_property(button_h, "visible", true) 
  458. 	else 
  459. 		vint_set_property(selector_header_txt_h, "anchor", 8, header_y) 
  460. 		vint_set_property(button_h, "visible", false) 
  461. 	end 
  462. end 
  463.  
  464. function msn_proto_selector_highlight(is_highlighted) 
  465. 	local selector_h = vint_object_find("selector") 
  466. 	local selector_bmp_h = vint_object_find("selector_bmp", selector_h) 
  467. 	local selector_header_txt_h = vint_object_find("selector_header_txt", selector_h) 
  468. 	--local text_color = {1/255, 8/255, 13/255} 
  469. 	-- 
  470. 	--local selector_color_2 = {231/255, 126/255, 50/255} 
  471. 	 
  472. 	local selector_pulse_anim_h = vint_object_find("selector_pulse_anim") 
  473. 	if is_highlighted == true then 
  474. 		--vint_set_property(selector_bmp_h, "tint", selector_color_2[1], selector_color_2[2], selector_color_2[3]) 
  475. 		--vint_set_property(selector_header_txt_h, "tint", selector_color[1], selector_color[2], selector_color[3]) 
  476. 		lua_play_anim(selector_pulse_anim_h) 
  477. 	else 
  478. 		vint_set_property(selector_pulse_anim_h, "is_paused", true) 
  479. 		vint_set_property(selector_bmp_h, "alpha", 1) 
  480. 		--vint_set_property(selector_header_txt_h, "tint", text_color[1], text_color[2], text_color[3]) 
  481. 		--vint_set_property(selector_bmp_h, "tint", selector_color[1], selector_color[2], selector_color[3]) 
  482. 	end  
  483. end 
  484.  
  485. function msn_proto_select_cursor_move(direction) 
  486. 	if direction == -1 then 
  487. 		local num_swatches = #Msn_proto_swatches 
  488. 		Msn_proto_swatch_selected = Msn_proto_swatch_selected - 1  
  489. 		if Msn_proto_swatch_selected < 1 then 
  490. 			Msn_proto_swatch_selected = num_swatches 
  491. 		end 
  492. 	elseif direction == 1 then 
  493. 		local num_swatches = #Msn_proto_swatches 
  494. 		Msn_proto_swatch_selected = Msn_proto_swatch_selected + 1  
  495. 		if Msn_proto_swatch_selected > num_swatches then 
  496. 			Msn_proto_swatch_selected = 1 
  497. 		end 
  498. 	else  
  499. 		--bad direction return... 
  500. 		return 
  501. 	end 
  502. 	msn_proto_swatches_highlight(Msn_proto_swatch_selected) 
  503. end 
  504.  
  505. ------------------------------------------------------------------------------- 
  506. -- Nav left and right 
  507. -- 
  508. function msn_proto_select_input_nav(event, acceleration) 
  509. 	--Exit early if we are in init state... 
  510. 	if Msn_proto_select_state == MSN_PROTO_SELECT_STATE_INIT then 
  511. 		return 
  512. 	end 
  513. 	 
  514. 	--Naving left and right 
  515. 	if Msn_proto_select_state == MSN_PROTO_SELECT_STATE_GRID then 
  516. 		--Navigate the grid 
  517. 		if event == "nav_left" then 
  518. 			audio_object_post_event("ui_stag_prototype_scroll") 
  519. 			msn_proto_select_cursor_move(-1) 
  520. 		elseif event == "nav_right" then 
  521. 			audio_object_post_event("ui_stag_prototype_scroll") 
  522. 			msn_proto_select_cursor_move(1) 
  523. 		end 
  524. 	end 
  525. end 
  526.  
  527. function msn_proto_select_input_a() 
  528. 	if Msn_proto_select_state == MSN_PROTO_SELECT_STATE_GRID then 
  529. 		--Select the item 
  530. 		local item_was_selected = msn_proto_select_item(Msn_proto_swatch_selected) 
  531. 		 
  532. 		--only nav if we selected an item.. 
  533. 		if item_was_selected then 
  534. 			msn_proto_select_cursor_move(1) 
  535. 		end 
  536. 		 
  537. 		audio_object_post_event("ui_stag_prototype_select_press") 
  538. 		 
  539. 	elseif Msn_proto_select_state == MSN_PROTO_SELECT_STATE_ACCEPT then 
  540. 		 
  541. 		audio_stop(Msn_proto_intro_audio_id) 
  542. 		 
  543. 		local audio_out = "ui_stag_prototype_screen_stop" 
  544. 		Msn_proto_outro_audio_id = audio_object_post_event(audio_out) 
  545. 		 
  546. 		--Make selection 
  547. 		msn_proto_ready_to_exit() 
  548. 	end 
  549. end 
  550.  
  551. function msn_proto_select_input_b() 
  552. 	if Msn_proto_select_state == MSN_PROTO_SELECT_STATE_ACCEPT then 
  553. 		--reset state if we are in the accept state... 
  554. 		msn_proto_state_set(MSN_PROTO_SELECT_STATE_GRID) 
  555. 	end 
  556. 	 
  557. 	--Uncheck previous item and select it... 
  558. 	local last_item_selected = Msn_items_selected[Msn_num_items_selected-1] 
  559. 	 
  560. 	if last_item_selected ~= nil then 
  561. 		msn_proto_select_item(last_item_selected) 
  562. 		Msn_proto_swatch_selected = last_item_selected 
  563. 		msn_proto_swatches_highlight(Msn_proto_swatch_selected) 
  564. 	end 
  565.  
  566. 	if Mouse_input_tracker ~= 0 then 
  567. 		msn_proto_selector_highlight(false) 
  568. 	end 
  569. 	 
  570. 	audio_object_post_event("ui_stag_prototype_cancel") 
  571. end 
  572.  
  573. ------------------------------------------------------------------------------- 
  574. -- Mouse inputs 
  575. -- 
  576.  
  577. function msn_proto_mouse_input_add() 
  578. 	for i = 1, #Msn_proto_swatches do 
  579. 		Mouse_input_tracker:add_mouse_input("mouse_move_always", 	"msn_proto_mouse_move", 	50, Msn_proto_swatches[i].handle) 
  580. 		Mouse_input_tracker:add_mouse_input("mouse_click", "msn_proto_mouse_click", 	50, Msn_proto_swatches[i].handle) 
  581. 	end 
  582. 	Mouse_input_tracker:add_mouse_input("mouse_move", 	"msn_proto_mouse_move", 	50, Selector_bmp_h) 
  583. 	Mouse_input_tracker:add_mouse_input("mouse_click", "msn_proto_mouse_click", 	50, Selector_bmp_h) 
  584. 	Mouse_input_tracker:subscribe(true) 
  585. end 
  586.  
  587. function msn_proto_mouse_click(event, target_handle, mouse_x, mouse_y) 
  588. 	--Select an item... 
  589. 	local hint_bar_hit_index = Hint_bar:get_hint_index(target_handle)	 
  590. 	if hint_bar_hit_index == 1 then 
  591. 		if Msn_proto_select_is_host then 
  592. 			msn_proto_select_input_b() 
  593. 		else 
  594. 			msn_proto_coop_input("map") 
  595. 		end 
  596. 		return 
  597. 	end 
  598. 	if Msn_proto_select_state == MSN_PROTO_SELECT_STATE_ACCEPT then 
  599. 		local found_hit = false 
  600. 		if target_handle == Selector_bmp_h then 
  601. 			found_hit = true 
  602. 		end 
  603. 		if found_hit == true then 
  604. 			--stop audio and play outro audio. 
  605. 			audio_stop(Msn_proto_intro_audio_id) 
  606. 			local audio_out = "ui_stag_prototype_screen_stop" 
  607. 			Msn_proto_outro_audio_id = audio_object_post_event(audio_out) 
  608. 			 
  609. 			--Now lets exit... 
  610. 			msn_proto_ready_to_exit() 
  611. 		end 
  612. 	else 
  613. 		--Swatch Select 
  614. 		--loop through swatched to find the handle. 
  615. 		for i = 1, #Msn_proto_swatches do 
  616. 			if target_handle == Msn_proto_swatches[i].handle then		 
  617. 				local item_1_selected = Msn_items_selected[0] 
  618. 				local item_2_selected = Msn_items_selected[1] 
  619. 				if (item_1_selected ~= nil and  i == item_1_selected) or (i == item_2_selected and item_2_selected ~= nil) then 
  620. 					return 
  621. 				end 
  622. 			 
  623. 				local selected = not Msn_proto_swatches[i].is_selected 
  624. 				audio_object_post_event("ui_stag_prototype_select_press") 
  625. 				msn_proto_select_item(i) 
  626. 				 
  627. 				msn_proto_swatches_highlight(-1, true) 
  628. 			end 
  629. 		end 
  630. 	end 
  631. end 
  632.  
  633. function msn_proto_mouse_move(event, target_handle) 
  634.  
  635. 	local hint_bar_hit_index = Hint_bar:get_hint_index(target_handle)	 
  636. 	if hint_bar_hit_index == 1 then 
  637. 		Hint_bar:set_highlight(1, MSN_PROTO_COLOR_HIGHLIGHT) 
  638. 	else 
  639. 		Hint_bar:set_highlight(1, MSN_PROTO_COLOR_NORMAL) 
  640. 	end 
  641. 	   
  642. 	--highlight an item... 
  643. 	if Msn_proto_select_state == MSN_PROTO_SELECT_STATE_ACCEPT then 
  644. 	else 
  645. 		--Swatch Select 
  646. 		--loop through swatched to find the handle. 
  647. 		for i = 1, #Msn_proto_swatches do 
  648. 			if target_handle == Msn_proto_swatches[i].handle then 
  649. 				if Msn_proto_swatch_selected ~= i then 
  650. 					if Msn_proto_select_state == MSN_PROTO_SELECT_STATE_ACCEPT then 
  651. 						--No highlighting if in accept state... 
  652. 						return 
  653. 					end 
  654. 					 
  655. 					local item_1_selected = Msn_items_selected[0] 
  656. 					local item_2_selected = Msn_items_selected[1] 
  657. 					if (item_1_selected ~= nil and  i == item_1_selected) or (i == item_2_selected and item_2_selected ~= nil) then 
  658. 						return 
  659. 					end 
  660. 				 
  661. 			 
  662. 					audio_object_post_event("ui_stag_prototype_scroll") 
  663. 					msn_proto_swatches_highlight(i) 
  664. 					Msn_proto_swatch_selected = i  
  665. 				end 
  666. 			end 
  667. 		end 
  668. 	end 
  669. end 
  670.  
  671. function msn_proto_mouse_drag(event, target_handle, mouse_x, mouse_y) 
  672. end 
  673.  
  674. function msn_proto_mouse_drag_release(event, target_handle, mouse_x, mouse_y) 
  675. end 
  676.  
  677.  
  678. function msn_proto_select_item(idx) 
  679.  
  680. 	local item_was_selected = true 
  681. 	if Msn_proto_swatches[idx].is_selected == false then 
  682. 		--select item in list... 
  683. 		msn_proto_swatches_select(idx, true) 
  684. 		 
  685. 		--add items to our selected list... 
  686. 		Msn_items_selected[Msn_num_items_selected] = idx 
  687. 		Msn_num_items_selected = Msn_num_items_selected + 1 
  688. 	else 
  689. 		--unselect item in list... 
  690. 		msn_proto_swatches_select(idx, false) 
  691. 		 
  692. 		--remove entry in our selected list... 
  693. 		for loop_idx, val in pairs(Msn_items_selected) do 
  694. 			if val == idx then 
  695. 				Msn_items_selected[loop_idx] = nil 
  696. 			end 
  697. 		end 
  698. 		 
  699. 		--decrement items selected... 
  700. 		Msn_num_items_selected = Msn_num_items_selected - 1 
  701. 		item_was_selected = false 
  702. 	end 
  703. 	 
  704. 	local header2_txt_h = vint_object_find("header2_txt") 
  705. 	if Msn_num_items_selected == 0 then 
  706. 		vint_set_property(header2_txt_h, "text_tag", "MSN_PROTO_SELECT_OPTION_1") 
  707. 	elseif Msn_num_items_selected == 1 then 
  708. 		vint_set_property(header2_txt_h, "text_tag", "MSN_PROTO_SELECT_OPTION_2") 
  709. 	elseif Msn_num_items_selected == 2 then 
  710. 		vint_set_property(header2_txt_h, "text_tag", "MSN_PROTO_SELECT_OPTION_3") 
  711. 	end 
  712. 	local pulse_objective_anim_h = vint_object_find("pulse_objective_anim") 
  713. 	lua_play_anim(pulse_objective_anim_h) 
  714.  
  715. 	--if 2 items are selected then we are ready to go... 
  716. 	if Msn_num_items_selected == 2 then 
  717. 		--Change state... 
  718. 		msn_proto_state_set(MSN_PROTO_SELECT_STATE_ACCEPT) 
  719. 		 
  720. 		--highlight accept button... 
  721. 		 
  722. 		local item_1_selected = Msn_items_selected[0] 
  723. 		local item_2_selected = Msn_items_selected[1] 
  724. 		local item_1_name = Msn_proto_swatches[item_1_selected].item_name 
  725. 		local item_2_name = Msn_proto_swatches[item_2_selected].item_name 
  726. 	 
  727. 		for idx, val in pairs(Msn_proto_swatches) do		 
  728. 			local alpha = 1 
  729. 			if idx ~= item_2_selected and idx ~= item_1_selected then 
  730. 				--Dim non selected items.. 
  731. 				alpha = .2 
  732. 			end 
  733. 			vint_set_property(val.handle, "alpha", alpha) 
  734. 		end 
  735.  
  736. 		 
  737. 		local values = {[0] = item_1_name, [1] = item_2_name} 
  738. 		local accept_description_txt = vint_insert_values_in_string("MSN_PROTO_CONFIRM_DESC", values) 
  739. 		 
  740. 		msn_proto_selector_update("MSN_PROTO_CONFIRM_ACTION", accept_description_txt, MSN_PROTO_ACCEPT_SELECTOR_X, MSN_PROTO_ACCEPT_SELECTOR_Y, true) 
  741. 		 
  742. 		--unhighlight 
  743. 		msn_proto_swatches_highlight(-1, true) 
  744. 	end 
  745. 	 
  746. 	if Msn_num_items_selected > 0 then 
  747. 		msn_proto_back_button_show(true) 
  748. 	else 
  749. 		msn_proto_back_button_show(false) 
  750. 	end 
  751. 	 
  752. 	return item_was_selected 
  753. end 
  754.  
  755. ------------------------------------------------------------------------------- 
  756. -- Changes state of our screen... 
  757. -- @state	MSN_PROTO_SELECT_STATE_ACCEPT, MSN_PROTO_SELECT_STATE_GRID  
  758. -- 
  759. function msn_proto_state_set(state)  
  760. 	if state == MSN_PROTO_SELECT_STATE_ACCEPT then 
  761. 		msn_proto_selector_highlight(true) 
  762. 	else 
  763. 		msn_proto_selector_highlight(false) 
  764. 	end 
  765. 	Msn_proto_select_state = state 
  766. end 
  767. 		 
  768.  
  769. function msn_proto_back_button_show(visible) 
  770. 	if Mouse_input_tracker ~= 0 then 
  771. 		Hint_bar:set_visible(visible) 
  772. 		 
  773. 		Mouse_back_input_tracker:remove_all() 
  774. 		if visible then 
  775. 			--enable hints... 
  776. 			Hint_bar:add_mouse_inputs("msn_proto", Mouse_back_input_tracker)		 
  777. 			Mouse_back_input_tracker:subscribe(true) 
  778. 		end 
  779. 	end 
  780. end 
  781.  
  782.  
  783. function msn_proto_ready_to_exit() 
  784. 	--Call C++ and tell it what items we have selected... 
  785. 	-- pseudo code below: pass game these variables... Msn_items_selected[0], Msn_items_selected[1] 
  786. 	game_proto_select(Msn_items_selected[0], Msn_items_selected[1]) 
  787. 	-- unload_interface() 
  788. 	-- local document_h = vint_document_find("msn_proto_select") 
  789. 	-- vint_document_unload(document_h) 
  790. 	pop_screen() 
  791. end 
  792.  
  793. ------------------------------------------------------------------------------- 
  794. -- Player choice input for coop... 
  795. -- 
  796. function msn_proto_coop_input(event) 
  797. 	if event == "map" then 
  798. 		--Coop quit dialog brings up the quit dialog for the coop player(Client) if they want to quit or not... 
  799. 		local options = { [0] = "CONTROL_YES", [1] = "CONTROL_NO" } 
  800. 		Msn_proto_disconnect_dialog_handle = dialog_box_open("MENU_TITLE_WARNING", "DIALOG_PAUSE_DISCONNECT_PROMPT", options, "msn_proto_coop_disconnect", 1, DIALOG_PRIORITY_SYSTEM_CRITICAL, true, nil, false, false) 
  801. 	end 
  802. end 
  803.  
  804. ------------------------------------------------------------------------------- 
  805. -- When the coop disconnect dialog closes... this is called. 
  806. -- 
  807. function msn_proto_coop_disconnect(result, action) 
  808. 	--They selected yes... 
  809. 	if result == 0 then 
  810. 		dialog_box_disconnect() 
  811. 	end 
  812. 	 
  813. 	Msn_proto_disconnect_dialog_handle = 0 
  814. end 
  815.  
  816.  
  817. --------------------------------------------------------------------------------------------------- 
  818. -- Screen Animation Support. 
  819. --  
  820. function msn_proto_update_txt() 
  821.  
  822. 	-- Left side text elements... 
  823. 	local core_temp_txt_h = vint_object_find("core_temp_txt") 
  824. 	local initialized_txt_h = vint_object_find("initialized_txt") 
  825. 	local processes_txt_h = vint_object_find("processes_txt") 
  826. 	local processing_txt_h = vint_object_find("processing_txt") 
  827. 	 
  828. 	-- Right side text elements... 
  829. 	local speed_txt_h = vint_object_find("speed_txt") 
  830. 	local core_anal_1_txt_h = vint_object_find("core_anal_1_txt") 
  831. 	local core_anal_2_txt_h = vint_object_find("core_anal_2_txt") 
  832. 	 
  833. 	-- SYSTEM STATUS... 
  834. 	local initialized_txt = "SYSTEM STATUS\nREADY"  
  835. 	vint_set_property(initialized_txt_h, "text_tag", initialized_txt) 
  836. 	 
  837. 	-- Set CPU PCT... 
  838. 	local cpu_pct = rand_float(.1,1)			 
  839. 			 
  840. 	-- List of file names... 
  841. 	local process_list = { 
  842. 		"AEVEMENTS.XTBL", 
  843. 		"AON_NODES.XTBL", 
  844. 		"AON_NODE_NPCS.XTBL", 
  845. 		"A_ACTIONS.XTBL", 
  846. 		"A_AUTO.XTBL", 
  847. 		"A_AUTO_APC.XTBL", 
  848. 		"A_AUTO_MONSTER.XTBL", 
  849. 		"A_BIPLANE.XTBL", 
  850. 		"A_BLEND_TREES.XTBL", 
  851. 		"A_BOATS.XTBL", 
  852. 		"A_BOATS_CRAFT.XTBL", 
  853. 		"A_BOATS_SPED1.XTBL", 
  854. 		"A_BROTHERHOOD.XTBL", 
  855. 		"A_ENVIRONMENT.XTBL", 
  856. 		"A_FACE.XTBL", 
  857. 		"A_FILES.XTBL", 
  858. 		"A_FILES_FLAGS.XTBL", 
  859. 		"A_FLINCHES.XTBL", 
  860. 		"A_HELI.XTBL", 
  861. 		"A_HELIFIGHTER.XTBL", 
  862. 		"A_IK_LOCATION.XTBL", 
  863. 		"A_IK_SITUATION.XTBL", 
  864. 		"A_JET.XTBL", 
  865. 		"A_MOTO.XTBL", 
  866. 		"A_MOTO_ATV.XTBL", 
  867. 		"A_MOTO_CRUISER.XTBL", 
  868. 		"A_MOTO_DIRT.XTBL", 
  869. 		"A_MOTO_MOPED.XTBL", 
  870. 		"A_MOTO_ROCKET.XTBL", 
  871. 		"A_PLANES.XTBL", 
  872. 		"A_PLANE_STANDARD.XTBL", 
  873. 		"A_POLICE_4D.XTBL", 
  874. 		"A_PROP_SETS.XTBL", 
  875. 		"A_REACTIONS.XTBL", 
  876. 		"A_SET_FILENAMES.XTBL", 
  877. 		"A_SET_PROPERTIES.XTBL", 
  878. 		"A_STATES.XTBL", 
  879. 		"A_SYNCED.XTBL", 
  880. 		"A_TAGS.XML", 
  881. 		"A_TRANSITIONS.XTBL", 
  882. 		"A_TRIGGERS.XTBL", 
  883. 		"A_VEHICLES.XTBL", 
  884. 		"AO_CONSTANTS.XTBL", 
  885. 		"AO_EVENTS.XTBL", 
  886. 		"AO_LINE_TAGS.XTBL", 
  887. 		"AO_MARKERS.XTBL", 
  888. 		"AO_PERSONAS.XTBL", 
  889. 		"AO_SETTINGS.XTBL", 
  890. 		"AO_SYNCS.XTBL", 
  891. 		"BAP_MATERIALS.XTBL", 
  892. 		"BES.XTBL", 
  893. 		"BE.XTBL", 
  894. 		"BE_BRUISER.XTBL", 
  895. 		"BE_ZOMBIE.XTBL", 
  896. 		"CRA_FREE.XTBL", 
  897. 		"CRA_SHAKE.XTBL", 
  898. 		"CORAMP.XTBL", 
  899. 		"CDEALERSHIPS.XTBL", 
  900. 		"C_PHONE.XTBL", 
  901. 		"CACTER.XTBL", 
  902. 		"CTS.XTBL", 
  903. 		"CLIFE.XTBL", 
  904. 		"CSWT1.XTBL", 
  905. 		"CERCIALS.XTBL", 
  906. 		"MC_STORE.XTBL", 
  907. 		"NRIETY.XTBL", 
  908. 		"NRIETY_LEVELS.XTBL", 
  909. 		"NRIETY_SPAWN.XTBL", 
  910. 		"NCOLOR_PALETTE.XTBL", 
  911. 		"PCHUTE.XTBL", 
  912. 		"P.XTBL", 
  913. 		"P_LIFE.XTBL", 
  914. 		"PE_TABLE.XTBL", 
  915. 		"P.XTBL", 
  916. 		"P.XTBL", 
  917. 		"P_ZOMBIE.XTBL", 
  918. 		"PSTREAKER.XTBL", 
  919. 		"PON_YACHT.XTBL", 
  920. 		"RO_ACTIVITIES.XTBL", 
  921. 		"RO_EVENTS.XTBL", 
  922. 		"S_NAMES.XTBL", 
  923. 		"S_COLOR_POOL.XTBL", 
  924. 		"SOX_EFFECTS.XTBL", 
  925. 		"SEDOOR.XTBL", 
  926. 		"SE_WEAPONS.XTBL", 
  927. 		"SFE_ANGLES.XTBL", 
  928. 		"S_ROPE.XTBL", 
  929. 		"TOO_COLOR_POOL.XTBL", 
  930. 		"TS.XTBL", 
  931. 		"TR.XTBL", 
  932. 		"T_OF_DAY.XTBL", 
  933. 		"T_OF_DAY_OBJECTS.XTBL", 
  934. 		"TFIC_LANES.XTBL", 
  935. 		"TFIC_TYPES.XTBL", 
  936. 		"TGERS.XTBL", 
  937. 		"TK_TABLE.XTBL", 
  938. 		"UCKABLES.XTBL", 
  939. 		"U_INTERFACE.XTBL", 
  940. 		"VCLES.XTBL", 
  941. 		"VBLACKHAWK.XTBL", 
  942. 		"VHELI_MAD03.XTBL", 
  943. 		"VPONY.XTBL", 
  944. 		"VRIOT.XTBL", 
  945. 		"VTANK.XTBL", 
  946. 		"VVTOL.XTBL", 
  947. 		"VVTOL2.XTBL", 
  948. 		"VGAT_LS.XTBL", 
  949. 		"VJOSH_LS.XTBL", 
  950. 		"VKIA_LS.XTBL", 
  951. 		"VKILLBANE_LS.XTBL", 
  952. 		"VKINZIE_LS.XTBL", 
  953. 		"VMATT_LS.XTBL", 
  954. 		"01_LS.XTBL", 
  955. 		"02_LS.XTBL", 
  956. 		"03_LS.XTBL", 
  957. 		"VOLEG_LS.XTBL", 
  958. 		"VPHILLIPE_LS.XTBL", 
  959. 		"VPIERCE_LS.XTBL", 
  960. 		"VPLAYER_BF_LS.XTBL", 
  961. 		"VPLAYER_BM_LS.XTBL", 
  962. 		"VPLAYER_HF_LS.XTBL", 
  963. 		"VPLAYER_HM_LS.XTBL", 
  964. 		"VPLAYER_WFA_LS.XTBL", 
  965. 		"VPLAYER_WF_LS.XTBL", 
  966. 		"VPLAYER_WMA_LS.XTBL", 
  967. 		"VPLAYER_WM_LS.XTBL", 
  968. 		"VPLAYER_Z_LS.XTBL",		 
  969. 	} 
  970. 	 
  971. 	local current_frame = 0  
  972. 	while true do 
  973. 		--Update stuff only every some amount of items... fill in with random shit... 
  974. 		if current_frame % 20 == 0 then 
  975. 			local core_temp = rand_float(90,100) 
  976. 			core_temp = (floor(core_temp * 100)) * .01 + 1 
  977. 			local core_tmp_txt = "CORE TEMP\n" .. core_temp 
  978. 			vint_set_property(core_temp_txt_h, "text_tag", core_tmp_txt) 
  979. 		end 
  980.  
  981. 		if current_frame % 4 == 0 then 
  982. 			local processing_txt = "PROCESSING...\n" ..  process_list[rand_int(1, #process_list - 1)] 
  983. 			vint_set_property(processing_txt_h, "text_tag", processing_txt) 
  984. 		end 
  985. 		 
  986. 		if current_frame % 27 == 0 then 
  987. 			local process_count = rand_int(89, 120) 
  988. 			local processes_txt = "PROCESSES\n" .. process_count 
  989. 			vint_set_property(processes_txt_h, "text_tag", processes_txt) 
  990. 		end 
  991. 	 
  992. 		if current_frame % 27 == 0 then 
  993. 			local cpu_pct = rand_float(.1,1)	 
  994. 			local text = 12 * cpu_pct 
  995. 			local text = floor(text*1000) * .001 
  996. 			vint_set_property(speed_txt_h, "text_tag", text) 
  997. 		end 
  998. 		 
  999. 		if current_frame % 10 == 0 then 
  1000. 			local right_large_fill_h = vint_object_find("right_large_fill") 
  1001. 			local right_large_cap_h = vint_object_find("right_large_cap") 
  1002. 			 
  1003. 			local width, height = element_get_actual_size(right_large_fill_h) 
  1004. 			local x, y = vint_get_property(right_large_cap_h, "anchor") 
  1005. 			width = rand_int(20, 380 * cpu_pct) -- floor(current_frame*.1) 
  1006. 			element_set_actual_size(right_large_fill_h, width, height) 
  1007. 			vint_set_property(right_large_cap_h, "anchor", width+7, y) 
  1008. 			 
  1009. 			local width, height =element_get_actual_size(right_large_cap_h) 
  1010. 			width = rand_int(2, max(3,floor(current_frame*.1))) 
  1011. 			element_set_actual_size(right_large_cap_h, width, height) 
  1012. 		end 
  1013. 		 
  1014. 		if current_frame % 30 == 0 then 
  1015. 			local text = rand_int(0, 99) 
  1016. 			vint_set_property(core_anal_1_txt_h, "text_tag", text) 
  1017. 		end 
  1018. 		 
  1019. 		if current_frame % 60 == 0 then 
  1020. 			local text = rand_int(0, 325) 
  1021. 			vint_set_property(core_anal_2_txt_h, "text_tag", text) 
  1022. 		end 
  1023. 		 
  1024. 		current_frame = current_frame + 1 
  1025. 		if current_frame == 1000 then 
  1026. 			current_frame = 0 
  1027. 		end 
  1028. 		thread_yield() 
  1029. 	end 
  1030. 	 
  1031. end 
  1032.  
  1033.  
  1034.  
  1035.