using System; using Server.Gumps; using Server.Mobiles; using Server.Network; namespace Server.Items { [FlipableAttribute(0xA57, 0xA58, 0xA59)] public class Bedroll : Item { [Constructable] public Bedroll() : base(0xA57) { this.Weight = 5.0; } public Bedroll(Serial serial) : base(serial) { } public override void OnDoubleClick(Mobile from) { if (this.Parent != null || !this.VerifyMove(from)) return; if (!from.InRange(this, 2)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. return; } if (this.ItemID == 0xA57) // rolled { Direction dir = PlayerMobile.GetDirection4(from.Location, this.Location); if (dir == Direction.North || dir == Direction.South) this.ItemID = 0xA55; else this.ItemID = 0xA56; } else // unrolled { this.ItemID = 0xA57; if (!from.HasGump(typeof(LogoutGump))) { CampfireEntry entry = Campfire.GetEntry(from); if (entry != null && entry.Safe) from.SendGump(new LogoutGump(entry, this)); } } } public override void Serialize(GenericWriter writer) { base.Serialize(writer); writer.WriteEncodedInt(0); // version } public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadEncodedInt(); } private class LogoutGump : Gump { private readonly Timer m_CloseTimer; private readonly CampfireEntry m_Entry; private readonly Bedroll m_Bedroll; public LogoutGump(CampfireEntry entry, Bedroll bedroll) : base(100, 0) { this.m_Entry = entry; this.m_Bedroll = bedroll; this.m_CloseTimer = Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerCallback(CloseGump)); this.AddBackground(0, 0, 400, 350, 0xA28); this.AddHtmlLocalized(100, 20, 200, 35, 1011015, false, false); //