MCPcopy Create free account
hub / github.com/TurningWheel/Barony / process

Method process

src/mod_tools.cpp:10409–10585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10407}
10408
10409void GameplayPreferences_t::process()
10410{
10411 if ( player < 0 )
10412 {
10413 for ( int i = 0; i < MAXPLAYERS; ++i )
10414 {
10415 if ( &gameplayPreferences[i] == this )
10416 {
10417 player = i;
10418 break;
10419 }
10420 }
10421 }
10422
10423 if ( player < 0 || player >= MAXPLAYERS )
10424 {
10425 return;
10426 }
10427
10428 if ( players[player]->isLocalPlayer() )
10429 {
10430 int index = 0;
10431 for ( auto& pref : preferences )
10432 {
10433 switch ( index )
10434 {
10435 case GPREF_ARACHNOPHOBIA:
10436 pref.set(MainMenu::arachnophobia_filter ? 1 : 0);
10437 break;
10438 case GPREF_COLORBLIND:
10439 pref.set(colorblind ? 1 : 0);
10440 break;
10441 case GPREF_VOICE_NO_RECV:
10442 // we don't have voice receive volume set, drop packets
10443#ifdef USE_FMOD
10444 pref.set(((!VoiceChat.useSystem || !VoiceChat.getAudioSettingBool(VoiceChat_t::AudioSettingBool::VOICE_SETTING_ENABLE_VOICE_RECEIVE)) ? 1 : 0) << player);
10445#else
10446 pref.set(1 << player);
10447#endif
10448 break;
10449 case GPREF_VOICE_NO_SEND:
10450 // we don't have voice input device or otherwise don't want to use it
10451#ifdef USE_FMOD
10452 pref.set(((!VoiceChat.useSystem || !VoiceChat.bRecordingInit
10453 || (VoiceChat.mainMenuAudioTabOpen()
10454 && VoiceChat.getAudioSettingBool(VoiceChat_t::AudioSettingBool::VOICE_SETTING_LOOPBACK_LOCAL_RECORD))
10455 || !VoiceChat.getAudioSettingBool(VoiceChat_t::AudioSettingBool::VOICE_SETTING_ENABLE_VOICE_INPUT)
10456 || !VoiceChat.getAudioSettingBool(VoiceChat_t::AudioSettingBool::VOICE_SETTING_ENABLE_VOICE_RECEIVE)) ? 1 : 0) << player);
10457#elif defined(NINTENDO)
10458 pref.set(1 << player);
10459#else
10460 pref.set(1 << player);
10461#endif
10462 break;
10463 case GPREF_VOICE_PTT:
10464#ifdef USE_FMOD
10465 pref.set((VoiceChat.getAudioSettingBool(VoiceChat_t::AudioSettingBool::VOICE_SETTING_PUSHTOTALK) ? 1 : 0) << player);
10466#else

Callers 1

startTutorialMethod · 0.45

Calls 5

isLocalPlayerMethod · 0.80
getAudioSettingBoolMethod · 0.80
mainMenuAudioTabOpenMethod · 0.80
setMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected