Skip to content

Commit 8ffc446

Browse files
committed
internetradio: small tweaks
1 parent 3dd5cbd commit 8ffc446

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

[gameplay]/internetradio/config/ShRadioConfig.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
-- ## Version: 1.0 ##
55
-- #######################################
66

7-
RADIO_CREATE_SPEAKER_DELAY = 3000
7+
RADIO_CREATE_SPEAKER_DELAY = 1000
88
RADIO_TOGGLE_SPEAKER_DELAY = 1500
99
RADIO_DESTROY_SPEAKER_DELAY = 1500
1010
RADIO_ALLOW_CUSTOM_URLS = true
11-
RADIO_STREAM_URL_MAX_LENGTH = 512
11+
RADIO_STREAM_URL_MAX_LENGTH = 1024 -- Accomodate long .mp3 CDN URLs from certain YT converter sites
1212
RADIO_MAX_SOUND_DISTANCE = 65
1313
RADIO_STATIONS = {
1414
{"[Top 40 Mix] BAYERN Radio - Top40", "http://stream.antenne.de:80/top-40"},
@@ -95,4 +95,4 @@ RADIO_STATIONS = {
9595
{"[Summer96] RadioRecord", "https://radiorecord.hostingradio.ru/summerparty96.aacp"},
9696
{"[Dance] BAYERN Radio - Dance XXL", "http://stream.antenne.de:80/dance-xxl"},
9797
{"[Dance] FunX Dance", "https://icecast.omroep.nl/funx-dance-bb-mp3"},
98-
}
98+
}

[gameplay]/internetradio/gui/CRadioGUI.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ local function initializeRadioGUI()
1313

1414
local screenX, screenY = guiGetScreenSize()
1515
local radioWindowSizeX, radioWindowSizeY = 325, 380
16-
local radioWindowPosX, radioWindowPosY = (screenX - 325)/1.1, (screenY - 380)/1.4
16+
local radioWindowPosX, radioWindowPosY = (screenX - 325) / 1.1, (screenY - 380) / 1.4
1717
local allowRemoteSpeakers = getRadioSetting("allowRemoteSpeakers")
1818

1919
RADIO_GUI = {}

[gameplay]/internetradio/handle_radio/CHandleRadio.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,4 +328,4 @@ function clearSpeakersOnDestroyQuit()
328328
clearPlayerSpeaker(source)
329329
end
330330
addEventHandler("onClientPlayerQuit", root, clearSpeakersOnDestroyQuit)
331-
addEventHandler("onClientElementDestroy", resourceRoot, clearSpeakersOnDestroyQuit)
331+
addEventHandler("onClientElementDestroy", resourceRoot, clearSpeakersOnDestroyQuit)

[gameplay]/internetradio/handle_radio/SHandleRadio.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ function destroyAttachedRadioOnVehicleExplodeOrDestroy()
203203
local attachedElementObject = (attachedElementType == "object")
204204

205205
if (attachedElementObject) then
206-
clearPlayerSpeaker(attachedElement)
206+
local boxFound = clearPlayerSpeaker(attachedElement)
207+
208+
if (boxFound) then
209+
break
210+
end
207211
end
208212
end
209213
end

[gameplay]/internetradio/track_name/CRadioTrackName.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ local function toggleSpeakerTrackRender()
1414
local toggleOn = next(NEARBY_SPEAKERS)
1515

1616
if (toggleOn) then
17-
1817
if (speakerTrackRender) then
1918
return false
2019
end
@@ -26,7 +25,6 @@ local function toggleSpeakerTrackRender()
2625
end
2726

2827
if (not toggleOn) then
29-
3028
if (not speakerTrackRender) then
3129
return false
3230
end
@@ -102,7 +100,7 @@ function onClientRenderRadioTrackName()
102100

103101
if (screenX and screenY) then
104102
local textWidth = dxGetTextWidth(trackName, RADIO_TRACK_SCALE, RADIO_TRACK_FONT, trackNameColorCoded)
105-
local textPosX = (screenX - textWidth/2)
103+
local textPosX = (screenX - textWidth / 2)
106104
local textBackgroundPosX = (textPosX - 5)
107105
local textBackgroundPosY = (textWidth + 8)
108106

0 commit comments

Comments
 (0)