Ok so using your code above, I've managed to use it to change the look and behaviour of the following engine parameters:
Preferences Panel
> UI.ButtonPanel.ShowCommandKey - now has two radio buttons for on/off
> Fog of War - same thing - two radion buttons for on/off
> Grab Mouse - same again.
Speed Panel (New)
> Game Speed Slider
> Mouse Scroll Speed Slider
(I want to make a "Key Scroll Slider" for this panel too, just like the original war2 had, but the code isn't there. Would it be hard to implement into the engine? Could I simply copy and rename the mouse scroll speed code?)
Sound Panel
> Effects Volume Slider
> Music Volume Slider
> Has Sound on/off and Music on/off radio buttons as well... The sound on/off buttons work perfectly, but the music on/off radio buttons only work when turning the music off. Clicking the "on" music radio button does not re-enable the music. Here's the code I used for the music radio buttons:
Code: Select all
local musiccheckbox = {}
musiccheckbox = menu:addImageRadioButton("", "musiccheckbox", 138, 200, offi, offi2, oni, oni2, function() SetMusicEnabled(true) end)
musiccheckbox:setMarked(IsMusicEnabled())
musiccheckbox = menu:addImageRadioButton("", "musiccheckbox", 138, 222, offi, offi2, oni, oni2, function() SetMusicEnabled(false) end)
if (IsMusicEnabled() == true) then
musiccheckbox:setMarked(false)
else
musiccheckbox:setMarked(true)
end
Whoops! Forgot pics!
- preferences.png (130.07 KiB) Viewed 5782 times
- sound.png (122.42 KiB) Viewed 5782 times
- speed.png (122.54 KiB) Viewed 5782 times