add:     if (selection[0].traits.id.personal && selection[0].traits.id.personal != "") { GUIObject = getGUIObjectByName("session_panel_status_name1"); GUIObject.caption = selection[0].traits.id.personal + "\n"; } else{ GUIObject = getGUIObjectByName("session_panel_status_name1"); }  if (selection[0].traits.id.generic) { GUIObject = getGUIObjectByName("session_panel_status_name2"); GUIObject.caption = selection[0].traits.id.generic + "\n"; } else{ GUIObject = getGUIObjectByName("session_panel_status_name2"); GUIObject.caption = ""; }  if (selection[0].traits.id.ranked) { GUIObject = getGUIObjectByName("session_panel_status_name3"); GUIObject.caption = selection[0].traits.id.ranked + "\n"; } else{ if (selection[0].traits.id.specific) { GUIObject = getGUIObjectByName("session_panel_status_name3"); GUIObject.caption = selection[0].traits.id.specific + "\n"; } } 
context: function getObjectInfo() {	// Updated each tick to extract entity information from selected unit(s).	if (!selection.length) 	// If no entity selected,	{		// Hide Status Orb		getGUIObjectByName("session_status_orb").hidden = true;		// Hide Group Pane.		getGUIObjectByName("session_group_pane").hidden = true;		getGlobal().MultipleEntitiesSelected = 0;	}	else			// If at least one entity selected,	{		// Store globals for entity information.//		strString = "" + selection[0].position;//		EntityPos = strString.substring(20,strString.length-3);		// Update portrait		if (selection[0].traits.id.icon)			setPortrait("session_panel_status_portrait", selection[0].traits.id.icon);		// Update hitpoints		if (selection[0].traits.health.curr & selection[0].traits.health.hitpoints)		{			getGUIObjectByName("session_panel_status_icon_hp_text").caption = Math.round(selection[0].traits.health.curr) + "/" + Math.round(selection[0].traits.health.hitpoints);			getGUIObjectByName("session_panel_status_icon_hp_bar").caption = ((Math.round(selection[0].traits.health.curr) * 100 ) / Math.round(selection[0].traits.health.hitpoints));		}		// Reveal Status Orb		getGUIObjectByName("session_status_orb").hidden = false;	        // Check if a group of entities selected	        if (selection.length > 1) 		{			// If a group pane isn't already open, and we don't have the same set as last time,			// NOTE: This "if" is an optimisation because the game crawls if this set of processing occurs every frame.			// It's quite possible for the player to select another group of the same size and for it to not be recognised.			// Best solution would be to base this off a "new entities selected" instead of an on-tick.			if (				// getGUIObjectByName("session_group_pane").hidden == true || 				selection.length != MultipleEntitiesSelected)			{				// Reveal Group Pane.				getGUIObjectByName("session_group_pane").hidden = false;				// Set size of Group Pane background.				if (selection.length <= 13)				{					switch (GUIType)					{						case "top":							setSize("session_group_pane_bg", "0%+20 0% 100%-20 0%+86");						break;						case "bottom":							setSize("session_group_pane_bg", "0%+20 100%-86 100%-20 100%");						break;					}				}				else				if (selection.length > 13 && selection.length < 26)				{					switch (GUIType)					{						case "top":							setSize("session_group_pane_bg", GUIStyleSize1[FlipGUILoop]);						break;						case "bottom":							setSize("session_group_pane_bg", GUIStyleSize2[FlipGUILoop]);						break;					}				}				else				{					switch (GUIType)					{						case "top":							setSize("session_group_pane_bg", "0%+20 0% 100%-20 0%+168");						break;						case "bottom":							setSize("session_group_pane_bg", "0%+20 100%-168 100%-20 100%");						break;					}				}				// Display appropriate portraits.										for (groupPaneLoop = 1; groupPaneLoop <= 39; groupPaneLoop++)				{					groupPanePortrait = getGUIObjectByName("session_group_pane_portrait_" + groupPaneLoop);					groupPaneBar = getGUIObjectByName("session_group_pane_portrait_" + groupPaneLoop + "_bar");					// If it's a valid entity,					if (groupPaneLoop <= selection.length){						// Reveal and set to display this entity's portrait in the group pane.						groupPanePortrait.hidden = false;						groupPaneBar.hidden = false;						// Set progress bar for hitpoints.						if (selection[groupPaneLoop-1].traits.health.curr && selection[groupPaneLoop-1].traits.health.hitpoints)							groupPaneBar.caption = ((Math.round(selection[groupPaneLoop-1].traits.health.curr) * 100 ) / Math.round(selection[groupPaneLoop-1].traits.health.hitpoints));						if (selection[groupPaneLoop-1].traits.id.icon)							setPortrait("session_group_pane_portrait_" + groupPaneLoop, selection[groupPaneLoop-1].traits.id.icon);					}					// If it's empty, hide its group portrait.					else					{						groupPanePortrait.hidden = true;						groupPaneBar.hidden = true;					}				}		                getGlobal().MultipleEntitiesSelected = selection.length;			}	        } 		else		{	                getGlobal().MultipleEntitiesSelected = 0;			// Hide Group Pane.			getGUIObjectByName("session_group_pane").hidden = true;		}        }}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/c0edde49683525f4ac73934be13a90964ed934d3/functions_session.js/clean/binaries/data/mods/official/gui/test/functions_session.js