public UseSkillButtonGump(SkillEntry skill)
            : base(skill.ID, 0)
        {
            while (UserInterface.GetControl<UseSkillButtonGump>(skill.ID) != null)
            {
                UserInterface.GetControl<UseSkillButtonGump>(skill.ID).Dispose();
            }

            m_Skill = skill;
            m_World = ServiceRegistry.GetService<WorldModel>();

            IsMoveable = true;
            HandlesMouseInput = true;

            m_BG = new ResizePic[3];
            m_BG[0] = (ResizePic)AddControl(new ResizePic(this, 0, 0, 0x24B8, 120, 40));
            m_BG[1] = (ResizePic)AddControl(new ResizePic(this, 0, 0, 0x24EA, 120, 40));
            m_BG[2] = (ResizePic)AddControl(new ResizePic(this, 0, 0, 0x251C, 120, 40));
            m_Caption = (HtmlGumpling)AddControl(new HtmlGumpling(this, 0, 10, 120, 20, 0, 0, "<center>" + m_Skill.Name));

            for (int i = 0; i < 3; i++)
            {
                m_BG[i].MouseDownEvent += EventMouseDown;
                m_BG[i].MouseUpEvent += EventMouseUp;
                m_BG[i].MouseClickEvent += EventMouseClick;
            }
        }
Esempio n. 2
0
        public VendorBuyGump(AEntity vendorBackpack, VendorBuyListPacket packet)
            : base(0, 0)
        {
            // sanity checking: don't show buy gumps for empty containers.
            if (!(vendorBackpack is Container) || ((vendorBackpack as Container).Contents.Count <= 0) || (packet.Items.Count <= 0))
            {
                Dispose();
                return;
            }

            IsMoveable = true;
            // note: original gumplings start at index 0x0870.
            AddControl(m_Background = new ExpandableScroll(this, 0, 0, 360, false));
            AddControl(new HtmlGumpling(this, 0, 6, 300, 20, 0, 0, " <center><span color='#004' style='font-family:uni0;'>Shop Inventory"));

            m_ScrollBar = (IScrollBar)AddControl(new ScrollFlag(this));
            AddControl(m_ShopContents = new RenderedTextList(this, 22, 32, 250, 260, m_ScrollBar));
            BuildShopContents(vendorBackpack, packet);

            AddControl(m_TotalCost = new HtmlGumpling(this, 44, 334, 200, 30, 0, 0, string.Empty));
            UpdateCost();

            Button okButton = (Button)AddControl(new Button(this, 220, 333, 0x907, 0x908, ButtonTypes.Activate, 0, 0));
            okButton.GumpOverID = 0x909;
            okButton.MouseClickEvent += okButton_MouseClickEvent;
        }
Esempio n. 3
0
        public override void Update(double totalMS, double frameMS)
        {
            if (IsInitialized && m_text == null)
            {
                ResizePic resize;

                m_text = new HtmlGumpling(this, 10, 10, 200, 200, 0, 0, m_msg);
                int width = m_text.Width + 20;
                AddControl(resize = new ResizePic(this, 0, 0, 9200, width, m_text.Height + 45));
                AddControl(m_text);
                // Add buttons
                switch (m_type)
                {
                    case MsgBoxTypes.OkOnly:
                        AddControl(new Button(this, (m_text.Width + 20) / 2 - 23, m_text.Height + 15, 2074, 2075, ButtonTypes.Activate, 0, 0));
                        ((Button)LastControl).GumpOverID = 2076;
                        break;
                    case MsgBoxTypes.OkCancel:
                        AddControl(new Button(this, (width / 2) - 46 - 10, m_text.Height + 15, 0x817, 0x818, ButtonTypes.Activate, 0, 1));
                        ((Button)LastControl).GumpOverID = 0x819;
                        AddControl(new Button(this, (width / 2) + 10, m_text.Height + 15, 2074, 2075, ButtonTypes.Activate, 0, 0));
                        ((Button)LastControl).GumpOverID = 2076;
                        break;
                }
                
                base.Update(totalMS, frameMS);
                CenterThisControlOnScreen();
            }
            base.Update(totalMS, frameMS);
        }
Esempio n. 4
0
 public DebugGump()
     : base(0, 0)
 {
     m_World = Service.Get<WorldModel>();
     IsMoveable = true;
     AddControl(new ResizePic(this, 0, 0, 0x2436, 256 + 16, 256 + 16));
     AddControl(m_Debug = new HtmlGumpling(this, 0, 0, 256, 256, 0, 0, string.Empty));
 }
Esempio n. 5
0
        public SkillsGump()
            : base(0, 0)
        {
            IsMoveable = true;

            m_World = ServiceRegistry.GetService<WorldModel>();

            AddControl(m_Background = new ExpandableScroll(this, 0, 0, 200));
            m_Background.TitleGumpID = 0x834;

            AddControl(m_SkillsHtml = new HtmlGumpling(this, 32, 32, 240, 200 - 92, 0, 2, string.Empty));
        }
Esempio n. 6
0
        public SkillsGump()
            : base(0, 0)
        {
            IsMovable = true;

            m_World = ServiceRegistry.GetService<WorldModel>();

            AddControl(m_Background = new ExpandableScroll(this, 0, 0, 200));
            m_Background.TitleGumpID = 0x834;

            AddControl(m_SkillsHtml = new HtmlGumpling(this, 36, 35, 230, 200 - 100, 0, 2, string.Empty));
            m_SkillsHtml.OnDragHRef += OnSkillDrag;
        }
Esempio n. 7
0
        public ContextMenuGump(ContextMenuData data)
            : base(0, 0)
        {
            m_Data = data;

            IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
            AFont font = (AFont)provider.GetUnicodeFont(1);

            m_Background = (ResizePic)AddControl(new ResizePic(this, 0, 0, 0x0A3C, 50, font.Height * m_Data.Count + 20));

            StringBuilder htmlContextItems = new StringBuilder();
            for (int i = 0; i < m_Data.Count; i++)
            {
                htmlContextItems.Append(string.Format("<a href='{0}' color='#DDD' hovercolor='#FFF' activecolor='#BBB' style='text-decoration:none;'>{1}</a><br/>", m_Data[i].ResponseCode, m_Data[i].Caption));
            }
            m_MenuItems = (HtmlGumpling)AddControl(new HtmlGumpling(this, 10, 10, 200, font.Height * m_Data.Count, 0, 0, htmlContextItems.ToString()));
        }
Esempio n. 8
0
        public VendorSellGump(VendorSellListPacket packet)
            : base(0, 0)
        {
            IsMoveable = true;
            // note: original gumplings start at index 0x0870.
            AddControl(m_Background = new ExpandableScroll(this, 0, 0, 360, false));
            AddControl(new HtmlGumpling(this, 0, 6, 300, 20, 0, 0, " <center><span color='#004' style='font-family:uni0;'>My Inventory"));

            m_ScrollBar = (IScrollBar)AddControl(new ScrollFlag(this));
            AddControl(m_ShopContents = new RenderedTextList(this, 22, 32, 250, 260, m_ScrollBar));
            BuildShopContents(packet);

            AddControl(m_TotalCost = new HtmlGumpling(this, 44, 334, 200, 30, 0, 0, string.Empty));
            UpdateCost();

            Button okButton = (Button)AddControl(new Button(this, 220, 333, 0x907, 0x908, ButtonTypes.Activate, 0, 0));
            okButton.GumpOverID = 0x909;
            okButton.MouseClickEvent += okButton_MouseClickEvent;
        }
Esempio n. 9
0
 void UpdateLabel(bool isDisposing = false)
 {
     if (!isDisposing && Item.Overheads.Count > 0)
     {
         if (m_Label == null)
         {
             IInputService input = Service.Get <IInputService>();
             UserInterface.AddControl(m_Label = new HtmlGumpling(null, 0, 0, 200, 32, 0, 0,
                                                                 string.Format("<center><span style='font-family: ascii3;'>{0}</center>", Item.Overheads[0].Text)),
                                      input.MousePosition.X - 100, input.MousePosition.Y - 12);
             m_Label.MetaData.Layer = UILayer.Over;
         }
     }
     else if (m_Label != null)
     {
         {
             m_Label.Dispose();
             m_Label = null;
         }
     }
 }
Esempio n. 10
0
        public override void Update(double totalMS, double frameMS)
        {
            SpriteBatch3D sb = ServiceRegistry.GetService<SpriteBatch3D>();
            if (m_Background.Width != sb.GraphicsDevice.Viewport.Width || m_Background.Height != sb.GraphicsDevice.Viewport.Height)
            {
                m_Background.Width = sb.GraphicsDevice.Viewport.Width;
                m_Background.Height = sb.GraphicsDevice.Viewport.Height;
            }

            if (Characters.UpdateValue != m_charListUpdate)
            {
                int entryIndex = 0;
                m_characterNames = new HtmlGumpling[Characters.Length];
                foreach (CharacterListEntry e in Characters.List)
                {
                    if (e.Name != string.Empty)
                    {
                        m_characterNames[entryIndex] = new HtmlGumpling(this, 228, 154 + 40 * entryIndex, 272, 22, 0, 0, formatHTMLCharName(entryIndex, e.Name, (m_charSelected == entryIndex ? 431 : 1278)));
                        AddControl(new ResizePic(this, m_characterNames[entryIndex]), 1);
                        AddControl(m_characterNames[entryIndex], 1);
                    }
                    entryIndex++;
                }
                m_charListUpdate = Characters.UpdateValue;
            }

            InputManager input = ServiceRegistry.GetService<InputManager>();
            if (input.HandleKeyboardEvent(KeyboardEvent.Down, WinKeys.Enter, false, false, false))
            {
                if (m_characterNames.Length > 0)
                    OnLoginWithCharacter(0);
            }

            base.Update(totalMS, frameMS);
        }
Esempio n. 11
0
 void UpdateLabel(bool isDisposing = false)
 {
     if (!isDisposing && Item.Overheads.Count > 0)
     {
         if (m_Label == null)
         {
             IInputService input = Service.Get<IInputService>();
             UserInterface.AddControl(m_Label = new HtmlGumpling(null, 0, 0, 200, 32, 0, 0,
                 string.Format("<center><span style='font-family: ascii3;'>{0}</center>", Item.Overheads[0].Text)),
                 input.MousePosition.X - 100, input.MousePosition.Y - 12);
             m_Label.MetaData.Layer = UILayer.Over;
         }
     }
     else if (m_Label != null)
     {
         {
             m_Label.Dispose();
             m_Label = null;
         }
     }
 }
Esempio n. 12
0
 public override void Update(double totalMS, double frameMS)
 {
     if (Characters.UpdateValue != m_charListUpdate)
     {
         int entryIndex = 0;
         m_characterNames = new HtmlGumpling[Characters.Length];
         foreach (CharacterListEntry e in Characters.List)
         {
             if (e.Name != string.Empty)
             {
                 m_characterNames[entryIndex] = new HtmlGumpling(this, 228, 154 + 40 * entryIndex, 272, 22, 0, 0, formatHTMLCharName(entryIndex, e.Name, (m_charSelected == entryIndex ? 431 : 1278)));
                 AddControl(new ResizePic(this, m_characterNames[entryIndex]), 1);
                 AddControl(m_characterNames[entryIndex], 1);
             }
             entryIndex++;
         }
         m_charListUpdate = Characters.UpdateValue;
     }
     base.Update(totalMS, frameMS);
 }