punish v6.8.18.0
This commit is contained in:
commit
cfb4dea47e
316 changed files with 554088 additions and 0 deletions
|
@ -0,0 +1,44 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Lumina.Text.ReadOnly;
|
||||
using Questionable.Functions;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Questing;
|
||||
|
||||
namespace Questionable.Validation.Validators;
|
||||
|
||||
internal sealed class SayValidator : IQuestValidator
|
||||
{
|
||||
private readonly ExcelFunctions _excelFunctions;
|
||||
|
||||
public SayValidator(ExcelFunctions excelFunctions)
|
||||
{
|
||||
_excelFunctions = excelFunctions;
|
||||
}
|
||||
|
||||
public IEnumerable<ValidationIssue> Validate(Quest quest)
|
||||
{
|
||||
foreach (var item in from x in quest.AllSteps()
|
||||
where x.Step.InteractionType == EInteractionType.Say
|
||||
select x)
|
||||
{
|
||||
ChatMessage chatMessage = item.Item3.ChatMessage;
|
||||
if (chatMessage != null)
|
||||
{
|
||||
ReadOnlySeString? rawDialogueText = _excelFunctions.GetRawDialogueText(quest, chatMessage.ExcelSheet, chatMessage.Key);
|
||||
if (rawDialogueText.HasValue && rawDialogueText.Value.PayloadCount != 1)
|
||||
{
|
||||
yield return new ValidationIssue
|
||||
{
|
||||
ElementId = quest.Id,
|
||||
Sequence = item.Item1.Sequence,
|
||||
Step = item.Item2,
|
||||
Type = EIssueType.InvalidChatMessage,
|
||||
Severity = EIssueSeverity.Error,
|
||||
Description = $"Invalid chat message: {rawDialogueText.Value}"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue