Fix minimap
This commit is contained in:
@@ -227,6 +227,14 @@ public partial class Game : Node3D, IGame
|
|||||||
|
|
||||||
public void FloorExitReached() => GameState.Input(new GameState.Input.FloorExitEntered());
|
public void FloorExitReached() => GameState.Input(new GameState.Input.FloorExitEntered());
|
||||||
|
|
||||||
|
public void ShowMinimap(bool isVisible)
|
||||||
|
{
|
||||||
|
if (_map.CurrentFloor is SpecialFloor)
|
||||||
|
InGameUI.ShowMinimap(false);
|
||||||
|
else
|
||||||
|
InGameUI.ShowMinimap(true);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task UseItem(IBaseInventoryItem item)
|
public async Task UseItem(IBaseInventoryItem item)
|
||||||
{
|
{
|
||||||
if (item.ItemTag == ItemTag.MysteryItem)
|
if (item.ItemTag == ItemTag.MysteryItem)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
namespace Zennysoft.Game.Ma;
|
namespace Zennysoft.Game.Ma;
|
||||||
|
|
||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.Collections;
|
|
||||||
using Chickensoft.GodotNodeInterfaces;
|
using Chickensoft.GodotNodeInterfaces;
|
||||||
using Chickensoft.SaveFileBuilder;
|
using Chickensoft.SaveFileBuilder;
|
||||||
using System;
|
using System;
|
||||||
@@ -31,6 +30,8 @@ public interface IGame : IProvide<IGame>, IProvide<IGameRepo>, IProvide<IPlayer>
|
|||||||
|
|
||||||
public void FloorExitReached();
|
public void FloorExitReached();
|
||||||
|
|
||||||
|
public void ShowMinimap(bool visible);
|
||||||
|
|
||||||
public void GameOver();
|
public void GameOver();
|
||||||
|
|
||||||
public Task Save();
|
public Task Save();
|
||||||
|
|||||||
@@ -110,6 +110,10 @@ public partial class Map : Node3D, IMap
|
|||||||
SetupDungeonFloor();
|
SetupDungeonFloor();
|
||||||
CurrentFloor.FloorIsLoaded = true;
|
CurrentFloor.FloorIsLoaded = true;
|
||||||
CurrentFloorNumber.OnNext(CurrentFloorNumber.Value + 1);
|
CurrentFloorNumber.OnNext(CurrentFloorNumber.Value + 1);
|
||||||
|
if (CurrentFloor is SpecialFloor)
|
||||||
|
Game.ShowMinimap(false);
|
||||||
|
else
|
||||||
|
Game.ShowMinimap(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<Node> LoadNewFloor(string sceneName)
|
private async Task<Node> LoadNewFloor(string sceneName)
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ public interface IInGameUI : IControl
|
|||||||
void CloseInventory();
|
void CloseInventory();
|
||||||
|
|
||||||
public void SetAffinity(ElementType elementType);
|
public void SetAffinity(ElementType elementType);
|
||||||
|
|
||||||
|
public void ShowMinimap(bool isVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Meta(typeof(IAutoNode))]
|
[Meta(typeof(IAutoNode))]
|
||||||
@@ -32,6 +34,8 @@ public partial class InGameUI : Control, IInGameUI
|
|||||||
|
|
||||||
[Node] public DebugInfo DebugInfo { get; set; } = default!;
|
[Node] public DebugInfo DebugInfo { get; set; } = default!;
|
||||||
|
|
||||||
|
[Node] public Minimap MiniMap { get; set; } = default!;
|
||||||
|
|
||||||
[Node] public TextureRect EolicImg { get; set; } = default!;
|
[Node] public TextureRect EolicImg { get; set; } = default!;
|
||||||
|
|
||||||
[Node] public TextureRect FerrumImg { get; set; } = default!;
|
[Node] public TextureRect FerrumImg { get; set; } = default!;
|
||||||
@@ -104,6 +108,11 @@ public partial class InGameUI : Control, IInGameUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ShowMinimap(bool isVisible)
|
||||||
|
{
|
||||||
|
MiniMap.Visible = isVisible;
|
||||||
|
}
|
||||||
|
|
||||||
public void CloseInventory()
|
public void CloseInventory()
|
||||||
{
|
{
|
||||||
InventoryMenu.Hide();
|
InventoryMenu.Hide();
|
||||||
|
|||||||
Reference in New Issue
Block a user