diff --git a/script.js b/script.js
index b7a159d1..8e55609e 100644
--- a/script.js
+++ b/script.js
@@ -2697,23 +2697,26 @@ function initialize() {
//设定初始的显示设置
//初始化开关
function initializeSwitch(checkbox) {
- //开关设置的快速保存
- function switchFastSave(event) {
- document.body.classList.toggle(this.id, this.checked);
- if (event instanceof Event) localStorage.setItem(cfgPrefix + this.id, Number(this.checked));
- }
if (!checkbox) return;
checkbox.onchange = switchFastSave;
- checkbox.checked = localStorage_getBoolean(cfgPrefix + checkbox.id, true);
+ checkbox.checked = localStorage_getBoolean(cfgPrefix + checkbox.id, Boolean(Number(checkbox.dataset.default ?? 1)));
checkbox.onchange(false);
return checkbox;
}
+ //开关设置的快速保存
+ function switchFastSave(event) {
+ if (!Boolean(Number(this.dataset.noClass)))
+ document.body.classList.toggle(this.id, this.checked);
+ if (event instanceof Event)
+ localStorage.setItem(cfgPrefix + this.id, Number(this.checked));
+ }
const displaySwitchList = Array.from(document.querySelectorAll(".config-display-list .switch-ipt"));
displaySwitchList.push(...[
- // "screenshot-transparent",
- // "change-swap-to-copy",
+ "screenshot-transparent",
+ "change-swap-to-copy",
"use-side-mode",
+ "use-sticky",
].map(id=>document.getElementById(id))
);
displaySwitchList.forEach(initializeSwitch);
@@ -5460,7 +5463,8 @@ function initialize() {
awokenCountLabel.setAttribute(dataAttrName, value);
awokenCountLabel.classList.toggle("full-awoken", value > 0 && value == card?.awakenings?.length);
- reCalculateAbility();
+ editBox.reCalculateAbility(); //重计算三维
+ editBox.refreshLatent(); //刷新潜觉
}
monEditAwokens.forEach(akDom => akDom.onclick = checkAwoken);
@@ -5478,7 +5482,9 @@ function initialize() {
const mSAwokenIcon = monEditOuterAwokensRow.querySelector("#current-super-awoken-icon");
mSAwokenIcon.onclick = function(){
this.setAttribute("data-awoken-icon", 0);
- reCalculateAbility();
+
+ editBox.reCalculateAbility(); //重计算三维
+ editBox.refreshLatent(); //刷新潜觉
}
//3个快速设置this.ipt为自己的value
@@ -5491,8 +5497,9 @@ function initialize() {
//等级
const monEditLv = settingBox.querySelector(".m-level");
monEditLv.onchange = function() {
- reCalculateExp();
- reCalculateAbility();
+ editBox.reCalculateExp();
+ editBox.reCalculateAbility(); //重计算三维
+ editBox.refreshLatent(); //刷新潜觉
};
const monEditLvMin = settingBox.querySelector(".m-level-btn-min");
const monLvExp = settingBox.querySelector(".m-level-exp");
@@ -5555,8 +5562,8 @@ function initialize() {
monEditLatentAllowableDetail.onclick = function(event) {
if (event instanceof Event) localStorage.setItem(cfgPrefix + 'hide-latent', Number(!this.open));
}
- editBox.refreshLatent = function(latent, monid) {//刷新潜觉
- refreshLatent(latent, new Member(monid), monEditLatentUl);
+ editBox.refreshLatent = function() {//刷新潜觉
+ refreshLatent(this.latent, this.getCurrentMember(), monEditLatentUl);
};
const rowSkill = settingBox.querySelector(".row-mon-skill");
@@ -5640,7 +5647,7 @@ function initialize() {
{
editBox.latent.splice(aIdx, 1);
editBox.reCalculateAbility(); //重计算三维
- editBox.refreshLatent(editBox.latent, editBox.mid); //刷新潜觉
+ editBox.refreshLatent(); //刷新潜觉
}
}
monEditLatents.forEach(la => la.onclick = deleteLatent);
@@ -5658,7 +5665,7 @@ function initialize() {
return;
editBox.reCalculateAbility();
- editBox.refreshLatent(editBox.latent, editBox.mid);
+ editBox.refreshLatent();
}
monEditLatentsAllowable.forEach(la => la.onclick = addLatent);
@@ -5697,6 +5704,7 @@ function initialize() {
editBox.reCalculateAbility = reCalculateAbility;
const btnCancel = editBox.querySelector(".button-cancel");
+ const btnClose = editBox.querySelector(".edit-box-title .mask-close");
const btnDone = editBox.querySelector(".button-done");
const btnNull = editBox.querySelector(".button-null");
const btnDelay = editBox.querySelector(".button-delay");
@@ -5706,23 +5714,13 @@ function initialize() {
editBox.memberIdx = [];
editBox.hide();
};
- btnDone.onclick = function() {
- if (parseInt(monEditLv.value, 10) == 0) {
- btnNull.onclick();
- return;
- }
+ btnClose.onclick = btnCancel.onclick;
+ editBox.getCurrentMember = function(){
const mon = editBox.isAssist ? new MemberAssist() : new MemberTeam();
- const [teamIdx, isAssist, memberIdx] = editBox.memberIdx;
- const teamData = formation.teams[teamIdx];
- const teamBigBox = teamBigBoxs[teamIdx];
- const teamBox = teamBigBox.querySelector(".team-box");
-
mon.id = editBox.mid;
const card = mon.card || Cards[0];
const skill = Skills[card.activeSkillId];
-
mon.level = parseInt(monEditLv.value, 10);
-
const mAwokenNumIpt = monEditAwokensRow.querySelector("input[name='awoken-number']:checked");
mon.awoken = mAwokenNumIpt ? parseInt(mAwokenNumIpt.value, 10) : 0;
if (card.superAwakenings.length) //如果支持超觉醒
@@ -5746,7 +5744,19 @@ function initialize() {
if (skillLevelNum < skill.maxLevel) {
mon.skilllevel = skillLevelNum;
}
+ return mon;
+ }
+ btnDone.onclick = function() {
+ if (parseInt(monEditLv.value, 10) == 0) {
+ btnNull.onclick();
+ return;
+ }
+ const [teamIdx, isAssist, memberIdx] = editBox.memberIdx;
+ const teamData = formation.teams[teamIdx];
+ // const teamBigBox = teamBigBoxs[teamIdx];
+ // const teamBox = teamBigBox.querySelector(".team-box");
+ const mon = editBox.getCurrentMember();
teamData[isAssist][memberIdx] = mon;
refreshAll(formation);
@@ -6191,17 +6201,17 @@ function editMember(teamNum, isAssist, indexInTeam) {
const btnDelay = editBox.querySelector(".button-box .button-delay");
if (!isAssist) {
editBox.latent = mon.latent ? mon.latent.concat() : [];
- editBox.refreshLatent(editBox.latent, mon.id);
}
rowMonLatent.classList.toggle(className_displayNone, isAssist);;
editBoxTitle.classList.toggle("edit-box-title-assist", isAssist);;
btnDelay.classList.toggle(className_displayNone, !isAssist);;
-
- editBox.reCalculateExp();
+
if (mon.awoken !== undefined && monEditAwokens[mon.awoken])
monEditAwokens[mon.awoken].click(); //涉及到觉醒数字的显示,所以需要点一下
- else
- editBox.reCalculateAbility();
+
+ editBox.reCalculateExp();
+ editBox.reCalculateAbility();
+ editBox.refreshLatent();
//自动选中ID狂,以方便修改
//monstersID.focus();
@@ -6360,6 +6370,7 @@ function editBoxChangeMonId(id) {
// }
// }
editBox.reCalculateAbility();
+ editBox.refreshLatent(); //刷新潜觉
}
//怪物没有超觉醒时隐藏超觉醒
const monEditCurrentSAwokenRow = monEditOuterAwokensRow.querySelector(".current-super-awoken");
@@ -6493,7 +6504,7 @@ function editBoxChangeMonId(id) {
//去除所有不能再打的潜觉
editBox.latent = editBox.latent.filter(lat => allowLatent.includes(lat));
- editBox.refreshLatent(editBox.latent, id);
+ editBox.refreshLatent();
editBox.reCalculateExp();
editBox.reCalculateAbility();
}
diff --git a/service-worker.js b/service-worker.js
index d338b175..4b2b792f 100644
--- a/service-worker.js
+++ b/service-worker.js
@@ -48267,7 +48267,7 @@ const cachesMap = new Map([
],
[
"multi.html",
- "464f3861e773979998d6fb98428af666"
+ "4dc8cd2afb23f7b42f7796bd88365a8e"
],
[
"script-custom_elements.js",
@@ -48287,11 +48287,11 @@ const cachesMap = new Map([
],
[
"script.js",
- "b471d517217cef5c4ea2459cfae21b28"
+ "ce3ec6865c12a5415c589d8d1bfbfaae"
],
[
"solo.html",
- "7430477da7cf8ff47951400f7152b8a1"
+ "a9bca8e47616043f5c62851d3dc456e1"
],
[
"style-fix-html2canvas.css",
@@ -48303,7 +48303,7 @@ const cachesMap = new Map([
],
[
"style.css",
- "9fe95f6bea2b9f29d1157cb6a625a4c6"
+ "5e09384e7d8e3bfd20885455bacc2c7a"
],
[
"temp.js",
@@ -48311,11 +48311,11 @@ const cachesMap = new Map([
],
[
"triple.html",
- "ab8237be0d312096c54ed25859aa02fa"
+ "4cf1fb7c421aa5ec74b2610bdb1878bf"
],
[
"languages/en.css",
- "44feff889ee52648f53d2af42e99f78e"
+ "c1d5aca45b5b4379a2a553070b8852e9"
],
[
"languages/en.js",
@@ -48323,7 +48323,7 @@ const cachesMap = new Map([
],
[
"languages/ja.css",
- "9a6f16441b0e47be39d397e9e6a5e296"
+ "9435ea1636e9a8389502a7ce07d23caa"
],
[
"languages/ja.js",
@@ -48331,7 +48331,7 @@ const cachesMap = new Map([
],
[
"languages/ko.css",
- "c0b7a6ffbe89d0936733c1214f99b5ae"
+ "9f2052af52e181a383c3ea25477649fd"
],
[
"languages/ko.js",
@@ -48343,7 +48343,7 @@ const cachesMap = new Map([
],
[
"languages/zh-hans.css",
- "46bfd4418135b078788094f749e33373"
+ "e236d607e29f36710817a2a3b27a5c8a"
],
[
"languages/zh-hans.js",
@@ -48351,7 +48351,7 @@ const cachesMap = new Map([
],
[
"languages/zh-hant.css",
- "6d01e57287e6a77c1511bdc4fcfdce91"
+ "6be62563e13e5263c704432960e2c41e"
],
[
"languages/zh-hant.js",
diff --git a/solo.html b/solo.html
index 95242ba3..682e2eab 100644
--- a/solo.html
+++ b/solo.html
@@ -54,14 +54,15 @@ const teamsCount = 1;
-
-
+
+
-
+
+
@@ -560,7 +561,7 @@ const teamsCount = 1;
-
-
-
-
+
+
-
+
+