Skip to content

Commit

Permalink
Merge pull request #315 from antond15/ui-fix
Browse files Browse the repository at this point in the history
fix(client/radio): Update UI state when removed from radio
  • Loading branch information
AvarianKnight authored May 1, 2022
2 parents 4e73a11 + 015157f commit 3863673
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions client/module/radio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ function syncRadioData(radioTable, localPlyRadioName)
toggleVoice(tgt, enabled, 'radio')
end
end
sendUIMessage({
radioChannel = radioChannel,
radioEnabled = radioEnabled
})
if GetConvarInt("voice_syncPlayerNames", 0) == 1 then
radioNames[playerServerId] = localPlyRadioName
end
Expand Down Expand Up @@ -63,6 +67,10 @@ function removePlayerFromRadio(plySource)
toggleVoice(tgt, false, 'radio')
end
end
sendUIMessage({
radioChannel = 0,
radioEnabled = radioEnabled
})
radioNames = {}
radioData = {}
playerTargets(MumbleIsPlayerTalking(PlayerId()) and callData or {})
Expand Down Expand Up @@ -90,10 +98,6 @@ function setRadioChannel(channel)
type_check({channel, "number"})
TriggerServerEvent('pma-voice:setPlayerRadio', channel)
radioChannel = channel
sendUIMessage({
radioChannel = channel,
radioEnabled = radioEnabled
})
end

--- exports setRadioChannel
Expand Down

0 comments on commit 3863673

Please sign in to comment.