Files
MovementTests/addons/forge/resources/ForgeCue.cs
Minimata c4be97e0de
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 21s
Create tag and build when new code gets to main / Test (push) Successful in 6m56s
Create tag and build when new code gets to main / Export (push) Successful in 9m3s
added forge addon
2026-02-08 15:16:01 +01:00

61 lines
1.2 KiB
C#

// 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
}