Skip to content

Commit 59b5fb2

Browse files
committed
Revert "Add client setting to toggle internet sound streams (#834)"
This reverts commit bdb8013.
1 parent 0e8ab99 commit 59b5fb2

File tree

8 files changed

+16
-89
lines changed

8 files changed

+16
-89
lines changed

Client/core/CClientVariables.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
*
3-
* PROJECT: Multi Theft Auto
3+
* PROJECT: Multi Theft Auto v1.0
44
* LICENSE: See LICENSE in the top level directory
55
* FILE: core/CClientVariables.cpp
66
* PURPOSE: Managed storage of client variables (cvars)
@@ -331,7 +331,6 @@ void CClientVariables::LoadDefaults()
331331
DEFAULT("high_detail_peds", 0); // Disable rendering high detail peds all the time
332332
DEFAULT("fast_clothes_loading", 1); // 0-off 1-auto 2-on
333333
DEFAULT("allow_screen_upload", 1); // 0-off 1-on
334-
DEFAULT("allow_external_sounds", 1); // 0-off 1-on
335334
DEFAULT("max_clientscript_log_kb", 5000); // Max size in KB (0-No limit)
336335
DEFAULT("display_fullscreen_style", 0); // 0-standard 1-borderless 2-borderless keep res 3-borderless stretch
337336
DEFAULT("display_windowed", 0); // 0-off 1-on

Client/core/CSettings.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,6 @@ void CSettings::CreateGUI()
376376
m_pCheckBoxAllowScreenUpload->GetPosition(vecTemp, false);
377377
m_pCheckBoxAllowScreenUpload->AutoSize(NULL, 20.0f);
378378

379-
m_pCheckBoxAllowExternalSounds = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabMultiplayer, _("Allow external sounds"), true));
380-
m_pCheckBoxAllowExternalSounds->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 20.0f));
381-
m_pCheckBoxAllowExternalSounds->GetPosition(vecTemp, false);
382-
m_pCheckBoxAllowExternalSounds->AutoSize(NULL, 20.0f);
383-
384379
m_pCheckBoxCustomizedSAFiles = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabMultiplayer, _("Use customized GTA:SA files"), true));
385380
m_pCheckBoxCustomizedSAFiles->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 20.0f));
386381
m_pCheckBoxCustomizedSAFiles->GetPosition(vecTemp, false);
@@ -1218,7 +1213,6 @@ void CSettings::CreateGUI()
12181213
m_pComboFxQuality->SetSelectionHandler(GUI_CALLBACK(&CSettings::OnFxQualityChanged, this));
12191214
m_pCheckBoxVolumetricShadows->SetClickHandler(GUI_CALLBACK(&CSettings::OnVolumetricShadowsClick, this));
12201215
m_pCheckBoxAllowScreenUpload->SetClickHandler(GUI_CALLBACK(&CSettings::OnAllowScreenUploadClick, this));
1221-
m_pCheckBoxAllowExternalSounds->SetClickHandler(GUI_CALLBACK(&CSettings::OnAllowExternalSoundsClick, this));
12221216
m_pCheckBoxCustomizedSAFiles->SetClickHandler(GUI_CALLBACK(&CSettings::OnCustomizedSAFilesClick, this));
12231217
m_pCheckBoxWindowed->SetClickHandler(GUI_CALLBACK(&CSettings::OnWindowedClick, this));
12241218
m_pCheckBoxDPIAware->SetClickHandler(GUI_CALLBACK(&CSettings::OnDPIAwareClick, this));
@@ -1512,11 +1506,6 @@ void CSettings::UpdateVideoTab()
15121506
CVARS_GET("allow_screen_upload", bAllowScreenUploadEnabled);
15131507
m_pCheckBoxAllowScreenUpload->SetSelected(bAllowScreenUploadEnabled);
15141508

1515-
// Allow external sounds
1516-
bool bAllowExternalSoundsEnabled;
1517-
CVARS_GET("allow_external_sounds", bAllowExternalSoundsEnabled);
1518-
m_pCheckBoxAllowExternalSounds->SetSelected(bAllowExternalSoundsEnabled);
1519-
15201509
// Customized sa files
15211510
m_pCheckBoxCustomizedSAFiles->SetSelected(GetApplicationSettingInt("customized-sa-files-request") != 0);
15221511
m_pCheckBoxCustomizedSAFiles->SetVisible(GetApplicationSettingInt("customized-sa-files-show") != 0);
@@ -3344,10 +3333,6 @@ void CSettings::SaveData()
33443333
bool bAllowScreenUploadEnabled = m_pCheckBoxAllowScreenUpload->GetSelected();
33453334
CVARS_SET("allow_screen_upload", bAllowScreenUploadEnabled);
33463335

3347-
// Allow external sounds
3348-
bool bAllowExternalSoundsEnabled = m_pCheckBoxAllowExternalSounds->GetSelected();
3349-
CVARS_SET("allow_external_sounds", bAllowExternalSoundsEnabled);
3350-
33513336
// Grass
33523337
bool bGrassEnabled = m_pCheckBoxGrass->GetSelected();
33533338
CVARS_SET("grass", bGrassEnabled);
@@ -4351,24 +4336,6 @@ bool CSettings::OnAllowScreenUploadClick(CGUIElement* pElement)
43514336
return true;
43524337
}
43534338

4354-
//
4355-
// AllowExternalSounds
4356-
//
4357-
bool CSettings::OnAllowExternalSoundsClick(CGUIElement* pElement)
4358-
{
4359-
if (!m_pCheckBoxAllowExternalSounds->GetSelected() && !m_bShownAllowExternalSoundsMessage)
4360-
{
4361-
m_bShownAllowExternalSoundsMessage = true;
4362-
SString strMessage;
4363-
strMessage +=
4364-
_("Some scripts may play sounds, such as radio, from the internet."
4365-
"\n\nDisabling this setting may decrease network"
4366-
"\nbandwidth consumption.\n");
4367-
CCore::GetSingleton().ShowMessageBox(_("EXTERNAL SOUNDS"), strMessage, MB_BUTTON_OK | MB_ICON_INFO);
4368-
}
4369-
return true;
4370-
}
4371-
43724339
//
43734340
// CustomizedSAFiles
43744341
//

Client/core/CSettings.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
*
3-
* PROJECT: Multi Theft Auto
3+
* PROJECT: Multi Theft Auto v1.0
44
* LICENSE: See LICENSE in the top level directory
55
* FILE: core/CSettings.h
66
* PURPOSE: Header file for in-game settings window class
@@ -152,7 +152,6 @@ class CSettings
152152
CGUICheckBox* m_pCheckBoxDeviceSelectionDialog;
153153
CGUICheckBox* m_pCheckBoxShowUnsafeResolutions;
154154
CGUICheckBox* m_pCheckBoxAllowScreenUpload;
155-
CGUICheckBox* m_pCheckBoxAllowExternalSounds;
156155
CGUICheckBox* m_pCheckBoxCustomizedSAFiles;
157156
CGUICheckBox* m_pCheckBoxGrass;
158157
CGUICheckBox* m_pCheckBoxHeatHaze;
@@ -378,7 +377,6 @@ class CSettings
378377
bool OnFxQualityChanged(CGUIElement* pElement);
379378
bool OnVolumetricShadowsClick(CGUIElement* pElement);
380379
bool OnAllowScreenUploadClick(CGUIElement* pElement);
381-
bool OnAllowExternalSoundsClick(CGUIElement* pElement);
382380
bool OnCustomizedSAFilesClick(CGUIElement* pElement);
383381
bool ShowUnsafeResolutionsClick(CGUIElement* pElement);
384382
bool OnWindowedClick(CGUIElement* pElement);
@@ -445,7 +443,6 @@ class CSettings
445443
DWORD m_dwFrameCount;
446444
bool m_bShownVolumetricShadowsWarning;
447445
bool m_bShownAllowScreenUploadMessage;
448-
bool m_bShownAllowExternalSoundsMessage;
449446
int m_iMaxAnisotropic;
450447

451448
std::list<SKeyBindSection*> m_pKeyBindSections;

Client/mods/deathmatch/logic/CClientSound.cpp

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*****************************************************************************
22
*
3-
* PROJECT: Multi Theft Auto
3+
* PROJECT: Multi Theft Auto v1.0
4+
* (Shared logic for modifications)
45
* LICENSE: See LICENSE in the top level directory
5-
* FILE: mods/deathmatch/logic/CClientSound.cpp
6+
* FILE: mods/shared_logic/CClientSound.cpp
67
* PURPOSE: Sound entity class
78
*
89
*****************************************************************************/
@@ -62,15 +63,12 @@ void CClientSound::DistanceStreamIn()
6263
{
6364
if (!m_pAudio)
6465
{
65-
// If the sound was successfully created, we stream it in
66-
if (Create())
67-
{
68-
m_pSoundManager->OnDistanceStreamIn(this);
66+
Create();
67+
m_pSoundManager->OnDistanceStreamIn(this);
6968

70-
// Call Stream In event
71-
CLuaArguments Arguments;
72-
CallEvent("onClientElementStreamIn", Arguments, true);
73-
}
69+
// Call Stream In event
70+
CLuaArguments Arguments;
71+
CallEvent("onClientElementStreamIn", Arguments, true);
7472
}
7573
}
7674

@@ -106,11 +104,6 @@ bool CClientSound::Create()
106104
if (m_pAudio)
107105
return false;
108106

109-
// If we're not allowed to play a stream, stop here
110-
if (m_bStream)
111-
if (!g_pCore->GetCVars()->GetValue("allow_external_sounds", true))
112-
return false;
113-
114107
// Initial state
115108
if (!m_pBuffer)
116109
m_pAudio = new CBassAudio(m_bStream, m_strPath, m_bLoop, m_bThrottle, m_b3D);
@@ -633,35 +626,6 @@ bool CClientSound::IsFxEffectEnabled(uint uiFxEffect)
633626
////////////////////////////////////////////////////////////
634627
void CClientSound::Process3D(const CVector& vecPlayerPosition, const CVector& vecCameraPosition, const CVector& vecLookAt)
635628
{
636-
// If this is a stream
637-
if (m_bStream)
638-
{
639-
// Check if we're allowed to play streams, otherwise just destroy the stream
640-
// This way we can start the stream without the need to handle this edge case in scripting
641-
if (g_pCore->GetCVars()->GetValue("allow_external_sounds", true))
642-
{
643-
if (!m_pAudio)
644-
{
645-
// call onClientSoundStarted
646-
CLuaArguments Arguments;
647-
Arguments.PushString("enabled"); // Reason
648-
CallEvent("onClientSoundStarted", Arguments, false);
649-
Create();
650-
}
651-
}
652-
else
653-
{
654-
if (m_pAudio)
655-
{
656-
// call onClientSoundStopped
657-
CLuaArguments Arguments;
658-
Arguments.PushString("disabled"); // Reason
659-
CallEvent("onClientSoundStopped", Arguments, false);
660-
Destroy();
661-
}
662-
}
663-
}
664-
665629
// Update 3D things if required
666630
if (m_b3D)
667631
{

Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
*
3-
* PROJECT: Multi Theft Auto
3+
* PROJECT: Multi Theft Auto v1.0
44
* LICENSE: See LICENSE in the top level directory
55
* FILE: mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
66
* PURPOSE: Scripting function processing

Client/mods/deathmatch/logic/CStaticFunctionDefinitions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
*
3-
* PROJECT: Multi Theft Auto
3+
* PROJECT: Multi Theft Auto v1.0
44
* LICENSE: See LICENSE in the top level directory
55
* FILE: mods/deathmatch/logic/CStaticFunctionDefinitions.h
66
* PURPOSE: Header for static function definitions class

Client/mods/deathmatch/logic/luadefs/CLuaAudioDefs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*****************************************************************************
22
*
3-
* PROJECT: Multi Theft Auto
3+
* PROJECT: Multi Theft Auto v1.x
44
* LICENSE: See LICENSE in the top level directory
5-
* FILE: mods/deathmatch/logic/luadefs/CLuaAudioDefs.cpp
5+
* FILE: mods/shared_logic/luadefs/CLuaAudioDefs.cpp
66
* PURPOSE: Lua audio definitions class
77
*
88
* Multi Theft Auto is available from http://www.multitheftauto.com/

Client/mods/deathmatch/logic/luadefs/CLuaAudioDefs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*****************************************************************************
22
*
3-
* PROJECT: Multi Theft Auto
3+
* PROJECT: Multi Theft Auto v1.x
44
* LICENSE: See LICENSE in the top level directory
5-
* FILE: mods/deathmatch/logic/luadefs/CLuaAudioDefs.h
5+
* FILE: mods/shared_logic/luadefs/CLuaAudioDefs.h
66
* PURPOSE: Lua audio definitions class header
77
*
88
* Multi Theft Auto is available from http://www.multitheftauto.com/

0 commit comments

Comments
 (0)