2022-06-20 00:38:09 +00:00
|
|
|
import {statusElement} from "/scripts/interface/game/html.js"
|
|
|
|
|
2022-06-20 00:18:47 +00:00
|
|
|
export function updateConnectionStatus(connection) {
|
2022-06-20 00:38:09 +00:00
|
|
|
statusElement.textContent = `Server Connection: ${connection}`
|
2022-06-20 00:18:47 +00:00
|
|
|
switch (connection) {
|
|
|
|
case "connected":
|
2022-06-20 00:38:09 +00:00
|
|
|
statusElement.style.color = "green";
|
2022-06-20 00:18:47 +00:00
|
|
|
break;
|
|
|
|
case "disconnected":
|
2022-06-20 00:38:09 +00:00
|
|
|
statusElement.style.color = "red";
|
2022-06-20 00:18:47 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|