CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
563 stars 85 forks source link

Custom Dropdown - prevent unwanted option change on mouse wheel scrool #1733

Closed krzychu124 closed 1 year ago

krzychu124 commented 1 year ago

Fixes #1379

Build ZIP

krzychu124 commented 1 year ago

I've added fix for memory leak and reduced number of instances created since for Dropdown the scrollbar stored under listScrollbar property is used as a template to generate a clone of scrollbar for popup window with options, so we can safely share a single instance across all components where needed, but needs to be destroyed manually between loading scenes, and it cannot be attached to component tree for automated lifecycle managment because layout breaks (attached component takes up the space...), hence why such weird construct (template is destroyed with first destroyed dropdown). 😕 I'll figure out better way of handling such case, since I saw more usecases but for now it works good enough for our needs.