//Credits override update code private static void OverrideCreditsUpdate(On.Terraria.Main.orig_DoUpdate orig, Main self, GameTime gameTime) { SGAmod.lastTime = gameTime; if (Credits.CreditsManager.queuedCredits) { Credits.CreditsManager.RollCredits(); Credits.CreditsManager.queuedCredits = false; } if (CreditsManager.CreditsActive) { CreditsManager.UpdateCredits(gameTime); return; } orig(self, gameTime); /* * if (SGAmod.DrawCreditsMouseTooltip) * { * SpriteBatch sb = Main.spriteBatch; * sb.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Matrix.Identity); * Utils.DrawBorderString(sb, "SGAmod Credits", new Vector2(100,100), Color.White); * sb.End(); * //SGAmod.DrawCreditsMouseTooltip = false; * } */ }
private static void Main_DoUpdate(On.Terraria.Main.orig_DoUpdate orig, Terraria.Main self, GameTime gameTime) { orig(self, gameTime); // update cutscene Update(gameTime); }
private void UpdateRaceMenu(On.Terraria.Main.orig_DoUpdate orig, Terraria.Main self, GameTime gameTime) { if (raceMenuUI != null) { raceMenuUI.Update(gameTime); } orig(self, gameTime); }
private void WaitForWindowAvailible(On.Terraria.Main.orig_DoUpdate orig, Main self, GameTime gameTime) { orig(self, gameTime); if (IsFormActive(GameForm))//if form becomes active change icon and un-detour Main.DoUpdate { InvokeOnForm(WindowFormChanges); On.Terraria.Main.DoUpdate -= WaitForWindowAvailible; } }
private static void Main_DoUpdate(On.Terraria.Main.orig_DoUpdate orig, Terraria.Main self, GameTime gameTime) { orig(self, gameTime); if (_activeEvents != null) { // update cutscene Update(gameTime); } }
private static void Main_DoUpdate(On.Terraria.Main.orig_DoUpdate orig, Main self, ref GameTime gameTime) { foreach (NPC npc in TailGlobalNPC.RemovalQueue) { TailGlobalNPC.ActiveTailNpcsList.Remove(npc); } TailGlobalNPC.RemovalQueue.Clear(); foreach (KeyValuePair <NPC, TailInstance> pair in TailGlobalNPC.ActiveTailNpcsList) { if (!pair.Key.active) { pair.Value.Remove(); TailGlobalNPC.RemovalQueue.Add(pair.Key); } } orig(self, ref gameTime); }
private void Main_DoUpdate(On.Terraria.Main.orig_DoUpdate orig, Main self, GameTime gameTime) { GeneralHelpers.ClickHandling(); GeneralHelpers.UpdateButtons(); orig(self, gameTime); var aLoader = Ambience.Instance; Ambience.DoUpdate_Ambience(); Ambience.UpdateVolume(); if (Main.gameMenu) { return; } Player player = Main.player[Main.myPlayer]?.GetModPlayer <FootstepsPlayer>().player; // soundInstancer.Condition = player.ZoneSkyHeight; if (Main.hasFocus) { delta_lastPos_playerBottom = lastPlayerPositionOnGround - player.Bottom.Y; // Main.NewText(delta_lastPos_playerBottom); if (ModContent.GetInstance <AmbientConfigServer>().newSplashes) { if (player.velocity.Y <= 0 || player.teleporting) { lastPlayerPositionOnGround = player.Bottom.Y; } // Main.NewText(player.fallStart - player.Bottom.Y); if (delta_lastPos_playerBottom > -300) { Main.soundSplash[0] = Ambience.SplashNew; } else if (delta_lastPos_playerBottom <= -300) { Main.soundSplash[0] = GetSound($"{Ambience.AmbientPath}/environment/liquid/entity_splash_heavy"); } } } Ambience.ClampAll(); }