OoT-Randomizer icon indicating copy to clipboard operation
OoT-Randomizer copied to clipboard

Store settings versioning names to avoid breaking plandomizers when renaming a setting

Open GSKirox opened this issue 2 years ago • 3 comments

This adds a settings_versioning table in SettingsList.py, which purpose is to update settings names, either in the init_ of the Settings class, or in loading of settings in Plandomizer.Py

By adding a new Setting_Info_Versioning entry in the table with the previous name used by the setting and the new one after a rename, this enables plandomizers to use the old name without breaking.

I've tested this in my current Traps branch (see https://github.com/GSKirox/OoT-Randomizer/tree/Traps), and plandos using the old setting name work fine, and all Unit Tests also pass.

GSKirox avatar Jan 04 '23 17:01 GSKirox

This is cool but I don't know that this behavior is desirable. It could lead to issues, especially if a setting is renamed but a different setting keeps the name for a different purpose.

cjohnson57 avatar Jan 04 '23 17:01 cjohnson57

Yeah this case would be unsolvable unfortunably. Would be a kinda dangerous change though, cause plandos which use the old purpose of the setting would behave strangely.

GSKirox avatar Jan 04 '23 18:01 GSKirox

Actually i was just thinking, if a setting is renamed but another just uses it, you can just.. not put it in this table lol. This is totally optional behaviour, if not used, then everything work as before.

GSKirox avatar Jan 06 '23 07:01 GSKirox