remance / Masendor

Open source educational and historical battle action game, All helps accepted
MIT License
142 stars 31 forks source link

Optimize list UI drawer #65

Closed coppermouse closed 1 year ago

coppermouse commented 1 year ago

I focus on getting the ListUI to be faster and we should not have to rely on not being updated/draw when not mouse over because that makes it not work as well.

I updates the image every frame but since it is cached it should go fast.

Having a cache method have forced me to refactor the code a lot. I must based the cache on values so I broken down the calculations in pure methods.

Also a lot of changes are due to autopep8.

I still see improvements to be done to the list but I think I rather fix those next time I implement a new thing in the list.