Рецепты: без дублей кузни в окне навыка, все урны видны (#72)

- Список рецептов по предмету/id/ингредиенту отсеивает версию кузни
  «плавильня/лом» по настройке мира, как список верстака
  (RecipeSmelterFilter, выключатель necrosmelterfilter).
- Урны в окне некромантии - одной иконкой с recipes=: в строке
  14 иконок, было 17, последние три урны не показывались.

DLL с этой правкой закоммитится вместе с оссуарием (#66).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
AlexCube
2026-10-22 22:34:47 +03:00
co-authored by Claude Opus 5.5
parent 037bd5fcf5
commit 6ed3dc21bd
2 changed files with 77 additions and 1 deletions
+3 -1
View File
@@ -181,7 +181,9 @@
пользуется, вода сидит на necroNecromancyLvl20. -->
<unlock_entry item="necroModKnifeScavengersFeast,bookSummonRatSpirit" unlock_tier="3"/>
<unlock_entry item="necroModKnifeGravesRepose" unlock_tier="4"/>
<unlock_entry item="necroModKnifeDarkSense,necroCinerarium,necroCinerariumLogist,necroCinerariumWorker,necroCinerariumRepair,necroCinerariumLoot,necroCinerariumProspector" unlock_tier="5"/>
<!-- 22.10.2026: урны - одной иконкой с recipes= (как комплекты брони в ванили): в окне навыка у строки только 14 иконок, в группе было 17 - последние урны не показывались («Не все рецепты цинерария доступны»). Клик по иконке - все урны списком. -->
<unlock_entry item="necroModKnifeDarkSense" unlock_tier="5"/>
<unlock_entry item="necroCinerarium" unlock_tier="5" recipes="necroCinerarium,necroCinerariumLogist,necroCinerariumWorker,necroCinerariumRepair,necroCinerariumLoot,necroCinerariumProspector"/>
</display_entry>
<!-- Ступенчатая разблокировка внутри группы. ПЕРЕРАСПРЕДЕЛЕНО 2026-09-09: четыре из
шести модов ножа (вода/еда/покой/чутьё) уехали отсюда в группу 1 - см. большой
+74
View File
@@ -0,0 +1,74 @@
using System.Collections.Generic;
using HarmonyLib;
namespace NecromancerTome
{
/// <summary>
/// Кузнечные рецепты в двух версиях (плавильня - use_smelter, лом - replace_smelter) игра разводит по настройке мира
/// только в списке верстака (FilterRecipesByWorkstation) и в поиске по имени (FilterRecipesByName). Список по предмету
/// (клик по иконке в окне навыка), по id и по ингредиенту показывал обе версии - 22.10.2026 на стриме рецепт оссуария
/// «задвоился» (4 строки вместо 2: кровь/сок × плавильня/лом), у кузнечных урн так же. Здесь тот же фильтр, что у игры.
/// Выключатель - necrosmelterfilter off.
/// </summary>
public static class RecipeSmelterFilter
{
public static bool Enabled = true;
public static void Apply(List<Recipe> _list)
{
if (!Enabled || _list == null)
return;
_list.RemoveAll(r => r != null && r.craftingArea == "forge" &&
((XUiM_Recipes.DisableSmelter && r.tags.Test_AnySet(XUiM_Recipes.useSmelterTag)) ||
(!XUiM_Recipes.DisableSmelter && r.tags.Test_AnySet(XUiM_Recipes.replaceSmelterTag))));
}
}
[HarmonyPatch(typeof(XUiM_Recipes), nameof(XUiM_Recipes.FilterRecipesByItem))]
public static class Patch_XUiM_Recipes_FilterRecipesByItem_Smelter
{
public static void Postfix(List<Recipe> __result) => RecipeSmelterFilter.Apply(__result);
}
[HarmonyPatch(typeof(XUiM_Recipes), nameof(XUiM_Recipes.FilterRecipesByID))]
public static class Patch_XUiM_Recipes_FilterRecipesByID_Smelter
{
public static void Postfix(List<Recipe> __result) => RecipeSmelterFilter.Apply(__result);
}
[HarmonyPatch(typeof(XUiM_Recipes), nameof(XUiM_Recipes.FilterRecipesByIngredient))]
public static class Patch_XUiM_Recipes_FilterRecipesByIngredient_Smelter
{
public static void Postfix(List<Recipe> __result) => RecipeSmelterFilter.Apply(__result);
}
public class ConsoleCmdNecroSmelterFilter : ConsoleCmdAbstract
{
public override bool IsExecuteOnClient => true;
public override bool AllowedInMainMenu => true;
public override string[] getCommands()
{
return new string[] { "necrosmelterfilter" };
}
public override string getDescription()
{
return "Necromancer's Tome: hide forge recipe versions that do not match the smelter setting in item/ingredient recipe lists.";
}
public override string getHelp()
{
return "necrosmelterfilter on|off - off: lists by item/ingredient show both forge versions, as in the base game";
}
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo)
{
SdtdConsole con = SingletonMonoBehaviour<SdtdConsole>.Instance;
if (_params.Count > 0 && (_params[0] == "on" || _params[0] == "off"))
RecipeSmelterFilter.Enabled = _params[0] == "on";
con.Output("necrosmelterfilter: " + (RecipeSmelterFilter.Enabled ? "on" : "off"));
}
}
}