diff --git a/ReallifeGamemode.Client/Voice/main.ts b/ReallifeGamemode.Client/Voice/main.ts index b3dd6ce1..900a057a 100644 --- a/ReallifeGamemode.Client/Voice/main.ts +++ b/ReallifeGamemode.Client/Voice/main.ts @@ -4,7 +4,7 @@ * @copyright (c) 2008 - 2019 Life of German */ -export default function voice() { +export default function voice(globalData: GlobalData) { let dictLoaded = false; const Use3d = true; @@ -24,17 +24,19 @@ export default function voice() { mp.events.add('render', () => { - if (!dictLoaded) { - mp.game.graphics.requestStreamedTextureDict("voiceimages", true); - dictLoaded = true; - } + if (globalData.LoggedIn) { + if (!dictLoaded) { + mp.game.graphics.requestStreamedTextureDict("voiceimages", true); + dictLoaded = true; + } - var { x, y } = mp.game.graphics.getScreenActiveResolution(0, 0); + var { x, y } = mp.game.graphics.getScreenActiveResolution(0, 0); - if (!mp.voiceChat.muted) { - mp.game.graphics.drawSprite("voiceimages", "microphone-black-shape", 0.165, 0.952, 0.015, 0.015 * (x / y), 0, 0, 102, 0, 255); - } else { - mp.game.graphics.drawSprite("voiceimages", "microphone-off", 0.165, 0.952, 0.015, 0.015 * (x / y), 0, 255, 51, 51, 255); + if (!mp.voiceChat.muted) { + mp.game.graphics.drawSprite("voiceimages", "microphone-black-shape", 0.165, 0.952, 0.015, 0.015 * (x / y), 0, 0, 102, 0, 255); + } else { + mp.game.graphics.drawSprite("voiceimages", "microphone-off", 0.165, 0.952, 0.015, 0.015 * (x / y), 0, 255, 51, 51, 255); + } } }) diff --git a/ReallifeGamemode.Client/dlcpacks/voiceimages/dlc.rpf b/ReallifeGamemode.Client/dlcpacks/voiceimages/dlc.rpf index 97ce0303..81a9fbcf 100644 Binary files a/ReallifeGamemode.Client/dlcpacks/voiceimages/dlc.rpf and b/ReallifeGamemode.Client/dlcpacks/voiceimages/dlc.rpf differ diff --git a/ReallifeGamemode.Client/index.ts b/ReallifeGamemode.Client/index.ts index 52447420..3b68b547 100644 --- a/ReallifeGamemode.Client/index.ts +++ b/ReallifeGamemode.Client/index.ts @@ -9,11 +9,11 @@ let globalData: GlobalData = { HideGui: false, Interaction: false, InChat: false, - LoggedIn = false + LoggedIn: false }; import voice from './Voice/main'; -voice(); +voice(globalData); import handMoney from './Gui/handmoney' handMoney();