Restoring game volume level when restoring a game

Started by pcj, Mon 15/08/2011 14:40:07

Previous topic - Next topic

pcj

I'm trying to restore the volume level the game was set at when the save file occurred (I wish it happened automatically but it doesn't seem to).  I'm using this code and even though the btnVolume slider returns the correct value it isn't being set to that volume:

Code: ags
function on_event(EventType event, int data) {
  // [...]
  else if (event == eEventRestoreGame) {
    System.Volume = btnVolume.Value;
    SetGameSpeed(btnSpeed.Value);
  }
}


It should work but doesn't... any way to work around?
Space Quest: Vohaul Strikes Back is now available to download!

pcj

I've worked around this by just looping through all the AudioChannels in the game and setting their volume individually rather than setting the System.Volume, but I'm pretty sure this is a bug that should be fixed...
Space Quest: Vohaul Strikes Back is now available to download!

Monsieur OUXX

Techies?
Would this be a bug in the new Audio classes?
 

SMF spam blocked by CleanTalk