コード例 #1
0
ファイル: WorldViewportGump.cs プロジェクト: broem/ClassicUO
        public WorldViewportGump(GameScene scene) : base(0, 0)
        {
            _settings              = Service.Get <Settings>();
            _inputManager          = Service.Get <InputManager>();
            AcceptMouseInput       = false;
            CanMove                = true;
            CanCloseWithEsc        = false;
            CanCloseWithRightClick = false;
            ControlInfo.Layer      = UILayer.Under;
            X                  = _settings.GameWindowX;
            Y                  = _settings.GameWindowY;
            _worldWidth        = _settings.GameWindowWidth;
            _worldHeight       = _settings.GameWindowHeight;
            _button            = new Button(0, 0x837, 0x838, 0x838);
            _button.MouseDown += (sender, e) => { _clicked = true; };

            _button.MouseUp += (sender, e) =>
            {
                _clicked      = false;
                _lastPosition = Point.Zero;
            };
            Width        = _worldWidth + BORDER_WIDTH * 2;
            Height       = _worldHeight + BORDER_HEIGHT * 2;
            _border      = new GameBorder(0, 0, Width, Height, 4);
            _viewport    = new WorldViewport(scene, BORDER_WIDTH, BORDER_HEIGHT, _worldWidth, _worldHeight);
            _chatControl = new ChatControl(BORDER_WIDTH, BORDER_HEIGHT, _worldWidth, _worldHeight);
            AddChildren(_border);
            AddChildren(_button);
            AddChildren(_viewport);
            AddChildren(_chatControl);
            Service.Register(_chatControl);
            Resize();
        }