コード例 #1
0
        private void UpdateMapMenu(GameTime gameTime)
        {
            WorldMapMenu.Update(gameTime);

            string temp = WorldMapMenu.CheckNewTravel();

            if (temp != null && TravelMenu.TurnsLeft == 0)
            {
                if (TravelMenu.StartTravel(temp))
                {
                    ChangeGameState(GameState.TravelMenu);
                    CityInfoMenu.Active = false;
                }
            }

            if (WorldMapMenu.inventoryButton.LeftClick())
            {
                ChangeGameState(GameState.InventoryMenu);
                CityInfoMenu.Active = false;
            }

            if (WorldMapMenu.returnButton.LeftClick())
            {
                RevertGameState();
                CityInfoMenu.Active = false;
            }
        }
コード例 #2
0
 static public bool Update()
 {
     if (active)
     {
         if (exit.LeftClick())
         {
             active = false;
         }
         foreach (City tempCity in WorldMapMenu.Cities)
         {
             if (selected == tempCity.Name)
             {
                 desc = tempCity.Information;
             }
         }
         if (go.LeftClick() && !TravelMenu.travelling)
         {
             if (TravelMenu.StartTravel(selected))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
コード例 #3
0
 private void UpdateTravelMenu(GameTime gameTime)
 {
     if (TravelMenu.Update(gameTime))
     {
         Player.Location = TravelMenu.Destination;
         ChangeGameState(GameState.CityMenu);
     }
     if (TravelMenu.CheckInvbutton())
     {
         ChangeGameState(GameState.InventoryMenu);
     }
     if (TravelMenu.CheckMapButton())
     {
         ChangeGameState(GameState.MapMenu);
     }
 }
コード例 #4
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            TextureManager.LoadContent(Content);
            ItemCreator.LoadItemData();
            SoundManager.LoadSounds(Content);
            SoundManager.PlayMusic();
            SoundManager.PlayPauseMusic();
            AchievementManager.CreateAchievements();
            Player.Init();
            MainMenuManager.Init();
            OptionsMenu.Init();
            CityManager.Initialize();
            TravelMenu.Init();
            WorldEventManager.Init();
            EventLog.Init();
            WorldMapMenu.LoadCities();
            EncounterManager.Initialize();
            CityInfoMenu.Init();
            CharCreationMenu.Init();
            SkillManager.Init();

            ModifierManager.LoadCityAndCategoryLists();
            ModifierManager.LoadItemModifiers();
            Calendar.PrepareCalendar();

            cityMenu = new CityMenu();
            playerInventoryModule = new PlayerInventoryModule();

            previousGameState2 = GameState.Debug;
            previousGameState  = GameState.Debug;
            gameState          = GameState.MainMenu;

            options   = false;
            activeInv = new Inventory(100);
            random    = new Random();

            CityControlList = new List <string>();
            CityControlList.Add("Carrot Town");
            CityControlList.Add("Cloudspire");
        }
コード例 #5
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin();

            if (gameState != GameState.MainMenu && !TravelMenu.travelling)
            {
                DrawBackground(spriteBatch);
            }


            if (gameState == GameState.CityMenu)
            {
                cityMenu.Draw(spriteBatch, WorldMapMenu.Cities);
            }
            else if (gameState == GameState.MapMenu)
            {
                WorldMapMenu.Draw(spriteBatch);
            }
            else if (gameState == GameState.TradeMenu)
            {
                Trading.Draw(spriteBatch);
            }
            else if (gameState == GameState.InventoryMenu)
            {
                playerInventoryModule.Draw(spriteBatch);
            }
            else if (gameState == GameState.TravelMenu)
            {
                TravelMenu.Draw(spriteBatch);
            }
            else if (gameState == GameState.MainMenu)
            {
                MainMenuManager.Draw(spriteBatch);
            }
            else if (gameState == GameState.CharacterCreationMenu)
            {
                CharCreationMenu.Draw(spriteBatch);
            }
            else if (gameState == GameState.Debug)
            {
                spriteBatch.DrawString(TextureManager.font32, "Press F1 for City Menu, F2 for Map Menu, F3 for Inv. Menu,\nF4 for Trading Menu or F5 for Travelling Menu \nand you can always press F6 to return here\nF11 loads and F12 saves", new Vector2(200, 200), Color.White);
            }
            if (gameState != GameState.MainMenu && gameState != GameState.InventoryMenu)
            {
                Calendar.Draw(spriteBatch);
            }

            CityInfoMenu.Draw(spriteBatch);

            if (eventLog)
            {
                EventLog.Draw(spriteBatch);
            }

            OptionsMenu.Draw(spriteBatch, options);

            EndCredits.Draw(spriteBatch); //////////////////////////////
            LevelUp.Draw(spriteBatch);    /////////////////////////////////
            spriteBatch.End();

            //Window.Title = "Press F6 for debug menu          " + Player.SkillLevels[0].ToString() + Player.SkillLevels[1].ToString() + Player.SkillLevels[2].ToString() + "    " + OptionsMenu.selectedSkill;
            Window.Title = "Project Travelling Merchant";
            //if (test)
            //{
            //    Window.Title = "WAAAAR";
            //}


            base.Draw(gameTime);
        }