Skip to content

Commit

Permalink
Merge pull request #78 from swoolcock/swoolcock/disable-map-retry
Browse files Browse the repository at this point in the history
Disable retry when using the lobby map UI
  • Loading branch information
maddie480 authored Mar 4, 2023
2 parents 5719f80 + dc978ad commit f62e75e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Entities/LobbyMapWarp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public override void Added(Scene scene) {

private void onTalk(Player player) {
if (player.Scene is Level level) {
level.CanRetry = false;
if (level.Tracker.GetEntity<LobbyMapController>() is LobbyMapController lmc) {
lmc.VisitManager?.ActivateWarp(info.MarkerId);
}
Expand Down
6 changes: 6 additions & 0 deletions UI/LobbyMapUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public override void Added(Scene scene) {
openedWithRevealMap = CollabModule.Instance.SaveData.RevealMap;

if (scene is Level level && level.Tracker.GetEntity<Player>() is Player player) {
level.CanRetry = false;

var path = player.Inventory.Backpack ? "marker/runBackpack" : "marker/runNoBackpack";
Add(maddyRunSprite = new Sprite(MTN.Mountain, path));
maddyRunSprite.Justify = new Vector2(0.5f, 1f);
Expand All @@ -128,6 +130,10 @@ public override void Removed(Scene scene) {
renderTarget = null;
overlayTexture = null;
mapTexture = null;

if (scene is Level level) {
level.CanRetry = true;
}
}

public override void Update() {
Expand Down

0 comments on commit f62e75e

Please sign in to comment.