예제 #1
0
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen(YellokillerGame game)
            : base(Langue.tr("MainMenuTitle"))
        {
            this.game = game;

            // Create our menu entries.
            soloMenuEntry = new MenuEntry(Langue.tr("MainMenuSolo"));
            coopMenuEntry = new MenuEntry(Langue.tr("MainMenuCoop"));
            editorMenuEntry = new MenuEntry(Langue.tr("MainMenuEditor"));
            optionsMenuEntry = new MenuEntry(Langue.tr("Options"));
            scoresMenuEntry = new MenuEntry(Langue.tr("Scores"));
            helpMenuEntry = new MenuEntry(Langue.tr("Help"));
            exitMenuEntry = new MenuEntry(Langue.tr("MainMenuQuit"));

            // Hook up menu event handlers.
            soloMenuEntry.Selected += SoloMenuEntrySelected;
            coopMenuEntry.Selected += CoopMenuEntrySelected;
            editorMenuEntry.Selected += EditorMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            scoresMenuEntry.Selected += ScoresMenuEntrySelected;
            helpMenuEntry.Selected += HelpMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(soloMenuEntry);
            MenuEntries.Add(coopMenuEntry);
            MenuEntries.Add(editorMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(scoresMenuEntry);
            MenuEntries.Add(helpMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }
예제 #2
0
        public Presets(YellokillerGame game)
            : base(Langue.tr("Presets"))
        {
            this.game = game;

            F1 = new MenuEntry(Langue.tr("F1"));
            F2 = new MenuEntry(Langue.tr("F2"));
            F3 = new MenuEntry(Langue.tr("F3"));
            F4 = new MenuEntry(Langue.tr("F4"));
            F5 = new MenuEntry(Langue.tr("F5"));
            F6 = new MenuEntry(Langue.tr("F6"));
            F7 = new MenuEntry(Langue.tr("F7"));
            F8 = new MenuEntry(Langue.tr("F8"));
        }
예제 #3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public PauseMenuScreen(int comingfrom, int mode, YellokillerGame game)
            : base(Langue.tr("PauseTitle"))
        {
            this.game = game;
            //Conserve la sélection
            selectedEntry = comingfrom;

            mod = mode;
            lan = Properties.Settings.Default.Language;

            // Create our menu entries.
            optionsGameMenuEntry = new MenuEntry(Langue.tr("Options"));

            if (mode == 2)
            {
                resumeGameMenuEntry = new MenuEntry(Langue.tr("PausEditRes"));
                quitGameMenuEntry = new MenuEntry(Langue.tr("PausEditQuit"));
            }
            else
            {
                resumeGameMenuEntry = new MenuEntry(Langue.tr("PausGameRes"));
                quitGameMenuEntry = new MenuEntry(Langue.tr("PausGameQuit"));
            }

            // Hook up menu event handlers.
            resumeGameMenuEntry.Selected += OnCancel;
            optionsGameMenuEntry.Selected += OptionsMenuEntrySelected;
            quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;

            // Add entries to the menu.
            MenuEntries.Add(resumeGameMenuEntry);

            if (mode == 2)
            {
                saveMapMenuEntry = new MenuEntry(Langue.tr("PausEditSave"));
                loadMapMenuEntry = new MenuEntry(Langue.tr("PausEditLoad"));
                deleteMapMenuEntry = new MenuEntry(Langue.tr("PausEditDel"));
                presetsMenuEntry = new MenuEntry(Langue.tr("Presets"));
                loadMapMenuEntry.Selected += LoadMapMenuEntrySelected;
                deleteMapMenuEntry.Selected += DeleteMapMenuEntrySelected;
                presetsMenuEntry.Selected += PresetsMapMenuEntrySelected;
                MenuEntries.Add(loadMapMenuEntry);
            }

            if (mode != 2)
            {
                MenuEntries.Add(optionsGameMenuEntry);
                MenuEntries.Add(quitGameMenuEntry);
            }
        }
예제 #4
0
        public DelMapMenuScreen(YellokillerGame game)
            : base(Langue.tr("PausEditLoad"))
        {
            this.game = game;
            try
            {
                string[] fileEntries = LoadMapMenuScreen.ConcatenerTableaux(Directory.GetFiles(System.Windows.Forms.Application.StartupPath + "\\Levels", "*.solo"), Directory.GetFiles(System.Windows.Forms.Application.StartupPath + "\\Levels", "*.coop"));

                foreach (string str in fileEntries)
                {
                    MenuEntry menuEntry = new MenuEntry(str.Substring(str.LastIndexOf('\\') + 1));
                    menuEntry.Selected += MenuEntrySelected;
                    MenuEntries.Add(menuEntry);
                }
            }
            catch (DirectoryNotFoundException)
            {
            }
        }
예제 #5
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public OptionsMenuScreen(int mode, YellokillerGame game)
            : base(Langue.tr("Options"))
        {
            this.game = game;
            // Fetches Settings.
            currentLanguage = Properties.Settings.Default.Language;
            fullScreen = Properties.Settings.Default.FullScreen;
            ToggleOK = true;

            // soundVolume = (uint)(MediaPlayer.Volume * 10);
            soundVolume = Properties.Settings.Default.MusicVolume;
            fxVolume = Properties.Settings.Default.FXVolume;

            mod = mode;

            // Create our menu entries.
            languageMenuEntry = new MenuEntry(string.Empty);
            fullScreenMenuEntry = new MenuEntry(string.Empty);
            soundVolumeMenuEntry = new MenuEntry(string.Empty);
            fxVolumeMenuEntry = new MenuEntry(string.Empty);
            eraseMenuEntry = new MenuEntry(string.Empty);
            backMenuEntry = new MenuEntry(string.Empty);

            SetMenuEntryText();

            // Hook up menu event handlers.
            languageMenuEntry.Selected += LanguageMenuEntrySelected;

            fullScreenMenuEntry.Selected += FullScreenMenuEntrySelected;

            eraseMenuEntry.Selected += EraseMenuEntrySelected;
            backMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(languageMenuEntry);
            MenuEntries.Add(fullScreenMenuEntry);
            MenuEntries.Add(soundVolumeMenuEntry);
            MenuEntries.Add(fxVolumeMenuEntry);
            MenuEntries.Add(eraseMenuEntry);
            MenuEntries.Add(backMenuEntry);
        }
예제 #6
0
        public GameOverScreen(string comingfrom, YellokillerGame game, uint retries)
        {
            this.retries = retries + 1;
            this.game = game;
            this.comingfrom = comingfrom;
            GOmessage = Langue.tr("GOMsg");

            //Durée de la transition.
            TransitionOnTime = TimeSpan.FromSeconds(1.2);
            TransitionOffTime = TimeSpan.FromSeconds(1.2);

            // Create our menu entries.
            restartMenuEntry = new MenuEntry(Langue.tr("GORetry"));
            chkpointMenuEntry = new MenuEntry(Langue.tr("GOchk"));
            abortMenuEntry = new MenuEntry(Langue.tr("GOAbort"));

            // Hook up menu event handlers.
            restartMenuEntry.Selected += RestartMenuEntrySelected;
            abortMenuEntry.Selected += AbortMenuEntrySelected;

            // Add entries to the menu.
            menuEntries.Add(restartMenuEntry);
        }
예제 #7
0
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public LevelSelectSolo(YellokillerGame game)
        {
            bool[] unlocked;
            List<string> storyMissions;
            List<string> fileEntries;

            this.game = game;

            storyMissions = new List<string>();
            fileEntries = new List<string>();
            foreach (string file in Directory.GetFiles(System.Windows.Forms.Application.StartupPath + "\\Story", "*.solo"))
            {
                storyMissions.Add(file);
                fileEntries.Add(file);
            }
            try
            {
                foreach (string file in Directory.GetFiles(System.Windows.Forms.Application.StartupPath + "\\Levels", "*.solo"))
                    fileEntries.Add(file);
            }
            catch (DirectoryNotFoundException)
            {

            }

            unlocked = new bool[6];
            unlocked[0] = Properties.Unlocked.Default.S1;
            unlocked[1] = Properties.Unlocked.Default.S2;
            unlocked[2] = Properties.Unlocked.Default.S3;
            unlocked[3] = Properties.Unlocked.Default.S4;
            unlocked[4] = Properties.Unlocked.Default.S5;
            unlocked[5] = Properties.Unlocked.Default.S6;

            foreach (string str in fileEntries)
            {
                string entryName = str.Substring(str.LastIndexOf('\\') + 1);

                Carte map = new Carte(new Vector2(Taille_Map.LARGEUR_MAP, Taille_Map.HAUTEUR_MAP));
                map.OuvrirCartePourMenu(entryName);
                miniCartes.Add(map);

                entryName = entryName.Substring(0, entryName.LastIndexOf('.'));
                MenuEntry menuEntry = new MenuEntry(entryName);

                if (storyMissions.Contains(str))
                    menuEntry.IsLocked = !unlocked[(int.Parse(entryName[0].ToString())) - 1];

                menuEntry.Selected += LevelMenuEntrySelected;
                levels.Add(menuEntry);

            }
            //Durée de la transition.
            TransitionOnTime = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            // Create our menu entries.
            abortMenuEntry = new MenuEntry(Langue.tr("BckToMenu"));

            // Hook up menu event handlers.
            abortMenuEntry.Selected += AbortMenuEntrySelected;

            // Add entries to the menu.
            levels.Add(abortMenuEntry);

            maxpage = (levels.Count - 2) / 8;
        }
예제 #8
0
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public GameWin(string comingfrom, uint salaire, double levelTime, uint deaths, uint retries, YellokillerGame game)
        {
            this.game = game;
            this.comingfrom = comingfrom;
            this.salaire = salaire;
            this.deaths = deaths;
            this.restart = retries;

            temps = levelTime;

            baseSalary = Langue.tr("BaseSalary") + salaire;
            penalties = Langue.tr("Penalties");
            WinMessage = Langue.tr("WinMsg");
            time = Langue.tr("Time") + Temps.Conversion(levelTime) + " --> " + (int)(-levelTime * 100);
            killed = Langue.tr("Killed") + deaths + " x 1 000 --> " + (-deaths * 1000);
            this.retries = Langue.tr("Retries") + retries + " x 10 000 --> " + (-retries * 10000);

            this.salaire -= (deaths * 1000) + (uint)(levelTime * 100) + (retries * 10000);
            if (this.salaire < 0)
                this.salaire = 0;
            score = Langue.tr("Score") + this.salaire;

            string[] fileEntries;

            try
            {
                fileEntries = LoadMapMenuScreen.ConcatenerTableaux(Directory.GetFiles(System.Windows.Forms.Application.StartupPath + "\\Story", "*." + comingfrom.Substring(comingfrom.Length - 4)), Directory.GetFiles(System.Windows.Forms.Application.StartupPath + "\\Levels", "*." + comingfrom.Substring(comingfrom.Length - 4)));
            }
            catch (DirectoryNotFoundException)
            {
                fileEntries = Directory.GetFiles(System.Windows.Forms.Application.StartupPath + "\\Story", "*." + comingfrom.Substring(comingfrom.Length - 4));
            }

            foreach (string str in Directory.GetFiles(System.Windows.Forms.Application.StartupPath + "\\Story"))
            {
                if (str.Substring(str.LastIndexOf('\\') + 1) == comingfrom)
                {
                    switch (comingfrom.Substring(comingfrom.Length - 4))
                    {
                        case ("solo"):
                            switch (comingfrom.Substring(comingfrom.LastIndexOf('\\') + 1)[0])
                            {
                                case ('1'):
                                    Properties.Unlocked.Default.S2 = true;
                                    break;
                                case ('2'):
                                    Properties.Unlocked.Default.S3 = true;
                                    break;
                                case ('3'):
                                    Properties.Unlocked.Default.S4 = true;
                                    break;
                                case ('4'):
                                    Properties.Unlocked.Default.S5 = true;
                                    break;
                                case ('5'):
                                    Properties.Unlocked.Default.S6 = true;
                                    break;
                            }
                            break;
                        case ("coop"):
                            switch (comingfrom.Substring(comingfrom.LastIndexOf('\\') + 1)[0])
                            {
                                case ('1'):
                                    Properties.Unlocked.Default.C2 = true;
                                    break;
                                case ('2'):
                                    Properties.Unlocked.Default.C3 = true;
                                    break;
                                case ('3'):
                                    Properties.Unlocked.Default.C4 = true;
                                    break;
                                case ('4'):
                                    Properties.Unlocked.Default.C5 = true;
                                    break;
                                case ('5'):
                                    Properties.Unlocked.Default.C6 = true;
                                    break;
                            }
                            break;
                    }
                    Properties.Unlocked.Default.Save();
                }
            }

            for (int i = 0; i < fileEntries.Length; i++)
            {
                if (fileEntries[i].Substring(fileEntries[i].LastIndexOf('\\') + 1) == comingfrom)
                {
                    if (i + 1 == fileEntries.Length)
                        next = fileEntries[0].Substring(fileEntries[0].LastIndexOf('\\') + 1);
                    else
                        next = fileEntries[i + 1].Substring(fileEntries[i + 1].LastIndexOf('\\') + 1);
                    break;
                }
            }

            //Durée de la transition.
            TransitionOnTime = TimeSpan.FromSeconds(1.2);
            TransitionOffTime = TimeSpan.FromSeconds(1.2);

            // Create our menu entries.
            nextMenuEntry = new MenuEntry(Langue.tr("WiNext"));
            restartMenuEntry = new MenuEntry(Langue.tr("WiRetry"));
            abortMenuEntry = new MenuEntry(Langue.tr("BckToMenu"));

            // Hook up menu event handlers.
            nextMenuEntry.Selected += NextMenuEntrySelected;
            restartMenuEntry.Selected += RestartMenuEntrySelected;
            abortMenuEntry.Selected += AbortMenuEntrySelected;

            // Add entries to the menu.
            menuEntries.Add(nextMenuEntry);
            menuEntries.Add(restartMenuEntry);
            menuEntries.Add(abortMenuEntry);

            if (this.salaire > S.Default.Score_10)
            {
                HiScore = true;
            }
        }