mirror of
https://github.com/DerTyp7/teamspeak-obs-overlay.git
synced 2025-10-29 21:02:10 +01:00
api key now gets stored dureing session
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
const CONFIG = {
|
const CONFIG = {
|
||||||
apiKey: "",
|
|
||||||
remoteAppPort: 5899,
|
remoteAppPort: 5899,
|
||||||
style: {
|
style: {
|
||||||
fontBackground: "rgba(19, 20, 33, 0.5)",
|
fontBackground: "rgba(19, 20, 33, 0.5)",
|
||||||
|
|||||||
13
js/app.js
13
js/app.js
@@ -8,7 +8,7 @@ function main() {
|
|||||||
name: "TS5 OBS Overlay",
|
name: "TS5 OBS Overlay",
|
||||||
description: "A simple OBS overlay for TS5 by DerTyp876",
|
description: "A simple OBS overlay for TS5 by DerTyp876",
|
||||||
content: {
|
content: {
|
||||||
apiKey: CONFIG.apiKey,
|
apiKey: apiKey,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -27,11 +27,7 @@ function main() {
|
|||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case "auth":
|
case "auth":
|
||||||
handleAuthMessage(data);
|
handleAuthMessage(data);
|
||||||
console.log(
|
apiKey = data.payload.apiKey;
|
||||||
"%c --> API-KEY: %s ",
|
|
||||||
"color:red;font-weight:bold;",
|
|
||||||
` ${data.payload.apiKey}`
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
case "clientMoved":
|
case "clientMoved":
|
||||||
handleClientMoved(data);
|
handleClientMoved(data);
|
||||||
@@ -54,15 +50,16 @@ function main() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ws.onerror = (err) => {
|
ws.onerror = (err) => {
|
||||||
console.error(err);
|
console.log(err);
|
||||||
ws.close();
|
ws.close();
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
ws.onclose = (event) => {
|
ws.onclose = (event) => {
|
||||||
console.log("Disconnected: " + event.reason);
|
console.log("Disconnected");
|
||||||
clientList.clear();
|
clientList.clear();
|
||||||
channelList.clear();
|
channelList.clear();
|
||||||
|
console.log(clientList);
|
||||||
drawClients();
|
drawClients();
|
||||||
main(); // Reconnected
|
main(); // Reconnected
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,22 +2,25 @@ function drawClients() {
|
|||||||
let elem = document.getElementById("content");
|
let elem = document.getElementById("content");
|
||||||
|
|
||||||
result = "";
|
result = "";
|
||||||
getClientsInChannel(thisClient.channel).forEach((c) => {
|
if (thisClient) {
|
||||||
result += `<div style="color:${CONFIG.style.fontColor}; font-size:${CONFIG.style.fontSize}">`;
|
getClientsInChannel(thisClient.channel).forEach((c) => {
|
||||||
result += '<div class="content-img">';
|
result += `<div style="color:${CONFIG.style.fontColor}; font-size:${CONFIG.style.fontSize}">`;
|
||||||
if (c.outputMuted) {
|
result += '<div class="content-img">';
|
||||||
result += ' <img src="img/muted_output.svg" />';
|
if (c.outputMuted) {
|
||||||
} else if (c.inputMuted) {
|
result += ' <img src="img/muted_output.svg" />';
|
||||||
result += ' <img src="img/muted_input.svg" />';
|
} else if (c.inputMuted) {
|
||||||
} else if (c.talkStatus == 1) {
|
result += ' <img src="img/muted_input.svg" />';
|
||||||
result += ' <img src="img/on.svg" />';
|
} else if (c.talkStatus == 1) {
|
||||||
} else {
|
result += ' <img src="img/on.svg" />';
|
||||||
result += ' <img src="img/off.svg" />';
|
} else {
|
||||||
}
|
result += ' <img src="img/off.svg" />';
|
||||||
result += "</div>";
|
}
|
||||||
result += `<div class="content-text"
|
result += "</div>";
|
||||||
style="-webkit-text-stroke:${CONFIG.style.fontStrokeSize} ${CONFIG.style.fontStrokeColor};
|
result += `<div class="content-text"
|
||||||
"><p style="background:${CONFIG.style.fontBackground};">${c.name}</p></div></div>`;
|
style="-webkit-text-stroke:${CONFIG.style.fontStrokeSize} ${CONFIG.style.fontStrokeColor};
|
||||||
});
|
"><p style="background:${CONFIG.style.fontBackground};">${c.name}</p></div></div>`;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
elem.innerHTML = result;
|
elem.innerHTML = result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<script src="config.js"></script>
|
<script src="config.js"></script>
|
||||||
<script src="js/objects.js"></script>
|
<script src="js/objects.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
let apiKey = "";
|
||||||
let clientList = new List();
|
let clientList = new List();
|
||||||
let channelList = new List();
|
let channelList = new List();
|
||||||
let thisClient;
|
let thisClient;
|
||||||
|
|||||||
Reference in New Issue
Block a user