Волк: кнопки окон сумки работают или скрыты; ссылка на Telegram в описании
Багажник (Tab): только «Сортировать», перенос в рюкзак тела и замок скрыты. При обыске над сумкой «Положить всё» / «Положить похожие» выкладывают в открытый ящик или мешок, «Сортировать» сортирует сумку; ванильный перенос копий ячеек (мог раздвоить вещи) выключен. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
fd4545d1a8
commit
8b8d1d0feb
+53
-1
@@ -426,6 +426,10 @@ namespace NecromancerTome
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (WolfBagButton(__instance, false))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
TEFeatureStorage te = __instance.GetParentByType<XUiC_LootWindow>()?.te;
|
||||
if (Taking && te != null)
|
||||
{
|
||||
@@ -446,12 +450,60 @@ namespace NecromancerTome
|
||||
[HarmonyPatch(typeof(XUiC_ContainerStandardControls), nameof(XUiC_ContainerStandardControls.Sort))]
|
||||
public static class Patch_Sort
|
||||
{
|
||||
public static bool Prefix()
|
||||
public static bool Prefix(XUiC_ContainerStandardControls __instance)
|
||||
{
|
||||
if (Viewing && WolfBagBackpack.On && __instance.GetParentByType<XUiC_BackpackWindow>() != null)
|
||||
{
|
||||
WolfBag.Sort();
|
||||
}
|
||||
return !Viewing;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Кнопки окна рюкзака, показывающего сумку волка: «Положить всё» / «Положить похожие» - в открытый
|
||||
/// ящик или мешок (как щелчок по ячейке сумки). True - кнопка сумки волка, обработана.</summary>
|
||||
static bool WolfBagButton(XUiC_ContainerStandardControls _c, bool _similarOnly)
|
||||
{
|
||||
if (!WolfBagBackpack.On || _c.GetParentByType<XUiC_BackpackWindow>() == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
XUiC_LootWindow lw = _c.xui.GetChildByType<XUiC_LootWindow>();
|
||||
TEFeatureStorage dst = lw != null && lw.ViewComponent.IsVisible ? lw.te : null;
|
||||
if (dst != null || _viewBag != null)
|
||||
{
|
||||
WolfBag.PutAll(dst, dst == null ? _viewBag : null, _similarOnly);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>«Положить похожие» у сумки волка; прочие переносы и замок ячеек при обыске - выключены (ячейки окна -
|
||||
/// копии сумки, ванильный перенос их раздвоил бы).</summary>
|
||||
[HarmonyPatch(typeof(XUiC_ContainerStandardControls))]
|
||||
public static class Patch_OtherMoves
|
||||
{
|
||||
static System.Collections.Generic.IEnumerable<System.Reflection.MethodBase> TargetMethods()
|
||||
{
|
||||
yield return AccessTools.Method(typeof(XUiC_ContainerStandardControls), nameof(XUiC_ContainerStandardControls.MoveFillAndSmart));
|
||||
yield return AccessTools.Method(typeof(XUiC_ContainerStandardControls), nameof(XUiC_ContainerStandardControls.MoveFillStacks));
|
||||
yield return AccessTools.Method(typeof(XUiC_ContainerStandardControls), nameof(XUiC_ContainerStandardControls.MoveSmart));
|
||||
yield return AccessTools.Method(typeof(XUiC_ContainerStandardControls), nameof(XUiC_ContainerStandardControls.ToggleLockMode));
|
||||
}
|
||||
|
||||
public static bool Prefix(XUiC_ContainerStandardControls __instance, System.Reflection.MethodBase __originalMethod)
|
||||
{
|
||||
if (!Viewing)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (__originalMethod.Name == nameof(XUiC_ContainerStandardControls.MoveFillAndSmart))
|
||||
{
|
||||
WolfBagButton(__instance, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Щелчок по запертой ячейке контейнера - отказ «рюкзак полон».</summary>
|
||||
[HarmonyPatch(typeof(XUiC_ItemStack), nameof(XUiC_ItemStack.Update))]
|
||||
public static class Patch_ItemStack_Update
|
||||
|
||||
Reference in New Issue
Block a user