This commit is contained in:
Oscar
2025-06-10 20:45:40 +03:00
parent dd266b1a8a
commit de85b85b13
14 changed files with 196 additions and 273 deletions

View File

@@ -0,0 +1,12 @@
namespace Sasalka;
[GameResource( "Base Item Definition", "inv", "", Category = "Sasalka", Icon = "inventory_2" )]
public class BaseItemDefinition : GameResource
{
public string Name { get; set; }
public string Description { get; set; }
[ResourceType( "prefab" )] public GameObject Prefab { get; set; }
public Texture ImageTexture { get; set; }
public string ImageUrl { get; set; }
}

View File

@@ -0,0 +1,8 @@
namespace Sasalka;
[GameResource( "Clothing Item Definition", "clitem", "", Category = "Sasalka", Icon = "inventory_2" )]
public class ClothingItemDefinition : BaseItemDefinition, IEquipable
{
[Property] public string ClothUrl { get; set; }
public Inventar.InventorySlot Slot { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Sasalka;
public interface IEquipable
{
Inventar.InventorySlot Slot { get; }
}

View File

@@ -0,0 +1,18 @@
using Sandbox.Citizen;
namespace Sasalka;
[GameResource( "Weapon Item Definition", "weapon", "", Category = "Sasalka", Icon = "inventory_2" )]
public class WeaponItemDefinition : BaseItemDefinition, IEquipable
{
public Inventar.InventorySlot Slot { get; set; }
public CitizenAnimationHelper.HoldTypes HoldType { get; set; } = CitizenAnimationHelper.HoldTypes.None;
[InlineEditor, Space] public WeaponDefinition WeaponDefinition { get; set; }
}
public struct WeaponDefinition
{
// public CitizenAnimationHelper.Hand Hand { get; set; }
public Vector3 Position { get; set; }
public Rotation Rotation { get; set; }
}