public void ThemeActivate(Object sender, OptionActivated <MenuStateThemeSelection> e) { //Theme Activation can be handled by adding an event handler to the Game Owner //on the state change. If the state is StandardTetrisGameState, we set the theme and remove the handler. //otherwise, we ignore the event trigger and wait for it to cchange to a StandardTetrisGameState. ActivatedOption = e; _Owner.BeforeGameStateChange -= _Owner_BeforeGameStateChange; _Owner.BeforeGameStateChange += _Owner_BeforeGameStateChange; }
private void MusicOptionItem_OnActivateOption(object sender, OptionActivated <SoundOption> e) { if (e.Option.SoundKey == "<RANDOM>") { TetrisGame.Soundman.PlayMusic(e.Owner.AudioThemeMan.BackgroundMusic.Key, true); } else { TetrisGame.Soundman.PlayMusic(e.Option.SoundKey, e.Owner.Settings.std.MusicVolume, true); } e.Owner.Settings.std.MusicOption = e.Option.SoundKey; }
private void SoundThemeOptionItem_OnChangeOption(object sender, OptionActivated <SoundOption> e) { e.Owner.Settings.std.SoundScheme = e.Option.SoundKey; }
public void ScaleActivate(Object sender, OptionActivated <MenuItemScaleItemSelection> e) { _Owner.SetScale(e.Option.Scale); }