mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-14 18:13:47 +00:00
Generic marker pickups
This commit is contained in:
parent
6cbf2014b4
commit
692c33c939
15 changed files with 176 additions and 36 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Cirno.Scripts.Resources.ItemEffects;
|
||||
using Cirno.Scripts.Interactables;
|
||||
using Cirno.Scripts.Resources.ItemEffects;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Resources;
|
||||
|
|
@ -26,6 +27,20 @@ public partial class LootItem : Resource
|
|||
//[Export] public SpriteFrames WorldSprite;
|
||||
//[Export] public PackedScene HudItemScene;
|
||||
[Export(PropertyHint.File)] public StringName DropScenePath { get; private set; } // Has to be a string path to avoid recursion issues
|
||||
|
||||
public ItemPickup Spawn(Node2D parent)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(DropScenePath)) return null;
|
||||
var itemScene = GD.Load<PackedScene>(DropScenePath);
|
||||
var spawnedItem = parent.CreateSibling<ItemPickup>(itemScene);
|
||||
|
||||
spawnedItem.Name = this.ItemKey;
|
||||
|
||||
spawnedItem.LootTable.Add(this);
|
||||
spawnedItem.SetSprite(InventorySprite);
|
||||
|
||||
return spawnedItem;
|
||||
}
|
||||
}
|
||||
|
||||
public enum UiItemType
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue