using System; using Gamecraft.Blocks.GUI; using RobocraftX.Common; using Svelto.ECS; using Unity.Mathematics; using TechbloxModdingAPI; using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Blocks { public class TextBlock : SignalingBlock { public TextBlock(EGID id) : base(id) { } public TextBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.TEXT_BLOCK_GROUP)) { } // custom text block properties /// /// The text block's current text. /// public string Text { get => BlockEngine.GetBlockInfo(this, (TextBlockDataStruct st) => st.textCurrent); set { if (value == null) value = ""; BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => { tbds.textCurrent.Set(val); tbds.textStored.Set(val, true); }, value); } } /// /// The text block's current text block ID (used in ChangeTextBlockCommand). /// public string TextBlockId { get => BlockEngine.GetBlockInfo(this, (TextBlockDataStruct st) => st.textBlockID); set { if (value == null) value = ""; BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) => tbds.textBlockID.Set(val), value); } } } }