コード例 #1
0
        public WorldViewportGump(GameScene scene) : base(0, 0)
        {
            _scene                 = scene;
            AcceptMouseInput       = false;
            CanMove                = !ProfileManager.Current.GameWindowLock;
            CanCloseWithEsc        = false;
            CanCloseWithRightClick = false;
            ControlInfo.Layer      = UILayer.Under;
            X            = ProfileManager.Current.GameWindowPosition.X;
            Y            = ProfileManager.Current.GameWindowPosition.Y;
            _worldWidth  = ProfileManager.Current.GameWindowSize.X;
            _worldHeight = ProfileManager.Current.GameWindowSize.Y;
            _savedSize   = _lastSize = ProfileManager.Current.GameWindowSize;

            _button = new Button(0, 0x837, 0x838, 0x838);

            _button.MouseDown += (sender, e) =>
            {
                if (!ProfileManager.Current.GameWindowLock)
                {
                    _clicked = true;
                }
            };

            _button.MouseUp += (sender, e) =>
            {
                if (!ProfileManager.Current.GameWindowLock)
                {
                    Point n = ResizeGameWindow(_lastSize);

                    UIManager.GetGump <OptionsGump>()
                    ?.UpdateVideo();

                    if (Client.Version >= ClientVersion.CV_200)
                    {
                        NetClient.Socket.Send(new PGameWindowSize((uint)n.X, (uint)n.Y));
                    }

                    _clicked = false;
                }
            };

            _button.SetTooltip(ResGumps.ResizeGameWindow);
            Width          = _worldWidth + BORDER_WIDTH * 2;
            Height         = _worldHeight + BORDER_WIDTH * 2;
            _borderControl = new BorderControl(0, 0, Width, Height, 4);

            _borderControl.DragEnd += (sender, e) =>
            {
                UIManager.GetGump <OptionsGump>()
                ?.UpdateVideo();
            };

            UIManager.SystemChat = _systemChatControl = new SystemChatControl(BORDER_WIDTH, BORDER_WIDTH, _worldWidth, _worldHeight);

            Add(_borderControl);
            Add(_button);
            Add(_systemChatControl);
            Resize();
        }
コード例 #2
0
ファイル: ResizableGump.cs プロジェクト: soufflee/ClassicUO
        protected ResizableGump(int width, int height, int minW, int minH, uint local, uint server, ushort borderHue = 0) : base(local, server)
        {
            _borderControl = new BorderControl(0, 0, Width, Height, 4)
            {
                Hue = borderHue
            };

            Add(_borderControl);
            _button = new Button(0, 0x837, 0x838, 0x838);
            Add(_button);

            _button.MouseDown += (sender, e) => { _clicked = true; };

            _button.MouseUp += (sender, e) =>
            {
                ResizeWindow(_lastSize);
                _clicked = false;
            };

            WantUpdateSize = false;

            Width      = _lastSize.X = width;
            Height     = _lastSize.Y = height;
            _savedSize = _lastSize;

            _minW = minW;
            _minH = minH;

            OnResize();
        }
コード例 #3
0
ファイル: ResizableGump.cs プロジェクト: shardengine/MobileUO
        protected ResizableGump(int width, int height, int minW, int minH, uint local, uint server, ushort borderHue = 0) : base(local, server)
        {
            _borderControl = new BorderControl(0, 0, Width, Height, 4)
            {
                Hue = borderHue
            };
            Add(_borderControl);
            _button = new Button(0, 0x837, 0x838, 0x838);
            Add(_button);

            //Upscale resize button on mobile
            if (UnityEngine.Application.isMobilePlatform)
            {
                _button.Width           *= 2;
                _button.Height          *= 2;
                _button.ContainsByBounds = true;
            }

            _button.MouseDown += (sender, e) => { _clicked = true; };
            _button.MouseUp   += (sender, e) =>
            {
                ResizeWindow(_lastSize);
                _clicked = false;
            };

            WantUpdateSize = false;

            Width      = _lastSize.X = width;
            Height     = _lastSize.Y = height;
            _savedSize = _lastSize;

            _minW = minW;
            _minH = minH;

            OnResize();
        }
コード例 #4
0
        public ChatGumpChooseName() : base(0, 0)
        {
            CanMove             = false;
            AcceptKeyboardInput = true;
            AcceptMouseInput    = true;
            WantUpdateSize      = true;

            X      = 250;
            Y      = 100;
            Width  = 210;
            Height = 330;

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

            Add
            (
                new BorderControl
                (
                    0,
                    0,
                    Width,
                    Height,
                    4
                )
            );

            Label text = new Label
                         (
                ResGumps.ChooseName,
                true,
                23,
                Width - 17,
                3
                         )
            {
                X = 6,
                Y = 6
            };

            Add(text);

            int BORDER_SIZE = 4;

            BorderControl border = new BorderControl
                                   (
                0,
                text.Y + text.Height,
                Width,
                27,
                BORDER_SIZE
                                   );

            Add(border);

            text = new Label
                   (
                ResGumps.Name,
                true,
                0x033,
                0,
                3
                   )
            {
                X = 6,
                Y = border.Y + 2
            };

            Add(text);

            int x = text.X + text.Width + 2;

            _textBox = new StbTextBox
                       (
                1,
                -1,
                Width - x - 17,
                true,
                FontStyle.Fixed,
                0x0481
                       )
            {
                X      = x,
                Y      = text.Y,
                Width  = Width - -x - 17,
                Height = 27 - BORDER_SIZE * 2
            };

            Add(_textBox);

            Add
            (
                new BorderControl
                (
                    0,
                    text.Y + text.Height,
                    Width,
                    27,
                    BORDER_SIZE
                )
            );

            // close
            Add
            (
                new Button(0, 0x0A94, 0x0A95, 0x0A94)
            {
                X            = Width - 19 - BORDER_SIZE,
                Y            = Height - 19 - BORDER_SIZE * 1,
                ButtonAction = ButtonAction.Activate
            }
            );

            // ok
            Add
            (
                new Button(1, 0x0A9A, 0x0A9B, 0x0A9A)
            {
                X            = Width - 19 * 2 - BORDER_SIZE,
                Y            = Height - 19 - BORDER_SIZE * 1,
                ButtonAction = ButtonAction.Activate
            }
            );
        }
コード例 #5
0
ファイル: UOChatGump.cs プロジェクト: qkdefus/ClassicUO
        public UOChatGumpChooseName() : base(0, 0)
        {
            CanMove             = false;
            AcceptKeyboardInput = true;
            AcceptMouseInput    = true;
            WantUpdateSize      = true;

            X      = 250;
            Y      = 100;
            Width  = 210;
            Height = 330;

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

            Add(new BorderControl(0, 0, Width, Height, 4));

            Label text = new Label("You are about to choose your name for the Ultima Online chat system. This name will be PERMANENT and unique on this shard. It will apply to all characters using this account. Do not use your Ultima Online account name for this name as the name you choose will be public. Enter your chat name here:"
                                   , true, 23, Width - 17, 3)
            {
                X = 6,
                Y = 6
            };

            Add(text);

            int BORDER_SIZE = 4;

            var border = new BorderControl(0, text.Y + text.Height, Width, 27, BORDER_SIZE);

            Add(border);

            text = new Label("Name:", true, 0x033, 0, 3)
            {
                X = 6,
                Y = border.Y + 2
            };
            Add(text);

            int x = text.X + text.Width + 2;

            _textBox = new TextBox(1, -1, 0, Width - x - 17, hue: 0x0481, style: FontStyle.Fixed)
            {
                X      = x,
                Y      = text.Y,
                Width  = Width - -x - 17,
                Height = 27 - BORDER_SIZE * 2
            };
            Add(_textBox);

            Add(new BorderControl(0, text.Y + text.Height, Width, 27, BORDER_SIZE));

            // close
            Add(new Button(0, 0x0A94, 0x0A95, 0x0A94)
            {
                X            = (Width - 19) - BORDER_SIZE,
                Y            = Height - 19 - BORDER_SIZE * 1,
                ButtonAction = ButtonAction.Activate
            });

            // ok
            Add(new Button(1, 0x0A9A, 0x0A9B, 0x0A9A)
            {
                X            = (Width - 19 * 2) - BORDER_SIZE,
                Y            = Height - 19 - BORDER_SIZE * 1,
                ButtonAction = ButtonAction.Activate
            });
        }