Skip to content

feat: add individual food and ingredient editing with multi-select and search - #5

Open
aiden0rchad wants to merge 2 commits into
hypery11:mainfrom
aiden0rchad:feature/food-ingredient-editing
Open

aiden0rchad wants to merge 2 commits into
hypery11:mainfrom
aiden0rchad:feature/food-ingredient-editing

Conversation

@aiden0rchad

Copy link
Copy Markdown

Summary

Adds individual food and ingredient editing in the Restaurant section, allowing players to inspect, search, and selectively adjust their stock instead of only having bulk-fill operations.

Note: This PR builds on top of PR #4 (item reference catalog expansion and official in-game localizations).

Context & Need

Currently, the Restaurant section only offers bulk actions (Max Owned Ingredients, Max All Ingredients, Max Branch Ingredients). Players who want to manage specific kitchen ingredients without maxing out their entire pantry and spoiling in-game progression had no way to view or edit individual ingredients.

Key Changes

  1. Per-Ingredient Inspection & Inline Editing (TableRows.swift, ContentView.swift):

    • Each ingredient shows its icon (fork.knife), localized name, numeric ID, main restaurant count, and branch restaurant stock badge (Branch: X) if non-zero.
    • Quick Increase: +10 and +50 buttons to easily bump stock.
    • Tier Maximize: Max button that clamps directly to that ingredient's official tier cap (6666, 666, 66, or 999).
    • Exact Count Entry: Dedicated text field with Return button accepting formatted numbers with grouping separators.
  2. In-Stock vs All-Ingredients Browsing (ContentView.swift, SaveEditorModel.swift):

    • Segmented scope selector toggles between:
      • In Stock (e.g. 128): Ingredients currently held in the save.
      • All Ingredients (462): Browse and search any ingredient in the game (even unowned ones with count 0), allowing players to add and unlock any ingredient by setting its count.
  3. Multi-Selection & Batch Operations:

    • Click Select… to enter multi-select mode with checkboxes.
    • Batch actions: +10 Selected, +50 Selected, Max Selected, Select All, and Clear.
    • All batch operations collapse into a single undo step (⌘Z).
  4. Multi-Language Search (ReferenceDB.swift):

    • Real-time search across English, Korean, Simplified Chinese, Traditional Chinese names, developer text keys, and numeric IDs.
  5. Core Engine Support (IngredientOps.swift, FishOps.swift):

    • Added IngredientSlot struct.
    • Added SaveDocument.ingredientItems() -> [IngredientSlot].
    • Added SaveDocument.setIngredient(id:count:branchCount:parentID:) -> Bool which updates existing entries or injects missing entries matching the game's 9-key schema.
  6. String Catalog & Localizations (Localizable.xcstrings):

    • Fully localized across English, Korean, Simplified Chinese, and Traditional Chinese.
    • Verified with Scripts/check_catalog.py (0 format or terminology violations).
  7. Tests & Tooling:

    • Added unit tests in DaveSaveCoreTests/IngredientOpsTests.swift (ingredientItemsEnumeratesSortedAndExtractsCounts, setIngredientUpdatesExistingAndInjectsMissing, searchIngredientsMatchesAcrossLanguages).
    • Added model tests in ExpandedEditingTests.swift (ingredientRowsInStockAndAll, setAndAdjustIngredientCount, batchAdjustAndMaximizeIngredients).
    • Included Scripts/package_app.sh for standalone CLI/local packaging without full Xcode.
    • All 96 tests in 19 suites pass.

…ions, and DLC mappings

- Add 601 EquipmentItem rows (weapons, harpoons, charms, diving gear) and 48 SubEquipment rows into reference.sqlite, mapped to their save-side equipment TIDs.
- Integrate official game localization tables across English, Korean, Simplified Chinese, and Traditional Chinese for 1,236 unique item and equipment text keys.
- Prioritize direct TID matches over ItemDataID references, ensuring charms like 3017001 resolve to their equipped charm name (Dolphin Necklace / 돌고래의 목걸이 / 海豚項鍊) rather than the raw unappraised pickup key Unidentified LongDash.
- Enhance prettify with prefix stripping (Item_JDLC_, Item_) and CamelCase handling for untranslated DLC/cutscene items (Memory of Yoshie).
- Fall back to localized "item" instead of repeating slot IDs (#id #id) when an unknown item is encountered in the inventory list.
- Support multi-language item search in ReferenceDB.searchItems matching across localized strings, developer keys, and numeric IDs.
- Add DLC 2 (May / Guilty Gear 14252101) and DLC 4 (In the Jungle 14252301) to dlcTypeToID in IngredientOps and craftDLCTypeToID in CraftMaterialOps.
- Add Scripts/build_reference_db.py to regenerate reference.sql and reference.sqlite deterministically from game tables and text assets.
- Add test suite in NewEquipmentAndItemLookupTests and update ExpandedEditingTests.
Copilot AI lite review requested due to automatic review settings September 13, 2026 23:49

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants