home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2003 October / cmycha200310.iso / NHL2004 / NHL2004Demo.exe / fe / nhl / js / sound_options_interface.js < prev    next >
Text File  |  2003-08-20  |  4KB  |  169 lines

  1. //Copyright (c) 2002 Electronic Arts Inc. All rights reserved.
  2.  
  3. var oAudioInterface    = oGameFace.AudioInterface;
  4. var aComboBox        = null;
  5. var aAudioDetail    = new Array();
  6. var aSpeakers        = new Array();
  7. var aGameMusic        = new Array();
  8.  
  9. //main init function
  10. function initSettings()
  11. {
  12.     if (!oLeagueFace.ProviderInterface.IsInSetup())
  13.     {
  14.           oLeagueFace.ProviderInterface.EnterSetup();
  15.      }
  16.  
  17.     aComboBox = new ComboBox("drpAudioDetail",    680, 232, 170, 19, 80, "divAudioDetail");
  18.     aComboBox = new ComboBox("drpSpeakers",        210, 232, 170, 19, 60, "divSpeakers");
  19.     aComboBox = new ComboBox("drpGameMusic",    240, 232, 170, 19, 80, "divGameMusic");
  20.  
  21.     //initToggle( tglColorCommentary_off );
  22.     //initToggle( tglColorCommentary_on );
  23.     //init game interface
  24.     oCallbackTable = new CallbackTableObject();
  25.     initGameInterface( oCallbackTable );
  26.     initMusicVolume();
  27.     initSFXVolume();
  28.     initCrowdVolume();
  29.     initPlayByPlayVolume();
  30.     initGameSpeechVolume();
  31.     //initColorCommentary();
  32.     initAudioDetail();
  33.     initSpeakers();
  34.     initGameMusic();
  35. }
  36.  
  37. function canExitScreen()
  38. {
  39.     removeCallbackTable();
  40.     return true;
  41. }
  42.  
  43. function clearSettings()
  44. {    
  45. }
  46.  
  47. function initMusicVolume()
  48. {
  49.     oCallbackTable.MusicVolumeChanged();
  50. }
  51.  
  52. function initSFXVolume()
  53. {
  54.     oCallbackTable.SFXVolumeChanged();
  55. }
  56.  
  57. function initCrowdVolume()
  58. {
  59.     oCallbackTable.CrowdVolumeChanged();
  60. }
  61.  
  62. function initPlayByPlayVolume()
  63. {
  64.     oCallbackTable.PlayByPlayVolumeChanged();
  65. }
  66.  
  67. function initGameSpeechVolume()
  68. {
  69.     oCallbackTable.SpeechVolumeChanged();
  70. }
  71.  
  72. function initColorCommentary()
  73. {
  74.     oCallbackTable.ColorCommentaryChanged();
  75. }
  76.  
  77. function initAudioDetail()
  78. {
  79.     //drpAudioDetail.AppendOptions( new Array( nhlMsg('LOW_FEMSING') , nhlMsg('MEDIUM_FEMSING') , nhlMsg('HIGH_FEMSING') ));
  80.  
  81.     drpAudioDetail.ClearAll();
  82.     drpAudioDetail.AddString(nhlMsg('LOW_FEMSING'));
  83.     drpAudioDetail.AddString(nhlMsg('MEDIUM_FEMSING'));
  84.     drpAudioDetail.AddString(nhlMsg('HIGH_FEMSING'));
  85.  
  86.     oCallbackTable.AudioDetailChanged();
  87. }
  88.  
  89. function initSpeakers()
  90. {
  91.     //drpSpeakers.AppendOptions( new Array( '2' , '4'));
  92.  
  93.     drpSpeakers.ClearAll();
  94.     drpSpeakers.AddString(nhlMsg('2'));
  95.     drpSpeakers.AddString(nhlMsg('4'));
  96.  
  97.     oCallbackTable.SpeakersChanged();
  98. }
  99.  
  100. function initGameMusic()
  101. {
  102.     //drpGameMusic.AppendOptions( new Array( nhlMsg('DEFAULT') , nhlMsg('IMPORTED') , nhlMsg('DEFAULT_IMPORTED') ));
  103.  
  104.        drpGameMusic.ClearAll();
  105.     drpGameMusic.AddString(nhlMsg('DEFAULT'));
  106.     drpGameMusic.AddString(nhlMsg('IMPORTED'));
  107.     drpGameMusic.AddString(nhlMsg('DEFAULT_IMPORTED'));
  108.  
  109.     oCallbackTable.InGameMusicChanged();
  110. }
  111.  
  112. function changeMusicVolume()
  113. {
  114.      oGameData.MusicVolume = sldMusicVolume.value;
  115. }
  116.  
  117. function changeSFXVolume()
  118. {
  119.     oGameData.SFXVolume = sldSFXVolume.value;
  120. }
  121.  
  122. function changeCrowdVolume()
  123. {
  124.     oGameData.CrowdVolume = sldCrowdVolume.value;
  125. }
  126.  
  127. function changePlayByPlayVolume()
  128. {
  129.     oGameData.PlayByPlayVolume = sldPlayByPlayVolume.value;
  130. }
  131.  
  132. function changeSpeechVolume()
  133. {
  134.     oGameData.SpeechVolume = sldSpeechVolume.value;
  135. }
  136.  
  137. function changeColorCommentary( oTgl )
  138. {
  139.     oAudioInterface.PlayToggleSFX();
  140.     oGameData.ColorCommentary = oTgl.selected;
  141. }
  142.  
  143. function changeAudioDetail()
  144. {
  145.     oGameData.AudioDetail = drpAudioDetail.Selected;
  146. }
  147.  
  148. function changeSpeakers()
  149. {
  150.     oGameData.Speakers = drpSpeakers.Selected;
  151. }
  152.  
  153. function changeGameMusic()
  154. {
  155.     oGameData.InGameMusic = drpGameMusic.Selected;
  156. }
  157.  
  158. function CallbackTableObject()
  159. {
  160.     this.MusicVolumeChanged = function(){sldMusicVolume.SetValue( oGameData.MusicVolume );};
  161.     this.SFXVolumeChanged = function() {sldSFXVolume.SetValue( oGameData.SFXVolume );};
  162.     this.CrowdVolumeChanged = function () {sldCrowdVolume.SetValue( oGameData.CrowdVolume );};
  163.     this.PlayByPlayVolumeChanged = function () {sldPlayByPlayVolume.SetValue( oGameData.PlayByPlayVolume );};
  164.     this.SpeechVolumeChanged = function () {sldSpeechVolume.SetValue( oGameData.SpeechVolume); };
  165.     //this.ColorCommentaryChanged = function () { (oGameData.ColorCommentary) ? doSwap( tglColorCommentary_on ) : doSwap( tglColorCommentary_off ); };
  166.     this.AudioDetailChanged = function () {drpAudioDetail.Selected = oGameData.AudioDetail; };
  167.     this.SpeakersChanged = function () {drpSpeakers.Selected = oGameData.Speakers; };
  168.     this.InGameMusicChanged = function () {drpGameMusic.Selected = oGameData.InGameMusic; };
  169. }