Esempio n. 1
0
        /// <summary>
        /// Renvoie les informations du menu
        /// </summary>
        /// <returns>VO_Menu</returns>
        public VO_Menu GetMenuData()
        {
            VO_Menu menu = null;

            RunServiceTask(delegate
            {
                menu = _Business.GetMenuData();
            }, ViewerErrors.TITLE_LOAD_MENU);

            return(menu);
        }
Esempio n. 2
0
        /// <summary>
        /// Renvoie les informations du menu
        /// </summary>
        /// <returns>VO_Menu</returns>
        public VO_Menu GetMenuData()
        {
            VO_Menu menu = null;

            RunServiceTask(delegate
            {
                menu = _Business.GetMenuData();
            });

            return(menu);
        }
Esempio n. 3
0
        /// <summary>
        /// Constructeur
        /// </summary>
        /// <param name="game"></param>
        public Screen(Game game, SpriteBatch spriteBatch)
            : base(game)
        {
            _SpriteBatch = spriteBatch;

            //1 - Couche métier
            _ScreenBusiness = new ScreenService();

            //2 - Récupérer les informations projet
            _MenuData        = _ScreenBusiness.GetMenuData();
            _ProjectData     = _ScreenBusiness.GetProjectData();
            _TerminologyData = _ScreenBusiness.GetTerminologyData();
        }
Esempio n. 4
0
 public Inventory(SpriteBatch spriteBatch, Game game)
 {
     _SpriteBatch = spriteBatch;
     _Service     = new InventoryService();
     _MenuData    = _Service.GetMenuData();
     if (_MenuData.InventoryBackButtonAnimation != Guid.Empty)
     {
         _InventoryButton = new VO_AnimatedSprite(_MenuData.InventoryBackButtonAnimation, Guid.Empty, Enums.AnimationType.Menu, _MenuData.InventoryBackButtonCoords.X, _MenuData.InventoryBackButtonCoords.Y, ViewerEnums.ImageResourceType.Permanent);
     }
     if (_MenuData.InventoryAnimation != Guid.Empty)
     {
         _Inventory = new VO_AnimatedSprite(_MenuData.InventoryAnimation, Guid.Empty, Enums.AnimationType.Menu, _MenuData.InventoryBackgroundCoords.X, _MenuData.InventoryBackgroundCoords.Y, ViewerEnums.ImageResourceType.Permanent);
     }
 }
Esempio n. 5
0
 /// <summary>
 /// Constructeur principal
 /// </summary>
 public GameCoreDBSave()
 {
     ObjectAnimations = new List<VO_Animation>();
     Characters = new List<VO_Character>();
     PlayableCharacters = new List<VO_PlayableCharacter>();
     Items = new List<VO_Item>();
     Actions = new List<VO_Action>();
     Events = new List<VO_Event>();
     Classes = new List<VO_Class>();
     Triggers = new List<VO_Trigger>();
     GlobalEvents = new List<VO_GlobalEvent>();
     InteractionScripts = new List<VO_Script>();
     Menu = new VO_Menu();
     Project = new VO_Project();
     Variables = new List<VO_Variable>();
     Terminology = new VO_Terminology();
 }
Esempio n. 6
0
        /// <summary>
        /// Insère un menu
        /// </summary>
        /// <returns></returns>
        public static VO_Menu CreateMenu()
        {
            //Création de l'objet
            VO_Menu newMenu = new VO_Menu()
            {
                ActivateEchapMenu         = true,
                ActivateLoadingMenu       = true,
                ActivateMainMenu          = true,
                ActivateSaveMenu          = true,
                InventoryBackButtonCoords = new Point(0, 0),
                InventoryCoords           = new Point(0, 0),
                ItemWidth  = 32,
                ItemHeight = 32,
                GridHeight = 5,
                GridWidth  = 5
            };

            //Insertion de l'objet
            GameCore.Instance.Game.Menu = newMenu;
            return(newMenu);
        }
Esempio n. 7
0
        /// <summary>
        /// Survient lorsque le formulaire devient visible
        /// </summary>
        public void InitializeDBMenus()
        {
            //Code de chargement
            Menu = GameCore.Instance.Game.Menu;

            //Désactiver events
            this.ddpGridWidth.ValueChanged     -= new System.EventHandler(this.ddpGridWidth_ValueChanged);
            this.ddpGridHeight.ValueChanged    -= new System.EventHandler(this.ddpGridHeight_ValueChanged);
            this.ddpItemWidth.ValueChanged     -= new System.EventHandler(this.ddpItemWidth_ValueChanged);
            this.ddpItemHeight.ValueChanged    -= new System.EventHandler(this.ddpGridHeight_ValueChanged);
            chkActivateMain.CheckedChanged     -= new EventHandler(chkActivateMain_CheckedChanged);
            chkEchapMenu.CheckedChanged        -= new EventHandler(chkEchapMenu_CheckedChanged);
            chkLoadingMenu.CheckedChanged      -= new EventHandler(chkLoadingMenu_CheckedChanged);
            chkSaveMenu.CheckedChanged         -= new EventHandler(chkSaveMenu_CheckedChanged);
            AnimMainMenu.AnimationLoading      -= new EventHandler(AnimPrincipalMenu_AnimationLoading);
            AnimInventoryMenu.AnimationLoading -= new EventHandler(AnimInventoryMenu_AnimationLoading);
            AnimBackButton.AnimationLoading    -= new EventHandler(AnimBackButton_AnimationLoading);

            //Bind des infos dans les contrôles
            chkActivateMain.Checked = Menu.ActivateMainMenu;
            chkEchapMenu.Checked    = Menu.ActivateEchapMenu;
            chkLoadingMenu.Checked  = Menu.ActivateLoadingMenu;
            chkSaveMenu.Checked     = Menu.ActivateSaveMenu;

            if (Menu.InventoryAnimation != new Guid())
            {
                AnimInventoryMenu.LoadAnimation(Menu.InventoryAnimation);
                AnimInventoryMenu.Start();
            }
            else
            {
                AnimInventoryMenu.LoadAnimation(new Guid());
            }
            if (Menu.InventoryBackButtonAnimation != new Guid())
            {
                AnimBackButton.LoadAnimation(Menu.InventoryBackButtonAnimation);
                AnimBackButton.Start();
            }
            else
            {
                AnimBackButton.LoadAnimation(new Guid());
            }
            if (Menu.MainMenuAnimation != new Guid())
            {
                AnimMainMenu.LoadAnimation(Menu.MainMenuAnimation);
                AnimMainMenu.Start();
            }
            else
            {
                AnimMainMenu.LoadAnimation(new Guid());
            }

            crdInventoryPosition.SourceResolution   = new Size(GameCore.Instance.Game.Project.Resolution.Width, GameCore.Instance.Game.Project.Resolution.Height);
            crdBackButtonPosition.SourceResolution  = new Size(GameCore.Instance.Game.Project.Resolution.Width, GameCore.Instance.Game.Project.Resolution.Height);
            crdInventoryBackground.SourceResolution = new Size(GameCore.Instance.Game.Project.Resolution.Width, GameCore.Instance.Game.Project.Resolution.Height);
            crdInventoryPosition.Coords             = new Rectangle(Menu.InventoryCoords, new Size(Menu.GridWidth * Menu.ItemWidth, Menu.GridHeight * Menu.ItemHeight));

            VO_Animation animInventory = GameCore.Instance.Game.MenusAnimations.Find(p => p.Id == Menu.InventoryAnimation);

            if (animInventory != null)
            {
                crdInventoryBackground.Coords = new Rectangle(Menu.InventoryBackgroundCoords, new Size(animInventory.SpriteWidth, animInventory.SpriteHeight));
            }
            else
            {
                crdInventoryBackground.Coords = new Rectangle(Menu.InventoryBackgroundCoords, new Size(0, 0));
            }
            VO_Animation animBackButton = GameCore.Instance.Game.MenusAnimations.Find(p => p.Id == Menu.InventoryBackButtonAnimation);

            if (animBackButton != null)
            {
                crdBackButtonPosition.Coords = new Rectangle(Menu.InventoryBackButtonCoords, new Size(animBackButton.SpriteWidth, animBackButton.SpriteHeight));
            }
            else
            {
                crdBackButtonPosition.Coords = new Rectangle(Menu.InventoryBackButtonCoords, new Size(0, 0));
            }
            ddpGridWidth.Value  = Menu.GridWidth;
            ddpGridHeight.Value = Menu.GridHeight;
            ddpItemWidth.Value  = Menu.ItemWidth;
            ddpItemHeight.Value = Menu.ItemHeight;

            //Activer les events
            this.ddpGridWidth.ValueChanged     += new System.EventHandler(this.ddpGridWidth_ValueChanged);
            this.ddpGridHeight.ValueChanged    += new System.EventHandler(this.ddpGridHeight_ValueChanged);
            this.ddpItemWidth.ValueChanged     += new System.EventHandler(this.ddpItemWidth_ValueChanged);
            this.ddpItemHeight.ValueChanged    += new System.EventHandler(this.ddpItemHeight_ValueChanged);
            AnimBackButton.AnimationLoading    += new EventHandler(AnimBackButton_AnimationLoading);
            AnimInventoryMenu.AnimationLoading += new EventHandler(AnimInventoryMenu_AnimationLoading);
            AnimMainMenu.AnimationLoading      += new EventHandler(AnimPrincipalMenu_AnimationLoading);
            chkActivateMain.CheckedChanged     += new EventHandler(chkActivateMain_CheckedChanged);
            chkEchapMenu.CheckedChanged        += new EventHandler(chkEchapMenu_CheckedChanged);
            chkLoadingMenu.CheckedChanged      += new EventHandler(chkLoadingMenu_CheckedChanged);
            chkSaveMenu.CheckedChanged         += new EventHandler(chkSaveMenu_CheckedChanged);
        }
Esempio n. 8
0
 /// <summary>
 /// Main Constructor
 /// </summary>
 /// <param name="game"></param>
 /// <param name="spriteBatch"></param>
 public TitleScreen(Game game, SpriteBatch spriteBatch)
     : base(game, spriteBatch)
 {
     _Service  = new TitleService();
     _MenuData = _Service.GetMenuData();
 }