Trying to preview different saved was more difficult than it
needed to be since after importing a layout, the user needed to
swap to another layout and then back to the original one in order
to see the changes. I changed this so that if a user imports a
layout to the currently active HUD slot, the plugin automatically
swaps to another HUD slot and back.
As a part of this also refined the general slot UI so that the
active slot is indicated in the slot selection UI for saving a
layout to game data.
Also add /phud for swapping between saved layouts.
Currently only the map and chat box have saved positions, although the
implementation supports additional windows. There is a checkbox when
importing to turn on or off window position saving.
The game checks if the slot being switched to is already selected and
does nothing if so. (For what it's worth, I did try changing the code
in memory to ignore these checks, but it didn't seem to work.) In
order to get the game to change slot, we write a different slot number
to the "current" slot in memory and then ask the game to change slot.
This doesn't swap the slot on screen and still works, which is
ideal. However, the game seems to overwrite the slot that is marked as
current when we do this. To remedy this issue, back up the slot before
telling the game to swap, then restore the slot afterwards.
Add a system to save layout slots and restore them, effectively
increasing the number of slots to an infinite amount.
Also add crafting and gathering layout swaps and make the UI more
reasonable.
Refactor out the combo boxes.