public NewSurveyToolTarget(SurveyToolEntry[] entries, SurveyToolEntry entry) : base(entry.MultiID, entry.Offset) { Range = 14; m_Entries = entries; m_Entry = entry; }
private static void FillTable(SurveyToolEntry[] entries) { for (int i = 0; i < entries.Length; ++i) { SurveyToolEntry e = (SurveyToolEntry)entries[i]; object obj = m_Table[e.m_Type]; if (obj == null) { m_Table[e.m_Type] = e; } else if (obj is SurveyToolEntry) { ArrayList list = new ArrayList(); list.Add(obj); list.Add(e); m_Table[e.m_Type] = list; } else if (obj is ArrayList) { ArrayList list = (ArrayList)obj; if (list.Count == 8) { Hashtable table = new Hashtable(); for (int j = 0; j < list.Count; ++j) { table[((SurveyToolEntry)list[j]).m_MultiID] = list[j]; } table[e.m_MultiID] = e; m_Table[e.m_Type] = table; } else { list.Add(e); } } else if (obj is Hashtable) { ((Hashtable)obj)[e.m_MultiID] = e; } } }
public static SurveyToolEntry Find(BaseHouse house) { object obj = m_Table[house.GetType()]; if (obj is SurveyToolEntry) { return((SurveyToolEntry)obj); } else if (obj is ArrayList) { ArrayList list = (ArrayList)obj; for (int i = 0; i < list.Count; ++i) { SurveyToolEntry e = (SurveyToolEntry)list[i]; if (e.m_MultiID == (house.ItemID & 0x3FFF)) { return(e); } } } else if (obj is Hashtable) { Hashtable table = (Hashtable)obj; obj = table[house.ItemID & 0x3FFF]; if (obj is SurveyToolEntry) { return((SurveyToolEntry)obj); } } return(null); }
public SurveyToolListGump(Mobile from, SurveyToolEntry[] entries) : base(50, 50) { m_From = from; m_Entries = entries; from.CloseGump(typeof(SurveyToolCategoryGump)); from.CloseGump(typeof(SurveyToolListGump)); AddPage(0); AddBackground(0, 0, 520, 420, 5054); AddImageTiled(10, 10, 500, 20, 2624); AddAlphaRegion(10, 10, 500, 20); AddLabel(50, 10, 1153, "Survey Tool"); AddImageTiled(10, 40, 500, 20, 2624); AddAlphaRegion(10, 40, 500, 20); AddHtmlLocalized(50, 40, 225, 20, 1060235, LabelColor, false, false); // House Description AddLabel(275, 40, 1153, "Lock Downs"); AddLabel(350, 40, 1153, "Lock Boxes"); AddLabel(425, 40, 1153, "Secures"); //AddHtmlLocalized( 275, 40, 75, 20, 1060236, LabelColor, false, false ); // Storage //AddHtmlLocalized( 350, 40, 75, 20, 1060237, LabelColor, false, false ); // Lockdowns //AddHtmlLocalized( 425, 40, 75, 20, 1060034, LabelColor, false, false ); // Cost AddImageTiled(10, 70, 500, 280, 2624); AddAlphaRegion(10, 70, 500, 280); AddImageTiled(10, 360, 500, 20, 2624); AddAlphaRegion(10, 360, 500, 20); //AddHtmlLocalized( 10, 360, 250, 20, 1060645, LabelColor, false, false ); // Bank Balance: //AddLabel( 250, 360, LabelHue, Banker.GetBalance( from ).ToString() ); AddImageTiled(10, 390, 500, 20, 2624); AddAlphaRegion(10, 390, 500, 20); AddButton(10, 390, 4017, 4019, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 390, 100, 20, 3000363, LabelColor, false, false); // Close for (int i = 0; i < entries.Length; ++i) { int page = 1 + (i / 14); int index = i % 14; if (index == 0) { if (page > 1) { AddButton(450, 390, 4005, 4007, 0, GumpButtonType.Page, page); AddHtmlLocalized(400, 390, 100, 20, 3000406, LabelColor, false, false); // Next } AddPage(page); if (page > 1) { AddButton(200, 390, 4014, 4016, 0, GumpButtonType.Page, page - 1); AddHtmlLocalized(250, 390, 100, 20, 3000405, LabelColor, false, false); // Previous } } SurveyToolEntry entry = entries[i]; int y = 70 + (index * 20); AddButton(10, y, 4005, 4007, 1 + i, GumpButtonType.Reply, 0); AddHtmlLocalized(50, y, 225, 20, entry.Description, LabelColor, false, false); AddLabel(275, y, LabelHue, entry.Storage.ToString()); AddLabel(350, y, LabelHue, entry.Lockdowns.ToString()); AddLabel(425, y, LabelHue, entry.Cost.ToString()); } }
private static void FillTable( SurveyToolEntry[] entries ) { for ( int i = 0; i < entries.Length; ++i ) { SurveyToolEntry e = (SurveyToolEntry)entries[i]; object obj = m_Table[e.m_Type]; if ( obj == null ) { m_Table[e.m_Type] = e; } else if ( obj is SurveyToolEntry ) { ArrayList list = new ArrayList(); list.Add( obj ); list.Add( e ); m_Table[e.m_Type] = list; } else if ( obj is ArrayList ) { ArrayList list = (ArrayList)obj; if ( list.Count == 8 ) { Hashtable table = new Hashtable(); for ( int j = 0; j < list.Count; ++j ) table[((SurveyToolEntry)list[j]).m_MultiID] = list[j]; table[e.m_MultiID] = e; m_Table[e.m_Type] = table; } else { list.Add( e ); } } else if ( obj is Hashtable ) { ((Hashtable)obj)[e.m_MultiID] = e; } } }
public NewSurveyToolTarget( SurveyToolEntry[] entries, SurveyToolEntry entry ) : base( entry.MultiID, entry.Offset ) { Range = 14; m_Entries = entries; m_Entry = entry; }
public SurveyToolListGump( Mobile from, SurveyToolEntry[] entries ) : base( 50, 50 ) { m_From = from; m_Entries = entries; from.CloseGump( typeof( SurveyToolCategoryGump ) ); from.CloseGump( typeof( SurveyToolListGump ) ); AddPage( 0 ); AddBackground( 0, 0, 520, 420, 5054 ); AddImageTiled( 10, 10, 500, 20, 2624 ); AddAlphaRegion( 10, 10, 500, 20 ); AddLabel( 50, 10, 1153, "Survey Tool"); AddImageTiled( 10, 40, 500, 20, 2624 ); AddAlphaRegion( 10, 40, 500, 20 ); AddHtmlLocalized( 50, 40, 225, 20, 1060235, LabelColor, false, false ); // House Description AddLabel( 275, 40, 1153, "Lock Downs"); AddLabel( 350, 40, 1153, "Lock Boxes"); AddLabel( 425, 40, 1153, "Secures"); //AddHtmlLocalized( 275, 40, 75, 20, 1060236, LabelColor, false, false ); // Storage //AddHtmlLocalized( 350, 40, 75, 20, 1060237, LabelColor, false, false ); // Lockdowns //AddHtmlLocalized( 425, 40, 75, 20, 1060034, LabelColor, false, false ); // Cost AddImageTiled( 10, 70, 500, 280, 2624 ); AddAlphaRegion( 10, 70, 500, 280 ); AddImageTiled( 10, 360, 500, 20, 2624 ); AddAlphaRegion( 10, 360, 500, 20 ); //AddHtmlLocalized( 10, 360, 250, 20, 1060645, LabelColor, false, false ); // Bank Balance: //AddLabel( 250, 360, LabelHue, Banker.GetBalance( from ).ToString() ); AddImageTiled( 10, 390, 500, 20, 2624 ); AddAlphaRegion( 10, 390, 500, 20 ); AddButton( 10, 390, 4017, 4019, 0, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 50, 390, 100, 20, 3000363, LabelColor, false, false ); // Close for ( int i = 0; i < entries.Length; ++i ) { int page = 1 + (i / 14); int index = i % 14; if ( index == 0 ) { if ( page > 1 ) { AddButton( 450, 390, 4005, 4007, 0, GumpButtonType.Page, page ); AddHtmlLocalized( 400, 390, 100, 20, 3000406, LabelColor, false, false ); // Next } AddPage( page ); if ( page > 1 ) { AddButton( 200, 390, 4014, 4016, 0, GumpButtonType.Page, page - 1 ); AddHtmlLocalized( 250, 390, 100, 20, 3000405, LabelColor, false, false ); // Previous } } SurveyToolEntry entry = entries[i]; int y = 70 + (index * 20); AddButton( 10, y, 4005, 4007, 1 + i, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 50, y, 225, 20, entry.Description, LabelColor, false, false ); AddLabel( 275, y, LabelHue, entry.Storage.ToString() ); AddLabel( 350, y, LabelHue, entry.Lockdowns.ToString() ); AddLabel( 425, y, LabelHue, entry.Cost.ToString() ); } }