
Animated images inside Metin2 quest windows
This legacy client integration by blackdragonx61 / Mali adds PNG frame sequences to quest dialogue through addaniimage(width, height, delay, frame_count, basename). It is intended for administrators maintaining both the client source and Lua quest library. The supplied example contains 26 Metin2 logo frames; the preview is a contact sheet of those files, not an in-game screenshot.
M2City r1 corrections
The original OnAniImage added the same widget to self.images once for every loaded frame, swallowed missing-frame errors and divided by the first frame's dimensions even when no frame existed. The reviewed method retains one reference, requires all requested frames, rejects zero/oversized dimensions and hides a failed animation. Layout only advances after successful loading. A missing SetAniImgScale prerequisite fails cleanly instead of leaving a partly visible widget.
Frame counts are limited to 64, target dimensions to 512, delay to 120 native units and the shared quest image list to four entries. Invalid numbers, paths and script delimiters are rejected. The event parser uses bounded decimal parsing instead of unchecked atoi. The Lua authoring helper applies corresponding limits. Native dimension notes add null/index guards and predictable zero outputs.
Installation and prerequisites
Merge the original __BL_QUEST_ANI_IMAGE__ flag across all relevant libraries, export the app constant, register the event enum/map, native wndMgr method, ui.AniImageBox wrapper and PNG loader. Apply reviewed/uiQuest-OnAniImage.py inside your existing QuestDialog and replace the original addaniimage with reviewed/questlib.lua. Follow the reviewed event-manager and native-dimension instructions; add the event switch case only once.
Your engine must already implement AniImageBox scaling through SetAniImgScale. That renderer extension is referenced by the original README but is not supplied in this archive. This is not a standalone replacement uiQuest.py. Preserve the existing quest close/Destroy cleanup: hide owned images and clear self.images. Check board resizing and scrolling in your fork.
Copy the supplied logo_ani_0000.png through logo_ani_0025.png to ymir work/ui/game/questboard. Example: addaniimage(330, 130, 4, 26, "logo_ani"). Delay is expressed in the engine's native units, not documented milliseconds. The optional OpenCV conversion script was read but not run and is not needed for the supplied images.
Validation and credits
All 15 supplied text files were read and 26 PNGs decoded. Fake UI tests cover the 26-frame single-reference case, limits, invalid paths, missing first/middle/last frame, zero dimensions, missing scale method and 100 create/cleanup cycles. The exact bounded native parser compiled with clang++ and passed 512 valid numeric cases plus invalid/overflow/null and boundary cases. The available compiler lacks its UBSan runtime; no sanitizer run is claimed. The Lua helper was reviewed, not executed. No full client build, qc compilation, actual renderer or gameplay test was performed.
Original author: blackdragonx61 / Mali. Primary release dated 18 January 2025: Quest Ani Image on Metin2Dev. That thread also identifies SetAniImgScale as a prerequisite and contains a reported division-by-zero failure; the supplied code was reviewed independently. Exact archive checksum equivalence to the upstream attachment is unverified. Original archive/notices are retained and redistribution was confirmed by the supplying owner; no new licence is asserted.
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: 15 text files reviewed; 26 PNGs decoded. Fake UI: ownership, limits, missing frames, zero dimensions, missing scale method and 100 cleanup cycles. Native parser compiled and tested with 512 valid values and invalid/overflow/null/boundary cases. UBSan runtime unavailable. Lua reviewed, not executed. No full client build, qc, real renderer or gameplay test.
Source: Mali / blackdragonx61 release, 18 Jan 2025; supplied archive checksum not matched upstream
SHA-256: c530a1ab0ed82bc04ca88ba84cf368e11197f2336122b20c677bd450b32f7ce3