Replaced Voicechat mute notification with an icon next to the map
This commit is contained in:
@@ -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);
|
||||
|
||||
BIN
ReallifeGamemode.Client/dlcpacks/voiceimages/dlc.rpf
Normal file
BIN
ReallifeGamemode.Client/dlcpacks/voiceimages/dlc.rpf
Normal file
Binary file not shown.
@@ -109,6 +109,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
{
|
||||
SaveManager.SaveAllOnSave();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Support
|
||||
[Command("o", "~m~Benutzung: ~s~/o [Nachricht]", GreedyArg = true)]
|
||||
|
||||
Reference in New Issue
Block a user