add: /*  tempArray = new Array ("kill", "food"); tempArray.sheet = new Object(); tempArray.sheet = new Array ("Command", "Resource"); console.write(tempArray[1].sheet); updateTab ("allegiance", "pick", "Tab", "", "", true); */ 
context: function refreshCommandButtons(){	// Reset button counter.	tabCounter = 1;	if ( selectionChanged )	{		// Update production lists (both types of Construction, Train). (Tab button, persistent buttons, click them to do things.)		if (validProperty ("selection[0].actions.create.list"))		{			listRoot = selection[0].actions.create.list;			for (listTab in listRoot)			{				if (listTab != "research")	// Do research later.					updateTab (listTab, "production", "Tab", "listRoot[listTab]", "");			}			}			// Update Barter. (Tab button, persistent buttons, click them to do things.)		updateTab ("barter", "production", "Tab", "selection[0].actions.barter.list");		// Update Allegiance. (Tab button, persistent buttons (though unit will be lost as soon as option selected), click them to do things.)		tempArray = new Array ("player1", "player2", "player3", "player4", "kill");		updateTab ("allegiance", "production", "Tab", "tempArray");			// Update pick lists (formation, stance, trade). (Tab button holds current selection, click a button to select a new option and close the tab.)		updateTab ("formation", "pick", "", "selection[0].traits.formation.type", "selection[0].traits.formation.curr");		updateTab ("stance", "pick", "", "selection[0].traits.ai.stance.list", "selection[0].traits.ai.stance.curr");		updateTab ("trade", "pick", "", "selection[0].actions.trade.list", "selection[0].actions.trade.curr");		updateTab ("gate", "pick", "", "selection[0].actions.gate.list", "selection[0].actions.gate.curr");		updateTab ("weapon", "pick", "", "selection[0].actions.attack", "selection[0].actions.attack.curr");				// Update research. (Tab button, persistent buttons, click them to do things.)		updateTab ("research", "production", "", "selection[0].actions.create.list.research", "");				// End of production and pick lists. Store end position.		var listCounter = tabCounter;				// Commands begin from this point.		tabCounter = snStatusPaneCommand.split;		// Update commands. (Click "tab" button to do something; no list.)				updateTab ("patrol", "command", "", "selection[0].actions.patrol", "");		updateTab ("townbell", "command", "", "selection[0].actions.townbell", "");						updateTab ("rally", "command", "", "selection[0].actions.create.rally", "");				updateTab ("explore", "command", "", "selection[0].actions.explore", "");				updateTab ("retreat", "command", "", "selection[0].actions.retreat", "");					updateTab ("stop", "command", "", "selection[0].actions.stop", "");						// End of commands. Store end position.		var commandCounter = tabCounter;	}	else	{		// Ensure tabs should be cleanable.		listCounter		= 1;		commandCounter 	= snStatusPaneCommand.split-1;	}	if ( selectionChanged )	{		// Clear remaining buttons between the lists and commands.		for (var commandClearLoop = listCounter; commandClearLoop <= snStatusPaneCommand.split-1; commandClearLoop++)		{			guiHide ("snStatusPaneCommand" + commandClearLoop + "_1");			// If this slot could possibly contain a list, hide that too.			guiHide ("snStatusPaneCommand" + "Group" + commandClearLoop);		}		for (var commandClearLoop = commandCounter; commandClearLoop <= snStatusPaneCommand.tab.max; commandClearLoop++)		{			guiHide ("snStatusPaneCommand" + commandClearLoop + "_1");			// If this slot could possibly contain a list, hide that too.			guiHide ("snStatusPaneCommand" + "Group" + commandClearLoop);		}			}		if ( selectionChanged )	{		// Do the selection/garrison list.		tabCounter = snStatusPaneCommand.tab.max;				// If there are entities garrisoned in the current entity,		if (selection[0].traits.garrison && selection[0].traits.garrison.curr > 0)		{			updateTab ("garrison", "production", "Tab", "selection", "");			}		else		{			// If more than one entity is selected, list them.			if (selection.length > 1)			{				tempArray = [];				for ( var i = 0; i < selection.length; i++ )					tempArray[i] = selection[i].tag;				tempArray.length = i;				updateTab ("selection", "production", "Tab", "tempArray", "");				}		}	}}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/76bf7b2087bec4841cd164a91207fb1206fac5c7/functions_page_session_status_commands.js/buggy/binaries/data/mods/official/gui/test/functions_page_session_status_commands.js