Map start system

This commit is contained in:
Marco 2025-02-21 11:39:22 +01:00
commit 7acc344986
11 changed files with 323 additions and 41 deletions

View file

@ -0,0 +1,11 @@
using Godot;
using Godot.Collections;
namespace Cirno.Scripts.Resources.DebugMenu;
[GlobalClass]
public partial class DebugMapSelectData : Resource
{
[Export]
public Array<DebugMenu.DebugMapSelectResource> Maps { get; private set; }
}

View file

@ -0,0 +1,35 @@
using Godot;
namespace Cirno.Scripts.Resources.DebugMenu;
[GlobalClass]
public partial class DebugMapSelectResource : Resource
{
[Export] public bool Enabled { get; private set; } = true;
[Export] public string Path { get; private set; }
[Export] private string _name { get; set; }
[Export] public MapStartDataResource StartData { get; private set; }
[Export] public Texture2D Icon { get; private set; }
public string DisplayName
{
get
{
if (!string.IsNullOrWhiteSpace(_name))
{
return _name;
}
if (!string.IsNullOrWhiteSpace(Path))
{
return Path.Split("/")[^1].Split(".")[0];
}
return string.Empty;
}
set => _name = value;
}
}

View file

@ -0,0 +1,20 @@
using System.Linq;
using Godot;
using Godot.Collections;
namespace Cirno.Scripts.Resources;
[GlobalClass]
public partial class MapStartDataResource : Resource
{
[Export]
public int EggIndex { get; set; }
[Export]
public Array<LootItem> StartingEquipment { get; set; } = new Array<LootItem>();
public override string ToString()
{
return $"EggIndex: {EggIndex}, Equipment: {string.Join("," ,StartingEquipment.Select(x => x.ItemKey))}";
}
}