예제 #1
0
파일: SMenu.cs 프로젝트: pampersrocker/STAR
        public SMenu(IServiceProvider ServiceProvider)
        {
            content = new ContentManager(ServiceProvider);
            content.RootDirectory = "Data";

            current_pos = 0;
            custmapmenu = new CustMapMenu(ServiceProvider);
            menulists = new MenuList[4];
            cloudlayer = new Star.Game.Level.CloudLayer();
            string[] names;
            names = new string[5];
            names[0] = "Story";
            names[1] = "Custom Maps";
            names[2] = "Options";
            names[3] = "Credits";
            names[4] = "Quit";
            menulists[0] = new MenuList("Main Menu",names);
            menulists[0].ChangeButtonState(0, ButtonIndicator.Button_Hover);
            names = new string[3];
            names[0] = "Continue";
            names[1] = "Start New Story";
            names[2] = "Mission Selection";
            menulists[1] = new MenuList("Story", names);
            mainmenu = new MainMenu();
            optionsMenu = new OptionsMenu();
            pBackground = new PlayerBackground(ServiceProvider);
            oldMenuEffect = new TransitionEffect(Vector2.Zero, TransitionType.Translate);

            newMenueEffect = new TransitionEffect(Vector2.Zero, TransitionType.Translate);
        }
예제 #2
0
        public CustMapMenu(IServiceProvider ServiceProvider)
        {
            content = new ContentManager(ServiceProvider);
            content.RootDirectory = "Data";
            base.lists = new MenuList[2];
            ReScanFolder();
            //levels = new MenuList("Levels", level_names);
            string[] temp = new string[2];
            temp[0] = "Refresh";
            temp[1] = "Back";
            list = new MenuList("Custom Maps", temp);
            list.SetActiveButton(0);

            lists[0] = list;
        }
예제 #3
0
파일: Menu.cs 프로젝트: pampersrocker/STAR
 public void Initialize(IServiceProvider serviceProvider, GraphicsDevice graphics, MenuList[] menuLists)
 {
     content = new ContentManager(serviceProvider);
     content.RootDirectory = "Data";
     lists = menuLists;
     title_pos = Vector2.Zero;
     PresentationParameters pp = graphics.PresentationParameters;
     if (title_pos == Vector2.Zero)
     {
         title_pos = new Vector2(
             pp.BackBufferWidth / 20f,
             pp.BackBufferHeight / 20f);
     }
     InitializeMenu();
 }
예제 #4
0
파일: Menu.cs 프로젝트: pampersrocker/STAR
 public void Initialize(IServiceProvider ServiceProvider, string title, string[] new_buttons,Vector2 new_title_pos, GraphicsDevice graphics)
 {
     content = new ContentManager(ServiceProvider);
     content.RootDirectory = "Data";
     lists = new MenuList[1];
     lists[0] = new MenuList(title, new_buttons);
     title_pos = new_title_pos;
     PresentationParameters pp = graphics.PresentationParameters;
     if (title_pos == Vector2.Zero)
     {
         title_pos = new Vector2(
             pp.BackBufferWidth / 20f,
             pp.BackBufferHeight / 20f);
     }
     InitializeMenu();
 }
예제 #5
0
 public void ReScanFolder()
 {
     level_names = Directory.GetFiles("Data/Levels/CustomLevels/", "*.map");
     for (int i = 0; i < level_names.Length;i++)
     {
         level_names[i] = level_names[i].Replace("Data/Levels/CustomLevels/", "");
         level_names[i] = level_names[i].Replace(".map", "");
         level_names[i] = level_names[i].Trim();
     }
     levels = new MenuList("Levels", level_names,levels_rect.X +10,levels_rect.Y+10,0);
     lists[1] = levels;
 }
예제 #6
0
 public void Initialize(Options options)
 {
     levels_rect = new Rectangle((int)((options.ScreenWidth / 100.0f) * 20f / options.ScaleFactor), (int)((options.ScreenHeight / 100f) * 20f / options.ScaleFactor), (int)((options.ScreenWidth / 100f) * 78f / options.ScaleFactor), (int)((options.ScreenHeight / 100f) * 70f / options.ScaleFactor));
     levels = new MenuList("Levels", level_names, levels_rect.X + 10, levels_rect.Y + 10, 0);
     levelstex = content.Load<Texture2D>("Stuff/Blank");
     lists[1] = levels;
 }
예제 #7
0
파일: SMenu.cs 프로젝트: pampersrocker/STAR
 public void Initialize(Options options, GraphicsDevice graphics)
 {
     camera = new Camera(options.ScreenWidth, options.ScreenHeight, new Vector2(options.ScreenWidth / 2, options.ScreenHeight / 2), options.ScaleFactor);
     this.options = options;
     optionsMenu.Options = options;
     optionsMenu.Initialize(content.ServiceProvider, graphics, new MenuList[1]);
     MenuList[] mainmenuList = new MenuList[1];
     string[] names = new string[5];
     names[0] = "Story";
     names[1] = "Custom Maps";
     names[2] = "Options";
     names[3] = "Credits";
     names[4] = "Quit";
     mainmenuList[0] = new MenuList("S.T.A.R.", names);
     mainmenuList[0].ChangeButtonState(0, ButtonIndicator.Button_Locked);
     mainmenuList[0].SetActiveButton(0);
     font = content.Load<SpriteFont>("Stuff/Arial");
     background = content.Load<Texture2D>("Img/Menu/StdBG");
     //bgrect = new Rectangle(0, 0, options.ScreenWidth, options.ScreenHeight);
     int height = (int)(((float)options.ScreenWidth / background.Width) * background.Height);
     if (height >= options.ScreenHeight)
     {
         bgrect = new Rectangle(0, options.ScreenHeight - height, options.ScreenWidth, height);
     }
     else
     {
         int width = (int)(((float)options.ScreenHeight / background.Height) * background.Width);
         bgrect = new Rectangle(options.ScreenWidth - width, 0, width, options.ScreenHeight);
     }
     screenWidth = options.ScreenWidth;
     screenHeight = options.ScreenHeight;
     options.InitObjectHolder.dataHolder.PutData(Layer.Data_Layer.NumLayerObjects.GetKey(),4);
     cloudlayer.Initialize(options, new LevelVariables());
     custmapmenu.Initialize(options);
     mainmenu.Initialize(content.ServiceProvider, graphics, mainmenuList);
     pBackground.Initialize(options);
 }