Example #1
0
        public MenuSystem(SubSystems subsystems)
            : base(subsystems)
        {
            TextFile textfile = GetSubSystem<IO.FileSystem>().OpenTextFile(@"data/system.def");
            TextSection info = textfile.GetSection("info");
            TextSection files = textfile.GetSection("files");

            m_motifname = info.GetAttribute<String>("name", String.Empty);
            m_motifauthor = info.GetAttribute<String>("author", String.Empty);

            Dictionary<Int32, Font> fontmap = new Dictionary<Int32, Font>();

            Drawing.SpriteSystem spritesystem = GetSubSystem<Drawing.SpriteSystem>();

            String fontpath1 = files.GetAttribute<String>("font1", null);
            if (fontpath1 != null) fontmap[1] = spritesystem.LoadFont(fontpath1);

            String fontpath2 = files.GetAttribute<String>("font2", null);
            if (fontpath2 != null) fontmap[2] = spritesystem.LoadFont(fontpath2);

            String fontpath3 = files.GetAttribute<String>("font3", null);
            if (fontpath3 != null) fontmap[3] = spritesystem.LoadFont(fontpath3);

            m_fontmap = new Drawing.FontMap(fontmap);

            String soundpath = @"data/" + files.GetAttribute<String>("snd");
            String spritepath = @"data/" + files.GetAttribute<String>("spr");
            String animpath = textfile.Filepath;

            m_titlescreen = new TitleScreen(this, textfile.GetSection("Title Info"), spritepath, animpath, soundpath);
            m_titlescreen.LoadBackgrounds("Title", textfile);

            m_versusscreen = new VersusScreen(this, textfile.GetSection("VS Screen"), spritepath, animpath, soundpath);
            m_versusscreen.LoadBackgrounds("Versus", textfile);

            m_selectscreen = new SelectScreen(this, textfile.GetSection("Select Info"), spritepath, animpath, soundpath);
            m_selectscreen.LoadBackgrounds("Select", textfile);

            m_combatscreen = new CombatScreen(this);
            m_replayscreen = new RecordedCombatScreen(this);

            m_currentscreen = null;
            m_newscreen = null;
            m_fade = 0;
            m_fadespeed = 0;
            m_eventqueue = new Queue<Events.Base>();
        }
Example #2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (TitleScreen != null)
                {
                    TitleScreen.Dispose();
                }

                if (VersusScreen != null)
                {
                    VersusScreen.Dispose();
                }

                SelectScreen?.Dispose();

                if (FontMap != null)
                {
                    FontMap.Dispose();
                }
            }

            base.Dispose(disposing);
        }