Replaced Voicechat mute notification with an icon next to the map

This commit is contained in:
Zeuto
2019-05-01 18:30:41 +02:00
parent 819407a817
commit 108edfacdb
3 changed files with 21 additions and 4 deletions

View File

@@ -1,5 +1,3 @@
import playerInteraction from "Interaction/playerinteraction";
/**
* @overview Life of German Reallife - Voice Main main.ts
* @author Zeuto
@@ -8,6 +6,7 @@ import playerInteraction from "Interaction/playerinteraction";
export default function voice() {
let dictLoaded = false;
const Use3d = true;
const UseAutoVolume = false;
const MaxRange = 30.0;
@@ -18,10 +17,27 @@ export default function voice() {
mp.keys.bind(0x73, false, _ => {
mp.voiceChat.muted = !mp.voiceChat.muted;
mp.game.graphics.notify("[" + new Date().toLocaleTimeString() + "] Voice-Chat: " + (!mp.voiceChat.muted ? '~g~aktiviert' : '~r~deaktiviert'));
});
let gX = 0.5;
let gY = 0.5;
mp.events.add('render', () => {
if (!dictLoaded) {
mp.game.graphics.requestStreamedTextureDict("voiceimages", true);
dictLoaded = true;
}
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);
}
})
function addListener(target: PlayerMp) {
listeners.push(target);

Binary file not shown.

View File

@@ -109,6 +109,7 @@ namespace ReallifeGamemode.Server.Commands
{
SaveManager.SaveAllOnSave();
}
#endregion
#region Support
[Command("o", "~m~Benutzung: ~s~/o [Nachricht]", GreedyArg = true)]