OpenKH/OpenKh

[FEATURE] - Improved listpatch handling for Mods Manager

Opened this issue · 0 comments

listpatch is used to patch certain file types using a yml containing data for what values to change in given entries.
Currently an entry must contain values for everything including data you might not want to change.

Here's an example for am Item entry that edits a keyblade:

Id: 41
  Type: Keyblade
  Flag0: 0
  Flag1: 52
  Rank: C
  StatEntry: 80
  Name: 34242
  Description: 34243
  ShopBuy: 0
  ShopSell: 0
  Command: 0
  Slot: 33
  Picture: 43
  Icon1: 0
  Icon2: 4

If I wanted to only edit the name and description and try using something like this:

- Id: 41
Name: 34250
Description: 34251

It sets the other missing values (Type, Flag0, Flag1, Rank, ect.) to 0 during the build process.

I believe it would be beneficial and allow greater compatibility between mods if instead of using 0 for the default it would instead check to see if the entry ID currently exists and use the values from that as default for anything missing in the listpatch entry.

It would mean something two different mods editing the same entry like this (assuming the very first example is what's being edited):

- Id: 41
  Name: 34250
  Description: 34251
- Id: 41
  Picture: 60
  ShopBuy: 1000
  ShopSell: 100

Would result in everything being put together like so:

Id: 41
  Type: Keyblade
  Flag0: 0
  Flag1: 52
  Rank: C
  StatEntry: 80
  Name: 34250
  Description: 34251
  ShopBuy: 1000
  ShopSell: 100
  Command: 0
  Slot: 33
  Picture: 60
  Icon1: 0
  Icon2: 4

Instead of one listpatch edit completely overwriting the other.