private void SetNewProto(ItemProto Prot)
{
if (CurrentProto != null)
SetProtoGUI(CurrentProto, false); // Save data to proto
CurrentProto = Prot;
SetProtoGUI(CurrentProto, true);
if (Config.SwitchTab)
{
TabPage Page = GetTabPageByItemType(CurrentProto.Type);
if(Page==null)
{
foreach(TabPage TopPage in panelProperties.Controls)
{
String ItemType = (String)TopPage.Tag;
if (ItemType == null)
continue;
if (Data.ItemTypes.ContainsKey(ItemType) || Data.ItemTypes.ContainsKey("ITEM_TYPE_"+ItemType))
{
Page = TopPage;
break;
}
}
}
panelProperties.SelectedTab = Page;
lstProtos.Focus();
}
}