PatchIt! Dev-log #7

March 5, 2013
#7 Backward compatibility for legacy PiP format in Version 1.1 Stable

I, nor anyone else, knows how much PatchIt! will catch on, nor how many mods will be created with/updated for compatibility with PatchIt! (although I hope the answer to both of these questions are “A lot!”), especially now that version 1.0.2 is out, and most of my focus has shifted toward version 1.1. Whether a lot of mods are packaged for it or not, I need to have some sort of backward compatibility to install legacy patches. What am I thinking? When a patch is selected for installation, the validity line, like usual. But this time, not only is it read to see if it is a valid patch, it also checks if it is a legacy patch or a modern patch. A bit of sudo-code to illustrate:

if validline == 10patch:
    print("This is a legacy patch")
    # Call legacy patch installation code
elif validline == 11patch:
    print("This is a modern patch")
    # Call modern patch installation code
else: #elif validline != 10patch or 11 patch:
    print("This is not a patch!")
    # Go to main menu

This check would be a separate function in the modern patch installation module, and, depending on the outcome, would call the appropriate code.
Therefore, the validity line serves three purposes:

  1. Is it an actual patch?
  2. Is it a modern patch?
  3. Is it a legacy patch?

The legacy installation code is simply the V1.0.x code moved to a different module, and updated to reflect the changes outlined in Dev-log #6. The validity line, however, would be removed in legacy installation code, as it would be pretty hard (but not impossible) to change the patch layout while PatchIt! is switching from the modern code to the legacy code.

Next Dev-log: #8 PiP File Format Revision for Version 1.1 Stable Draft 2

Advertisements

Triangular Reactions

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s