Exemple #1
0
        /// <summary>
        /// MouseLeftPress
        /// </summary>
        /// <param name="e"></param>
        public override void MouseLeftPress(MouseState e)
        {
            if (!DebugConsole.Visible)
            {
                if (ScriptManager.BlockType <= ViewerEnums.BlockType.BlockUserMoves)
                {
                    if (_Interface.IsInterfaceActive())
                    {
                        _Interface.MousePress(e);
                    }
                    else
                    {
                        Point eFixed = FixViewCoords(e);

                        //Si pas d'action, déplacement
                        if (!ActionManager.ClickedState && !_Interface.Inventory.Opened && ActionManager.CurrentActionIsGo() && ScriptManager.ScriptStagesInteractions)
                        {
                            PlayableCharactersManager.CurrentPlayerCharacter.CharacterSprite.MoveCharacter(eFixed);
                        }
                        //Si action, on execute un event ou on gère l'interface
                        else
                        {
                            if (_Interface.Inventory.GetInventoryButtonEvent(new Point(e.X, e.Y)))
                            {
                                if (ActionManager.ItemAsAction)
                                {
                                    ActionManager.UnloadItem();
                                }
                                else
                                {
                                    _Interface.Inventory.SwitchInventory();
                                }
                            }
                            if (!_Interface.Inventory.Opened && ScriptManager.ScriptStagesInteractions)
                            {
                                if (!_Service.ExecuteClickedEvent(eFixed, _ProjectData.Resolution.MatrixPrecision))
                                {
                                    if (ActionManager.CurrentActionIsGo())
                                    {
                                        PlayableCharactersManager.CurrentPlayerCharacter.CharacterSprite.MoveCharacter(eFixed);
                                    }
                                }
                            }
                        }
                    }
                }
                else if (ScriptManager.CurrentChoice != null)
                {
                    ScriptManager.CurrentChoice.MousePress(e);
                }
            }
        }