public static void Initialize(int screenwidth, int screenheight)
        {
            choosen_map_ = Editor.Next_map_;
            menus_       = new Dictionary <int, Dictionary <int, WTuple <string, Delegate> > >();
            titles_      = new Dictionary <int, string>();
            Dictionary <int, WTuple <string, Delegate> > actions1 = new Dictionary <int, WTuple <string, Delegate> >();
            int i    = 0;
            int rows = screenheight / 30 - 1;

            foreach (var entry in Maps.Maps_.OrderBy(entry => entry.Key))
            {
                if (entry.Key == choosen_map_)
                {
                    state_ = i;
                }
                actions1[i] = new WTuple <string, Delegate>(entry.Key, new Func <object>(ChooseMap));
                i++;
            }
            actions1[i] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[0]   = actions1;
            titles_[0]  = "CHOOSE THE NEXT MAP";
            max_height_ = screenheight - 20;
            max_width_  = screenwidth - (int)Textures.Font_.MeasureString(titles_[0]).X - 20;
            map_        = new MapEditor(actions1[state_].Item1_);
            ComputeSize();
            rows_ = screenheight / 30 - 1;
            SetState(state_);
        }
        public static void Initialize(int screenwidth, int screenheight)
        {
            menus_  = new Dictionary <int, Dictionary <int, WTuple <string, Delegate> > >();
            titles_ = new Dictionary <int, string>();
            Dictionary <int, WTuple <string, Delegate> > actions1 = new Dictionary <int, WTuple <string, Delegate> >();
            int rows = screenheight / 30 - 1;

            actions1[0] = new WTuple <string, Delegate>("Tutorial map: " + (Editor.Tutorial_ ? "Yes" : "No"), new Func <object>(ChooseTutorial));
            actions1[1] = new WTuple <string, Delegate>("Custom map: " + (Editor.Custom_ ? "Yes" : "No"), new Func <object>(ChooseCustom));
            actions1[2] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[0]   = actions1;
            titles_[0]  = "OPTIONS";
            max_height_ = screenheight - 20;
            max_width_  = screenwidth - (int)Textures.Font_.MeasureString(titles_[0]).X - 20;
            rows_       = screenheight / 30 - 1;
            SetState(state_);
        }
Example #3
0
        public static void InitializeMaps()
        {
            Dictionary <int, WTuple <String, Delegate> > actions4 = new Dictionary <int, WTuple <string, Delegate> >();
            int i = 0;

            if (Maps.Maps_.Where(map => map.Value.Tutorial_).Count() != 0)
            {
                actions4[i++] = new WTuple <string, Delegate>("Tutorial", new Func <object>(ChooseTutorial));
            }
            if (Maps.Maps_.Where(map => map.Value.Official_ && !map.Value.Tutorial_).Count() != 0)
            {
                actions4[i++] = new WTuple <string, Delegate>("Official maps", new Func <object>(ChooseOfficialMaps));
            }
            if (Maps.Maps_.Where(map => !map.Value.Official_).Count() != 0)
            {
                actions4[i++] = new WTuple <string, Delegate>("Custom maps", new Func <object>(ChooseCustomMaps));
            }
            actions4[i] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[3]   = actions4;
            titles_[3]  = "PLAY";
        }
Example #4
0
        public static void Initialize()
        {
            int screenwidth  = Drawer.Graphics_.PreferredBackBufferWidth;
            int screenheight = Drawer.Graphics_.PreferredBackBufferHeight;

            //gameplay_ = GamePlay.None;
            menus_  = new Dictionary <int, Dictionary <int, WTuple <string, Delegate> > >();
            titles_ = new Dictionary <int, string>();
            Dictionary <int, WTuple <string, Delegate> > actions1 = new Dictionary <int, WTuple <string, Delegate> >();

            actions1[0] = new WTuple <string, Delegate>("Editor", new Func <object>(ChooseEditor));
            actions1[1] = new WTuple <string, Delegate>("Play", new Func <object>(ChoosePlay));
            actions1[2] = new WTuple <string, Delegate>("Options", new Func <object>(ChooseOptions));
            actions1[3] = new WTuple <string, Delegate>("Quit", new Func <object>(ChooseQuit));
            menus_[0]   = actions1;
            titles_[0]  = "TITLE SCREEN";

            Dictionary <int, WTuple <String, Delegate> > actions2 = new Dictionary <int, WTuple <string, Delegate> >();

            actions2[0] = new WTuple <string, Delegate>("Quality: " + (Drawer.Hd_ ? "HIGH" : "LOW"), new Func <object>(ChooseQuality));
            actions2[1] = new WTuple <string, Delegate>("Full screen: OPTION DISABLED", new Func <object>(DoNothing));
            //actions2[1] = new WTuple<string, Delegate>("Full screen: " + (Drawer.Full_screen_ ? "ON" : "OFF"), new Func<object>(ChooseFullScreen));
            actions2[2] = new WTuple <string, Delegate>("Sounds: " + (GameHandler.Sounds_ ? "ON" : "OFF"), new Func <object>(ChooseSounds));
            actions2[3] = new WTuple <string, Delegate>("Delete best scores", new Func <object>(ChooseDeleteScores));
            //actions2[3] = new WTuple<string, Delegate>("Delete best scores (OPTION DISABLED)", new Func<object>(DoNothing));
            actions2[4] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[1]   = actions2;
            titles_[1]  = "OPTIONS";

            Dictionary <int, WTuple <String, Delegate> > actions3 = new Dictionary <int, WTuple <string, Delegate> >();

            actions3[0] = new WTuple <string, Delegate>("Width: " + width_, new Func <object>(ChooseWidth));
            actions3[1] = new WTuple <string, Delegate>("Height: " + height_, new Func <object>(ChooseHeight));
            actions3[2] = new WTuple <string, Delegate>("Done", new Func <object>(ChooseDone));
            actions3[3] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[2]   = actions3;
            titles_[2]  = "CREATE A NEW MAP";

            Dictionary <int, WTuple <String, Delegate> > actions4 = new Dictionary <int, WTuple <string, Delegate> >();
            int i = 0;

            if (Maps.Maps_.Where(map => map.Value.Tutorial_).Count() != 0)
            {
                actions4[i++] = new WTuple <string, Delegate>("Tutorial", new Func <object>(ChooseTutorial));
            }
            if (Maps.Maps_.Where(map => map.Value.Official_ && !map.Value.Tutorial_).Count() != 0)
            {
                actions4[i++] = new WTuple <string, Delegate>("Official maps", new Func <object>(ChooseOfficialMaps));
            }
            if (Maps.Maps_.Where(map => !map.Value.Official_).Count() != 0)
            {
                actions4[i++] = new WTuple <string, Delegate>("Custom maps", new Func <object>(ChooseCustomMaps));
            }
            actions4[i] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[3]   = actions4;
            titles_[3]  = "PLAY";

            Dictionary <int, WTuple <String, Delegate> > actions8 = new Dictionary <int, WTuple <string, Delegate> >();

            i = 0;
            foreach (var entry in Maps.GetNamesAndScores().OrderBy(entry => entry.Key).Where(entry => entry.Value.Item2))
            {
                actions8[i] = new WTuple <string, Delegate>(entry.Key + entry.Value.Item1, new Func <object>(ChooseMap));
                i++;
            }
            actions8[i] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[7]   = actions8;
            titles_[7]  = "TUTORIAL - CHOOSE A MAP"; /* Tutorial */

            Dictionary <int, WTuple <String, Delegate> > actions9 = new Dictionary <int, WTuple <string, Delegate> >();

            i = 0;
            foreach (var entry in Maps.GetNamesAndScores().OrderBy(entry => entry.Key).Where(entry => entry.Value.Item3 && !entry.Value.Item2))
            {
                actions9[i] = new WTuple <string, Delegate>(entry.Key + entry.Value.Item1, new Func <object>(ChooseMap));
                i++;
            }
            actions9[i] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[8]   = actions9;
            titles_[8]  = "OFFICIAL MAPS - CHOOSE A MAP"; /* Official maps */

            Dictionary <int, WTuple <String, Delegate> > actions10 = new Dictionary <int, WTuple <string, Delegate> >();

            i = 0;
            foreach (var entry in Maps.GetNamesAndScores().OrderBy(entry => entry.Key).Where(entry => !entry.Value.Item3))
            {
                actions10[i] = new WTuple <string, Delegate>(entry.Key + entry.Value.Item1, new Func <object>(ChooseMap));
                i++;
            }
            actions10[i] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[9]    = actions10;
            titles_[9]   = "CUSTOM MAPS - CHOOSE A MAP"; /* Custom maps */

            Dictionary <int, WTuple <String, Delegate> > actions5 = new Dictionary <int, WTuple <string, Delegate> >();

            i = 0;
            foreach (var entry in Maps.Maps_.OrderBy(entry => entry.Key))
            {
                if (entry.Value.Read_only_)
                {
                    continue;
                }
                actions5[i] = new WTuple <string, Delegate>(entry.Key, new Func <object>(ChooseMapEdit));
                i++;
            }
            actions5[i] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[4]   = actions5;
            titles_[4]  = "EDIT A EXISTING MAP";
            max_height_ = screenheight - 20;
            max_width_  = screenwidth - (int)Textures.Font_.MeasureString(titles_[4]).X - 20;
            map_        = new MapEditor(actions5[0].Item1_);
            ComputeSize();

            Dictionary <int, WTuple <String, Delegate> > actions6 = new Dictionary <int, WTuple <string, Delegate> >();

            actions6[0] = new WTuple <string, Delegate>("Create a new map", new Func <object>(ChooseNewMap));
            actions6[1] = new WTuple <string, Delegate>("Edit a existing map", new Func <object>(ChooseExistingMap));
            actions6[2] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[5]   = actions6;
            titles_[5]  = "EDITOR";

            Dictionary <int, WTuple <String, Delegate> > actions7 = new Dictionary <int, WTuple <string, Delegate> >();

            actions7[0] = new WTuple <string, Delegate>("Yes", new Func <object>(ChooseDeleteYes));
            actions7[1] = new WTuple <string, Delegate>("No", new Func <object>(ChooseBack));
            actions7[2] = new WTuple <string, Delegate>("Back", new Func <object>(ChooseBack));
            menus_[6]   = actions7;
            titles_[6]  = "DELETE BEST SCORES ?";

            /*state_ = 0;
             * menu_ = 0;*/
        }