feat: update with 1.0

This commit is contained in:
2025-10-14 23:00:30 +08:00
parent 0a1256b47a
commit c7cda74648
+11 -6
View File
@@ -381,8 +381,8 @@ handlers[1] = (tabNode, containerNode) => {
const list = containerNode.querySelectorAll(`button.btn`);
for (const node of list) {
if (node.id === id) continue;
if (node.querySelector("button.theresmore-helper")) continue;
const name = node.firstChild.textContent;
if (!node.querySelector("button.btn")) {
const button = document.createElement("button");
button.classList.add(
"-bottom-0",
@@ -393,6 +393,7 @@ handlers[1] = (tabNode, containerNode) => {
"rounded-full",
"font-bold",
"text-xs",
"theresmore-helper",
);
button.textContent = "A";
if (blackList.has(name)) {
@@ -415,7 +416,6 @@ handlers[1] = (tabNode, containerNode) => {
};
node.appendChild(button);
}
}
if (containerNode.firstChild.textContent === "ALL") return;
const btn = document.createElement("button");
@@ -569,7 +569,7 @@ handlers[4] = async (tabNode, containerNode) => {
}
}
} else if (currentSubTab.firstChild.textContent === "攻击") {
const chooseBtn = containerNode.querySelector(`button.btn.btn-dark`);
const chooseBtn = containerNode.querySelector(`button.btn:nth-child(2)`);
if (chooseBtn && chooseBtn.firstChild.textContent !== "没有敌人可供攻击") {
if (chooseBtn.lastChild.id !== "auto-attack") {
const btn = document.createElement("button");
@@ -729,8 +729,13 @@ function customFunction(MainStore) {
}
}
function sleep(time) {
return new Promise((resolve) => {
setTimeout(resolve, time);
async function sleep(time) {
let timer;
try {
return await new Promise((resolve) => {
timer = setTimeout(resolve, time);
});
} finally {
return clearTimeout(timer);
}
}