public InGameControlSet(IMainButtonController mainButtonController,
                         IEOMessageBoxFactory messageBoxFactory,
                         IHudControlsFactory hudControlsFactory)
     : base(mainButtonController)
 {
     _messageBoxFactory  = messageBoxFactory;
     _hudControlsFactory = hudControlsFactory;
     _controls           = new Dictionary <HudControlIdentifier, IGameComponent>();
 }
 public AccountDialogDisplayActions(ILocalizedStringFinder localizedStringFinder,
                                    ICreateAccountWarningDialogFactory createAccountWarningDialogFactory,
                                    ICreateAccountProgressDialogFactory createAccountProgressDialogFactory,
                                    IEOMessageBoxFactory eoMessageBoxFactory,
                                    IChangePasswordDialogFactory changePasswordDialogFactory)
 {
     _localizedStringFinder              = localizedStringFinder;
     _createAccountWarningDialogFactory  = createAccountWarningDialogFactory;
     _createAccountProgressDialogFactory = createAccountProgressDialogFactory;
     _eoMessageBoxFactory         = eoMessageBoxFactory;
     _changePasswordDialogFactory = changePasswordDialogFactory;
 }
        public ChangePasswordDialog(INativeGraphicsManager nativeGraphicsManager,
                                    IGameStateProvider gameStateProvider,
                                    IContentManagerProvider contentManagerProvider,
                                    IEOMessageBoxFactory eoMessageBoxFactory,
                                    IKeyboardDispatcherProvider keyboardDispatcherProvider,
                                    IPlayerInfoProvider playerInfoProvider,
                                    IEODialogButtonService dialogButtonService)
            : base(gameStateProvider)
        {
            _eoMessageBoxFactory = eoMessageBoxFactory;
            _playerInfoProvider  = playerInfoProvider;
            var dispatcher = keyboardDispatcherProvider.Dispatcher;

            BackgroundTexture = nativeGraphicsManager.TextureFromResource(GFXTypes.PreLoginUI, 21);

            var cursorTexture = contentManagerProvider.Content.Load <Texture2D>("Cursor");

            _inputBoxes = new IXNATextBox[4];
            for (int i = 0; i < _inputBoxes.Length; ++i)
            {
                var tb = new XNATextBox(new Rectangle(198, 60 + i * 30, 137, 19), Constants.FontSize08, caretTexture: cursorTexture)
                {
                    LeftPadding = 5,
                    DefaultText = " ",
                    MaxChars    = i == 0 ? 16 : 12,
                    PasswordBox = i > 1,
                    TextColor   = ColorConstants.LightBeigeText
                };
                _inputBoxes[i] = tb;
            }

            _clickEventHandler = new TextBoxClickEventHandler(dispatcher, _inputBoxes);
            _tabEventHandler   = new TextBoxTabEventHandler(dispatcher, _inputBoxes);

            dispatcher.Subscriber = _inputBoxes[0];

            _ok = new XNAButton(
                dialogButtonService.SmallButtonSheet,
                new Vector2(157, 195),
                dialogButtonService.GetSmallDialogButtonOutSource(SmallButton.Ok),
                dialogButtonService.GetSmallDialogButtonOverSource(SmallButton.Ok));
            _ok.OnClick += OnButtonPressed;

            _cancel = new XNAButton(
                dialogButtonService.SmallButtonSheet,
                new Vector2(250, 195),
                dialogButtonService.GetSmallDialogButtonOutSource(SmallButton.Cancel),
                dialogButtonService.GetSmallDialogButtonOverSource(SmallButton.Cancel));
            _cancel.OnClick += (s, e) => Close(XNADialogResult.Cancel);

            CenterInGameView();
        }
 public CreateCharacterDialogFactory(INativeGraphicsManager nativeGraphicsManager,
                                     IGameStateProvider gameStateProvider,
                                     ICharacterRendererFactory characterRendererFactory,
                                     IContentManagerProvider contentManagerProvider,
                                     IKeyboardDispatcherProvider keyboardDispatcherProvider,
                                     IEOMessageBoxFactory eoMessageBoxFactory,
                                     IEODialogButtonService dialogButtonService)
 {
     _nativeGraphicsManager      = nativeGraphicsManager;
     _gameStateProvider          = gameStateProvider;
     _characterRendererFactory   = characterRendererFactory;
     _contentManagerProvider     = contentManagerProvider;
     _keyboardDispatcherProvider = keyboardDispatcherProvider;
     _eoMessageBoxFactory        = eoMessageBoxFactory;
     _dialogButtonService        = dialogButtonService;
 }
示例#5
0
 public WalkErrorHandler(IMapCellStateProvider mapCellStateProvider,
                         ICharacterProvider characterProvider,
                         IStatusLabelSetter statusLabelSetter,
                         ICurrentMapStateRepository currentMapStateRepository,
                         IUnlockDoorValidator unlockDoorValidator,
                         IEOMessageBoxFactory eoMessageBoxFactory,
                         IPacketSendService packetSendService)
 {
     _mapCellStateProvider      = mapCellStateProvider;
     _characterProvider         = characterProvider;
     _statusLabelSetter         = statusLabelSetter;
     _currentMapStateRepository = currentMapStateRepository;
     _unlockDoorValidator       = unlockDoorValidator;
     _eoMessageBoxFactory       = eoMessageBoxFactory;
     _packetSendService         = packetSendService;
 }
示例#6
0
 public ControlSetFactory(INativeGraphicsManager nativeGraphicsManager,
                          IEOMessageBoxFactory messageBoxFactory,
                          IHudControlsFactory hudControlsFactory,
                          IContentManagerProvider contentManagerProvider,
                          IKeyboardDispatcherProvider keyboardDispatcherProvider,
                          IConfigurationProvider configProvider,
                          ICharacterInfoPanelFactory characterInfoPanelFactory)
 {
     _nativeGraphicsManager      = nativeGraphicsManager;
     _messageBoxFactory          = messageBoxFactory;
     _hudControlsFactory         = hudControlsFactory;
     _contentManagerProvider     = contentManagerProvider;
     _keyboardDispatcherProvider = keyboardDispatcherProvider;
     _configProvider             = configProvider;
     _characterInfoPanelFactory  = characterInfoPanelFactory;
 }
 public ChangePasswordDialogFactory(INativeGraphicsManager nativeGraphicsManager,
                                    IGameStateProvider gameStateProvider,
                                    IContentManagerProvider contentManagerProvider,
                                    IEOMessageBoxFactory eoMessageBoxFactory,
                                    IKeyboardDispatcherProvider keyboardDispatcherProvider,
                                    IPlayerInfoProvider playerInfoProvider,
                                    IEODialogButtonService eoDialogButtonService)
 {
     _nativeGraphicsManager      = nativeGraphicsManager;
     _gameStateProvider          = gameStateProvider;
     _contentManagerProvider     = contentManagerProvider;
     _eoMessageBoxFactory        = eoMessageBoxFactory;
     _keyboardDispatcherProvider = keyboardDispatcherProvider;
     _playerInfoProvider         = playerInfoProvider;
     _eoDialogButtonService      = eoDialogButtonService;
 }
示例#8
0
 public HudPanelFactory(INativeGraphicsManager nativeGraphicsManager,
                        IContentManagerProvider contentManagerProvider,
                        IHudControlProvider hudControlProvider,
                        INewsProvider newsProvider,
                        IChatProvider chatProvider,
                        ICharacterProvider characterProvider,
                        ICharacterInventoryProvider characterInventoryProvider,
                        IExperienceTableProvider experienceTableProvider,
                        IEOMessageBoxFactory messageBoxFactory,
                        ITrainingController trainingController)
 {
     _nativeGraphicsManager      = nativeGraphicsManager;
     _contentManagerProvider     = contentManagerProvider;
     _hudControlProvider         = hudControlProvider;
     _newsProvider               = newsProvider;
     _chatProvider               = chatProvider;
     _characterProvider          = characterProvider;
     _characterInventoryProvider = characterInventoryProvider;
     _experienceTableProvider    = experienceTableProvider;
     _messageBoxFactory          = messageBoxFactory;
     _trainingController         = trainingController;
 }
示例#9
0
        public StatsPanel(INativeGraphicsManager nativeGraphicsManager,
                          ICharacterProvider characterProvider,
                          ICharacterInventoryProvider characterInventoryProvider,
                          IExperienceTableProvider experienceTableProvider,
                          IEOMessageBoxFactory messageBoxFactory,
                          ITrainingController trainingController)
        {
            _characterProvider          = characterProvider;
            _characterInventoryProvider = characterInventoryProvider;
            _experienceTableProvider    = experienceTableProvider;
            _messageBoxFactory          = messageBoxFactory;
            _trainingController         = trainingController;

            BackgroundImage = nativeGraphicsManager.TextureFromResource(GFXTypes.PostLoginUI, 34);
            DrawArea        = new Rectangle(102, 330, BackgroundImage.Width, BackgroundImage.Height);

            _basicStats     = new IXNALabel[6];
            _arrowButtons   = new IXNAButton[6];
            _characterStats = new IXNALabel[6];
            _characterInfo  = new IXNALabel[3];
            _otherInfo      = new IXNALabel[8];

            var buttonTexture   = nativeGraphicsManager.TextureFromResource(GFXTypes.PostLoginUI, 27, true);
            var outTextureArea  = new Rectangle(215, 386, 19, 15);
            var overTextureArea = new Rectangle(234, 386, 19, 15);

            for (int i = 0; i < _basicStats.Length; ++i)
            {
                _basicStats[i] = new XNALabel(Constants.FontSize08pt5)
                {
                    ForeColor = ColorConstants.LightGrayText,
                    AutoSize  = false,
                    Text      = "",
                    DrawArea  = new Rectangle(50, 8 + i * 18, 73, 13)
                };

                _arrowButtons[i] = new XNAButton(buttonTexture,
                                                 new Vector2(106, 7 + i * 18),
                                                 outTextureArea,
                                                 overTextureArea)
                {
                    Visible    = false,
                    FlashSpeed = 500
                };
            }

            for (int i = 0; i < _characterStats.Length; ++i)
            {
                _characterStats[i] = new XNALabel(Constants.FontSize08pt5)
                {
                    ForeColor = ColorConstants.LightGrayText,
                    AutoSize  = false,
                    Text      = "",
                    DrawArea  = new Rectangle(158, 8 + i * 18, 73, 13)
                };
            }

            for (int i = 0; i < _otherInfo.Length; ++i)
            {
                var drawArea = i < 4
                    ? new Rectangle(280, 44 + i % 4 * 18, 60, 13)
                    : new Rectangle(379, 44 + i % 4 * 18, 94, 13);

                _otherInfo[i] = new XNALabel(Constants.FontSize08pt5)
                {
                    ForeColor = ColorConstants.LightGrayText,
                    AutoSize  = false,
                    Text      = "",
                    DrawArea  = drawArea
                };
            }

            _characterInfo[NAME] = new XNALabel(Constants.FontSize08pt5)
            {
                ForeColor = ColorConstants.LightGrayText,
                AutoSize  = false,
                Text      = "",
                DrawArea  = new Rectangle(280, 8, 144, 13)
            };
            _characterInfo[GUILD] = new XNALabel(Constants.FontSize08pt5)
            {
                ForeColor = ColorConstants.LightGrayText,
                AutoSize  = false,
                Text      = "",
                DrawArea  = new Rectangle(280, 26, 193, 13)
            };
            _characterInfo[LEVEL] = new XNALabel(Constants.FontSize08pt5)
            {
                ForeColor = ColorConstants.LightGrayText,
                AutoSize  = false,
                Text      = "",
                DrawArea  = new Rectangle(453, 8, 20, 13)
            };
        }
示例#10
0
 public FirstTimePlayerActions(IPlayerInfoProvider playerInfoProvider,
                               IEOMessageBoxFactory messageBoxFactory)
 {
     _playerInfoProvider = playerInfoProvider;
     _messageBoxFactory  = messageBoxFactory;
 }
示例#11
0
        public CreateCharacterDialog(
            INativeGraphicsManager nativeGraphicsManager,
            IGameStateProvider gameStateProvider,
            ICharacterRendererFactory rendererFactory,
            ContentManager contentManager,
            KeyboardDispatcher dispatcher,
            IEOMessageBoxFactory messageBoxFactory,
            IEODialogButtonService eoDialogButtonService)
            : base(gameStateProvider)
        {
            _messageBoxFactory = messageBoxFactory;
            BackgroundTexture  = nativeGraphicsManager.TextureFromResource(GFXTypes.PreLoginUI, 20);

            _charCreateSheet = nativeGraphicsManager.TextureFromResource(GFXTypes.PreLoginUI, 22);

            var cursorTexture = contentManager.Load <Texture2D>("cursor");

            _inputBox = new XNATextBox(new Rectangle(80, 57, 138, 19), Constants.FontSize08, caretTexture: cursorTexture)
            {
                LeftPadding = 5,
                DefaultText = " ",
                Text        = " ",
                MaxChars    = 12,
                Selected    = true,
                TextColor   = ColorConstants.LightBeigeText,
                Visible     = true
            };
            _inputBox.SetParentControl(this);
            dispatcher.Subscriber = _inputBox;

            for (int i = 0; i < _arrowButtons.Length; ++i)
            {
                var btn = new XNAButton(_charCreateSheet,
                                        new Vector2(196, 85 + i * 26),
                                        new Rectangle(185, 38, 19, 19),
                                        new Rectangle(206, 38, 19, 19));
                btn.OnClick += ArrowButtonClick;
                btn.SetParentControl(this);
                _arrowButtons[i] = btn;
            }

            _characterControl = new CreateCharacterControl(rendererFactory)
            {
                DrawPosition = new Vector2(235, 58)
            };
            _characterControl.SetParentControl(this);

            _srcRectangles[0] = new Rectangle(0, 38, 23, 19);
            _srcRectangles[1] = new Rectangle(0, 19, 23, 19);
            _srcRectangles[2] = new Rectangle(0, 0, 23, 19);
            _srcRectangles[3] = new Rectangle(46, 38, 23, 19);

            _ok = new XNAButton(eoDialogButtonService.SmallButtonSheet,
                                new Vector2(157, 195),
                                eoDialogButtonService.GetSmallDialogButtonOutSource(SmallButton.Ok),
                                eoDialogButtonService.GetSmallDialogButtonOverSource(SmallButton.Ok));
            _ok.OnClick += (s, e) => ClickOk();
            _ok.SetParentControl(this);

            _cancel = new XNAButton(eoDialogButtonService.SmallButtonSheet,
                                    new Vector2(250, 195),
                                    eoDialogButtonService.GetSmallDialogButtonOutSource(SmallButton.Cancel),
                                    eoDialogButtonService.GetSmallDialogButtonOverSource(SmallButton.Cancel));
            _cancel.OnClick += (s, e) => Close(XNADialogResult.Cancel);
            _cancel.SetParentControl(this);

            CenterInGameView();
        }
 public ErrorDialogDisplayAction(IEOMessageBoxFactory messageBoxFactory)
 {
     _messageBoxFactory = messageBoxFactory;
 }
示例#13
0
 public CharacterDialogActions(IEOMessageBoxFactory messageBoxFactory,
                               ICreateCharacterDialogFactory createCharacterDialogFactory)
 {
     _messageBoxFactory            = messageBoxFactory;
     _createCharacterDialogFactory = createCharacterDialogFactory;
 }