55 lines
1.3 KiB
C#
55 lines
1.3 KiB
C#
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
|
|
|
|
/// <summary>
|
|
/// The text block's current text.
|
|
/// </summary>
|
|
public string Text
|
|
{
|
|
get => BlockEngine.GetBlockInfo<TextBlockDataStruct>(this).textCurrent;
|
|
|
|
set
|
|
{
|
|
if (value == null) value = "";
|
|
var tbds = BlockEngine.GetBlockInfo<TextBlockDataStruct>(this);
|
|
tbds.textCurrent.Set(value);
|
|
tbds.textStored.Set(value, true);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// The text block's current text block ID (used in ChangeTextBlockCommand).
|
|
/// </summary>
|
|
public string TextBlockId
|
|
{
|
|
get => BlockEngine.GetBlockInfo<TextBlockDataStruct>(this).textBlockID;
|
|
|
|
set
|
|
{
|
|
if (value == null) value = "";
|
|
BlockEngine.GetBlockInfo<TextBlockDataStruct>(this).textBlockID.Set(value);
|
|
}
|
|
}
|
|
}
|
|
}
|