Manage the upgrade path from the old items_control.txt to items_control_new.txt.
- On load, check whether a control/items_control.txt file exists and has uncommented lines in it. If so:
- If a control/items_control_new.txt file already exists, display a warning, then go to step 2.
- If a control/items_control_old.txt file already exists, display a warning, then go to step 2.
- Display a message to the user, offering to upgrade the control/items_control.txt file to control/items_control_new.txt. If the user DOES NOT accept, go to step 2.
- Rename control/items_control.txt to control/items_control.txt.old.
- Load control/items_control.txt.old and convert the contents to the correct format for control/items_control_new.txt.
- Save control/items_control_new.txt.
- Create a control/items_control.txt file containing only a comment letting the user know that they should use control/items_control_new .txt instead. For example: "# NOTE: This file was renamed to items_control.txt.old on 2016-09-20 at 09:37:19, by the items_control_upgrade.pl plugin. The settings in this file should now be managed in items_control_new.txt instead. DO NOT EDIT THIS FILE, PLEASE."
- Go to step 2.
- Automatically unload the items_control_upgrade.pl plugin.
Parse the control/items_control_new.txt file, which contains:
- pickupitems.txt settings
- items_control.txt settings
- buyAuto settings