reorganizing code
parent
fe11421fc1
commit
ae5767e1fd
|
@ -16,10 +16,10 @@ namespace SupaLidlGame.Items
|
||||||
|
|
||||||
public int Count { get; set; } = 1;
|
public int Count { get; set; } = 1;
|
||||||
|
|
||||||
public Character CharacterOwner { get; set; }
|
|
||||||
|
|
||||||
public bool IsOneHanded { get; set; } = false;
|
public bool IsOneHanded { get; set; } = false;
|
||||||
|
|
||||||
|
public Character CharacterOwner { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if this item can directly stack with other items
|
/// Determines if this item can directly stack with other items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -48,12 +48,7 @@ namespace SupaLidlGame.Utils
|
||||||
|
|
||||||
public void LoadScene(PackedScene scene)
|
public void LoadScene(PackedScene scene)
|
||||||
{
|
{
|
||||||
if (CurrentMap is not null)
|
GD.Print("Loading map " + scene.ResourcePath);
|
||||||
{
|
|
||||||
CurrentMap.Entities.RemoveChild(CurrentPlayer);
|
|
||||||
RemoveChild(CurrentMap);
|
|
||||||
CurrentMap.Active = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map map;
|
Map map;
|
||||||
if (_maps.ContainsKey(scene.ResourcePath))
|
if (_maps.ContainsKey(scene.ResourcePath))
|
||||||
|
@ -66,11 +61,17 @@ namespace SupaLidlGame.Utils
|
||||||
_maps.Add(scene.ResourcePath, map);
|
_maps.Add(scene.ResourcePath, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
GD.Print("Loading " + scene.ResourcePath);
|
if (CurrentMap is not null)
|
||||||
|
{
|
||||||
|
CurrentMap.Entities.RemoveChild(CurrentPlayer);
|
||||||
|
RemoveChild(CurrentMap);
|
||||||
|
CurrentMap.Active = false;
|
||||||
|
}
|
||||||
|
|
||||||
CurrentMap = map;
|
|
||||||
AddChild(map);
|
AddChild(map);
|
||||||
InitTilemap(map);
|
InitTilemap(map);
|
||||||
|
|
||||||
|
CurrentMap = map;
|
||||||
CurrentMap.Active = true;
|
CurrentMap.Active = true;
|
||||||
|
|
||||||
if (CurrentPlayer is not null)
|
if (CurrentPlayer is not null)
|
||||||
|
|
Loading…
Reference in New Issue