Inventory and onlinelist now pre load on login and open without delay on keybind press.

This commit is contained in:
2021-05-02 06:19:15 +02:00
parent 6d675018dc
commit 4bd5e5aa49
8 changed files with 181 additions and 174 deletions

View File

@@ -1,5 +1,4 @@
window.onbeforeunload = () => { window.scrollTo(0, 0); }
$(document).ready(function () { mp.trigger('CEF:PlayerList_Loaded'); });
setPlayerCount = (factionId, value) => {
if (factionId == -1) {
@@ -9,6 +8,21 @@ setPlayerCount = (factionId, value) => {
}
}
function showPlayerList() {
document.getElementsByName("OnlineList")[0].classList.remove("hidden");
mp.events.call("CEF:PlayerList_Loaded");
window.scrollTo(0, 0);
}
function closePlayerList() {
document.getElementsByName("OnlineList")[0].classList.toggle("hidden");
}
function clear_row() {
document.getElementById('players').innerHTML = '';
}
function getFactionNameByFactionId(factionId) {
switch (parseInt(factionId)) {
case 1: return "LSPD";