Data editor base: EntityEditorWindow (searchable list, form over JSON entities, texts in every language of the mod, other fields as JSON), EntityDocument, LocaleFileService, PropertiesText; mod tests

This commit is contained in:
cthangover committed 2026-10-23 19:09:39 +02:00
1 parent 6ca1fff35f
commit e1a1d770cf
14 files changed
+1502 -1

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
namespace Cthangover.Tools.EntityEditor
{
/// <summary>
/// One property of an entity as an <see cref="EntityEditorWindow"/> form shows
/// it. A concrete editor lists its fields; properties no field names are
/// shown and edited as raw JSON ("other fields"), so the form never hides or
/// drops data a mod added.
/// </summary>
public class EntityField
{
/// <summary>JSON property name.</summary>
public string Key { get; init; }
/// <summary>Locale key of the label.</summary>
public string LabelKey { get; init; }
/// <summary>Locale key of the tooltip, or null.</summary>
public string TooltipKey { get; init; }
/// <summary>How the value is edited.</summary>
public EntityFieldKind Kind { get; init; }
/// <summary>Picture: the file group of the pictures (<c>items</c>, <c>characters</c>…).</summary>
public string Group { get; init; }
/// <summary>Choice, flags, list: the values offered (read when the form is built).</summary>
public Func<IEnumerable<string>> Options { get; init; }
/// <summary>Locale text: how a new entity's key is made from its id (<c>{0}</c> = id).</summary>
public string KeyPattern { get; init; }
}
}