BepInEx / BepInEx.ConfigurationManager

Plugin configuration manager for BepInEx
https://www.patreon.com/ManlyMarco
GNU Lesser General Public License v3.0
231 stars 53 forks source link

Validate values on lost focus instead of immediately / Typing in floats is difficult and using - characters can throw up errors. #14

Open krypto5863 opened 3 years ago

krypto5863 commented 3 years ago

ConfigurationManager seems to really dislike it when you try to type in 0 after values higher than 0 in a decimal position. It also seems to really dislike typing in zeros before them in whole number places. Makes the configurations kinda wonky to use.

Also, trying to type a - sign anywhere but the start of the number throws up a good chunk of red in the console.

Hope this is fixed, configmanager is really handy for development...

ManlyMarco commented 3 years ago

This is because the input is validated after every key press to make development easier. I didn't bother to improve it since most of the time the slider is used (you need to specify value range to make it show up though). To fix this the input would have to be validated after focus is lost.

krypto5863 commented 3 years ago

So after pressing enter or clicking another box? I'd personally prefer this implementation. Apply changes when changes are complete and all that.

Californ1a commented 4 months ago

I was also looking to see if this was an option - right now all string configs kind of need a debounce timer added to them to prevent them from firing off with every letter the user types into the config. It would be very useful if there were two separate events similar to html's change event and input event so you would have the option of both/either live events and/or a single final event.