DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OptionsMenuSounds()

void ScriptedWidgetEventHandler::OptionsMenuSounds ( Widget parent,
Widget details_root,
GameOptions options,
OptionsMenu menu )
inlineprivate

См. определение в файле OptionsMenuSounds.c строка 37

38 {
40 m_DetailsRoot = details_root;
41 m_DetailsBodyDefault = m_DetailsRoot.FindAnyWidget("settings_details_body");
42 m_DetailsBodyConnectivity = m_DetailsRoot.FindAnyWidget("settings_details_body_connectivity");
43 m_DetailsLabel = TextWidget.Cast( m_DetailsRoot.FindAnyWidget("details_label"));
44 m_DetailsText = RichTextWidget.Cast( m_DetailsRoot.FindAnyWidget("details_content"));
45 m_Options = options;
46 m_Menu = menu;
47
48 m_MasterOption = NumericOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_MASTER_VOLUME));
49 m_EffectsOption = NumericOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_EFFECTS_SLIDER));
50 m_MusicOption = NumericOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_MUSIC_SLIDER));
51 m_VOIPOption = NumericOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_VON_SLIDER));
52 m_VOIPThresholdOption = NumericOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_VON_THRESHOLD_SLIDER));
53 m_InputModeOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_VON_INPUT_MODE));
54
55 m_MissionGameplay = MissionGameplay.Cast(GetGame().GetMission());
56 m_VonManager = VONManager.GetInstance();
57 m_AudioLevelTimer = new Timer();
58 m_AudioLevelTimer.Run(0.1, this, "UpdateAudioLevel", null, true);
59
60 m_Root.FindAnyWidget( "master_setting_option" ).SetUserID(OptionAccessType.AT_OPTIONS_MASTER_VOLUME);
61 m_Root.FindAnyWidget( "effects_setting_option" ).SetUserID(OptionAccessType.AT_OPTIONS_EFFECTS_SLIDER);
62 m_Root.FindAnyWidget( "music_setting_option" ).SetUserID(OptionAccessType.AT_OPTIONS_MUSIC_SLIDER);
63 m_Root.FindAnyWidget( "voip_output_setting_option" ).SetUserID(OptionAccessType.AT_OPTIONS_VON_SLIDER);
64 m_Root.FindAnyWidget( "voip_threshold_setting_option" ).SetUserID(OptionAccessType.AT_OPTIONS_VON_THRESHOLD_SLIDER);
65 m_Root.FindAnyWidget( "voip_selection_setting_option" ).SetUserID(OptionAccessType.AT_OPTIONS_VON_INPUT_MODE);
66 m_Root.FindAnyWidget( "ambient_music_mode_option" ).SetUserID(OptionIDsScript.OPTION_AMBIENT_MUSIC_MODE);
67
69
70 array<string> inputModeValues = {
71 "#STR_Controls_PushToTalk",
72 "#STR_USRACT_UAVOICEOVERNETTOGGLE",
73 };
74 array<string> ambientMusicModeValues = {
75 "#STR_Ambient_Music_Enabled",
76 "#STR_Ambient_Music_Menu_Only",
77 };
78
79 m_MasterSelector = new OptionSelectorSlider(m_Root.FindAnyWidget("master_setting_option" ), m_MasterOption.ReadValue(), this, false, m_MasterOption.GetMin(), m_MasterOption.GetMax());
80 m_EffectsSelector = new OptionSelectorSlider(m_Root.FindAnyWidget("effects_setting_option" ), m_EffectsOption.ReadValue(), this, false, m_EffectsOption.GetMin(), m_EffectsOption.GetMax());
81 m_VOIPSelector = new OptionSelectorSlider(m_Root.FindAnyWidget("voip_output_setting_option" ), m_VOIPOption.ReadValue(), this, false, m_VOIPOption.GetMin(), m_VOIPOption.GetMax());
82 m_VOIPThresholdSelector = new OptionSelectorLevelMarker(m_Root.FindAnyWidget("voip_threshold_setting_option" ), m_VOIPThresholdOption.ReadValue(), this, false, m_VOIPThresholdOption.GetMin(), m_VOIPThresholdOption.GetMax());
83 m_MusicSelector = new OptionSelectorSlider(m_Root.FindAnyWidget("music_setting_option" ), m_MusicOption.ReadValue(), this, false, m_MusicOption.GetMin(), m_MusicOption.GetMax());
84 m_InputModeSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("voip_selection_setting_option" ), m_InputModeOption.GetIndex(), this, false, inputModeValues);
85 m_AmbientMusicSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("ambient_music_mode_option" ), g_Game.GetProfileOptionInt(EDayZProfilesOptions.AMBIENT_MUSIC_MODE), this, false, ambientMusicModeValues);
86
87 m_MasterSelector.m_OptionChanged.Insert(UpdateMaster);
88 m_EffectsSelector.m_OptionChanged.Insert(UpdateEffects);
89 m_VOIPSelector.m_OptionChanged.Insert(UpdateVOIP);
90 m_VOIPThresholdSelector.m_OptionChanged.Insert(UpdateVOIPThreshold);
91 m_MusicSelector.m_OptionChanged.Insert(UpdateMusic);
93 m_InputModeSelector.m_OptionChanged.Insert(UpdateInputMode);
94
96 {
97 // event to monitor when options get reverted directly from C++
98 m_VOIPThresholdOption.GetEvents().Event_OnRevert.Insert(m_VonManager.OnVOIPThresholdChanged);
99 m_VonManager.m_OnVonStateEvent.Insert(OnVonStateEvent);
100 m_VonManager.m_OnPartyChatChangedEvent.Insert(OnPartyChatChangedEvent);
101 m_VOIPThresholdSelector.m_OptionChanged.Insert(m_VonManager.OnVOIPThresholdChanged);
102 }
103
104 float x, y, y2;
105 m_Root.FindAnyWidget("sound_settings_scroll").GetScreenSize(x, y);
106 m_Root.FindAnyWidget("sound_settings_root").GetScreenSize(x, y2);
107 int f = (y2 > y);
108 m_Root.FindAnyWidget("sound_settings_scroll").SetAlpha(f);
109
110 m_Root.SetHandler(this);
111
112 CGame game = GetGame();
114
115 // do not enable mic capture if user in party chat
116 if (!game.IsInPartyChat())
117 {
118 game.EnableMicCapture(true);
119 }
120 }
DayZGame g_Game
Определения DayZGame.c:3868
EDayZProfilesOptions
Определения EDayZProfilesOptions.c:2
Icon x
Icon y
proto native bool IsMicCapturing()
Returns whether mic is currently capturing audio from user.
proto native bool IsInPartyChat()
Returns whether user is currently in a voice party (currently only supported on xbox)
proto native WorkspaceWidget GetWorkspace()
proto native void EnableMicCapture(bool enable)
Enable microphone to locally capture audio from user. Audio heard does NOT automatically get transmit...
ref NumericOptionsAccess m_MusicOption
Определения OptionsMenuSounds.c:16
ref OptionSelectorMultistate m_AmbientMusicSelector
Определения OptionsMenuSounds.c:25
GameOptions m_Options
Определения OptionsMenuControls.c:18
bool m_WasMicCapturing
Определения OptionsMenuSounds.c:35
VONManagerBase m_VonManager
Определения OptionsMenuSounds.c:31
void UpdateAmbientSoundModeOption(int value)
Определения OptionsMenuSounds.c:397
void UpdateVOIP(float value)
Определения OptionsMenuSounds.c:379
ref NumericOptionsAccess m_MasterOption
Определения OptionsMenuSounds.c:12
ref NumericOptionsAccess m_VOIPThresholdOption
Определения OptionsMenuSounds.c:15
void OnPartyChatChangedEvent()
Определения OptionsMenuSounds.c:238
Widget m_Root
Определения SizeToChild.c:9
ref NumericOptionsAccess m_VOIPOption
Определения OptionsMenuSounds.c:14
ref OptionSelectorSlider m_VOIPSelector
Определения OptionsMenuSounds.c:21
ref OptionSelectorLevelMarker m_VOIPThresholdSelector
Определения OptionsMenuSounds.c:22
ref Timer m_AudioLevelTimer
Определения OptionsMenuSounds.c:27
CameraToolsMenu m_Menu
Определения CTEvent.c:8
ref OptionSelectorSlider m_MusicSelector
Определения OptionsMenuSounds.c:23
RichTextWidget m_DetailsText
Определения OptionsMenuControls.c:15
ref NumericOptionsAccess m_EffectsOption
Определения OptionsMenuSounds.c:13
void UpdateInputMode(int newIndex)
Определения OptionsMenuSounds.c:402
ref OptionSelectorMultistate m_InputModeSelector
Определения OptionsMenuSounds.c:24
void UpdateEffects(float value)
Определения OptionsMenuSounds.c:373
Widget m_DetailsBodyConnectivity
Определения OptionsMenuControls.c:8
void UpdateVOIPThreshold(float value)
Определения OptionsMenuSounds.c:385
Widget m_DetailsBodyDefault
Определения OptionsMenuControls.c:7
ref OptionSelectorSlider m_EffectsSelector
Определения OptionsMenuSounds.c:20
MissionGameplay m_MissionGameplay
Определения OptionsMenuSounds.c:30
void UpdateMusic(float value)
Определения OptionsMenuSounds.c:391
ref ListOptionsAccess m_InputModeOption
Определения OptionsMenuSounds.c:17
void UpdateMaster(float value)
Определения OptionsMenuSounds.c:367
void OnVonStateEvent()
Определения OptionsMenuSounds.c:225
ref OptionSelectorSlider m_MasterSelector
Определения OptionsMenuSounds.c:19
TextWidget m_DetailsLabel
Определения OptionsMenuControls.c:14
OptionIDsScript
Used for script-based game options. For anything C++ based, you would most likely use "Option Access ...
Определения gameplay.c:1293
proto native CGame GetGame()
OptionAccessType
C++ OptionAccessType.
Определения gameplay.c:1224
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.

Перекрестные ссылки WorkspaceWidget::CreateWidgets(), CGame::EnableMicCapture(), FillTextMap(), g_Game, GetGame(), VONManager::GetInstance(), GetLayoutName(), CGame::GetWorkspace(), CGame::IsInPartyChat(), CGame::IsMicCapturing(), m_AmbientMusicSelector, m_AudioLevelTimer, m_DetailsBodyConnectivity, m_DetailsBodyDefault, m_DetailsLabel, m_DetailsRoot, m_DetailsText, m_EffectsOption, m_EffectsSelector, m_InputModeOption, m_InputModeSelector, m_MasterOption, m_MasterSelector, m_Menu, m_MissionGameplay, m_MusicOption, m_MusicSelector, m_Options, m_Root, m_VOIPOption, m_VOIPSelector, m_VOIPThresholdOption, m_VOIPThresholdSelector, m_VonManager, m_WasMicCapturing, OnPartyChatChangedEvent(), OnVonStateEvent(), UpdateAmbientSoundModeOption(), UpdateEffects(), UpdateInputMode(), UpdateMaster(), UpdateMusic(), UpdateVOIP(), UpdateVOIPThreshold(), x и y.