fix editor (#2641)
This commit is contained in:
parent
7231886a80
commit
0e3bd2f648
1 changed files with 22 additions and 0 deletions
|
|
@ -48,6 +48,10 @@ public sealed partial class CustomInteractionEditor : DefaultWindow
|
|||
private readonly Dictionary<int, string> _effectIds = new();
|
||||
private readonly Dictionary<int, string> _soundIds = new();
|
||||
|
||||
private const int MaxNameLength = 64;
|
||||
private const int MaxDescriptionLength = 256;
|
||||
private const int MaxMessageLength = 128;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
|
@ -300,6 +304,12 @@ public sealed partial class CustomInteractionEditor : DefaultWindow
|
|||
if (string.IsNullOrEmpty(message))
|
||||
return;
|
||||
|
||||
if (message.Length > MaxMessageLength)
|
||||
{
|
||||
ShowError($"Сообщение слишком длинное (макс. {MaxMessageLength} символов)");
|
||||
return;
|
||||
}
|
||||
|
||||
_interaction.InteractionMessages.Add(message);
|
||||
AddMessageToList(message);
|
||||
NewMessageInput.Text = string.Empty;
|
||||
|
|
@ -336,6 +346,18 @@ public sealed partial class CustomInteractionEditor : DefaultWindow
|
|||
return;
|
||||
}
|
||||
|
||||
if (_interaction.Name.Length > MaxNameLength)
|
||||
{
|
||||
ShowError($"Имя слишком длинное (макс. {MaxNameLength} символов)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_interaction.Description.Length > MaxDescriptionLength)
|
||||
{
|
||||
ShowError($"Описание слишком длинное (макс. {MaxDescriptionLength} символов)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_interaction.InteractionMessages.Count == 0)
|
||||
{
|
||||
ShowError("Добавьте хотя бы одно сообщение взаимодействия");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue