Tomash667 / carpg

Combination of action rpg with roguelike.
https://carpg.pl
MIT License
16 stars 15 forks source link

fixed #430 Crash on crafting in Alchemy #432

Closed BottledByte closed 4 years ago

BottledByte commented 4 years ago

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.

Tomash667 commented 4 years ago

Look good but I like to test it, after 15:00 (before that I'm at work) :)