The purpose of this patch is to fix these defects:
- The CSlider GUI object type in rP19479/D325 doesn't play sounds when pressed (unlike buttons, checkboxes, dropdowns)
- The CSlider GUI object does not allow the script side to determine if the value is currently being changed by the user (mouse being pressed, moved)
- The Gamesetup usage of this slider in rP23430/D2571 has the issue that the slider is lagging behind in multiplayer mode, because the slider value is updated to the current selection, but that selection is updated only after being sent across the network. (Noticed by me before the commit, but I didn't notice that it was inacceptably bad until nani reported it to me.)
The patch solves (1) and (2) by adding inheritance of IGUIButtonBehavior to CSlider, and solves (3) by not updating the slider value with the g_GameAttributes value if the user is currently picking a value.
There are two aspects to consider:
- The CSlider changes values incrementally upon mousemove events. It could be changed to pick the value at the current mouse position, as was done in rP22164/D1622. That would fix the slider position not being at the current mouse position. However it would not fix that the slider would still jump back to an outdated g_GameAttributes value in multiplayer mode (due to the greater than zero network lag) before jumping back to the mouse position.
- In the future code, there may be multiple gamesetup controlers changing g_GameAttributes simultaneously, so one should not assume that only the host changes settings.