eterniti / xv2patcher

A dll that patches Xenoverse 2 to improve modding functionalities
12 stars 5 forks source link

Fix for UI Softlock when adding new color options for Mentor/Partner colorable outfits #5

Open Dee-Ayy opened 8 months ago

Dee-Ayy commented 8 months ago

So the issue here is related to modding the colorable outfits of the Custom Mentors/Partners.

It's possible to edit the outfits to allow more colorable slots, or editing the outfits to be completely different which may require a different number of colorable slots. However if a new slot is added after any of the previous colors have been edited the color selector UI will lock up upon selecting the newly added slot. this is because the value in the save was left as FFFF, a value too high for the selection menu.

The opcode loading the clothing color values is at DBXV2.exe+0x7F6CE3 A small fix I found was just checking if the value in EAX is FFFF, then doing xor, eax,eax if so. This results in the color selector loading the first slot to use for the color option. Ideally it would be better for it to load the default color for the slot, but this is an easier 2nd best solution for avoiding the softlock.

This is an example of how I did a fix by modifying the opcode at DBXV2.exe+0x7F6CE3 to jump to this new bit of code. 66 3D FFFF - cmp ax,FFFF 75 02 - jne 31 C0 - xor eax,eax 48 83 C4 20 - add rsp,20 5B - pop rbx C3 - ret