Fixes #430 where recipe list in CraftPanel used to loose focus, while the craft button could still be pressed which resulted in crash. Now CraftPanel remembers last selected recipe index and restores it when gaining focus again. If the recipe list gets shorter (somehow) and last chosen index is past new size, index is set at 0.
Testing:
I was fiddling with crafting menu for a while. Recipe list did not lost focus. Craft button did not caused a crash.
Fixes #430 where recipe list in CraftPanel used to loose focus, while the craft button could still be pressed which resulted in crash. Now CraftPanel remembers last selected recipe index and restores it when gaining focus again. If the recipe list gets shorter (somehow) and last chosen index is past new size, index is set at 0.
Testing: I was fiddling with crafting menu for a while. Recipe list did not lost focus. Craft button did not caused a crash.