eDonnes124 / Town-Of-Us-R

An Among Us mod containing a bunch of roles
GNU General Public License v3.0
335 stars 135 forks source link

remove lag after 1st time opening hats #238

Open whichtwix opened 2 months ago

whichtwix commented 2 months ago

this pr removes the lag with opening the hat tab after the 1st time opening it. Object instantiating and looping through all the hats is not done after the 1st time once all the hats are cached. The hats then change parents between the hat tab and 1 of our own objects

current known bug with unknown solution: when changing from the any tab to the hat tab after the first time, an System.ArgumentException is thrown, and the previous's tab's contents also show up.

changing from color -> hat or hat -> any other tab is fine changing from any tab except color -> hats causes a visual bug the user has to go to color first to get to hats