-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
111 lines (100 loc) · 3.33 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<body style="overflow:hidden;margin:0;">
<div style="margin:10">
<div style="display: inline-block">
<h3>Select osu!.db:</h3>
<input id="file_osudb" type="file" onInput="parseosudb()"></input>
</div>
<div style="display: inline-block">
<h3>Select scores.db:</h3>
<input id="file_scoresdb" type="file" onInput="parsescoresdb()">
</div>
</div>
<div id="table"></div>
</body>
<link href="https://unpkg.com/tabulator-tables@5.0.10/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@5.0.10/dist/js/tabulator.min.js"></script>
<script src="buffer.js"></script>
<script src="osudb.js"></script>
<script src="scoresdb.js"></script>
<script src="util.js"></script>
<script>
let scores = null,
beatmaps = null;
let table = new Tabulator("#table", {
height:"100%",
columns:[
{title:"Player", field:"Player", sorter:"string"},
{title:"SR", field:"SR", sorter:"number"},
{title:"FC", field:"FC", sorter:"string"},
{title:"Combo", field:"Combo", sorter:"number"},
{title:"Acc", field:"Acc", sorter:"number"},
{title:"300", field:"300", sorter:"number"},
{title:"100", field:"100", sorter:"number"},
{title:"50", field:"50", sorter:"number"},
{title:"Geki", field:"Geki", sorter:"number"},
{title:"Katu", field:"Katu", sorter:"number"},
{title:"Miss", field:"Miss", sorter:"number"},
{title:"Score", field:"Score", sorter:"number"},
{title:"Mode", field:"Mode", sorter:"string"},
{title:"Mods", field:"Mods", sorter:"string"},
{title:"BeatmapID", field:"BeatmapID", sorter:"number"},
{title:"Mapname", field:"Mapname", sorter:"string"},
{title:"Difficulty", field:"Difficulty", sorter:"string"},
{title:"Link", field:"Link", sorter:"string"},
],
});
document.body.onresize = () => {
table.setHeight(document.body.clientHeight - document.body.children[0].clientHeight - 20);
}
document.body.onresize();
function parseosudb(){
beatmaps = new osudb(document.getElementById("file_osudb").files[0]);
beatmaps.onload = updateTable;
}
function parsescoresdb(){
scores = new scoresdb(document.getElementById("file_scoresdb").files[0]);
scores.onload = updateTable;
}
function updateTable(){
if(scores == null || beatmaps == null)
return;
let bm = {};
let d = [];
let bmh = beatmaps.parseOsuDBHeader();
for(let i = 0; i != bmh.beatmaps; i++){
let r = beatmaps.i;
let f = beatmaps.parseBeatmap();
bm[f.Hash] = r;
}
let q = scores.parseScoresDB().maps;
for(let i = 0; i != q.length; i++){
if(bm[q[i].Hash] != undefined)
for(let j = 0; j != q[i].scores.length; j++){
let b = beatmaps.parseBeatmap(bm[q[i].Hash]);
let s = q[i].scores[j];
d.push({
Player: s.Player,
SR: b.SR[s.Mode][OsuModsSRAffecting(s.Mods)] ?? 0,
FC: s.FullCombo,
Combo: s.Combo,
Acc: OsuAcc(s),
300: s[300],
100: s[100],
50: s[50],
Geki: s.Geki,
Katu: s.Katu,
Miss: s.Miss,
Score: s.Score,
Mode: ["Standard", "Taiko", "CTB", "Mania"][s.Mode],
Mods: OsuModsToString(s.Mods),
BeatmapID: b.ID,
ScoreID: s.ScoreID,
Mapname: b.SongTitle,
Difficulty: b.Difficulty,
Link: "https://osu.ppy.sh/b/" + b.ID
})
}
}
table.setData(d);
}
</script>