Skip to content

Commit

Permalink
various
Browse files Browse the repository at this point in the history
allow alt map animation to play between maps
fix a bug where the alt map animation could play again after a map change
change version number
  • Loading branch information
Samuel J. Newsome committed Mar 19, 2022
1 parent c279028 commit 4040ef8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Assets/scripts/AltMapManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void Toggle(bool instant = false)
// setting "instant" to true just skips the animation and the sound
private IEnumerator Animation(bool enabled, bool instant = false)
{
doingAnimation = true;
doingAnimation = true && !instant;

if (!instant)
SFXPlayer.instance.Play(enabled ? "sfx_alt_activate" : "sfx_alt_deactivate");
Expand All @@ -49,7 +49,7 @@ private IEnumerator Animation(bool enabled, bool instant = false)
if (!instant) yield return new WaitForEndOfFrame();
}
}
doingAnimation = false;
if (!instant) doingAnimation = false;

altMapEnabled = enabled;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/scripts/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static class Input
}
public static class Meta
{
public const string VERSION = "alpha 1.1.dev";
public const string VERSION = "alpha 2.1";
public const string SAVE_HEADER = "spacegamesave";
}
}
Expand Down
3 changes: 1 addition & 2 deletions Assets/scripts/MapManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ public static void ChangeMap(string name, int transferPoint = 0, Action<AsyncOpe
if (Player.instance != null)
foreach (Follower f in Player.followers)
f.transform.position = Player.instance.transform.position;
// toggle alt map if it's enabled and stop the animation from playing between map changes
AltMapManager.instance.StopAllCoroutines();
// toggle alt map if it's enabled
if (AltMapManager.instance.altMapEnabled)
AltMapManager.instance.Toggle(true);
// and we aren't changing map anymore, so this can go back to being false
Expand Down

0 comments on commit 4040ef8

Please sign in to comment.