Skip to content

Allow configuring craftable tabs#230

Open
Interzoneism wants to merge 1 commit into
masterfrom
codex/add-user-defined-craftable-categories
Open

Allow configuring craftable tabs#230
Interzoneism wants to merge 1 commit into
masterfrom
codex/add-user-defined-craftable-categories

Conversation

@Interzoneism

Copy link
Copy Markdown
Owner

Summary

  • add CraftableTabConfig entries to the mod configuration so craftable tab metadata can be customized
  • build runtime craftable tab definitions from configuration and use them to drive tab lookup, caching, and scan behavior
  • rework handbook tab generation and selection to honor configured names, padding, and filters

Testing

  • dotnet build -nologo -clp:Summary -warnaserror

https://chatgpt.com/codex/tasks/task_e_68dcf3d725b8832bbb1b88ff8bef2087

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines 440 to +444
private static string GetVariantKey(bool includeAll, bool modsOnly, bool woodOnly, bool stoneOnly)
{
if (includeAll) return "all";
if (modsOnly) return "mods";
if (woodOnly) return "wood";
if (stoneOnly) return "stone";
return "van";
var def = FindTabDefinition(includeAll, modsOnly, woodOnly, stoneOnly);
if (def != null && !string.IsNullOrEmpty(def.VariantKey)) return def.VariantKey;
return DefaultCraftableTab?.VariantKey ?? "van";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Respect custom variant keys when indexing recipes

The new configuration now returns whatever CraftableTabConfig.VariantKey is provided (see GetVariantKey), but the recipe indexer still hard‑codes the original identifiers ("van", "mods", "wood", "stone", "all") when building and applying caches (RecipeIndexVariants, ApplyRecipeIndexVariant, etc.). If a config file renames one of those variants, scans will wait for a non‑existent index because the cache is stored under the old key. To keep the feature working when users customise variant names, derive the variant list for indexing from CraftableTabDefinitions (or the normalised config) rather than the hard‑coded strings.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex fix p1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Testing

  • dotnet build ShowCraftable/ShowCraftable.sln -nologo -clp:Summary -warnaserror

View task →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant