public override void Begin() { base.Begin(); // add on-screen elements like GameLoader/OverworldLoader Add(new HudRenderer()); Add(snow); RendererList.UpdateLists(); // register the routine Entity entity = new Entity(); entity.Add(new Coroutine(Routine())); Add(entity); // run the update check task asynchronously new Task(() => { // display "checking for updates" message, in case the async task is not done yet. modUpdatingMessage = Dialog.Clean("AUTOUPDATECHECKER_CHECKING"); SortedDictionary <ModUpdateInfo, EverestModuleMetadata> updateList = ModUpdaterHelper.GetAsyncLoadedModUpdates(); if (updateList == null || updateList.Count == 0) { // no mod update, clear message and continue right away. modUpdatingMessage = null; shouldContinue = true; } else { // install mod updates autoUpdate(updateList); } }).Start(); }
public override void End() { orig_End(); Remove(Snow); RendererList.UpdateLists(); Snow = null; }
public override void End() { orig_End(); if (!EnteringPico8) { Remove(Snow); RendererList.UpdateLists(); Snow = null; } }
public FactoryIntroVignette(Session session, HiresSnow snow = null) { this.session = session; areaMusic = session.Audio.Music.Event; session.Audio.Music.Event = null; session.Audio.Apply(forceSixteenthNoteHack: false); Add(hud = new HudRenderer()); RendererList.UpdateLists(); textbox = new Textbox("KaydenFox_FactoryMod_1_Factory_A_Intro"); textCoroutine = new Coroutine(TextSequence()); }
public Emulator(Scene returnTo, int levelX = 0, int levelY = 0) { ReturnTo = returnTo; bootLevel = new Point(levelX, levelY); buffer = VirtualContent.CreateRenderTarget("pico-8", 128, 128); // sprites var atlas = GFX.Game["pico8/atlas"]; sprites = new MTexture[(atlas.Width / 8) * (atlas.Height / 8)]; for (int ty = 0; ty < atlas.Height / 8; ty++) { for (int tx = 0; tx < atlas.Width / 8; tx++) { sprites[tx + ty * (atlas.Width / 8)] = atlas.GetSubtexture(tx * 8, ty * 8, 8, 8); } } // tilemap var tiledata = MapData; tiledata = Regex.Replace(tiledata, @"\s+", ""); tilemap = new byte[tiledata.Length / 2]; for (int i = 0, len = tiledata.Length, hlen = len / 2; i < len; i += 2) { var a = tiledata[i]; var b = tiledata[i + 1]; var str = (i < hlen ? (a.ToString() + b.ToString()) : (b.ToString() + a.ToString())); tilemap[i / 2] = (byte)int.Parse(str, System.Globalization.NumberStyles.HexNumber); } // font var fontatlas = GFX.Game["pico8/font"]; font = new MTexture[(fontatlas.Width / 4) * (fontatlas.Height / 6)]; for (var ty = 0; ty < fontatlas.Height / 6; ty++) { for (var tx = 0; tx < fontatlas.Width / 4; tx++) { font[tx + ty * (fontatlas.Width / 4)] = fontatlas.GetSubtexture(tx * 4, ty * 6, 4, 6); } } // boot stuff picoBootLogo = GFX.Game["pico8/logo"]; ResetScreen(); Audio.SetMusic(null); Audio.SetAmbience(null); new FadeWipe(this, true); RendererList.UpdateLists(); }
public override void Begin() { base.Begin(); Everest.Loader.AutoLoadNewMods = false; // add on-screen elements like GameLoader/OverworldLoader Add(new HudRenderer()); Add(snow); RendererList.UpdateLists(); // register the routine Entity entity = new Entity(); entity.Add(new Coroutine(Routine())); Add(entity); }
public CustomTextVignette(Session session, string text, HiresSnow snow = null) { this.session = session; areaMusic = session.Audio.Music.Event; session.Audio.Music.Event = null; session.Audio.Apply(); sfx = Audio.Play(SFX.music_prologue_intro_vignette); if (snow == null) { fade = 1f; snow = new HiresSnow(); } Add(renderer = new HudRenderer()); Add(this.snow = snow); RendererList.UpdateLists(); this.text = FancyText.Parse(Dialog.Get(text), 960, 8, 0f); textCoroutine = new Coroutine(TextSequence()); }
public override void Begin() { base.Begin(); targetSID = CollabModule.Instance.Session.LobbySID; targetRoom = CollabModule.Instance.Session.LobbyRoom; targetSpawnPoint = new Vector2(CollabModule.Instance.Session.LobbySpawnPointX, CollabModule.Instance.Session.LobbySpawnPointY); CollabModule.Instance.Session.LobbySID = null; CollabModule.Instance.Session.LobbyRoom = null; CollabModule.Instance.Session.LobbySpawnPointX = 0; CollabModule.Instance.Session.LobbySpawnPointY = 0; CollabModule.Instance.Session.SaveAndReturnToLobbyAllowed = false; SaveLoadIcon.Show(this); Entity coroutineHolder; Add(coroutineHolder = new Entity()); coroutineHolder.Add(new Coroutine(Routine())); Stats.Store(); RendererList.UpdateLists(); }
private void ReturnToMap() { StopSfx(); menu.RemoveSelf(); menu = null; exiting = true; bool toAreaQuit = SaveData.Instance.Areas[0].Modes[0].Completed && Celeste.PlayMode != Celeste.PlayModes.Event; new FadeWipe(this, false, delegate { if (toAreaQuit) { Engine.Scene = new OverworldLoader(Overworld.StartMode.AreaQuit, snow); } else { Engine.Scene = new OverworldLoader(Overworld.StartMode.Titlescreen, snow); } }).OnUpdate = (f) => textAlpha = Math.Min(textAlpha, 1f - f); RendererList.UpdateLists(); RendererList.MoveToFront(snow); }
public Emulator(int levelX = 0, int levelY = 0) { bootLevel = new Point(levelX, levelY); //buffer = VirtualContent.CreateRenderTarget("pico- //engine.RunWithLogging(); buffer = new RenderTarget2D(engine.GraphicsDevice, 128, 128); // sprites //var atlas = Atlas.FromDirectory("./Graphics/"); //var atlasTexture = atlas.Sources[0]; Console.WriteLine("loading atlas"); Texture2D atlasTexture; using (Stream titleStream = TitleContainer.OpenStream("./Graphics/atlas.png")) { atlasTexture = Texture2D.FromStream(engine.GraphicsDevice, titleStream); } //MTexture. //var atlas = GFX.Game["pico8/atlas"]; var spritesheight = 88; var spriteswidth = 128; sprites = new MTexture[(spriteswidth / 8) * (spritesheight / 8)]; for (int ty = 0; ty < spritesheight / 8; ty++) { for (int tx = 0; tx < spriteswidth / 8; tx++) { //sprites[tx + ty * (spriteswidth / 8)] = atlas.GetSubtexture(tx * 8, ty * 8, 8, 8); sprites[tx + ty * (spriteswidth / 8)] = new MTexture(Crop(atlasTexture, new Rectangle(tx * 8, ty * 8, 8, 8))); } } // tilemap var tiledata = MapData; tiledata = Regex.Replace(tiledata, @"\s+", ""); tilemap = new byte[tiledata.Length / 2]; for (int i = 0, len = tiledata.Length, hlen = len / 2; i < len; i += 2) { var a = tiledata[i]; var b = tiledata[i + 1]; var str = (i < hlen ? (a.ToString() + b.ToString()) : (b.ToString() + a.ToString())); tilemap[i / 2] = (byte)int.Parse(str, System.Globalization.NumberStyles.HexNumber); } // font //var fontatlas = Atlas.FromDirectory("./Graphics/font.png"); //var fontTexture = fontatlas.Sources[0]; Console.WriteLine("loading fonts"); Texture2D fontTexture; using (Stream titleStream = TitleContainer.OpenStream("./Graphics/font.png")) { fontTexture = Texture2D.FromStream(engine.GraphicsDevice, titleStream); } var fontwidth = 120; var fontheight = 12; font = new MTexture[(fontwidth / 4) * (fontheight / 6)]; for (var ty = 0; ty < fontheight / 6; ty++) { for (var tx = 0; tx < fontwidth / 4; tx++) { //font[tx + ty * (fontwidth / 4)] = fontatlas.GetSubtexture(tx * 4, ty * 6, 4, 6); font[tx + ty * (fontwidth / 4)] = new MTexture(Crop(fontTexture, new Rectangle(tx * 4, ty * 6, 4, 6))); } } // boot stuff //picoBootLogo = GFX.Game["pico8/logo"]; // TODO: maybe don't ignore this //ResetScreen(); //Audio.SetMusic(null); //Audio.SetAmbience(null); //new FadeWipe(this, true); RendererList.UpdateLists(); Console.WriteLine("all done"); }