Fullscreen Map View

New MapView class which shows a fullscreen map
This commit is contained in:
Reinier Vens 2020-12-02 21:12:25 +00:00
commit 88ae36d137
14 changed files with 361 additions and 26 deletions

View file

@ -15,8 +15,10 @@ public class ActionGameManager : MonoBehaviour
{
public GameSettings Settings;
public SectorRenderer SectorRenderer;
public MapView MapView;
public CinemachineVirtualCamera TopDownCamera;
public CinemachineVirtualCamera FollowCamera;
public GameObject GameplayUI;
//public PlayerInput Input;
private DirectoryInfo _filePath;
@ -55,6 +57,8 @@ public class ActionGameManager : MonoBehaviour
_input = new AetheriaInput();
_input.Player.Enable();
_input.Global.Enable();
_input.UI.Enable();
_zoomLevelIndex = Settings.DefaultMinimapZoom;
_input.Player.MinimapZoom.performed += context =>
@ -63,6 +67,22 @@ public class ActionGameManager : MonoBehaviour
SectorRenderer.MinimapDistance = Settings.MinimapZoomLevels[_zoomLevelIndex];
};
_input.Global.MapToggle.performed += context =>
{
MapView.enabled = !MapView.enabled;
GameplayUI.SetActive(!MapView.enabled);
if (MapView.enabled)
{
MapView.BindInput(_input.UI);
_input.Player.Disable();
}
else
{
_input.Player.Enable();
SectorRenderer.MinimapDistance = Settings.MinimapZoomLevels[_zoomLevelIndex];
}
};
ConsoleController.AddCommand("editmode", _ => ToggleEditMode());
ConsoleController.AddCommand("savezone", args =>
{