private void AddDetails(int index, int half, int tb) { int hue; if (index < m_Book.Entries.Count) { int btn; btn = (index * 2) + 1; TMapBookEntry e = (TMapBookEntry)m_Book.Entries[index]; hue = GetMapHue(e.Map); AddLabel(135 + (half * 160), 40 + (tb * 80), hue, String.Format("Level {0} {1}", e.Level, e.Map)); if (e.Decoder == null) { AddLabel(135 + (half * 160), 55 + (tb * 80), hue, String.Format("Not Decoded")); } else { AddLabel(135 + (half * 160), 55 + (tb * 80), hue, String.Format("Decoder {0}", e.Decoder.Name)); AddButton(135 + (half * 160), 89 + (tb * 80), 216, 216, btn + 1, GumpButtonType.Reply, 0); AddHtml(150 + (half * 160), 87 + (tb * 80), 100, 18, "View", false, false); } // buttons AddButton(135 + (half * 160), 75 + (tb * 80), 2437, 2438, btn, GumpButtonType.Reply, 0); AddHtml(150 + (half * 160), 73 + (tb * 80), 100, 18, "Drop TMap", false, false); } }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), 1) || !Multis.DesignContext.Check(from)) { return; } int buttonID = info.ButtonID; int index = (buttonID / 2); int drp = buttonID % 2; if (index >= 0 && index < m_Book.Entries.Count && drp == 1) { TMapBookEntry e = (TMapBookEntry)m_Book.Entries[index]; if (m_Book.CheckAccess(from)) { m_Book.DropTMap(from, e, index); from.CloseGump(typeof(TMapBookGump)); from.SendGump(new TMapBookGump(from, m_Book)); } else { from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } } // ViewMap else if (index >= 1 && index < m_Book.Entries.Count + 1 && drp == 0) { index = index - 1; TMapBookEntry e = (TMapBookEntry)m_Book.Entries[index]; if (m_Book.CheckAccess(from)) { from.CloseGump(typeof(TMapBookGump)); from.SendGump(new TMapBookGump(from, m_Book)); m_Book.ViewMap(from, e, index); } else { from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } } // end view }