Skip to content

Commit

Permalink
v1.5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
lchzh3473 committed Jan 4, 2024
1 parent 4a88264 commit 01bab20
Show file tree
Hide file tree
Showing 22 changed files with 480 additions and 165 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### [1.5.8] - 2024.1.4

#### 优化

- 优化音频组件和路径管理

#### 修复

- 修复无音乐时播放超长谱面报错的问题

### [1.5.7] - 2023.12.2

#### 优化
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sim-phi-vite",
"private": true,
"version": "1.5.7",
"version": "1.5.8",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -20,17 +20,17 @@
"@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-terser": "^0.4.4",
"@stylistic/eslint-plugin": "^1.4.1",
"@types/eslint": "^8.44.7",
"@stylistic/eslint-plugin": "^1.5.1",
"@types/eslint": "^8.56.0",
"@types/md5": "^2.3.5",
"@types/prompts": "^2.4.9",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"eslint": "^8.54.0",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"eslint": "^8.56.0",
"eslint-plugin-rulesdir": "^0.2.2",
"picocolors": "^1.0.0",
"prompts": "^2.4.2",
"typescript": "^5.3.2",
"vite": "^5.0.2"
"typescript": "^5.3.3",
"vite": "^5.0.10"
}
}
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h1 class="title"></h1>
</div>
</div>
<input type="button" value="重置" onclick="location.reload(true)" />
<input type="button" id="btn-rmg" class="hide" value="资源管理" />
<input type="button" id="btn-rmg" value="资源管理" />
<input type="button" id="btn-docs" value="使用说明" />
<input type="button" id="btn-more" value="更多设置" />
<div id="select" class="disabled">
Expand Down
4 changes: 2 additions & 2 deletions scripts/meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.5.7",
"version": "1.5.8",
"pubdate": 1611795955,
"lastupdate": 1701531841
"lastupdate": 1704333812
}
6 changes: 3 additions & 3 deletions src/components/MessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ export abstract class MessageHandler {
let timer = 0;
msgbox.updateHTML = () => {
clearTimeout(timer);
timer = self.setTimeout((() => {
timer = self.setTimeout(() => {
const { pages } = page;
if (page.page > pages) page.page = pages;
const start = (page.page - 1) * page.size;
text.textContent = `${msgbox.code ? `${msgbox.host}: 检测到${msgbox.list.length}${msgbox.name}\n` : ''}来自${msgbox.target}`;
text.textContent = `${msgbox.code ? `${msgbox.host}: 检测到 ${msgbox.list.length}${msgbox.name}\n` : ''}来自 ${msgbox.target}`;
nodePageNum.textContent = String(page.page);
nodePages.textContent = String(pages);
for (const i of nodeBMsg.querySelectorAll('[bm-ctrl]')) (i as HTMLElement).classList.toggle('hide', pages <= 1);
Expand All @@ -131,7 +131,7 @@ export abstract class MessageHandler {
div.append(`${i.name}: ${i.message}`, btnIgnore);
nodeBMsg.appendChild(div);
}
}));
});
};
this.betterMessageBoxes.push(msgbox);
return msgbox;
Expand Down
9 changes: 7 additions & 2 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class Renderer {
public readonly tapholds: NoteExtends[];
// 资源数据
public chart: ChartExtends | null;
public bgMusic: AudioBuffer;
public bgMusic: AudioBuffer | null;
public bgVideo: HTMLVideoElement | null;
private _mirrorType: number;
private initialized: boolean;
Expand Down Expand Up @@ -170,7 +170,7 @@ export class Renderer {
this.enableVP = false;
// chart
this.chart = null;
this.bgMusic = null as unknown as AudioBuffer;
this.bgMusic = null;
this.bgVideo = null;
this.lines = [];
this.notes = [];
Expand Down Expand Up @@ -201,6 +201,11 @@ export class Renderer {
this._setLowResFactor(1);
this.resizeCanvas();
}
public get duration(): number {
if (this.bgMusic) return this.bgMusic.duration;
if (this.chart) return this.chart.maxSeconds + 0.5;
throw new TypeError('Illegal state');
}
// config
public setNoteScale(num = 1): void {
this.noteScale = num;
Expand Down
3 changes: 2 additions & 1 deletion src/external.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-nocheck : allow top level imports, allow ts-noche
import { InteractProxy } from '/utils/interact.js';
import { audio } from '/utils/aup.js';
// import { audio } from '/utils/aup.js';
import { audio } from './utils/AudioTools';
export { InteractProxy, audio };
Loading

0 comments on commit 01bab20

Please sign in to comment.