Оссуарий: заголовок «Образцы» над ячейками образцов (#66)
22.10: «Переименуй». У коллекторов игры заголовок общий - «Инструменты» (xuiTools); для котла при открытии окна ставится «Образцы» (13 языков), у остальных возвращается родной. Проверено в test8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
be7c203abe
commit
a6a5c02b24
@@ -144,6 +144,35 @@ namespace NecromancerTome
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Заголовок над ячейками образцов (22.10: «Переименуй»): у коллекторов игры - «Инструменты» (xuiTools), у котла -
|
||||
/// «Образцы». Окно общее, поэтому чужим возвращаем родное.</summary>
|
||||
[HarmonyPatch(typeof(XUiC_DewCollectorModGrid), nameof(XUiC_DewCollectorModGrid.OnOpen))]
|
||||
public static class Patch_XUiC_DewCollectorModGrid_OnOpen_GeoOssuaryHeader
|
||||
{
|
||||
public static void Postfix(XUiC_DewCollectorModGrid __instance)
|
||||
{
|
||||
XUiController window = __instance;
|
||||
while (window.Parent != null && !(window.ViewComponent is XUiV_Window))
|
||||
window = window.Parent;
|
||||
XUiV_Label header = FindHeader(window);
|
||||
if (header != null)
|
||||
header.Text = Localization.Get(GeoOssuary.Is(__instance.tileEntity) ? "necroGeoOssuarySamples" : "xuiTools");
|
||||
}
|
||||
|
||||
static XUiV_Label FindHeader(XUiController _c)
|
||||
{
|
||||
if (_c.ViewComponent is XUiV_Label l && (l.Text == Localization.Get("xuiTools") || l.Text == Localization.Get("necroGeoOssuarySamples")))
|
||||
return l;
|
||||
foreach (XUiController child in _c.Children)
|
||||
{
|
||||
XUiV_Label found = FindHeader(child);
|
||||
if (found != null)
|
||||
return found;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(TileEntityCollector), nameof(TileEntityCollector.isDisabled))]
|
||||
public static class Patch_TileEntityCollector_isDisabled_GeoOssuary
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user