public SelectData(SelectScreen selectscreen, Input.ButtonMap buttonmap, TextSection textsection, String prefix, Boolean moveoverempty) { if (selectscreen == null) throw new ArgumentNullException("selectscreen"); if (buttonmap == null) throw new ArgumentNullException("buttonmap"); if (textsection == null) throw new ArgumentNullException("textsection"); if (prefix == null) throw new ArgumentNullException("prefix"); m_selectscreen = selectscreen; m_buttonmap = buttonmap; m_moveoverempty = moveoverempty; m_elements = new Elements.Collection(SelectScreen.SpriteManager, SelectScreen.AnimationManager, SelectScreen.SoundManager, SelectScreen.MenuSystem.FontMap); m_elements.Build("cursor.active", textsection, prefix + ".cursor.active"); m_elements.Build("cursor.done", textsection, prefix + ".cursor.done"); m_elements.Build("cursor.move", textsection, prefix + ".cursor.move"); m_elements.Build("random.move", textsection, prefix + ".random.move"); m_elements.Build("player.face", textsection, prefix + ".face"); m_elements.Build("player.name", textsection, prefix + ".name"); m_startcell = textsection.GetAttribute<Point>(prefix + ".cursor.startcell"); // X & Y seem to be reversed for this m_startcell = new Point(m_startcell.Y, m_startcell.X); Reset(); }
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>(); }
private void load(SeeSharpStorage storage) { var basePath = storage.GetFullPath(string.Empty); var pageStorage = storage.GetStorageForDirectory("pages"); _pagesPath = pageStorage.GetFullPath(string.Empty); var syncManager = new SyncManager(basePath, _pagesPath, _state); var selectScreen = new SelectScreen(_state) { Save = () => { syncManager.Save(); } }; Add(new ScreenStack(selectScreen) { RelativeSizeAxes = Axes.Both, }); }