{
  "markdown": "# Homebrewed Dynamic Filters for RimWorld\n\n## Description\n\nHomebrewed Dynamic Filters is a RimWorld 1.6 mod that attaches dynamic filter policies to the game's `Verse.ThingFilter` objects: stockpiles, storage buildings and storage groups, bill ingredient filters, outfits, food restrictions, pens, wind turbines, and Better Workbench Management \"Count Additional\" output filters.\n\nA policy is a named rule (\"all metallic stuff\", \"everything that rots\", \"all defs from mod X\") created from a template in the mod settings, or activated as a read-only preset. It is applied continuously to the chosen filter and can be combined with the vanilla filter.\n\nThe mod is built on the sibling [Homebrewed Toolkit](https://github.com/HomebrewDotNET/HomebrewDot.Net.Rimworld.Toolkit) assembly, which provides the indexing, condition and collector engines, services, and hooks.\n\n## Installation\n\n### Players\n\nInstall like any other mod and enable \"Homebrewed Dynamic Filters\" in the mod list. Requires [Harmony](https://steamcommunity.com/sharedfiles/filedetails/?id=2009463077) and the Homebrewed Toolkit.\n\nOpen the mod settings and toggle what you want:\n\n- \"Enable storage policies and filters\" — the master switch for dynamic storage policies.\n- \"Enable policy presets\" — activates the built-in presets as read-only templates.\n- \"Enable special thing filter presets\" — (shown while presets are enabled) adds a preset for every special thing filter the game loads, including filters from other mods.\n- \"Show Policies button in toolbar\" — adds a toolbar button that opens the Policies tab.\n\n### Building from source\n\nRequires the .NET SDK and RimWorld 1.6 with the Harmony and Toolkit assemblies on disk. Build the mod project:\n\n```\ndotnet build src/HomebrewDot.Net.RimWorld.DynamicFilters/HomebrewDot.Net.RimWorld.DynamicFilters.csproj\n```\n\nAssemblies land in `1.6/Assemblies/`. When rsync is available, the build also syncs content to a dev folder in RimWorld's `Mods` directory. Paths default to `C:\\Program Files (x86)\\Steam\\steamapps\\common\\RimWorld` and can be overridden with environment variables such as `RIMWORLD_VERSION`, `RIMWORLD_ROOT`, and `RIMWORLD_HARMONY_ROOT`.\n\n## Usage\n\n### In game\n\n1. Enable the features you want in the mod settings.\n2. In the Templates tab, pick a template and configure it. Presets appear here as `[Preset] name` templates and are read-only.\n3. Activate the policy, then attach it to a filter (stockpile, storage, bill, outfit, food restriction, pen, or wind turbine). A policy bar shows in the filter config window and is enforced on every item check.\n4. The Policies tab lists active policies with edit, rename, and delete.\n\nBuilt-in templates: Simple Filter Policy, Complex Filter Policy, and Blocks Windmill. Built-in presets cover resources, food, meals, drinks, corpses, medical and surgical items, stuff categories, perishability, tech level, equipment (weapons, apparel, tools, shields), damaged equipment (tattered and worn out apparel/weapons), and more. An opt-in setting adds a preset for every special thing filter the game loads — the stockpile \"Allow ...\" checkboxes (allow fresh, allow colonist corpses, allow smeltable, allow clean apparel, and the rest, including filters added by other mods) — each using the exact same check as the game's own filter and taking precedence over the built-in presets that cover the same ground (for example allow rotten replaces the Rotting preset). Like all policies, activating one registers its collection, so the Complex Filter Policy can include or exclude it.\n\n### Adding presets from another mod\n\nRegister a preset provider and create the preset with `DynamicFilterPresets.CreateSimple`:\n\n```csharp\nusing HomebrewDot.Net.Rimworld;\nusing Verse;\n\n[StaticConstructorOnStartup]\npublic static class MyModPresets\n{\n    static MyModPresets()\n    {\n        DynamicFilterPresets.AddPresetProvider(activator =>\n        {\n            DynamicFilterPresets.CreateSimple(\"My Mod Stuff\", \"Filters all defs from my mod\",\n                new[] { DynamicFilterPresets.CreateModFilterCondition(\"mynamespace.myid\") },\n                thingDef: true);\n        });\n    }\n}\n```\n\nCondition factories in `DynamicFilterPresets` cover properties, stats, comps, mod IDs, tech level, rotting, and smeltable.\n\n### Adding a custom template\n\nA template with user input implements `IDynamicPolicyTemplate` and is registered with `DynamicFiltersToolkit.Templates.AddTemplate`:\n\n```csharp\nusing System;\nusing System.Collections.Generic;\nusing HomebrewDot.Net.Rimworld;\nusing HomebrewDot.Net.Rimworld.Configuration;\nusing HomebrewDot.Net.Rimworld.Filtering;\nusing UnityEngine;\nusing Verse;\n\npublic class RangedWeaponFilterTemplate : IDynamicPolicyTemplate\n{\n    public string StorageKey => \"MyMod.RangedWeaponFilter\";\n    public bool Singleton => false;\n\n    public string GetTitle() => \"Ranged Weapon Filter\";\n    public string GetShortDescription() => \"Includes ranged weapons above a configured range\";\n    public string GetLongDescription(IExposable settings) => \"Includes all ranged weapons with a range above the configured value\";\n    public void DrawSettings(Rect rect, ref IExposable settings) { }\n    public IEnumerable<string> ValidateSettings(IExposable settings) => Array.Empty<string>();\n    public IDynamicPolicyProvider Create(IExposable settings) => new RangedWeaponFilterProvider(settings);\n}\n\nDynamicFiltersToolkit.Templates.AddTemplate(new RangedWeaponFilterTemplate());\n```\n\n## Contributing\n\nNot accepting direct contributions right now. Feel free to fork.\n\n## License\n\nLicensed under Apache License 2.0. See [LICENSE.md](LICENSE.md).\n",
  "bytes": 5607,
  "sha": "a6985c42754ce49b8cbed8edb3d79b7e75b08bf8a1b18dc812e0e2cc2632f03d",
  "repo_slug": "homebrewdotnet/homebrewdot.net.rimworld.dynamicfilters",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/okf_homebrewdotnet_homebrewdot_net_rimworld__8e37ebf6/readme"
}