* Extract loop body into GoldAutoPlaceInInventorySlot()
* Improve placement of gold in inventory
When adding gold to the inventory, this now finds a free slot as
follows:
1) Start at X, and work left until row 3 is full
2) Start at Y, and work up until column 9 is full
3) Move one column left, start at row 2 and work up
4) Repeat step 3 until there is no free space
| |0|1|2|3|4|5|6|7|8|9|
|-|-|-|-|-|-|-|-|-|-|-|
|0| | | | | | | | | | |
|1| | | | | | | | | | |
|2| | | | | | | | | |Y|
|3| | | | | | | | | |X|
* Improve inventory placement for single-height items
When adding single-height items (which in practice are all 1x1) to the
inventory, this now finds a free slot as follows:
1) Start at X, and work right until row 3 is full
2) Start at Y, and work up until column 9 is full
3) Move one column left, start at row 2 and work up
4) Repeat step 3 until there is no free space
| |0|1|2|3|4|5|6|7|8|9|
|-|-|-|-|-|-|-|-|-|-|-|
|0| | | | | | | | | | |
|1| | | | | | | | | | |
|2| | | | | | | | | |Y|
|3|X| | | | | | | | | |
* Improve inventory placement for two-height items
When adding 1x2 items to the inventory, this now finds a free slot as
follows:
1) Start at X, and work down until column 9 is full
2) Move one column left, start at row 0 and work down
3) Repeat step 2 until there is no free space
| |0|1|2|3|4|5|6|7|8|9|
|-|-|-|-|-|-|-|-|-|-|-|
|0| | | | | | | |Z|Y|X|
|1| | | | | | | | | | |
|2| | | | | | | | | | |
|3| | | | | | | | | | |
When adding 2x2 items, it first tries to place them in even columns,
then goes to odd columns of no space was found:
1) Start at Y, and work down until columns 8/9 are full
2) Move two columns left, start at row 0 and work down
3) Repeat step 2 until there is no free space in columns 0/1
4) Go to Z, and work down until columns 7/8 are full
5) Move two columns left, start at row 0 and work down
3) Repeat step 5 until there is no free space
The 'saveFlag' argument used for persisting the changes into the
inventory is never leveraged on this function: all existing consumers
provide 'FALSE'. It was probably a copy-paste leftover from the
standard 'AutoPlace'.
Initial game controller support.
Actions are based on the Switch branch but the controller code itself is
implemented differently, allowing for easy remapping and minimizing
changes to the Source/ directory.
Many subtle and not so subtle controller bugs have been fixed
in this implementation, including:
1. Smoother & more responsive movement with the joysticks.
2. Consistent controls for all the menus in the game (stores, quest log,
etc).
3. Cursor appearance / disappearance at appropriate times.
Low-level controls are abstracted and 3 SDL interfaces are supported:
game controller, joystick, and keyboard. See SourceX/controls/ for more
details on this.
Wishlist for the future:
1. Primary button and use button should attack continously.
This is hard as it requires checking the cooldowns / attack speed.
2. Quick spell menu navigation is very buggy. It is also buggy in the
switch branch. I haven't had a change to investigate.