AGS.Editor.CharactersEditorFilter.MouseDown C# (CSharp) Method

MouseDown() public method

public MouseDown ( MouseEventArgs e, RoomEditorState state ) : void
e MouseEventArgs
state RoomEditorState
return void
        public void MouseDown(MouseEventArgs e, RoomEditorState state)
        {
            int xClick = (e.X + state.ScrollOffsetX) / state.ScaleFactor;
            int yClick = (e.Y + state.ScrollOffsetY) / state.ScaleFactor;

            _selectedCharacter = null;

            foreach (Character character in _game.RootCharacterFolder.AllItemsFlat)
            {
                if (_room.Number == character.StartingRoom)
                {
                    AgsView view = _game.FindViewByID(character.NormalView);

                    if (view != null && view.Loops.Count > 0)
                    {
                        SelectCharacter(view, character, xClick, yClick, state);
                    }
                }
            }

            if (_selectedCharacter != null)
            {
                Factory.GUIController.SetPropertyGridObject(_selectedCharacter);
            }
            else
            {
                Factory.GUIController.SetPropertyGridObject(_room);
            }
        }