rem:  getGUIObjectByName ("snResourceCounter_" + resourceName).caption = localPlayer.resource.valueOf()[resourceNameU]; 
add:   refreshResource (resourceName); 
context: function setResources (resourceName, resourceQty){	// Generic function to set the value of a resource in the player's pool.	// Ensure resource name is title-case.	resourceName = toTitleCase (resourceName);	// Create uppercase name.	resourceNameU = resourceName.toUpperCase();	if ( localPlayer.resource.valueOf()[resourceNameU] )	{		// Set resource value.		localPlayer.resource.valueOf()[resourceNameU] = resourceQty;		// Update GUI resource counter.		getGUIObjectByName ("snResourceCounter_" + resourceName).caption = localPlayer.resource.valueOf()[resourceNameU];		console.write ("Resource set to " + resourceQty + " " + resourceName + ".");		return ( true );	}	// If the resource wasn't in the list, report an error.	console.write ("Failed to set resource " + resourceName + " to " + resourceQty);	return ( false ) ;}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/795e07990e4fc2e5f2e5b31da6555bb14672f821/functions_sim_player.js/clean/binaries/data/mods/official/gui/test/functions_sim_player.js