Fixed voice icon is now only been showed when loggedin
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
* @copyright (c) 2008 - 2019 Life of German
|
* @copyright (c) 2008 - 2019 Life of German
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default function voice() {
|
export default function voice(globalData: GlobalData) {
|
||||||
|
|
||||||
let dictLoaded = false;
|
let dictLoaded = false;
|
||||||
const Use3d = true;
|
const Use3d = true;
|
||||||
@@ -24,17 +24,19 @@ export default function voice() {
|
|||||||
|
|
||||||
mp.events.add('render', () => {
|
mp.events.add('render', () => {
|
||||||
|
|
||||||
if (!dictLoaded) {
|
if (globalData.LoggedIn) {
|
||||||
mp.game.graphics.requestStreamedTextureDict("voiceimages", true);
|
if (!dictLoaded) {
|
||||||
dictLoaded = true;
|
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) {
|
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);
|
mp.game.graphics.drawSprite("voiceimages", "microphone-black-shape", 0.165, 0.952, 0.015, 0.015 * (x / y), 0, 0, 102, 0, 255);
|
||||||
} else {
|
} else {
|
||||||
mp.game.graphics.drawSprite("voiceimages", "microphone-off", 0.165, 0.952, 0.015, 0.015 * (x / y), 0, 255, 51, 51, 255);
|
mp.game.graphics.drawSprite("voiceimages", "microphone-off", 0.165, 0.952, 0.015, 0.015 * (x / y), 0, 255, 51, 51, 255);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -9,11 +9,11 @@ let globalData: GlobalData = {
|
|||||||
HideGui: false,
|
HideGui: false,
|
||||||
Interaction: false,
|
Interaction: false,
|
||||||
InChat: false,
|
InChat: false,
|
||||||
LoggedIn = false
|
LoggedIn: false
|
||||||
};
|
};
|
||||||
|
|
||||||
import voice from './Voice/main';
|
import voice from './Voice/main';
|
||||||
voice();
|
voice(globalData);
|
||||||
|
|
||||||
import handMoney from './Gui/handmoney'
|
import handMoney from './Gui/handmoney'
|
||||||
handMoney();
|
handMoney();
|
||||||
|
|||||||
Reference in New Issue
Block a user