public AccessListGump(Mobile from, BaseGalleon galleon) : base(50, 50, galleon) { from.CloseGump(typeof(AccessListGump)); m_Galleon = galleon; m_Entry = galleon.SecurityEntry; if (m_Entry == null) { m_Entry = new SecurityEntry(m_Galleon); m_Galleon.SecurityEntry = m_Entry; } AddButton(10, 370, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(45, 370, 100, 20, 1149777, LabelColor, false, false); //MAIN MENU List<Mobile> list = new List<Mobile>(m_Entry.Manifest.Keys); m_UseList = list; int pages = (int)Math.Ceiling(list.Count / 10.0); int index = 0; for (int i = 1; i <= pages; i++) { int y = 85; AddPage(i); for (int c = 0; c < 10; c++) { if (index >= list.Count) break; Mobile mob = list[index]; if (mob == null) continue; string name = mob.Name; SecurityLevel level = m_Entry.GetEffectiveLevel(mob); AddButton(10, y, 4005, 4007, index + 2, GumpButtonType.Reply, 0); AddHtml(45, y, 130, 20, Color(name, "DarkCyan"), false, false); AddHtmlLocalized(180, y, 100, 20, GetLevel(level), GetHue(level), false, false); index++; y += 25; } if (i < pages) { AddButton(310, 390, 4005, 4007, 0, GumpButtonType.Page, i + 1); } if (i > 1) { AddButton(270, 390, 4014, 4016, 0, GumpButtonType.Page, i - 1); } } }
public ShipSecurityGump(Mobile from, BaseGalleon galleon) : base(50, 50, galleon) { from.CloseGump(typeof(ShipSecurityGump)); m_From = from; m_Galleon = galleon; m_Entry = galleon.SecurityEntry; if (m_Entry == null) m_Galleon.SecurityEntry = new SecurityEntry(m_Galleon); PartyAccess pa = m_Entry.PartyAccess; AddHtmlLocalized(10, 80, 330, 20, 1149743, LabelColor, false, false); //Party membership modifies access to this ship: //Party defaults AddButton(60, 100, pa == PartyAccess.Never ? 4006 : 4005, pa == PartyAccess.Never ? 4006 : 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(95, 100, 300, 20, 1149778, LabelColor, false, false); //Never AddButton(60, 120, pa == PartyAccess.LeaderOnly ? 4006 : 4005, pa == PartyAccess.LeaderOnly ? 4006 : 4007, 2, GumpButtonType.Reply, 0); AddHtmlLocalized(95, 120, 300, 20, 1149744, LabelColor, false, false); //When I am Party Leader AddButton(60, 140, pa == PartyAccess.MemberOnly ? 4006 : 4005, pa == PartyAccess.MemberOnly ? 4006 : 4007, 3, GumpButtonType.Reply, 0); AddHtmlLocalized(95, 140, 300, 20, 1149745, LabelColor, false, false); //When I am a Party Member //Default security access AddHtmlLocalized(10, 165, 100, 20, 1149731, LabelColor, false, false); //Public Access: AddButton(140, 165, 4005, 4007, 4, GumpButtonType.Reply, 0); AddHtmlLocalized(175, 165, 100, 20, GetLevel(m_Entry.DefaultPublicAccess), GetHue(m_Entry.DefaultPublicAccess), false, false); AddHtmlLocalized(10, 185, 100, 20, 1149732, LabelColor, false, false); //Party Access: AddButton(140, 185, 4005, 4007, 5, GumpButtonType.Reply, 0); AddHtmlLocalized(175, 185, 100, 20, GetLevel(m_Entry.DefaultPartyAccess), GetHue(m_Entry.DefaultPartyAccess), false, false); AddHtmlLocalized(10, 205, 100, 20, 1149733, LabelColor, false, false); //Guild Access: AddButton(140, 205, 4005, 4007, 6, GumpButtonType.Reply, 0); AddHtmlLocalized(175, 205, 100, 20, GetLevel(m_Entry.DefaultGuildAccess), GetHue(m_Entry.DefaultGuildAccess), false, false); AddButton(195, 370, 4005, 4007, 7, GumpButtonType.Reply, 0); AddHtmlLocalized(230, 370, 100, 20, 1149734, LabelColor, false, false); //ACCESS LIST }
public bool IsPublic() { if (m_SecurityEntry == null) m_SecurityEntry = new SecurityEntry(this); return m_SecurityEntry.IsPublic; }
public SecurityLevel GetSecurityLevel(Mobile from) { if (m_SecurityEntry == null) m_SecurityEntry = new SecurityEntry(this); if (from.AccessLevel > AccessLevel.Player || IsOwner(from)) return SecurityLevel.Captain; return m_SecurityEntry.GetEffectiveLevel(from); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 3: case 2: m_Pole = reader.ReadItem() as BindingPole; m_CapturedCaptain = reader.ReadMobile(); goto case 1; case 1: m_BaseBoatHue = reader.ReadInt(); goto case 0; case 0: m_GalleonPilot = reader.ReadMobile(); m_Hits = reader.ReadInt(); m_Wheel = reader.ReadItem() as ShipWheel; m_GalleonHold = reader.ReadItem() as GalleonHold; if (version < 3) { reader.ReadItem(); reader.ReadItem(); } m_DamageTaken = (DamageLevel)reader.ReadInt(); m_BasePaintHue = reader.ReadInt(); m_PaintCoats = reader.ReadInt(); m_NextPaintDecay = reader.ReadDateTime(); m_SecurityEntry = new SecurityEntry(this, reader); int count = reader.ReadInt(); for (int i = 0; i < count; i++) { Static tile = reader.ReadItem() as Static; if (tile != null && !tile.Deleted) AddCannonTile(tile); } count = reader.ReadInt(); for (int i = 0; i < count; i++) { Item cannon = reader.ReadItem(); if (cannon != null && !cannon.Deleted) m_Cannons.Add(cannon); } count = reader.ReadInt(); for (int i = 0; i < count; i++) { Static filler = reader.ReadItem() as Static; if (filler != null && !filler.Deleted) AddFillerTile(filler); } count = reader.ReadInt(); for (int i = 0; i < count; i++) { MooringLine line = reader.ReadItem() as MooringLine; if (line != null && !line.Deleted) AddMooringLine(line); } count = reader.ReadInt(); for (int i = 0; i < count; i++) { HoldItem hItem = reader.ReadItem() as HoldItem; if (hItem != null && !hItem.Deleted) AddHoldTile(hItem); } count = reader.ReadInt(); for (int i = 0; i < count; i++) { Item addon = reader.ReadItem(); if (addon != null && !addon.Deleted) AddAddon(addon); } count = reader.ReadInt(); for (int i = 0; i < count; i++) { Static atile = reader.ReadItem() as Static; if (atile != null && !atile.Deleted) AddAddonTile(atile); } break; } if (m_Pole != null) m_Pole.Galleon = this; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 5: { m_MultiID = reader.ReadInt(); m_Offset = reader.ReadPoint3D(); m_ShipName = reader.ReadString(); m_BoatItem = reader.ReadItem() as BaseBoat; break; } case 4: { switch (reader.ReadInt()) { default: case 0: break; case 1: m_PilotEntry = new PilotEntry(reader); break; } goto case 3; } case 3: { m_BaseHue = reader.ReadInt(); if(version < 5) reader.ReadItem(); reader.ReadItem(); m_Owner = reader.ReadMobile(); goto case 2; } case 2: { switch (reader.ReadInt()) { default: case 0: break; case 1: m_SecurityEntry = new SecurityEntry(null, reader); break; } goto case 1; } case 1: case 0: { m_MultiID = reader.ReadInt(); m_Offset = reader.ReadPoint3D(); m_ShipName = reader.ReadString(); if ( version == 0 ) reader.ReadUInt(); break; } } if ( LootType == LootType.Newbied ) LootType = LootType.Blessed; if ( Weight == 0.0 ) Weight = 1.0; }
public GrantAccessGump(Mobile player, BaseGalleon galleon) : base(50, 50, galleon) { player.CloseGump(typeof(GrantAccessGump)); m_Player = player; m_Galleon = galleon; m_Entry = galleon.SecurityEntry; if (m_Entry == null) { m_Entry = new SecurityEntry(m_Galleon); m_Galleon.SecurityEntry = m_Entry; } bool isAccessed = m_Entry.Manifest.ContainsKey(player); bool inGuild = m_Entry.IsInGuild(player); bool inParty = m_Entry.IsInParty(player); bool isPublic = m_Entry.IsPublic; SecurityLevel level = m_Entry.GetEffectiveLevel(player); //Player Info AddHtmlLocalized(10, 85, 100, 20, 1149763, LabelColor, false, false); //Player: AddHtml(90, 85, 100, 20, Color(player.Name, "DarkCyan"), false, false); AddHtmlLocalized(10, 105, 100, 20, 1149768, LabelColor, false, false); //Effective Level: AddHtmlLocalized(150, 105, 100, 20, GetLevel(level), GetHue(level), false, false); //Default Info int cliloc = isPublic ? 1149756 : 1149757; int hue = isPublic ? CrewHue : NoHue; AddHtmlLocalized(10, 130, 100, 20, 1149731, LabelColor, false, false); //Public Access: AddHtmlLocalized(150, 130, 50, 20, cliloc, hue, false, false); //Yes/No if (isPublic) AddHtmlLocalized(230, 130, 100, 20, GetLevel(m_Entry.DefaultPublicAccess), GetHue(m_Entry.DefaultPublicAccess), false, false); cliloc = inParty ? 1149756 : 1149757; hue = inParty ? CrewHue : NoHue; AddHtmlLocalized(10, 150, 200, 20, 1149769, LabelColor, false, false); //Is Party Member: AddHtmlLocalized(150, 150, 50, 20, cliloc, hue, false, false); if (inParty) AddHtmlLocalized(230, 150, 100, 20, GetLevel(m_Entry.DefaultPartyAccess), GetHue(m_Entry.DefaultPartyAccess), false, false); cliloc = inGuild ? 1149756 : 1149757; hue = inGuild ? CrewHue : NoHue; AddHtmlLocalized(10, 170, 200, 20, 1149770, LabelColor, false, false); //Is Guild Member AddHtmlLocalized(150, 170, 50, 20, cliloc, hue, false, false); if (inGuild) AddHtmlLocalized(230, 170, 100, 20, GetLevel(m_Entry.DefaultGuildAccess), GetHue(m_Entry.DefaultGuildAccess), false, false); AddHtmlLocalized(10, 195, 300, 20, 1149747, LabelColor, false, false); //Access list status: AddButton(65, 215, isAccessed ? 4006 : 4005, isAccessed ? 4006 : 4007, 1, GumpButtonType.Reply, 0); if (!isAccessed) AddHtmlLocalized(100, 215, 200, 20, 1149775, NoHue, false, false); //Not in access list else AddHtmlLocalized(100, 215, 200, 20, 1149776, NoHue, false, false); //Remove from access list AddButton(65, 235, level == SecurityLevel.Denied ? 4006 : 4005, level == SecurityLevel.Denied ? 4006 : 4007, 2, GumpButtonType.Reply, 0); AddHtmlLocalized(100, 235, 200, 20, 1149726, LabelColor, false, false); //Deny access AddButton(65, 255, level == SecurityLevel.Passenger ? 4006 : 4005, level == SecurityLevel.Passenger ? 4006 : 4007, 3, GumpButtonType.Reply, 0); AddHtmlLocalized(100, 255, 200, 20, 1149727, level == SecurityLevel.Passenger ? GetHue(level) : LabelColor, false, false); //Passenger AddButton(65, 275, level == SecurityLevel.Crewman ? 4006 : 4005, level == SecurityLevel.Passenger ? 4006 : 4007, 4, GumpButtonType.Reply, 0); AddHtmlLocalized(100, 275, 200, 20, 1149728, level == SecurityLevel.Crewman ? GetHue(level) : LabelColor, false, false); //Crew AddButton(65, 295, level == SecurityLevel.Officer ? 4006 : 4005, level == SecurityLevel.Passenger ? 4006 : 4007, 5, GumpButtonType.Reply, 0); AddHtmlLocalized(100, 295, 200, 20, 1149729, level == SecurityLevel.Officer ? GetHue(level) : LabelColor, false, false); AddButton(65, 315, level == SecurityLevel.Captain ? 4006 : 4005, level == SecurityLevel.Captain ? 4006 : 4007, 6, GumpButtonType.Reply, 0); AddHtmlLocalized(100, 315, 200, 20, 1149730, level == SecurityLevel.Captain ? GetHue(level) : LabelColor, false, false); //BOtton of screen AddButton(10, 370, 4005, 4007, 7, GumpButtonType.Reply, 0); AddHtmlLocalized(45, 370, 100, 20, 1149777, LabelColor,false, false); //MAIN MENU AddButton(195, 370, 4005, 4007, 8, GumpButtonType.Reply, 0); AddHtmlLocalized(230, 370, 100, 20, 1149734, LabelColor,false, false); //ACCESS LIST }