Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions TravelOptions/Scripts/TravelOptionsMapWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -513,20 +513,23 @@ protected override void ClickHandler(BaseScreenComponent sender, Vector2 positio
if (position.x < 0 || position.x > regionTextureOverlayPanelRect.width || position.y < 0 || position.y > regionTextureOverlayPanelRect.height)
return;

if (popUp == null)
if (popUp == null || (popUp as TravelOptionsPopUp == null)) //the second check ensures travelling outside of locations still works when another mod replaces the travel popup
{
popUp = (DaggerfallTravelPopUp)UIWindowFactory.GetInstanceWithArgs(UIWindowType.TravelPopUp, new object[] { uiManager, uiManager.TopWindow, this });
//popUp = (DaggerfallTravelPopUp)UIWindowFactory.GetInstanceWithArgs(UIWindowType.TravelPopUp, new object[] { uiManager, uiManager.TopWindow, this });
popUp = new TravelOptionsPopUp(uiManager, uiManager.TopWindow, this);
}
((TravelOptionsPopUp)popUp).EndPos = GetClickMPCoords();
uiManager.PushWindow(popUp);
popUp = null; //ensures the next travel popup will be created from scratch so that if another mod has replaced it, TO's popup ONLY appears during non-location travel
}
else
{
base.ClickHandler(sender, position);
}
// Set scale factors into popup, except when teleport travelling
if (popUp != null && !teleportationTravel)
((TravelOptionsPopUp)popUp).SetScaleFactors(TravelOptionsMod.Instance.FastTravelCostScaleFactor, TravelOptionsMod.Instance.ShipTravelCostScaleFactor);
if(popUp as TravelOptionsPopUp != null) //ensures the map doesn't break when another mod has replaced the travel popup
((TravelOptionsPopUp)popUp).SetScaleFactors(TravelOptionsMod.Instance.FastTravelCostScaleFactor, TravelOptionsMod.Instance.ShipTravelCostScaleFactor);
}

protected void MarkLocationHandler(BaseScreenComponent sender, Vector2 position)
Expand Down