Example #1
0
        public Chatbox(IResourceManager resourceManager, IUserInterfaceManager userInterfaceManager,
                       IKeyBindingManager keyBindingManager)
        {
            _resourceManager = resourceManager;
            _userInterfaceManager = userInterfaceManager;
            _keyBindingManager = keyBindingManager;

            Position = new Point((int)CluwneLib.CurrentClippingViewport.Width - (int)Size.X - 10, 10);

            ClientArea = new Rectangle(Position.X, Position.Y, (int) Size.X, (int) Size.Y);

            _textInputLabel = new Label("", "CALIBRI", _resourceManager)
                                  {
                                      Text =
                                          {
                                              Size = new Size(ClientArea.Width - 10, 12),
                                              Color = Color.Green
                                          }
                                  };

            _chatColors = new Dictionary<ChatChannel, Color>
                              {
                                  {ChatChannel.Default, Color.Gray},
                                  {ChatChannel.Damage, Color.Red},
                                  {ChatChannel.Radio, Color.DarkGreen},
                                  {ChatChannel.Server, Color.Blue},
                                  {ChatChannel.Player, Color.Green},
                                  {ChatChannel.Lobby, Color.White},
                                  {ChatChannel.Ingame, Color.Green},
                                  {ChatChannel.OOC, Color.White},
                                  {ChatChannel.Emote, Color.Cyan},
                                  {ChatChannel.Visual, Color.Yellow},
                              };
        }
Example #2
0
        public Chatbox(IResourceManager resourceManager, IUserInterfaceManager userInterfaceManager,
                       IKeyBindingManager keyBindingManager)
        {
            _resourceManager      = resourceManager;
            _userInterfaceManager = userInterfaceManager;
            _keyBindingManager    = keyBindingManager;

            Position = new Point(Gorgon.CurrentClippingViewport.Width - (int)Size.X - 10, 10);

            ClientArea = new Rectangle(Position.X, Position.Y, (int)Size.X, (int)Size.Y);

            _textInputLabel = new Label("", "CALIBRI", _resourceManager)
            {
                Text =
                {
                    Size  = new Size(ClientArea.Width - 10, 12),
                    Color = Color.Green
                }
            };

            _chatColors = new Dictionary <ChatChannel, Color>
            {
                { ChatChannel.Default, Color.Gray },
                { ChatChannel.Damage, Color.Red },
                { ChatChannel.Radio, Color.DarkGreen },
                { ChatChannel.Server, Color.Blue },
                { ChatChannel.Player, Color.Green },
                { ChatChannel.Lobby, Color.White },
                { ChatChannel.Ingame, Color.Green },
                { ChatChannel.OOC, Color.White },
                { ChatChannel.Emote, Color.Cyan },
                { ChatChannel.Visual, Color.Yellow },
            };
        }
Example #3
0
        public Chatbox(IResourceManager resourceManager, IUserInterfaceManager userInterfaceManager,
                       IKeyBindingManager keyBindingManager)
        {
            _resourceManager = resourceManager;
            _userInterfaceManager = userInterfaceManager;
            _keyBindingManager = keyBindingManager;

            Position = new Vector2i((int)CluwneLib.CurrentClippingViewport.Width - (int)Size.X - 10, 10);

            ClientArea = new IntRect(Position.X, Position.Y, (int) Size.X, (int) Size.Y);

            _textInputLabel = new Label("", "CALIBRI", _resourceManager)
                                  {
                                      Text =
                                          {
                                              Size = new Vector2i(ClientArea.Width - 10, 12),
                                              Color = new SFML.Graphics.Color(0, 128, 0)
                                          }
                                  };

            _chatColors = new Dictionary<ChatChannel, SFML.Graphics.Color>
                              {
                                  [ChatChannel.Default] = new SFML.Graphics.Color(128, 128, 128),
                                  [ChatChannel.Damage ] = Color.Red,
                                  [ChatChannel.Radio  ] = new SFML.Graphics.Color(0, 100, 0),
                                  [ChatChannel.Server ] = Color.Blue,
                                  [ChatChannel.Player ] = new SFML.Graphics.Color(0, 128, 0),
                                  [ChatChannel.Lobby  ] = Color.White,
                                  [ChatChannel.Ingame ] = new SFML.Graphics.Color(0, 128, 0),
                                  [ChatChannel.OOC    ] = Color.White,
                                  [ChatChannel.Emote  ] = Color.Cyan,
                                  [ChatChannel.Visual ] = Color.Yellow,
                              };
        }
Example #4
0
        public Chatbox(IResourceManager resourceManager, IUserInterfaceManager userInterfaceManager,
                       IKeyBindingManager keyBindingManager)
        {
            _resourceManager      = resourceManager;
            _userInterfaceManager = userInterfaceManager;
            _keyBindingManager    = keyBindingManager;

            Position = new Vector2i((int)CluwneLib.CurrentClippingViewport.Width - (int)Size.X - 10, 10);

            ClientArea = new IntRect(Position.X, Position.Y, (int)Size.X, (int)Size.Y);

            _textInputLabel = new Label("", "CALIBRI", _resourceManager)
            {
                Text =
                {
                    Size  = new Vector2i(ClientArea.Width - 10, 12),
                    Color = new SFML.Graphics.Color(0,          128, 0)
                }
            };

            _chatColors = new Dictionary <ChatChannel, SFML.Graphics.Color>
            {
                [ChatChannel.Default] = new SFML.Graphics.Color(128, 128, 128),
                [ChatChannel.Damage]  = Color.Red,
                [ChatChannel.Radio]   = new SFML.Graphics.Color(0, 100, 0),
                [ChatChannel.Server]  = Color.Blue,
                [ChatChannel.Player]  = new SFML.Graphics.Color(0, 128, 0),
                [ChatChannel.Lobby]   = Color.White,
                [ChatChannel.Ingame]  = new SFML.Graphics.Color(0, 128, 0),
                [ChatChannel.OOC]     = Color.White,
                [ChatChannel.Emote]   = Color.Cyan,
                [ChatChannel.Visual]  = Color.Yellow,
            };
        }
Example #5
0
 protected State(IDictionary<Type, object> managers)
 {
     StateManager = (IStateManager) managers[typeof (IStateManager)];
     NetworkManager = (INetworkManager) managers[typeof (INetworkManager)];
     ResourceManager = (IResourceManager) managers[typeof (IResourceManager)];
     UserInterfaceManager = (IUserInterfaceManager) managers[typeof (IUserInterfaceManager)];
     MapManager = (IMapManager) managers[typeof (IMapManager)];
     PlayerManager = (IPlayerManager) managers[typeof (IPlayerManager)];
     ConfigurationManager = (IConfigurationManager) managers[typeof (IConfigurationManager)];
     PlacementManager = (IPlacementManager) managers[typeof (IPlacementManager)];
     KeyBindingManager = (IKeyBindingManager) managers[typeof (IKeyBindingManager)];
 }
Example #6
0
 protected State(IDictionary <Type, object> managers)
 {
     StateManager         = (IStateManager)managers[typeof(IStateManager)];
     NetworkManager       = (IClientNetManager)managers[typeof(IClientNetManager)];
     ResourceCache        = (IResourceCache)managers[typeof(IResourceCache)];
     UserInterfaceManager = (IUserInterfaceManager)managers[typeof(IUserInterfaceManager)];
     MapManager           = (IMapManager)managers[typeof(IMapManager)];
     PlayerManager        = (IPlayerManager)managers[typeof(IPlayerManager)];
     ConfigurationManager = (IConfigurationManager)managers[typeof(IConfigurationManager)];
     PlacementManager     = (IPlacementManager)managers[typeof(IPlacementManager)];
     KeyBindingManager    = (IKeyBindingManager)managers[typeof(IKeyBindingManager)];
 }
Example #7
0
 public KeyboardSettingsViewModel(ISettingsManager settingsManager,
                                  IKeyBindingManager keyBindingManager)
 {
     _keyBindingManager       = keyBindingManager;
     Schemes                  = _keyBindingManager.SchemeManager.SchemeDefinitions;
     _selectedScheme          = _keyBindingManager.SchemeManager.CurrentScheme;
     AllCommands              = keyBindingManager.KeyGestureService.GetAllCommandDefinitions().Where(x => x.AllowGestureMapping);
     Scopes                   = new BindableCollection <GestureScope>(keyBindingManager.KeyGestureService.GetAllCommandGestureScopes());
     SelectedScope            = GestureScopes.GlobalGestureScope;
     AvailableGestureBindings = new ObservableCollection <GestureScopeMapping>();
     SetupCollectionViewSource();
 }
        public StateManager(IConfigurationManager configurationManager, INetworkManager networkManager,
                            IUserInterfaceManager userInterfaceManager,
                            IResourceManager resourceManager, IMapManager mapManager, IPlayerManager playerManager,
                            IPlacementManager placementManager, IKeyBindingManager keyBindingManager)
        {
            _managers = new Dictionary <Type, object>
            {
                { typeof(INetworkManager), networkManager },
                { typeof(IUserInterfaceManager), userInterfaceManager },
                { typeof(IResourceManager), resourceManager },
                { typeof(IMapManager), mapManager },
                { typeof(IPlayerManager), playerManager },
                { typeof(IConfigurationManager), configurationManager },
                { typeof(IPlacementManager), placementManager },
                { typeof(IKeyBindingManager), keyBindingManager },
                { typeof(IStateManager), this }
            };

            _loadedStates = new Dictionary <Type, IState>();
            CurrentState  = null;

            playerManager.RequestedStateSwitch += HandleStateChange;
        }