Made it say Ready~
This commit is contained in:
parent
4adf3d80a1
commit
4bc23eabc4
1 changed files with 3 additions and 3 deletions
|
@ -418,7 +418,7 @@ window.Umi = { UI: {}, Protocol: { SockChat: { Protocol: {} } } };
|
||||||
const pingIndicator = new MamiPingIndicator;
|
const pingIndicator = new MamiPingIndicator;
|
||||||
const pingToggle = Umi.UI.Toggles.Add('ping', {
|
const pingToggle = Umi.UI.Toggles.Add('ping', {
|
||||||
click: () => alert(pingToggle.title),
|
click: () => alert(pingToggle.title),
|
||||||
}, 'Ready!');
|
}, 'Ready~');
|
||||||
pingToggle.appendChild(pingIndicator.getElement());
|
pingToggle.appendChild(pingIndicator.getElement());
|
||||||
console.log(pingIndicator);
|
console.log(pingIndicator);
|
||||||
|
|
||||||
|
@ -623,8 +623,8 @@ window.Umi = { UI: {}, Protocol: { SockChat: { Protocol: {} } } };
|
||||||
if(dumpEvents) console.log('ping:recv', recv);
|
if(dumpEvents) console.log('ping:recv', recv);
|
||||||
|
|
||||||
let strength = 3;
|
let strength = 3;
|
||||||
if(recv.diff > 1000) --strength;
|
if(recv.diff >= 1000) --strength;
|
||||||
if(recv.diff > 250) --strength;
|
if(recv.diff >= 250) --strength;
|
||||||
|
|
||||||
pingToggle.title = `${recv.diff.toLocaleString()}ms`;
|
pingToggle.title = `${recv.diff.toLocaleString()}ms`;
|
||||||
pingIndicator.setStrength(strength);
|
pingIndicator.setStrength(strength);
|
||||||
|
|
Loading…
Reference in a new issue