Пример #1
0
        public DebugGump(int x, int y) : base(0, 0)
        {
            CanMove                = true;
            CanCloseWithEsc        = false;
            CanCloseWithRightClick = true;
            AcceptMouseInput       = true;
            AcceptKeyboardInput    = false;

            Width  = 100;
            Height = 50;
            X      = _last_position.X <= 0 ? x : _last_position.X;
            Y      = _last_position.Y <= 0 ? y : _last_position.Y;

            Add
            (
                _trans = new AlphaBlendControl(.3f)
            {
                Width = Width, Height = Height
            }
            );

            ControlInfo.Layer = UILayer.Over;

            WantUpdateSize = true;
        }
Пример #2
0
        private void BuildGump()
        {
            CanMove                = true;
            AcceptMouseInput       = true;
            AcceptKeyboardInput    = false;
            CanCloseWithRightClick = false;
            WantUpdateSize         = false;

            Width  = _rectSize * _columns + 1;
            Height = _rectSize + 1;

            Add(_background = new AlphaBlendControl(0.3f)
            {
                Width = Width, Height = Height + 20, Y = -20
            });


            for (int col = 0; col < _columns; col++)
            {
                Add(new Label((col + 1).ToString(), false, 0x034E, _rectSize, 2, FontStyle.BlackBorder, TEXT_ALIGN_TYPE.TS_CENTER)
                {
                    X = col * _rectSize,
                    Y = -20,
                });
                Add(new CounterItem(col * _rectSize + 2, 2, _rectSize - 4, _rectSize - 4, col));
            }
        }
Пример #3
0
        public MacroGump(string name) : base(0, 0)
        {
            CanMove = true;
            CanCloseWithRightClick = true;

            AlphaBlendControl macroGumpBackground = new AlphaBlendControl
            {
                Width  = 260,
                Height = 200,
                X      = ProfileManager.CurrentProfile.GameWindowSize.X / 2 - 125,
                Y      = 150,
                Alpha  = 0.8f
            };

            Label text = new Label($"Edit macro: {name}", true, 15)
            {
                X = ProfileManager.CurrentProfile.GameWindowSize.X / 2 - 105,
                Y = macroGumpBackground.Y + 2
            };

            Add(macroGumpBackground);
            Add(text);

            Add
            (
                new MacroControl(name, true)
            {
                X = macroGumpBackground.X + 20,
                Y = macroGumpBackground.Y + 20,
            }
            );

            SetInScreen();
        }
Пример #4
0
        public DebugGump() : base(0, 0)
        {
            CanMove                = true;
            CanCloseWithEsc        = false;
            CanCloseWithRightClick = true;
            AcceptMouseInput       = true;
            AcceptKeyboardInput    = false;

            _fullDisplayMode = !ProfileManager.Current.DebugGumpIsMinimized;

            Width  = 500;
            Height = 275;

            Add(_trans = new AlphaBlendControl(.3f)
            {
                Width = Width, Height = Height
            });

            Add(_label = new Label("", true, 0x35, font: 1, style: FontStyle.BlackBorder)
            {
                X = 10, Y = 10
            });

            ControlInfo.Layer = UILayer.Over;

            WantUpdateSize = false;
        }
Пример #5
0
        public NetworkStatsGump(int x, int y) : base(0, 0)
        {
            CanMove                = true;
            CanCloseWithEsc        = false;
            CanCloseWithRightClick = true;
            AcceptMouseInput       = true;
            AcceptKeyboardInput    = false;

            _ping = _deltaBytesReceived = _deltaBytesSent = 0;

            X      = _last_position.X <= 0 ? x : _last_position.X;
            Y      = _last_position.Y <= 0 ? y : _last_position.Y;
            Width  = 100;
            Height = 30;

            Add
            (
                _trans = new AlphaBlendControl(.3f)
            {
                Width  = Width,
                Height = Height
            }
            );


            LayerOrder = UILayer.Over;

            WantUpdateSize = false;
        }
Пример #6
0
        private void BuildGump()
        {
            _background = new AlphaBlendControl()
            {
                Alpha = 0.6f
            };

            _text = new Label($"{Timer}", true, 0x35, 0, 1, FontStyle.BlackBorder)
            {
                X = _borderSize + _iconSize + _spaceSize + 3,
                Y = _borderSize - 2
            };

            _icon = new TextureControl()
            {
                AcceptMouseInput = false
            };

            _icon.Texture = ArtLoader.Instance.GetTexture(0x0E21);
            _icon.Hue     = 0;
            _icon.X       = _borderSize;
            _icon.Y       = _borderSize - 1; // slight offset due to imgs offset
            _icon.Width   = _iconSize;
            _icon.Height  = _iconSize;

            Add(_background);
            Add(_text);
            Add(_icon);
        }
Пример #7
0
        public NameOverheadGump(Entity entity) : base(entity.Serial, 0)
        {
            CanMove                = false;
            AcceptMouseInput       = true;
            CanCloseWithRightClick = true;
            Entity = entity;

            Hue hue = entity is Mobile m?Notoriety.GetHue(m.NotorietyFlag) : (Hue)0x0481;

            _renderedText = new RenderedText()
            {
                IsUnicode = true,
                Font      = 0xFF,
                Hue       = hue,
                FontStyle = FontStyle.BlackBorder,
                Align     = TEXT_ALIGN_TYPE.TS_CENTER,
                IsHTML    = true,
            };


            Add(_background = new AlphaBlendControl(.3f)
            {
                WantUpdateSize = false,
            });
        }
Пример #8
0
        public SystemChatControl(int x, int y, int w, int h)
        {
            X                      = x;
            Y                      = y;
            Width                  = w;
            Height                 = h;
            _textEntries           = new Deque <ChatLineTime>();
            CanCloseWithRightClick = false;
            AcceptMouseInput       = false;
            AcceptKeyboardInput    = false;

            TextBoxControl = new StbTextBox
                             (
                ProfileManager.CurrentProfile.ChatFont, MAX_MESSAGE_LENGHT, Width, true,
                FontStyle.BlackBorder | FontStyle.Fixed, 33
                             )
            {
                X      = CHAT_X_OFFSET,
                Y      = Height - CHAT_HEIGHT,
                Width  = Width - CHAT_X_OFFSET,
                Height = CHAT_HEIGHT
            };

            float gradientTransparency =
                ProfileManager.CurrentProfile != null && ProfileManager.CurrentProfile.HideChatGradient ? 1.0f : 0.5f;

            Add
            (
                _trans = new AlphaBlendControl(gradientTransparency)
            {
                X                = TextBoxControl.X,
                Y                = TextBoxControl.Y,
                Width            = Width,
                Height           = CHAT_HEIGHT + 5,
                IsVisible        = !ProfileManager.CurrentProfile.ActivateChatAfterEnter,
                AcceptMouseInput = true
            }
            );

            Add(TextBoxControl);

            Add
            (
                _currentChatModeLabel = new Label(string.Empty, true, 0, style: FontStyle.BlackBorder)
            {
                X         = TextBoxControl.X,
                Y         = TextBoxControl.Y,
                IsVisible = false
            }
            );

            WantUpdateSize = false;

            MessageManager.MessageReceived += ChatOnMessageReceived;
            Mode = ChatMode.Default;

            IsActive = !ProfileManager.CurrentProfile.ActivateChatAfterEnter;

            SetFocus();
        }
Пример #9
0
        public CounterBarGump() : base(0, 0)
        {
            CanMove             = false;
            AcceptMouseInput    = true;
            AcceptKeyboardInput = false;

            CanCloseWithRightClick = false;

            X      = 0;
            Y      = 0;
            Width  = 200;
            Height = 34;

            WantUpdateSize = false;

            Add(_background = new AlphaBlendControl()
            {
                Width = Width, Height = Height
            });

            //int x = 0;
            //for (int i = 0; i < 50; i++)
            //{
            //    Add(new CounterItem() { X = x });

            //    x += 20 + 10;
            //}
        }
Пример #10
0
        private void BuildGump()
        {
            CanMove                = true;
            AcceptMouseInput       = true;
            AcceptKeyboardInput    = false;
            CanCloseWithRightClick = false;
            WantUpdateSize         = false;
            CanBeSaved             = true;

            Width  = _rectSize * _columns + 1;
            Height = _rectSize * _rows + 1;

            Add(_background = new AlphaBlendControl(0.3f)
            {
                Width = Width, Height = Height
            });

            for (int row = 0; row < _rows; row++)
            {
                for (int col = 0; col < _columns; col++)
                {
                    Add(new CounterItem(col * _rectSize + 2, row * _rectSize + 2, _rectSize - 4, _rectSize - 4));
                }
            }
        }
Пример #11
0
        public LootListGump() : base(0, 0)
        {
            if (ProfileManager.Current.LootList == null)
            {
                ProfileManager.Current.LootList = new List <ushort[]>();
            }
            _items = ProfileManager.Current.LootList;

            //if (_items == null)
            //{
            //    Dispose();

            //    return;
            //}

            X = _lastX;
            Y = _lastY;

            CanMove          = true;
            AcceptMouseInput = true;

            _background        = new AlphaBlendControl();
            _background.Width  = 120 * ProfileManager.Current.CorpseScale;
            _background.Height = 160 * ProfileManager.Current.CorpseScale;
            Add(_background);

            Width  = _background.Width;
            Height = _background.Height;

            NiceButton setLootBag = new NiceButton(3, Height - 23, 50 * ProfileManager.Current.CorpseScale, 10 * ProfileManager.Current.CorpseScale, ButtonAction.Activate, LanguageManager.Current.UI_Add)
            {
                ButtonParameter = 2, IsSelectable = false
            };

            Add(setLootBag);

            _buttonPrev = new NiceButton(Width - 50, Height - 20, 20, 20, ButtonAction.Activate, "<<")
            {
                ButtonParameter = 0, IsSelectable = false
            };
            _buttonNext = new NiceButton(Width - 20, Height - 20, 20, 20, ButtonAction.Activate, ">>")
            {
                ButtonParameter = 1, IsSelectable = false
            };

            _buttonNext.IsEnabled = _buttonPrev.IsEnabled = false;
            _buttonNext.IsVisible = _buttonPrev.IsVisible = false;


            Add(_buttonPrev);
            Add(_buttonNext);
            if (_items != null)
            {
                RedrawItems();
            }
        }
Пример #12
0
        public LootingGump(Item item) : base(0, 0)
        {
            CanMove          = false;
            AcceptMouseInput = false;
            string name;

            if (item != null)
            {
                name = item.Name;
            }
            else
            {
                name = string.Empty;
            }

            ControlInfo.Layer = UILayer.Over;

            if (name == string.Empty)
            {
                _name     = string.Empty;
                IsVisible = false;
            }
            else
            {
                if (item.IsCorpse)
                {
                    _name = LanguageManager.Current.UI_TryOpen + name;
                }
                else
                {
                    _name = LanguageManager.Current.UI_Looting + name;
                }
                IsVisible = true;
            }

            Add(alpha = new AlphaBlendControl(0.3f)
            {
                Hue = 34
            });
            _renderedText = new Label(_name, true, 0xFFFF, font: 1, style: FontStyle.BlackBorder)
            {
                X = 2
            };


            alpha.Width  = _renderedText.Width + 5;
            alpha.Height = _renderedText.Height + 5;

            Width  = alpha.Width;
            Height = alpha.Height;
            Add(_renderedText);
            X = ProfileManager.Current.GameWindowSize.X / 2 - Width / 2;
            Y = ProfileManager.Current.GameWindowSize.Y / 2 + 20;
        }
Пример #13
0
        public PartyInviteGump(uint inviter) : base(0, 0)
        {
            CanCloseWithRightClick = true;

            AlphaBlendControl partyGumpBackground = new AlphaBlendControl
            {
                Width  = 250,
                Height = 80,
                X      = ProfileManager.Current.GameWindowSize.X / 2 - 125,
                Y      = 150,
                Alpha  = 0.2f
            };

            Mobile mobile = World.Mobiles.Get(inviter);

            Label text = new Label(string.Format(ResGumps.P0HasInvitedYouToParty, mobile == null || string.IsNullOrEmpty(mobile.Name) ? ResGumps.NoName : mobile.Name), true, 15)
            {
                X = ProfileManager.Current.GameWindowSize.X / 2 - 115,
                Y = 165
            };

            NiceButton acceptButton  = new NiceButton(ProfileManager.Current.GameWindowSize.X / 2 + 70, 205, 45, 25, ButtonAction.Activate, ResGumps.Accept);
            NiceButton declineButton = new NiceButton(ProfileManager.Current.GameWindowSize.X / 2 + 10, 205, 45, 25, ButtonAction.Activate, ResGumps.Decline);

            Add(partyGumpBackground);
            Add(text);
            Add(acceptButton);
            Add(declineButton);

            acceptButton.MouseUp += (sender, e) =>
            {
                if (World.Party.Inviter != 0 && World.Party.Leader == 0)
                {
                    GameActions.RequestPartyAccept(World.Party.Inviter);
                    World.Party.Leader  = World.Party.Inviter;
                    World.Party.Inviter = 0;
                }

                base.Dispose();
            };

            declineButton.MouseUp += (sender, e) =>
            {
                if (World.Party.Inviter != 0 && World.Party.Leader == 0)
                {
                    NetClient.Socket.Send(new PPartyDecline(World.Party.Inviter));
                    World.Party.Inviter = 0;
                }

                base.Dispose();
            };
        }
Пример #14
0
            public LootListItem(ushort[] item, int size)
            {
                if (item == null)
                {
                    Dispose();

                    return;
                }

                int SIZE = size;

                CanMove = false;


                AlphaBlendControl background = new AlphaBlendControl();

                background.Y      = 15;
                background.Width  = SIZE;
                background.Height = SIZE;
                Add(background);

                _texture = new TextureControl
                {
                    IsPartial    = false,
                    ScaleTexture = true,
                    Hue          = item[1],
                    Texture      = ArtLoader.Instance.GetTexture(item[0]),
                    Y            = 15,
                    Width        = SIZE,
                    Height       = SIZE,
                    CanMove      = false
                };

                Add(_texture);


                _texture.MouseUp += (sender, e) =>
                {
                    if (e.Button == MouseButtonType.Left)
                    {
                        ProfileManager.Current.LootList.Remove(item);
                        UIManager.GetGump <LootListGump>()?.Dispose();
                        UIManager.Add(new LootListGump());
                    }
                };

                Width  = background.Width;
                Height = background.Height + 15;

                WantUpdateSize = false;
            }
Пример #15
0
        public GridLootGump(Serial local) : base(local, 0)
        {
            _corpse = World.Items.Get(local);

            if (_corpse == null)
            {
                Dispose();

                return;
            }

            X = _lastX;
            Y = _lastY;

            CanMove          = true;
            AcceptMouseInput = true;

            _background        = new AlphaBlendControl();
            _background.Width  = 300 - 10;
            _background.Height = 400;
            Add(_background);

            Width  = _background.Width;
            Height = _background.Height;

            NiceButton setLootBag = new NiceButton(3, Height - 23, 100, 20, ButtonAction.Activate, "Set loot bag")
            {
                ButtonParameter = 2, IsSelectable = false
            };

            Add(setLootBag);

            _buttonPrev = new NiceButton(Width - 50, Height - 20, 20, 20, ButtonAction.Activate, "<<")
            {
                ButtonParameter = 0, IsSelectable = false
            };
            _buttonNext = new NiceButton(Width - 20, Height - 20, 20, 20, ButtonAction.Activate, ">>")
            {
                ButtonParameter = 1, IsSelectable = false
            };

            _buttonNext.IsEnabled = _buttonPrev.IsEnabled = false;
            _buttonNext.IsVisible = _buttonPrev.IsVisible = false;


            Add(_buttonPrev);
            Add(_buttonNext);

            RedrawItems();
        }
Пример #16
0
        public SystemChatControl(int x, int y, int w, int h)
        {
            X                      = x;
            Y                      = y;
            Width                  = w;
            Height                 = h;
            _textEntries           = new Deque <ChatLineTime>();
            CanCloseWithRightClick = false;
            AcceptMouseInput       = false;
            AcceptKeyboardInput    = false;

            int height = FontsLoader.Instance.GetHeightUnicode(ProfileManager.Current.ChatFont, "123ABC", Width, 0, (ushort)(FontStyle.BlackBorder | FontStyle.Fixed));

            TextBoxControl = new StbTextBox(ProfileManager.Current.ChatFont, MAX_MESSAGE_LENGHT, Width, true, FontStyle.BlackBorder | FontStyle.Fixed, 33)
            {
                X      = 0,
                Y      = Height - height,
                Width  = Width,
                Height = height
            };

            float gradientTransparency = (ProfileManager.Current != null && ProfileManager.Current.HideChatGradient) ? 1.0f : 0.5f;

            Add(_trans = new AlphaBlendControl(gradientTransparency)
            {
                X                = TextBoxControl.X,
                Y                = TextBoxControl.Y,
                Width            = Width,
                Height           = height + 5,
                IsVisible        = !ProfileManager.Current.ActivateChatAfterEnter,
                AcceptMouseInput = true
            });
            Add(TextBoxControl);

            Add(_currentChatModeLabel = new Label(string.Empty, true, 0, style: FontStyle.BlackBorder)
            {
                X         = TextBoxControl.X,
                Y         = TextBoxControl.Y,
                IsVisible = false
            });

            WantUpdateSize = false;

            MessageManager.MessageReceived += ChatOnMessageReceived;
            Mode = ChatMode.Default;

            IsActive = !ProfileManager.Current.ActivateChatAfterEnter;

            SetFocus();
        }
Пример #17
0
        public PartyInviteGump(uint inviter) : base(0, 0)
        {
            CanCloseWithRightClick = true;
            var partyGumpBackground = new AlphaBlendControl()
            {
                Width  = 250,
                Height = 80,
                X      = (ProfileManager.Current.GameWindowSize.X / 2) - 125,
                Y      = 150,
                Alpha  = 0.2f
            };

            Mobile mobile = World.Mobiles.Get(inviter);

            var text = new Label($"{ (mobile == null || string.IsNullOrEmpty(mobile.Name) ? "[no-name]" : mobile.Name) }\n has invited you to join a party.", true, 15)
            {
                X = (ProfileManager.Current.GameWindowSize.X / 2) - 115,
                Y = 165,
            };

            var acceptButton  = new NiceButton(((ProfileManager.Current.GameWindowSize.X / 2) + 70), 205, 45, 25, ButtonAction.Activate, "Accept");
            var declineButton = new NiceButton(((ProfileManager.Current.GameWindowSize.X / 2) + 10), 205, 45, 25, ButtonAction.Activate, "Decline");

            Add(partyGumpBackground);
            Add(text);
            Add(acceptButton);
            Add(declineButton);

            acceptButton.MouseUp += (sender, e) =>
            {
                if (World.Party.Inviter != 0 && World.Party.Leader == 0)
                {
                    GameActions.RequestPartyAccept(World.Party.Inviter);
                    World.Party.Leader  = World.Party.Inviter;
                    World.Party.Inviter = 0;
                }
                base.Dispose();
            };

            declineButton.MouseUp += (sender, e) =>
            {
                if (World.Party.Inviter != 0 && World.Party.Leader == 0)
                {
                    NetClient.Socket.Send(new PPartyDecline(World.Party.Inviter));
                    World.Party.Inviter = 0;
                }
                base.Dispose();
            };
        }
Пример #18
0
        public InfoBarGump() : base(0, 0)
        {
            CanMove                = true;
            AcceptMouseInput       = true;
            AcceptKeyboardInput    = false;
            CanCloseWithRightClick = false;
            Height = 20;

            Add(_background = new AlphaBlendControl(0.3f)
            {
                Width = Width, Height = Height
            });

            ResetItems();
        }
Пример #19
0
        private void BuildGump()
        {
            Entity entity = World.Get(LocalSerial);

            if (entity == null)
            {
                Dispose();
                return;
            }

            Add(_background = new AlphaBlendControl(.3f)
            {
                WantUpdateSize = false,
                Hue            = entity is Mobile m ? Notoriety.GetHue(m.NotorietyFlag) : (ushort)0x0481
            });
Пример #20
0
        public SystemChatControl(int x, int y, int w, int h)
        {
            X                      = x;
            Y                      = y;
            Width                  = w;
            Height                 = h;
            _textEntries           = new Deque <ChatLineTime>();
            _messageHistory        = new List <Tuple <ChatMode, string> >();
            CanCloseWithRightClick = false;
            AcceptMouseInput       = false;
            AcceptKeyboardInput    = false;

            int height = FileManager.Fonts.GetHeightUnicode(Engine.Profile.Current.ChatFont, "123ABC", Width, 0, (ushort)(FontStyle.BlackBorder | FontStyle.Fixed));

            textBox = new TextBox(Engine.Profile.Current.ChatFont, MAX_MESSAGE_LENGHT, Width, Width, true, FontStyle.BlackBorder | FontStyle.Fixed, 33)
            {
                X      = 0,
                Y      = Height - height - 3,
                Width  = Width,
                Height = height - 3
            };

            Add(_trans = new AlphaBlendControl
            {
                X                = textBox.X,
                Y                = textBox.Y,
                Width            = Width,
                Height           = height + 5,
                IsVisible        = !Engine.Profile.Current.ActivateChatAfterEnter,
                AcceptMouseInput = true
            });
            Add(textBox);

            Add(_currentChatModeLabel = new Label(string.Empty, true, 0, style: FontStyle.BlackBorder)
            {
                X         = textBox.X,
                Y         = textBox.Y,
                IsVisible = false
            });

            WantUpdateSize = false;

            Chat.MessageReceived += ChatOnMessageReceived;
            Mode = ChatMode.Default;

            IsActive = !Engine.Profile.Current.ActivateChatAfterEnter;
        }
Пример #21
0
        public NameOverheadGump(Entity entity) : base(entity.Serial, 0)
        {
            CanMove                = false;
            AcceptMouseInput       = true;
            CanCloseWithRightClick = true;
            Entity = entity;

            Hue hue = entity is Mobile m?Notoriety.GetHue(m.NotorietyFlag) : (Hue)0x0481;

            _renderedText = RenderedText.Create(String.Empty, hue, 0xFF, true, FontStyle.BlackBorder, TEXT_ALIGN_TYPE.TS_CENTER, 100, 30, true);

            Add(_background = new AlphaBlendControl(.3f)
            {
                WantUpdateSize = false,
                Hue            = hue
            });
        }
Пример #22
0
        public GridLootGump(Serial local) : base(local, 0)
        {
            _corpse = World.Items.Get(local);

            if (_corpse == null)
            {
                Dispose();

                return;
            }

            X = Engine.Profile.Current.GridLootType == 2 ? 200 : 100;
            Y = 100;

            CanMove          = true;
            AcceptMouseInput = true;

            _background        = new AlphaBlendControl();
            _background.Width  = 300 - 10;
            _background.Height = 400;
            Add(_background);

            Width  = _background.Width;
            Height = _background.Height;


            _buttonPrev = new NiceButton(Width - 50, Height - 20, 20, 20, ButtonAction.Activate, "<<")
            {
                ButtonParameter = 0, IsSelectable = false
            };
            _buttonNext = new NiceButton(Width - 20, Height - 20, 20, 20, ButtonAction.Activate, ">>")
            {
                ButtonParameter = 1, IsSelectable = false
            };

            _buttonNext.IsEnabled = _buttonPrev.IsEnabled = false;
            _buttonNext.IsVisible = _buttonPrev.IsVisible = false;


            Add(_buttonPrev);
            Add(_buttonNext);

            RedrawItems();
        }
Пример #23
0
        public NameOverheadGump(Entity entity) : base(entity.Serial, 0)
        {
            CanMove                = false;
            AcceptMouseInput       = true;
            CanCloseWithRightClick = true;
            Entity = entity;

            Hue hue = entity is Mobile m?Notoriety.GetHue(m.NotorietyFlag) : (Hue)999;

            //_label = new Label(string.IsNullOrEmpty(entity.Name) ? "" : entity.Name, true, hue, style: FontStyle.BlackBorder, align: TEXT_ALIGN_TYPE.TS_CENTER)
            //{
            //    X = 2,
            //    Y = 2,
            //};


            _renderedText = new RenderedText()
            {
                IsUnicode = true,
                Font      = 0xFF,
                Hue       = hue,
                FontStyle = FontStyle.BlackBorder,
                Align     = TEXT_ALIGN_TYPE.TS_CENTER,
                IsHTML    = true,
            };


            Add(_background = new AlphaBlendControl(.3f)
            {
                WantUpdateSize = false,
                //Width = _label.Width + 4,
                //Height = _label.Height + 4
            });
            // Add(_label);

            //X = (int) entity.RealScreenPosition.X;
            //Y = (int) entity.RealScreenPosition.Y;
        }
Пример #24
0
        public GridLootGump(uint local) : base(local, 0)
        {
            _corpse = World.Items.Get(local);

            if (_corpse == null)
            {
                Dispose();

                return;
            }

            if (World.Player.ManualOpenedCorpses.Contains(LocalSerial))
            {
                World.Player.ManualOpenedCorpses.Remove(LocalSerial);
            }
            else if (World.Player.AutoOpenedCorpses.Contains(LocalSerial) &&
                     ProfileManager.Current != null && ProfileManager.Current.SkipEmptyCorpse)
            {
                IsVisible    = false;
                _hideIfEmpty = true;
            }

            X = _lastX;
            Y = _lastY;

            CanMove                = true;
            AcceptMouseInput       = true;
            WantUpdateSize         = false;
            CanCloseWithRightClick = true;
            _background            = new AlphaBlendControl();
            _background.Width      = 300;
            _background.Height     = 400;
            Add(_background);

            Width  = _background.Width;
            Height = _background.Height;

            NiceButton setLootBag = new NiceButton(3, Height - 23, 100, 20, ButtonAction.Activate, "Set loot bag")
            {
                ButtonParameter = 2, IsSelectable = false
            };

            Add(setLootBag);

            _buttonPrev = new NiceButton(Width - 80, Height - 20, 40, 20, ButtonAction.Activate, "<<")
            {
                ButtonParameter = 0, IsSelectable = false
            };
            _buttonNext = new NiceButton(Width - 40, Height - 20, 40, 20, ButtonAction.Activate, ">>")
            {
                ButtonParameter = 1, IsSelectable = false
            };

            _buttonNext.IsVisible = _buttonPrev.IsVisible = false;


            Add(_buttonPrev);
            Add(_buttonNext);
            Add(_currentPageLabel = new Label("1", true, 999, align: IO.Resources.TEXT_ALIGN_TYPE.TS_CENTER)
            {
                X = Width / 2 - 5,
                Y = Height - 20,
            });

            _corpse.Items.Added   += Items_Added;
            _corpse.Items.Removed += Items_Removed;
        }
Пример #25
0
            public GridLootItem(uint serial)
            {
                LocalSerial = serial;

                Item item = World.Items.Get(serial);

                if (item == null)
                {
                    Dispose();

                    return;
                }

                const int SIZE = 50;

                CanMove = false;

                HSliderBar amount = new HSliderBar(0, 0, SIZE, 1, item.Amount, item.Amount, HSliderBarStyle.MetalWidgetRecessedBar, true, color: 0xFFFF, drawUp: true);

                Add(amount);

                amount.IsVisible = amount.IsEnabled = amount.MaxValue > 1;


                AlphaBlendControl background = new AlphaBlendControl();

                background.Y      = 15;
                background.Width  = SIZE;
                background.Height = SIZE;
                Add(background);


                _texture              = new TextureControl();
                _texture.IsPartial    = item.ItemData.IsPartialHue;
                _texture.ScaleTexture = true;
                _texture.Hue          = item.Hue;
                _texture.Texture      = ArtLoader.Instance.GetTexture(item.DisplayedGraphic);
                _texture.Y            = 15;
                _texture.Width        = SIZE;
                _texture.Height       = SIZE;
                _texture.CanMove      = false;

                if (World.ClientFeatures.TooltipsEnabled)
                {
                    _texture.SetTooltip(item);
                }

                Add(_texture);


                _texture.MouseUp += (sender, e) =>
                {
                    if (e.Button == MouseButtonType.Left)
                    {
                        GameActions.GrabItem(item, (ushort)amount.Value);
                    }
                };

                Width  = background.Width;
                Height = background.Height + 15;

                WantUpdateSize = false;
            }
Пример #26
0
        public PartyGumpAdvanced() : base(0, 0)
        {
            _partyListEntries = new List <PartyListEntry>();
            X                = 100;
            Y                = 100;
            CanMove          = true;
            AcceptMouseInput = true;
            WantUpdateSize   = false;

            Add(_alphaBlendControl = new AlphaBlendControl(0.05f)
            {
                X      = 1,
                Y      = 1,
                Width  = WIDTH - 2,
                Height = HEIGHT - 2
            });

            _scrollArea = new ScrollArea(20, 60, 295, 190, true)
            {
                AcceptMouseInput = true
            };
            Add(_scrollArea);

            Add(new Label("Bar", true, 1153)
            {
                X = 30, Y = 25
            });

            Add(new Label("Kick", true, 1153)
            {
                X = 60, Y = 25
            });

            Add(new Label("Player", true, 1153)
            {
                X = 100, Y = 25
            });

            Add(new Label("Status", true, 1153)
            {
                X = 250, Y = 25
            });

            //======================================================
            Add(_messagePartyButton = new Button((int)Buttons.Message, 0xFAB, 0xFAC, 0xFAD)
            {
                X = 30, Y = 275, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_messagePartyLabel = new Label("Message party", true, 1153)
            {
                X = 70, Y = 275, IsVisible = false
            });

            //======================================================
            Add(_lootMeButton = new Button((int)Buttons.Loot, 0xFA2, 0xFA3, 0xFA4)
            {
                X = 30, Y = 300, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_lootMeLabel = new Label("Party CANNOT loot me", true, 1153)
            {
                X = 70, Y = 300, IsVisible = false
            });

            //======================================================
            Add(_leaveButton = new Button((int)Buttons.Leave, 0xFAE, 0xFAF, 0xFB0)
            {
                X = 30, Y = 325, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_leaveLabel = new Label("Leave party", true, 1153)
            {
                X = 70, Y = 325, IsVisible = false
            });

            //======================================================
            Add(_createAddButton = new Button((int)Buttons.Add, 0xFA8, 0xFA9, 0xFAA)
            {
                X = 30, Y = 350, ButtonAction = ButtonAction.Activate
            });

            Add(_createAddLabel = new Label("Add party member", true, 1153)
            {
                X = 70, Y = 350
            });
            //======================================================

            Add(new Line(30, 50, 260, 1, Color.White.PackedValue));
            Add(new Line(95, 50, 1, 200, Color.White.PackedValue));
            Add(new Line(245, 50, 1, 200, Color.White.PackedValue));
            Add(new Line(30, 250, 260, 1, Color.White.PackedValue));

            Width  = WIDTH;
            Height = HEIGHT;

            Height = 320;
            _alphaBlendControl.Height = Height;
            //Set contents if player is NOT in party
            _createAddButton.Y            = 270;
            _createAddLabel.Y             = _createAddButton.Y;
            _createAddLabel.Text          = "Create a party";
            _leaveButton.IsVisible        = false;
            _leaveLabel.IsVisible         = false;
            _lootMeButton.IsVisible       = false;
            _lootMeLabel.IsVisible        = false;
            _messagePartyButton.IsVisible = false;
            _messagePartyLabel.IsVisible  = false;
        }
Пример #27
0
            public SellListItem(ushort[] item, int size, SellListGump list)
            {
                if (item == null)
                {
                    Dispose();

                    return;
                }

                int SIZE = size;

                CanMove = false;
                int total;

                if (item.Length < 3)
                {
                    total = (ProfileManager.Current.AutoBuyAmount * 2);
                }
                else
                {
                    total = item[2] * 2;
                }
                HSliderBar amount = new HSliderBar(0, 0, SIZE, 0, total, total / 2, HSliderBarStyle.MetalWidgetRecessedBar, true, color: 0xFFFF, drawUp: true);

                Add(amount);

                amount.IsVisible = list.IsBuyGump;

                AlphaBlendControl background = new AlphaBlendControl();

                background.Y      = 15;
                background.Width  = SIZE;
                background.Height = SIZE;
                Add(background);

                _texture = new TextureControl
                {
                    IsPartial    = false,
                    ScaleTexture = true,
                    Hue          = item[1],
                    Texture      = ArtLoader.Instance.GetTexture(item[0]),
                    Y            = 15,
                    Width        = SIZE,
                    Height       = SIZE,
                    CanMove      = false
                };

                Add(_texture);


                _texture.MouseUp += (sender, e) =>
                {
                    if (e.Button == MouseButtonType.Left)
                    {
                        if (list.IsBuyGump)
                        {
                            if (amount.Value == 0)
                            {
                                ProfileManager.Current.BuyList.Remove(item);
                            }
                            else
                            {
                                ProfileManager.Current.BuyList.Add(new ushort[3] {
                                    item[0], item[1], (ushort)amount.Value
                                });
                                ProfileManager.Current.BuyList.Remove(item);
                            }
                        }
                        else
                        {
                            ProfileManager.Current.SellList.Remove(item);
                        }
                        UIManager.GetGump <SellListGump>()?.Dispose();
                        UIManager.Add(new SellListGump(list.IsBuyGump));
                    }
                };

                Width  = background.Width;
                Height = background.Height + 15;

                WantUpdateSize = false;
            }
Пример #28
0
        public TargetMenuGump() : base(0, 0)
        {
            X                = _lastX;
            Y                = _lastY;
            CanMove          = true;
            AcceptMouseInput = true;
            Add(_background  = new AlphaBlendControl(0.3f)
            {
                Width = 180, Height = 500
            });
            Add(new Label(LanguageManager.Current.UI_TargetMenu, true, HUE_FONT, 160, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_CENTER)
            {
                X = 10,
                Y = 10
            });
            Add(new NiceButton(10, 50, 20, 20, ButtonAction.Activate, "1", 1)
            {
                ButtonParameter = (int)TargetButton.Target_1, IsSelected = (TargetManager.Target_1_name != null)
            });
            Add(new NiceButton(10, 90, 20, 20, ButtonAction.Activate, "2", 2)
            {
                ButtonParameter = (int)TargetButton.Target_2, IsSelected = (TargetManager.Target_2_name != null)
            });
            Add(new NiceButton(10, 130, 20, 20, ButtonAction.Activate, "3", 3)
            {
                ButtonParameter = (int)TargetButton.Target_3, IsSelected = (TargetManager.Target_3_name != null)
            });
            Add(new NiceButton(10, 170, 20, 20, ButtonAction.Activate, "4", 4)
            {
                ButtonParameter = (int)TargetButton.Target_4, IsSelected = (TargetManager.Target_4_name != null)
            });
            Add(new NiceButton(10, 210, 20, 20, ButtonAction.Activate, "5", 5)
            {
                ButtonParameter = (int)TargetButton.Target_5, IsSelected = (TargetManager.Target_5_name != null)
            });



            _name1 = new Label(TargetManager.Target_1_name, true, HUE_FONT, 80, FONT)
            {
                X = 90,
                Y = 50,
            };
            _name2 = new Label(TargetManager.Target_2_name, true, HUE_FONT, 80, FONT)
            {
                X = 90,
                Y = 90,
            };

            _name3 = new Label(TargetManager.Target_3_name, true, HUE_FONT, 80, FONT)
            {
                X = 90,
                Y = 130,
            };
            _name4 = new Label(TargetManager.Target_4_name, true, HUE_FONT, 80, FONT)
            {
                X = 90,
                Y = 170,
            };
            _name5 = new Label(TargetManager.Target_5_name, true, HUE_FONT, 80, FONT)
            {
                X = 90,
                Y = 210,
            };

            Add(_name1);
            Add(_name2);
            Add(_name3);
            Add(_name4);
            Add(_name5);
            Add(new Label("LastTarget:", true, 15, 70, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 10,
                Y = 250
            });
            _lastTarget = (new Label(TargetManager.LastTarget_name, true, HUE_FONT, 80, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 90,
                Y = 250
            });
            Add(new Label("LastHarmfulTarget:", true, HUE_TITLE, 70, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 10,
                Y = 290
            });
            _lastHarmfulTarget = (new Label(TargetManager.LastHarmfulTarget_name, true, HUE_FONT, 80, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 90,
                Y = 290
            });
            Add(new Label("LastBeneficialTarget:", true, 60, 70, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 10,
                Y = 330
            });
            _lastBeneficialTarget = (new Label(TargetManager.LastBeneficialTarget_name, true, HUE_FONT, 80, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 90,
                Y = 330
            });
            Add(new Label("SelectTarget:", true, 50, 70, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 10,
                Y = 370
            });
            _selectTarget = (new Label(TargetManager.SelectedTarget_name, true, HUE_FONT, 80, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 90,
                Y = 370
            });
            Add(_lastTarget);
            Add(_lastHarmfulTarget);
            Add(_lastBeneficialTarget);
            Add(_selectTarget);

            Add(new Label("LastGump:", true, 60, 70, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 10,
                Y = 410
            });
            _lastGump = new Label("", true, HUE_FONT, 80, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 90,
                Y = 410
            };
            Add(new Label("LastButton:", true, 60, 70, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 10,
                Y = 450
            }
                );
            _lastButton = new Label(LastButton.ToString(), true, HUE_FONT, 80, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            {
                X = 90,
                Y = 450
            };

            Add(_lastGump);
            Add(_lastButton);

            //Add(new NiceButton(10, 490, 20, 20, ButtonAction.Activate, "1", 6) { ButtonParameter = (int)TargetButton.Object_1, IsSelected = (TargetManager.Object_1 != 0) });
            //Add(new NiceButton(10, 530, 20, 20, ButtonAction.Activate, "2", 7) { ButtonParameter = (int)TargetButton.Object_2, IsSelected = (TargetManager.Object_2 != 0) });
            //Add(new NiceButton(10, 570, 20, 20, ButtonAction.Activate, "3", 8) { ButtonParameter = (int)TargetButton.Object_3, IsSelected = (TargetManager.Object_3 != 0) });
            //Add(new NiceButton(10, 610, 20, 20, ButtonAction.Activate, "4", 9) { ButtonParameter = (int)TargetButton.Object_4, IsSelected = (TargetManager.Object_4 != 0) });
            //Add(new NiceButton(10, 650, 20, 20, ButtonAction.Activate, "5", 10) { ButtonParameter = (int)TargetButton.Object_5, IsSelected = (TargetManager.Object_5 != 0) });

            //_obj1 = new Label("", true, HUE_FONT, 80, FONT)
            //{
            //    X = 90,
            //    Y = 490,
            //};
            //_obj2 = new Label("", true, HUE_FONT, 80, FONT)
            //{
            //    X = 90,
            //    Y = 530,
            //};

            //_obj3 = new Label("", true, HUE_FONT, 80, FONT)
            //{
            //    X = 90,
            //    Y = 570,
            //};
            //_obj4 = new Label("", true, HUE_FONT, 80, FONT)
            //{
            //    X = 90,
            //    Y = 610,
            //};
            //_obj5 = new Label("", true, HUE_FONT, 80, FONT)
            //{
            //    X = 90,
            //    Y = 650,
            //};
            //Add(_obj1);
            //Add(_obj2);
            //Add(_obj3);
            //Add(_obj4);
            //Add(_obj5);
            //Add(new Label("LastObject:", true, 60, 70, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            //{
            //    X = 10,
            //    Y = 690
            //});
            //_lastObjectGump = new Label("", true, HUE_FONT, 80, FONT, Renderer.FontStyle.BlackBorder, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT)
            //{
            //    X = 90,
            //    Y = 690
            //};
            //Add(_lastObjectGump);
        }
        public NameOverHeadHandlerGump() : base(0, 0)
        {
            CanMove                = true;
            AcceptMouseInput       = true;
            CanCloseWithRightClick = true;
            X = _lastX;
            Y = _lastY;
            WantUpdateSize = false;

            LayerOrder = UILayer.Over;

            RadioButton       all, mobiles, items, mobilesCorpses;
            AlphaBlendControl alpha;

            Add
            (
                alpha = new AlphaBlendControl(0.2f)
            {
                Hue = 34
            }
            );


            Add
            (
                all = new RadioButton
                      (
                    0,
                    0x00D0,
                    0x00D1,
                    ResGumps.All,
                    color: 0xFFFF
                      )
            {
                IsChecked = NameOverHeadManager.TypeAllowed == NameOverheadTypeAllowed.All
            }
            );

            Add
            (
                mobiles = new RadioButton
                          (
                    0,
                    0x00D0,
                    0x00D1,
                    ResGumps.MobilesOnly,
                    color: 0xFFFF
                          )
            {
                Y         = all.Y + all.Height,
                IsChecked = NameOverHeadManager.TypeAllowed == NameOverheadTypeAllowed.Mobiles
            }
            );

            Add
            (
                items = new RadioButton
                        (
                    0,
                    0x00D0,
                    0x00D1,
                    ResGumps.ItemsOnly,
                    color: 0xFFFF
                        )
            {
                Y         = mobiles.Y + mobiles.Height,
                IsChecked = NameOverHeadManager.TypeAllowed == NameOverheadTypeAllowed.Items
            }
            );

            Add
            (
                mobilesCorpses = new RadioButton
                                 (
                    0,
                    0x00D0,
                    0x00D1,
                    ResGumps.MobilesAndCorpsesOnly,
                    color: 0xFFFF
                                 )
            {
                Y         = items.Y + items.Height,
                IsChecked = NameOverHeadManager.TypeAllowed == NameOverheadTypeAllowed.MobilesCorpses
            }
            );

            alpha.Width  = Math.Max(mobilesCorpses.Width, Math.Max(items.Width, Math.Max(all.Width, mobiles.Width)));
            alpha.Height = all.Height + mobiles.Height + items.Height + mobilesCorpses.Height;

            Width  = alpha.Width;
            Height = alpha.Height;

            all.ValueChanged += (sender, e) =>
            {
                if (all.IsChecked)
                {
                    NameOverHeadManager.TypeAllowed = NameOverheadTypeAllowed.All;
                }
            };

            mobiles.ValueChanged += (sender, e) =>
            {
                if (mobiles.IsChecked)
                {
                    NameOverHeadManager.TypeAllowed = NameOverheadTypeAllowed.Mobiles;
                }
            };

            items.ValueChanged += (sender, e) =>
            {
                if (items.IsChecked)
                {
                    NameOverHeadManager.TypeAllowed = NameOverheadTypeAllowed.Items;
                }
            };

            mobilesCorpses.ValueChanged += (sender, e) =>
            {
                if (mobilesCorpses.IsChecked)
                {
                    NameOverHeadManager.TypeAllowed = NameOverheadTypeAllowed.MobilesCorpses;
                }
            };
        }
Пример #30
0
        public PartyGumpAdvanced() : base(0, 0)
        {
            _partyListEntries = new List <PartyListEntry>();
            _line             = new Texture2D(Engine.Batcher.GraphicsDevice, 1, 1);

            _line.SetData(new[]
            {
                Color.White
            });
            X                = 100;
            Y                = 100;
            CanMove          = true;
            AcceptMouseInput = true;
            WantUpdateSize   = false;

            Width  = WIDTH;
            Height = HEIGHT;

            Add(_alphaBlendControl = new AlphaBlendControl(0.05f)
            {
                X      = 1,
                Y      = 1,
                Width  = WIDTH - 2,
                Height = HEIGHT - 2
            });

            _scrollArea = new ScrollArea(20, 60, 295, 190, true)
            {
                AcceptMouseInput = true
            };
            Add(_scrollArea);

            Add(new Label("Bar", true, 1153)
            {
                X = 30, Y = 25
            });

            Add(new Label("Kick", true, 1153)
            {
                X = 60, Y = 25
            });

            Add(new Label("Player", true, 1153)
            {
                X = 100, Y = 25
            });

            Add(new Label("Status", true, 1153)
            {
                X = 250, Y = 25
            });

            //======================================================
            Add(_messagePartyButton = new Button((int)Buttons.Message, 0xFAB, 0xFAC, 0xFAD)
            {
                X = 30, Y = 275, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_messagePartyLabel = new Label("Message party", true, 1153)
            {
                X = 70, Y = 275, IsVisible = false
            });

            //======================================================
            Add(_lootMeButton = new Button((int)Buttons.Loot, 0xFA2, 0xFA3, 0xFA4)
            {
                X = 30, Y = 300, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_lootMeLabel = new Label("Party CANNOT loot me", true, 1153)
            {
                X = 70, Y = 300, IsVisible = false
            });

            //======================================================
            Add(_leaveButton = new Button((int)Buttons.Leave, 0xFAE, 0xFAF, 0xFB0)
            {
                X = 30, Y = 325, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_leaveLabel = new Label("Leave party", true, 1153)
            {
                X = 70, Y = 325, IsVisible = false
            });

            //======================================================
            Add(_createAddButton = new Button((int)Buttons.Add, 0xFA8, 0xFA9, 0xFAA)
            {
                X = 30, Y = 350, ButtonAction = ButtonAction.Activate
            });

            Add(_createAddLabel = new Label("Add party member", true, 1153)
            {
                X = 70, Y = 350
            });
            //======================================================
            World.Party.PartyMemberChanged += OnPartyMemberChanged;
        }