| @@ -376,7 +376,8 @@ | |||||
| content: "Reset"; | content: "Reset"; | ||||
| } | } | ||||
| .search-box .awoken-clear::before, | .search-box .awoken-clear::before, | ||||
| .search-box .sawoken-clear::before | |||||
| .search-box .sawoken-clear::before, | |||||
| .special-div .special-clear::before | |||||
| { | { | ||||
| content: "Clear"; | content: "Clear"; | ||||
| } | } | ||||
| @@ -386,6 +387,12 @@ | |||||
| .search-box .sawoken-div::before{ | .search-box .sawoken-div::before{ | ||||
| content: "▼Super Awoken (OR)"; | content: "▼Super Awoken (OR)"; | ||||
| } | } | ||||
| .search-box .special-div::before{ | |||||
| content: "▼Special Search"; | |||||
| } | |||||
| .special-div .special-add::before { | |||||
| content: "➕"; | |||||
| } | |||||
| .control-div .search-start::before{ | .control-div .search-start::before{ | ||||
| content: "🔍Start Search"; | content: "🔍Start Search"; | ||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| localTranslating = { | localTranslating = { | ||||
| webpage_title: `P&D ${teamsCount}P Formation Maker`, | webpage_title: `P&D ${teamsCount}P Formation Maker`, | ||||
| addition_display: "Additional display", | |||||
| title_blank: "Input Formation Title", | title_blank: "Input Formation Title", | ||||
| detail_blank: "Input Detail", | detail_blank: "Input Detail", | ||||
| sort_name:{ | sort_name:{ | ||||
| @@ -368,7 +368,8 @@ | |||||
| content: "リセット"; | content: "リセット"; | ||||
| } | } | ||||
| .search-box .awoken-clear::before, | .search-box .awoken-clear::before, | ||||
| .search-box .sawoken-clear::before | |||||
| .search-box .sawoken-clear::before, | |||||
| .special-div .special-clear::before | |||||
| { | { | ||||
| content: "クリア"; | content: "クリア"; | ||||
| } | } | ||||
| @@ -378,6 +379,12 @@ | |||||
| .search-box .sawoken-div::before{ | .search-box .sawoken-div::before{ | ||||
| content: "▼超覚醒(OR)"; | content: "▼超覚醒(OR)"; | ||||
| } | } | ||||
| .search-box .special-div::before{ | |||||
| content: "▼特別な検索"; | |||||
| } | |||||
| .special-div .special-add::before { | |||||
| content: "➕"; | |||||
| } | |||||
| .control-div .search-start::before{ | .control-div .search-start::before{ | ||||
| content: "🔍検索の開始"; | content: "🔍検索の開始"; | ||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| localTranslating = { | localTranslating = { | ||||
| webpage_title: `パズル&ドラゴンズ${teamsCount}人のチーム図作成ツール`, | webpage_title: `パズル&ドラゴンズ${teamsCount}人のチーム図作成ツール`, | ||||
| addition_display: "追加の表示", | |||||
| title_blank: "入力タイトル", | title_blank: "入力タイトル", | ||||
| detail_blank: "入力詳細", | detail_blank: "入力詳細", | ||||
| sort_name:{ | sort_name:{ | ||||
| @@ -365,7 +365,8 @@ | |||||
| content: "재설정"; | content: "재설정"; | ||||
| } | } | ||||
| .search-box .awoken-clear::before, | .search-box .awoken-clear::before, | ||||
| .search-box .sawoken-clear::before | |||||
| .search-box .sawoken-clear::before, | |||||
| .special-div .special-clear::before | |||||
| { | { | ||||
| content: "명확한"; | content: "명확한"; | ||||
| } | } | ||||
| @@ -375,6 +376,12 @@ | |||||
| .search-box .sawoken-div::before{ | .search-box .sawoken-div::before{ | ||||
| content: "▼슈퍼 각성(OR)"; | content: "▼슈퍼 각성(OR)"; | ||||
| } | } | ||||
| .search-box .special-div::before{ | |||||
| content: "▼특별 검색"; | |||||
| } | |||||
| .special-div .special-add::before { | |||||
| content: "➕"; | |||||
| } | |||||
| .control-div .search-start::before{ | .control-div .search-start::before{ | ||||
| content: "🔍검색 시작"; | content: "🔍검색 시작"; | ||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| localTranslating = { | localTranslating = { | ||||
| webpage_title: `퍼즐앤드래곤 ${teamsCount} 명의 팀 다이어그램 작성 도구`, | webpage_title: `퍼즐앤드래곤 ${teamsCount} 명의 팀 다이어그램 작성 도구`, | ||||
| addition_display: "추가 표시입니다", | |||||
| title_blank: "입력 제목", | title_blank: "입력 제목", | ||||
| detail_blank: "입력 내용", | detail_blank: "입력 내용", | ||||
| sort_name:{ | sort_name:{ | ||||
| @@ -6,31 +6,4 @@ | |||||
| { | { | ||||
| font-family: "Microsoft Yahei","Source Han Sans",Arial, Helvetica, sans-serif; | font-family: "Microsoft Yahei","Source Han Sans",Arial, Helvetica, sans-serif; | ||||
| font-weight: bold; | font-weight: bold; | ||||
| } | |||||
| .specialSearch { | |||||
| display: block !important; | |||||
| min-height: 35px; | |||||
| } | |||||
| .specialSearch::before { | |||||
| content: "▼暂时仅中文有的筛选(缺少翻译)"; | |||||
| display: block; | |||||
| } | |||||
| .specialSearch li{ | |||||
| margin-bottom: 5px; | |||||
| margin-right: 3px; | |||||
| } | |||||
| .specialSearch select{ | |||||
| font-size: 20px; | |||||
| } | |||||
| .specialSearch .specialSearch-clear, | |||||
| .specialSearch .specialSearch-add | |||||
| { | |||||
| float: right; | |||||
| padding: 0; | |||||
| } | |||||
| .specialSearch .specialSearch-clear::before { | |||||
| content: "❌"; | |||||
| } | |||||
| .specialSearch .specialSearch-add::before { | |||||
| content: "➕"; | |||||
| } | } | ||||
| @@ -371,7 +371,8 @@ | |||||
| content: "重置"; | content: "重置"; | ||||
| } | } | ||||
| .search-box .awoken-clear::before, | .search-box .awoken-clear::before, | ||||
| .search-box .sawoken-clear::before | |||||
| .search-box .sawoken-clear::before, | |||||
| .special-div .special-clear::before | |||||
| { | { | ||||
| content: "清除"; | content: "清除"; | ||||
| } | } | ||||
| @@ -381,6 +382,12 @@ | |||||
| .search-box .sawoken-div::before{ | .search-box .sawoken-div::before{ | ||||
| content: "▼超覺醒(OR)"; | content: "▼超覺醒(OR)"; | ||||
| } | } | ||||
| .search-box .special-div::before{ | |||||
| content: "▼特殊搜索"; | |||||
| } | |||||
| .special-div .special-add::before { | |||||
| content: "➕"; | |||||
| } | |||||
| .control-div .search-start::before{ | .control-div .search-start::before{ | ||||
| content: "🔍開始搜索"; | content: "🔍開始搜索"; | ||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| localTranslating = { | localTranslating = { | ||||
| webpage_title: `龍族拼圖${teamsCount}人隊伍圖製作工具`, | webpage_title: `龍族拼圖${teamsCount}人隊伍圖製作工具`, | ||||
| addition_display: "附加顯示", | |||||
| title_blank: "輸入隊伍標題", | title_blank: "輸入隊伍標題", | ||||
| detail_blank: "輸入說明", | detail_blank: "輸入說明", | ||||
| sort_name:{ | sort_name:{ | ||||
| @@ -371,7 +371,8 @@ | |||||
| content: "重置"; | content: "重置"; | ||||
| } | } | ||||
| .search-box .awoken-clear::before, | .search-box .awoken-clear::before, | ||||
| .search-box .sawoken-clear::before | |||||
| .search-box .sawoken-clear::before, | |||||
| .special-div .special-clear::before | |||||
| { | { | ||||
| content: "清除"; | content: "清除"; | ||||
| } | } | ||||
| @@ -381,6 +382,12 @@ | |||||
| .search-box .sawoken-div::before{ | .search-box .sawoken-div::before{ | ||||
| content: "▼超觉醒(OR)"; | content: "▼超觉醒(OR)"; | ||||
| } | } | ||||
| .search-box .special-div::before{ | |||||
| content: "▼特殊搜索"; | |||||
| } | |||||
| .special-div .special-add::before { | |||||
| content: "➕"; | |||||
| } | |||||
| .control-div .search-start::before{ | .control-div .search-start::before{ | ||||
| content: "🔍开始搜索"; | content: "🔍开始搜索"; | ||||
| } | } | ||||
| @@ -917,6 +917,13 @@ var formation = new Formation(teamsCount,5); | |||||
| <li class="awoken-count"><input type="checkbox" class="sawoken-check" name="types" value="81" id="search-awoken-81" /><label class="awoken-icon" data-awoken-icon="81" for="search-awoken-81"></label><!--5色--></li> | <li class="awoken-count"><input type="checkbox" class="sawoken-check" name="types" value="81" id="search-awoken-81" /><label class="awoken-icon" data-awoken-icon="81" for="search-awoken-81"></label><!--5色--></li> | ||||
| </ul> | </ul> | ||||
| </div> | </div> | ||||
| <div class="special-div"> | |||||
| <button class="special-add brown-button"></button> | |||||
| <button class="special-clear brown-button"></button> | |||||
| <ul class="special-filter-list"> | |||||
| <li><select class="special-filter"></select></li> | |||||
| </ul> | |||||
| </div> | |||||
| <div class="control-div"><!--控制栏--> | <div class="control-div"><!--控制栏--> | ||||
| <button class="search-start"><!--开始搜索--></button> | <button class="search-start"><!--开始搜索--></button> | ||||
| <button class="search-close"><!--关闭搜索--></button> | <button class="search-close"><!--关闭搜索--></button> | ||||
| @@ -27,6 +27,7 @@ if (location.search.includes('&')) { | |||||
| } | } | ||||
| let localTranslating = { | let localTranslating = { | ||||
| webpage_title: `智龙迷城${teamsCount}人队伍图制作工具`, | webpage_title: `智龙迷城${teamsCount}人队伍图制作工具`, | ||||
| addition_display: "💬", | |||||
| } | } | ||||
| //一开始就加载当前语言 | //一开始就加载当前语言 | ||||
| @@ -2339,6 +2340,53 @@ function initialize() { | |||||
| }); | }); | ||||
| }; | }; | ||||
| //特殊搜索部分 | |||||
| const s_specialDiv = searchBox.querySelector(".special-div"); | |||||
| const specialAdd = s_specialDiv.querySelector(".special-add"); | |||||
| const specialClear = s_specialDiv.querySelector(".special-clear"); | |||||
| const specialFilterUl = s_specialDiv.querySelector(".special-filter-list"); | |||||
| const specialFilterFirstLi = specialFilterUl.querySelector("li"); | |||||
| const specialFirstSelect = specialFilterFirstLi.querySelector(".special-filter"); | |||||
| function newSpecialSearchOption(func, idx1, idx2) | |||||
| { | |||||
| const funcName = returnMonsterNameArr(func, currentLanguage.searchlist, currentDataSource.code)[0]; | |||||
| return new Option(funcName + (func.addition ? "+" + localTranslating.addition_display : ""), idx1 + (idx2 != null ? "|" + idx2 : "")); | |||||
| } | |||||
| specialSearchFunctions.forEach((sfunc,idx)=>{ | |||||
| if (sfunc.group) | |||||
| { | |||||
| console.debug(returnMonsterNameArr(sfunc, currentLanguage.searchlist, currentDataSource.code)) | |||||
| const groupName = returnMonsterNameArr(sfunc, currentLanguage.searchlist, currentDataSource.code)[0]; | |||||
| const optgroup = specialFirstSelect.appendChild(document.createElement("optgroup")); | |||||
| optgroup.label = groupName; | |||||
| if (sfunc.functions) | |||||
| { | |||||
| sfunc.functions.forEach((_sfunc,_idx)=>{ | |||||
| optgroup.appendChild(newSpecialSearchOption(_sfunc, idx, _idx)); | |||||
| }); | |||||
| } | |||||
| }else | |||||
| { | |||||
| specialFirstSelect.options.add(newSpecialSearchOption(sfunc, idx)); | |||||
| } | |||||
| }); | |||||
| specialAdd.onclick = function() | |||||
| { | |||||
| specialFilterUl.appendChild(specialFilterFirstLi.cloneNode(true)); | |||||
| } | |||||
| specialAdd.onclick(); //先运行一次产生两个 | |||||
| specialClear.onclick = function() | |||||
| { | |||||
| /*for (let ci = specialFilterUl.children.length-1; ci>0; ci--) | |||||
| { | |||||
| specialFilterUl.children[ci].remove(); | |||||
| }*/ | |||||
| specialFilterUl.innerHTML = ""; | |||||
| specialFilterUl.appendChild(specialFilterFirstLi); | |||||
| specialFirstSelect.selectedIndex = 0; | |||||
| } | |||||
| const s_controlDiv = searchBox.querySelector(".control-div"); | const s_controlDiv = searchBox.querySelector(".control-div"); | ||||
| const searchStart = s_controlDiv.querySelector(".search-start"); | const searchStart = s_controlDiv.querySelector(".search-start"); | ||||
| const searchClose = s_controlDiv.querySelector(".search-close"); | const searchClose = s_controlDiv.querySelector(".search-close"); | ||||
| @@ -2394,7 +2442,7 @@ function initialize() { | |||||
| showAbilitiesWithAwoken: s_add_show_abilities_with_awoken.checked, | showAbilitiesWithAwoken: s_add_show_abilities_with_awoken.checked, | ||||
| customAddition: typeof customAdditionalFunction == "function" ? | customAddition: typeof customAdditionalFunction == "function" ? | ||||
| [customAdditionalFunction] : | [customAdditionalFunction] : | ||||
| (Array.isArray(customAdditionalFunction) ? customAdditionalFunction : null) | |||||
| (Array.isArray(customAdditionalFunction) ? customAdditionalFunction : []) | |||||
| }; | }; | ||||
| searchMonList.originalHeads = searchArr.map(card => createCardHead(card.id, additionalOption)); | searchMonList.originalHeads = searchArr.map(card => createCardHead(card.id, additionalOption)); | ||||
| searchMonList.customAddition = additionalOption.customAddition; | searchMonList.customAddition = additionalOption.customAddition; | ||||
| @@ -2426,6 +2474,7 @@ function initialize() { | |||||
| s_add_show_abilities_with_awoken.onchange = reShowSearch; | s_add_show_abilities_with_awoken.onchange = reShowSearch; | ||||
| const startSearch = function(cards, customAdditionalFunction) { | const startSearch = function(cards, customAdditionalFunction) { | ||||
| if (customAdditionalFunction == undefined) customAdditionalFunction = []; | |||||
| const attr1Filter = s_attr1s.filter(returnCheckedInput).map(returnInputValue); | const attr1Filter = s_attr1s.filter(returnCheckedInput).map(returnInputValue); | ||||
| const attr2Filter = s_attr2s.filter(returnCheckedInput).map(returnInputValue); | const attr2Filter = s_attr2s.filter(returnCheckedInput).map(returnInputValue); | ||||
| let attr1, attr2; | let attr1, attr2; | ||||
| @@ -2456,7 +2505,7 @@ function initialize() { | |||||
| num: parseInt(btn.getAttribute("data-awoken-count"), 10) | num: parseInt(btn.getAttribute("data-awoken-count"), 10) | ||||
| }; | }; | ||||
| }); | }); | ||||
| const searchResult = searchCards(cards, | |||||
| let searchResult = searchCards(cards, | |||||
| attr1, attr2, | attr1, attr2, | ||||
| s_fixMainColor.checked, | s_fixMainColor.checked, | ||||
| typesFilter, | typesFilter, | ||||
| @@ -2467,7 +2516,20 @@ function initialize() { | |||||
| s_awokensEquivalent.checked, | s_awokensEquivalent.checked, | ||||
| s_includeSuperAwoken.checked | s_includeSuperAwoken.checked | ||||
| ); | ); | ||||
| //console.log("搜索结果", searchResult); | |||||
| //进行特殊附加搜索 | |||||
| const specialFilters = Array.from(specialFilterUl.querySelectorAll(".special-filter")).map(select=>{ | |||||
| const indexs = select.value.split("|").map(Number); | |||||
| const funcObj = indexs.length > 1 ? specialSearchFunctions[indexs[0]].functions[indexs[1]] : specialSearchFunctions[indexs[0]]; | |||||
| return funcObj; | |||||
| }); | |||||
| searchResult = specialFilters.reduce((pre,funcObj)=> | |||||
| { | |||||
| if (!funcObj) return pre; | |||||
| if (funcObj.addition) customAdditionalFunction.push(funcObj.addition); //如果有附加显示,则添加到列表 | |||||
| return funcObj.function(pre); //结果进一步筛选 | |||||
| }, searchResult); | |||||
| showSearch(searchResult, customAdditionalFunction); | showSearch(searchResult, customAdditionalFunction); | ||||
| }; | }; | ||||
| searchBox.startSearch = startSearch; | searchBox.startSearch = startSearch; | ||||
| @@ -2488,6 +2550,7 @@ function initialize() { | |||||
| awokenClear.onclick(); | awokenClear.onclick(); | ||||
| sawokenClear.onclick(); | sawokenClear.onclick(); | ||||
| specialClear.onclick(); | |||||
| searchMonList.originalHeads = null; | searchMonList.originalHeads = null; | ||||
| searchResultCount.setAttribute("data-search-result-count", 0); | searchResultCount.setAttribute("data-search-result-count", 0); | ||||
| @@ -771,6 +771,13 @@ var formation = new Formation(teamsCount,6); | |||||
| <li class="awoken-count"><input type="checkbox" class="sawoken-check" name="types" value="81" id="search-awoken-81" /><label class="awoken-icon" data-awoken-icon="81" for="search-awoken-81"></label><!--5色--></li> | <li class="awoken-count"><input type="checkbox" class="sawoken-check" name="types" value="81" id="search-awoken-81" /><label class="awoken-icon" data-awoken-icon="81" for="search-awoken-81"></label><!--5色--></li> | ||||
| </ul> | </ul> | ||||
| </div> | </div> | ||||
| <div class="special-div"> | |||||
| <button class="special-add brown-button"></button> | |||||
| <button class="special-clear brown-button"></button> | |||||
| <ul class="special-filter-list"> | |||||
| <li><select class="special-filter"></select></li> | |||||
| </ul> | |||||
| </div> | |||||
| <div class="control-div"><!--控制栏--> | <div class="control-div"><!--控制栏--> | ||||
| <button class="search-start"><!--开始搜索--></button> | <button class="search-start"><!--开始搜索--></button> | ||||
| <button class="search-close"><!--关闭搜索--></button> | <button class="search-close"><!--关闭搜索--></button> | ||||
| @@ -1682,7 +1682,9 @@ icon.inflicts::after | |||||
| } | } | ||||
| .search-box .rare-clear::before, | .search-box .rare-clear::before, | ||||
| .search-box .awoken-clear::before, | .search-box .awoken-clear::before, | ||||
| .search-box .sawoken-clear::before | |||||
| .search-box .sawoken-clear::before, | |||||
| .search-box .special-add::before, | |||||
| .search-box .special-clear::before | |||||
| { | { | ||||
| width: 80px; | width: 80px; | ||||
| background-size: 100px 100px; | background-size: 100px 100px; | ||||
| @@ -1693,7 +1695,9 @@ icon.inflicts::after | |||||
| padding: 0; | padding: 0; | ||||
| vertical-align: top; | vertical-align: top; | ||||
| } | } | ||||
| .search-box .sawoken-clear::before | |||||
| .search-box .sawoken-clear::before, | |||||
| .search-box .special-add::before, | |||||
| .search-box .special-clear::before | |||||
| { | { | ||||
| width: 50px; | width: 50px; | ||||
| font-size: 14px; | font-size: 14px; | ||||
| @@ -1827,6 +1831,15 @@ icon.inflicts::after | |||||
| margin-top: 5px; | margin-top: 5px; | ||||
| } | } | ||||
| .special-filter-list>li{ | |||||
| margin-bottom: 5px; | |||||
| margin-right: 3px; | |||||
| } | |||||
| .special-filter-list select{ | |||||
| font-size: 20px; | |||||
| } | |||||
| .control-div button{ | .control-div button{ | ||||
| font-size: 20px; | font-size: 20px; | ||||
| } | } | ||||
| @@ -1704,6 +1704,13 @@ var formation = new Formation(teamsCount,6); | |||||
| <li class="awoken-count"><input type="checkbox" class="sawoken-check" name="types" value="81" id="search-awoken-81" /><label class="awoken-icon" data-awoken-icon="81" for="search-awoken-81"></label><!--5色--></li> | <li class="awoken-count"><input type="checkbox" class="sawoken-check" name="types" value="81" id="search-awoken-81" /><label class="awoken-icon" data-awoken-icon="81" for="search-awoken-81"></label><!--5色--></li> | ||||
| </ul> | </ul> | ||||
| </div> | </div> | ||||
| <div class="special-div"> | |||||
| <button class="special-add brown-button"></button> | |||||
| <button class="special-clear brown-button"></button> | |||||
| <ul class="special-filter-list"> | |||||
| <li><select class="special-filter"></select></li> | |||||
| </ul> | |||||
| </div> | |||||
| <div class="control-div"><!--控制栏--> | <div class="control-div"><!--控制栏--> | ||||
| <button class="search-start"><!--开始搜索--></button> | <button class="search-start"><!--开始搜索--></button> | ||||
| <button class="search-close"><!--关闭搜索--></button> | <button class="search-close"><!--关闭搜索--></button> | ||||