Made it say Ready~

This commit is contained in:
flash 2024-02-29 21:58:01 +00:00
parent 4adf3d80a1
commit 4bc23eabc4

View file

@ -418,7 +418,7 @@ window.Umi = { UI: {}, Protocol: { SockChat: { Protocol: {} } } };
const pingIndicator = new MamiPingIndicator;
const pingToggle = Umi.UI.Toggles.Add('ping', {
click: () => alert(pingToggle.title),
}, 'Ready!');
}, 'Ready~');
pingToggle.appendChild(pingIndicator.getElement());
console.log(pingIndicator);
@ -623,8 +623,8 @@ window.Umi = { UI: {}, Protocol: { SockChat: { Protocol: {} } } };
if(dumpEvents) console.log('ping:recv', recv);
let strength = 3;
if(recv.diff > 1000) --strength;
if(recv.diff > 250) --strength;
if(recv.diff >= 1000) --strength;
if(recv.diff >= 250) --strength;
pingToggle.title = `${recv.diff.toLocaleString()}ms`;
pingIndicator.setStrength(strength);