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

            MotifName   = info.GetAttribute("name", string.Empty);
            MotifAuthor = info.GetAttribute("author", string.Empty);

            var fontmap = new Dictionary <int, Font>();

            var spritesystem = GetSubSystem <SpriteSystem>();

            var fontpath1 = files.GetAttribute <string>("font1", null);

            if (fontpath1 != null)
            {
                fontmap[1] = spritesystem.LoadFont(fontpath1);
            }

            var fontpath2 = files.GetAttribute <string>("font2", null);

            if (fontpath2 != null)
            {
                fontmap[2] = spritesystem.LoadFont(fontpath2);
            }

            var fontpath3 = files.GetAttribute <string>("font3", null);

            if (fontpath3 != null)
            {
                fontmap[3] = spritesystem.LoadFont(fontpath3);
            }

            FontMap = new FontMap(fontmap);

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

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

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

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

            CombatScreen     = new CombatScreen(this);
            ReplayScreen     = new RecordedCombatScreen(this);
            StoryboardScreen = new StoryboardScreen(this);

            CurrentScreen = null;
            m_newscreen   = null;
            m_fade        = 0;
            m_fadespeed   = 0;
            m_eventqueue  = new Queue <Events.Base>();
        }
Beispiel #2
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>();
        }
Beispiel #3
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>();
        }