public PartyHealthTrackerGump(PartyMember member) : base(member.Serial, 0) { while (UserInterface.GetControl<MobileHealthTrackerGump>() != null) { UserInterface.GetControl<MobileHealthTrackerGump>(member.Serial).Dispose(); } IsMoveable = false; IsUncloseableWithRMB = true; m_Serial = member.Serial; //AddControl(m_Background = new ResizePic(this, 0, 0, 3000, 131, 48));//I need opacity %1 background AddControl(m_Name = new TextLabel(this, 1, 0, 1, member.Name)); //m_Background.MouseDoubleClickEvent += Background_MouseDoubleClickEvent; //maybe private message calling? m_BarBGs = new GumpPic[3]; int sameX = 15; int sameY = 3; if (WorldModel.Entities.GetPlayerEntity().Serial != member.Serial)//you can't send a message to self { AddControl(btnPrivateMsg = new Button(this, 0, 20, 11401, 11402, ButtonTypes.Activate, member.Serial, 0));//private party message / use bandage ?? } AddControl(m_BarBGs[0] = new GumpPic(this, sameX, 15 + sameY, 9750, 0)); AddControl(m_BarBGs[1] = new GumpPic(this, sameX, 24 + sameY, 9750, 0)); AddControl(m_BarBGs[2] = new GumpPic(this, sameX, 33 + sameY, 9750, 0)); m_Bars = new GumpPicWithWidth[3]; AddControl(m_Bars[0] = new GumpPicWithWidth(this, sameX, 15 + sameY, 40, 0, 1f));//I couldn't find correct visual AddControl(m_Bars[1] = new GumpPicWithWidth(this, sameX, 24 + sameY, 9751, 0, 1f));//I couldn't find correct visual AddControl(m_Bars[2] = new GumpPicWithWidth(this, sameX, 33 + sameY, 41, 0, 1f));//I couldn't find correct visual // bars should not handle mouse input, pass it to the background gump. for (int i = 0; i < m_BarBGs.Length; i++)//??? { m_Bars[i].HandlesMouseInput = false; } }
public MobileHealthTrackerGump(Mobile mobile) : base(mobile.Serial, 0) { while (UserInterface.GetControl<MobileHealthTrackerGump>(mobile.Serial) != null) { UserInterface.GetControl<MobileHealthTrackerGump>(mobile.Serial).Dispose(); } IsMoveable = true; HandlesMouseInput = true; Mobile = mobile; if (Mobile.IsClientEntity) { AddControl(m_Background = new GumpPic(this, 0, 0, 0x0803, 0)); m_BarBGs = new GumpPic[3]; AddControl(m_BarBGs[0] = new GumpPic(this, 34, 10, 0x0805, 0)); AddControl(m_BarBGs[1] = new GumpPic(this, 34, 24, 0x0805, 0)); AddControl(m_BarBGs[2] = new GumpPic(this, 34, 38, 0x0805, 0)); m_Bars = new GumpPicWithWidth[3]; AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 10, 0x0806, 0, 1f)); AddControl(m_Bars[1] = new GumpPicWithWidth(this, 34, 24, 0x0806, 0, 1f)); AddControl(m_Bars[2] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f)); } else { AddControl(m_Background = new GumpPic(this, 0, 0, 0x0804, 0)); m_BarBGs = new GumpPic[1]; AddControl(m_BarBGs[0] = new GumpPic(this, 34, 38, 0x0805, 0)); m_Bars = new GumpPicWithWidth[1]; AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f)); AddControl(new HtmlGumpling(this, 17, 13, 120, 20, 0, 0, String.Format("<span color='#000' style='font-family:uni0;'>{0}", mobile.Name))); } }
public override void Initialize() { m_gumplingTop = (GumpPic)AddControl(new GumpPic(this, 0, 0, 0, 0x0820, 0)); m_gumplingMiddle = (GumpPicTiled)AddControl(new GumpPicTiled(this, 0, 0, 0, 0, 0, 0x0822)); m_gumplingBottom = (GumpPic)AddControl(new GumpPic(this, 0, 0, 0, 0x0823, 0)); m_gumplingExpander = (Button)AddControl(new Button(this, 0, 0, 0, 0x082E, 0x82F, ButtonTypes.Activate, 0, gumplingExpander_ButtonID)); m_gumplingExpander.OnMouseDown = expander_OnMouseDown; m_gumplingExpander.OnMouseUp = expander_OnMouseUp; m_gumplingExpander.OnMouseOver = expander_OnMouseOver; }
void BuildGump() { ClearControls(); if (m_Book.ItemID >= 0xFEF && m_Book.ItemID <= 0xFF2) { m_BookBackground = new GumpPic(this, 0, 0, 0x1FE, 0); m_PageCornerLeft = new GumpPic(this, 0, 0, 0x1FF, 0); m_PageCornerRight = new GumpPic(this, 356, 0, 0x200, 0); } AddControl(m_BookBackground); // book background gump AddControl(m_PageCornerLeft); // page turn left m_PageCornerLeft.GumpLocalID = 0; m_PageCornerLeft.MouseClickEvent += PageCorner_MouseClickEvent; m_PageCornerLeft.MouseDoubleClickEvent += PageCorner_MouseDoubleClickEvent; AddControl(m_PageCornerRight); // page turn right m_PageCornerRight.GumpLocalID = 1; m_PageCornerRight.MouseClickEvent += PageCorner_MouseClickEvent; m_PageCornerRight.MouseDoubleClickEvent += PageCorner_MouseDoubleClickEvent; // Draw the title and author page m_TitleTextEntry = new TextEntry(this, 45, 50, 155, 300, 1, 0, 0, m_Book.Title); m_TitleTextEntry.MakeThisADragger(); m_TitleTextEntry.IsEditable = m_Book.IsEditable; m_AuthorTextEntry = new TextEntry(this, 45, 110, 160, 300, 1, 0, 0, m_Book.Author); m_AuthorTextEntry.MakeThisADragger(); m_AuthorTextEntry.IsEditable = m_Book.IsEditable; AddControl(m_TitleTextEntry, 1); AddControl(new HtmlGumpling(this, 45, 90, 155, 300, 0, 0, "<font color=#444>By"), 1); AddControl(m_AuthorTextEntry, 1); // Add book pages to active pages bool isRight = true; string color = m_Book.IsEditable ? "800" : "000"; for (int i = 0; i < m_Book.PageCount; i++) { int onGumpPage = (i + 3) / 2; int x = isRight ? 235 : 45; m_Pages.Add(new TextEntryPage(this, x, 32, 155, 300, i)); m_Pages[i].SetMaxLines(8, OnPageOverflow, OnPageUnderflow); m_Pages[i].SetKeyboardPageControls(OnPreviousPage, OnNextPage); m_Pages[i].MakeThisADragger(); m_Pages[i].IsEditable = m_Book.IsEditable; m_Pages[i].LeadingHtmlTag = $"<font color=#{color}>"; m_Pages[i].Text = m_Book.Pages[i].GetAllLines(); AddControl(m_Pages[i], onGumpPage); AddControl(new HtmlGumpling(this, x, 195, 135, 20, 0, 0, $"<center><font color=#444>{i + 1}"), onGumpPage); isRight = !isRight; } AudioService service = Service.Get<AudioService>(); service.PlaySound(0x058); SetActivePage(1); UserInterface.KeyboardFocusControl = m_Pages[0]; m_Pages[0].CaratAt = m_Pages[0].Text.Length; }
protected override void OnInitialize() { m_GumplingTop = (GumpPic)AddControl(new GumpPic(this, 0, 0, 0x0820, 0)); m_GumplingMiddle = (GumpPicTiled)AddControl(new GumpPicTiled(this, 0, 0, 0, 0, 0x0822)); m_GumplingBottom = (GumpPic)AddControl(new GumpPic(this, 0, 0, 0x0823, 0)); if (m_IsResizable) { m_GumplingExpander = (Button)AddControl(new Button(this, 0, 0, 0x082E, 0x82F, ButtonTypes.Activate, 0, c_GumplingExpander_ButtonID)); m_GumplingExpander.MouseDownEvent += expander_OnMouseDown; m_GumplingExpander.MouseUpEvent += expander_OnMouseUp; m_GumplingExpander.MouseOverEvent += expander_OnMouseOver; } }
private void OnEntityUpdated() { // clear the existing Controls ClearControls(); // Add the base gump - the semi-naked paper doll. if (true) { int bodyID = 12 + (m_isElf ? 2 : 0) + (m_isFemale ? 1 : 0); // ((Mobile)m_sourceEntity).BodyID; GumpPic paperdoll = (GumpPic)AddControl(new GumpPic(this, 0, 0, bodyID, ((Mobile)m_sourceEntity).Hue)); paperdoll.HandlesMouseInput = true; paperdoll.IsPaperdoll = true; } // Loop through the items on the mobile and create the gump pics. for (int i = 0; i < s_DrawOrder.Length; i++) { Item item = ((Mobile)m_sourceEntity).GetItem((int)s_DrawOrder[i]); if (item == null) { continue; } bool canPickUp = true; switch (s_DrawOrder[i]) { case PaperDollEquipSlots.FacialHair: case PaperDollEquipSlots.Hair: canPickUp = false; break; default: break; } AddControl(new ItemGumplingPaperdoll(this, 0, 0, item)); ((ItemGumplingPaperdoll)LastControl).SlotIndex = (int)i; ((ItemGumplingPaperdoll)LastControl).IsFemale = m_isFemale; ((ItemGumplingPaperdoll)LastControl).CanPickUp = canPickUp; } // If this object has a backpack, add it last. if (((Mobile)m_sourceEntity).GetItem((int)PaperDollEquipSlots.Backpack) != null) { Item backpack = ((Mobile)m_sourceEntity).GetItem((int)PaperDollEquipSlots.Backpack); AddControl(new GumpPicBackpack(this, -7, 0, backpack)); LastControl.HandlesMouseInput = true; LastControl.MouseDoubleClickEvent += On_Dblclick_Backpack; } }
public void CreateVisual() { if (m_ResizePic != null || m_label != null || ScrollButton != null) return; m_ResizePic = (ResizePic)AddControl(new ResizePic(this, 0, 0, 3000, m_Width, m_Font.Height + 8), 0); m_ResizePic.GumpLocalID = GumpLocalID; m_ResizePic.MouseClickEvent += onClickClosedList; m_ResizePic.MouseOverEvent += onMouseOverClosedList; m_ResizePic.MouseOutEvent += onMouseOutClosedList; m_ResizePic.IsEnabled = false; m_label = (TextLabelAscii)AddControl(new TextLabelAscii(this, 4, 5, 1, hue_Text, string.Empty), 0); m_label.GumpLocalID = GumpLocalID; ScrollButton = (GumpPic)AddControl(new GumpPic(this, m_Width - 22, 5, 2086, 0), 0); IsFirstvisible = true;//for invisible create control }
public MobileHealthTrackerGump(Mobile mobile) : base(mobile.Serial, 0) { while (UserInterface.GetControl<MobileHealthTrackerGump>(mobile.Serial) != null) { UserInterface.GetControl<MobileHealthTrackerGump>(mobile.Serial).Dispose(); } IsMoveable = true; Mobile = mobile; m_World = Service.Get<WorldModel>(); if (Mobile.IsClientEntity) { AddControl(m_Background = new GumpPic(this, 0, 0, 0x0803, 0)); m_Background.MouseDoubleClickEvent += Background_MouseDoubleClickEvent; m_BarBGs = new GumpPic[3]; AddControl(m_BarBGs[0] = new GumpPic(this, 34, 10, 0x0805, 0)); AddControl(m_BarBGs[1] = new GumpPic(this, 34, 24, 0x0805, 0)); AddControl(m_BarBGs[2] = new GumpPic(this, 34, 38, 0x0805, 0)); m_Bars = new GumpPicWithWidth[3]; AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 10, 0x0806, 0, 1f)); AddControl(m_Bars[1] = new GumpPicWithWidth(this, 34, 24, 0x0806, 0, 1f)); AddControl(m_Bars[2] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f)); } else { AddControl(m_Background = new GumpPic(this, 0, 0, 0x0804, 0)); m_Background.MouseDoubleClickEvent += Background_MouseDoubleClickEvent; m_BarBGs = new GumpPic[1]; AddControl(m_BarBGs[0] = new GumpPic(this, 34, 38, 0x0805, 0)); m_Bars = new GumpPicWithWidth[1]; AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f)); AddControl(m_NameEntry = new TextEntry(this, 17, 16, 124, 20, 0, 0, 99, mobile.Name)); SetupMobileNameEntry(); } // bars should not handle mouse input, pass it to the background gump. for (int i = 0; i < m_BarBGs.Length; i++) { m_BarBGs[i].HandlesMouseInput = false; m_Bars[i].HandlesMouseInput = false; } }
public UseSpellButtonGump(SpellDefinition spell) : base(spell.ID, 0) { while (UserInterface.GetControl<UseSpellButtonGump>(spell.ID) != null) { UserInterface.GetControl<UseSpellButtonGump>(spell.ID).Dispose(); } m_Spell = spell; m_World = ServiceRegistry.GetService<WorldModel>(); IsMoveable = true; HandlesMouseInput = true; m_SpellButton = (GumpPic)AddControl(new GumpPic(this, 0, 0, spell.GumpIconSmallID, 0)); LastControl.HandlesMouseInput = true; LastControl.MouseClickEvent += EventMouseClick; }
public void CreateVisual() { if (m_ResizePic != null || m_label != null || ScrollButton != null) { return; } m_ResizePic = (ResizePic)AddControl(new ResizePic(this, 0, 0, 3000, m_Width, m_Font.Height + 8), 0); m_ResizePic.GumpLocalID = GumpLocalID; m_ResizePic.MouseClickEvent += onClickClosedList; m_ResizePic.MouseOverEvent += onMouseOverClosedList; m_ResizePic.MouseOutEvent += onMouseOutClosedList; m_ResizePic.IsEnabled = false; m_label = (TextLabelAscii)AddControl(new TextLabelAscii(this, 4, 5, 1, hue_Text, string.Empty), 0); m_label.GumpLocalID = GumpLocalID; ScrollButton = (GumpPic)AddControl(new GumpPic(this, m_Width - 22, 5, 2086, 0), 0); IsFirstvisible = true;//for invisible create control }
public MobileHealthTrackerGump(Mobile mobile) : base(mobile.Serial, 0) { while (UserInterface.GetControl<MobileHealthTrackerGump>(mobile.Serial) != null) { UserInterface.GetControl<MobileHealthTrackerGump>(mobile.Serial).Dispose(); } IsMoveable = true; Mobile = mobile; if (Mobile.IsClientEntity) { AddControl(m_Background = new GumpPic(this, 0, 0, 0x0803, 0)); m_Background.MouseDoubleClickEvent += Background_MouseDoubleClickEvent; m_BarBGs = new GumpPic[3]; AddControl(m_BarBGs[0] = new GumpPic(this, 34, 10, 0x0805, 0)); AddControl(m_BarBGs[1] = new GumpPic(this, 34, 24, 0x0805, 0)); AddControl(m_BarBGs[2] = new GumpPic(this, 34, 38, 0x0805, 0)); m_Bars = new GumpPicWithWidth[3]; AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 10, 0x0806, 0, 1f)); AddControl(m_Bars[1] = new GumpPicWithWidth(this, 34, 24, 0x0806, 0, 1f)); AddControl(m_Bars[2] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f)); } else { AddControl(m_Background = new GumpPic(this, 0, 0, 0x0804, 0)); m_BarBGs = new GumpPic[1]; AddControl(m_BarBGs[0] = new GumpPic(this, 34, 38, 0x0805, 0)); m_Bars = new GumpPicWithWidth[1]; AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f)); AddControl(new HtmlGumpling(this, 17, 13, 120, 20, 0, 0, String.Format("<span color='#000' style='font-family:uni0;'>{0}", mobile.Name))); } // bars should not handle mouse input, pass it to the background gump. for (int i = 0; i < m_BarBGs.Length; i++) { m_BarBGs[i].HandlesMouseInput = false; m_Bars[i].HandlesMouseInput = false; } }
public override void Update(double totalMS, double frameMS) { if (hasSourceEntity) { m_isFemale = ((Mobile)m_sourceEntity).Flags.IsFemale; m_isElf = false; if (m_sourceEntityUpdateHash != ((Mobile)m_sourceEntity).UpdateTicker) { // update our hash m_sourceEntityUpdateHash = ((Mobile)m_sourceEntity).UpdateTicker; // clear the existing Controls ClearControls(); // Add the base gump - the semi-naked paper doll. if (true) { int bodyID = 12 + (m_isElf ? 2 : 0) + (m_isFemale ? 1 : 0); // ((Mobile)m_sourceEntity).BodyID; GumpPic paperdoll = (GumpPic)AddControl(new GumpPic(this, 0, 0, 0, bodyID, ((Mobile)m_sourceEntity).Hue)); paperdoll.HandlesMouseInput = true; paperdoll.IsPaperdoll = true; } // Loop through the items on the mobile and create the gump pics. for (int i = 0; i < s_DrawOrder.Length; i++) { Item item = ((Mobile)m_sourceEntity).GetItem((int)s_DrawOrder[i]); if (item == null) { continue; } bool canPickUp = true; switch (s_DrawOrder[i]) { case EquipSlots.FacialHair: case EquipSlots.Hair: canPickUp = false; break; default: break; } AddControl(new ItemGumplingPaperdoll(this, 0, 0, item)); ((ItemGumplingPaperdoll)LastControl).SlotIndex = (int)i; ((ItemGumplingPaperdoll)LastControl).IsFemale = m_isFemale; ((ItemGumplingPaperdoll)LastControl).CanPickUp = canPickUp; } // If this object has a backpack, draw it last. if (((Mobile)m_sourceEntity).GetItem((int)EquipSlots.Backpack) != null) { Item backpack = ((Mobile)m_sourceEntity).GetItem((int)EquipSlots.Backpack); AddControl(new GumpPicBackpack(this, 0, -5, 0, backpack)); LastControl.HandlesMouseInput = true; LastControl.OnMouseDoubleClick += dblclick_Backpack; } } } base.Update(totalMS, frameMS); }
private void CreateMageryGumplings() { ClearControls(); AddControl(new GumpPic(this, 0, 0, 0x08AC, 0)); // spellbook background AddControl(m_PageCornerLeft = new GumpPic(this, 50, 8, 0x08BB, 0)); // page turn left m_PageCornerLeft.GumpLocalID = 0; m_PageCornerLeft.MouseClickEvent += PageCorner_MouseClickEvent; m_PageCornerLeft.MouseDoubleClickEvent += PageCorner_MouseDoubleClickEvent; AddControl(m_PageCornerRight = new GumpPic(this, 321, 8, 0x08BC, 0)); // page turn right m_PageCornerRight.GumpLocalID = 1; m_PageCornerRight.MouseClickEvent += PageCorner_MouseClickEvent; m_PageCornerRight.MouseDoubleClickEvent += PageCorner_MouseDoubleClickEvent; for (int i = 0; i < 4; i++) // spell circles 1 - 4 { AddControl(new GumpPic(this, 60 + i * 35, 174, 0x08B1 + i, 0)); LastControl.GumpLocalID = i; LastControl.MouseClickEvent += SpellCircle_MouseClickEvent; // unsubscribe from these? } for (int i = 0; i < 4; i++) // spell circles 5 - 8 { AddControl(new GumpPic(this, 226 + i * 34, 174, 0x08B5 + i, 0)); LastControl.GumpLocalID = i + 4; LastControl.MouseClickEvent += SpellCircle_MouseClickEvent; // unsubscribe from these? } // indexes are on pages 1 - 4. Spells are on pages 5+. m_CircleHeaders = new HtmlGumpling[8]; for (int i = 0; i < 8; i++) { m_CircleHeaders[i] = (HtmlGumpling)AddControl( new HtmlGumpling(this, 64 + (i % 2) * 148, 10, 130, 200, 0, 0, string.Format("<span color='#004' style='font-family=uni0;'><center>{0}</center></span>", Magery.CircleNames[i])), 1 + (i / 2)); } m_Indexes = new HtmlGumpling[8]; for (int i = 0; i < 8; i++) { m_Indexes[i] = (HtmlGumpling)AddControl( new HtmlGumpling(this, 64 + (i % 2) * 156, 28, 130, 200, 0, 0, string.Empty), 1 + (i / 2)); } m_MaxPage = 4; // Begin checking which spells are in the spellbook and add them to m_Spells list int totalSpells = 0; m_SpellList.Clear(); for (int spellCircle = 0; spellCircle < 8; spellCircle++) { for (int spellIndex = 1; spellIndex <= 8; spellIndex++) { if (m_Spellbook.HasSpell(spellCircle, spellIndex)) { m_SpellList.Add(new KeyValuePair<int, int>(spellCircle, spellIndex)); totalSpells++; } } } m_MaxPage = m_MaxPage + ((totalSpells + 1) / 2); // The number of additional spell info pages needed SetActivePage(1); }
private void BuildGump() { m_World = ServiceRegistry.GetService<WorldModel>(); m_Client = ServiceRegistry.GetService<INetworkClient>(); IsMoveable = true; SaveOnWorldStop = true; GumpLocalID = Mobile.Serial; if (Mobile.IsClientEntity) { AddControl(new GumpPic(this, 0, 0, 0x07d0, 0)); // HELP AddControl(new Button(this, 185, 44 + 27 * 0, 0x07ef, 0x07f0, ButtonTypes.Activate, 0, (int)Buttons.Help)); ((Button)LastControl).GumpOverID = 0x07f1; // OPTIONS AddControl(new Button(this, 185, 44 + 27 * 1, 0x07d6, 0x07d7, ButtonTypes.Activate, 0, (int)Buttons.Options)); ((Button)LastControl).GumpOverID = 0x07d8; // LOG OUT AddControl(new Button(this, 185, 44 + 27 * 2, 0x07d9, 0x07da, ButtonTypes.Activate, 0, (int)Buttons.LogOut)); ((Button)LastControl).GumpOverID = 0x07db; // QUESTS AddControl(new Button(this, 185, 44 + 27 * 3, 0x57b5, 0x57b7, ButtonTypes.Activate, 0, (int)Buttons.Quests)); ((Button)LastControl).GumpOverID = 0x57b6; // SKILLS AddControl(new Button(this, 185, 44 + 27 * 4, 0x07df, 0x07e0, ButtonTypes.Activate, 0, (int)Buttons.Skills)); ((Button)LastControl).GumpOverID = 0x07e1; // GUILD AddControl(new Button(this, 185, 44 + 27 * 5, 0x57b2, 0x57b4, ButtonTypes.Activate, 0, (int)Buttons.Guild)); ((Button)LastControl).GumpOverID = 0x57b3; // PEACE / WAR m_IsWarMode = Mobile.Flags.IsWarMode; int[] btngumps = m_IsWarMode ? WarModeBtnGumps : PeaceModeBtnGumps; m_WarModeBtn = (Button)AddControl(new Button(this, 185, 44 + 27 * 6, btngumps[0], btngumps[1], ButtonTypes.Activate, 0, (int)Buttons.PeaceWarToggle)); ((Button)LastControl).GumpOverID = btngumps[2]; // STATUS AddControl(new Button(this, 185, 44 + 27 * 7, 0x07eb, 0x07ec, ButtonTypes.Activate, 0, (int)Buttons.Status)); ((Button)LastControl).GumpOverID = 0x07ed; // Virtue menu AddControl(m_VirtueMenuButton = new GumpPic(this, 80, 8, 0x0071, 0)); m_VirtueMenuButton.MouseDoubleClickEvent += VirtueMenu_MouseDoubleClickEvent; // Special moves book // AddControl(new GumpPic(this, 158, 200, 0x2B34, 0)); // LastControl.MouseDoubleClickEvent += SpecialMoves_MouseDoubleClickEvent; // equipment slots for hat/earrings/neck/ring/bracelet AddControl(new EquipmentSlot(this, 2, 76, Mobile, EquipLayer.Helm)); AddControl(new EquipmentSlot(this, 2, 76 + 22 * 1, Mobile, EquipLayer.Earrings)); AddControl(new EquipmentSlot(this, 2, 76 + 22 * 2, Mobile, EquipLayer.Neck)); AddControl(new EquipmentSlot(this, 2, 76 + 22 * 3, Mobile, EquipLayer.Ring)); AddControl(new EquipmentSlot(this, 2, 76 + 22 * 4, Mobile, EquipLayer.Bracelet)); // Paperdoll control! AddControl(new PaperDollInteractable(this, 8, 21, Mobile)); } else { AddControl(new GumpPic(this, 0, 0, 0x07d1, 0)); // Paperdoll AddControl(new PaperDollInteractable(this, 8, 21, Mobile)); } // name and title AddControl(new HtmlGumpling(this, 36, 262, 180, 42, 0, 0, string.Format("<span color=#aaa style='font-family:uni0;'>{0}", Mobile.Name))); AddControl(new HtmlGumpling(this, 35, 262, 180, 42, 0, 0, string.Format("<span color=#222 style='font-family:uni0;'>{0}", Mobile.Name))); }
private void CreateMageryGumplings() { ClearControls(); AddControl(new GumpPic(this, 0, 0, 0x08AC, 0)); // spellbook background m_PageCornerLeft = (GumpPic)AddControl(new GumpPic(this, 50, 8, 0x08BB, 0)); // page turn left LastControl.GumpLocalID = 0; LastControl.MouseClickEvent += PageCorner_MouseClickEvent; LastControl.MouseDoubleClickEvent += PageCorner_MouseDoubleClickEvent; m_PageCornerRight = (GumpPic)AddControl(new GumpPic(this, 321, 8, 0x08BC, 0)); // page turn right LastControl.GumpLocalID = 1; LastControl.MouseClickEvent += PageCorner_MouseClickEvent; LastControl.MouseDoubleClickEvent += PageCorner_MouseDoubleClickEvent; for (int i = 0; i < 4; i++) // spell circles 1 - 4 { AddControl(new GumpPic(this, 60 + i * 35, 174, 0x08B1 + i, 0)); LastControl.GumpLocalID = i; LastControl.MouseClickEvent += SpellCircle_MouseClickEvent; } for (int i = 0; i < 4; i++) // spell circles 5 - 8 { AddControl(new GumpPic(this, 226 + i * 34, 174, 0x08B5 + i, 0)); LastControl.GumpLocalID = i + 4; LastControl.MouseClickEvent += SpellCircle_MouseClickEvent; } // indexes are on pages 1 - 4. Spells are on pages 5+. m_CircleHeaders = new HtmlGumpling[8]; for (int i = 0; i < 8; i++) { m_CircleHeaders[i] = (HtmlGumpling)AddControl( new HtmlGumpling(this, 64 + (i % 2) * 148, 10, 130, 200, 0, 0, string.Format("<span color='#004' style='font-family=uni0;'><center>{0}</center></span>", Magery.CircleNames[i])), 1 + (i / 2)); } m_Indexes = new HtmlGumpling[8]; for (int i = 0; i < 8; i++) { m_Indexes[i] = (HtmlGumpling)AddControl( new HtmlGumpling(this, 64 + (i % 2) * 156, 28, 130, 200, 0, 0, string.Empty), 1 + (i / 2)); } // add indexes and spell pages. m_MaxPage = 4; int currentSpellPage = 5; bool isRightPage = false; for (int spellCircle = 0; spellCircle < 8; spellCircle++) { for (int spellIndex = 0; spellIndex < 8; spellIndex++) { int spellIndexAll = spellCircle * 8 + spellIndex; if (m_Spellbook.HasSpell(spellIndexAll)) { m_Indexes[spellCircle].Text += string.Format("<a href='page={1}' color='#532' hovercolor='#800' activecolor='#611' style='font-family=uni0; text-decoration=none;'>{0}</a><br/>", Magery.Spells[spellIndexAll].Name, currentSpellPage); CreateSpellPage(currentSpellPage, isRightPage, spellCircle, Magery.Spells[spellIndexAll]); if (isRightPage) { currentSpellPage++; isRightPage = false; } else { m_MaxPage += 1; isRightPage = true; } } } } SetActivePage(1); }
public override void Update(double totalMS, double frameMS) { if (m_ExpandableScrollHeight < c_ExpandableScrollHeight_Min) m_ExpandableScrollHeight = c_ExpandableScrollHeight_Min; if (m_ExpandableScrollHeight > c_ExpandableScrollHeight_Max) m_ExpandableScrollHeight = c_ExpandableScrollHeight_Max; if (m_gumplingTitleGumpIDDelta) { m_gumplingTitleGumpIDDelta = false; if (m_gumplingTitle != null) m_gumplingTitle.Dispose(); m_gumplingTitle = (GumpPic)AddControl(new GumpPic(this, 0, 0, m_gumplingTitleGumpID, 0)); } if (!m_GumplingTop.IsInitialized) { IsVisible = false; } else { IsVisible = true; m_GumplingTop.Position = new Point(0, 0); m_GumplingMiddle.Position = new Point(17, m_GumplingMidY); m_GumplingMiddle.Width = 263; m_GumplingMiddle.Height = m_GumplingMidHeight; m_GumplingBottom.Position = new Point(17, m_GumplingBottomY); if (m_IsResizable) m_GumplingExpander.Position = new Point(m_GumplingExpanderX, m_GumplingExpanderY); if (m_gumplingTitle != null && m_gumplingTitle.IsInitialized) { m_gumplingTitle.Position = new Point( (m_GumplingTop.Width - m_gumplingTitle.Width) / 2, (m_GumplingTop.Height - m_gumplingTitle.Height) / 2); } } base.Update(totalMS, frameMS); }