Yes, one variable per setting is enough (if it weren't possible to cancel, you'd need no additional vars; adding this possibility adds the need for one additional variable per setting.)
I believe Ultra Magnus thought he'd need two because one can't read e.g. the current MusicMasterVolume.
Ultra Magnus:
Say the music volume is 70 at the start of the game. lastMlevel, sldMusic.Value and the game's MusicMasterVolume are all set to 70.
Now the player opens the settings GUI, then slides the slider to 80. This changes the actual volume to 80, so both sldMusic.Value and MusicMasterVolume are 80 now.
Resume:
-Set lastMlevel to sldMusic.Value
-exit
Cancel:
-Set sldMusic.Value and MusicMasterVolume to lastMlevel
So the functions are supposed to look like this:
[code]function btnResume_OnClick(GUIControl *control, MouseButton button)
{
lastMlevel=sldMusic.Value;
lastSlevel=sldSound.Value;
lastGlevel=sldGamma.Value;
}
function btnNoChange_OnClick(GUIControl *control, MouseButton button)
{
sldMusic.Value=lastMlevel;
SetMusicMasterVolume(lastMlevel);
sldSound.Value=lastSlevel;
SetSoundVolume(lastSlevel);
sldGamma.Value=lastGlevel;
System.Gamma=lastGlevel;
}[/code]