Modlama:Mod Uyumluluğu/barchart
Gezinti kısmına atla
Arama kısmına atla
%0 kadarı uyumludur ve çalışan bir alternatifi bulunur. | |
%0 kadarının yakında bir güncellemesi gerçekleşecek. | |
%0 kadarı bozuktur ve açık kaynağı yoktur.¹ |
¹ Bunların çoğu bir Stardew Valley güncellemesi yüzünden bozulmuştur. Bazıları sonradan yapımcıları tarafından güncellenebilir.
Kullanım
Her grup için sayıları listeleyin:
{{/barchart |ok = 135 |workaround = 33 |soon = 56 |broken = 33 |total = 257 }}
Yazılım
Bu yazılım, üst sayfadan çalıştırıldığında şablon çağırma üretir.
(function() {
// group mods by status
let counts = { ok: 0, workaround: 0, soon: 0, broken: 0, total: 0 };
let invalidMods = [];
$("#mod-list .mod").each(function(i, entry) {
entry = $(entry);
let status = entry.attr("data-beta-status") || entry.attr("data-status");
let hasSource = entry.is("[data-github], [data-custom-source]");
switch(status) {
// ignore obsolete mods
case "abandoned":
case "obsolete":
break;
// compatible
case "ok":
case "optional":
counts.ok++;
counts.total++;
break;
// workaround
case "workaround":
case "unofficial":
counts.workaround++;
counts.total++;
break;
// soon/broken
case "broken":
if (hasSource)
counts.soon++;
else
counts.broken++;
counts.total++;
break;
default:
invalidMods.push(mods);
break;
}
});
// show results
if (invalidMods.length) {
console.log("found entries with unknown status:", invalidMods);
throw 'script failed';
}
console.log(`
{{/barchart
|ok = ${counts.ok}
|workaround = ${counts.workaround}
|soon = ${counts.soon}
|broken = ${counts.broken}
|total = ${counts.total}
}}
`.replace(/^ /mg, ''));
})();