public override void OnResponse( NetState sender, RelayInfo info )
{
int index = info.ButtonID - 1;
if( index == -1 )
{
m_Mobile.SendGump( new PropertiesGump( m_Mobile, m_Object, m_Stack, m_List, m_Page ) );
}
else if( index >= 0 && index < 4 )
{
if( m_Monster == null )
LoadLists();
ModelBodyType type;
ArrayList list;
switch( index )
{
default:
case 0: type = ModelBodyType.Monsters; list = m_Monster; break;
case 1: type = ModelBodyType.Animals; list = m_Animal; break;
case 2: type = ModelBodyType.Sea; list = m_Sea; break;
case 3: type = ModelBodyType.Human; list = m_Human; break;
}
m_Mobile.SendGump( new SetBodyGump( m_Property, m_Mobile, m_Object, m_Stack, m_Page, m_List, 0, list, type ) );
}
else if( m_OurList != null )
{
index -= 4;
if( index == 0 && m_OurPage > 0 )
{
m_Mobile.SendGump( new SetBodyGump( m_Property, m_Mobile, m_Object, m_Stack, m_Page, m_List, m_OurPage - 1, m_OurList, m_OurType ) );
}
else if( index == 1 && ((m_OurPage + 1) * 12) < m_OurList.Count )
{
m_Mobile.SendGump( new SetBodyGump( m_Property, m_Mobile, m_Object, m_Stack, m_Page, m_List, m_OurPage + 1, m_OurList, m_OurType ) );
}
else
{
index -= 2;
if( index >= 0 && index < m_OurList.Count )
{
try
{
InternalEntry entry = (InternalEntry)m_OurList[index];
CommandLogging.LogChangeProperty( m_Mobile, m_Object, m_Property.Name, entry.Body.ToString() );
m_Property.SetValue( m_Object, entry.Body, null );
PropertiesGump.OnValueChanged( m_Object, m_Property, m_Stack );
}
catch
{
m_Mobile.SendMessage( "An exception was caught. The property may not have changed." );
}
m_Mobile.SendGump( new SetBodyGump( m_Property, m_Mobile, m_Object, m_Stack, m_Page, m_List, m_OurPage, m_OurList, m_OurType ) );
}
}
}
}