Exemplo n.º 1
0
        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));
                    }
                }
            }
        }
Exemplo n.º 2
0
        public SetBodyGump(PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list, int ourPage, ArrayList ourList, ModelBodyType ourType)
            : base(20, 30)
        {
            m_Property = prop;
            m_Mobile   = mobile;
            m_Object   = o;
            m_Stack    = stack;
            m_Page     = page;
            m_List     = list;
            m_OurPage  = ourPage;
            m_OurList  = ourList;
            m_OurType  = ourType;

            AddPage(0);

            AddBackground(0, 0, 525, 328, 5054);

            AddImageTiled(10, 10, 505, 20, 0xA40);
            AddAlphaRegion(10, 10, 505, 20);

            AddImageTiled(10, 35, 505, 283, 0xA40);
            AddAlphaRegion(10, 35, 505, 283);

            AddTypeButton(10, 10, 1, "Monster", ModelBodyType.Monsters);
            AddTypeButton(130, 10, 2, "Animal", ModelBodyType.Animals);
            AddTypeButton(250, 10, 3, "Marine", ModelBodyType.Sea);
            AddTypeButton(370, 10, 4, "Human", ModelBodyType.Human);

            AddImage(480, 12, 0x25EA);
            AddImage(497, 12, 0x25E6);

            if (ourList == null)
            {
                AddLabel(15, 40, 0x480, "Choose a body type above.");
            }
            else if (ourList.Count == 0)
            {
                AddLabel(15, 40, 0x480, "The server must have UO:3D installed to use this feature.");
            }
            else
            {
                for (int i = 0, index = (ourPage * 12); i < 12 && index >= 0 && index < ourList.Count; ++i, ++index)
                {
                    InternalEntry entry  = (InternalEntry)ourList[index];
                    int           itemID = entry.ItemID;

                    Rectangle2D bounds = ItemBounds.Table[itemID & 0x3FFF];

                    int x = 15 + ((i % 4) * 125);
                    int y = 40 + ((i / 4) * 93);

                    AddItem(x + ((120 - bounds.Width) / 2) - bounds.X, y + ((69 - bounds.Height) / 2) - bounds.Y, itemID);
                    AddButton(x + 6, y + 66, 0x98D, 0x98D, 7 + index, GumpButtonType.Reply, 0);

                    x += 6;
                    y += 67;

                    AddHtml(x + 0, y - 1, 108, 21, Center(entry.DisplayName), false, false);
                    AddHtml(x + 0, y + 1, 108, 21, Center(entry.DisplayName), false, false);
                    AddHtml(x - 1, y + 0, 108, 21, Center(entry.DisplayName), false, false);
                    AddHtml(x + 1, y + 0, 108, 21, Center(entry.DisplayName), false, false);
                    AddHtml(x + 0, y + 0, 108, 21, Color(Center(entry.DisplayName), TextColor32), false, false);
                }

                if (ourPage > 0)
                {
                    AddButton(480, 12, 0x15E3, 0x15E7, 5, GumpButtonType.Reply, 0);
                }

                if ((ourPage + 1) * 12 < ourList.Count)
                {
                    AddButton(497, 12, 0x15E1, 0x15E5, 6, GumpButtonType.Reply, 0);
                }
            }
        }
 public static void Write(Stream output, InternalEntry instance, Endian endian)
 {
     output.WriteStringZ(instance.Name, Encoding.ASCII);
     output.WriteValueU32(instance.Size, endian);
     output.WriteValueU32(instance.Offset, endian);
 }
Exemplo n.º 4
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 protected override object?GetValueInternal(IProperty property)
 => InternalEntry.GetOriginalValue(property);
Exemplo n.º 5
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 protected override void SetValueInternal(IProperty property, object?value)
 => InternalEntry.SetOriginalValue(property, value);
Exemplo n.º 6
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public override TValue GetValue <TValue>(IProperty property)
 => InternalEntry.GetOriginalValue <TValue>(InternalEntry.EntityType.CheckPropertyBelongsToType(property));
Exemplo n.º 7
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public override TValue GetValue <TValue>(string propertyName)
 => InternalEntry.GetOriginalValue <TValue>(InternalEntry.EntityType.GetProperty(propertyName));