新增怪物id输入时即时变化的开关

This commit is contained in:
枫谷剑仙 2021-04-06 19:31:28 +08:00
parent 3c7c372521
commit b92051ccf7
10 changed files with 51 additions and 8 deletions

View File

@ -415,6 +415,10 @@
{
content: "⛓Evo Search";
}
.real-time-change-card-label::after
{
content: "Real-Time change card";
}
.base .evo-type::before,
.base .evo-type::after
{

View File

@ -407,6 +407,10 @@
{
content: "⛓️進化サーチ";
}
.real-time-change-card-label::after
{
content: "カードを即座に更新します";
}
.base .evo-type::before,
.base .evo-type::after
{

View File

@ -404,6 +404,10 @@
{
content: "⛓️진화 계통";
}
.real-time-change-card-label::after
{
content: "카드를 즉시 업데이트합니다";
}
.base .evo-type::before,
.base .evo-type::after
{

View File

@ -410,6 +410,10 @@
{
content: "⛓️進化鏈";
}
.real-time-change-card-label::after
{
content: "即時更新卡片";
}
.base .evo-type::before,
.base .evo-type::after
{

View File

@ -409,6 +409,10 @@
{
content: "⛓️进化链";
}
.real-time-change-card-label::after
{
content: "即时更新卡片";
}
.base .evo-type::before,
.base .evo-type::after
{

View File

@ -672,7 +672,7 @@ var formation = new Formation(teamsCount,5);
</div>
<div class="awoken-option">
<input type="checkbox" class="config-checkbox-ipt" name="consider-equivalent-awoken" id="consider-equivalent-awoken" checked><label class="config-checkbox-lbl consider-equivalent-awoken-label" for="consider-equivalent-awoken"><div class="config-checkbox-lbl-cicle"></div></label>
<input type="checkbox" class="config-checkbox-ipt" name="include-super-awoken" id="include-super-awoken"><label class="config-checkbox-lbl include-super-awoken-label" for="include-super-awoken"><div class="config-checkbox-lbl-cicle"></div></label>
<input type="checkbox" class="config-checkbox-ipt" name="include-super-awoken" id="include-super-awoken"><label class="config-checkbox-lbl include-super-awoken-label" for="include-super-awoken"><div class="config-checkbox-lbl-cicle"></div></label>
<input type="checkbox" class="config-checkbox-ipt" name="show-official-awoken-sorting" id="show-official-awoken-sorting"><label class="config-checkbox-lbl show-official-awoken-sorting-label" for="show-official-awoken-sorting"><div class="config-checkbox-lbl-cicle"></div></label>
<ul class="awoken-ul selected-awokens">
</ul>
@ -892,6 +892,7 @@ var formation = new Formation(teamsCount,5);
</div>
<div class="setting-box">
<div class="setting-row row-mon-id">
<input type="checkbox" class="config-checkbox-ipt" name="real-time-change-card" id="real-time-change-card"><label class="config-checkbox-lbl real-time-change-card-label" for="real-time-change-card"><div class="config-checkbox-lbl-cicle"></div></label>
<button class="open-evolutionary-tree"></button>
<button class="open-search"></button><!--搜索怪物按钮-->
<input type="search" class="m-id" list="monsters-name-list"/><button class="search-by-string"></button>

View File

@ -1436,6 +1436,14 @@ function initialize() {
const openEvolutionaryTree = settingBox.querySelector(".row-mon-id .open-evolutionary-tree");
openEvolutionaryTree.onclick = function() {evolutionaryTreeMask.show(editBox.mid)};
//输入id数字即时更新的开关
const realTimeClassName = 'real-time-change-card';
const s_realTimeChangeCard = settingBox.querySelector(`#${realTimeClassName}`);
s_realTimeChangeCard.onchange = function() {
localStorage.setItem("PADDF-" + realTimeClassName, this.checked ? 1 : 0);
}
s_realTimeChangeCard.checked = Boolean(parseInt(localStorage.getItem("PADDF-" + realTimeClassName)));
const searchOpen = settingBox.querySelector(".row-mon-id .open-search");
searchOpen.onclick = function() {
s_includeSuperAwoken.onchange();
@ -1823,7 +1831,7 @@ function initialize() {
//id搜索
const monstersID = settingBox.querySelector(".row-mon-id .m-id");
const btnSearchByString = settingBox.querySelector(".row-mon-id .search-by-string");
monstersID.onchange = function(e)
function idChange(e)
{
if (/^\d+$/.test(this.value)) {
const newId = parseInt(this.value, 10);
@ -1854,7 +1862,14 @@ function initialize() {
return false;
}
}
monstersID.oninput = monstersID.onchange;
monstersID.onchange = idChange;
monstersID.oninput = function(e)
{
if (s_realTimeChangeCard.checked)
{
idChange.call(this,e);
}
};
monstersID.onkeydown = function(e) {
//如果键入回车,则执行字符串搜索
if (e.key == "Enter")
@ -2699,9 +2714,6 @@ function editBoxChangeMonId(id) {
mAltName.classList.add(className_displayNone);
}
const evoCardUl = settingBox.querySelector(".row-mon-id .evo-card-list");
evoCardUl.classList.add(className_displayNone);
evoCardUl.innerHTML = ""; //据说直接清空HTML性能更好
const evoLinkCardsIdArray = Cards.filter(m=>m.evoRootId == card.evoRootId).map(m=>m.id); //筛选出相同进化链的
@ -2743,6 +2755,9 @@ function editBoxChangeMonId(id) {
evoLinkCardsIdArray.sort((a,b)=>a-b);
const createCardHead = editBox.createCardHead;
const evoCardUl = settingBox.querySelector(".row-mon-id .evo-card-list");
evoCardUl.classList.add(className_displayNone);
evoCardUl.innerHTML = ""; //据说直接清空HTML性能更好
const openEvolutionaryTree = settingBox.querySelector(".row-mon-id .open-evolutionary-tree");
if (evoLinkCardsIdArray.length > 1) {
fragment = document.createDocumentFragment(); //创建节点用的临时空间
@ -2755,10 +2770,10 @@ function editBoxChangeMonId(id) {
});
evoCardUl.appendChild(fragment);
evoCardUl.classList.remove(className_displayNone);
openEvolutionaryTree.classList.remove(className_displayNone);
openEvolutionaryTree.classList.remove(className_displayNone); //显示进化树按钮
}else
{
openEvolutionaryTree.classList.add(className_displayNone);
openEvolutionaryTree.classList.add(className_displayNone); //隐藏进化树按钮
}
const mType = monInfoBox.querySelectorAll(".monster-type li");

View File

@ -772,6 +772,7 @@ var formation = new Formation(teamsCount,6);
</div>
<div class="setting-box">
<div class="setting-row row-mon-id">
<input type="checkbox" class="config-checkbox-ipt" name="real-time-change-card" id="real-time-change-card"><label class="config-checkbox-lbl real-time-change-card-label" for="real-time-change-card"><div class="config-checkbox-lbl-cicle"></div></label>
<button class="open-evolutionary-tree"></button>
<button class="open-search"></button><!--搜索怪物按钮-->
<input type="search" class="m-id" list="monsters-name-list"/><button class="search-by-string"></button>

View File

@ -1771,6 +1771,11 @@ icon.inflicts::after
{
opacity: 1;
}
.setting-box .row-mon-id .real-time-change-card-label
{
margin-right: 0;
margin-left: 5px;
}
.setting-box .row-mon-id .open-search{
float: right;
}

View File

@ -1629,6 +1629,7 @@ var formation = new Formation(teamsCount,6);
</div>
<div class="setting-box">
<div class="setting-row row-mon-id">
<input type="checkbox" class="config-checkbox-ipt" name="real-time-change-card" id="real-time-change-card"><label class="config-checkbox-lbl real-time-change-card-label" for="real-time-change-card"><div class="config-checkbox-lbl-cicle"></div></label>
<button class="open-evolutionary-tree"></button>
<button class="open-search"></button><!--搜索怪物按钮-->
<input type="search" class="m-id" list="monsters-name-list"/><button class="search-by-string"></button>