./vdo_respect_meter.lua

  1. function vdo_respect_meter_init() 
  2. 	 
  3. 	 
  4. end 
  5.  
  6. -- Inherited from Vdo_base_object 
  7. Vdo_respect_meter = Vdo_base_object:new_base() 
  8.  
  9. --Local Constants... 
  10.  
  11. --Used to keep track of the the state of the meter. 
  12. local RESPECT_STATE_REST 						= 0		-- If we are ready to update... 
  13. local RESPECT_STATE_RESPECT 					= 1		-- If we are getting respect... 
  14. local RESPECT_STATE_RANKUP 					= 2		-- If we are going to rank up... 
  15. local RESPECT_STATE_UPGRADE 					= 3		-- If we are in upgrade state... 
  16. local RESPECT_STATE_RETURNING 				= 4		-- If we are returning back to be ready for update... 
  17.  
  18.  
  19. --Queue IDs, used for queuing up the rankup/upgrade stuff. 
  20. local RESPECT_QUEUE_NOTHING = 0 			 
  21. local RESPECT_QUEUE_RANKUP = 1  
  22. local RESPECT_QUEUE_RANKUP_UPGRADE = 2  
  23.  
  24. local RESPECT_START_ANGLE = 2.65 
  25. local RESPECT_END_ANGLE = 2.6 	-- This is really negative, but entering as positive to make equation work 
  26.  
  27.  
  28. --Standard Init... 
  29. function Vdo_respect_meter:init() 
  30. 	--Replace button images 
  31. 	self.back_button_img = get_back_image() 
  32. 	self.back_button_key = game_get_key_name_for_action( "CBA_GAC_MAP_MENU" ) 
  33. 	self.button_h = Vdo_hint_button:new( "button_icon" ) 
  34. 	self.button_pulse_h = Vdo_hint_button:new( "button_icon_pulse" ) 
  35. 	 
  36. 	self.respect_level = Vdo_base_object:new("respect_level_text", self.handle, self.doc_handle) 
  37. 	self.respect_meter = Vdo_base_object:new("respect_meter", self.handle, self.doc_handle) 
  38. 	 
  39. 	-- Override color with global 
  40. 	local circle_pulse_00 = Vdo_base_object:new("circles_pulse_00", self.handle, self.doc_handle) 
  41. 	local circles_pulse_01 = Vdo_base_object:new("circles_pulse_01", self.handle, self.doc_handle) 
  42. 	local circles_pulse_01 = Vdo_base_object:new("circles_pulse_01", self.handle, self.doc_handle) 
  43. 	 
  44. 	self.respect_meter:set_color(COLOR_RESPECT_METER.R, COLOR_RESPECT_METER.G, COLOR_RESPECT_METER.B) 
  45. 	circle_pulse_00:set_color(COLOR_RESPECT_METER.R, COLOR_RESPECT_METER.G, COLOR_RESPECT_METER.B) 
  46. 	circles_pulse_01:set_color(COLOR_RESPECT_METER_HIGHLIGHT.R, COLOR_RESPECT_METER_HIGHLIGHT.G, COLOR_RESPECT_METER_HIGHLIGHT.B) 
  47. 	 
  48. 	local pulse_tweens = {"respect_meter_tint", "tint_tween_1", "tint_tween_2", "tint_tween_3"} 
  49. 	for idx, val in pairs(pulse_tweens) do 
  50. 		local h = Vdo_tween_object:new(val, self.handle, self.doc_handle) 
  51. 		h:set_property("start_value", COLOR_RESPECT_METER.R, COLOR_RESPECT_METER.G, COLOR_RESPECT_METER.B) 
  52. 		h:set_property("end_value", COLOR_RESPECT_METER_HIGHLIGHT.R, COLOR_RESPECT_METER_HIGHLIGHT.G, COLOR_RESPECT_METER_HIGHLIGHT.B) 
  53. 	end 
  54. 	 
  55. 	-- Clone fleur outline animation and object. Then Retarget and store handles for later... 
  56. 	local fleur_outline = Vdo_anim_object:new("fleur_outline", self.handle, self.doc_handle) 
  57. 	local fleur_outline_anim = Vdo_anim_object:new("fleur_outline_zoom_anim", self.handle, self.doc_handle) 
  58. 	self.fluer_outline_anims = {} 
  59. 	self.fluer_outlines = {} 
  60. 	for index = 1, 7 do 
  61. 		local fleur_outline_clone = Vdo_base_object:clone(fleur_outline.handle) 
  62. 		local anim = Vdo_anim_object:clone(fleur_outline_anim.handle) 
  63. 		anim:set_target_handle(fleur_outline_clone.handle) 
  64. 		anim:stop() 
  65. 		self.fluer_outline_anims[index] = anim  
  66. 		self.fluer_outlines[index] = fleur_outline_clone.handle 
  67. 	end 
  68. 	 
  69. 	--Initalize Values 
  70. 	self.is_first_update = true 
  71. 	self.respect = -1 
  72. 	self.respect_pct = 0 
  73. 	self.level = -1 
  74. 	self.queue_rank_up = RESPECT_QUEUE_NOTHING	-- When this is set to true and the respect meter goes up... 
  75. 	self.is_ranking_up = false							-- Set to true when we are ranking up... 
  76. 	self.should_go_back_to_normal = false			-- Flag used to determine if we should go back to normal state while the upgrade button is displayed. 
  77. 	self.state = -1										-- Used to keep track of what state the respect meter is in, so we don't overlap shit... 
  78. 	self.is_in_store = false 
  79. 	 
  80. 	-- Respect Up animation 
  81. 	local respect_up_anim = Vdo_anim_object:new("respect_up_anim", self.handle, self.doc_handle) 
  82. 	local respect_up_end_tween = Vdo_tween_object:new("respect_up_end", respect_up_anim.handle, respect_up_anim.doc_handle) 
  83. 	local respect_up_callback_string = self:package_tween_callback("respect_up_cb") 
  84. 	respect_up_end_tween:set_end_event(respect_up_callback_string)		 
  85. 	 
  86. 	-- Rank Up Animation... 
  87. 	local rank_up_anim = Vdo_anim_object:new("rank_anim", self.handle, self.doc_handle) 
  88. 	local rank_up_end_tween = Vdo_tween_object:new("rank_up_end", rank_up_anim.handle, rank_up_anim.doc_handle) 
  89. 	local rank_up_callback_string = self:package_tween_callback("rank_up_cb") 
  90. 	rank_up_end_tween:set_end_event(rank_up_callback_string)	 
  91. 	 
  92. 	-- Rank Up and Upgrade animation... 
  93. 	local rank_up_and_upgrade_anim = Vdo_anim_object:new("rank_and_upgrade_anim", self.handle, self.doc_handle) 
  94. 	local rank_up_and_upgrade_end_tween = Vdo_tween_object:new("rank_up_and_upgrade_end", rank_up_and_upgrade_anim.handle, rank_up_and_upgrade_anim.doc_handle) 
  95. 	local rank_up_and_upgrade_callback_string = self:package_tween_callback("rank_upgrade_cb") 
  96. 	rank_up_and_upgrade_end_tween:set_end_event(rank_up_and_upgrade_callback_string)	 
  97. 	 
  98. 	--Callbacks for return state... 
  99. 	local return_callback_string = self:package_tween_callback("return_complete_cb")	 
  100. 	local rank_and_upgrade_return_anim = Vdo_tween_object:new("rank_and_upgrade_return_anim", self.handle, self.doc_handle) 
  101. 	local rank_and_upgrade_return_twn = Vdo_tween_object:new("rank_and_upgrade_return_twn", rank_and_upgrade_return_anim.handle, rank_and_upgrade_return_anim.doc_handle) 
  102. 	rank_and_upgrade_return_twn:set_end_event(return_callback_string) 
  103. 	 
  104. 	local rank_return_anim = Vdo_tween_object:new("rank_return_anim", self.handle, self.doc_handle) 
  105. 	local rank_return_twn = Vdo_tween_object:new("rank_return_twn", rank_return_anim.handle, rank_return_anim.doc_handle) 
  106. 	rank_return_twn:set_end_event(return_callback_string) 
  107. 	 
  108. 	local respect_up_return_anim = Vdo_tween_object:new("respect_up_return_anim", self.handle, self.doc_handle) 
  109. 	local respect_up_return_twn = Vdo_tween_object:new("respect_up_return_twn", respect_up_return_anim.handle, respect_up_return_anim.doc_handle) 
  110. 	respect_up_return_twn:set_end_event(return_callback_string) 
  111. end 
  112.  
  113. -- Update/animate the respect meter 
  114. -- 
  115. -- @param	total_respect		current total amount of respect player has 
  116. -- @param	respect_pct		 	% the player is towards their next rank level 
  117. -- @param	level: player		rank level 
  118. function Vdo_respect_meter:update_respect(total_respect, respect_pct, level, show_upgrade_anim) 
  119. 	 
  120. 	--level starts at 0 but needs to be displayed as starting from 50 
  121. 	level = level + 1 
  122.  
  123.  
  124. 	--Always make sure the standard return animation is stopped... 
  125. 	local stop_return_anim = false 
  126.  
  127. 	if self.is_first_update then 
  128. 		 
  129. 		--First Update, this means we will set everything up manually without any special animations... 
  130. 		self:fill_meter(total_respect, self.respect_pct, respect_pct, false) 
  131. 		 
  132. 		-- Set Level	 
  133. 		self.respect_level:set_text(var_to_string(level)) 
  134. 		 
  135. 		self.is_first_update = false 
  136. 		self:set_state(RESPECT_STATE_RESPECT) 
  137. 		stop_return_anim = true 
  138. 	else 
  139. 		-- The Real Update... 
  140. 		 
  141. 		-- We are currently returning from another state... so we have to handle this someway. 
  142. 		-- This might break if we are trying to level up a second time while returning... 
  143. 		if self.state == RESPECT_STATE_RETURNING then 
  144. 			--Force fill the meter... 
  145. 			self:fill_meter(total_respect, self.respect_pct, respect_pct, false) 
  146. 			 
  147. 			--Force Set Level... 
  148. 			self.respect_level:set_text(var_to_string(level)) 
  149. 		elseif self.state ~= RESPECT_STATE_RANKUP and self.state ~= RESPECT_STATE_UPGRADE then 
  150. 			-- Ok to do the upgrade animation... 
  151. 			if level > self.level then 
  152. 				if level ~= 0 then 
  153. 					--Only do the fantastic upgrade animation if we are past level 0... 
  154. 					 
  155. 					--Add Respect Up 
  156. 					self:fill_meter(total_respect, self.respect_pct, 1, true) 
  157. 					 
  158. 					if show_upgrade_anim == true then 
  159. 						--Queue Up Level Up animation 
  160. 						self.queue_rank_up = RESPECT_QUEUE_RANKUP_UPGRADE 
  161. 					else  
  162. 						--Just Queue Rank up... 
  163. 						self.queue_rank_up = RESPECT_QUEUE_RANKUP 
  164. 					end 
  165. 				else 
  166. 					-- Set Level to 0 
  167. 					self.respect_level:set_text(var_to_string(level)) 
  168. 					 
  169. 					--Just some added respect... 
  170. 					self:fill_meter(total_respect, self.respect_pct, 1, true) 
  171. 				end 
  172. 				self:set_state(RESPECT_STATE_RANKUP) 
  173. 				stop_return_anim = true 
  174. 			else 
  175. 				if total_respect <= self.respect then 
  176. 					--negative respect... just fill the meter and reset our state... 
  177. 					self:fill_meter(total_respect, self.respect_pct, respect_pct, false) 
  178. 		 
  179. 					-- Set Level 
  180. 					self.respect_level:set_text(var_to_string(level)) 
  181. 					--Don't change state just keep whatever state we were in and let everything else flow. 
  182. 					--self:set_state(RESPECT_STATE_RESPECT) 
  183. 				else 
  184. 					--Just some added respect... 
  185. 					self:fill_meter(total_respect, self.respect_pct, respect_pct, true) 
  186. 					self:set_state(RESPECT_STATE_RESPECT) 
  187. 					stop_return_anim = true 
  188. 				end	 
  189. 			end	 
  190. 			 
  191. 		else  
  192. 			-- Do not update the thing if we are in upgrade state or returning from an upgrade state...  
  193. 		end 
  194. 	end 
  195. 	 
  196. 	if stop_return_anim then 
  197. 		local anim = Vdo_anim_object:new("respect_up_return_anim", self.handle, self.doc_handle) 
  198. 		anim:stop() 
  199. 	end 
  200. 	 
  201. 	--Store values off for later access... 
  202. 	self.level = level 
  203. 	self.respect_pct = respect_pct 
  204. 	self.respect = total_respect 
  205. end 
  206.  
  207.  
  208. ---------------------------------------------------------------------------  
  209. -- Fills up the meter and plays added respect animation. 
  210. -- After animation is complete it does a callback which checks if we've 
  211. -- Increased a level and calls that animation... 
  212. -- 
  213. -- @param new_text_string	Text string for header 
  214. --------------------------------------------------------------------------- 
  215. function Vdo_respect_meter:fill_meter(total_respect, old_respect_pct, respect_pct, do_animation) 
  216. 		 
  217. 	-- calculate respect gained since last update 
  218. 	local new_respect = total_respect - self.respect 
  219. 	 
  220. 	-- min/max for a percentage 
  221. 	respect_pct = limit(respect_pct, 0, 1) 
  222. 	 
  223. 	local start_respect_angle = RESPECT_START_ANGLE - ((RESPECT_START_ANGLE + RESPECT_END_ANGLE) * old_respect_pct) 
  224. 	local end_respect_angle = RESPECT_START_ANGLE - ((RESPECT_START_ANGLE + RESPECT_END_ANGLE) * respect_pct) 
  225. 	 
  226. 	local respect_amount_obj = Vdo_base_object:new("respect_amount_text", self.handle, self.doc_handle) 
  227. 	local respect_up_anim = Vdo_anim_object:new("respect_up_anim", self.handle, self.doc_handle) 
  228.  
  229.  
  230. 	-- Animate Meter 
  231. 	local respect_up_anim = Vdo_anim_object:new("respect_up_anim", self.handle, self.doc_handle) 
  232. 	local meter_tween = Vdo_tween_object:new("meter_tween",self.handle, self.doc_handle) 
  233. 	local meter_bg_tween = Vdo_tween_object:new("meter_bg_tween",self.handle, self.doc_handle) 
  234. 	 
  235. 	-- Animate from previous to new		 
  236. 	meter_tween:set_property("start_value", start_respect_angle) 
  237. 	meter_tween:set_property("end_value", end_respect_angle) 
  238. 	meter_bg_tween:set_property("start_value", start_respect_angle - .03) 
  239. 	meter_bg_tween:set_property("end_value", end_respect_angle - .03) 
  240. 	 
  241. 	if do_animation == true then 
  242. 		respect_up_anim:play(0)			 
  243. 	else 
  244. 		--force meter in position 
  245. 		local respect_meter = Vdo_base_object:new("respect_meter", self.handle, self.doc_handle) 
  246. 		local respect_meter_bg = Vdo_base_object:new("respect_meter_bg", self.handle, self.doc_handle) 
  247. 		respect_meter:set_property("end_angle", end_respect_angle) 
  248. 		respect_meter_bg:set_property("end_angle", end_respect_angle - .03)		 
  249. 	end 
  250. 	 
  251. 	if new_respect > 0 then 
  252. 		--Show amount of respect earned.... 
  253. 		respect_amount_obj:set_visible(true) 
  254. 		respect_amount_obj:set_text("+" .. new_respect) 
  255. 	else 
  256. 		--Set text to empty if total_respect is empty... 
  257. 		respect_amount_obj:set_visible(false) 
  258. 	end 
  259. end 
  260.  
  261.  
  262. -- Set the meter in rank up state and play eccentric rank up animation 
  263. -- Then stay in Upgrade State... 
  264. function Vdo_respect_meter:rank_up_and_upgrade() 
  265. 	self.back_button_key = game_get_key_name_for_action( "CBA_GAC_MAP_MENU" ) 
  266. 	self.button_h:set_button( self.back_button_img, self.back_button_key, false, false) 
  267. 	self.button_pulse_h:set_button( self.back_button_img, self.back_button_key, false, false) 
  268. 	 
  269. 	--Play Circles animatino 
  270. 	local circles_anim = Vdo_anim_object:new("circles", self.handle, self.doc_handle) 
  271.  
  272. 	--Play Outline Zoom Animation... 
  273. 	local fleur_outline = Vdo_base_object:new("fleur_outline", self.handle, self.doc_handle) 
  274. 	local fleur_outline_anim = Vdo_anim_object:new("fleur_outline_zoom_anim", self.handle, self.doc_handle) 
  275. 	local rank_up_anim = Vdo_anim_object:new("rank_and_upgrade_anim", self.handle, self.doc_handle) 
  276. 	 
  277. 	fleur_outline_anim:play() 
  278. 	circles_anim:play() 
  279. 	rank_up_anim:play(.2) 
  280. 	 
  281. 	--Play Fleur outline animation... 
  282. 	for index = 1, 7 do 
  283. 		self.fluer_outline_anims[index]:play(index * .125) 
  284. 	end 
  285. 	 
  286. 	--self.button_h:set_button( self.back_button_img, self.back_button_key, false, false) 
  287. 	--self.button_pulse_h:set_button( self.back_button_img, self.back_button_key, false, false) 
  288. 	 
  289. 	-- Play Respect Up Sound 
  290. 	-- but only if we are in the hud or in a store. 
  291. 	if Hud_has_focus == true or self.is_in_store == true then 
  292. 		game_UI_audio_play("UI_HUD_Respect_Level_Up") 
  293. 	end 
  294.  
  295. 	--Remove from Rank up Queue 
  296. 	self.queue_rank_up = RESPECT_QUEUE_NOTHING 
  297. end 
  298.  
  299. -- Set the meter in rank up state and play eccentric rank up animation. 
  300. function Vdo_respect_meter:rank_up() 
  301.  
  302. 	--Play Circles animatino 
  303. 	local circles_anim = Vdo_anim_object:new("circles", self.handle, self.doc_handle) 
  304.  
  305. 	--Play Outline Zoom Animation... 
  306. 	local fleur_outline = Vdo_base_object:new("fleur_outline", self.handle, self.doc_handle) 
  307. 	local fleur_outline_anim = Vdo_anim_object:new("fleur_outline_zoom_anim", self.handle, self.doc_handle) 
  308. 	local rank_up_anim = Vdo_anim_object:new("rank_anim", self.handle, self.doc_handle) 
  309. 	 
  310. 	fleur_outline_anim:play() 
  311. 	circles_anim:play() 
  312. 	rank_up_anim:play(.2) 
  313. 	 
  314. 	--Play Fleur outline animation... 
  315. 	for index = 1, 7 do 
  316. 		self.fluer_outline_anims[index]:play(index * .125) 
  317. 	end 
  318.  
  319. 	-- Play Respect Up Sound 
  320. 	-- But only if we are not in the hud 
  321. 	if Hud_has_focus == true or self.is_in_store == true then 
  322. 		game_UI_audio_play("UI_HUD_Respect_Level_Up") 
  323. 	end 
  324. 	 
  325. 	--Remove from Rank up Queue 
  326. 	self.queue_rank_up = RESPECT_QUEUE_NOTHING 
  327. end 
  328.  
  329.  
  330. --Animates the VDO from what ever state it is in back to the normal state... 
  331. function Vdo_respect_meter:back_to_normal() 
  332.  
  333. 	--Set Level... 
  334. 	self.respect_level:set_text(var_to_string(self.level)) 
  335. 	 
  336. 	if self.state == RESPECT_STATE_UPGRADE or self.state == RESPECT_STATE_RANKUP then 
  337. 		--Fill up respect meter from 0... 
  338. 		self:fill_meter(0, 0, self.respect_pct, false) 
  339. 		 
  340. 		if self.state == RESPECT_STATE_UPGRADE then	 
  341. 			--Then animate back to respect state... 
  342. 			local anim = Vdo_anim_object:new("rank_and_upgrade_return_anim", self.handle, self.doc_handle) 
  343. 			anim:play() 
  344. 		else 
  345. 			--Then animate back to respect state.. 
  346. 			local anim = Vdo_anim_object:new("rank_return_anim", self.handle, self.doc_handle) 
  347. 			anim:play() 
  348. 		end 
  349. 		self:set_state(RESPECT_STATE_RETURNING) 
  350. 	elseif self.state == RESPECT_STATE_RESPECT then 
  351. 		--do normal back to rest state... 
  352. 		local anim = Vdo_anim_object:new("respect_up_return_anim", self.handle, self.doc_handle) 
  353. 		anim:play() 
  354. 	elseif self.state == RESPECT_STATE_REST then 
  355. 		--just make sure the level is visible 
  356. 		self.respect_level:set_alpha(1) 
  357. 	end 
  358. end 
  359.  
  360. --This gets called when any return animations are complete... 
  361. function Vdo_respect_meter:return_complete_cb() 
  362. 	self.should_go_back_to_normal = false 
  363. 	self:set_state(RESPECT_STATE_REST) 
  364. 	--debug_print("vint", "Reset back to false...\n")	 
  365. end 
  366.  
  367. function Vdo_respect_meter:game_is_finished_showing_upgrades() 
  368. 	if self.state == RESPECT_STATE_RANKUP then 
  369. 		--queue to go back to normal...  
  370. 		self.should_go_back_to_normal = true 
  371. 	else 
  372. 		--Not in the rank up state so we should just go back... 
  373. 		self:back_to_normal()  
  374. 	end 
  375. end 
  376.  
  377. -- Determines if the meter can hide or not... this is basically used by the  
  378. -- Hud timer script to hide elements that are not needed visually... 
  379. function Vdo_respect_meter:can_hide() 
  380. 	local can_hide = true 
  381. 	if self.state == RESPECT_STATE_RANKUP or self.state == RESPECT_STATE_UPGRADE then 
  382. 		--We cannot hide if we are upgrading... 
  383. 		can_hide = false 
  384. 	end 
  385. 	return can_hide 
  386. end 
  387.  
  388. -- Shows or hides the pulse of the icon when respect is tallied... 
  389. function Vdo_respect_meter:pulse_icon(pulse_bool) 
  390. 	local pulse = Vdo_base_object:new("fleur_pulse", self.handle, self.doc_handle) 
  391. 	pulse:set_visible(pulse_bool) 
  392. end 
  393.  
  394. -- Simple callback setup in the init. It is called by the rank up and rankup/upgrade animations. 
  395. -- When this is fired up we determine what state to move in based on what was queued from the last update. 
  396. function Vdo_respect_meter:rank_up_cb() 
  397. 	-- Transition back to normal state.... 
  398. 	self:back_to_normal() 
  399. end 
  400.  
  401. --Call back after rank up and upgrade... 
  402. function Vdo_respect_meter:rank_upgrade_cb() 
  403. 	--Set state to upgrade since we are now in the upgrade button state... 
  404. 	self:set_state(RESPECT_STATE_UPGRADE) 
  405.  
  406. 	--Determine if we should go back to the normal state, if the game has said so. 
  407. 	if self.should_go_back_to_normal then 
  408. 		-- Transition back to normal state.... 
  409. 		self:back_to_normal() 
  410. 	end 
  411. end 
  412.  
  413. -- Simple callback setup in the init. It is called by the respect up animation(slamdown effect...) 
  414. -- When this is fired after we determine if we aren't trying to queue up these other things... 
  415. function Vdo_respect_meter:respect_up_cb() 
  416. 	--Determine if we rank up or just bring back the level 
  417. 	if self.queue_rank_up == RESPECT_QUEUE_RANKUP_UPGRADE then  
  418. 		--Do the rank up and upgrade animation 
  419. 		self:rank_up_and_upgrade() 
  420. 	elseif self.queue_rank_up == RESPECT_QUEUE_RANKUP then 
  421. 		--Do the rank up animation but no upgrade... 
  422. 		self:rank_up() 
  423. 	else 
  424. 		if self.state == RESPECT_STATE_REST or self.state == RESPECT_STATE_RESPECT then 
  425. 			-- Transition back to normal state... only if we are aren't in Upgrade mode... 
  426. 			self:back_to_normal() 
  427. 		end 
  428. 	end 
  429. end 
  430.  
  431. ------------------------------------------------------------------------------- 
  432. -- Set the state of the code... 
  433. ------------------------------------------------------------------------------- 
  434. function Vdo_respect_meter:set_state(state) 
  435. 	self.state = state 
  436. end 
  437.  
  438. function Vdo_respect_meter:get_data() 
  439. 	return self.respect, self.respect_pct, self.level 
  440. end 
  441.  
  442.  
  443. ------------------------------------------------------------------------------- 
  444. -- Resets respect meter to be first update 
  445. -- Set this every time if you don't want to play the animation when  
  446. -- using update_respect() 
  447. -- 
  448. function Vdo_respect_meter:reset_first_update() 
  449. 	self.is_first_update = true 
  450. end 
  451.  
  452. function Vdo_respect_meter:set_is_in_store(is_in_store) 
  453. 	self.is_in_store = is_in_store 
  454. end 
  455.  
  456. function Vdo_respect_meter:set_color(color) 
  457. 	local new_color = table_clone(color) 
  458. 	new_color.R = new_color.R * .5 
  459. 	new_color.G = new_color.G * .5 
  460. 	new_color.B = new_color.B * .5 
  461. 	for index = 1, #self.fluer_outlines do 
  462. 		vint_set_property(self.fluer_outlines[index], "tint", new_color.R, new_color.G, new_color.B) 
  463. 	end 
  464. 	local epic_circles_01_h = vint_object_find("epic_circles_01", self.handle) 
  465. 	local epic_circles_02_h = vint_object_find("epic_circles_02", self.handle) 
  466. 	vint_set_property(epic_circles_01_h, "tint", new_color.R, new_color.G, new_color.B) 
  467. 	vint_set_property(epic_circles_02_h, "tint", new_color.R, new_color.G, new_color.B) 
  468. end