Merge pull request #55 from Armored-Dragon/nametag-fixes

Fixed nametags appearing when disabled.
This commit is contained in:
ksuprynowicz 2023-11-26 11:49:18 +01:00 committed by GitHub
commit 96f7d4be23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,7 @@ const logs = (info) => console.log("[NAMETAGS] " + info);
AvatarManager.avatarAddedEvent.connect(reset);
function reset() {
if (!visible) return;
clear();
startup();
}
@ -131,19 +132,6 @@ function scriptEnding() {
tablet.removeButton(tabletButton);
Menu.removeMenuItem("View", "Nametags");
}
function setVisible(visible) {
if (visible !== isVisible) {
isVisible = visible;
if (isVisible) {
startUpdating();
} else {
stopUpdating();
}
if (button) {
button.editProperties({ isActive: isVisible });
}
}
}
function toggleState() {
visible = !visible;