This PR make painter form scroll bars draggable The problem is that if you resend the player the formspec, their scrollbar drag will end. Scrollbars produce constant output when they are being dragged so you can't resend the formspec whenever getting scrollbar changes. The solution is to set a timer. If the player moves the scrollbar again, cancel the timer. When the timer expires resend the formspec. I used this technique in my edit_skin mod.
Other changes:
removed from/to_slider_rgb in favor of setting the scrollbar range directly.
return true from on_player_receive_fields if it is the painter formspec so no other callbacks will be called.
Set the color from the hex field when enter is pressed instead of doing nothing.
Other problems with painter (this PR does not fix):
If you use a painter on a car without setting a color you get a warning.
This file is a mix of tabs and spaces. Mostly tabs. I would have converted it to all spaces to be consistent with the rest of the mod but then the diff would be useless so that will need to be a different PR.
UI is bad. Before looking at the code I thought you had to press set color whenever changing the color. but actually you only need to do it if setting the hex field. Also the scrollbars are very narrow.
This PR make painter form scroll bars draggable The problem is that if you resend the player the formspec, their scrollbar drag will end. Scrollbars produce constant output when they are being dragged so you can't resend the formspec whenever getting scrollbar changes. The solution is to set a timer. If the player moves the scrollbar again, cancel the timer. When the timer expires resend the formspec. I used this technique in my edit_skin mod.
Other changes:
Other problems with painter (this PR does not fix):