예제 #1
0
        // EVENT PREVU POUR CHARACTERS & EVENTS, les Anim ne sont pas supposées être cliquables
        public bool ExecuteClickedEvent(Point point, int matrixPrecision)
        {
            VO_StageObject hotSpot = null;

            #region Récupère le script
            //Gestion des characters
            foreach (VO_StageCharacter character in _CurrentStage.ListCharacters)
            {
                VO_CharacterSprite characterSprite = GetCharacterSprite(character.Id);
                if (characterSprite.PointIsInCharacter(point))
                {
                    //Activer l'event
                    foreach (VO_Page page in character.Event.PageList)
                    {
                        if (IsActivePage(page))
                        {
                            return(TestScript(character, Enums.TriggerEventConditionType.ClickEvent));
                        }
                    }
                }
            }

            //Gestion des events
            int eventIndex = MatrixManager.CurrentStage.EventsMatrix[point.X / matrixPrecision, point.Y / matrixPrecision] - 1;

            //Récupérer l'event associé
            if (eventIndex > -1)
            {
                hotSpot = _CurrentStage.ListHotSpots[eventIndex];
                return(TestScript(hotSpot, Enums.TriggerEventConditionType.ClickEvent));
            }
            #endregion

            return(false);
        }
예제 #2
0
        /// <summary>
        /// Récupère et traite l'event
        /// </summary>
        /// <param name="point"></param>
        /// <param name="matrixPrecision"></param>
        public bool GetEventFromMatrix(Point point, int matrixPrecision)
        {
            //Gestion des characters
            foreach (VO_StageCharacter character in _CurrentStage.ListCharacters)
            {
                VO_CharacterSprite characterSprite = GetCharacterSprite(character.Id);
                if (characterSprite.PointIsInCharacter(point))
                {
                    //Activer l'event
                    foreach (VO_Page page in character.Event.PageList)
                    {
                        if (IsActivePage(page))
                        {
                            return(true);
                        }
                    }
                    return(false);
                }
            }

            //Gestion des events
            int eventIndex = MatrixManager.CurrentStage.EventsMatrix[point.X / matrixPrecision, point.Y / matrixPrecision] - 1;

            //Récupérer l'event associé
            if (eventIndex > -1)
            {
                VO_Event eventSpot = _CurrentStage.ListHotSpots[eventIndex].Event;

                //Activer l'event
                foreach (VO_Page page in eventSpot.PageList)
                {
                    if (IsActivePage(page) && page.TriggerCondition == Enums.TriggerEventConditionType.ClickEvent)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }