示例#1
0
        protected EventPopup CreatePopup(SysMenuManager manager)
        {
            EventPopup popup = new EventPopup(manager);

            manager.AddMenu(popup);
            return(popup);
        }
        public GamePopup(SysMenuManager owner) : base(owner)
        {
            transitionOnTime  = 80;
            transitionOffTime = 180;

            menuFont = FrameworkCore.Serif;
            SetOwner(owner);
        }
示例#3
0
        protected EventPopup CreatePopup(SysMenuManager manager, Rectangle img, string txt)
        {
            EventPopup popup = new EventPopup(manager);

            popup.image       = img;
            popup.description = txt;
            manager.AddMenu(popup);
            return(popup);
        }
        /// <summary>
        /// A menu formated to look like a popup window.
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="description">What text to display in the main window.</param>
        public SysPopup(SysMenuManager owner, string description) : base(owner)
        {
            menuFont             = FrameworkCore.Serif;
            this.descriptionText = description;
            SetOwner(owner);


            this.descriptionText = Helpers.StringWrap(FrameworkCore.SpriteBatch, FrameworkCore.Serif,
                                                      description, 504, Vector2.Zero, Color.Black);
        }
        public SkirmishPopup(SysMenuManager owner)
            : base(owner)
        {
            transitionOnTime  = 80;
            transitionOffTime = 180;

            menuFont = FrameworkCore.Serif;
            SetOwner(owner);

            InitializeItems();
        }
        public EventPopup(SysMenuManager owner)
            : base(owner)
        {
            screenPos = new Vector2(
                FrameworkCore.Graphics.GraphicsDevice.Viewport.Width / 2 - 512,
                FrameworkCore.Graphics.GraphicsDevice.Viewport.Height / 2 - 256);

            transitionOnTime  = 500;
            transitionOffTime = 300;

            canBeExited = false;
        }
        public ShipPopup(SysMenuManager owner)
            : base(owner)
        {
            screenPos = new Vector2(
                FrameworkCore.Graphics.GraphicsDevice.Viewport.Width / 2 - 256,
                FrameworkCore.Graphics.GraphicsDevice.Viewport.Height / 2 - 128);

            transitionOnTime  = 500;
            transitionOffTime = 300;

            darkenScreen = true;

            MenuItem item = new MenuItem("");

            item.Selected += OnClose;
            base.AddItem(item);

            canBeExited = false;
        }
        public FrameworkCore()
            : base()
        {
#if WINDOWS && STEAM
            steam = new ManagedSteam();
#endif



            game = this;

#if LiveEnabled
            Components.Add(new GamerServicesComponent(this));

            //DELETE ME
            //Guide.SimulateTrialMode = true;
#endif

            options        = new Options();
            storageManager = new StorageManager();


            highScores = new HighScoreEntry();


#if WINDOWS
            OptionsData optionsData = storageManager.LoadOptionsPC();
            options.bloom      = optionsData.bloom;
            options.fullscreen = optionsData.isFullscreen;

            options.renderPlanets = optionsData.renderPlanets;
            options.mousewheel    = optionsData.mousewheel;
            options.sensitivity   = optionsData.sensitivity;
            options.hardwaremouse = optionsData.hardwaremouse;
            options.manualDefault = optionsData.manualDefault;

            options.resolutionX = optionsData.VideoWidth;
            options.resolutionY = optionsData.VideoHeight;

            options.p1UseMouse = optionsData.player1UseMouse;
            options.p2UseMouse = optionsData.player2UseMouse;

            options.fixedTimeStep = optionsData.fixedTimeStep;
            options.vsync         = optionsData.vsync;

            if (options.hardwaremouse)
            {
                Game.IsMouseVisible = true;
            }
#endif



            graphics = new GraphicsDeviceManager(this);
#if XBOX
            if (GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width < 1920)
            {
                graphics.PreferredBackBufferHeight = 720;
                graphics.PreferredBackBufferWidth  = 1280;
            }
            else
            {
                graphics.PreferredBackBufferHeight = 1080;
                graphics.PreferredBackBufferWidth  = 1920;
            }
#elif ONLIVE
            graphics.PreferredBackBufferHeight = 720;
            graphics.PreferredBackBufferWidth  = 1280;
            graphics.IsFullScreen = true;
#else
            //PC
            //graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
            //graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;


            graphics.PreferredBackBufferHeight = optionsData.VideoHeight;
            graphics.PreferredBackBufferWidth  = optionsData.VideoWidth;
            graphics.IsFullScreen = optionsData.isFullscreen;

            game.IsFixedTimeStep = optionsData.fixedTimeStep;
            graphics.SynchronizeWithVerticalRetrace = optionsData.vsync;
            graphics.ApplyChanges();
#endif



            particles = new ParticleManager(this);

            contentManager = new ContentManager(Services, "Content");

            boltManager = new BoltManager(this, particles);



            bloomComponent = new BloomComponent(this);


            Meshrenderer       = new MeshRenderer();
            playerMeshRenderer = new MeshRenderer();

            playbackSystem   = new PlaybackSystem();
            worldTextManager = new WorldTextManager(this);
            debrismanager    = new DebrisManager();
            hulkmanager      = new HulkManager();



            audioManager = new AudioManager();

            sysmenumanager = new SysMenuManager();
            level          = new Level();

            for (int i = 0; i < 4; i++)
            {
                PlayerIndex index = PlayerIndex.One;

                if (i == 0)
                {
                    index = PlayerIndex.One;
                }
                else if (i == 1)
                {
                    index = PlayerIndex.Two;
                }
                else if (i == 2)
                {
                    index = PlayerIndex.Three;
                }
                else
                {
                    index = PlayerIndex.Four;
                }

                menuInputs[i] = new InputManager(index);
            }

#if WINDOWS
    #if !TRIAL
            //check for full version files.
            isPirated = IsMissingFiles();
    #endif
#endif
        }
 public void SetOwner(SysMenuManager owner)
 {
     this.owner = owner;
 }
        public SysMenu(SysMenuManager owner)
        {
            this.owner = owner;

            InitializeItems();
        }
        public InventoryPopup(SysMenuManager owner, bool includeClearSlot)
            : base(owner)
        {
            transitionOnTime  = 200;
            transitionOffTime = 200;

            menuFont = FrameworkCore.Serif;
            SetOwner(owner);

            darkenScreen = true;
            hideChildren = false;

            InventoryMenuItem menuItem = null;

            if (includeClearSlot)
            {
                menuItem           = new InventoryMenuItem(Resource.MenuSkirmishSlotClear);
                menuItem.Selected += OnSelectClear;
                menuItems.Add(menuItem);
            }

            //populate the menu items.
            foreach (InventoryItem item in FrameworkCore.players[0].inventoryItems)
            {
                if (!isValidItem(item))
                {
                    continue;
                }

                menuItem               = new InventoryMenuItem(item.name);
                menuItem.Selected     += OnSelectItem;
                menuItem.inventoryItem = item;
                menuItems.Add(menuItem);
            }

            if (FrameworkCore.players[0].inventoryItems.Count > 0)
            {
                selectedIndex = 0;
            }


            if (menuItems.Count <= 0)
            {
                noItemsFound = true;

                menuItem           = new InventoryMenuItem("");
                menuItem.Selected += OnSelectDeactivate;
                menuItems.Add(menuItem);
            }
            else
            {
                menuItem           = new InventoryMenuItem(Resource.MenuCancel);
                menuItem.Selected += OnSelectDeactivate;
                menuItems.Add(menuItem);
            }

            UpdateTargetPositions();

            foreach (InventoryMenuItem item in menuItems)
            {
                item.position = item.targetPosition;
            }
        }
示例#12
0
 /// <summary>
 /// A menu formated to look like a popup window.
 /// </summary>
 /// <param name="owner"></param>
 /// <param name="description">What text to display in the main window.</param>
 public BasePopup(SysMenuManager owner)
 {
     menuFont = FrameworkCore.Serif;
     SetOwner(owner);
 }
示例#13
0
        public EventManager(SysMenuManager menu)
        {
            if (menu == null)
            {
                throw new NullReferenceException("eventmanager menu is null");
            }

            this.menuManager = menu;

            unlockableEventPool = new List <Event>();
            PopulateUnlockableEvents();


            inventoryPool = new List <InventoryItem>();
            PopulateInventory();


            eventPool = new List <Event>();
            PopulateEvents();

            dangerPool = new List <Event>();
            PopulateDangerPool();

            wormPool = new List <Event>();
            PopulateWormPool();


            foreach (Event ev in eventPool)
            {
                InitializeEvent(ev);
            }

            foreach (Event ev in dangerPool)
            {
                InitializeEvent(ev);
            }

            foreach (Event ev in wormPool)
            {
                InitializeEvent(ev);
            }

            log = new List <LogEvent>();


            //populate the trade outpost.
            int TRADEITEMQUANTITY = 5;

            tradeItems = new List <InventoryItem>();
            for (int i = 0; i < TRADEITEMQUANTITY; i++)
            {
                bool check = true;
                while (check == true)
                {
                    InventoryItem randItem = tradePool[FrameworkCore.r.Next(tradePool.Length)];

                    bool isDuplicate = false;
                    for (int x = 0; x < tradeItems.Count; x++)
                    {
                        if (tradeItems[x] == randItem)
                        {
                            //found it.
                            isDuplicate = true;
                        }
                    }

                    if (!isDuplicate)
                    {
                        tradeItems.Add(randItem);
                        check = false;
                    }
                }
            }
        }