添加调整录像默认播放速度的选项

This commit is contained in:
copcap 2024-05-07 22:11:46 +08:00
parent 28b5206aa7
commit ca74242a14
No known key found for this signature in database
GPG Key ID: 30E7AB6699451AEE
2 changed files with 25 additions and 1 deletions

View File

@ -2775,7 +2775,7 @@ export const Content = {
if (ui.updateVideoMenu) {
ui.updateVideoMenu();
}
_status.videoDuration = 1;
_status.videoDuration = 1 / parseFloat(lib.config.video_default_play_speed.slice(0, -1));
ui.create.system("返回", function () {
var mode = localStorage.getItem(lib.configprefix + "playbackmode");
if (mode) {
@ -2788,6 +2788,14 @@ export const Content = {
game.playVideo(_status.playback, lib.config.mode);
});
ui.create.system("暂停", ui.click.pause, true).id = "pausebutton";
var atempo = ui.create.system(
"原速",
function () {
_status.videoDuration = 1;
updateDuration();
},
true
);
var slow = ui.create.system(
"减速",
function () {
@ -2805,6 +2813,7 @@ export const Content = {
true
);
var updateDuration = function () {
atempo.innerHTML = `原速(当前${Math.round(100 / _status.videoDuration) / 100}倍速)`;
if (_status.videoDuration > 1) {
slow.classList.add("glow");
} else {
@ -2816,6 +2825,7 @@ export const Content = {
fast.classList.remove("glow");
}
};
updateDuration();
ui.system.style.display = "";
ui.refresh(ui.system);
ui.system.show();

View File

@ -965,6 +965,20 @@ export class Library {
},
unfrequent: true,
},
video_default_play_speed: {
name: "默认录像播放速度",
init: "1x",
intro: "设置播放游戏录像时默认的播放速度",
item: {
"0.25x": "0.25倍速",
"0.5x": "0.5倍速",
"1x": "原速",
"1.5x": "1.5倍速",
"2x": "2倍速",
"4x": "4倍速",
},
unfrequent: true,
},
max_loadtime: {
name: "最长载入时间",
intro: "设置游戏从启动到完成载入所需的最长时间,超过此时间未完成载入会报错,若设备较慢或安装了较多扩展可适当延长此时间",