// Copyright © Gamesmiths Guild. using Gamesmiths.Forge.Cues; using Godot; using Godot.Collections; namespace Gamesmiths.Forge.Godot.Resources; [Tool] [GlobalClass] [Icon("uid://din7fexs0x53h")] public partial class ForgeCue : Resource { private CueMagnitudeType _magnitudeType; [Export] public required ForgeTagContainer CueKeys { get; set; } [Export] public int MinValue { get; set; } [Export] public int MaxValue { get; set; } [Export] public CueMagnitudeType MagnitudeType { get => _magnitudeType; set { _magnitudeType = value; NotifyPropertyListChanged(); } } [Export] public string? MagnitudeAttribute { get; set; } public CueData GetCueData() { return new CueData( CueKeys.GetTagContainer(), MinValue, MaxValue, MagnitudeType, string.IsNullOrEmpty(MagnitudeAttribute) ? null : MagnitudeAttribute); } #if TOOLS public override void _ValidateProperty(Dictionary property) { if (property["name"].AsStringName() == PropertyName.MagnitudeAttribute && (MagnitudeType == CueMagnitudeType.EffectLevel || MagnitudeType == CueMagnitudeType.StackCount)) { property["usage"] = (int)PropertyUsageFlags.NoEditor; } } #endif }