mirror of
https://github.com/DerTyp7/teamspeak-obs-overlay.git
synced 2025-10-29 21:02:10 +01:00
Add options to hide self and non-talking clients
This commit is contained in:
@@ -7,4 +7,6 @@ const CONFIG = {
|
|||||||
fontStrokeSize: "3px",
|
fontStrokeSize: "3px",
|
||||||
fontStrokeColor: "#000000",
|
fontStrokeColor: "#000000",
|
||||||
},
|
},
|
||||||
|
hideSelf: false,
|
||||||
|
hideSilent: false,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ function main() {
|
|||||||
|
|
||||||
clientList.clear();
|
clientList.clear();
|
||||||
channelList.clear();
|
channelList.clear();
|
||||||
|
selfClient = null;
|
||||||
|
|
||||||
ws.onopen = (event) => {
|
ws.onopen = (event) => {
|
||||||
// Send payload to TS5 client
|
// Send payload to TS5 client
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ function drawClients() {
|
|||||||
result = "";
|
result = "";
|
||||||
if (thisClient) {
|
if (thisClient) {
|
||||||
getClientsInChannel(thisClient.channel).forEach((c) => {
|
getClientsInChannel(thisClient.channel).forEach((c) => {
|
||||||
result += `<div class="client-div" style="color:${CONFIG.style.fontColor}; font-size:${CONFIG.style.fontSize}">`;
|
isHidden = CONFIG.hideSilent && c.talkStatus == 0;
|
||||||
|
result += `<div class="client-div" ${isHidden ? "hidden" : ""} style="color:${CONFIG.style.fontColor}; font-size:${CONFIG.style.fontSize}">`;
|
||||||
result += '<div class="client-img-div">';
|
result += '<div class="client-img-div">';
|
||||||
if (c.outputMuted) {
|
if (c.outputMuted) {
|
||||||
result += ' <img src="img/muted_output.svg" />';
|
result += ' <img src="img/muted_output.svg" />';
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ function handleAuthMessage(data) {
|
|||||||
parseClientInfos(data.payload.connections[0].clientInfos)
|
parseClientInfos(data.payload.connections[0].clientInfos)
|
||||||
);
|
);
|
||||||
thisClient = clientList.getById(data.payload.connections[0].clientId);
|
thisClient = clientList.getById(data.payload.connections[0].clientId);
|
||||||
|
|
||||||
|
selfClient = data.payload.connections[0].clientInfos.find((client) => client.id == data.payload.connections[0].clientId);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleClientMoved(data) {
|
function handleClientMoved(data) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ function getClientsInChannel(channel) {
|
|||||||
|
|
||||||
clientList.items.forEach((e) => {
|
clientList.items.forEach((e) => {
|
||||||
if (e.channel) {
|
if (e.channel) {
|
||||||
if (e.channel.id == channel.id) {
|
if (e.channel.id == channel.id && !(CONFIG.hideSelf && selfClient && e.id == selfClient.id)) {
|
||||||
result.push(e);
|
result.push(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user