Client Systems & Python UI
Metin2 inventory search: page navigation, refresh and lifecycle corrections
M2City Client · Editorial · Published 2026-11-05 · Branch-specific details should be checked against your own source.
This package adapts the supplied Search Inventory tutorial into a separate, bounded search controller. Search locates the first matching bag page; Next visits matching pages and wraps; Reset keeps the current page. Matches highlight existing slots. The controller never moves, sorts, sells or uses items and sends no network packets.
Problems found in the supplied integration
The tutorial mixes IME updates, page changes and bag refresh calls, resets an empty search by looking for the first occupied page, depends on custom masks and diffuse-colour methods, and changes tooltip behaviour when the feature is disabled. Cleanup leaves added widget references. Its example layout only includes the new controls in the expanded-inventory branches and imports an external utils module. Several tutorial image paths are absent from the eight supplied PNGs.
M2City r1 changes
The replacement inventory_search.py separates search state from the inventory window. It validates dimensions, page bounds, input length and encoding, finishes the item scan before changing the page, and suppresses reentrant refreshes. Normal bag refresh searches only the current page; explicit Search and Next inspect the configured bag. There is no per-frame polling or scan on every IME event. The maximum supported layout is 4096 cells, with a 55-character query.
The owner reference is weak and Destroy clears search state. Slot identities stay unchanged: matching uses global bag cells, while highlighting receives local cells on the displayed page. The normal redraw restores ordinary slot effects before search highlighting; no custom colour API or arbitrary slot remapping is required.
Integration requirements
This is a source integration kit, not a drop-in complete inventory window. Keep your existing InventoryWindow.py and uiinventory.py. Add the controller and five small adapters documented in INSTALL.txt: label lookup, current page, page selection, ordinary redraw and highlights. Connect your input and Search/Next/Reset buttons with weak callbacks. The original tutorial and example remain for reference, not as recommended whole-file replacements.
Choose the actual string encoding of your client. Use the bag dimensions and player API overloads from your fork; exclude equipment, locked cells and special storage as appropriate. The supplied skill-book example uses VNUM 50300 and socket 0, which must match your prototypes. Your base redraw must restore potion/new-item/locked-slot effects before search highlights. The guide includes the refresh guard, no-double-redraw hook, close/focus and relog teardown steps. Special inventory requires a separate adapter and is not claimed as pre-integrated here.
What was validated
The tutorial was manually reviewed. The supplied 1,581-line layout was parsed without execution and its feature branches, named controls and external dependencies inspected; it was not rendered. All eight supplied PNGs decoded. Tests execute the exact replacement controller with fake bag adapters: four-page search and wrap, reset/no-match, moved items, unchanged slot identity, current-page-only reads, recursive callbacks, text and dimension boundaries, encoding rejection, weak ownership and 100 destruction cycles. No game executable was run, and no actual client rendering or full fork build is claimed.
Source and rights
Supplied archive: search-inventory-system SCOOB M2RO.rar. A related public reference is Search Inventory & Special Storage, posted by SCOOB. That listing also describes native and special-storage functionality; it does not prove this two-Python-file archive is the same complete version. No missing code or screenshots were copied from that listing. Exact original author/version remains unconfirmed. The supplying owner confirmed public redistribution; original files/notices are retained without asserting an open-source licence.
Editorial resource — M2City
Version: Owner-supplied legacy integration; M2City r1 (2026-11-04); exact fork unspecified
Rights: Owner explicitly confirmed public redistribution. Preserve original notices; no open-source relicensing.
Validation: Actual r1 controller tested with fake bag adapters: four-page search/wrap, unchanged slot identities, clear/no-match, inventory mutation, current-page-only refresh, recursion guard, text/encoding/bounds rejection, weak owner and 100 destroy cycles. No game rendering/full client build.
Source: Owner-supplied Search Inventory archive; related SCOOB listing, exact release not established
SHA-256: 7ae58baa15352333e0ad4b131dd97a73fd1d4edefddaeed226e411df4c4811f2
Download package
3 download options · Sign in to download
metin2-inventory-search-controller-m2city-r1.zipM2City downloadmetin2-inventory-search-controller-m2city-r1.zipGoogle Drive mirrormetin2-inventory-search-controller-m2city-r1.zipMEGA mirrorMAKE THE NEXT ANSWER BETTER
What happened on your build?
Share a small example, the exact error and how you verified your fix. The discussion is open on the forum.
Need a scoped quest, UI or proto fix? · Explore more development guides · Check your proto files free