This commit is contained in:
choelzl 2022-02-07 03:55:22 +01:00
parent 736fe8f823
commit c73dffb327
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
2 changed files with 13 additions and 5 deletions

View File

@ -34,8 +34,15 @@
}
});
$.bind('twitchFollow', function(event) {
sendData('follow', event.getFollower());
});
$.bind('twitchSubscriber', function(event) {
sendData('subscribe', event.getSubscriber());
});
$.bind('initReady', function() {
$.registerChatCommand('./custom/custom/customOverlay.js', 'overlay');
$.registerChatCommand('./custom/custom/customOverlay.js', 'overlay', 2);
$.registerChatSubcommand('overlay', 'follow', 2);
$.registerChatSubcommand('overlay', 'subscribe', 2);

View File

@ -39,8 +39,8 @@ $(function () {
$('#follow').text(lastFollow);
$('#subscribe').text(lastSub);
$('#donate').text(lastDonator);
$('#cfollow').parent().closest('div').progressbar({ value : 5.0/parseInt(queryMap.getOrElse('follow',9999))*100 });
$('#csubscribe').parent().closest('div').progressbar({ value : 5.0/parseInt(queryMap.getOrElse('subscribe',9999))*100});
$('#cfollow').parent().closest('div').progressbar({ value : countFollow/parseInt(queryMap.getOrElse('follow',9999))*100 });
$('#csubscribe').parent().closest('div').progressbar({ value : countSub/parseInt(queryMap.getOrElse('subscribe',9999))*100});
$('#cfollow').text(`${countFollow} / ${queryMap.getOrElse('follow',9999)}`);
$('#csubscribe').text(`${countSub} / ${queryMap.getOrElse('subscribe',9999)}`);
}
@ -94,8 +94,9 @@ $(function () {
refreshUI();
})
socket.getDBValue('get_current_stream_info_counts', 'panelData', 'stream', (e)=>{
console.log(e)
console.log(JSON.parse(e.panelData))
let data = JSON.parse(e.panelData);
countFollow = data.followers;
countSub = 0;
})
}
}catch(e) {console.log(e)}